From 5b9920d961793475b15aaaf4962a7631cfe79cbc Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Tue, 19 Mar 2024 12:14:47 -0500 Subject: [PATCH 01/22] Change all bkwd to bak to match gsft convention --- duneanaobj/StandardRecord/SRGArECAL.h | 2 +- duneanaobj/StandardRecord/SRGArTrack.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/duneanaobj/StandardRecord/SRGArECAL.h b/duneanaobj/StandardRecord/SRGArECAL.h index c49b47a..791702c 100644 --- a/duneanaobj/StandardRecord/SRGArECAL.h +++ b/duneanaobj/StandardRecord/SRGArECAL.h @@ -25,7 +25,7 @@ namespace caf int garsoft_trk_assn = -999; ///< GArSoft trackId associated to ECAL cluster - SRTrueParticle truth; ///< Best-match GEANT truth particle for this ECAL cluster + SRTrueParticle truth; ///< Best-match GEANT truth particle for this ECAL cluster float truth_fraction; ///< Contribution of truth particle to reco object }; diff --git a/duneanaobj/StandardRecord/SRGArTrack.h b/duneanaobj/StandardRecord/SRGArTrack.h index 9cdd1af..00bd547 100644 --- a/duneanaobj/StandardRecord/SRGArTrack.h +++ b/duneanaobj/StandardRecord/SRGArTrack.h @@ -16,23 +16,23 @@ 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 dEdx_fwd = -999.; ///< dE/dx of track in forward fit + float dEdx_bak = -999.; ///< dE/dx of track in backward fit - 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 + float p_bak = -999.; ///< Reco momentum of track in backward fit - float len_cm_fwd = -999.; ///< Length of track in forward fit - float len_cm_bkwd = -999.; ///< Length of track in backward fit + float len_cm_fwd = -999.; ///< Length of track in forward fit + float len_cm_bak = -999.; ///< Length of track in backward fit 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; ///< 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 + 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 }; From 9182afdf9f4a91b04fdd07a20625c2c230690a70 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Fri, 22 Mar 2024 08:41:37 -0500 Subject: [PATCH 02/22] Small changes to existing classes --- duneanaobj/StandardRecord/SRGArECAL.h | 14 +++++++------- duneanaobj/StandardRecord/SRGArTrack.h | 21 ++++++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/duneanaobj/StandardRecord/SRGArECAL.h b/duneanaobj/StandardRecord/SRGArECAL.h index 791702c..5455232 100644 --- a/duneanaobj/StandardRecord/SRGArECAL.h +++ b/duneanaobj/StandardRecord/SRGArECAL.h @@ -16,17 +16,17 @@ namespace caf class SRGArECAL { public: - SRVector3D position; ///< ECAL cluster 3D position - float E = -999.; ///< Energy in MeV corresponding to this cluster + SRVector3D position; ///< ECAL cluster 3D position [cm] + float E = -999.; ///< Energy corresponding to this cluster [GeV] - int hits_in_cluster = -999; ///< Total number of ECAL hits in 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_ecal_id = -999; ///< GArSoft ECALId for ECAL cluster - int garsoft_trk_assn = -999; ///< GArSoft trackId associated to 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 + SRTrueParticle truth; ///< Best-match GEANT truth particle for this ECAL cluster + float truth_fraction; ///< Contribution of truth particle to reco object }; } diff --git a/duneanaobj/StandardRecord/SRGArTrack.h b/duneanaobj/StandardRecord/SRGArTrack.h index 00bd547..372a422 100644 --- a/duneanaobj/StandardRecord/SRGArTrack.h +++ b/duneanaobj/StandardRecord/SRGArTrack.h @@ -16,25 +16,28 @@ namespace caf public: // GAr track characteristics - float dEdx_fwd = -999.; ///< dE/dx of track in forward fit - float dEdx_bak = -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_bak = -999.; ///< Reco momentum of track in backward 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_bak = -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 + 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 + float truth_fraction; ///< Contribution of truth particle to reco object }; } From f2d24114dcb2ecc55defbe641111367e9ca0a02e Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Fri, 22 Mar 2024 08:42:05 -0500 Subject: [PATCH 03/22] Add new class for GAr reco particles --- duneanaobj/StandardRecord/SRGArParticle.h | 47 +++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 duneanaobj/StandardRecord/SRGArParticle.h diff --git a/duneanaobj/StandardRecord/SRGArParticle.h b/duneanaobj/StandardRecord/SRGArParticle.h new file mode 100644 index 0000000..aff6f29 --- /dev/null +++ b/duneanaobj/StandardRecord/SRGArParticle.h @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////// +// \file SRGArParticle.h +// \brief Reconstructed GAr particle object +// \author F. Martinez +// \date Mar. 2024 +//////////////////////////////////////////////////////////////////////// +#ifndef DUNEANAOBJ_SRGARPARTICLE_H +#define DUNEANAOBJ_SRGARPARTICLE_H + +namespace caf +{ + class SRGArParticle: + { + public: + + // GAr reco particle characteristics + SRVector3D p; ///< Reconstructed momentum of particle [GeV] + + float dEdx_total = -999.; ///< Total energy deposited in TPC [GeV] + float dEdx_mean = -999.; ///< Truncated mean dE/dx of TPC track [keV/cm] + + 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; ///< Reconstructed charge of particle + + float muon_score = -1.0; ///< Muon score based on ECAL and MuID activity + float proton_dEdx_score = -1.0; ///< Proton score based on TPC dE/dx measurement + float proton_tof_score = -1.0; ///< Proton score based on ECAL ToF measurement + + int garsoft_trk_assn = -999; ///< GArSoft TrackId associated to reco particle + std::vector garsoft_ecal_assns; ///< GArSoft ECALIds associated to reco particle + std::vector garsoft_muid_assns; ///< GArSoft MuIDIds associated to reco particle + }; + +} + +#if !defined(__GCCXML__) && !defined(__castxml__) +std::ostream & operator<<(std::ostream & stream, const caf::SRGArTrack & tr); +#endif + +#endif //DUNEANAOBJ_SRGARPARTICLE_H From 42604a882b30a76f9ec67487537ce31921347e3b Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Fri, 22 Mar 2024 09:05:38 -0500 Subject: [PATCH 04/22] Fix some errors --- duneanaobj/StandardRecord/SRGArParticle.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/duneanaobj/StandardRecord/SRGArParticle.h b/duneanaobj/StandardRecord/SRGArParticle.h index aff6f29..7bbbe8f 100644 --- a/duneanaobj/StandardRecord/SRGArParticle.h +++ b/duneanaobj/StandardRecord/SRGArParticle.h @@ -7,9 +7,11 @@ #ifndef DUNEANAOBJ_SRGARPARTICLE_H #define DUNEANAOBJ_SRGARPARTICLE_H +#include "duneanaobj/StandardRecord/SRVector3D.h" + namespace caf { - class SRGArParticle: + class SRGArParticle { public: @@ -40,8 +42,4 @@ namespace caf } -#if !defined(__GCCXML__) && !defined(__castxml__) -std::ostream & operator<<(std::ostream & stream, const caf::SRGArTrack & tr); -#endif - #endif //DUNEANAOBJ_SRGARPARTICLE_H From 8ef0df863c4da1202e08119f7294b339c65fcdb4 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Fri, 22 Mar 2024 09:05:49 -0500 Subject: [PATCH 05/22] Update SRGAr --- duneanaobj/StandardRecord/SRGAr.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/duneanaobj/StandardRecord/SRGAr.h b/duneanaobj/StandardRecord/SRGAr.h index 5016dc0..309c813 100644 --- a/duneanaobj/StandardRecord/SRGAr.h +++ b/duneanaobj/StandardRecord/SRGAr.h @@ -7,6 +7,7 @@ #ifndef DUNEANAOBJ_SRGAR_H #define DUNEANAOBJ_SRGAR_H +#include "duneanaobj/StandardRecord/SRGArParticle.h" #include "duneanaobj/StandardRecord/SRGArTrack.h" #include "duneanaobj/StandardRecord/SRGArECAL.h" @@ -16,11 +17,17 @@ namespace caf class SRGArInt { public: + std::vector particles; + std::size_t nparticles = 0; + std::vector tracks; std::size_t ntracks = 0; - std::vector clusters; - std::size_t nclusters = 0; + std::vector ecalclusters; + std::size_t necalclusters = 0; + + std::vector muidclusters; + std::size_t nmuidclusters = 0; // legacy parametric reco fields From c0bf2240cbd4521012bc92fdebaa419b54a99af4 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Fri, 22 Mar 2024 09:06:32 -0500 Subject: [PATCH 06/22] Update Interaction and RecoParticles branches to add GArSoft (gsft) reconstruction --- duneanaobj/StandardRecord/SRInteractionBranch.h | 3 +++ duneanaobj/StandardRecord/SRRecoParticlesBranch.h | 3 +++ 2 files changed, 6 insertions(+) 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/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 From bace41527c91a0a2a54c73cf672c8ef1ac29653b Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Fri, 22 Mar 2024 09:06:58 -0500 Subject: [PATCH 07/22] Update classes_def, with correct checksums --- duneanaobj/StandardRecord/classes_def.xml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/duneanaobj/StandardRecord/classes_def.xml b/duneanaobj/StandardRecord/classes_def.xml index 8237e46..3a32ec1 100644 --- a/duneanaobj/StandardRecord/classes_def.xml +++ b/duneanaobj/StandardRecord/classes_def.xml @@ -57,7 +57,8 @@ - + + @@ -82,7 +83,8 @@ - + + @@ -205,11 +207,21 @@ - + + - + + + + + + + + + + From 8d37049766b67cc3fe1537e83d5f9e2ac8c2ebcd Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Wed, 24 Apr 2024 07:22:49 -0500 Subject: [PATCH 08/22] Add particle energy method for GAr --- duneanaobj/StandardRecord/SREnums.h | 1 + 1 file changed, 1 insertion(+) diff --git a/duneanaobj/StandardRecord/SREnums.h b/duneanaobj/StandardRecord/SREnums.h index 30f8994..14b9b04 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. From 14867a3a88cde38323809a3790e5025b0aeaf86e Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Wed, 24 Apr 2024 07:23:56 -0500 Subject: [PATCH 09/22] sand should contain SANDInt not GArInt --- duneanaobj/StandardRecord/SRSAND.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }; From d375a538e9e99f3d43272cc112ae9b0706fc2fcb Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Wed, 24 Apr 2024 07:25:47 -0500 Subject: [PATCH 10/22] Add ParticleId to GArParticle --- duneanaobj/StandardRecord/SRGArParticle.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/duneanaobj/StandardRecord/SRGArParticle.h b/duneanaobj/StandardRecord/SRGArParticle.h index 7bbbe8f..4dde7e7 100644 --- a/duneanaobj/StandardRecord/SRGArParticle.h +++ b/duneanaobj/StandardRecord/SRGArParticle.h @@ -35,6 +35,8 @@ namespace caf float proton_dEdx_score = -1.0; ///< Proton score based on TPC dE/dx measurement float proton_tof_score = -1.0; ///< Proton score based on ECAL ToF measurement + int garsoft_part_id= -999; ///< GArSoft ParticleId for reco particle + int garsoft_trk_assn = -999; ///< GArSoft TrackId associated to reco particle std::vector garsoft_ecal_assns; ///< GArSoft ECALIds associated to reco particle std::vector garsoft_muid_assns; ///< GArSoft MuIDIds associated to reco particle From 11c74694605eef264910314543aecc508522925a Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Wed, 24 Apr 2024 11:12:53 -0500 Subject: [PATCH 11/22] Update classes checksums --- duneanaobj/StandardRecord/classes_def.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/duneanaobj/StandardRecord/classes_def.xml b/duneanaobj/StandardRecord/classes_def.xml index 3a32ec1..dcb9beb 100644 --- a/duneanaobj/StandardRecord/classes_def.xml +++ b/duneanaobj/StandardRecord/classes_def.xml @@ -212,7 +212,8 @@ - + + @@ -250,7 +251,8 @@ - + + From 7fbddb7b18b002c0694806fdacb326cc3e3aaf7e Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 25 Apr 2024 08:27:58 -0500 Subject: [PATCH 12/22] Make SRGArParticle inherit from SRRecoParticle and initialise from base class member --- duneanaobj/StandardRecord/SRGArParticle.h | 9 +++++---- duneanaobj/StandardRecord/classes_def.xml | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/duneanaobj/StandardRecord/SRGArParticle.h b/duneanaobj/StandardRecord/SRGArParticle.h index 4dde7e7..5b3ee59 100644 --- a/duneanaobj/StandardRecord/SRGArParticle.h +++ b/duneanaobj/StandardRecord/SRGArParticle.h @@ -7,17 +7,18 @@ #ifndef DUNEANAOBJ_SRGARPARTICLE_H #define DUNEANAOBJ_SRGARPARTICLE_H -#include "duneanaobj/StandardRecord/SRVector3D.h" +#include "duneanaobj/StandardRecord/SRRecoParticle.h" namespace caf { - class SRGArParticle + class SRGArParticle: public SRRecoParticle { public: - // GAr reco particle characteristics - SRVector3D p; ///< Reconstructed momentum of particle [GeV] + SRGArParticle() {} + SRGArParticle(SRRecoParticle const& p): SRRecoParticle(p) {} + // GAr reco particle characteristics float dEdx_total = -999.; ///< Total energy deposited in TPC [GeV] float dEdx_mean = -999.; ///< Truncated mean dE/dx of TPC track [keV/cm] diff --git a/duneanaobj/StandardRecord/classes_def.xml b/duneanaobj/StandardRecord/classes_def.xml index dcb9beb..10c34b4 100644 --- a/duneanaobj/StandardRecord/classes_def.xml +++ b/duneanaobj/StandardRecord/classes_def.xml @@ -212,7 +212,8 @@ - + + From eee4ebc905270f7ab09b3905b3740a747a350184 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 25 Apr 2024 09:25:40 -0500 Subject: [PATCH 13/22] Careful with the constructor --- duneanaobj/StandardRecord/SRGArParticle.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/duneanaobj/StandardRecord/SRGArParticle.h b/duneanaobj/StandardRecord/SRGArParticle.h index 5b3ee59..84db5f8 100644 --- a/duneanaobj/StandardRecord/SRGArParticle.h +++ b/duneanaobj/StandardRecord/SRGArParticle.h @@ -16,7 +16,9 @@ namespace caf public: SRGArParticle() {} - SRGArParticle(SRRecoParticle const& p): SRRecoParticle(p) {} + explicit SRGArParticle(SRRecoParticle const& p): SRRecoParticle(p) {} + + virtual ~SRGArParticle() = default; // GAr reco particle characteristics float dEdx_total = -999.; ///< Total energy deposited in TPC [GeV] From 740e0c600825e7dc46432e1c5a9634d004e3d9f1 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 16:47:26 -0500 Subject: [PATCH 14/22] Some tweaks to the calo cluster class --- duneanaobj/StandardRecord/SRGArCalo.h | 45 +++++++++++++++++++++++++++ duneanaobj/StandardRecord/SRGArECAL.h | 34 -------------------- 2 files changed, 45 insertions(+), 34 deletions(-) create mode 100644 duneanaobj/StandardRecord/SRGArCalo.h delete mode 100644 duneanaobj/StandardRecord/SRGArECAL.h diff --git a/duneanaobj/StandardRecord/SRGArCalo.h b/duneanaobj/StandardRecord/SRGArCalo.h new file mode 100644 index 0000000..761414e --- /dev/null +++ b/duneanaobj/StandardRecord/SRGArCalo.h @@ -0,0 +1,45 @@ +//////////////////////////////////////////////////////////////////////// +// \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 +{ + /// Types of GAr calo clusters + enum CaloClusterType + { + kUnknownCluster = 0, + kECalCluster = 1, + kMuIDCluster = 2 + }; + + class SRGArCalo + { + public: + + CaloClusterType cluster_type = CaloClusterType::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 5455232..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 [cm] - float E = -999.; ///< Energy corresponding to this cluster [GeV] - - 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 From e74c34a0c096390d972594ca269553b9366bb0f8 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 16:48:27 -0500 Subject: [PATCH 15/22] Get rid of SRGArParticle and reorganise its content --- duneanaobj/StandardRecord/SRGArAssociation.h | 40 ++++++++++++++++ duneanaobj/StandardRecord/SRGArParticle.h | 50 -------------------- duneanaobj/StandardRecord/SRGArTrack.h | 5 ++ 3 files changed, 45 insertions(+), 50 deletions(-) create mode 100644 duneanaobj/StandardRecord/SRGArAssociation.h delete mode 100644 duneanaobj/StandardRecord/SRGArParticle.h diff --git a/duneanaobj/StandardRecord/SRGArAssociation.h b/duneanaobj/StandardRecord/SRGArAssociation.h new file mode 100644 index 0000000..22c1fb8 --- /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/SRGArParticle.h b/duneanaobj/StandardRecord/SRGArParticle.h deleted file mode 100644 index 84db5f8..0000000 --- a/duneanaobj/StandardRecord/SRGArParticle.h +++ /dev/null @@ -1,50 +0,0 @@ -//////////////////////////////////////////////////////////////////////// -// \file SRGArParticle.h -// \brief Reconstructed GAr particle object -// \author F. Martinez -// \date Mar. 2024 -//////////////////////////////////////////////////////////////////////// -#ifndef DUNEANAOBJ_SRGARPARTICLE_H -#define DUNEANAOBJ_SRGARPARTICLE_H - -#include "duneanaobj/StandardRecord/SRRecoParticle.h" - -namespace caf -{ - class SRGArParticle: public SRRecoParticle - { - public: - - SRGArParticle() {} - explicit SRGArParticle(SRRecoParticle const& p): SRRecoParticle(p) {} - - virtual ~SRGArParticle() = default; - - // GAr reco particle characteristics - float dEdx_total = -999.; ///< Total energy deposited in TPC [GeV] - float dEdx_mean = -999.; ///< Truncated mean dE/dx of TPC track [keV/cm] - - 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; ///< Reconstructed charge of particle - - float muon_score = -1.0; ///< Muon score based on ECAL and MuID activity - float proton_dEdx_score = -1.0; ///< Proton score based on TPC dE/dx measurement - float proton_tof_score = -1.0; ///< Proton score based on ECAL ToF measurement - - int garsoft_part_id= -999; ///< GArSoft ParticleId for reco particle - - int garsoft_trk_assn = -999; ///< GArSoft TrackId associated to reco particle - std::vector garsoft_ecal_assns; ///< GArSoft ECALIds associated to reco particle - std::vector garsoft_muid_assns; ///< GArSoft MuIDIds associated to reco particle - }; - -} - -#endif //DUNEANAOBJ_SRGARPARTICLE_H diff --git a/duneanaobj/StandardRecord/SRGArTrack.h b/duneanaobj/StandardRecord/SRGArTrack.h index 372a422..56e5a3b 100644 --- a/duneanaobj/StandardRecord/SRGArTrack.h +++ b/duneanaobj/StandardRecord/SRGArTrack.h @@ -28,6 +28,11 @@ namespace caf float len_cm_fwd = -999.; ///< Length of track in forward fit [cm] float len_cm_bak = -999.; ///< Length of track in backward fit [cm] + 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] + + 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 From 73af985172f88e68775e2ef65c87bd7def394673 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 16:48:53 -0500 Subject: [PATCH 16/22] Update SRGAr class --- duneanaobj/StandardRecord/SRGAr.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/duneanaobj/StandardRecord/SRGAr.h b/duneanaobj/StandardRecord/SRGAr.h index 309c813..b65439a 100644 --- a/duneanaobj/StandardRecord/SRGAr.h +++ b/duneanaobj/StandardRecord/SRGAr.h @@ -7,9 +7,9 @@ #ifndef DUNEANAOBJ_SRGAR_H #define DUNEANAOBJ_SRGAR_H -#include "duneanaobj/StandardRecord/SRGArParticle.h" #include "duneanaobj/StandardRecord/SRGArTrack.h" -#include "duneanaobj/StandardRecord/SRGArECAL.h" +#include "duneanaobj/StandardRecord/SRGArCalo.h" +#include "duneanaobj/StandardRecord/SRGArAssociation.h" namespace caf { @@ -17,28 +17,28 @@ namespace caf class SRGArInt { public: - std::vector particles; - std::size_t nparticles = 0; - std::vector tracks; - std::size_t ntracks = 0; + std::vector tracks; + std::size_t ntracks = 0; - std::vector ecalclusters; - std::size_t necalclusters = 0; + std::vector ecalclusters; + std::size_t necalclusters = 0; - std::vector muidclusters; - std::size_t nmuidclusters = 0; + std::vector muidclusters; + std::size_t nmuidclusters = 0; - // legacy parametric reco fields + std::vector associations; + std::size_t nassociations = 0; - int nFSP; + // 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 From ce07d346f5a0c42a6fa5d8ca8696146dfe3ed15f Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 16:49:50 -0500 Subject: [PATCH 17/22] Create PIDScore branch --- duneanaobj/StandardRecord/SRPIDScoreBranch.h | 24 ++++++++++++++++++++ duneanaobj/StandardRecord/SRRecoParticle.h | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 duneanaobj/StandardRecord/SRPIDScoreBranch.h 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 From 8bb44ede2fc8226a05994b11df86a912bb1c01b2 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 16:50:13 -0500 Subject: [PATCH 18/22] Add branch with GAr PID scores --- .../StandardRecord/SRGArPIDScoreBranch.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 duneanaobj/StandardRecord/SRGArPIDScoreBranch.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 From 8298f8959a53b2281abad1a04de5f3ea2db3fc1f Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 16:53:01 -0500 Subject: [PATCH 19/22] Remove repeated truth overlap variable --- duneanaobj/StandardRecord/SRGArTrack.h | 1 - 1 file changed, 1 deletion(-) diff --git a/duneanaobj/StandardRecord/SRGArTrack.h b/duneanaobj/StandardRecord/SRGArTrack.h index 56e5a3b..a922a12 100644 --- a/duneanaobj/StandardRecord/SRGArTrack.h +++ b/duneanaobj/StandardRecord/SRGArTrack.h @@ -42,7 +42,6 @@ namespace caf 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 }; } From 0a11806cfd72014a43c4fe98727a601ffbdd5c6b Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 18:53:01 -0500 Subject: [PATCH 20/22] Fix typo in GArAssociation --- duneanaobj/StandardRecord/SRGArAssociation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/duneanaobj/StandardRecord/SRGArAssociation.h b/duneanaobj/StandardRecord/SRGArAssociation.h index 22c1fb8..d0eccf1 100644 --- a/duneanaobj/StandardRecord/SRGArAssociation.h +++ b/duneanaobj/StandardRecord/SRGArAssociation.h @@ -9,7 +9,7 @@ namespace caf { - class SRGArAssociation: + class SRGArAssociation { public: From e38afa1dceb765544b3501e953fe8afa7cdc0326 Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 18:53:31 -0500 Subject: [PATCH 21/22] Move GArCaloType to Enums --- duneanaobj/StandardRecord/Proxy/Instantiations.cxx | 2 ++ duneanaobj/StandardRecord/SREnums.h | 8 ++++++++ duneanaobj/StandardRecord/SRGArCalo.h | 10 +--------- 3 files changed, 11 insertions(+), 9 deletions(-) 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 14b9b04..fa30456 100644 --- a/duneanaobj/StandardRecord/SREnums.h +++ b/duneanaobj/StandardRecord/SREnums.h @@ -117,6 +117,14 @@ namespace caf kPandoraNDLAr }; + /// Types of GAr calo clusters + enum GArCaloType + { + kUnknownCluster = 0, + kECalCluster = 1, + kMuIDCluster = 2 + }; + } diff --git a/duneanaobj/StandardRecord/SRGArCalo.h b/duneanaobj/StandardRecord/SRGArCalo.h index 761414e..52779d3 100644 --- a/duneanaobj/StandardRecord/SRGArCalo.h +++ b/duneanaobj/StandardRecord/SRGArCalo.h @@ -13,19 +13,11 @@ namespace caf { - /// Types of GAr calo clusters - enum CaloClusterType - { - kUnknownCluster = 0, - kECalCluster = 1, - kMuIDCluster = 2 - }; - class SRGArCalo { public: - CaloClusterType cluster_type = CaloClusterType::kUnknownCluster; ///< Type of GAr calo cluster + 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] From b7b7ae72828b37d3e4eb15058ad67bc3a545c41f Mon Sep 17 00:00:00 2001 From: Francisco Martinez Lopez Date: Thu, 30 May 2024 18:53:46 -0500 Subject: [PATCH 22/22] Update classes_def --- duneanaobj/StandardRecord/classes_def.xml | 37 ++++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/duneanaobj/StandardRecord/classes_def.xml b/duneanaobj/StandardRecord/classes_def.xml index 10c34b4..a49b47a 100644 --- a/duneanaobj/StandardRecord/classes_def.xml +++ b/duneanaobj/StandardRecord/classes_def.xml @@ -71,7 +71,7 @@ - + @@ -89,7 +89,8 @@ - + + @@ -100,6 +101,16 @@ + + + + + + + + + + @@ -207,22 +218,22 @@ - + + - - - - + + - + - + + @@ -234,15 +245,19 @@ - + + + - + + +