9.5.2012 Kamil Sedlak
Several smaller improvements, should not have impact on the simulation.
This commit is contained in:
@ -439,6 +439,7 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
|
||||
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 if (strcmp(conditionNameTMP,"doubleHit")==0) conditionMap[iConditionTMP]=&doubleHit;
|
||||
else {
|
||||
std::cout<<" !!! ERROR: Condition of the name \""<<conditionNameTMP<<"\" not predefined ==> Add it in the musrAnalysis.cxx S T O P !!!"<<std::endl;
|
||||
exit(1);
|
||||
@ -1052,6 +1053,7 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
|
||||
Long64_t timeBin0 = -100000000;
|
||||
Long64_t timeBin1 = -100000000;
|
||||
Long64_t timeBin2 = -100000000;
|
||||
Long64_t timeBinDoubleHit;
|
||||
Int_t kEntry = 0;
|
||||
Int_t posEntry = 0;
|
||||
Int_t idetM = 0;
|
||||
@ -1095,18 +1097,32 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
|
||||
pileup_muDecayPosY = -1000000000;
|
||||
pileup_muDecayPosZ = -1000000000;
|
||||
pileup_muDecayPosR = -1000000000;
|
||||
det_time31 = -1001.;
|
||||
timeBinDoubleHit = -100000000;
|
||||
doubleHit = false;
|
||||
pos_detID = -1.;
|
||||
pos_detID_doubleHit = -1.;
|
||||
Int_t pos_detID_doubleHit_INT = -1;
|
||||
if (mCounterHitExistsForThisEventID) {
|
||||
numberOfGoodMuons++;
|
||||
Long64_t dataBinMin = timeBin0+dataWindowBinMin;
|
||||
Long64_t dataBinMax = timeBin0+dataWindowBinMax;
|
||||
// Long64_t positronBinMax = timeBin0+pileupWindowBinMax+dataWindowBinMin;
|
||||
Long64_t positronBinMax = dataBinMax-dataWindowBinMin; // note that "dataWindowBinMin" is normally negative, i.e. positronBinMax > dataBinMax !!!
|
||||
pCounterHitExistsForThisEventID = PositronCounterHit(eventID,dataBinMin,dataBinMax,positronBinMax,timeBin1,timeBin2,posEntry,idetP,idetP_ID,idetP_edep);
|
||||
pCounterHitExistsForThisEventID = PositronCounterHit(eventID,dataBinMin,dataBinMax,positronBinMax,timeBin1,timeBin2,timeBinDoubleHit,posEntry,idetP,idetP_ID,idetP_edep,pos_detID_doubleHit_INT);
|
||||
pos_detID = Double_t(idetP_ID);
|
||||
pos_detID_doubleHit = Double_t(pos_detID_doubleHit_INT);
|
||||
if (debugEventMap[eventID]>2) {
|
||||
if (pCounterHitExistsForThisEventID) {std::cout<<"FillHistograms: GOOD positron candidate found: timeBin1="<<timeBin1
|
||||
<<", deltat+800="<<timeBin1-timeBin0+800 <<std::endl;}
|
||||
else {std::cout<<"FillHistograms: NO positron candidate found"<<std::endl;}
|
||||
}
|
||||
if ((!pCounterHitExistsForThisEventID)&&(pos_detID_doubleHit_INT!=-1)&&mCounterHitExistsForThisEventID) {
|
||||
doubleHit = true;
|
||||
det_time31 = (timeBinDoubleHit-timeBin1)*tdcresolution;
|
||||
if (pos_detID_doubleHit==pos_detID) {std::cout<<"DOUBLEHIT: pos_detID_doubleHit="<<pos_detID_doubleHit<<"; pos_detID="<<pos_detID<<std::endl;}
|
||||
|
||||
}
|
||||
//cDEL if (pCounterHitExistsForThisEventID) std::cout<<" timeBin1-timeBin2 = "<<timeBin1<<"-"<<timeBin2<<"="<<timeBin1-timeBin2 <<std::endl;
|
||||
//
|
||||
if (pCounterHitExistsForThisEventID&&(posEntry>0)) {
|
||||
@ -1405,7 +1421,7 @@ Double_t musrAnalysis::PreprocessEvent(Long64_t iEn) {
|
||||
//}
|
||||
//
|
||||
//================================================================
|
||||
Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_t dataBinMax, Long64_t positronBinMax, Long64_t& tBin1, Long64_t& tBin2, Int_t& kEntry, Int_t& idetP, Int_t& idetP_ID, Double_t& idetP_edep) {
|
||||
Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_t dataBinMax, Long64_t positronBinMax, Long64_t& tBin1, Long64_t& tBin2, Long64_t& tBinDoubleHit, Int_t& kEntry, Int_t& idetP, Int_t& idetP_ID, Double_t& idetP_edep, Int_t& idetP_ID_doubleHit) {
|
||||
|
||||
if (bool_debugingRequired) {
|
||||
if (debugEventMap[eventID]>4) {std::cout<<"PositronCounterHit: pCounterMap.size()="<<pCounterMap.size()<<std::endl;}
|
||||
@ -1415,6 +1431,8 @@ Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_
|
||||
// Bool_t positronHitFound = false;
|
||||
Bool_t goodPositronFound = false;
|
||||
Int_t positronQuality = 0;
|
||||
// Int_t prev_counterID = 0;
|
||||
// Long64_t prev_time = 0;
|
||||
// std::cout<<"Debug 10------------------------------"<<std::endl;
|
||||
if (musrMode=='D') {
|
||||
// Loop over all positron counters
|
||||
@ -1428,9 +1446,15 @@ Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_
|
||||
if (positronQuality==2) {
|
||||
if (goodPositronFound) {
|
||||
if (debugEventMap[eventID]>3) {std::cout<<"PositronCounterHit: positron candidate killed - double hit in a different counter"<<std::endl;}
|
||||
// std::cout<<"("<<evID<<") Double hit in counters "<<idetP_ID<<", "<<prev_counterID<<"; time bins ="<<tBin1<<", "<<prev_time<<std::endl;
|
||||
// if (idetP_ID_doubleHit == idetP_ID) std::cout<<"DOUBLEHIT idetP_ID_doubleHit = "<<idetP_ID_doubleHit<<"; idetP_ID ="<< idetP_ID<<std::endl;
|
||||
return false; // double hit was found in a different counter
|
||||
}
|
||||
goodPositronFound = true;
|
||||
tBinDoubleHit = tBin1;
|
||||
idetP_ID_doubleHit = idetP_ID;
|
||||
// prev_counterID = idetP_ID;
|
||||
// prev_time = tBin1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1440,6 +1464,7 @@ Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_
|
||||
if (goodPositronFound&&(tBin1<dataBinMax)) return true;
|
||||
}
|
||||
// std::cout<<"Debug 110"<<std::endl;
|
||||
idetP_ID_doubleHit = -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -217,6 +217,8 @@ public :
|
||||
Double_t pos_Theta_MINUS_muDecayPol_Theta360;
|
||||
Double_t pos_Phi_MINUS_muDecayPol_Phi;
|
||||
Double_t pos_Phi_MINUS_muDecayPol_Phi360;
|
||||
Double_t pos_detID;
|
||||
Double_t pos_detID_doubleHit;
|
||||
// Double_t det_time0;
|
||||
// Double_t get_time0;
|
||||
// Double_t det_time1;
|
||||
@ -225,6 +227,7 @@ public :
|
||||
Double_t gen_time10;
|
||||
Double_t det_time10_MINUS_gen_time10;
|
||||
Double_t det_time20;
|
||||
Double_t det_time31;
|
||||
Double_t det_time1_MINUS_muDecayTime;
|
||||
Double_t detP_x;
|
||||
Double_t detP_y;
|
||||
@ -279,6 +282,7 @@ public :
|
||||
Bool_t promptPeakD;
|
||||
Bool_t promptPeakL;
|
||||
Bool_t promptPeakR;
|
||||
Bool_t doubleHit;
|
||||
|
||||
musrAnalysis(TTree *tree=0);
|
||||
virtual ~musrAnalysis();
|
||||
@ -301,7 +305,7 @@ public :
|
||||
virtual void PrintHitsInAllCounters();
|
||||
virtual void InitialiseEvent();
|
||||
virtual Double_t PreprocessEvent(Long64_t iEn);
|
||||
virtual Bool_t PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_t dataBinMax, Long64_t positronBinMax, Long64_t& tBin1, Long64_t& tBin2, Int_t& kEntry, Int_t& idetP, Int_t& idetP_ID, Double_t& idetP_edep);
|
||||
virtual Bool_t PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_t dataBinMax, Long64_t positronBinMax, Long64_t& tBin1, Long64_t& tBin2, Long64_t& tBinDoubleHit, Int_t& kEntry, Int_t& idetP, Int_t& idetP_ID, Double_t& idetP_edep, Int_t& idetP_ID_doubleHit);
|
||||
// virtual Bool_t MuonCounterHit(Int_t evID, Long64_t timeBinMin, Long64_t& timeBin0, Int_t& kEntry, Int_t& idet, Int_t& idetID, Double_t& idetEdep);
|
||||
void CopySubstring(char* inputChar,int iStart,int iEnd,char* outputChar);
|
||||
void MyPrintTree();
|
||||
@ -510,6 +514,8 @@ musrAnalysis::musrAnalysis(TTree *tree)
|
||||
variableMap["pos_Theta_MINUS_muDecayPol_Theta360"]=&pos_Theta_MINUS_muDecayPol_Theta360;
|
||||
variableMap["pos_Phi_MINUS_muDecayPol_Phi"]=&pos_Phi_MINUS_muDecayPol_Phi;
|
||||
variableMap["pos_Phi_MINUS_muDecayPol_Phi360"]=&pos_Phi_MINUS_muDecayPol_Phi360;
|
||||
variableMap["pos_detID"]=&pos_detID;
|
||||
variableMap["pos_detID_doubleHit"]=&pos_detID_doubleHit;
|
||||
// variableMap["det_time0"]=&det_time0;
|
||||
// variableMap["gen_time0"]=&gen_time0;
|
||||
// variableMap["det_time1"]=&det_time1;
|
||||
@ -537,6 +543,7 @@ musrAnalysis::musrAnalysis(TTree *tree)
|
||||
variableMap["pileup_muDecayPosZ"]=&pileup_muDecayPosZ;
|
||||
variableMap["pileup_muDecayPosR"]=&pileup_muDecayPosR;
|
||||
variableMap["det_time20"]=&det_time20;
|
||||
variableMap["det_time31"]=&det_time31;
|
||||
|
||||
testIVar1=0;
|
||||
humanDecayHistograms=NULL;
|
||||
|
Reference in New Issue
Block a user