diff --git a/doc/musrSim.pdf b/doc/musrSim.pdf index 67c7ebe..f83e101 100644 Binary files a/doc/musrSim.pdf and b/doc/musrSim.pdf differ diff --git a/doc/musrSim.tex b/doc/musrSim.tex index aaa56b5..80e2413 100644 --- a/doc/musrSim.tex +++ b/doc/musrSim.tex @@ -1208,8 +1208,8 @@ The list of variables that can be stored in the Root tree: the photon enters (and not \emph{from} which it comes). This e.g.\ allows one to attach more APDs to one scintillator, in which case odet\_ID[] will correspond to the volume IDs of individual APDs. \item{\bf odet\_nPhot[odet\_n]} (array of Int\_t) -- number of photons detected in the given optical photon signal. -\item{\bf odet\_timeFirst[odet\_n], odet\_timeLast[odet\_n]} (array of Double\_t) - -- times, when the the first and last photons contributing to the given signal were detected (odet\_timeFirst and odet\_timeLast). +\item{\bf odet\_timeFirst[odet\_n], odet\_timeSecond[odet\_n], odet\_timeThird[odet\_n], odet\_timeLast[odet\_n]} (array of Double\_t) + -- times, when the the first, second, third and last photons, contributing to the given signal, were detected. \item{\bf odet\_timeA[odet\_n], odet\_timeB[odet\_n]} (array of Double\_t) -- time, when the $n^{th}$ photon was detected, where $n$ for \emph{odet\_timeA[i]} is given as \emph{OPSA\_fracA} multiplied by \emph{odet\_nPhot[i]}. Similarly for \emph{odet\_timeB[i]}. @@ -1517,14 +1517,14 @@ Please let us know your comments and suggestions for further improvement/develop musrSim program. -\section{Appendix A: Steering file for the simulation} -\begin{verbatim} -# Macro file for seg06.cc -# set detector parameters -# This line fills some space -# This line fills some space -/run/beamOn 2 -\end{verbatim} +%\section{Appendix A: Steering file for the simulation} +%\begin{verbatim} +%# Macro file for seg06.cc +%# set detector parameters +%# This line fills some space +%# This line fills some space +%/run/beamOn 2 +%\end{verbatim} \begin{thebibliography}{0} diff --git a/include/musrRootOutput.hh b/include/musrRootOutput.hh index 84e2642..32d50aa 100644 --- a/include/musrRootOutput.hh +++ b/include/musrRootOutput.hh @@ -79,9 +79,10 @@ class musrRootOutput { G4double ekVertex, G4double xVertex, G4double yVertex, G4double zVertex, G4int idVolVertex, G4int idProcVertex, G4int idTrackVertex, G4int particleID) ; - void SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4double timeFirst, G4double timeA, - G4double timeB, G4double timeC, G4double timeD, G4double timeMean, G4double timeLast, - G4double timeCFD, G4double amplCFD); + void SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4double timeFirst, G4double timeSecond, + G4double timeThird, G4double timeA, G4double timeB, G4double timeC, G4double timeD, + G4double timeMean, G4double timeLast, G4double timeCFD, G4double amplCFD); + void SetCFDSpecialInfo (G4int n, G4double time); void SetSaveDetectorInfo (G4int ID, G4int particleID, G4double ke, G4double x, G4double y, G4double z, G4double time, @@ -218,6 +219,8 @@ class musrRootOutput { static G4bool store_odet_ID; static G4bool store_odet_nPhot; static G4bool store_odet_timeFirst; + static G4bool store_odet_timeSecond; + static G4bool store_odet_timeThird; static G4bool store_odet_timeA; static G4bool store_odet_timeB; static G4bool store_odet_timeC; @@ -327,6 +330,8 @@ class musrRootOutput { G4int odet_ID[odet_nMax]; G4int odet_nPhot[odet_nMax]; G4double odet_timeFirst[odet_nMax]; + G4double odet_timeSecond[odet_nMax]; + G4double odet_timeThird[odet_nMax]; G4double odet_timeA[odet_nMax]; G4double odet_timeB[odet_nMax]; G4double odet_timeC[odet_nMax]; diff --git a/include/musrScintSD.hh b/include/musrScintSD.hh index 2cd4069..fab656b 100644 --- a/include/musrScintSD.hh +++ b/include/musrScintSD.hh @@ -33,18 +33,19 @@ class G4HCofThisEvent; class signalInfo { public: - signalInfo(G4int id, G4int nP, G4double tFirst, + signalInfo(G4int id, G4int nP, G4double tFirst, G4double tSecond, G4double tThird, G4double tA, G4double tB, G4double tC, G4double tD, G4double tE, G4double tLast, G4double tCFD, G4double aCFD, G4double tCFDarray[1000]) { - detID=id; nPhot=nP; timeFirst=tFirst; + detID=id; nPhot=nP; timeFirst=tFirst; timeSecond=tSecond; timeThird=tThird; timeA=tA; timeB=tB; timeC=tC; timeD=tD; timeE=tE; timeLast=tLast; timeCFD=tCFD; amplCFD=aCFD; if (musrRootOutput::store_odet_timeCFDarray) {for(int i=0;i<1000;i++) {timeCFDarray[i]=tCFDarray[i];}} } ~signalInfo() {} void transferDataToRoot(musrRootOutput* myRootOut, G4int nn) { - myRootOut->SetOPSAinfo(nn,detID,nPhot,timeFirst,timeA,timeB,timeC,timeD,timeE,timeLast,timeCFD,amplCFD); + myRootOut->SetOPSAinfo(nn,detID,nPhot,timeFirst,timeSecond,timeThird, + timeA,timeB,timeC,timeD,timeE,timeLast,timeCFD,amplCFD); for (Int_t kk=0; kk<13; kk++) { for (Int_t ll=0; ll<5; ll++) { int index = (ll+1)*100+kk; @@ -60,6 +61,8 @@ class signalInfo { G4int nPhot_refl; G4int nPhot_other; G4double timeFirst; + G4double timeSecond; + G4double timeThird; G4double timeA; G4double timeB; G4double timeC; diff --git a/musrSim.cc b/musrSim.cc index 720fe56..89b32c8 100644 --- a/musrSim.cc +++ b/musrSim.cc @@ -41,7 +41,7 @@ int main(int argc,char** argv) { XInitThreads(); G4cout<<"\n\n*************************************************************"<Branch("save_polz",&save_polz,"save_polz[save_n]/D"); } - if (store_odet_ID || store_odet_nPhot || store_odet_timeFirst || store_odet_timeA || store_odet_timeB || + if (store_odet_ID || store_odet_nPhot || store_odet_timeFirst || store_odet_timeSecond || store_odet_timeThird || store_odet_timeA || store_odet_timeB || store_odet_timeC || store_odet_timeD || store_odet_timeMean || store_odet_timeLast || store_odet_timeCFD || store_odet_amplCFD) {rootTree->Branch("odet_n",&odet_n,"odet_n/I");} if (store_odet_ID) {rootTree->Branch("odet_ID",&odet_ID,"odet_ID[odet_n]/I");} if (store_odet_nPhot) {rootTree->Branch("odet_nPhot",&odet_nPhot,"odet_nPhot[odet_n]/I");} if (store_odet_timeFirst) {rootTree->Branch("odet_timeFirst",&odet_timeFirst,"odet_timeFirst[odet_n]/D");} + if (store_odet_timeSecond) {rootTree->Branch("odet_timeSecond",&odet_timeSecond,"odet_timeSecond[odet_n]/D");} + if (store_odet_timeThird) {rootTree->Branch("odet_timeThird",&odet_timeThird,"odet_timeThird[odet_n]/D");} if (store_odet_timeA) {rootTree->Branch("odet_timeA",&odet_timeA,"odet_timeA[odet_n]/D");} if (store_odet_timeB) {rootTree->Branch("odet_timeB",&odet_timeB,"odet_timeB[odet_n]/D");} if (store_odet_timeC) {rootTree->Branch("odet_timeC",&odet_timeC,"odet_timeC[odet_n]/D");} @@ -604,8 +608,9 @@ void musrRootOutput::SetDetectorInfoVvv (G4int nDetectors, } -void musrRootOutput::SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4double timeFirst, G4double timeA, - G4double timeB, G4double timeC, G4double timeD, G4double timeMean, G4double timeLast, G4double timeCFD, G4double amplCFD) +void musrRootOutput::SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4double timeFirst, + G4double timeSecond, G4double timeThird, G4double timeA, G4double timeB, G4double timeC, + G4double timeD, G4double timeMean, G4double timeLast, G4double timeCFD, G4double amplCFD) { if ((nDetectors<0)||(nDetectors>=(odet_nMax-1))) { char message[200]; @@ -618,6 +623,8 @@ void musrRootOutput::SetOPSAinfo (G4int nDetectors, G4int ID, G4int nPhot, G4 odet_ID[nDetectors]=ID; odet_nPhot[nDetectors]=nPhot; odet_timeFirst[nDetectors]=timeFirst/microsecond; + odet_timeSecond[nDetectors]=timeSecond/microsecond; + odet_timeThird[nDetectors]=timeThird/microsecond; odet_timeA[nDetectors]=timeA/microsecond; odet_timeB[nDetectors]=timeB/microsecond; odet_timeC[nDetectors]=timeC/microsecond; diff --git a/src/musrScintSD.cc b/src/musrScintSD.cc index 264b486..63c8ccb 100644 --- a/src/musrScintSD.cc +++ b/src/musrScintSD.cc @@ -584,6 +584,8 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() { Double_t time = -1000, lastTime = -1000; G4int OPSA_nPhot = 0; G4double OPSA_timeFirst = -1000000; + G4double OPSA_timeSecond = -1000000; + G4double OPSA_timeThird = -1000000; G4double OPSA_timeA = -1000000; G4double OPSA_timeB = -1000000; G4double OPSA_timeC = -1000000; @@ -660,6 +662,8 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() { G4double timePhot = it3->first; // if (APDcellsTimeVariationRequested) timePhot += G4RandGauss::shoot(0,APDcellsTimeVariationSigma); // Shifted above if (nP==1) OPSA_timeFirst = timePhot; + if (nP==2) OPSA_timeSecond= timePhot; + if (nP==3) OPSA_timeThird = timePhot; if (nP==NA) OPSA_timeA = timePhot; if (nP==NB) OPSA_timeB = timePhot; if (nP==OPSA_nPhot) OPSA_timeLast = timePhot; @@ -772,12 +776,15 @@ void musrScintSD::EndOfEvent_OptiacalPhotons() { } } - signalInfo* mySignalInfo = new signalInfo(OPSA_detID,OPSA_nPhot,OPSA_timeFirst,OPSA_timeA,OPSA_timeB,OPSA_timeC, - OPSA_timeD,OPSA_timeMean,OPSA_timeLast,OPSA_CFD_time,OPSA_CFD_ampl,timeCFDarray); + signalInfo* mySignalInfo = new signalInfo(OPSA_detID,OPSA_nPhot,OPSA_timeFirst,OPSA_timeSecond,OPSA_timeThird, + OPSA_timeA,OPSA_timeB,OPSA_timeC,OPSA_timeD,OPSA_timeMean,OPSA_timeLast, + OPSA_CFD_time,OPSA_CFD_ampl,timeCFDarray); OPSA_signal_Map.insert(std::pair(OPSA_nPhot,mySignalInfo) ); } OPSA_nPhot = 0; OPSA_timeFirst = -1000000; + OPSA_timeSecond = -1000000; + OPSA_timeThird = -1000000; OPSA_timeA = -1000000; OPSA_timeB = -1000000; OPSA_timeC = -1000000;