Skip to content

Commit 47c8b21

Browse files
committed
first commit of software trigger additions
1 parent 30569b2 commit 47c8b21

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
@@ -357,6 +357,12 @@ namespace caf
357357
"" // sbnd
358358
};
359359

360+
Atom<string> SBNDSoftwareTriggerLabel{
361+
Name("SBNDSoftwareTriggerLabel"),
362+
Comment("Label for software trigger producer"),
363+
"" // sbnd
364+
};
365+
360366
Atom<string> CRTPMTLabel {
361367
Name("CRTPMTLabel"),
362368
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
@@ -1715,6 +1715,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
17151715
std::vector<caf::SRSBNDCRTTrack> srsbndcrttracks;
17161716
caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo;
17171717
caf::SRSBNDTimingInfo srsbndtiminginfo;
1718+
caf::SRSoftwareTrigger srsbndsofttrig;
17181719

17191720
// Mapping of (feb, channel) to truth information (AuxDetSimChannel) -- filled for ICARUS
17201721
std::map<std::pair<int, int>, sim::AuxDetSimChannel> crtsimchanmap;
@@ -1799,6 +1800,15 @@ void CAFMaker::produce(art::Event& evt) noexcept {
17991800
sbnd::timing::TimingInfo const& sbndtiminginfo(*sbndtiminginfo_handle);
18001801
FillSBNDTimingInfo(sbndtiminginfo, srsbndtiminginfo);
18011802
}
1803+
1804+
art::Handle<std::vector<sbnd::trigger::pmtSoftwareTrigger>> sbndsofttrig_handle;
1805+
GetByLabelStrict(evt, fParams.SBNDSoftwareTriggerLabel(), sbndsofttrig_handle);
1806+
if (sbndsofttrig_handle.isValid()){
1807+
const std::vector<sbnd::trigger::pmtSoftwareTrigger> &sbndsofttrig = *sbndsofttrig_handle;
1808+
if (sbndsofttrig.size()==1){
1809+
FillSoftwareTrigger(sbndsofttrig.at(0), srsbndsofttrig);
1810+
}
1811+
}
18021812
}
18031813

18041814
// Get all of the CRTPMT Matches
@@ -2545,6 +2555,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
25452555
rec.nopflashes = srflashes.size();
25462556
rec.sbnd_frames = srsbndframeshiftinfo;
25472557
rec.sbnd_timings = srsbndtiminginfo;
2558+
rec.soft_trig = srsbndsofttrig;
25482559

25492560
if (fParams.FillTrueParticles()) {
25502561
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
@@ -59,7 +59,11 @@ namespace caf
5959
triggerInfo.monpulse_sizes = *monpulseSizes;
6060
triggerInfo.num_pairs_over_threshold = *numPairs;
6161
triggerInfo.passed_trigger = *passedTrig;
62-
6362
}
6463

64+
void FillSoftwareTrigger(const sbnd::trigger::pmtSoftwareTrigger& softInfo, caf::SRSoftwareTrigger& caf_softInfo){
65+
caf_softInfo.npmts = softInfo.nAboveThreshold;
66+
caf_softInfo.flash_peakpe = softInfo.peakPE;
67+
caf_softInfo.flash_peaktime = softInfo.peaktime + softInfo.trig_ts*1e-3;
68+
}
6569
}

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
#include <vector>
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 FillSoftwareTrigger(const sbnd::trigger::pmtSoftwareTrigger& softInfo, caf::SRSoftwareTrigger& caf_softInfo);
3033
}
3134

3235
#endif

0 commit comments

Comments
 (0)