Skip to content

Commit 6b68ceb

Browse files
authored
Merge branch 'develop' into feature/linyan-addgenievar
2 parents 9456c15 + e6ccf46 commit 6b68ceb

4 files changed

Lines changed: 55 additions & 7 deletions

File tree

sbncode/CAFMaker/CAFMakerParams.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ namespace caf
345345
"crttracks" // sbnd
346346
};
347347

348+
Atom<string> SBNDCRTVetoLabel {
349+
Name("SBNDCRTVetoLabel"),
350+
Comment("Label of sbnd CRT Veto."),
351+
"crtveto" // sbnd
352+
};
353+
348354
Atom<string> SBNDFrameShiftInfoLabel {
349355
Name("SBNDFrameShiftInfoLabel"),
350356
Comment("Label of sbnd frame shift."),

sbncode/CAFMaker/CAFMaker_module.cc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@
118118
#include "sbnobj/Common/Trigger/ExtraTriggerInfo.h"
119119
#include "sbnobj/Common/Reco/CRUMBSResult.h"
120120
#include "sbnobj/Common/Reco/OpT0FinderResult.h"
121+
#include "sbnobj/SBND/CRT/CRTVeto.hh"
121122
#include "sbnobj/Common/Reco/CorrectedOpFlashTiming.h"
122123
#include "sbnobj/SBND/Timing/TimingInfo.hh"
123124
#include "sbnobj/SBND/Timing/FrameShiftInfo.hh"
124125

125-
126126
// GENIE
127127
#include "Framework/EventGen/EventRecord.h"
128128
#include "Framework/Ntuple/NtpMCEventRecord.h"
@@ -1719,6 +1719,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
17191719
std::vector<caf::SRCRTTrack> srcrttracks;
17201720
std::vector<caf::SRCRTSpacePoint> srcrtspacepoints;
17211721
std::vector<caf::SRSBNDCRTTrack> srsbndcrttracks;
1722+
caf::SRSBNDCRTVeto srsbndcrtveto;
17221723
caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo;
17231724
caf::SRSBNDTimingInfo srsbndtiminginfo;
17241725

@@ -1789,6 +1790,24 @@ void CAFMaker::produce(art::Event& evt) noexcept {
17891790
FillSBNDCRTTrack(sbndcrttracks[i], srsbndcrttracks.back());
17901791
}
17911792
}
1793+
1794+
// Fill CRT Veto
1795+
art::Handle<std::vector<sbnd::crt::CRTVeto>> sbndcrtveto_handle;
1796+
GetByLabelStrict(evt, fParams.SBNDCRTVetoLabel(), sbndcrtveto_handle);
1797+
// fill into event
1798+
if (sbndcrtveto_handle.isValid()) {
1799+
const std::vector<sbnd::crt::CRTVeto> &sbndcrtveto_vec = *sbndcrtveto_handle;
1800+
// Only one valid veto per event
1801+
if (sbndcrtveto_vec.size() == 1) {
1802+
// And associated SpacePoint objects
1803+
art::FindManyP<sbnd::crt::CRTSpacePoint> spAssoc(sbndcrtveto_handle, evt, fParams.SBNDCRTVetoLabel());
1804+
if (spAssoc.isValid()) {
1805+
// There is one vector of SpacePoints per Veto --> can be empty if no veto condition was satisfied
1806+
const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>>& veto_sp_v(spAssoc.at(0));
1807+
FillSBNDCRTVeto(sbndcrtveto_vec[0], veto_sp_v, srsbndcrtveto);
1808+
}
1809+
}
1810+
}
17921811

17931812
art::Handle<sbnd::timing::FrameShiftInfo> sbndframeshiftinfo_handle;
17941813
GetByLabelStrict(evt, fParams.SBNDFrameShiftInfoLabel(), sbndframeshiftinfo_handle);
@@ -2547,6 +2566,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
25472566
rec.ncrt_spacepoints = srcrtspacepoints.size();
25482567
rec.sbnd_crt_tracks = srsbndcrttracks;
25492568
rec.nsbnd_crt_tracks = srsbndcrttracks.size();
2569+
rec.sbnd_crt_veto = srsbndcrtveto;
25502570
rec.opflashes = srflashes;
25512571
rec.nopflashes = srflashes.size();
25522572
rec.sbnd_frames = srsbndframeshiftinfo;

sbncode/CAFMaker/FillReco.cxx

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,25 @@ namespace caf
188188
srsbndcrttrack.tof = track.ToF();
189189
}
190190

191+
void FillSBNDCRTVeto(const sbnd::crt::CRTVeto &veto,
192+
const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>> &points,
193+
caf::SRSBNDCRTVeto &srsbndcrtveto,
194+
bool allowEmpty)
195+
{
196+
srsbndcrtveto.V0 = veto.V0();
197+
srsbndcrtveto.V1 = veto.V1();
198+
srsbndcrtveto.V2 = veto.V2();
199+
srsbndcrtveto.V3 = veto.V3();
200+
srsbndcrtveto.V4 = veto.V4();
201+
202+
// add the CRTSpacePoint associations to the SR Veto
203+
for(auto const& sp : points) {
204+
srsbndcrtveto.sp_position.emplace_back(sp->X(), sp->Y(), sp->Z());
205+
srsbndcrtveto.sp_time.push_back(sp->Ts0()); // ns for SBND CRT SpacePoints
206+
srsbndcrtveto.sp_pe.push_back(sp->PE());
207+
}
208+
}
209+
191210
void FillSBNDFrameShiftInfo(const sbnd::timing::FrameShiftInfo &frame,
192211
caf::SRSBNDFrameShiftInfo &srsbndframe,
193212
bool allowEmpty)
@@ -349,13 +368,10 @@ namespace caf
349368
slice.correctedOpFlash.setDefault();
350369
if ( slcCorrectedOpFlash.empty()==false ) {
351370
const sbn::CorrectedOpFlashTiming &_correctedOpFlash = *slcCorrectedOpFlash[0];
352-
//TODO: use the score of the match to fill the information accordingly
353371
slice.correctedOpFlash.OpFlashT0 = _correctedOpFlash.OpFlashT0;
354-
slice.correctedOpFlash.UpstreamTime_lightonly = _correctedOpFlash.UpstreamTime_lightonly;
355-
slice.correctedOpFlash.UpstreamTime_tpczcorr = _correctedOpFlash.UpstreamTime_tpczcorr;
356-
slice.correctedOpFlash.UpstreamTime_propcorr_tpczcorr = _correctedOpFlash.UpstreamTime_propcorr_tpczcorr;
357-
slice.correctedOpFlash.FMScore = _correctedOpFlash.FMScore;
358-
slice.correctedOpFlash.SliceNuScore = _correctedOpFlash.SliceNuScore;
372+
slice.correctedOpFlash.NuToFLight = _correctedOpFlash.NuToFLight;
373+
slice.correctedOpFlash.NuToFCharge = _correctedOpFlash.NuToFCharge;
374+
slice.correctedOpFlash.OpFlashT0Corrected = _correctedOpFlash.OpFlashT0Corrected;
359375
}
360376
}
361377

sbncode/CAFMaker/FillReco.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "sbnobj/Common/CRT/CRTTrack.hh"
4343
#include "sbnobj/SBND/CRT/CRTSpacePoint.hh"
4444
#include "sbnobj/SBND/CRT/CRTTrack.hh"
45+
#include "sbnobj/SBND/CRT/CRTVeto.hh"
4546
#include "sbnobj/Common/CRT/CRTPMTMatching.hh"
4647
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
4748
#include "sbnobj/Common/PMT/Data/PMTBeamSignal.hh"
@@ -277,6 +278,11 @@ namespace caf
277278
void FillSBNDCRTTrack(const sbnd::crt::CRTTrack &track,
278279
caf::SRSBNDCRTTrack &srsbndcrttrack,
279280
bool allowEmpty = false);
281+
282+
void FillSBNDCRTVeto(const sbnd::crt::CRTVeto &veto,
283+
const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>> &points,
284+
caf::SRSBNDCRTVeto &srsbndcrtveto,
285+
bool allowEmpty = false);
280286

281287
void FillICARUSOpFlash(const recob::OpFlash &flash,
282288
std::vector<recob::OpHit const*> const& hits,

0 commit comments

Comments
 (0)