Skip to content

Commit 70f9518

Browse files
committed
catching NaN cases and 0
1 parent 4ce4aff commit 70f9518

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ void CAFMaker::BlindEnergyParameters(StandardRecord* brec) {
506506

507507
void CAFMaker::SBNDShiftCRTReference(StandardRecord &rec, double SBNDFrame) const {
508508

509+
std::cout << "hellooooo PMT " << std::endl;
509510
//CRT Space Point
510511
for (SRCRTSpacePoint &sp: rec.crt_spacepoints){
511512
sp.time += SBNDFrame; //ns
@@ -524,7 +525,7 @@ void CAFMaker::SBNDShiftCRTReference(StandardRecord &rec, double SBNDFrame) cons
524525
}
525526

526527
void CAFMaker::SBNDShiftPMTReference(StandardRecord &rec, double SBNDFrame) const {
527-
528+
std::cout << "hellooooo PMT " << std::endl;
528529
double SBNDFrame_us = SBNDFrame / 1000.0; //convert ns to us
529530

530531
//Op Flash
@@ -2462,16 +2463,18 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24622463
// For more information, see:
24632464
// https://sbn-docdb.fnal.gov/cgi-bin/sso/RetrieveFile?docid=43090
24642465

2465-
if (isRealData && (fDet == kSBND) && (rec.sbnd_frames.frameApplyAtCaf != 0.0))
2466+
if (isRealData && (fDet == kSBND))
24662467
{
2467-
mf::LogInfo("CAFMaker") << "Setting Reference Timing for timing object in SBND \n"
2468-
<< " Shift Apply At Caf Level = " << rec.sbnd_frames.frameApplyAtCaf << " ns\n";
2469-
2470-
//shift reference frame for CRT objects: crt trk, crt sp, crt sp match, crt trk match
2471-
SBNDShiftCRTReference(rec, rec.sbnd_frames.frameApplyAtCaf);
2468+
if ((rec.sbnd_frames.frameApplyAtCaf != kSignalingNaN) && (rec.sbnd_frames.frameApplyAtCaf != 0.0)){
2469+
mf::LogInfo("CAFMaker") << "Setting Reference Timing for timing object in SBND \n"
2470+
<< " Shift Apply At Caf Level = " << rec.sbnd_frames.frameApplyAtCaf << " ns\n";
2471+
2472+
//shift reference frame for CRT objects: crt trk, crt sp, crt sp match, crt trk match
2473+
SBNDShiftCRTReference(rec, rec.sbnd_frames.frameApplyAtCaf);
24722474

2473-
//shift reference frame for PMT objects: opflash, opt0
2474-
SBNDShiftPMTReference(rec, rec.sbnd_frames.frameApplyAtCaf);
2475+
//shift reference frame for PMT objects: opflash, opt0
2476+
SBNDShiftPMTReference(rec, rec.sbnd_frames.frameApplyAtCaf);
2477+
}
24752478
}
24762479

24772480
// Get metadata information for header

0 commit comments

Comments
 (0)