6.10.2011 - Kamil Sedlak

1) Added "tubsbox2" as a new volume in musrDetectorConstruction
  2) Changed the way how the double hits in M-counter and P-counter
     are treated in musrSimAna - this was a very big change which 
     still needs to be cross-checked.
This commit is contained in:
2011-10-06 09:49:51 +00:00
parent 0c995ad9d8
commit 781fb2022c
5 changed files with 123 additions and 58 deletions

View File

@ -218,6 +218,12 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
bool_debugingRequired=true;
debugEventMap.insert(std::pair<int,int>(ieventToDebug_tmp,iLevelToDebug_tmp));
}
else if (strcmp(tmpString0,"USE_UNPERFECT_POSITRONS_IN_DOUBLE_HITS")==0) {
musrCounter::bool_ignoreUnperfectPositrons = false;
}
else if (strcmp(tmpString0,"USE_UNPERFECT_MUONS_IN_DOUBLE_HITS")==0) {
musrCounter::bool_ignoreUnperfectMuons = false;
}
else if (strncmp(tmpString0,"musrTH",strlen("musrTH"))==0) {
// Definition of the histograms - either musrTH1D or musrTH2D
int beginningOfHistoTitle=0, endOfHistoTitle =0;
@ -1007,12 +1013,13 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
Int_t idetP = 0;
Int_t idetP_ID = 0;
Double_t idetP_edep = 0.;
Bool_t doubleHitM = false;
Bool_t doubleHitP = false;
//cks 4.10.2011 Bool_t doubleHitM = false;
//cks 4.10.2011 Bool_t doubleHitP = false;
// std::cout<<" FillHistograms: timeBinOfThePreviouslyProcessedHit = "<<timeBinOfThePreviouslyProcessedHit<<std::endl;
// mCounterHitExistsForThisEventID = mCounter->GetNextGoodHitInThisEvent(eventID,timeBinOfThePreviouslyProcessedHit,0,'M',timeBin0,kEntry,idetM,idetM_ID,idetM_edep,doubleHitM);
mCounterHitExistsForThisEventID = mCounter->GetNextGoodMuon(eventID,timeBinOfThePreviouslyProcessedHit,timeBin0,kEntry,idetM,idetM_ID,idetM_edep,doubleHitM);
// mCounterHitExistsForThisEventID = mCounter->GetNextGoodMuon(eventID,timeBinOfThePreviouslyProcessedHit,timeBin0,kEntry,idetM,idetM_ID,idetM_edep,doubleHitM);
mCounterHitExistsForThisEventID = MuonCounterHit(eventID,timeBinOfThePreviouslyProcessedHit,timeBin0,kEntry,idetM,idetM_ID,idetM_edep);
timeBinOfThePreviouslyProcessedHit = timeBin0;
//___________________________________________________________
@ -1044,7 +1051,7 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
numberOfGoodMuons++;
Long64_t dataBinMin = timeBin0+dataWindowBinMin;
Long64_t dataBinMax = timeBin0+dataWindowBinMax;
pCounterHitExistsForThisEventID = PositronCounterHit(eventID,dataBinMin,dataBinMax,timeBin1,timeBin2,posEntry,idetP,idetP_ID,idetP_edep,doubleHitP);
pCounterHitExistsForThisEventID = PositronCounterHit(eventID,dataBinMin,dataBinMax,timeBin1,timeBin2,posEntry,idetP,idetP_ID,idetP_edep);
//cDEL if (pCounterHitExistsForThisEventID) std::cout<<" timeBin1-timeBin2 = "<<timeBin1<<"-"<<timeBin2<<"="<<timeBin1-timeBin2 <<std::endl;
//
if (pCounterHitExistsForThisEventID&&(posEntry>0)) {
@ -1217,7 +1224,8 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
// Check whether there is a good trigger in the next event
// std::cout<<" FillHistograms: timeBinOfThePreviouslyProcessedHit = "<<timeBinOfThePreviouslyProcessedHit<<std::endl;
// mCounterHitExistsForThisEventID = mCounter->GetNextGoodHitInThisEvent(eventID,timeBinOfThePreviouslyProcessedHit,0,'M',timeBin0,kEntry,idetM,idetM_ID,idetM_edep,doubleHitM);
mCounterHitExistsForThisEventID = mCounter->GetNextGoodMuon(eventID,timeBinOfThePreviouslyProcessedHit,timeBin0,kEntry,idetM,idetM_ID,idetM_edep,doubleHitM);
// mCounterHitExistsForThisEventID = mCounter->GetNextGoodMuon(eventID,timeBinOfThePreviouslyProcessedHit,timeBin0,kEntry,idetM,idetM_ID,idetM_edep,doubleHitM);
mCounterHitExistsForThisEventID = MuonCounterHit(eventID,timeBinOfThePreviouslyProcessedHit,timeBin0,kEntry,idetM,idetM_ID,idetM_edep);
timeBinOfThePreviouslyProcessedHit = timeBin0;
// if (mCounterHitExistsForThisEventID) std::cout<<" YYYYYYYYYYYYYYYYYYY check this : LOOOPING AGAIN"<<std::endl;
oncePerEvent=false;
@ -1355,7 +1363,16 @@ 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& doubleHit) {
Bool_t musrAnalysis::MuonCounterHit(Int_t evID, Long64_t timeBinMin, Long64_t& timeBin0, Int_t& kEntry, Int_t& idet, Int_t& idetID, Double_t& idetEdep) {
Bool_t mCounterHitCanditateExists = mCounter->GetNextGoodMuon(evID,timeBinMin,timeBin0,kEntry,idet,idetID,idetEdep);
if (!mCounterHitCanditateExists) return false;
// Check for other muons within the pileup window:
if ( mCounter->CheckForPileupMuons(timeBin0,kEntry) ) return false; // This muon candidate is killed due to a double hit rejection.
return true;
}
//================================================================
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 (debugEventMap[eventID]>2) {std::cout<<"DEBUGEVENT:"<<eventID<<"\"PositronCounterHit\": pCounterMap.size()="<<pCounterMap.size()<<std::endl;}
@ -1364,29 +1381,41 @@ Bool_t musrAnalysis::PositronCounterHit(Int_t evID, Long64_t dataBinMin, Long64_
Bool_t positronHitFound = false;
Bool_t goodPositronFound = false;
Int_t positronQuality = 0;
// std::cout<<"Debug 10------------------------------"<<std::endl;
if (musrMode=='D') {
// Loop over all positron counters
for (counterMapType::const_iterator it = pCounterMap.begin(); it!=pCounterMap.end(); ++it) {
// std::cout<<" ===POSITRON==="<< pCounterMap.size()<<std::endl;
// Bool_t thereWasHit = (it->second)->GetNextGoodHitInThisEvent(evID,dataBinMin,dataBinMax,'P',tBin1,kEntry,idetP,idetP_ID,idetP_edep,doubleHit);
// Bool_t thereWasHit = (it->second)->GetNextGoodPositron(evID,dataBinMin,dataBinMax,tBin1,tBin2,kEntry,idetP,idetP_ID,idetP_edep,doubleHit);
Int_t positronQuality = (it->second)->GetNextGoodPositron(evID,dataBinMin,dataBinMax,tBin1,tBin2,kEntry,idetP,idetP_ID,idetP_edep,doubleHit);
// std::cout<<"000000000000 tBin1="<<tBin1<<" tBin2="<<tBin2<<std::endl;
if (doubleHit) {return false;} // There were two hits in the same positron counter
if (positronQuality>0) {
if (positronHitFound) {
if (bool_debugingRequired) {
if (debugEventMap[eventID]>2) {std::cout<<"DEBUGEVENT:"<<eventID<<"\"PositronCounterHit\": Coincidence with other positron candidate in other counter."<<std::endl;}
}
doubleHit = true;
return false;
} // There were two hits in two different positron counters
positronHitFound = true;
if (positronQuality>1) goodPositronFound = true;
}
// std::cout<<"Debug 20"<<std::endl;
Long64_t dataBinMinimum = dataBinMin;
do {
// std::cout<<"Debug 30"<<std::endl;
positronQuality = (it->second)->GetNextGoodPositron(evID,dataBinMinimum,dataBinMax,tBin1,tBin2,kEntry,idetP,idetP_ID,idetP_edep);
// std::cout<<"Debug 40 positronQuality="<<positronQuality<<std::endl;
dataBinMinimum=tBin1+1; // If a positron is found, one needs to search again through the remaining hits in this counter.
if (positronQuality>0) {
// std::cout<<"Debug 50"<<std::endl;
if (positronHitFound) { // Positron found now but also previously ==> double hit ==> through away this event.
// std::cout<<"Debug 60"<<std::endl;
if (bool_debugingRequired) {
if (debugEventMap[eventID]>2) {std::cout<<"DEBUGEVENT:"<<eventID
<<"\"PositronCounterHit\": Coincidence with other positron candidate in other counter."<<std::endl;}
}
return false;
} // end of "positronHitFound"
// std::cout<<"Debug 70"<<std::endl;
positronHitFound = true;
if (positronQuality>1) goodPositronFound = true;
}
// std::cout<<"Debug 80"<<std::endl;
} while (positronQuality>0);
// std::cout<<"Debug 90"<<std::endl;
}
// std::cout<<"Debug 100 positronQuality="<<positronQuality<<std::endl;
if (goodPositronFound) return true;
}
return goodPositronFound;
// std::cout<<"Debug 110"<<std::endl;
return false;
}
//================================================================