Skip to content

Commit f868720

Browse files
committed
first commit
1 parent fb929f3 commit f868720

4 files changed

Lines changed: 71 additions & 0 deletions

File tree

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,18 @@ namespace caf
338338
"crttracks" // sbnd
339339
};
340340

341+
Atom<string> SBNDFrameShiftInfoLabel {
342+
Name("SBNDFrameShiftInfoLabel"),
343+
Comment("Label of sbnd frame shift."),
344+
"reco1" // sbnd
345+
};
346+
347+
Atom<string> SBNDTimingInfoLabel {
348+
Name("SBNDTimingInfoLabel"),
349+
Comment("Label of sbnd timing shift."),
350+
"reco1" // sbnd
351+
};
352+
341353
Atom<string> CRTPMTLabel {
342354
Name("CRTPMTLabel"),
343355
Comment("Label for the CRTPMT Matched variables from the crtpmt data product"),

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,6 +1603,8 @@ void CAFMaker::produce(art::Event& evt) noexcept {
16031603
std::vector<caf::SRCRTTrack> srcrttracks;
16041604
std::vector<caf::SRCRTSpacePoint> srcrtspacepoints;
16051605
std::vector<caf::SRSBNDCRTTrack> srsbndcrttracks;
1606+
std::vector<caf::SRSBNDFrameShiftInfo> srsbndframeshiftinfo;
1607+
std::vector<caf::SRSBNDTimingInfo> srsbndtiminginfo;
16061608

16071609
if(fDet == kICARUS)
16081610
{
@@ -1651,6 +1653,29 @@ void CAFMaker::produce(art::Event& evt) noexcept {
16511653
FillSBNDCRTTrack(sbndcrttracks[i], srsbndcrttracks.back());
16521654
}
16531655
}
1656+
1657+
art::Handle<std::vector<raw::FrameShiftInfo>> sbndframeshiftinfo_handle;
1658+
GetByLabelStrict(evt, fParams.SBNDFrameShiftInfoLabel(), sbndframeshiftinfo_handle);
1659+
// fill into event
1660+
if (sbndframeshiftinfo_handle.isValid()) {
1661+
const std::vector<raw::FrameShiftInfo> &sbndframeshiftinfo = *sbndframeshiftinfo_handle;
1662+
for (unsigned i = 0; i < sbndframeshiftinfo.size(); i++) {
1663+
srsbndframeshiftinfo.emplace_back();
1664+
FillSBNDFrameShiftInfo(sbndframeshiftinfo[i], srsbndframeshiftinfo.back());
1665+
}
1666+
}
1667+
1668+
art::Handle<std::vector<raw::TimingInfo>> sbndtiminginfo_handle;
1669+
GetByLabelStrict(evt, fParams.SBNDTimingInfoLabel(), sbndtiminginfo_handle);
1670+
// fill into event
1671+
if (sbndtiminginfo_handle.isValid()) {
1672+
const std::vector<raw::TimingInfo> &sbndtiminginfo = *sbndtiminginfo_handle;
1673+
for (unsigned i = 0; i < sbndtiminginfo.size(); i++) {
1674+
srsbndtiminginfo.emplace_back();
1675+
FillSBNDTimingInfo(sbndtiminginfo[i], srsbndtiminginfo.back());
1676+
}
1677+
}
1678+
16541679
}
16551680

16561681
// Get all of the CRTPMT Matches

sbncode/CAFMaker/FillReco.cxx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,31 @@ namespace caf
141141
srsbndcrttrack.tof = track.ToF();
142142
}
143143

144+
void FillSBNDFrameShiftInfo(const raw::FrameShiftInfo &frame,
145+
caf::SRSBNDFrameShiftInfo &srsbndframe,
146+
bool allowEmpty)
147+
{
148+
srsbndframe.frameTdcCrtt1 = frame.frameTdcCrtt1;
149+
srsbndframe.frameTdcBes = frame.frameTdcBes;
150+
srsbndframe.frameTdcRwm = frame.frameTdcRwm;
151+
srsbndframe.frameHltCrtt1 = frame.frameHltCrtt1;
152+
srsbndframe.frameHltBeamGate = frame.frameHltBeamGate;
153+
srsbndframe.frameDataToMC = frame.frameDataToMC;
154+
}
155+
156+
void FillSBNDTimingInfo(const raw::TimingInfo &timing,
157+
caf::SRSBNDTimingInfo &srsbndtiming,
158+
bool allowEmpty)
159+
{
160+
srsbndtiming.tdcCrtt1 = timing.tdcCrtt1;
161+
srsbndtiming.tdcBes = timing.tdcBes;
162+
srsbndtiming.tdcRwm = timing.tdcRwm;
163+
srsbndtiming.tdcEtrig = timing.tdcEtrig;
164+
srsbndtiming.hltCrtt1 = timing.hltCrtt1;
165+
srsbndtiming.hltEtrig = timing.hltEtrig;
166+
srsbndtiming.hltBeamGate = timing.hltBeamGate;
167+
}
168+
144169
void FillCRTPMTMatch(const sbn::crt::CRTPMTMatching &match,
145170
caf::SRCRTPMTMatch &srmatch,
146171
bool allowEmpty){

sbncode/CAFMaker/FillReco.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
4545
#include "nusimdata/SimulationBase/MCParticle.h"
4646
#include "nusimdata/SimulationBase/MCTruth.h"
47+
#include "sbndcode/Timing/SBNDRawTimingObj.h"
4748

4849
#include "sbnanaobj/StandardRecord/SRSlice.h"
4950
#include "sbnanaobj/StandardRecord/StandardRecord.h"
@@ -279,6 +280,14 @@ namespace caf
279280
caf::SRPFP& srpfp,
280281
bool allowEmpty = false);
281282

283+
void FillSBNDFrameShiftInfo(const raw::FrameShiftInfo &frame,
284+
caf::SRSBNDFrameShiftInfo &srsbndframe,
285+
bool allowEmpty = false);
286+
287+
void FillSBNDTimingInfo(const raw::TimingInfo &timing,
288+
caf::SRSBNDTimingInfo &srsbndtiming,
289+
bool allowEmpty = false);
290+
282291
template<class T, class U>
283292
void CopyPropertyIfSet( const std::map<std::string, T>& props, const std::string& search, U& value );
284293
}

0 commit comments

Comments
 (0)