diff --git a/duneanaobj/StandardRecord/Proxy/Instantiations.cxx b/duneanaobj/StandardRecord/Proxy/Instantiations.cxx index c75f2f3..0a6b036 100644 --- a/duneanaobj/StandardRecord/Proxy/Instantiations.cxx +++ b/duneanaobj/StandardRecord/Proxy/Instantiations.cxx @@ -16,5 +16,7 @@ namespace caf template class Proxy; template class Proxy; + template class Proxy; + template class Proxy; } diff --git a/duneanaobj/StandardRecord/SREnums.h b/duneanaobj/StandardRecord/SREnums.h index 30f8994..fa30456 100644 --- a/duneanaobj/StandardRecord/SREnums.h +++ b/duneanaobj/StandardRecord/SREnums.h @@ -58,6 +58,7 @@ namespace caf kRange, ///< Amount of material traversed by particle kMCS, ///< Multiple scattering kCalorimetry, ///< Observed energy deposited in active volume + kCurvature ///< Estimated from curvature momentum measurement }; /// \brief Neutrino interaction categories. @@ -116,6 +117,14 @@ namespace caf kPandoraNDLAr }; + /// Types of GAr calo clusters + enum GArCaloType + { + kUnknownCluster = 0, + kECalCluster = 1, + kMuIDCluster = 2 + }; + } diff --git a/duneanaobj/StandardRecord/SRGAr.h b/duneanaobj/StandardRecord/SRGAr.h index 5016dc0..b65439a 100644 --- a/duneanaobj/StandardRecord/SRGAr.h +++ b/duneanaobj/StandardRecord/SRGAr.h @@ -8,7 +8,8 @@ #define DUNEANAOBJ_SRGAR_H #include "duneanaobj/StandardRecord/SRGArTrack.h" -#include "duneanaobj/StandardRecord/SRGArECAL.h" +#include "duneanaobj/StandardRecord/SRGArCalo.h" +#include "duneanaobj/StandardRecord/SRGArAssociation.h" namespace caf { @@ -16,22 +17,28 @@ namespace caf class SRGArInt { public: - std::vector tracks; - std::size_t ntracks = 0; - std::vector clusters; - std::size_t nclusters = 0; + std::vector tracks; + std::size_t ntracks = 0; - // legacy parametric reco fields + std::vector ecalclusters; + std::size_t necalclusters = 0; + + std::vector muidclusters; + std::size_t nmuidclusters = 0; - int nFSP; + std::vector associations; + std::size_t nassociations = 0; + + // legacy parametric reco fields + /* int nFSP; std::vector pdg; std::vector ptrue; std::vector trkLen; std::vector trkLenPerp; std::vector partEvReco; int gastpc_pi_pl_mult; - int gastpc_pi_min_mult; + int gastpc_pi_min_mult; */ }; /// The information needed to uniquely identify a ND-GAr reco object diff --git a/duneanaobj/StandardRecord/SRGArAssociation.h b/duneanaobj/StandardRecord/SRGArAssociation.h new file mode 100644 index 0000000..d0eccf1 --- /dev/null +++ b/duneanaobj/StandardRecord/SRGArAssociation.h @@ -0,0 +1,40 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRGArAssociation.h +// \brief Associations between GAr reco objects +// \author F. Martinez +// \date Mar. 2024 +//////////////////////////////////////////////////////////////////////// +#ifndef DUNEANAOBJ_SRGArASSOCIATION_H +#define DUNEANAOBJ_SRGArASSOCIATION_H + +namespace caf +{ + class SRGArAssociation + { + public: + + float ECAL_total_energy = -999.; ///< Total energy deposited in ECAL [GeV] + int ECAL_n_hits = 0; ///< Number of hits in ECAL + + float MuID_total_energy = -999.; ///< Total energy deposited in MuID [GeV] + int MuID_n_hits = 0; ///< Number of hits in MuID + + float ToF_time = -999.; ///< Arrival time of particle to ECAL [ns] + float ToF_beta = -999.; ///< Velocity measured from arrival time and length + + int charge = 0; ///< Inferred charge from track direction + + int garsoft_assn_id= -999; ///< GArSoft AssociationId for object association + + int garsoft_trk_assn = -999; ///< associated GArSoft TrackId + + std::vector garsoft_ecal_assns; ///< associated GArSoft ECALIds + size_t n_garsoft_ecal_assns = 0; ///< number of associated ECal clusters + + std::vector garsoft_muid_assns; ///< associated GArSoft MuIDIds + size_t n_garsoft_muid_assns = 0; ///< number of associated MuID clusters + }; + +} + +#endif //DUNEANAOBJ_SRGArASSOCIATION_H diff --git a/duneanaobj/StandardRecord/SRGArCalo.h b/duneanaobj/StandardRecord/SRGArCalo.h new file mode 100644 index 0000000..52779d3 --- /dev/null +++ b/duneanaobj/StandardRecord/SRGArCalo.h @@ -0,0 +1,37 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRGArCalo.h +// \brief Reconstructed GAr calo cluster object +// \author F. Martinez +// \date Jan. 2023 +//////////////////////////////////////////////////////////////////////// + +#ifndef DUNEANAOBJ_SRGARCALO_H +#define DUNEANAOBJ_SRGARCALO_H + +#include "duneanaobj/StandardRecord/SRVector3D.h" +#include "duneanaobj/StandardRecord/SRTrueParticle.h" + +namespace caf +{ + class SRGArCalo + { + public: + + GArCaloType cluster_type = GArCaloType::kUnknownCluster; ///< Type of GAr calo cluster + + SRVector3D position; ///< Calo cluster 3D position [cm] + float E = -999.; ///< Energy corresponding to this cluster [GeV] + + int hits_in_cluster = -999; ///< Total number of Calo hits in cluster + + int garsoft_calo_id = -999; ///< GArSoft CaloId for calo cluster + + int garsoft_trk_assn = -999; ///< GArSoft TrackId associated to calo cluster + + std::vector truth; ///< Associated SRTrueParticle(s), if relevant (use SRTruthBranch::Particle() with these IDs to grab them) + std::vector truthOverlap; ///< Fractional overlap between this cluster and true particle + }; + +} + +#endif //DUNEANAOBJ_SRGARCALO_H diff --git a/duneanaobj/StandardRecord/SRGArECAL.h b/duneanaobj/StandardRecord/SRGArECAL.h deleted file mode 100644 index c49b47a..0000000 --- a/duneanaobj/StandardRecord/SRGArECAL.h +++ /dev/null @@ -1,34 +0,0 @@ -//////////////////////////////////////////////////////////////////////// -// \file SRGArECAL.h -// \brief Reconstructed GAr ECAL cluster object -// \author F. Martinez -// \date Jan. 2023 -//////////////////////////////////////////////////////////////////////// - -#ifndef DUNEANAOBJ_SRGARECAL_H -#define DUNEANAOBJ_SRGARECAL_H - -#include "duneanaobj/StandardRecord/SRVector3D.h" -#include "duneanaobj/StandardRecord/SRTrueParticle.h" - -namespace caf -{ - class SRGArECAL - { - public: - SRVector3D position; ///< ECAL cluster 3D position - float E = -999.; ///< Energy in MeV corresponding to this cluster - - int hits_in_cluster = -999; ///< Total number of ECAL hits in cluster - - int garsoft_ecal_id = -999; ///< GArSoft ECALId for ECAL cluster - - int garsoft_trk_assn = -999; ///< GArSoft trackId associated to ECAL cluster - - SRTrueParticle truth; ///< Best-match GEANT truth particle for this ECAL cluster - float truth_fraction; ///< Contribution of truth particle to reco object - }; - -} - -#endif //DUNEANAOBJ_SRGARECAL_H diff --git a/duneanaobj/StandardRecord/SRGArPIDScoreBranch.h b/duneanaobj/StandardRecord/SRGArPIDScoreBranch.h new file mode 100644 index 0000000..8807307 --- /dev/null +++ b/duneanaobj/StandardRecord/SRGArPIDScoreBranch.h @@ -0,0 +1,26 @@ +//////////////////////////////////////////////////////////////////////// +/// \file SRGArPIDScoreBranch.h +/// \brief Collections of GArSoft PID scores +/// \author F. Martinez + +#ifndef DUNEANAOBJ_SRGARPIDSCOREBRANCH_H +#define DUNEANAOBJ_SRGARPIDSCOREBRANCH_H + +#include + +namespace caf +{ + class SRGArPIDScoreBranch + { + private: + static constexpr float NaN = std::numeric_limits::signaling_NaN(); + + public: + + float muon_score = NaN; ///< Muon score based on ECAL and MuID activity + float proton_dEdx_score = NaN; ///< Proton score based on TPC dE/dx measurement + float proton_tof_score = NaN; ///< Proton score based on ECAL ToF measurement + }; +} + +#endif //DUNEANAOBJ_SRGARPIDSCOREBRANCH_H diff --git a/duneanaobj/StandardRecord/SRGArTrack.h b/duneanaobj/StandardRecord/SRGArTrack.h index 9cdd1af..a922a12 100644 --- a/duneanaobj/StandardRecord/SRGArTrack.h +++ b/duneanaobj/StandardRecord/SRGArTrack.h @@ -16,25 +16,32 @@ namespace caf public: // GAr track characteristics - float dEdx_fwd = -999.; ///< dE/dx of track in forward fit - float dEdx_bkwd = -999.; ///< dE/dx of track in backward fit + float dQdx_fwd = -999.; ///< dQ/dx of track in forward fit [ADC/cm] + float dQdx_bak = -999.; ///< dQ/dx of track in backward fit [ADC/cm] - float p_fwd = -999.; ///< Reco momentum of track in forward fit - float p_bkwd = -999.; ///< Reco momentum of track in forward fit + float p_fwd = -999.; ///< Reco momentum of track in forward fit [GeV] + float p_bak = -999.; ///< Reco momentum of track in backward fit [GeV] - float len_cm_fwd = -999.; ///< Length of track in forward fit - float len_cm_bkwd = -999.; ///< Length of track in backward fit + float chisq_fwd = -999.; ///< Kalman fit chi square of track in forward fit + float chisq_bak = -999.; ///< Kalman fit chi square of track in backward fit - int clusters_in_track = -999; ///< Total number of TPC clusters in track + float len_cm_fwd = -999.; ///< Length of track in forward fit [cm] + float len_cm_bak = -999.; ///< Length of track in backward fit [cm] - int garsoft_trk_id = -999; ///< GArSoft trackId for track + float dEdx_fwd = -999.; ///< Truncated mean dE/dx in forward fit [keV/cm] + float dEdx_bak = -999.; ///< Truncated mean dE/dx in forward fit [keV/cm] - std::vector pid_fwd; ///< PID of track in forward fit - std::vector pid_prob_fwd; ///< PID probability vector in forward fit - std::vector pid_bkwd; ///< PID of track in backward fit - std::vector pid_prob_bkwd; ///< PID probability vector in backward fit + float dEdx_total = -999.; ///< Total energy deposited in TPC [GeV] + + int clusters_in_track = -999; ///< Total number of TPC clusters in track + + int garsoft_trk_id = -999; ///< GArSoft TrackId for track + + std::vector pid_fwd; ///< Parametrised PID of track in forward fit + std::vector pid_prob_fwd; ///< Parametrised PID probability vector in forward fit + std::vector pid_bak; ///< Parametrised PID of track in backward fit + std::vector pid_prob_bak; ///< Parametrised PID probability vector in backward fit - float truth_fraction; ///< Contribution of truth particle to reco object }; } diff --git a/duneanaobj/StandardRecord/SRInteractionBranch.h b/duneanaobj/StandardRecord/SRInteractionBranch.h index b00adf9..997140a 100644 --- a/duneanaobj/StandardRecord/SRInteractionBranch.h +++ b/duneanaobj/StandardRecord/SRInteractionBranch.h @@ -21,6 +21,9 @@ namespace caf std::vector pandora; ///< Interactions from Pandora reconstruction std::size_t npandora; + std::vector gsft; ///< Interactions from GArSoft reconstruction + std::size_t ngsft; + }; } diff --git a/duneanaobj/StandardRecord/SRPIDScoreBranch.h b/duneanaobj/StandardRecord/SRPIDScoreBranch.h new file mode 100644 index 0000000..98a4424 --- /dev/null +++ b/duneanaobj/StandardRecord/SRPIDScoreBranch.h @@ -0,0 +1,24 @@ +//////////////////////////////////////////////////////////////////////// +/// \file SRPIDScoreBranch.h +/// \brief Collections of PID score methods +/// \author F. Martinez + +#ifndef DUNEANAOBJ_SRPIDSCOREBRANCH_H +#define DUNEANAOBJ_SRPIDSCOREBRANCH_H + +#include "duneanaobj/StandardRecord/SRGArPIDScoreBranch.h" + +namespace caf +{ + + class SRPIDScoreBranch + { + public: + SRGArPIDScoreBranch gsft_pid; + + // other reconstructions can go here: Pandora, DeepLearnPhysics, etc. once we have stuff to fill for them + }; + +} // caf + +#endif //DUNEANAOBJ_SRPIDSCOREBRANCH_H diff --git a/duneanaobj/StandardRecord/SRRecoParticle.h b/duneanaobj/StandardRecord/SRRecoParticle.h index aa23d59..293f7d8 100644 --- a/duneanaobj/StandardRecord/SRRecoParticle.h +++ b/duneanaobj/StandardRecord/SRRecoParticle.h @@ -3,13 +3,13 @@ /// \brief A general reconstructed particle container /// \author J. Wolcott - #ifndef DUNEANAOBJ_SRRECOPARTICLE_H #define DUNEANAOBJ_SRRECOPARTICLE_H #include "duneanaobj/StandardRecord/SREnums.h" #include "duneanaobj/StandardRecord/SRLorentzVector.h" #include "duneanaobj/StandardRecord/SRVector3D.h" +#include "duneanaobj/StandardRecord/SRPIDScoreBranch.h" namespace caf { @@ -28,7 +28,7 @@ namespace caf int pdg = 0; ///< PDG code inferred for this particle. int tgtA = 0; ///< Atomic number of nucleus this particle was reconstructed in (useful for, e.g., SAND) - float score = NaN; ///< PID score for this particle, if relevant + SRPIDScoreBranch score; ///< PID score(s) for this particle, if relevant float E = NaN; ///< Reconstructed energy for this particle [GeV] PartEMethod E_method = PartEMethod::kUnknownMethod; ///< Method used to determine energy for the particle diff --git a/duneanaobj/StandardRecord/SRRecoParticlesBranch.h b/duneanaobj/StandardRecord/SRRecoParticlesBranch.h index 93e013e..04393ad 100644 --- a/duneanaobj/StandardRecord/SRRecoParticlesBranch.h +++ b/duneanaobj/StandardRecord/SRRecoParticlesBranch.h @@ -24,6 +24,9 @@ namespace caf int npida = 0; std::vector pida; ///< Particles bearing weights from PIDA algorithm + + int ngsft = 0; + std::vector gsft; ///< Particles reconstructed by GArSoft }; } // caf diff --git a/duneanaobj/StandardRecord/SRSAND.h b/duneanaobj/StandardRecord/SRSAND.h index 89f2cdf..34115cf 100644 --- a/duneanaobj/StandardRecord/SRSAND.h +++ b/duneanaobj/StandardRecord/SRSAND.h @@ -37,7 +37,7 @@ namespace caf }; std::size_t nixn = 0; - std::vector ixn; ///< Reconstructed interactions + std::vector ixn; ///< Reconstructed interactions }; diff --git a/duneanaobj/StandardRecord/classes_def.xml b/duneanaobj/StandardRecord/classes_def.xml index 8237e46..a49b47a 100644 --- a/duneanaobj/StandardRecord/classes_def.xml +++ b/duneanaobj/StandardRecord/classes_def.xml @@ -57,7 +57,8 @@ - + + @@ -70,7 +71,7 @@ - + @@ -82,12 +83,14 @@ - + + - + + @@ -98,6 +101,16 @@ + + + + + + + + + + @@ -205,11 +218,23 @@ - + + + - + + + + + + + + + + + @@ -220,15 +245,19 @@ - + + + - + + + @@ -238,7 +267,8 @@ - + +