2.11.2011 Kamil Sedlak
1) Correcting bugs with the (multi)map treatment in routines musrCounter.cxx and musrScintSD.cc - the elements of the (multi)maps were erased in a loop over the (multi)maps, which is wrong. 2) Also the time variation is moved back to "process event" rather then "end of event" in the musrScintSD.cc (is probably more realistic).
This commit is contained in:
parent
f93a3c070b
commit
db0c8f35ee
@ -218,7 +218,14 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
|
|||||||
int ieventToDebug_tmp, iLevelToDebug_tmp;
|
int ieventToDebug_tmp, iLevelToDebug_tmp;
|
||||||
sscanf(&line[0],"%*s %d %d",&ieventToDebug_tmp,&iLevelToDebug_tmp);
|
sscanf(&line[0],"%*s %d %d",&ieventToDebug_tmp,&iLevelToDebug_tmp);
|
||||||
bool_debugingRequired=true;
|
bool_debugingRequired=true;
|
||||||
debugEventMap.insert(std::pair<int,int>(ieventToDebug_tmp,iLevelToDebug_tmp));
|
if (ieventToDebug_tmp>-1) {
|
||||||
|
debugEventMap.insert(std::pair<int,int>(ieventToDebug_tmp,iLevelToDebug_tmp));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (int j=0; j<=-ieventToDebug_tmp;j++) {
|
||||||
|
debugEventMap.insert(std::pair<int,int>(j,iLevelToDebug_tmp));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(tmpString0,"WRITE_OUT_DUMP_FILE")==0) {
|
else if (strcmp(tmpString0,"WRITE_OUT_DUMP_FILE")==0) {
|
||||||
// int clock_channelID_tmp;
|
// int clock_channelID_tmp;
|
||||||
@ -933,7 +940,7 @@ void musrAnalysis::AnalyseEvent(Long64_t iiiEntry) {
|
|||||||
// Loop over several next event and preprocess them (i.e. fill
|
// Loop over several next event and preprocess them (i.e. fill
|
||||||
// them into the lists/maps of the class musrCounter).
|
// them into the lists/maps of the class musrCounter).
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[eventID]>0) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(before \"PreprocessEvent\"_________"<<std::endl;}
|
if (debugEventMap[eventID]>0) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________ \"Preprocessing Event\"_________"<<std::endl;}
|
||||||
}
|
}
|
||||||
while (((iiiEntry>lastPreprocessedEntry)||(((nextUnfilledEventTime-currentTime)<safeTimeWindow))&&(!boolInfinitelyLowMuonRate)) && (lastPreprocessedEntry+1<nentries)) {
|
while (((iiiEntry>lastPreprocessedEntry)||(((nextUnfilledEventTime-currentTime)<safeTimeWindow))&&(!boolInfinitelyLowMuonRate)) && (lastPreprocessedEntry+1<nentries)) {
|
||||||
Double_t deltaT = PreprocessEvent(lastPreprocessedEntry+1);
|
Double_t deltaT = PreprocessEvent(lastPreprocessedEntry+1);
|
||||||
@ -942,7 +949,7 @@ void musrAnalysis::AnalyseEvent(Long64_t iiiEntry) {
|
|||||||
fChain->GetEntry(iiiEntry); InitialiseEvent();
|
fChain->GetEntry(iiiEntry); InitialiseEvent();
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[eventID]>2) PrintHitsInAllCounters();
|
if (debugEventMap[eventID]>2) PrintHitsInAllCounters();
|
||||||
if (debugEventMap[eventID]>1) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(after \"PreprocessEvent\"_________"<<std::endl;}
|
// if (debugEventMap[eventID]>1) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(after \"PreprocessEvent\"_________"<<std::endl;}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop over all interesting "moments", which are:
|
// Loop over all interesting "moments", which are:
|
||||||
@ -959,11 +966,12 @@ void musrAnalysis::AnalyseEvent(Long64_t iiiEntry) {
|
|||||||
// (*it).second->myPrintThisCounter(eventID);
|
// (*it).second->myPrintThisCounter(eventID);
|
||||||
// }
|
// }
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[eventID]>1) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(before \"FillHistograms\"_________"<<std::endl;}
|
if (debugEventMap[eventID]>1) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(\"Filling Histograms\"_________"<<std::endl;}
|
||||||
}
|
}
|
||||||
FillHistograms(iiiEntry);
|
FillHistograms(iiiEntry);
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[eventID]>1) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(after \"FillHistograms\"_________"<<std::endl;}
|
// if (debugEventMap[eventID]>1) {std::cout<<"DEBUGEVENT "<<eventID<<"_________________(after \"FillHistograms\"_________"<<std::endl;}
|
||||||
|
if (debugEventMap[eventID]>1) {std::cout<<"____________________________________________________________________"<<std::endl;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1015,7 +1023,7 @@ void musrAnalysis::RewindAllTimeInfo() {
|
|||||||
//================================================================
|
//================================================================
|
||||||
|
|
||||||
void musrAnalysis::PrintHitsInAllCounters() {
|
void musrAnalysis::PrintHitsInAllCounters() {
|
||||||
std::cout<<"___________________\n";
|
// std::cout<<"___________________\n";
|
||||||
for (counterMapType::const_iterator it = allCounterMap.begin(); it!=allCounterMap.end(); ++it) {
|
for (counterMapType::const_iterator it = allCounterMap.begin(); it!=allCounterMap.end(); ++it) {
|
||||||
(*it).second->myPrintThisCounter(eventID,0);
|
(*it).second->myPrintThisCounter(eventID,0);
|
||||||
}
|
}
|
||||||
@ -1080,6 +1088,10 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
|
|||||||
Long64_t dataBinMin = timeBin0+dataWindowBinMin;
|
Long64_t dataBinMin = timeBin0+dataWindowBinMin;
|
||||||
Long64_t dataBinMax = timeBin0+dataWindowBinMax;
|
Long64_t dataBinMax = timeBin0+dataWindowBinMax;
|
||||||
pCounterHitExistsForThisEventID = PositronCounterHit(eventID,dataBinMin,dataBinMax,timeBin1,timeBin2,posEntry,idetP,idetP_ID,idetP_edep);
|
pCounterHitExistsForThisEventID = PositronCounterHit(eventID,dataBinMin,dataBinMax,timeBin1,timeBin2,posEntry,idetP,idetP_ID,idetP_edep);
|
||||||
|
if (debugEventMap[eventID]>2) {
|
||||||
|
if (pCounterHitExistsForThisEventID) {std::cout<<"FillHistograms: GOOD positron candidate found ("<<timeBin1<<")"<<std::endl;}
|
||||||
|
else {std::cout<<"FillHistograms: NO positron candidate found"<<std::endl;}
|
||||||
|
}
|
||||||
//cDEL if (pCounterHitExistsForThisEventID) std::cout<<" timeBin1-timeBin2 = "<<timeBin1<<"-"<<timeBin2<<"="<<timeBin1-timeBin2 <<std::endl;
|
//cDEL if (pCounterHitExistsForThisEventID) std::cout<<" timeBin1-timeBin2 = "<<timeBin1<<"-"<<timeBin2<<"="<<timeBin1-timeBin2 <<std::endl;
|
||||||
//
|
//
|
||||||
if (pCounterHitExistsForThisEventID&&(posEntry>0)) {
|
if (pCounterHitExistsForThisEventID&&(posEntry>0)) {
|
||||||
@ -1381,7 +1393,7 @@ Double_t musrAnalysis::PreprocessEvent(Long64_t iEn) {
|
|||||||
Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_t dataBinMax, 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& tBin1, Long64_t& tBin2, Int_t& kEntry, Int_t& idetP, Int_t& idetP_ID, Double_t& idetP_edep) {
|
||||||
|
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[eventID]>2) {std::cout<<"DEBUGEVENT:"<<eventID<<"\"PositronCounterHit\": pCounterMap.size()="<<pCounterMap.size()<<std::endl;}
|
if (debugEventMap[eventID]>4) {std::cout<<"PositronCounterHit: pCounterMap.size()="<<pCounterMap.size()<<std::endl;}
|
||||||
}
|
}
|
||||||
if (pCounterMap.empty()) return false;
|
if (pCounterMap.empty()) return false;
|
||||||
|
|
||||||
@ -1393,9 +1405,15 @@ Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_
|
|||||||
// Loop over all positron counters
|
// Loop over all positron counters
|
||||||
for (counterMapType::const_iterator it = pCounterMap.begin(); it!=pCounterMap.end(); ++it) {
|
for (counterMapType::const_iterator it = pCounterMap.begin(); it!=pCounterMap.end(); ++it) {
|
||||||
positronQuality = (it->second)->GetNextGoodPositron(evID,dataBinMin,dataBinMax,tBin1,tBin2,kEntry,idetP,idetP_ID,idetP_edep);
|
positronQuality = (it->second)->GetNextGoodPositron(evID,dataBinMin,dataBinMax,tBin1,tBin2,kEntry,idetP,idetP_ID,idetP_edep);
|
||||||
if (positronQuality==3) return false; // double hit was found in the same counter
|
if (positronQuality==3) { // double hit was found in the same counter
|
||||||
|
if (debugEventMap[eventID]>3) {std::cout<<"PositronCounterHit: positron candidate killed - double hit in the same counter"<<std::endl;}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (positronQuality==2) {
|
if (positronQuality==2) {
|
||||||
if (goodPositronFound) return false; // double hit was found in a different counter
|
if (goodPositronFound) {
|
||||||
|
if (debugEventMap[eventID]>3) {std::cout<<"PositronCounterHit: positron candidate killed - double hit in a different counter"<<std::endl;}
|
||||||
|
return false; // double hit was found in a different counter
|
||||||
|
}
|
||||||
goodPositronFound = true;
|
goodPositronFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,6 +168,8 @@ Bool_t musrCounter::GetNextGoodMuon(Int_t evtID, Long64_t timeBinMin, Long64_t&
|
|||||||
// std::cout<<" musrCounter::GetNextGoodMuon timeBinMin="<<timeBinMin<<std::endl;
|
// std::cout<<" musrCounter::GetNextGoodMuon timeBinMin="<<timeBinMin<<std::endl;
|
||||||
if (hitMap.empty()) return false;
|
if (hitMap.empty()) return false;
|
||||||
if (counterType!='M') {std::cout<<"\n!!! FATAL ERROR !!! musrCounter::GetNextGoodMuon: not the muon counter! ==> S T O P !!!\n"; exit(1);}
|
if (counterType!='M') {std::cout<<"\n!!! FATAL ERROR !!! musrCounter::GetNextGoodMuon: not the muon counter! ==> S T O P !!!\n"; exit(1);}
|
||||||
|
|
||||||
|
std::list<hitMap_TYPE::iterator> it_muon_hits_to_be_deleted;
|
||||||
for (hitMap_TYPE::iterator it = hitMap.begin(); it != hitMap.end(); ++it) {
|
for (hitMap_TYPE::iterator it = hitMap.begin(); it != hitMap.end(); ++it) {
|
||||||
|
|
||||||
Long64_t timeBinOfCount_tmp = it->first;
|
Long64_t timeBinOfCount_tmp = it->first;
|
||||||
@ -178,20 +180,25 @@ Bool_t musrCounter::GetNextGoodMuon(Int_t evtID, Long64_t timeBinMin, Long64_t&
|
|||||||
if (eventNumber!=evtID) continue; // This trigger hit does not correspond to the currently processed event
|
if (eventNumber!=evtID) continue; // This trigger hit does not correspond to the currently processed event
|
||||||
// ==> skip it, because it was already proceesed or will be processed in future
|
// ==> skip it, because it was already proceesed or will be processed in future
|
||||||
numberOfMuonCandidates++;
|
numberOfMuonCandidates++;
|
||||||
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>3) std::cout<<"GetNextGoodMuon: muon candidate found ("<<timeBinOfNextHit<<")"<<std::endl;}
|
||||||
|
|
||||||
// Hit candidate was found. Now check its coincidences and vetos
|
// Hit candidate was found. Now check its coincidences and vetos
|
||||||
Bool_t bool_coincidenceConditions = true;
|
Bool_t bool_coincidenceConditions = true;
|
||||||
for (counterMapType::const_iterator itCounter = koincidenceCounterMap.begin(); itCounter!=koincidenceCounterMap.end(); ++itCounter) {
|
for (counterMapType::const_iterator itCounter = koincidenceCounterMap.begin(); itCounter!=koincidenceCounterMap.end(); ++itCounter) {
|
||||||
if (!( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'M') )) { // no coincidence found ==> skip hit
|
if (!( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'M') )) { // no coincidence found ==> skip hit
|
||||||
if (bool_ignoreUnperfectMuons) hitMap.erase(it);
|
// if (bool_ignoreUnperfectMuons) hitMap.erase(it);
|
||||||
|
if (bool_ignoreUnperfectMuons) it_muon_hits_to_be_deleted.push_back(it);
|
||||||
bool_coincidenceConditions = false;
|
bool_coincidenceConditions = false;
|
||||||
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>3) std::cout<<"GetNextGoodMuon: muon candidate not in koincidence ("<<timeBinOfNextHit<<")"<<std::endl;}
|
||||||
goto MuonCoincidencesChecked;
|
goto MuonCoincidencesChecked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (counterMapType::const_iterator itCounter = vetoCounterMap.begin(); itCounter!=vetoCounterMap.end(); ++itCounter) {
|
for (counterMapType::const_iterator itCounter = vetoCounterMap.begin(); itCounter!=vetoCounterMap.end(); ++itCounter) {
|
||||||
if ( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'M') ) { // coincidence with veto found ==> skip hit
|
if ( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'M') ) { // coincidence with veto found ==> skip hit
|
||||||
if (bool_ignoreUnperfectMuons) hitMap.erase(it);
|
// if (bool_ignoreUnperfectMuons) hitMap.erase(it);
|
||||||
|
if (bool_ignoreUnperfectMuons) it_muon_hits_to_be_deleted.push_back(it);
|
||||||
bool_coincidenceConditions = false;
|
bool_coincidenceConditions = false;
|
||||||
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>3) std::cout<<"GetNextGoodMuon: muon candidate vetoed ("<<timeBinOfNextHit<<")"<<std::endl;}
|
||||||
goto MuonCoincidencesChecked;
|
goto MuonCoincidencesChecked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -199,17 +206,27 @@ Bool_t musrCounter::GetNextGoodMuon(Int_t evtID, Long64_t timeBinMin, Long64_t&
|
|||||||
MuonCoincidencesChecked:
|
MuonCoincidencesChecked:
|
||||||
if (!bool_coincidenceConditions) continue; // This hit does not fulfill coincidence and veto criteria
|
if (!bool_coincidenceConditions) continue; // This hit does not fulfill coincidence and veto criteria
|
||||||
numberOfMuonCandidatesAfterVK++;
|
numberOfMuonCandidatesAfterVK++;
|
||||||
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>3) std::cout<<"GetNextGoodMuon: muon candidate after VK ("<<timeBinOfNextHit<<")"<<std::endl;}
|
||||||
|
|
||||||
if ( CheckForPileupMuons(timeBinOfNextHit) ) {
|
if ( CheckForPileupMuons(timeBinOfNextHit) ) {
|
||||||
// std::cout<<"CheckForPileupMuons=true"<<std::endl;
|
// std::cout<<"CheckForPileupMuons=true"<<std::endl;
|
||||||
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>3) std::cout<<"GetNextGoodMuon: muon candidate killed by pileup muon ("<<timeBinOfNextHit<<")"<<std::endl;}
|
||||||
continue; // This muon candidate is killed due to a double hit rejection.
|
continue; // This muon candidate is killed due to a double hit rejection.
|
||||||
}
|
}
|
||||||
kEntry = (it->second)->eventEntry;
|
kEntry = (it->second)->eventEntry;
|
||||||
idet = (it->second)->det_i;
|
idet = (it->second)->det_i;
|
||||||
idetID = (it->second)->det_id;
|
idetID = (it->second)->det_id;
|
||||||
idetEdep = (it->second)->det_edep;
|
idetEdep = (it->second)->det_edep;
|
||||||
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>1) std::cout<<"GetNextGoodMuon: GOOD muon candidate found ("
|
||||||
|
<<timeBinOfNextHit<<" "<<evtID<<")"<<std::endl;}
|
||||||
|
for(std::list<hitMap_TYPE::iterator>::iterator itt = it_muon_hits_to_be_deleted.begin(); itt != it_muon_hits_to_be_deleted.end(); ++itt) {
|
||||||
|
hitMap.erase(*itt);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
for(std::list<hitMap_TYPE::iterator>::iterator itt = it_muon_hits_to_be_deleted.begin(); itt != it_muon_hits_to_be_deleted.end(); ++itt) {
|
||||||
|
hitMap.erase(*itt);
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,15 +271,16 @@ Int_t musrCounter::GetNextGoodPositron(Int_t evtID, Long64_t timeBinMin, Long64_
|
|||||||
// = 3 ... double hit
|
// = 3 ... double hit
|
||||||
// Loop over the hits in the counter
|
// Loop over the hits in the counter
|
||||||
Int_t positronQuality=0;
|
Int_t positronQuality=0;
|
||||||
if (bool_debugingRequired) {if (debugEventMap[evtID]>4) myPrintThisCounter(evtID);}
|
if (bool_debugingRequired) {if (debugEventMap[evtID]>4) myPrintThisCounter(evtID,0);}
|
||||||
if (hitMap.empty()) return 0;
|
if (hitMap.empty()) return 0;
|
||||||
if (counterType!='P') {std::cout<<"\n!!! FATAL ERROR !!! musrCounter::GetNextGoodPositron: not the positron counter! ==> S T O P !!!\n"; exit(1);}
|
if (counterType!='P') {std::cout<<"\n!!! FATAL ERROR !!! musrCounter::GetNextGoodPositron: not the positron counter! ==> S T O P !!!\n"; exit(1);}
|
||||||
|
std::list<hitMap_TYPE::iterator> it_positron_hits_to_be_deleted;
|
||||||
for (hitMap_TYPE::iterator it = hitMap.begin(); it != hitMap.end(); ++it) {
|
for (hitMap_TYPE::iterator it = hitMap.begin(); it != hitMap.end(); ++it) {
|
||||||
// Int_t eventNumber = (it->second)->eventIDnumber;
|
// Int_t eventNumber = (it->second)->eventIDnumber;
|
||||||
Long64_t timeBinOfCount_tmp = it->first;
|
Long64_t timeBinOfCount_tmp = it->first;
|
||||||
if ((timeBinOfCount_tmp <= timeBinMin) || (timeBinOfCount_tmp > timeBinMax)) {
|
if ((timeBinOfCount_tmp <= timeBinMin) || (timeBinOfCount_tmp > timeBinMax)) {
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[evtID]>3) {std::cout<<"DEBUGEVENT:"<<evtID<<"\"GetNextGoodPositron\": Hit out of data interval"<<std::endl;}
|
if (debugEventMap[evtID]>3) {std::cout<<"GetNextGoodPositron: Hit out of data interval"<<std::endl;}
|
||||||
}
|
}
|
||||||
continue; // This hit is out of the data interval ==> skip it
|
continue; // This hit is out of the data interval ==> skip it
|
||||||
}
|
}
|
||||||
@ -275,9 +293,10 @@ Int_t musrCounter::GetNextGoodPositron(Int_t evtID, Long64_t timeBinMin, Long64_
|
|||||||
}
|
}
|
||||||
if (!( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'P') )) {
|
if (!( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'P') )) {
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[evtID]>3) {std::cout<<"DEBUGEVENT:"<<evtID<<"\"GetNextGoodPositron\": Coincidence required but not found"<<std::endl;}
|
if (debugEventMap[evtID]>3) {std::cout<<"GetNextGoodPositron: Coincidence required but not found (timeBin="<<timeBinOfCount_tmp<<")"<<std::endl;}
|
||||||
}
|
}
|
||||||
if (bool_ignoreUnperfectPositrons) hitMap.erase(it); // no coincidence found ==> remove the candidate.
|
// if (bool_ignoreUnperfectPositrons) hitMap.erase(it); // no coincidence found ==> remove the candidate.
|
||||||
|
if (bool_ignoreUnperfectPositrons) it_positron_hits_to_be_deleted.push_back(it);
|
||||||
bool_coincidenceConditions = false;
|
bool_coincidenceConditions = false;
|
||||||
goto CoincidencesChecked;
|
goto CoincidencesChecked;
|
||||||
// goto endOfThisHit; // no coincidence found ==> skip hit
|
// goto endOfThisHit; // no coincidence found ==> skip hit
|
||||||
@ -286,9 +305,10 @@ Int_t musrCounter::GetNextGoodPositron(Int_t evtID, Long64_t timeBinMin, Long64_
|
|||||||
for (counterMapType::const_iterator itCounter = vetoCounterMap.begin(); itCounter!=vetoCounterMap.end(); ++itCounter) {
|
for (counterMapType::const_iterator itCounter = vetoCounterMap.begin(); itCounter!=vetoCounterMap.end(); ++itCounter) {
|
||||||
if ( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'P') ) {
|
if ( (itCounter->second)->IsInCoincidence(timeBinOfCount_tmp,'P') ) {
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[evtID]>3) {std::cout<<"DEBUGEVENT:"<<evtID<<"\"GetNextGoodPositron\": Coincidence vith veto detector found"<<std::endl;}
|
if (debugEventMap[evtID]>3) {std::cout<<"GetNextGoodPositron: Coincidence vith veto detector found (timeBin="<<timeBinOfCount_tmp<<")"<<std::endl;}
|
||||||
}
|
}
|
||||||
if (bool_ignoreUnperfectPositrons) hitMap.erase(it); // coincidence with veto found ==> remove the candidate.
|
// if (bool_ignoreUnperfectPositrons) hitMap.erase(it); // coincidence with veto found ==> remove the candidate.
|
||||||
|
if (bool_ignoreUnperfectPositrons) it_positron_hits_to_be_deleted.push_back(it);
|
||||||
bool_coincidenceConditions = false;
|
bool_coincidenceConditions = false;
|
||||||
goto CoincidencesChecked;
|
goto CoincidencesChecked;
|
||||||
// goto endOfThisHit; // coincidence with veto found ==> skip hit
|
// goto endOfThisHit; // coincidence with veto found ==> skip hit
|
||||||
@ -297,7 +317,12 @@ Int_t musrCounter::GetNextGoodPositron(Int_t evtID, Long64_t timeBinMin, Long64_
|
|||||||
|
|
||||||
CoincidencesChecked:
|
CoincidencesChecked:
|
||||||
if (!bool_coincidenceConditions) continue; // This hit does not fulfill coincidence and veto criteria
|
if (!bool_coincidenceConditions) continue; // This hit does not fulfill coincidence and veto criteria
|
||||||
if (positronQuality==2) return 3; // An electron was already found before, and now again ==> double hit
|
if (positronQuality==2) {
|
||||||
|
for(std::list<hitMap_TYPE::iterator>::iterator itt = it_positron_hits_to_be_deleted.begin(); itt != it_positron_hits_to_be_deleted.end(); ++itt) {
|
||||||
|
hitMap.erase(*itt);
|
||||||
|
}
|
||||||
|
return 3; // An electron was already found before, and now again ==> double hit
|
||||||
|
}
|
||||||
else positronQuality=2;
|
else positronQuality=2;
|
||||||
|
|
||||||
kEntry = (it->second)->eventEntry;
|
kEntry = (it->second)->eventEntry;
|
||||||
@ -307,9 +332,13 @@ Int_t musrCounter::GetNextGoodPositron(Int_t evtID, Long64_t timeBinMin, Long64_
|
|||||||
timeBinOfNextGoodHit = timeBinOfCount_tmp;
|
timeBinOfNextGoodHit = timeBinOfCount_tmp;
|
||||||
timeBinOfNextGoodHit_phaseShifted = (it->second) -> timeBin2;
|
timeBinOfNextGoodHit_phaseShifted = (it->second) -> timeBin2;
|
||||||
if (bool_debugingRequired) {
|
if (bool_debugingRequired) {
|
||||||
if (debugEventMap[evtID]>3) {std::cout<<"DEBUGEVENT:"<<evtID<<"\"GetNextGoodPositron\": Good positron candidate found in this counter."<<std::endl;}
|
if (debugEventMap[evtID]>3) {std::cout<<"GetNextGoodPositron: Good positron candidate found in this counter. (timeBin="<<timeBinOfCount_tmp<<" "<<(it->second)->eventIDnumber<<")"<<std::endl;}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for(std::list<hitMap_TYPE::iterator>::iterator itt = it_positron_hits_to_be_deleted.begin(); itt != it_positron_hits_to_be_deleted.end(); ++itt) {
|
||||||
|
hitMap.erase(*itt);
|
||||||
|
}
|
||||||
|
|
||||||
return positronQuality;
|
return positronQuality;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -270,9 +270,13 @@ void musrScintSD::ProcessOpticalPhoton(G4Step* aStep) {
|
|||||||
//non-zero efficiency
|
//non-zero efficiency
|
||||||
|
|
||||||
|
|
||||||
|
// Do APD cell variation time if requested. Even if not requested, generate the random numbers in order to
|
||||||
|
// have reproducible simulation.
|
||||||
|
G4double APDcellsTimeVariation = G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
|
||||||
|
if (APDcellsTimeVariationRequested) tmpTime += APDcellsTimeVariation;
|
||||||
|
|
||||||
// If the simulation of the effect of the finite number of cells in APD is requested, find out
|
// If the simulation of the effect of the finite number of cells in APD is requested, find out
|
||||||
// whether a given cell already fired - if so, do not store the photon.
|
// whether a given cell already fired - if so, do not store the photon.
|
||||||
// G4bool APDcellAlreadyFired = false;
|
|
||||||
G4int APDcellID = (APDcellsEffectRequested) ? FindAPDcellID(aStep) : 0;
|
G4int APDcellID = (APDcellsEffectRequested) ? FindAPDcellID(aStep) : 0;
|
||||||
FireAPDcell(optHitDetectorMap,APDcellID,tmpTime);
|
FireAPDcell(optHitDetectorMap,APDcellID,tmpTime);
|
||||||
// if (APDcellsEffectRequested) {
|
// if (APDcellsEffectRequested) {
|
||||||
@ -595,15 +599,15 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() {
|
|||||||
|
|
||||||
// Do APD cell variation time if requested. Even if not requested, generate the random numbers in order to
|
// Do APD cell variation time if requested. Even if not requested, generate the random numbers in order to
|
||||||
// have reproducible simulation.
|
// have reproducible simulation.
|
||||||
for (optHitDetectorMapType::iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) {
|
// for (optHitDetectorMapType::iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) {
|
||||||
G4double APDcellsTimeVariation = G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
|
// G4double APDcellsTimeVariation = G4RandGauss::shoot(0,APDcellsTimeVariationSigma);
|
||||||
if (APDcellsTimeVariationRequested) {
|
// if (APDcellsTimeVariationRequested) {
|
||||||
G4int APDcellID = it2->second;
|
// G4int APDcellID = it2->second;
|
||||||
G4double tmpTime = it2->first + APDcellsTimeVariation;
|
// G4double tmpTime = it2->first + APDcellsTimeVariation;
|
||||||
optHitDetectorMap->erase(it2);
|
// optHitDetectorMap->erase(it2);
|
||||||
optHitDetectorMap->insert(std::pair<G4double,G4int>(tmpTime,APDcellID));
|
// optHitDetectorMap->insert(std::pair<G4double,G4int>(tmpTime,APDcellID));
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Simulate cross talk if requested. Even if not requested, generate the random numbers in order to
|
// Simulate cross talk if requested. Even if not requested, generate the random numbers in order to
|
||||||
// have reproducible simulation.
|
// have reproducible simulation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user