Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
5b9920d
Change all bkwd to bak to match gsft convention
fmartinezlopez Mar 19, 2024
9182afd
Small changes to existing classes
fmartinezlopez Mar 22, 2024
f2d2411
Add new class for GAr reco particles
fmartinezlopez Mar 22, 2024
42604a8
Fix some errors
fmartinezlopez Mar 22, 2024
8ef0df8
Update SRGAr
fmartinezlopez Mar 22, 2024
c0bf224
Update Interaction and RecoParticles branches to add GArSoft (gsft) r…
fmartinezlopez Mar 22, 2024
bace415
Update classes_def, with correct checksums
fmartinezlopez Mar 22, 2024
8d37049
Add particle energy method for GAr
fmartinezlopez Apr 24, 2024
14867a3
sand should contain SANDInt not GArInt
fmartinezlopez Apr 24, 2024
d375a53
Add ParticleId to GArParticle
fmartinezlopez Apr 24, 2024
11c7469
Update classes checksums
fmartinezlopez Apr 24, 2024
7fbddb7
Make SRGArParticle inherit from SRRecoParticle and initialise from ba…
fmartinezlopez Apr 25, 2024
eee4ebc
Careful with the constructor
fmartinezlopez Apr 25, 2024
740e0c6
Some tweaks to the calo cluster class
fmartinezlopez May 30, 2024
e74c34a
Get rid of SRGArParticle and reorganise its content
fmartinezlopez May 30, 2024
73af985
Update SRGAr class
fmartinezlopez May 30, 2024
ce07d34
Create PIDScore branch
fmartinezlopez May 30, 2024
8bb44ed
Add branch with GAr PID scores
fmartinezlopez May 30, 2024
8298f89
Remove repeated truth overlap variable
fmartinezlopez May 30, 2024
0a11806
Fix typo in GArAssociation
fmartinezlopez May 30, 2024
e38afa1
Move GArCaloType to Enums
fmartinezlopez May 30, 2024
b7b7ae7
Update classes_def
fmartinezlopez May 30, 2024
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
2 changes: 2 additions & 0 deletions duneanaobj/StandardRecord/Proxy/Instantiations.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ namespace caf
template class Proxy<NDLAR_RECO_STACK>;
template class Proxy<FD_RECO_STACK>;

template class Proxy<GArCaloType>;

template class Proxy<TrueParticleID::PartType>;
}
9 changes: 9 additions & 0 deletions duneanaobj/StandardRecord/SREnums.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -116,6 +117,14 @@ namespace caf
kPandoraNDLAr
};

/// Types of GAr calo clusters
enum GArCaloType
{
kUnknownCluster = 0,
kECalCluster = 1,
kMuIDCluster = 2
};

}


Expand Down
23 changes: 15 additions & 8 deletions duneanaobj/StandardRecord/SRGAr.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,37 @@
#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
{
/// An ND-GAr reconstructed neutrino interaction
class SRGArInt
{
public:
std::vector<SRGArTrack> tracks;
std::size_t ntracks = 0;

std::vector<SRGArECAL> clusters;
std::size_t nclusters = 0;
std::vector<SRGArTrack> tracks;
std::size_t ntracks = 0;

// legacy parametric reco fields
std::vector<SRGArCalo> ecalclusters;
std::size_t necalclusters = 0;

std::vector<SRGArCalo> muidclusters;
std::size_t nmuidclusters = 0;

int nFSP;
std::vector<SRGArAssociation> associations;
std::size_t nassociations = 0;

// legacy parametric reco fields
/* int nFSP;
std::vector<int> pdg;
std::vector<float> ptrue;
std::vector<float> trkLen;
std::vector<float> trkLenPerp;
std::vector<float> 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
Expand Down
40 changes: 40 additions & 0 deletions duneanaobj/StandardRecord/SRGArAssociation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
////////////////////////////////////////////////////////////////////////
// \file SRGArAssociation.h
// \brief Associations between GAr reco objects
// \author F. Martinez <f.martinezlopez@qmul.ac.uk>
// \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<int> garsoft_ecal_assns; ///< associated GArSoft ECALIds
size_t n_garsoft_ecal_assns = 0; ///< number of associated ECal clusters

std::vector<int> garsoft_muid_assns; ///< associated GArSoft MuIDIds
size_t n_garsoft_muid_assns = 0; ///< number of associated MuID clusters
};

}

#endif //DUNEANAOBJ_SRGArASSOCIATION_H
37 changes: 37 additions & 0 deletions duneanaobj/StandardRecord/SRGArCalo.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
////////////////////////////////////////////////////////////////////////
// \file SRGArCalo.h
// \brief Reconstructed GAr calo cluster object
// \author F. Martinez <f.martinezlopez@qmul.ac.uk>
// \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<TrueParticleID> truth; ///< Associated SRTrueParticle(s), if relevant (use SRTruthBranch::Particle() with these IDs to grab them)
std::vector<float> truthOverlap; ///< Fractional overlap between this cluster and true particle
};

}

#endif //DUNEANAOBJ_SRGARCALO_H
34 changes: 0 additions & 34 deletions duneanaobj/StandardRecord/SRGArECAL.h

This file was deleted.

26 changes: 26 additions & 0 deletions duneanaobj/StandardRecord/SRGArPIDScoreBranch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
////////////////////////////////////////////////////////////////////////
/// \file SRGArPIDScoreBranch.h
/// \brief Collections of GArSoft PID scores
/// \author F. Martinez <f.martinezlopez@qmul.ac.uk>

#ifndef DUNEANAOBJ_SRGARPIDSCOREBRANCH_H
#define DUNEANAOBJ_SRGARPIDSCOREBRANCH_H

#include <limits>

namespace caf
{
class SRGArPIDScoreBranch
{
private:
static constexpr float NaN = std::numeric_limits<float>::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
33 changes: 20 additions & 13 deletions duneanaobj/StandardRecord/SRGArTrack.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> pid_fwd; ///< PID of track in forward fit
std::vector<float> pid_prob_fwd; ///< PID probability vector in forward fit
std::vector<int> pid_bkwd; ///< PID of track in backward fit
std::vector<float> 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<int> pid_fwd; ///< Parametrised PID of track in forward fit
std::vector<float> pid_prob_fwd; ///< Parametrised PID probability vector in forward fit
std::vector<int> pid_bak; ///< Parametrised PID of track in backward fit
std::vector<float> pid_prob_bak; ///< Parametrised PID probability vector in backward fit

float truth_fraction; ///< Contribution of truth particle to reco object
};

}
Expand Down
3 changes: 3 additions & 0 deletions duneanaobj/StandardRecord/SRInteractionBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ namespace caf
std::vector<SRInteraction> pandora; ///< Interactions from Pandora reconstruction
std::size_t npandora;

std::vector<SRInteraction> gsft; ///< Interactions from GArSoft reconstruction
std::size_t ngsft;


};
}
Expand Down
24 changes: 24 additions & 0 deletions duneanaobj/StandardRecord/SRPIDScoreBranch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
////////////////////////////////////////////////////////////////////////
/// \file SRPIDScoreBranch.h
/// \brief Collections of PID score methods
/// \author F. Martinez <f.martinezlopez@qmul.ac.uk>

#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
4 changes: 2 additions & 2 deletions duneanaobj/StandardRecord/SRRecoParticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/// \brief A general reconstructed particle container
/// \author J. Wolcott <jwolcott@fnal.gov>


#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
{
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions duneanaobj/StandardRecord/SRRecoParticlesBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ namespace caf

int npida = 0;
std::vector<SRRecoParticle> pida; ///< Particles bearing weights from PIDA algorithm

int ngsft = 0;
std::vector<SRRecoParticle> gsft; ///< Particles reconstructed by GArSoft
};

} // caf
Expand Down
2 changes: 1 addition & 1 deletion duneanaobj/StandardRecord/SRSAND.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace caf
};

std::size_t nixn = 0;
std::vector<SRGArInt> ixn; ///< Reconstructed interactions
std::vector<SRSANDInt> ixn; ///< Reconstructed interactions

};

Expand Down
Loading