@@ -469,6 +469,17 @@ void sbnd::LightCaloProducer::CalculateCalorimetry(art::Event& e,
469469 }
470470 }
471471
472+ // Get electron lifetime (from database if enabled, otherwise from detector properties)
473+ double elifetime_tpc0, elifetime_tpc1;
474+ if (fuse_elifetime_db) {
475+ ELifetimeInfo elife_info = GetELifetimeFromDB (e.id ().run ());
476+ elifetime_tpc0 = elife_info.tau_tpc0 ;
477+ elifetime_tpc1 = elife_info.tau_tpc1 ;
478+ } else {
479+ elifetime_tpc0 = det_prop.ElectronLifetime ();
480+ elifetime_tpc1 = det_prop.ElectronLifetime ();
481+ }
482+
472483 for (size_t n_slice=0 ; n_slice < match_slices_v.size (); n_slice++){
473484 // initialize tree variables
474485 _pfpid = -1 ;
@@ -493,17 +504,6 @@ void sbnd::LightCaloProducer::CalculateCalorimetry(art::Event& e,
493504 bool has_sp0 = false ;
494505 bool has_sp1 = false ;
495506
496- // Get electron lifetime (from database if enabled, otherwise from detector properties)
497- double elifetime_tpc0, elifetime_tpc1;
498- if (fuse_elifetime_db) {
499- ELifetimeInfo elife_info = GetELifetimeFromDB (e.id ().run ());
500- elifetime_tpc0 = elife_info.tau_tpc0 ;
501- elifetime_tpc1 = elife_info.tau_tpc1 ;
502- } else {
503- elifetime_tpc0 = det_prop.ElectronLifetime ();
504- elifetime_tpc1 = det_prop.ElectronLifetime ();
505- }
506-
507507 for (size_t i=0 ; i < slice_hits_v.size (); i++){
508508 auto hit = slice_hits_v[i];
509509 auto drift_time = clock_data.TPCTick2TrigTime (hit->PeakTime ());
0 commit comments