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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user