Skip to content

Commit 54f41b8

Browse files
authored
Merge pull request #604 from SBNSoftware/feature/lynnt_Fall25_pmtmetrics
PMT Software Trigger
2 parents b9afc9f + d227faf commit 54f41b8

5 files changed

Lines changed: 27 additions & 2 deletions

File tree

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,12 @@ namespace caf
363363
"" // sbnd
364364
};
365365

366+
Atom<string> SBNDSoftwareTriggerLabel{
367+
Name("SBNDSoftwareTriggerLabel"),
368+
Comment("Label for software trigger producer"),
369+
"" // sbnd
370+
};
371+
366372
Atom<string> CRTPMTLabel {
367373
Name("CRTPMTLabel"),
368374
Comment("Label for the CRTPMT Matched variables from the crtpmt data product"),

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
17411741
caf::SRSBNDCRTVeto srsbndcrtveto;
17421742
caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo;
17431743
caf::SRSBNDTimingInfo srsbndtiminginfo;
1744+
caf::SRSoftwareTrigger srsbndsofttrig;
17441745

17451746
// Mapping of (feb, channel) to truth information (AuxDetSimChannel) -- filled for ICARUS
17461747
std::map<std::pair<int, int>, sim::AuxDetSimChannel> crtsimchanmap;
@@ -1843,6 +1844,15 @@ void CAFMaker::produce(art::Event& evt) noexcept {
18431844
sbnd::timing::TimingInfo const& sbndtiminginfo(*sbndtiminginfo_handle);
18441845
FillSBNDTimingInfo(sbndtiminginfo, srsbndtiminginfo);
18451846
}
1847+
1848+
art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> sbndsofttrig_handle;
1849+
GetByLabelStrict(evt, fParams.SBNDSoftwareTriggerLabel(), sbndsofttrig_handle);
1850+
if (sbndsofttrig_handle.isValid()){
1851+
const std::vector<sbnd::trigger::pmtSoftwareTrigger> &sbndsofttrig = *sbndsofttrig_handle;
1852+
if (sbndsofttrig.size()==1){
1853+
FillSoftwareTriggerSBND(sbndsofttrig.at(0), srsbndsofttrig);
1854+
}
1855+
}
18461856
}
18471857

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

25942605
if (fParams.FillTrueParticles()) {
25952606
rec.true_particles = true_particles;

sbncode/CAFMaker/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ art_make_library( LIBRARY_NAME sbncode_CAFMaker
4343
art::Framework_Services_System_TriggerNamesService_service
4444
sbncode_Metadata_MetadataSBN_service
4545
larsim::Utils
46-
larevt::SpaceCharge
46+
larevt::SpaceCharge
4747
systematicstools::interface
4848
systematicstools::interpreters
4949
systematicstools::utility
5050
${GENIE_LIB_LIST}
5151
nugen::EventGeneratorBase_GENIE
52+
sbndaq_artdaq_core::sbndaq-artdaq-core_Obj_SBND
5253
)
5354

5455
cet_build_plugin ( CAFMaker art::module

sbncode/CAFMaker/FillTrigger.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ namespace caf
6666
triggerInfo.monpulse_sizes = *monpulseSizes;
6767
triggerInfo.num_pairs_over_threshold = *numPairs;
6868
triggerInfo.passed_trigger = *passedTrig;
69-
7069
}
7170

71+
void FillSoftwareTriggerSBND(const sbnd::trigger::pmtSoftwareTrigger& softInfo, caf::SRSoftwareTrigger& caf_softInfo){
72+
caf_softInfo.npmts = softInfo.nAboveThreshold;
73+
caf_softInfo.flash_peakpe = softInfo.peakPE;
74+
caf_softInfo.flash_peaktime = softInfo.peaktime + softInfo.trig_ts*1e-3;
75+
}
7276
}

sbncode/CAFMaker/FillTrigger.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
#include "sbnobj/Common/Trigger/ExtraTriggerInfo.h"
55
#include "sbnobj/Common/Trigger/BeamBits.h"
66
#include "sbnanaobj/StandardRecord/SRTrigger.h"
7+
#include "sbnanaobj/StandardRecord/SRSoftwareTrigger.h"
78
#include "sbnanaobj/StandardRecord/SRSBNDTimingInfo.h"
89
#include "lardataobj/RawData/TriggerData.h"
910
#include "art/Framework/Principal/Handle.h"
11+
#include "sbndaq-artdaq-core/Obj/SBND/pmtSoftwareTrigger.hh"
1012

1113
namespace caf
1214
{
@@ -27,6 +29,7 @@ namespace caf
2729
art::Handle<int> const& numPairs,
2830
art::Handle<bool> const& passedTrig,
2931
caf::SRTrigger& triggerInfo);
32+
void FillSoftwareTriggerSBND(const sbnd::trigger::pmtSoftwareTrigger& softInfo, caf::SRSoftwareTrigger& caf_softInfo);
3033
}
3134

3235
#endif

0 commit comments

Comments
 (0)