Skip to content
Merged
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
6 changes: 6 additions & 0 deletions sbncode/CAFMaker/CAFMakerParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,12 @@ namespace caf
"" // sbnd
};

Atom<string> SBNDSoftwareTriggerLabel{
Name("SBNDSoftwareTriggerLabel"),
Comment("Label for software trigger producer"),
"" // sbnd
};

Atom<string> CRTPMTLabel {
Name("CRTPMTLabel"),
Comment("Label for the CRTPMT Matched variables from the crtpmt data product"),
Expand Down
11 changes: 11 additions & 0 deletions sbncode/CAFMaker/CAFMaker_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
caf::SRSBNDCRTVeto srsbndcrtveto;
caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo;
caf::SRSBNDTimingInfo srsbndtiminginfo;
caf::SRSoftwareTrigger srsbndsofttrig;

// Mapping of (feb, channel) to truth information (AuxDetSimChannel) -- filled for ICARUS
std::map<std::pair<int, int>, sim::AuxDetSimChannel> crtsimchanmap;
Expand Down Expand Up @@ -1843,6 +1844,15 @@ void CAFMaker::produce(art::Event& evt) noexcept {
sbnd::timing::TimingInfo const& sbndtiminginfo(*sbndtiminginfo_handle);
FillSBNDTimingInfo(sbndtiminginfo, srsbndtiminginfo);
}

art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> sbndsofttrig_handle;
GetByLabelStrict(evt, fParams.SBNDSoftwareTriggerLabel(), sbndsofttrig_handle);
if (sbndsofttrig_handle.isValid()){
const std::vector<sbnd::trigger::pmtSoftwareTrigger> &sbndsofttrig = *sbndsofttrig_handle;
if (sbndsofttrig.size()==1){
FillSoftwareTriggerSBND(sbndsofttrig.at(0), srsbndsofttrig);
}
}
}

// Get all of the CRTPMT Matches
Expand Down Expand Up @@ -2590,6 +2600,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
rec.nopflashes = srflashes.size();
rec.sbnd_frames = srsbndframeshiftinfo;
rec.sbnd_timings = srsbndtiminginfo;
rec.soft_trig = srsbndsofttrig;

if (fParams.FillTrueParticles()) {
rec.true_particles = true_particles;
Expand Down
3 changes: 2 additions & 1 deletion sbncode/CAFMaker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ art_make_library( LIBRARY_NAME sbncode_CAFMaker
art::Framework_Services_System_TriggerNamesService_service
sbncode_Metadata_MetadataSBN_service
larsim::Utils
larevt::SpaceCharge
larevt::SpaceCharge
systematicstools::interface
systematicstools::interpreters
systematicstools::utility
${GENIE_LIB_LIST}
nugen::EventGeneratorBase_GENIE
sbndaq_artdaq_core::sbndaq-artdaq-core_Obj_SBND
)

cet_build_plugin ( CAFMaker art::module
Expand Down
6 changes: 5 additions & 1 deletion sbncode/CAFMaker/FillTrigger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ namespace caf
triggerInfo.monpulse_sizes = *monpulseSizes;
triggerInfo.num_pairs_over_threshold = *numPairs;
triggerInfo.passed_trigger = *passedTrig;

}

void FillSoftwareTriggerSBND(const sbnd::trigger::pmtSoftwareTrigger& softInfo, caf::SRSoftwareTrigger& caf_softInfo){
caf_softInfo.npmts = softInfo.nAboveThreshold;
caf_softInfo.flash_peakpe = softInfo.peakPE;
caf_softInfo.flash_peaktime = softInfo.peaktime + softInfo.trig_ts*1e-3;
}
}
3 changes: 3 additions & 0 deletions sbncode/CAFMaker/FillTrigger.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
#include "sbnobj/Common/Trigger/ExtraTriggerInfo.h"
#include "sbnobj/Common/Trigger/BeamBits.h"
#include "sbnanaobj/StandardRecord/SRTrigger.h"
#include "sbnanaobj/StandardRecord/SRSoftwareTrigger.h"
#include "sbnanaobj/StandardRecord/SRSBNDTimingInfo.h"
#include "lardataobj/RawData/TriggerData.h"
#include "art/Framework/Principal/Handle.h"
#include "sbndaq-artdaq-core/Obj/SBND/pmtSoftwareTrigger.hh"

namespace caf
{
Expand All @@ -27,6 +29,7 @@ namespace caf
art::Handle<int> const& numPairs,
art::Handle<bool> const& passedTrig,
caf::SRTrigger& triggerInfo);
void FillSoftwareTriggerSBND(const sbnd::trigger::pmtSoftwareTrigger& softInfo, caf::SRSoftwareTrigger& caf_softInfo);
}

#endif