19.5.2011 Kamil Sedlak

1) bug fix in musrAnalysis.cxx for rotation reference frame causing some memory leak
2) Implementing prompt peak variables and conditions (usefull only for investigations
   of the origin of the prompt peak).
3) Updating the documentation describing changes in point 2)
This commit is contained in:
sedlak 2011-05-19 15:08:01 +00:00
parent ecbc0475dc
commit d1b6c85605
7 changed files with 68 additions and 5 deletions

Binary file not shown.

View File

@ -290,6 +290,14 @@ All events should/have to be (?) saved in the Root tree
Beginning of the pileup interval for the M-counter in $\mu$s. Beginning of the pileup interval for the M-counter in $\mu$s.
\item{\bf PILEUPWINDOWMAX=\emph{value}} \\ \item{\bf PILEUPWINDOWMAX=\emph{value}} \\
End of the pileup interval for the M-counter in $\mu$s. End of the pileup interval for the M-counter in $\mu$s.
\item{\bf PROMPTPEAKMIN=\emph{value}} \\
Beginning of the prompt-peak interval in $\mu$s. This variable is used only for the condition
``{\tt promptPeak}'', ``{\tt promptPeakF}'', etc.\ , and normally does not need to be specified. It becomes useful if
the user wants to investigate, where the prompt-peak originates from (where do the muons,
which give rise to the prompt peak, stop). The default value is -0.01\,$\mu$s.
\item{\bf PROMPTPEAKMAX=\emph{value}} \\
End of the prompt-peak interval in $\mu$s, the default value is 0.01\,$\mu$s. (See comments
for {\tt PROMPTPEAKMIN}.)
\item{\bf MUSRMODE=\emph{string}} \\ \item{\bf MUSRMODE=\emph{string}} \\
Defines the mode of \musr\ experiment -- presently only ``D'', corresponding to Defines the mode of \musr\ experiment -- presently only ``D'', corresponding to
the time differential mode is implemented. the time differential mode is implemented.
@ -400,6 +408,13 @@ All events should/have to be (?) saved in the Root tree
\item[goodEvent\_D\_det\_AND\_pileupEvent] \ldots {\tt goodEvent\_D\_det} and {\tt pileupEvent}. \item[goodEvent\_D\_det\_AND\_pileupEvent] \ldots {\tt goodEvent\_D\_det} and {\tt pileupEvent}.
\item[goodEvent\_L\_det\_AND\_pileupEvent] \ldots {\tt goodEvent\_L\_det} and {\tt pileupEvent}. \item[goodEvent\_L\_det\_AND\_pileupEvent] \ldots {\tt goodEvent\_L\_det} and {\tt pileupEvent}.
\item[goodEvent\_R\_det\_AND\_pileupEvent] \ldots {\tt goodEvent\_R\_det} and {\tt pileupEvent}. \item[goodEvent\_R\_det\_AND\_pileupEvent] \ldots {\tt goodEvent\_R\_det} and {\tt pileupEvent}.
\item[promptPeak] \ldots {\tt goodEvent\_det}, and {\tt PROMPTPEAKMIN < det\_time10 < PROMPTPEAKMAX}.
\item[promptPeakF] \ldots like {\tt goodEvent\_F\_det} and {\tt promptPeak}.
\item[promptPeakB] \ldots like {\tt goodEvent\_B\_det} and {\tt promptPeak}.
\item[promptPeakU] \ldots like {\tt goodEvent\_U\_det} and {\tt promptPeak}.
\item[promptPeakD] \ldots like {\tt goodEvent\_D\_det} and {\tt promptPeak}.
\item[promptPeakL] \ldots like {\tt goodEvent\_L\_det} and {\tt promptPeak}.
\item[promptPeakR] \ldots like {\tt goodEvent\_R\_det} and {\tt promptPeak}.
\end{description} \end{description}
Additional conditions may be implemented on request. Additional conditions may be implemented on request.
\item{\bf draw \emph{histogramName} \emph{conditionID} } \\ \item{\bf draw \emph{histogramName} \emph{conditionID} } \\

View File

@ -41,7 +41,7 @@ int main(int argc,char** argv) {
XInitThreads(); XInitThreads();
G4cout<<"\n\n*************************************************************"<<G4endl; G4cout<<"\n\n*************************************************************"<<G4endl;
G4cout<<" musrSim version 1.0.0 released on 13 May 2011"<<G4endl; G4cout<<" musrSim version 1.0.1 released on 19 May 2011"<<G4endl;
G4cout<<" WWW: http://lmu.web.psi.ch/simulation/index.html"<<G4endl; G4cout<<" WWW: http://lmu.web.psi.ch/simulation/index.html"<<G4endl;
// choose the Random engine // choose the Random engine
// CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); // the /musr/run/randomOption 2 does not work with RanecuEngine // CLHEP::HepRandom::setTheEngine(new CLHEP::RanecuEngine); // the /musr/run/randomOption 2 does not work with RanecuEngine

View File

@ -103,6 +103,8 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
dataWindowMax = 10.0; dataWindowMax = 10.0;
pileupWindowMin = -10.5; pileupWindowMin = -10.5;
pileupWindowMax = 10.5; pileupWindowMax = 10.5;
promptPeakWindowMin = -0.010;
promptPeakWindowMax = 0.010;
musrMode = 'D'; musrMode = 'D';
overallBinDelay = 0; overallBinDelay = 0;
boolInfinitelyLowMuonRate = false; boolInfinitelyLowMuonRate = false;
@ -190,6 +192,14 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
sscanf(&line[strlen("PILEUPWINDOWMAX=")],"%g",&tmpfvar); sscanf(&line[strlen("PILEUPWINDOWMAX=")],"%g",&tmpfvar);
pileupWindowMax = tmpfvar; pileupWindowMax = tmpfvar;
} }
else if (strncmp(tmpString0,"PROMPTPEAKMIN=",strlen("PROMPTPEAKMIN="))==0) {
sscanf(&line[strlen("PROMPTPEAKMIN=")],"%g",&tmpfvar);
promptPeakWindowMin = tmpfvar;
}
else if (strncmp(tmpString0,"PROMPTPEAKMAX=",strlen("PROMPTPEAKMAX="))==0) {
sscanf(&line[strlen("PROMPTPEAKMAX=")],"%g",&tmpfvar);
promptPeakWindowMax = tmpfvar;
}
else if (strncmp(tmpString0,"MUSRMODE=",strlen("MUSRMODE="))==0) { else if (strncmp(tmpString0,"MUSRMODE=",strlen("MUSRMODE="))==0) {
sscanf(&line[strlen("MUSRMODE=")],"%s",&tmpString1); sscanf(&line[strlen("MUSRMODE=")],"%s",&tmpString1);
musrMode = tmpString1[0]; musrMode = tmpString1[0];
@ -222,7 +232,7 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
int nrBinsX, nrBinsY; int nrBinsX, nrBinsY;
float minX, maxX, minY, maxY; float minX, maxX, minY, maxY;
char varXName[500]; char varYName[500]; char varXName[500]; char varYName[500];
char furtherOption[200]; char furtherOption[200]; sprintf(furtherOption,"Undefined");
float rot_ref_frequency, rot_ref_phase; float rot_ref_frequency, rot_ref_phase;
if (strcmp(tmpString0,"musrTH1D")==0) { if (strcmp(tmpString0,"musrTH1D")==0) {
sscanf(&line[endOfHistoTitle+2],"%d %g %g %s %s %g %g",&nrBinsX,&minX,&maxX,varXName,furtherOption,&rot_ref_frequency,&rot_ref_phase); sscanf(&line[endOfHistoTitle+2],"%d %g %g %s %s %g %g",&nrBinsX,&minX,&maxX,varXName,furtherOption,&rot_ref_frequency,&rot_ref_phase);
@ -379,6 +389,13 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
else if (strcmp(conditionNameTMP,"goodEvent_D_det_AND_pileupEvent")==0) conditionMap[iConditionTMP]=&goodEvent_D_det_AND_pileupEvent; else if (strcmp(conditionNameTMP,"goodEvent_D_det_AND_pileupEvent")==0) conditionMap[iConditionTMP]=&goodEvent_D_det_AND_pileupEvent;
else if (strcmp(conditionNameTMP,"goodEvent_L_det_AND_pileupEvent")==0) conditionMap[iConditionTMP]=&goodEvent_L_det_AND_pileupEvent; else if (strcmp(conditionNameTMP,"goodEvent_L_det_AND_pileupEvent")==0) conditionMap[iConditionTMP]=&goodEvent_L_det_AND_pileupEvent;
else if (strcmp(conditionNameTMP,"goodEvent_R_det_AND_pileupEvent")==0) conditionMap[iConditionTMP]=&goodEvent_R_det_AND_pileupEvent; else if (strcmp(conditionNameTMP,"goodEvent_R_det_AND_pileupEvent")==0) conditionMap[iConditionTMP]=&goodEvent_R_det_AND_pileupEvent;
else if (strcmp(conditionNameTMP,"promptPeak")==0) conditionMap[iConditionTMP]=&promptPeak;
else if (strcmp(conditionNameTMP,"promptPeakF")==0) conditionMap[iConditionTMP]=&promptPeakF;
else if (strcmp(conditionNameTMP,"promptPeakB")==0) conditionMap[iConditionTMP]=&promptPeakB;
else if (strcmp(conditionNameTMP,"promptPeakU")==0) conditionMap[iConditionTMP]=&promptPeakU;
else if (strcmp(conditionNameTMP,"promptPeakD")==0) conditionMap[iConditionTMP]=&promptPeakD;
else if (strcmp(conditionNameTMP,"promptPeakL")==0) conditionMap[iConditionTMP]=&promptPeakL;
else if (strcmp(conditionNameTMP,"promptPeakR")==0) conditionMap[iConditionTMP]=&promptPeakR;
else { else {
std::cout<<" !!! ERROR: Condition of the name \""<<conditionNameTMP<<"\" not predefined ==> Add it in the musrAnalysis.cxx S T O P !!!"<<std::endl; std::cout<<" !!! ERROR: Condition of the name \""<<conditionNameTMP<<"\" not predefined ==> Add it in the musrAnalysis.cxx S T O P !!!"<<std::endl;
exit(1); exit(1);
@ -1041,6 +1058,15 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
goodEvent_L_det_AND_pileupEvent = goodEvent_L_det && pileupEvent; goodEvent_L_det_AND_pileupEvent = goodEvent_L_det && pileupEvent;
goodEvent_R_det_AND_pileupEvent = goodEvent_R_det && pileupEvent; goodEvent_R_det_AND_pileupEvent = goodEvent_R_det && pileupEvent;
promptPeak = goodEvent_det && (det_time10>promptPeakWindowMin) && (det_time10<promptPeakWindowMax);
promptPeakF = promptPeak && goodEvent_F_det;
promptPeakB = promptPeak && goodEvent_B_det;
promptPeakU = promptPeak && goodEvent_U_det;
promptPeakD = promptPeak && goodEvent_D_det;
promptPeakL = promptPeak && goodEvent_L_det;
promptPeakR = promptPeak && goodEvent_R_det;
// if (bool_debugingRequired && muonTriggered_det) { // if (bool_debugingRequired && muonTriggered_det) {
// std::cout<<"DEBUG: goodEvent_det: eventID="<<eventID<<std::endl; // std::cout<<"DEBUG: goodEvent_det: eventID="<<eventID<<std::endl;
// if (goodEvent_det) std::cout<<" ___DETECTED___"<<std::endl; // if (goodEvent_det) std::cout<<" ___DETECTED___"<<std::endl;

View File

@ -240,6 +240,13 @@ public :
Bool_t goodEvent_D_det_AND_pileupEvent; Bool_t goodEvent_D_det_AND_pileupEvent;
Bool_t goodEvent_L_det_AND_pileupEvent; Bool_t goodEvent_L_det_AND_pileupEvent;
Bool_t goodEvent_R_det_AND_pileupEvent; Bool_t goodEvent_R_det_AND_pileupEvent;
Bool_t promptPeak;
Bool_t promptPeakF;
Bool_t promptPeakB;
Bool_t promptPeakU;
Bool_t promptPeakD;
Bool_t promptPeakL;
Bool_t promptPeakR;
musrAnalysis(TTree *tree=0); musrAnalysis(TTree *tree=0);
virtual ~musrAnalysis(); virtual ~musrAnalysis();
@ -295,6 +302,8 @@ public :
Double_t dataWindowMax; Double_t dataWindowMax;
Double_t pileupWindowMin; Double_t pileupWindowMin;
Double_t pileupWindowMax; Double_t pileupWindowMax;
Double_t promptPeakWindowMin;
Double_t promptPeakWindowMax;
Long64_t pileupWindowBinMin; Long64_t pileupWindowBinMin;
Long64_t pileupWindowBinMax; Long64_t pileupWindowBinMax;
Long64_t dataWindowBinMin; Long64_t dataWindowBinMin;

View File

@ -143,6 +143,14 @@ Double_t musrTH::GetBinContent1D(Int_t i, Int_t jBin) {
return value; return value;
} }
//============================================================================================== //==============================================================================================
Int_t musrTH::GetXmin1D() {
return int(histArray1D[0]->GetXaxis()->GetXmin());
}
//==============================================================================================
Int_t musrTH::GetXmax1D() {
return int(histArray1D[0]->GetXaxis()->GetXmax());
}
//==============================================================================================
Int_t musrTH::GetNbinsX1D() { Int_t musrTH::GetNbinsX1D() {
return histArray1D[0]->GetNbinsX(); return histArray1D[0]->GetNbinsX();
} }
@ -171,7 +179,8 @@ void musrTH::FillHumanDecayArray(musrTH* decayMapHistos, humanDecayMapType myMap
} }
// // if (iHumanBinForAllTheRest != -1) { // // if (iHumanBinForAllTheRest != -1) {
for (Int_t j=1; j<= (decayMapHistos->GetNbinsX1D()); j++) { // for (Int_t j=1; j<= (decayMapHistos->GetNbinsX1D()); j++) {
for (Int_t j=(decayMapHistos->GetXmin1D()); j<= (decayMapHistos->GetXmax1D()); j++) {
Double_t value = decayMapHistos->GetBinContent1D(i,j); Double_t value = decayMapHistos->GetBinContent1D(i,j);
Bool_t thisBinWasAssigned=false; Bool_t thisBinWasAssigned=false;
if (value!=0) { if (value!=0) {
@ -180,8 +189,10 @@ void musrTH::FillHumanDecayArray(musrTH* decayMapHistos, humanDecayMapType myMap
if (iDecayHistoBin==j) thisBinWasAssigned=true; if (iDecayHistoBin==j) thisBinWasAssigned=true;
} }
} }
if ((!thisBinWasAssigned)&&(value!=0)) { if ((!thisBinWasAssigned)&&(value!=0)&&(j!=-1001)) { // in case of pileup histo, -1001 is assigned
std::cout<<"musrHT.cxx: Some muons stoped and decayed in detector no. "<<j<<", but this bin is not assighned to humanDecayHistogram"<<std::endl; // if there was no pileup muon. Avoid printing error in this case.
std::cout<<"musrHT.cxx: "<<value<<" muons stoped and decayed in detector no. "<<j
<<", but this bin is not assigned to humanDecayHistogram "<<i<<std::endl;
// Double_t value2 = histArray1D[i]-> GetBinContent(XXXX); // Double_t value2 = histArray1D[i]-> GetBinContent(XXXX);
} }
} }

View File

@ -34,6 +34,8 @@ public:
// TH1D** GetHistArray1D(std::string& varToBeFilled) {varToBeFilled = variableToBeFilled_X; return histArray1D;} // TH1D** GetHistArray1D(std::string& varToBeFilled) {varToBeFilled = variableToBeFilled_X; return histArray1D;}
TH1D** GetHistArray1D() {return histArray1D;} TH1D** GetHistArray1D() {return histArray1D;}
// TH2D** GetHistArray2D() {return histArray2D;} // TH2D** GetHistArray2D() {return histArray2D;}
Int_t GetXmin1D();
Int_t GetXmax1D();
Int_t GetNbinsX1D(); Int_t GetNbinsX1D();
Int_t GetNbinsX2D(); Int_t GetNbinsX2D();
Int_t GetNbinsY2D(); Int_t GetNbinsY2D();