Skip to content

Commit 4f49aba

Browse files
committed
add fixes
1 parent b0dd48b commit 4f49aba

3 files changed

Lines changed: 19 additions & 34 deletions

File tree

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ namespace caf
341341
Atom<string> SBNDFrameShiftInfoLabel {
342342
Name("SBNDFrameShiftInfoLabel"),
343343
Comment("Label of sbnd frame shift."),
344-
"framshift" // sbnd
344+
"frameshift" // sbnd
345345
};
346346

347347
Atom<string> SBNDTimingInfoLabel {

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1641,8 +1641,8 @@ void CAFMaker::produce(art::Event& evt) noexcept {
16411641
std::vector<caf::SRCRTTrack> srcrttracks;
16421642
std::vector<caf::SRCRTSpacePoint> srcrtspacepoints;
16431643
std::vector<caf::SRSBNDCRTTrack> srsbndcrttracks;
1644-
std::vector<caf::SRSBNDFrameShiftInfo> srsbndframeshiftinfo;
1645-
std::vector<caf::SRSBNDTimingInfo> srsbndtiminginfo;
1644+
caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo;
1645+
caf::SRSBNDTimingInfo srsbndtiminginfo;
16461646

16471647
if(fDet == kICARUS)
16481648
{
@@ -1691,29 +1691,22 @@ void CAFMaker::produce(art::Event& evt) noexcept {
16911691
FillSBNDCRTTrack(sbndcrttracks[i], srsbndcrttracks.back());
16921692
}
16931693
}
1694-
1695-
art::Handle<std::vector<raw::FrameShiftInfo>> sbndframeshiftinfo_handle;
1694+
1695+
art::Handle<raw::FrameShiftInfo> sbndframeshiftinfo_handle;
16961696
GetByLabelStrict(evt, fParams.SBNDFrameShiftInfoLabel(), sbndframeshiftinfo_handle);
16971697
// fill into event
16981698
if (sbndframeshiftinfo_handle.isValid()) {
1699-
const std::vector<raw::FrameShiftInfo> &sbndframeshiftinfo = *sbndframeshiftinfo_handle;
1700-
for (unsigned i = 0; i < sbndframeshiftinfo.size(); i++) {
1701-
srsbndframeshiftinfo.emplace_back();
1702-
FillSBNDFrameShiftInfo(sbndframeshiftinfo[i], srsbndframeshiftinfo.back());
1703-
}
1699+
raw::FrameShiftInfo const& sbndframeshiftinfo(*sbndframeshiftinfo_handle);
1700+
FillSBNDFrameShiftInfo(sbndframeshiftinfo, srsbndframeshiftinfo);
17041701
}
17051702

1706-
art::Handle<std::vector<raw::TimingInfo>> sbndtiminginfo_handle;
1703+
art::Handle<raw::TimingInfo> sbndtiminginfo_handle;
17071704
GetByLabelStrict(evt, fParams.SBNDTimingInfoLabel(), sbndtiminginfo_handle);
17081705
// fill into event
17091706
if (sbndtiminginfo_handle.isValid()) {
1710-
const std::vector<raw::TimingInfo> &sbndtiminginfo = *sbndtiminginfo_handle;
1711-
for (unsigned i = 0; i < sbndtiminginfo.size(); i++) {
1712-
srsbndtiminginfo.emplace_back();
1713-
FillSBNDTimingInfo(sbndtiminginfo[i], srsbndtiminginfo.back());
1714-
}
1707+
raw::TimingInfo const& sbndtiminginfo(*sbndtiminginfo_handle);
1708+
FillSBNDTimingInfo(sbndtiminginfo, srsbndtiminginfo);
17151709
}
1716-
17171710
}
17181711

17191712
// Get all of the CRTPMT Matches
@@ -2421,9 +2414,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24212414
rec.opflashes = srflashes;
24222415
rec.nopflashes = srflashes.size();
24232416
rec.sbnd_frames = srsbndframeshiftinfo;
2424-
rec.nsbnd_frames = srsbndframeshiftinfo.size();
24252417
rec.sbnd_timings = srsbndtiminginfo;
2426-
rec.nsbnd_timings = srsbndtiminginfo.size();
24272418

24282419
if (fParams.FillTrueParticles()) {
24292420
rec.true_particles = true_particles;
@@ -2465,24 +2456,17 @@ void CAFMaker::produce(art::Event& evt) noexcept {
24652456

24662457
// TODO: TPC?
24672458

2468-
// SBND: Fix the Reference time (See docdb# ????? and FrameShift module on sbndcode repo)
2469-
2459+
// SBND: Fix the Reference time in data depending on the stream (See FrameShift module on sbndcode repo)
24702460
if (isRealData & (fDet == kSBND))
24712461
{
2472-
mf::LogInfo("CAFMaker") << "Setting Reference Timing for timing object in SBND" ;
2473-
2474-
//Should only be 1 set of frame per event, if not, something is really wrong and nothing should be corrected
2475-
if (rec.nsbnd_frames == 1)
2476-
{
2477-
SRSBNDFrameShiftInfo frame = rec.sbnd_frames.at(0);
2478-
2479-
//shift reference frame for CRT objects: crt trk, crt sp, crt sp match, crt trk match
2480-
SBNDShiftCRTReference(rec, frame.frameApplyAtCaf);
2481-
2482-
//shift reference frame for PMT objects: opflash, opt0
2483-
SBNDShiftPMTReference(rec, frame.frameApplyAtCaf);
2484-
}
2462+
mf::LogInfo("CAFMaker") << "Setting Reference Timing for timing object in SBND \n"
2463+
<< " Shift Apply At Caf Level = " << rec.sbnd_frames.frameApplyAtCaf << " ns\n";
2464+
2465+
//shift reference frame for CRT objects: crt trk, crt sp, crt sp match, crt trk match
2466+
SBNDShiftCRTReference(rec, rec.sbnd_frames.frameApplyAtCaf);
24852467

2468+
//shift reference frame for PMT objects: opflash, opt0
2469+
SBNDShiftPMTReference(rec, rec.sbnd_frames.frameApplyAtCaf);
24862470
}
24872471

24882472
// Get metadata information for header

sbncode/CAFMaker/FillReco.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ namespace caf
158158
caf::SRSBNDTimingInfo &srsbndtiming,
159159
bool allowEmpty)
160160
{
161+
srsbndtiming.rawDAQHeaderTimestamp = timing.rawDAQHeaderTimestamp;
161162
srsbndtiming.tdcCrtt1 = timing.tdcCrtt1;
162163
srsbndtiming.tdcBes = timing.tdcBes;
163164
srsbndtiming.tdcRwm = timing.tdcRwm;

0 commit comments

Comments
 (0)