diff --git a/doc/musrSimAna.pdf b/doc/musrSimAna.pdf index ca7e615..b38f357 100644 Binary files a/doc/musrSimAna.pdf and b/doc/musrSimAna.pdf differ diff --git a/doc/musrSimAna.tex b/doc/musrSimAna.tex index aaa4189..b6ca25b 100644 --- a/doc/musrSimAna.tex +++ b/doc/musrSimAna.tex @@ -435,6 +435,11 @@ All events should/have to be (?) saved in the Root tree This defines a group of detectors, where \emph{group} stands for ``B'' (backward), ``F'' (forward), ``U'' (up), ``D'' (down), ``L'' (left) and ``R'' (right) detectors. This grouping is used in the definition of some conditions. + \item{\bf sampleID \emph{ID$_1$ ID$_2$ \ldots ID$_n$} } \\ + Defines which volume (or volumes, if there are more) is the sample. Typically, the + sample is just one volume, but sometimes there is a smaller volume inside of the sample, + to which a field is applied, so the small volume also has to be considered as the sample. + This information is needed for the condition ``muonDecayedInSample\_gen''. \item{\bf setSpecialAnticoincidenceTimeWindow \emph{detectorID} \emph{timeMin} \emph{timeMax} \emph{unit}} \\ This command sets a special anti-coincidence time window for a detector \emph{detectorID}. Normally, the anti-coincidence time window is defined by {\tt VCOINCIDENCEW}, and is the same for all anti-coincidence diff --git a/musrSimAna/musrAnalysis.cxx b/musrSimAna/musrAnalysis.cxx index 42f7e15..4d25034 100644 --- a/musrSimAna/musrAnalysis.cxx +++ b/musrSimAna/musrAnalysis.cxx @@ -474,6 +474,23 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) { nscan = sscanf(pch,"%d",&N1); } while (nscan==1); } + else if (strcmp(tmpString0,"sampleID")==0) { + int nscan; int N1; char NAME[100]; + char *pch = line + strlen("sampleID"); + do { + nscan = sscanf(pch,"%d",&N1); + SampleDetIDList.push_back(N1); + nscan = sscanf(pch,"%s",NAME); + char* pch2 = strstr(pch ,NAME)+strlen(NAME); + pch=pch2; + nscan = sscanf(pch,"%d",&N1); + } while (nscan==1); + std::cout<<"SampleID :"; + for (std::list ::const_iterator it=SampleDetIDList.begin(); it!=SampleDetIDList.end(); ++it) { + std::cout<<" "<< *it; + } + std::cout<GetNumberOfMuonCandidates(); Long64_t numberOfMuonCandidatesAfterVK = mCounter->GetNumberOfMuonCandidatesAfterVK(); + Long64_t numberOfMuonCandidatesAfterVKandDoubleHitRemoval = mCounter->GetNumberOfMuonCandidatesAfterVKandDoubleHitRemoval(); Double_t durationOfExperiment = (numberOfRewinds*rewindTimeBins*tdcresolution+currentTime)/1000000; hInfo->Fill(5,(Double_t) numberOfMuonCandidates); // number of "triggers" hInfo->Fill(4,(Double_t) numberOfMuonCandidatesAfterVK); // number of "triggers" hInfo->Fill(3,durationOfExperiment); + hInfo->Fill(8,(Double_t) numberOfMuonCandidatesAfterVKandDoubleHitRemoval); //============================== // Write out the histograms std::cout<<"musrAnalysis::SaveHistograms()"< -1000; muonTriggered_det = mCounterHitExistsForThisEventID; positronHit_det = pCounterHitExistsForThisEventID; diff --git a/musrSimAna/musrAnalysis.hh b/musrSimAna/musrAnalysis.hh index b9cb4b2..fa3f6c5 100644 --- a/musrSimAna/musrAnalysis.hh +++ b/musrSimAna/musrAnalysis.hh @@ -409,6 +409,7 @@ private: std::list D_posCounterList; std::list L_posCounterList; std::list R_posCounterList; + std::list SampleDetIDList; // std::list ::iterator posCounterList_Iterator; }; diff --git a/musrSimAna/musrCounter.cxx b/musrSimAna/musrCounter.cxx index 5013150..401abfc 100644 --- a/musrSimAna/musrCounter.cxx +++ b/musrSimAna/musrCounter.cxx @@ -32,6 +32,7 @@ musrCounter::musrCounter(int CHANNEL_NR, char CHANNEL_NAME[200], char CHANNEL_TY doubleHitN=0; numberOfMuonCandidates=0; numberOfMuonCandidatesAfterVK=0; + numberOfMuonCandidatesAfterVKandDoubleHitRemoval=0; } //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... @@ -194,6 +195,8 @@ Bool_t musrCounter::GetNextGoodMuon(Int_t evtID, Long64_t timeBinMin, Long64_t& goto endOfThisHit; } + numberOfMuonCandidatesAfterVKandDoubleHitRemoval++; + kEntry = (it->second)->eventEntry; idet = (it->second)->det_i; idetID = (it->second)->det_id; diff --git a/musrSimAna/musrCounter.hh b/musrSimAna/musrCounter.hh index 058622f..b30f894 100644 --- a/musrSimAna/musrCounter.hh +++ b/musrSimAna/musrCounter.hh @@ -64,7 +64,7 @@ class musrCounter { void myPrintThisCounter(Int_t evtID, Int_t detail=2); Long64_t GetNumberOfMuonCandidates(){return numberOfMuonCandidates;} Long64_t GetNumberOfMuonCandidatesAfterVK(){return numberOfMuonCandidatesAfterVK;} - + Long64_t GetNumberOfMuonCandidatesAfterVKandDoubleHitRemoval(){return numberOfMuonCandidatesAfterVKandDoubleHitRemoval;} private: // static musrCounter* pointerToAnalysis; @@ -91,6 +91,7 @@ class musrCounter { Int_t doubleHitN; Long64_t numberOfMuonCandidates; Long64_t numberOfMuonCandidatesAfterVK; + Long64_t numberOfMuonCandidatesAfterVKandDoubleHitRemoval; }; #endif diff --git a/src/musrScintSD.cc b/src/musrScintSD.cc index 63c8ccb..6ba7a38 100644 --- a/src/musrScintSD.cc +++ b/src/musrScintSD.cc @@ -269,18 +269,25 @@ void musrScintSD::ProcessOpticalPhoton(G4Step* aStep) { // whether a given cell already fired - if so, do not store the photon. G4bool APDcellAlreadyFired = false; G4int APDcellID = 0; + if (APDcellsTimeVariationRequested) tmpTime += G4RandGauss::shoot(0,APDcellsTimeVariationSigma); + if (APDcellsEffectRequested) { APDcellID = FindAPDcellID(aStep); // G4cout<<"Cell ID="<begin(); it2 != optHitDetectorMap->end(); it2++ ) { + for (optHitDetectorMapType::iterator it2 = optHitDetectorMap->begin(); it2 != optHitDetectorMap->end(); it2++ ) { if ((it2->second)==APDcellID) { + // G4cout<<"Already fired cell ="<