@@ -318,8 +318,8 @@ class CAFMaker : public art::EDProducer {
318318 void FixPMTReferenceTimes (StandardRecord &rec, double PMT_reference_time);
319319 void FixCRTReferenceTimes (StandardRecord &rec, double CRTT0_reference_time, double CRTT1_reference_time);
320320
321- void SBNDShiftCRTReference (StandardRecord &rec, double SBNDFrame);
322- void SBNDShiftPMTReference (StandardRecord &rec, double SBNDFrame);
321+ void SBNDShiftCRTReference (StandardRecord &rec, double SBNDFrame) const ;
322+ void SBNDShiftPMTReference (StandardRecord &rec, double SBNDFrame) const ;
323323
324324 // / Equivalent of FindManyP except a return that is !isValid() prints a
325325 // / messsage and aborts if StrictMode is true.
@@ -504,7 +504,7 @@ void CAFMaker::BlindEnergyParameters(StandardRecord* brec) {
504504 }
505505}
506506
507- void CAFMaker::SBNDShiftCRTReference (StandardRecord &rec, double SBNDFrame){
507+ void CAFMaker::SBNDShiftCRTReference (StandardRecord &rec, double SBNDFrame) const {
508508
509509 // CRT Space Point
510510 for (SRCRTSpacePoint &sp: rec.crt_spacepoints ){
@@ -523,7 +523,7 @@ void CAFMaker::SBNDShiftCRTReference(StandardRecord &rec, double SBNDFrame){
523523 // }
524524}
525525
526- void CAFMaker::SBNDShiftPMTReference (StandardRecord &rec, double SBNDFrame){
526+ void CAFMaker::SBNDShiftPMTReference (StandardRecord &rec, double SBNDFrame) const {
527527
528528 double SBNDFrame_us = SBNDFrame / 1000.0 ; // convert ns to us
529529
@@ -2416,7 +2416,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24162416 rec.opflashes = srflashes;
24172417 rec.nopflashes = srflashes.size ();
24182418 rec.sbnd_frames = srsbndframeshiftinfo;
2419- rec.sbnd_timings = srsbndtiminginfo;
2419+ rec.sbnd_timings = srsbndtiminginfo;
24202420
24212421 if (fParams .FillTrueParticles ()) {
24222422 rec.true_particles = true_particles;
@@ -2425,7 +2425,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24252425 rec.crtpmt_matches = srcrtpmtmatches;
24262426 rec.ncrtpmt_matches = srcrtpmtmatches.size ();
24272427
2428- // ICARUS: Fix the Reference time
2428+ // Move the reference time of reconstructed objects from trigger time to beam spill/beam gate opening time.
24292429 //
24302430 // We want MC and Data to have the same reference time.
24312431 // In MC/LArSoft the "reference time" is canonically defined
@@ -2442,6 +2442,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24422442 // filled with the default values, which are set to the numerical limits of double.
24432443 // In this case, we should set the PMT_reference_time to 0.
24442444
2445+ // ICARUS: Fix the Reference time
24452446 const bool hasValidTriggerTime =
24462447 srtrigger.global_trigger_det_time >
24472448 (std::numeric_limits<double >::min () + std::numeric_limits<double >::epsilon ()) &&
@@ -2458,8 +2459,11 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24582459
24592460 // TODO: TPC?
24602461
2461- // SBND: Fix the Reference time in data depending on the stream (See FrameShift module on sbndcode repo)
2462- if (isRealData & (fDet == kSBND ))
2462+ // SBND: Fix the Reference time in data depending on the stream i
2463+ // For more information, see:
2464+ // https://sbn-docdb.fnal.gov/cgi-bin/sso/RetrieveFile?docid=43090
2465+
2466+ if (isRealData && (fDet == kSBND ) && (rec.sbnd_frames .frameApplyAtCaf != 0.0 ))
24632467 {
24642468 mf::LogInfo (" CAFMaker" ) << " Setting Reference Timing for timing object in SBND \n "
24652469 << " Shift Apply At Caf Level = " << rec.sbnd_frames .frameApplyAtCaf << " ns\n " ;
@@ -2754,7 +2758,6 @@ void CAFMaker::endJob() {
27542758 if (fParams .CreateBlindedCAF () && fFlatFilep ) AddMetadataToFile (fFlatFilep , metamap);
27552759}
27562760
2757-
27582761} // end namespace caf
27592762DEFINE_ART_MODULE (caf::CAFMaker)
27602763// //////////////////////////////////////////////////////////////////////
0 commit comments