29.3.2011 Kamil Sedlak

1) Small change in optical photon simulation
2) Some other small changes, probably not very important
This commit is contained in:
2011-03-29 15:34:13 +00:00
parent 2a1c05b09b
commit 9bc0d53074
9 changed files with 199 additions and 62 deletions

View File

@ -455,6 +455,39 @@ void musrAnalysis::ReadInInputParameters(char* charV1190FileName) {
nscan = sscanf(pch,"%d",&N1);
} while (nscan==1);
}
else if (strcmp(tmpString0,"setSpecialAnticoincidenceTimeWindow")==0) {
int channelNumber;
double min, max;
char unit[100]="Undefined";
Long64_t lmin, lmax;
sscanf(&line[0],"%*s %d %lf %lf %s",&channelNumber,&min,&max,unit);
if ((strcmp(unit,"bin")==0)||(strcmp(unit,"bins")==0)) {lmin = Long64_t (min); lmax = Long64_t (max);}
else if ((strcmp(unit,"ns") ==0)||(strcmp(unit,"nanosecond") ==0)) {
lmin = Long64_t (min*nanosecond/tdcresolution);
lmax = Long64_t (max*nanosecond/tdcresolution);
}
else if ((strcmp(unit,"mus") ==0)||(strcmp(unit,"microsecond") ==0)) {
lmin = Long64_t (min*microsecond/tdcresolution);
lmax = Long64_t (max*microsecond/tdcresolution);
}
else {
std::cout<<" ERROR! musrAnalysis: unknown unit in setSpecialAnticoincidenceTimeWindow !!! (unit="<<unit<<")"<<std::endl;
std::cout<<" ==> S T O P "<<std::endl;
exit(1);
}
std::cout<<" lmin="<<lmin<<" bins"<<std::endl;
std::cout<<" lmax="<<lmax<<" bins"<<std::endl;
if (allCounterMap.find(channelNumber)==allCounterMap.end()) {
std::cout<<" ERROR! musrAnalysis: unknown counter ("<<channelNumber<<") in setSpecialAnticoincidenceTimeWindow"<<std::endl;
std::cout<<" ==> S T O P "<<std::endl;
exit(1);
}
musrCounter* counter = (allCounterMap.find(channelNumber))->second;
counter->SetAntiCoincidenceTimeWindowMin(lmin);
counter->SetAntiCoincidenceTimeWindowMax(lmax);
}
else if (strcmp(tmpString0,"artificiallyChangeMuDecayTime")==0) {
float min, max, mmmin, mmmax;
sscanf(&line[0],"%*s %g %g %g %g %g %g %g",&min,&max,&mmmin,&mmmax);
@ -759,8 +792,11 @@ void musrAnalysis::SaveHistograms(char* runChar, char* v1190FileName) {
}
Long64_t numberOfMuonCandidates = mCounter->GetNumberOfMuonCandidates();
Long64_t numberOfMuonCandidatesAfterVK = mCounter->GetNumberOfMuonCandidatesAfterVK();
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);
//==============================
// Write out the histograms
std::cout<<"musrAnalysis::SaveHistograms()"<<std::endl;
@ -780,14 +816,18 @@ void musrAnalysis::SaveHistograms(char* runChar, char* v1190FileName) {
std::cout<<"==================================================================="<<std::endl;
std::cout<<"Number of raw trigger counts (ignoring pileup gate, vetos and coincidences): "<<numberOfMuonCandidates<<std::endl;
std::cout<<"Number of trigger counts (after vetos and coincidences but not pile-up rejected): "<<numberOfMuonCandidatesAfterVK<<std::endl;
std::cout<<"Number of triggered events (i.e. only good \"muons\"): "<<numberOfGoodMuons<<std::endl;
Double_t durationOfExperiment = (numberOfRewinds*rewindTimeBins*tdcresolution+currentTime)/1000000;
std::cout<<"Duration of the \"experiment\": "<<durationOfExperiment<<" second"<<std::endl;
// std::cout<<" (numberOfRewinds="<<numberOfRewinds<<")"<<std::endl;
std::cout<<"In this run, MUONRATEFACTOR was set to "<<muonRateFactor<<", and the raw trigger rate was "
<<numberOfMuonCandidates/durationOfExperiment<<" muons/second"<<std::endl;
std::cout<<" To get event rate of 30000 events/second, set MUONRATEFACTOR to "
<< muonRateFactor*( (numberOfMuonCandidates/durationOfExperiment)/30000 )<<std::endl;
std::cout<<"MUONRATEFACTOR was set to "<<muonRateFactor<<std::endl;
std::cout<<" Raw trigger rate = "<<numberOfMuonCandidates/durationOfExperiment<<" muons/second";
std::cout<<" (to get 30000 events/second, set MUONRATEFACTOR = "
<< muonRateFactor*( (numberOfMuonCandidates/durationOfExperiment)/30000 )<<")"<<std::endl;
std::cout<<" Trigger rate after V & K = "<<numberOfMuonCandidatesAfterVK/durationOfExperiment<<" muons/second";
std::cout<<" (to get 30000 events/second, set MUONRATEFACTOR = "
<< muonRateFactor*( (numberOfMuonCandidatesAfterVK/durationOfExperiment)/30000 )<<")"<<std::endl;
std::cout<<"========================== E N D =================================="<<std::endl;
}
@ -985,7 +1025,7 @@ void musrAnalysis::FillHistograms(Int_t iiiEntry) {
goodEvent_R_det = goodEvent_det && ( (find(R_posCounterList.begin(), R_posCounterList.end(), idetP_ID)) != R_posCounterList.end() );
// std::cout<<"goodEvent_F_det="<<goodEvent_F_det<<std::endl;
if (pileupEvent&&goodEvent_F_det) {
std::cout<<" DEBUG: Pileup Event: eventID = "<<eventID<<" pileup_eventID = "<<pileup_eventID<<" det_time10 = "<<det_time10<<std::endl;
// std::cout<<" DEBUG: Pileup Event: eventID = "<<eventID<<" pileup_eventID = "<<pileup_eventID<<" det_time10 = "<<det_time10<<std::endl;
// debugEventMap.insert(std::pair<int,int>(eventID,10));
}