Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b256c77
Starting point for CRTVeto in caf
aantonakis Sep 9, 2025
6cbfa8d
Added veto values in a different way for testing
aantonakis Sep 10, 2025
3a6116e
Added starting point for sp associations. Does not store info in recT…
aantonakis Sep 17, 2025
9254c24
Cleaned up debug statements and code structure. Might need to adjust …
aantonakis Sep 18, 2025
2d109dc
Merge branch 'develop' into feature/aantonak_crtveto_caf
aantonakis Sep 18, 2025
21befcb
Merge branch 'develop' into feature/aantonak_crtveto_caf
aantonakis Sep 24, 2025
7e3023c
Fixed curly braces from last merge conflict
aantonakis Sep 24, 2025
d03d9f6
Removed unnecessary loop. passed veto key directly to association. Ch…
aantonakis Sep 25, 2025
387d4ad
cleaned up print out statements
aantonakis Sep 25, 2025
25ef6cc
Changed the FillReco function to have just the veto ptrs. Needs testi…
aantonakis Oct 6, 2025
1ab38e5
Merge branch 'develop' into feature/aantonak_crtveto_caf
aantonakis Oct 7, 2025
c011954
Cleaned up comments. Only a vector of veto ptrs is used now. Still ne…
aantonakis Oct 8, 2025
4aac8d8
Merge branch 'develop' into feature/aantonak_crtveto_caf
aantonakis Oct 23, 2025
89516ab
Changed SpacePoint times back to ns
aantonakis Oct 23, 2025
7cdb76e
Fixed white space for FillReco?
aantonakis Oct 23, 2025
1b4390b
Fixed white space for CAFMaker module
aantonakis Oct 23, 2025
04a5a6c
Removed pointers
aantonakis Oct 28, 2025
c29001e
Update sbncode/CAFMaker/CAFMaker_module.cc
aantonakis Oct 30, 2025
1ee32b7
Update sbncode/CAFMaker/FillReco.cxx
aantonakis Oct 30, 2025
d2f5729
Changed emplace_back to push_back
aantonakis Oct 30, 2025
f10a4bc
Merge branch 'develop' into feature/aantonak_crtveto_caf
aantonakis Oct 30, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sbncode/CAFMaker/CAFMakerParams.h
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ namespace caf
"crttracks" // sbnd
};

Atom<string> SBNDCRTVetoLabel {
Name("SBNDCRTVetoLabel"),
Comment("Label of sbnd CRT Veto."),
"crtveto" // sbnd

Atom<string> SBNDFrameShiftInfoLabel {
Name("SBNDFrameShiftInfoLabel"),
Comment("Label of sbnd frame shift."),
Expand Down
38 changes: 38 additions & 0 deletions sbncode/CAFMaker/CAFMaker_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
#include "sbnobj/Common/Trigger/ExtraTriggerInfo.h"
#include "sbnobj/Common/Reco/CRUMBSResult.h"
#include "sbnobj/Common/Reco/OpT0FinderResult.h"
#include "sbnobj/SBND/CRT/CRTVeto.hh"
#include "sbnobj/SBND/Timing/TimingInfo.hh"
#include "sbnobj/SBND/Timing/FrameShiftInfo.hh"

Expand Down Expand Up @@ -1645,6 +1646,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
std::vector<caf::SRCRTTrack> srcrttracks;
std::vector<caf::SRCRTSpacePoint> srcrtspacepoints;
std::vector<caf::SRSBNDCRTTrack> srsbndcrttracks;
caf::SRSBNDCRTVeto srsbndcrtveto;
caf::SRSBNDFrameShiftInfo srsbndframeshiftinfo;
caf::SRSBNDTimingInfo srsbndtiminginfo;

Expand Down Expand Up @@ -1695,6 +1697,41 @@ void CAFMaker::produce(art::Event& evt) noexcept {
FillSBNDCRTTrack(sbndcrttracks[i], srsbndcrttracks.back());
}
}
// Fill CRT Veto
art::Handle<std::vector<sbnd::crt::CRTVeto>> sbndcrtveto_handle;
GetByLabelStrict(evt, fParams.SBNDCRTVetoLabel(), sbndcrtveto_handle);
// fill into event
if (sbndcrtveto_handle.isValid()) {
const std::vector<sbnd::crt::CRTVeto> &sbndcrtvetos = *sbndcrtveto_handle;
// And associated SpacePoint objects
art::FindManyP<sbnd::crt::CRTSpacePoint> spAssoc(sbndcrtveto_handle, evt, fParams.SBNDCRTVetoLabel());
std::vector<sbnd::crt::CRTSpacePoint> vetoSpacePoints;
if (spAssoc.isValid()) {

// Assume there is only one Veto per event
const std::vector<art::Ptr<sbnd::crt::CRTSpacePoint>> veto_sp_v(spAssoc.at(0));

// Fill the associated space points --> then add to the FillReco function

if (veto_sp_v.size() == 0) {
// TODO ? Need to decide how to handle this
// This version seems to work in skipping empty associations. It does break the rec.sbnd_crt_veto.sp_pe..length and
// rec.sbnd_crt_veto.sp_time..length branches? However, the rec.sbnd_crt_veto.sp_position..length still works and can be used?
std::cout << "No Veto Space Points" << std::endl;
//vetoSpacePoints.emplace_back(); // nullptr
}
else {

for (auto const& sp: veto_sp_v) {

vetoSpacePoints.push_back(*sp);

}
}
}
FillSBNDCRTVeto(sbndcrtvetos[0], vetoSpacePoints, srsbndcrtveto);
}


art::Handle<sbnd::timing::FrameShiftInfo> sbndframeshiftinfo_handle;
GetByLabelStrict(evt, fParams.SBNDFrameShiftInfoLabel(), sbndframeshiftinfo_handle);
Expand Down Expand Up @@ -2426,6 +2463,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
rec.ncrt_spacepoints = srcrtspacepoints.size();
rec.sbnd_crt_tracks = srsbndcrttracks;
rec.nsbnd_crt_tracks = srsbndcrttracks.size();
rec.sbnd_crt_veto = srsbndcrtveto;
rec.opflashes = srflashes;
rec.nopflashes = srflashes.size();
rec.sbnd_frames = srsbndframeshiftinfo;
Expand Down
18 changes: 18 additions & 0 deletions sbncode/CAFMaker/FillReco.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ namespace caf
srsbndcrttrack.tof = track.ToF();
}

void FillSBNDCRTVeto(const sbnd::crt::CRTVeto &veto,
const std::vector<sbnd::crt::CRTSpacePoint> &points,
caf::SRSBNDCRTVeto &srsbndcrtveto,
bool allowEmpty)
{
srsbndcrtveto.V0 = veto.V0();
srsbndcrtveto.V1 = veto.V1();
srsbndcrtveto.V2 = veto.V2();
srsbndcrtveto.V3 = veto.V3();
srsbndcrtveto.V4 = veto.V4();

// add the CRTSpacePoint associations to the SR Veto
for(auto const& sp : points) {
srsbndcrtveto.sp_position.emplace_back(sp.X(), sp.Y(), sp.Z());
srsbndcrtveto.sp_time.emplace_back(sp.Ts0());
srsbndcrtveto.sp_pe.emplace_back(sp.PE());
}

void FillSBNDFrameShiftInfo(const sbnd::timing::FrameShiftInfo &frame,
caf::SRSBNDFrameShiftInfo &srsbndframe,
bool allowEmpty)
Expand Down
6 changes: 6 additions & 0 deletions sbncode/CAFMaker/FillReco.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "sbnobj/Common/CRT/CRTTrack.hh"
#include "sbnobj/SBND/CRT/CRTSpacePoint.hh"
#include "sbnobj/SBND/CRT/CRTTrack.hh"
#include "sbnobj/SBND/CRT/CRTVeto.hh"
#include "sbnobj/Common/CRT/CRTPMTMatching.hh"
#include "sbnobj/Common/CRT/CRTHitT0TaggingInfo.hh"
#include "sbnobj/Common/PMT/Data/PMTBeamSignal.hh"
Expand Down Expand Up @@ -256,6 +257,11 @@ namespace caf
void FillSBNDCRTTrack(const sbnd::crt::CRTTrack &track,
caf::SRSBNDCRTTrack &srsbndcrttrack,
bool allowEmpty = false);

void FillSBNDCRTVeto(const sbnd::crt::CRTVeto &veto,
const std::vector<sbnd::crt::CRTSpacePoint> &points,
caf::SRSBNDCRTVeto &srsbndcrtveto,
bool allowEmpty = false);

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