@@ -10,9 +10,12 @@ namespace opdet {
1010 DigiPMTSBNDAlg::DigiPMTSBNDAlg (ConfigurationParameters_t const & config)
1111 : fParams (config)
1212 , fSampling (fParams .frequency)
13- , fPMTCoatedVUVEff (fParams .PMTCoatedVUVEff / fParams .larProp->ScintPreScale ())
14- , fPMTCoatedVISEff(fParams .PMTCoatedVISEff / fParams .larProp->ScintPreScale ())
15- , fPMTUncoatedEff(fParams .PMTUncoatedEff/ fParams .larProp->ScintPreScale ())
13+ , fPMTCoatedVUVEff_tpc0 (fParams .PMTCoatedVUVEff_tpc0 / fParams .larProp->ScintPreScale ())
14+ , fPMTCoatedVISEff_tpc0(fParams .PMTCoatedVISEff_tpc0 / fParams .larProp->ScintPreScale ())
15+ , fPMTUncoatedEff_tpc0(fParams .PMTUncoatedEff_tpc0/ fParams .larProp->ScintPreScale ())
16+ , fPMTCoatedVUVEff_tpc1(fParams .PMTCoatedVUVEff_tpc1 / fParams .larProp->ScintPreScale ())
17+ , fPMTCoatedVISEff_tpc1(fParams .PMTCoatedVISEff_tpc1 / fParams .larProp->ScintPreScale ())
18+ , fPMTUncoatedEff_tpc1(fParams .PMTUncoatedEff_tpc1/ fParams .larProp->ScintPreScale ())
1619 // , fSinglePEmodel(fParams.SinglePEmodel)
1720 , fEngine(fParams .engine)
1821 , fFlatGen(*fEngine )
@@ -21,15 +24,20 @@ namespace opdet {
2124 , fExponentialGen(*fEngine )
2225 {
2326
24- mf::LogInfo (" DigiPMTSBNDAlg" ) << " PMT corrected efficiencies = "
25- << fPMTCoatedVUVEff << " " << fPMTCoatedVISEff << " " << fPMTUncoatedEff <<" \n " ;
27+ mf::LogInfo (" DigiPMTSBNDAlg" ) << " PMT corrected efficiencies TPC0 = "
28+ << fPMTCoatedVUVEff_tpc0 << " " << fPMTCoatedVISEff_tpc0 << " " << fPMTUncoatedEff_tpc0
29+ << " PMT corrected efficiencies TPC1 = "
30+ << fPMTCoatedVUVEff_tpc1 << " " << fPMTCoatedVISEff_tpc1 << " " << fPMTUncoatedEff_tpc1 <<" \n " ;
2631
27- if (fPMTCoatedVUVEff > 1.0001 || fPMTCoatedVISEff > 1.0001 || fPMTUncoatedEff > 1.0001 )
32+ if (fPMTCoatedVUVEff_tpc0 > 1.0001 || fPMTCoatedVISEff_tpc0 > 1.0001 || fPMTUncoatedEff_tpc0 > 1.0001 || fPMTCoatedVUVEff_tpc1 > 1.0001 || fPMTCoatedVISEff_tpc1 > 1.0001 || fPMTUncoatedEff_tpc1 > 1.0001 )
2833 mf::LogWarning (" DigiPMTSBNDAlg" )
2934 << " Detection efficiencies set in fhicl file seem to be too large!\n "
30- << " PMTCoatedVUVEff: " << fParams .PMTCoatedVUVEff << " \n "
31- << " PMTCoatedVISEff: " << fParams .PMTCoatedVISEff << " \n "
32- << " PMTUncoatedEff: " << fParams .PMTUncoatedEff << " \n "
35+ << " PMTCoatedVUVEff TPC0: " << fParams .PMTCoatedVUVEff_tpc0 << " \n "
36+ << " PMTCoatedVISEff TPC0: " << fParams .PMTCoatedVISEff_tpc0 << " \n "
37+ << " PMTUncoatedEff TPC0: " << fParams .PMTUncoatedEff_tpc0 << " \n "
38+ << " PMTCoatedVUVEff TPC1: " << fParams .PMTCoatedVUVEff_tpc1 << " \n "
39+ << " PMTCoatedVISEff TPC1: " << fParams .PMTCoatedVISEff_tpc1 << " \n "
40+ << " PMTUncoatedEff TPC1: " << fParams .PMTUncoatedEff_tpc1 << " \n "
3341 << " Final efficiency must be equal or smaller than the scintillation "
3442 << " pre scale applied at simulation time.\n "
3543 << " Please check this number (ScintPreScale): "
@@ -164,14 +172,14 @@ namespace opdet {
164172 double ttsTime = 0 ;
165173 double tphoton;
166174 double ttpb=0 ;
167-
175+ double _PMTUncoatedEff;
168176 // we want to keep the 1 ns SimPhotonLite resolution
169177 // digitizer sampling period is 2 ns
170178 // create a PE accumulator vector with size x2 the waveform size
171179 std::vector<unsigned int > nPE_v ( (size_t ) fSamplingPeriod *wave.size (), 0 );
172-
180+ _PMTUncoatedEff = (ch % 2 == 0 ) ? fPMTUncoatedEff_tpc0 : fPMTUncoatedEff_tpc1 ;
173181 for (size_t i = 0 ; i < simphotons.size (); i++) { // simphotons is here reflected light. To be added for all PMTs
174- if (fFlatGen .fire (1.0 ) < fPMTUncoatedEff ) {
182+ if (fFlatGen .fire (1.0 ) < _PMTUncoatedEff ) {
175183 if (fParams .TTS > 0.0 ) ttsTime = Transittimespread (fParams .TTS );
176184 ttpb = fTimeTPB ->fire (); // for including TPB emission time
177185
@@ -211,6 +219,8 @@ namespace opdet {
211219 double ttsTime = 0 ;
212220 double tphoton;
213221 double ttpb=0 ;
222+ double _PMTCoatedVUVEff;
223+ double _PMTCoatedVISEff;
214224 sim::SimPhotons auxphotons;
215225
216226 // we want to keep the 1 ns SimPhotonLite resolution
@@ -219,10 +229,11 @@ namespace opdet {
219229 std::vector<unsigned int > nPE_v ( (size_t ) fSamplingPeriod *wave.size (), 0 );
220230
221231 // direct light
232+ _PMTCoatedVUVEff = (ch % 2 == 0 ) ? fPMTCoatedVUVEff_tpc0 : fPMTCoatedVUVEff_tpc1 ;
222233 if (auto it{ DirectPhotonsMap.find (ch) }; it != std::end (DirectPhotonsMap) )
223234 {auxphotons = it->second ;}
224235 for (size_t j = 0 ; j < auxphotons.size (); j++) { // auxphotons is direct light
225- if (fFlatGen .fire (1.0 ) < fPMTCoatedVUVEff ) {
236+ if (fFlatGen .fire (1.0 ) < _PMTCoatedVUVEff ) {
226237 if (fParams .TTS > 0.0 ) ttsTime = Transittimespread (fParams .TTS ); // implementing transit time spread
227238 ttpb = fTimeTPB ->fire (); // for including TPB emission time
228239
@@ -235,10 +246,11 @@ namespace opdet {
235246 }
236247
237248 // reflected light
249+ _PMTCoatedVISEff = (ch % 2 == 0 ) ? fPMTCoatedVISEff_tpc0 : fPMTCoatedVISEff_tpc1 ;
238250 if (auto it{ ReflectedPhotonsMap.find (ch) }; it != std::end (ReflectedPhotonsMap) )
239251 {auxphotons = it->second ;}
240252 for (size_t j = 0 ; j < auxphotons.size (); j++) { // auxphotons is now reflected light
241- if (fFlatGen .fire (1.0 ) < fPMTCoatedVISEff ) {
253+ if (fFlatGen .fire (1.0 ) < _PMTCoatedVISEff ) {
242254 if (fParams .TTS > 0.0 ) ttsTime = Transittimespread (fParams .TTS ); // implementing transit time spread
243255 ttpb = fTimeTPB ->fire (); // for including TPB emission time
244256
@@ -280,18 +292,18 @@ namespace opdet {
280292 double ttsTime = 0 ;
281293 double tphoton;
282294 double ttpb=0 ;
283-
295+ double _PMTUncoatedEff;
284296 // we want to keep the 1 ns SimPhotonLite resolution
285297 // digitizer sampling period is 2 ns
286298 // create a PE accumulator vector with size x2 the waveform size
287299 std::vector<unsigned int > nPE_v ( (size_t ) fSamplingPeriod *wave.size (), 0 );
288-
289300 // here litesimphotons corresponds only to reflected light
301+ _PMTUncoatedEff = (ch % 2 == 0 ) ? fPMTUncoatedEff_tpc0 : fPMTUncoatedEff_tpc1 ;
290302 std::map<int , int > const & photonMap = litesimphotons.DetectedPhotons ;
291303 for (auto const & reflectedPhotons : photonMap) {
292304 // TODO: check that this new approach of not using the last
293305 // (1-accepted_photons) doesn't introduce some bias. ~icaza
294- mean_photons = reflectedPhotons.second *fPMTUncoatedEff ;
306+ mean_photons = reflectedPhotons.second *_PMTUncoatedEff ;
295307 accepted_photons = fPoissonQGen .fire (mean_photons);
296308 for (size_t i = 0 ; i < accepted_photons; i++) {
297309 if (fParams .TTS > 0.0 ) ttsTime = Transittimespread (fParams .TTS ); // implementing transit time spread
@@ -335,18 +347,19 @@ namespace opdet {
335347 double ttsTime = 0 ;
336348 double tphoton;
337349 double ttpb;
338-
350+ double _PMTCoatedVUVEff;
351+ double _PMTCoatedVISEff;
339352 // we want to keep the 1 ns SimPhotonLite resolution
340353 // digitizer sampling period is 2 ns
341354 // create a PE accumulator vector with size x2 the waveform size
342355 std::vector<unsigned int > nPE_v ( (size_t ) fSamplingPeriod *wave.size (), 0 );
343-
344356 // direct light
357+ _PMTCoatedVUVEff = (ch % 2 == 0 ) ? fPMTCoatedVUVEff_tpc0 : fPMTCoatedVUVEff_tpc1 ;
345358 if ( auto it{ DirectPhotonsMap.find (ch) }; it != std::end (DirectPhotonsMap) ){
346359 for (auto & directPhotons : (it->second ).DetectedPhotons ) {
347360 // TODO: check that this new approach of not using the last
348361 // (1-accepted_photons) doesn't introduce some bias. ~icaza
349- mean_photons = directPhotons.second *fPMTCoatedVUVEff ;
362+ mean_photons = directPhotons.second *_PMTCoatedVUVEff ;
350363 accepted_photons = fPoissonQGen .fire (mean_photons);
351364 for (size_t i = 0 ; i < accepted_photons; i++) {
352365 if (fParams .TTS > 0.0 ) ttsTime = Transittimespread (fParams .TTS ); // implementing transit time spread
@@ -362,11 +375,12 @@ namespace opdet {
362375 }
363376
364377 // reflected light
378+ _PMTCoatedVISEff = (ch % 2 == 0 ) ? fPMTCoatedVISEff_tpc0 : fPMTCoatedVISEff_tpc1 ;
365379 if ( auto it{ ReflectedPhotonsMap.find (ch) }; it != std::end (ReflectedPhotonsMap) ){
366380 for (auto & reflectedPhotons : (it->second ).DetectedPhotons ) {
367381 // TODO: check that this new approach of not using the last
368382 // (1-accepted_photons) doesn't introduce some bias. ~icaza
369- mean_photons = reflectedPhotons.second *fPMTCoatedVISEff ;
383+ mean_photons = reflectedPhotons.second *_PMTCoatedVISEff ;
370384 accepted_photons = fPoissonQGen .fire (mean_photons);
371385 for (size_t i = 0 ; i < accepted_photons; i++) {
372386 if (fParams .TTS > 0.0 ) ttsTime = Transittimespread (fParams .TTS ); // implementing transit time spread
@@ -575,9 +589,12 @@ namespace opdet {
575589 fBaseConfig .PMTChargeToADC = config.pmtchargeToADC ();
576590 fBaseConfig .PMTBaseline = config.pmtbaseline ();
577591 fBaseConfig .PMTADCDynamicRange = config.pmtADCDynamicRange ();
578- fBaseConfig .PMTCoatedVUVEff = config.pmtcoatedVUVEff ();
579- fBaseConfig .PMTCoatedVISEff = config.pmtcoatedVISEff ();
580- fBaseConfig .PMTUncoatedEff = config.pmtuncoatedEff ();
592+ fBaseConfig .PMTCoatedVUVEff_tpc0 = config.pmtcoatedVUVEff_tpc0 ();
593+ fBaseConfig .PMTCoatedVISEff_tpc0 = config.pmtcoatedVISEff_tpc0 ();
594+ fBaseConfig .PMTUncoatedEff_tpc0 = config.pmtuncoatedEff_tpc0 ();
595+ fBaseConfig .PMTCoatedVUVEff_tpc1 = config.pmtcoatedVUVEff_tpc1 ();
596+ fBaseConfig .PMTCoatedVISEff_tpc1 = config.pmtcoatedVISEff_tpc1 ();
597+ fBaseConfig .PMTUncoatedEff_tpc1 = config.pmtuncoatedEff_tpc1 ();
581598 fBaseConfig .PMTSinglePEmodel = config.PMTsinglePEmodel ();
582599 fBaseConfig .PMTRiseTime = config.pmtriseTime ();
583600 fBaseConfig .PMTFallTime = config.pmtfallTime ();
0 commit comments