From 6e0703a25805c28b5a6beb6ecfe6ec7b7142c762 Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Mon, 15 Jan 2024 16:28:01 -0600 Subject: [PATCH 1/2] Add new CRT products --- sbnanaobj/StandardRecord/SRCRTSpacePoint.cxx | 18 +++++++++++ sbnanaobj/StandardRecord/SRCRTSpacePoint.h | 27 +++++++++++++++++ .../StandardRecord/SRCRTSpacePointMatch.cxx | 13 ++++++++ .../StandardRecord/SRCRTSpacePointMatch.h | 23 ++++++++++++++ sbnanaobj/StandardRecord/SREnums.h | 14 +++++++++ sbnanaobj/StandardRecord/SRSBNDCRTTrack.cxx | 18 +++++++++++ sbnanaobj/StandardRecord/SRSBNDCRTTrack.h | 29 ++++++++++++++++++ .../StandardRecord/SRSBNDCRTTrackMatch.cxx | 13 ++++++++ .../StandardRecord/SRSBNDCRTTrackMatch.h | 23 ++++++++++++++ sbnanaobj/StandardRecord/SRTrack.h | 10 +++++-- sbnanaobj/StandardRecord/StandardRecord.h | 30 +++++++++++-------- sbnanaobj/StandardRecord/classes_def.xml | 26 ++++++++++++++-- 12 files changed, 227 insertions(+), 17 deletions(-) create mode 100644 sbnanaobj/StandardRecord/SRCRTSpacePoint.cxx create mode 100644 sbnanaobj/StandardRecord/SRCRTSpacePoint.h create mode 100644 sbnanaobj/StandardRecord/SRCRTSpacePointMatch.cxx create mode 100644 sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h create mode 100644 sbnanaobj/StandardRecord/SRSBNDCRTTrack.cxx create mode 100644 sbnanaobj/StandardRecord/SRSBNDCRTTrack.h create mode 100644 sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.cxx create mode 100644 sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h diff --git a/sbnanaobj/StandardRecord/SRCRTSpacePoint.cxx b/sbnanaobj/StandardRecord/SRCRTSpacePoint.cxx new file mode 100644 index 00000000..fe72e18c --- /dev/null +++ b/sbnanaobj/StandardRecord/SRCRTSpacePoint.cxx @@ -0,0 +1,18 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRCRTSpacePoint.cxx +//////////////////////////////////////////////////////////////////////// + +#include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h" + +#include + +namespace caf +{ + SRCRTSpacePoint::SRCRTSpacePoint(): + pe(std::numeric_limits::signaling_NaN()), + time(std::numeric_limits::signaling_NaN()), + time_err(std::numeric_limits::signaling_NaN()), + complete(false) + {} +} // end namespace caf +//////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRCRTSpacePoint.h b/sbnanaobj/StandardRecord/SRCRTSpacePoint.h new file mode 100644 index 00000000..eaa26cda --- /dev/null +++ b/sbnanaobj/StandardRecord/SRCRTSpacePoint.h @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRCRTSpacePoint.h +//////////////////////////////////////////////////////////////////////// +#ifndef SRCRTSPACEPOINT_H +#define SRCRTSPACEPOINT_H + +#include "sbnanaobj/StandardRecord/SRVector3D.h" + +namespace caf +{ + class SRCRTSpacePoint + { + public: + SRCRTSpacePoint(); + ~SRCRTSpacePoint() {} + + SRVector3D position; // position [cm] + SRVector3D position_err; // positional spread [cm] + float pe; // total PE + float time; // time [ns] + float time_err; // time_err [ns] + bool complete; // was cluster made from perpendicular & overlapping strips? + }; +} // end namespace + +#endif // SRCRTSPACEPOINT_H +////////////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.cxx b/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.cxx new file mode 100644 index 00000000..3b9b671e --- /dev/null +++ b/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.cxx @@ -0,0 +1,13 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRCRTSpacePointMatch.cxx +//////////////////////////////////////////////////////////////////////// + +#include "sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h" + +namespace caf +{ + SRCRTSpacePointMatch::SRCRTSpacePointMatch(): + score(std::numeric_limits::signaling_NaN()) + {} +} +//////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h b/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h new file mode 100644 index 00000000..3a48cac5 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h @@ -0,0 +1,23 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRCRTSpacePointMatch.h +//////////////////////////////////////////////////////////////////////// +#ifndef SRCRTSPACEPOINTMATCH_H +#define SRCRTSPACEPOINTMATCH_H + +#include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h" + +namespace caf +{ + class SRCRTSpacePointMatch + { + public: + SRCRTSpacePointMatch(); + ~SRCRTSpacePointMatch() {} + + SRCRTSpacePoint spacepoint; // the spacepoint + float score; // assessment of quality of matching (depends on alg configuration) + }; +} + +#endif // SRCRTSPACEPOINTMATCH_H +////////////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SREnums.h b/sbnanaobj/StandardRecord/SREnums.h index a2ab0e68..1262e23c 100644 --- a/sbnanaobj/StandardRecord/SREnums.h +++ b/sbnanaobj/StandardRecord/SREnums.h @@ -30,6 +30,20 @@ namespace caf kWallBack=6 }; + enum SBNDCRTTagger_t { + kUndefinedSBNDTagger = -1, + kBottomSBNDTagger, + kSouthSBNDTagger, + kNorthSBNDTagger, + kWestSBNDTagger, + kEastSBNDTagger, + kTopLowSBNDTagger, + kTopHighSBNDTagger, + + kUpstreamSBNDTagger = kSouthSBNDTagger, + kDownstreamSBNDTagger = kNorthSBNDTagger + }; + /// Which type of MC? enum MCType_t { diff --git a/sbnanaobj/StandardRecord/SRSBNDCRTTrack.cxx b/sbnanaobj/StandardRecord/SRSBNDCRTTrack.cxx new file mode 100644 index 00000000..49d71a22 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRSBNDCRTTrack.cxx @@ -0,0 +1,18 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRSBNDCRTTrack.cxx +//////////////////////////////////////////////////////////////////////// + +#include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h" + +#include + +namespace caf +{ + SRSBNDCRTTrack::SRSBNDCRTTrack(): + time(std::numeric_limits::signaling_NaN()), + time_err(std::numeric_limits::signaling_NaN()), + pe(std::numeric_limits::signaling_NaN()), + tof(std::numeric_limits::signaling_NaN()) + {} +} // end namespace caf +//////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h b/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h new file mode 100644 index 00000000..14b2a4e8 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h @@ -0,0 +1,29 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRSBNDCRTTrack.h +//////////////////////////////////////////////////////////////////////// +#ifndef SRSBNDCRTTRACK_H +#define SRSBNDCRTTRACK_H + +#include "sbnanaobj/StandardRecord/SRVector3D.h" +#include "sbnanaobj/StandardRecord/SREnums.h" +#include + +namespace caf +{ + class SRSBNDCRTTrack + { + public: + SRSBNDCRTTrack(); + ~SRSBNDCRTTrack() {} + + std::vector points; // fitted track points at each tagger [cm] + float time; // average time [ns] + float time_err; // error in average time [ns] + float pe; // total PE; + float tof; // time from first space point to last [ns] + std::set taggers; // which taggers were used to create the track + }; +} // end namespace + +#endif // SRSBNDCRTTRACK_H +////////////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.cxx b/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.cxx new file mode 100644 index 00000000..0121643d --- /dev/null +++ b/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.cxx @@ -0,0 +1,13 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRSBNDCRTTrackMatch.cxx +//////////////////////////////////////////////////////////////////////// + +#include "sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h" + +namespace caf +{ + SRSBNDCRTTrackMatch::SRSBNDCRTTrackMatch(): + score(std::numeric_limits::signaling_NaN()) + {} +} +//////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h b/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h new file mode 100644 index 00000000..1a8a9b39 --- /dev/null +++ b/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h @@ -0,0 +1,23 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRSBNDCRTTrackMatch.h +//////////////////////////////////////////////////////////////////////// +#ifndef SRSBNDCRTTRACKMATCH_H +#define SRSBNDCRTTRACKMATCH_H + +#include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h" + +namespace caf +{ + class SRSBNDCRTTrackMatch + { + public: + SRSBNDCRTTrackMatch(); + ~SRSBNDCRTTrackMatch() {} + + SRSBNDCRTTrack track; // the track + float score; // assessment of quality of matching (depends on alg configuration) + }; +} + +#endif // SRSBNDCRTTRACKMATCH_H +////////////////////////////////////////////////////////////////////////////// diff --git a/sbnanaobj/StandardRecord/SRTrack.h b/sbnanaobj/StandardRecord/SRTrack.h index e46b3390..c93f8c65 100644 --- a/sbnanaobj/StandardRecord/SRTrack.h +++ b/sbnanaobj/StandardRecord/SRTrack.h @@ -12,6 +12,8 @@ #include "sbnanaobj/StandardRecord/SRTrkRange.h" #include "sbnanaobj/StandardRecord/SRCRTHitMatch.h" #include "sbnanaobj/StandardRecord/SRCRTTrackMatch.h" +#include "sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h" +#include "sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h" #include "sbnanaobj/StandardRecord/SRTrackCalo.h" #include "sbnanaobj/StandardRecord/SRTrackDazzle.h" #include "sbnanaobj/StandardRecord/SRTrackScatterClosestApproach.h" @@ -49,9 +51,11 @@ namespace caf SRTrkMCS mcsP; SRTrkRange rangeP; - SRTrackTruth truth; ///< truth information - SRCRTHitMatch crthit; ///< CRT Hit match - SRCRTTrackMatch crttrack; ///< CRT Track match + SRTrackTruth truth; ///< truth information + SRCRTHitMatch crthit; ///< CRT Hit match (ICARUS) + SRCRTTrackMatch crttrack; ///< CRT Track match (ICARUS) + SRCRTSpacePointMatch crtspacepoint; ///< CRT SpacePoint match (SBND) + SRSBNDCRTTrackMatch crtsbndtrack; ///< CRT Track match (SBND) SRTrackScatterClosestApproach scatterClosestApproach; ///< Scattering variables relating to spread about interpolated track SRTrackStoppingChi2Fit stoppingChi2Fit; ///< Fit results from Pol0 and Exp to dEdx vs res. range diff --git a/sbnanaobj/StandardRecord/StandardRecord.h b/sbnanaobj/StandardRecord/StandardRecord.h index e7aeb18b..03588a0b 100644 --- a/sbnanaobj/StandardRecord/StandardRecord.h +++ b/sbnanaobj/StandardRecord/StandardRecord.h @@ -9,6 +9,8 @@ #include "sbnanaobj/StandardRecord/SRCRTHit.h" #include "sbnanaobj/StandardRecord/SRCRTTrack.h" +#include "sbnanaobj/StandardRecord/SRCRTSpacePoint.h" +#include "sbnanaobj/StandardRecord/SRSBNDCRTTrack.h" #include "sbnanaobj/StandardRecord/SRHeader.h" #include "sbnanaobj/StandardRecord/SRCRTPMTMatch.h" #include "sbnanaobj/StandardRecord/SRSlice.h" @@ -36,18 +38,22 @@ namespace caf SRSliceRecoBranch reco; ///< Slice reco branch: tracks, showers, etc. SRTruthBranch mc; ///< Truth branch for all interactions - int nslc; ///< Number of slices in list - std::vector slc; ///< Slice branch. - int nfake_reco; ///< Number of Fake-Reco's in list - std::vector fake_reco; ///< List of fake-reco slices - int ntrue_particles; ///< Number of true particles in list - std::vector true_particles; ///< True particles in spill - int ncrt_hits; ///< Number of CRT hits in event - std::vector crt_hits; ///< CRT hits in event - int ncrt_tracks; ///< Number of CRT tracks in event - std::vector crt_tracks; ///< CRT tracks in event - int nopflashes; ///< Number of OpFlashes in spill - std::vector opflashes; ///< List of OpFlashes in spill + int nslc; ///< Number of slices in list + std::vector slc; ///< Slice branch. + int nfake_reco; ///< Number of Fake-Reco's in list + std::vector fake_reco; ///< List of fake-reco slices + int ntrue_particles; ///< Number of true particles in list + std::vector true_particles; ///< True particles in spill + int ncrt_hits; ///< Number of CRT hits in event (ICARUS) + std::vector crt_hits; ///< CRT hits in event (ICARUS) + int ncrt_tracks; ///< Number of CRT tracks in event (ICARUS) + std::vector crt_tracks; ///< CRT tracks in event (ICARUS) + int ncrt_spacepoints; ///< Number of CRT spacepoints in event (SBND) + std::vector crt_spacePoints; ///< CRT spacepoints in event (SBND) + int nsbnd_crt_tracks; ///< Number of CRT tracks in event (SBND) + std::vector sbnd_crt_tracks; ///< CRT tracks in event (SBND) + int nopflashes; ///< Number of OpFlashes in spill + std::vector opflashes; ///< List of OpFlashes in spill int ncrtpmt_matches; /// crtpmt_matches; ///< CRT-PMT matches in event diff --git a/sbnanaobj/StandardRecord/classes_def.xml b/sbnanaobj/StandardRecord/classes_def.xml index 0a245473..ba0f1341 100644 --- a/sbnanaobj/StandardRecord/classes_def.xml +++ b/sbnanaobj/StandardRecord/classes_def.xml @@ -5,7 +5,8 @@ - + + @@ -94,7 +95,8 @@ - + + @@ -347,9 +349,29 @@ + + + + + + + + + + + + + + + + + + + + From be0a74790b0047d6381ed89f2cb103e169358a2e Mon Sep 17 00:00:00 2001 From: Henry Lay Date: Tue, 16 Jan 2024 09:03:06 -0600 Subject: [PATCH 2/2] Update new CRT objects to compile properly --- sbnanaobj/StandardRecord/SRCRTSpacePoint.h | 2 +- sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h | 2 +- sbnanaobj/StandardRecord/SRSBNDCRTTrack.h | 9 ++++++--- sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h | 2 +- sbnanaobj/StandardRecord/StandardRecord.h | 2 +- sbnanaobj/StandardRecord/classes_def.xml | 4 ++-- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sbnanaobj/StandardRecord/SRCRTSpacePoint.h b/sbnanaobj/StandardRecord/SRCRTSpacePoint.h index eaa26cda..e17175c3 100644 --- a/sbnanaobj/StandardRecord/SRCRTSpacePoint.h +++ b/sbnanaobj/StandardRecord/SRCRTSpacePoint.h @@ -12,7 +12,7 @@ namespace caf { public: SRCRTSpacePoint(); - ~SRCRTSpacePoint() {} + virtual ~SRCRTSpacePoint() {} SRVector3D position; // position [cm] SRVector3D position_err; // positional spread [cm] diff --git a/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h b/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h index 3a48cac5..d3300ce2 100644 --- a/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h +++ b/sbnanaobj/StandardRecord/SRCRTSpacePointMatch.h @@ -12,7 +12,7 @@ namespace caf { public: SRCRTSpacePointMatch(); - ~SRCRTSpacePointMatch() {} + virtual ~SRCRTSpacePointMatch() {} SRCRTSpacePoint spacepoint; // the spacepoint float score; // assessment of quality of matching (depends on alg configuration) diff --git a/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h b/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h index 14b2a4e8..2a2e4d47 100644 --- a/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h +++ b/sbnanaobj/StandardRecord/SRSBNDCRTTrack.h @@ -6,7 +6,8 @@ #include "sbnanaobj/StandardRecord/SRVector3D.h" #include "sbnanaobj/StandardRecord/SREnums.h" -#include + +#include namespace caf { @@ -14,14 +15,16 @@ namespace caf { public: SRSBNDCRTTrack(); - ~SRSBNDCRTTrack() {} + virtual ~SRSBNDCRTTrack() {} std::vector points; // fitted track points at each tagger [cm] float time; // average time [ns] float time_err; // error in average time [ns] float pe; // total PE; float tof; // time from first space point to last [ns] - std::set taggers; // which taggers were used to create the track + + // TODO: Find way of adding taggers field + // std::set taggers; // which taggers were used to create the track }; } // end namespace diff --git a/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h b/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h index 1a8a9b39..cb789a83 100644 --- a/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h +++ b/sbnanaobj/StandardRecord/SRSBNDCRTTrackMatch.h @@ -12,7 +12,7 @@ namespace caf { public: SRSBNDCRTTrackMatch(); - ~SRSBNDCRTTrackMatch() {} + virtual ~SRSBNDCRTTrackMatch() {} SRSBNDCRTTrack track; // the track float score; // assessment of quality of matching (depends on alg configuration) diff --git a/sbnanaobj/StandardRecord/StandardRecord.h b/sbnanaobj/StandardRecord/StandardRecord.h index 03588a0b..c08f6d6b 100644 --- a/sbnanaobj/StandardRecord/StandardRecord.h +++ b/sbnanaobj/StandardRecord/StandardRecord.h @@ -49,7 +49,7 @@ namespace caf int ncrt_tracks; ///< Number of CRT tracks in event (ICARUS) std::vector crt_tracks; ///< CRT tracks in event (ICARUS) int ncrt_spacepoints; ///< Number of CRT spacepoints in event (SBND) - std::vector crt_spacePoints; ///< CRT spacepoints in event (SBND) + std::vector crt_spacepoints; ///< CRT spacepoints in event (SBND) int nsbnd_crt_tracks; ///< Number of CRT tracks in event (SBND) std::vector sbnd_crt_tracks; ///< CRT tracks in event (SBND) int nopflashes; ///< Number of OpFlashes in spill diff --git a/sbnanaobj/StandardRecord/classes_def.xml b/sbnanaobj/StandardRecord/classes_def.xml index ba0f1341..8b01f989 100644 --- a/sbnanaobj/StandardRecord/classes_def.xml +++ b/sbnanaobj/StandardRecord/classes_def.xml @@ -6,7 +6,7 @@ - + @@ -358,7 +358,7 @@ - +