Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions sbncode/BeamSpillInfoRetriever/BNBRetriever/BNBRetriever_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@

#include "sbnobj/Common/POTAccounting/BNBSpillInfo.h"

#include "sbncode/BeamSpillInfoRetriever/POTTools.h"
#include "sbncode/BeamSpillInfoRetriever/getFOM.h"

#include "ifdh_art/IFBeamService/IFBeam_service.h"
#include "ifbeam_c.h"
#include "MWRData.h"
Expand Down Expand Up @@ -130,6 +133,8 @@ class sbn::BNBRetriever : public art::EDProducer {
//
art::ServiceHandle<ifbeam_ns::IFBeam> ifbeam_handle;
std::unique_ptr<ifbeam_ns::BeamFolder> bfp;
std::unique_ptr<ifbeam_ns::BeamFolder> offsets;
std::unique_ptr<ifbeam_ns::BeamFolder> vp873;
std::unique_ptr<ifbeam_ns::BeamFolder> bfp_mwr;

//
Expand Down Expand Up @@ -260,6 +265,8 @@ sbn::BNBRetriever::BNBRetriever(Parameters const& params)
raw_data_label(params().RawDataLabel()),
fDeviceUsedForTiming(params().DeviceUsedForTiming()),
bfp( ifbeam_handle->getBeamFolder(params().Bundle(), params().URL(), params().TimeWindow())),
vp873( ifbeam_handle->getBeamFolder(params().VP873Bundle(), params().URL(), params().TimeWindow())),
offsets( ifbeam_handle->getBeamFolder(params().OffsetBundle(), params().URL(), params().TimeWindow())),
bfp_mwr( ifbeam_handle->getBeamFolder(params().MultiWireBundle(), params().URL(), params().MWR_TimeWindow())),
fTriggerDatabaseFile(params().TriggerDatabaseFile())
{
Expand All @@ -278,7 +285,9 @@ sbn::BNBRetriever::BNBRetriever(Parameters const& params)
//
bfp->set_epsilon(0.02); //20 ms, this was tuned by hand and compared to IFBeamDB times
bfp_mwr->set_epsilon(0.5);

vp873->set_epsilon(0.02);
offsets->set_epsilon(600);

//bfp_mwr->setValidWindow(86400);
bfp_mwr->setValidWindow(3605);
produces< std::vector< sbn::BNBSpillInfo >, art::InSubRun >();
Expand Down Expand Up @@ -633,8 +642,9 @@ int sbn::BNBRetriever::matchMultiWireData(

}//end loop over MWR devices

sbn::BNBSpillInfo spillInfo = makeBNBSpillInfo(eventID, times_temps[i], MWRdata, matched_MWR);

sbn::BNBSpillInfo spillInfo = sbn::pot::makeBNBSpillInfo(eventID, times_temps[i], MWRdata, matched_MWR, bfp, offsets, vp873);
double const spillFOM = sbn::getBNBqualityFOM(spillInfo);
spillInfo.FOM = spillFOM;
beamInfos.push_back(std::move(spillInfo));

// We do not write these to the art::Events because
Expand Down
2 changes: 2 additions & 0 deletions sbncode/BeamSpillInfoRetriever/job/bnbspillinfo.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ bnbspillinfo: {
URL: "" #keep this blank and we're good
Bundle: "BoosterNeutrinoBeam_read"
MultiWireBundle: "BNBMultiWire"
VP873Bundle: "BNB_monitor"
OffsetBundle: "BNB_BPM_settings"
TimeWindow: "700" #seconds
MWR_TimeWindow: "3601" #seconds
raw_data_label: "daq"
Expand Down