From af54b159104f8fa4290cb935f2b7c8db818e0006 Mon Sep 17 00:00:00 2001 From: nathanielerowe <70993723+nathanielerowe@users.noreply.github.com> Date: Thu, 30 Oct 2025 13:27:14 -0500 Subject: [PATCH 1/2] add primed for bfp --- sbncode/BeamSpillInfoRetriever/POTTools.cpp | 9 ++++++++- .../SBNDBNBRetriever/SBNDBNBRetriever_module.cc | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/sbncode/BeamSpillInfoRetriever/POTTools.cpp b/sbncode/BeamSpillInfoRetriever/POTTools.cpp index 48f6984df..1524b522d 100644 --- a/sbncode/BeamSpillInfoRetriever/POTTools.cpp +++ b/sbncode/BeamSpillInfoRetriever/POTTools.cpp @@ -277,13 +277,20 @@ namespace sbn::pot{ } } - sbn::pot::MWRdata_t extractSpillTimes(TriggerInfo_t const& triggerInfo, std::unique_ptr const& bfp, std::unique_ptr const& bfp_mwr, double fTimePad, double MWRtoroidDelay, sbn::MWRData mwrdata) { + sbn::pot::MWRdata_t extractSpillTimes(TriggerInfo_t const& triggerInfo, std::unique_ptr const& bfp, std::unique_ptr const& bfp_mwr, std::unique_ptr const& vp873, std::unique_ptr const& offsets, double fTimePad, double MWRtoroidDelay, sbn::MWRData mwrdata) { // These lines get everything primed within the IFBeamDB. try{bfp->FillCache((triggerInfo.t_current_event)+fTimePad);} catch (WebAPIException &we) {}; try{bfp->FillCache((triggerInfo.t_previous_event)-fTimePad);} catch (WebAPIException &we) {}; try{bfp_mwr->FillCache((triggerInfo.t_current_event)+fTimePad);} catch (WebAPIException &we) {}; try{bfp_mwr->FillCache((triggerInfo.t_previous_event)-fTimePad);} catch (WebAPIException &we) {}; + + // Added Oct 30 by N. Rowe + try{vp873->FillCache((triggerInfo.t_current_event)+fTimePad);} catch (WebAPIException &we) {}; + try{vp873->FillCache((triggerInfo.t_previous_event)-fTimePad);} catch (WebAPIException &we) {}; + try{offsets->FillCache((triggerInfo.t_current_event)+fTimePad);} catch (WebAPIException &we) {}; + try{offsets->FillCache((triggerInfo.t_previous_event)-fTimePad);} catch (WebAPIException &we) {}; + // The multiwire chambers provide their // data in a vector format but we'll have diff --git a/sbncode/BeamSpillInfoRetriever/SBNDBNBRetriever/SBNDBNBRetriever_module.cc b/sbncode/BeamSpillInfoRetriever/SBNDBNBRetriever/SBNDBNBRetriever_module.cc index 97ca57d6d..35318be71 100644 --- a/sbncode/BeamSpillInfoRetriever/SBNDBNBRetriever/SBNDBNBRetriever_module.cc +++ b/sbncode/BeamSpillInfoRetriever/SBNDBNBRetriever/SBNDBNBRetriever_module.cc @@ -95,7 +95,7 @@ void sbn::SBNDBNBRetriever::produce(art::Event & e) } TotalBeamSpills += triggerInfo.number_of_gates_since_previous_event; - sbn::pot::MWRdata_t const MWRdata = extractSpillTimes(triggerInfo, bfp, bfp_mwr, fTimePad, MWRtoroidDelay, mwrdata); + sbn::pot::MWRdata_t const MWRdata = extractSpillTimes(triggerInfo, bfp, bfp_mwr, vp873, offsets, fTimePad, MWRtoroidDelay, mwrdata); int const spill_count = matchMultiWireData(e.id(), triggerInfo, MWRdata, fOutbeamInfos); From 123e634c7f77b4f065d0a60f3adc77f175c5a817 Mon Sep 17 00:00:00 2001 From: nathanielerowe <70993723+nathanielerowe@users.noreply.github.com> Date: Thu, 30 Oct 2025 13:31:44 -0500 Subject: [PATCH 2/2] Also add to icarus+zerobias --- .../ICARUSBNBRetriever/ICARUSBNBRetriever_module.cc | 4 ++-- sbncode/BeamSpillInfoRetriever/POTTools.h | 2 +- .../SBNDBNBZEROBIASRetriever_module.cc | 3 +-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sbncode/BeamSpillInfoRetriever/ICARUSBNBRetriever/ICARUSBNBRetriever_module.cc b/sbncode/BeamSpillInfoRetriever/ICARUSBNBRetriever/ICARUSBNBRetriever_module.cc index 077eb4c9e..b2fc9d9a0 100644 --- a/sbncode/BeamSpillInfoRetriever/ICARUSBNBRetriever/ICARUSBNBRetriever_module.cc +++ b/sbncode/BeamSpillInfoRetriever/ICARUSBNBRetriever/ICARUSBNBRetriever_module.cc @@ -287,8 +287,8 @@ void sbn::ICARUSBNBRetriever::produce(art::Event& e) // Keep track of the number of beam gates the DAQ thinks // are in this job TotalBeamSpills += triggerInfo.number_of_gates_since_previous_event; - sbn::pot::MWRdata_t const MWRdata = extractSpillTimes(triggerInfo, bfp, bfp_mwr, fTimePad, MWRtoroidDelay, mwrdata); - + sbn::pot::MWRdata_t const MWRdata = extractSpillTimes(triggerInfo, bfp, bfp_mwr, vp873, offsets, fTimePad, MWRtoroidDelay, mwrdata); + int const spill_count = matchMultiWireData(e.id(), triggerInfo, MWRdata, fOutbeamInfos); if(spill_count > int(triggerInfo.number_of_gates_since_previous_event)) diff --git a/sbncode/BeamSpillInfoRetriever/POTTools.h b/sbncode/BeamSpillInfoRetriever/POTTools.h index cb78fe686..62dba3665 100644 --- a/sbncode/BeamSpillInfoRetriever/POTTools.h +++ b/sbncode/BeamSpillInfoRetriever/POTTools.h @@ -71,7 +71,7 @@ namespace sbn::pot{ * @param MWRtoroidDelay Delay between MWR and toroids * @param mwrdata MWRData to unpack */ - MWRdata_t extractSpillTimes(TriggerInfo_t const& triggerInfo, std::unique_ptr const& bfp, std::unique_ptr const& bfp_mwr, double fTimePad, double MWRtoroidDelay, sbn::MWRData mwrdata ); + MWRdata_t extractSpillTimes(TriggerInfo_t const& triggerInfo, std::unique_ptr const& bfp, std::unique_ptr const& bfp_mwr, std::unique_ptr const& offsets, std::unique_ptr const& vp873, double fTimePad, double MWRtoroidDelay, sbn::MWRData mwrdata ); /** * @brief Compile spill information into BNBSpillInfo object */ diff --git a/sbncode/BeamSpillInfoRetriever/SBNDBNBZEROBIASRetriever/SBNDBNBZEROBIASRetriever_module.cc b/sbncode/BeamSpillInfoRetriever/SBNDBNBZEROBIASRetriever/SBNDBNBZEROBIASRetriever_module.cc index c22c70411..7138a4aaf 100644 --- a/sbncode/BeamSpillInfoRetriever/SBNDBNBZEROBIASRetriever/SBNDBNBZEROBIASRetriever_module.cc +++ b/sbncode/BeamSpillInfoRetriever/SBNDBNBZEROBIASRetriever/SBNDBNBZEROBIASRetriever_module.cc @@ -97,9 +97,8 @@ void sbn::SBNDBNBZEROBIASRetriever::produce(art::Event & e) e.put(std::move(p)); return; } - TotalBeamSpills += triggerInfo.number_of_gates_since_previous_event; - sbn::pot::MWRdata_t const MWRdata = extractSpillTimes(triggerInfo, bfp, bfp_mwr, fTimePad, MWRtoroidDelay, mwrdata); + sbn::pot::MWRdata_t const MWRdata = extractSpillTimes(triggerInfo, bfp, bfp_mwr, vp873, offsets, fTimePad, MWRtoroidDelay, mwrdata); matchMultiWireData(e.id(), triggerInfo, MWRdata, fOutbeamInfos); fOutbeamInfosTotal.insert(fOutbeamInfosTotal.end(),fOutbeamInfos.begin(),fOutbeamInfos.end());