1 #ifndef TSFGReconModule_hxx_seen
2 #define TSFGReconModule_hxx_seen
6 #include <TClonesArray.h>
7 #include <TLorentzVector.h>
13 #include <TND280Event.hxx>
14 #include <TReconCluster.hxx>
15 #include <TReconPID.hxx>
16 #include <TReconShower.hxx>
17 #include <TReconTrack.hxx>
18 #include <TReconVertex.hxx>
20 #include <TG4VHit.hxx>
21 #include <TMCDigit.hxx>
24 #include <TG4VHit.hxx>
25 #include <TG4HitSegment.hxx>
26 #include <retrieveHitTruthInfo.hxx>
27 #include <TG4Trajectory.hxx>
32 class TSFGReconModule;
40 const char *title =
"SFG Recon Module");
641 virtual bool FillTree(ND::TND280Event &);
654 void FillBaseObject(T basePtr, ND::THandle<ND::TReconBase> baseObject,
686 virtual int FillNode(
const ND::THandle<ND::TReconNode>,
bool saveHits);
690 int FillHit(
const ND::THandle<ND::THit>);
695 int AddHit(
const ND::THandle<ND::THit>,
701 virtual std::map<int, std::pair<int, float> >
706 virtual std::vector<int>
714 typedef std::map<ND::THandle<ND::THit>,
int>
HitMap;
722 double& pur,
double& eff);
733 bool checkNearbyMultiTrk(ND::THandle<ND::THit> hit, std::vector<ND::TG4HitSegment*> HitSegAllPlanes, ND::THandle<ND::TG4TrajectoryContainer> true_traj);
std::vector< int > Truth_TrajIds
The vector of primary true trajectory Ids which contribute to the ND::THits which are constituents of...
ClassDef(ND::TSFGReconModule::TSFGCluster, 1)
std::vector< int > Showers
The indices of the showers contained by the current object.
std::vector< int > Truth_HitCount
The vector of true trajectory Ids which contribute to the ND::THits which are constituents of this ve...
std::vector< int > Truth_TrajIds
True trajectory Ids See the TSFGVertex object for documentation.
virtual int FillNode(const ND::THandle< ND::TReconNode >, bool saveHits)
Fill the next node for any type of object.
virtual std::map< int, std::pair< int, float > > HitTruthInfo(const ND::THandle< ND::THitSelection >)
For each hit, go through and find the energy generated for each trajectory.
int TrueParticleID
True Geant4 particle associated to a TSFGTrack.
std::vector< int > Hits
The indices of the hits contained by the current object.
float EDeposit
The total reconstructed energy deposit of the corresponding track. This is usually just the sum of th...
float Charge
The reconstructed particle charge of the corresponding TReconPID.
std::vector< int > Tracks
The indices of the tracks contained by the current object.
std::vector< float > Truth_ChargeShare
Carge share o true trajectory.
TLorentzVector PosVariance
Variance on the position of the corresponding object.
virtual ObjectId FillParticleObject(const ND::THandle< ND::TReconPID >, bool saveHits)
Fill the next TSFGParticle entry from a TReconPID.
std::vector< float > HitSegTrueEdepo
True energy loss of the current hit segment.
std::vector< float > Truth_ChargeShare
Carge share o true trajectory.
std::vector< int > Showers
The indices of the showers contained by the current object.
std::vector< int > Truth_HitCount
Nmber of hits contributed by each true trajectory.
std::string AlgorithmName
The name of the algorithm which produced this object.
std::vector< int > Vertices
The indices of the vertices contained by the current object.
bool checkHitSegInCube(ND::THandle< ND::THit > hit, ND::TG4HitSegment *HitSeg)
int TrueParticleEff
Efficiency of Geant4 particle associated to a TSFGTrack.
int FillHit(const ND::THandle< ND::THit >)
Fill the Hits container and return the index of the new hit.
std::vector< int > Particles
The indices of the particles contained by the current object.
int TrueParticlePur
Purity of Geant4 particle associated to a TSFGTrack.
std::vector< int > Clusters
The indices of the clusters contained by the current object.
int fNTracks
The TSFGTrack vector of results.
TSFGClusterContainer * fClusters
The TSFGCluster vector of results.
std::vector< int > Clusters
The indices of the clusters contained by the current object.
int NDOF
The Number of Degrees of Freedom in the reconstruction of the corresponding object. Retrieved from ND::TReconBase::GetNDOF.
virtual void InitializeModule()
Called before anything else to allow the module to initialize.
std::vector< int > Particles
The indices of the particles contained by the current object.
TVector3 Direction
Direction of the corresponding object.
int fNNodes
The TSFGNode vector of results.
std::vector< int > Truth_TrajIds
True trajectory Ids.
float Quality
ND::TReconBase::StateBits to check the which status flags are set.
TSFGAlgoResContainer * fAlgoResults
The TSFGAlgoRes vector of results.
int TrueParticleID
True Geant4 particle associated to a TSFGTrack.
virtual ~TSFGReconModule()
ClassDef(ND::TSFGReconModule::TSFGAlgoRes, 1)
int fNShowers
The TSFGShower vector of results.
virtual ObjectId FillShowerObject(const ND::THandle< ND::TReconShower >, bool saveHits)
Fill the next TSFGShower entry from a TReconShower.
int TrueParticleID
True Geant4 particle associated to a TSFGTrack.
TVector3 Position
Hit position.
TVector3 Direction
Direction of the corresponding object.
Contains a summary of the reconstruction information in a TReconShower.
std::vector< int > Nodes
The indices of the nodes contained by the current object.
int Status
The reported status of the corresponding object. Use ND::TReconBase::StateBits to check the which sta...
TLorentzVector Position
Position of the corresponding object.
static const int arraySize
Size of the TSFGCluster::Moments array.
std::vector< int > Truth_TrajIds
True trajectory Ids.
TSFGHitContainer * fTrueHits
std::vector< int > Hits
The indices of the hits contained by the current object.
int TrueParticleID
True G4 particle associated to a TSFGParticle.
std::vector< int > Tracks
The indices of the tracks contained by the current object.
int TrueParticlePur
Purity of the True G4 particle associated to a TSFGParticle.
int fNAlgoResults
The TSFGAlgoRes vector of results.
void FillTrueTrajInfoForHit(ND::TG4HitSegment *, TSFGHit *)
UInt_t UniqueId
A unique Id used for reconstruction objects.
int fNVertices
The TSFGVertex vector of results.
void FillBaseObject(T basePtr, ND::THandle< ND::TReconBase > baseObject, bool saveHits)
Fill the header for TSFGAlgoRes, TSFGVertex, TSFGParticle, TSFGTrack, TSFGVertex, and TSFGCluster...
ClassDef(ND::TSFGReconModule::TSFGVertex, 1)
The weighted reconstructed charge deposited by each truth.
std::vector< int > Tracks
The indices of the tracks contained by the current object.
TLorentzVector Position
Position of the corresponding object.
std::vector< float > Truth_ChargeShare
Carge share o true trajectory See the TSFGVertex object for documentation.
virtual ObjectId FillClusterObject(const ND::THandle< ND::TReconCluster >, bool saveHits)
Fill the next TSFGCluster entry from a TReconCluster.
ND::THandle< ND::TG4Trajectory > GetG4Trajectory(const T &object, double &pur, double &eff)
UInt_t UniqueId
A unique Id used for reconstruction objects.
std::vector< int > Nodes
The indices of the nodes contained by the current object.
bool checkNearbyMultiTrk(ND::THandle< ND::THit > hit, std::vector< ND::TG4HitSegment * > HitSegAllPlanes, ND::THandle< ND::TG4TrajectoryContainer > true_traj)
std::vector< int > Truth_HitCount
Nmber of hits contributed by each true trajectory.
TVector3 Direction
Direction of the corresponding object.
UInt_t UniqueId
A count of the Hits associated with this object.
void FillHitInfoNeededForNN(const ND::THandle< ND::THit >, TSFGHit *)
virtual EType GetTreeType() const
Override the parent method to return the type of this tree.
TClonesArray TSFGAlgoResContainer
TLorentzVector PosVariance
Variance on the position of the corresponding object.
Used to fill a TTree of summary information for the SFG reconstruction algorithms.
UInt_t UniqueId
A unique Id used for reconstruction objects.
TClonesArray TSFGPartContainer
TClonesArray TSFGVertexContainer
virtual std::vector< int > HitTruthPrimaryInfo(const ND::THandle< ND::THitSelection >)
For each hit, go through and find the primary particles that are depositing energy.
float Quality
The reported reconstruction 'quality' of the corresponding object. Uses ND::TReconBase::GetQuality.
int NHits
Holds index of the TSFGHit objects that are pertinent to this algorithm result.
std::vector< int > Vertices
The indices of the vertices contained by the current object.
std::vector< int > Hits
The indices of the hits contained by the current object.
std::vector< int > Clusters
Holds index of the TSFGShower objects that are pertinent to this algorithm result.
std::vector< int > Showers
The indices of the showers contained by the current object.
std::vector< int > Vertices
The indices of the vertices contained by the current object.
virtual ObjectId FillTrackObject(const ND::THandle< ND::TReconTrack >, bool saveHits)
Fill the next TSFGTrack entry from a TReconTrack.
TLorentzVector Position
Position of the corresponding object.
float Time
Reconstructed hit time from the corresponding TSingleHit.
UInt_t UniqueId
A unique Id used for reconstruction objects.
ObjectId()
The default constructor.
std::vector< TPRegexp > fRejectAlgoResultList
If an incoming TAlgorithmResult's name matches a pattern within this vector it will not be summarised...
std::vector< int > Tracks
The indices of the tracks contained by the current object.
virtual bool FillTree(ND::TND280Event &)
Called by the main loop to fill an event.
std::vector< int > Particles
The indices of the particles contained by the current object.
std::vector< int > Hits
The indices of the hits contained by the current object.
std::vector< int > Clusters
The indices of the clusters contained by the current object.
std::vector< int > Nodes
The indices of the nodes contained by the current object.
float EDeposit
The total reconstructed energy deposit of the corresponding track. This is usually just the sum of th...
std::vector< int > Tracks
The indices of the tracks contained by the current object.
std::vector< int > Particles
The indices of the particles contained by the current object.
int UsedHitCluster
The index of the cluster that contains all of the hits used by this algorithm result. This is -1 if the hits are not saved.
TLorentzVector Position
corresponding object.
TClonesArray TSFGClusterContainer
virtual Bool_t ProcessFirstEvent(ND::TND280Event &)
This gets called on the first event to let the main event loop know if the first event in the file sh...
std::vector< int > Truth_PrimaryTrajIds
Primary Ids of truth trajectories.
float Quality
The reported reconstruction 'quality' of the vertex. Retrieved from ND::TReconBase::GetQuality.
float EDeposit
The total reconstructed energy deposit of the corresponding track. This is usually just the sum of th...
virtual ObjectId FillVertexObject(const ND::THandle< ND::TReconVertex >, bool saveHits)
Fill the next TSFGVertex entry from a TReconVertex.
TSFGReconModule(const char *name="SFG", const char *title="SFG Recon Module")
std::string AlgorithmName
The name of the algorithm which produced this object.
TLorentzVector Position
Position of the correspponding object.
TSFGHitContainer * fHits
The TSFGHit vector of hits.
std::vector< int > Showers
The indices of the showers contained by the current object.
TLorentzVector PosVariance
Variance on the position of the corresponding object.
std::vector< TLorentzVector > HitSegPosition
True hit segments inside the cube position (3D + time)
TLorentzVector PosVariance
Variance on the position of the corresponding object.
std::vector< int > Truth_HitCount
Nmber of hits contributed by each true trajectory.
int fNTrueHits
The TSFGHit vector of hits based on the number of photons generated in each cube. ...
std::vector< int > Vertices
The indices of the vertices contained by the current object.
Contains a summary of the reconstruction information for each cube.
virtual ObjectId FillReconObject(const ND::THandle< ND::TReconBase >, bool saveHits)
This is a switch yard to take any sort of reconstruction object, and farm it out to the right specifi...
int Status
The reported Status of the corresponding object. Use ND::TReconBase::StateBits to check the which sta...
std::vector< int > Truth_TrajIds
True trajectory Ids.
std::vector< float > Truth_ChargeShare
Carge share o true trajectory.
int TrueParticleEff
Efficiency of Geant4 particle associated to a TSFGTrack.
TVector3 Direction
Direction of the corresponding object.
TVector3 DirVariance
Direction variance of the corresponding object.
std::vector< int > Truth_HitCount
Nmber of hits contributed by each true trajectory.
TVector3 DirVariance
Direction variance of the corresponding object.
std::vector< int > Particles
The indices of the particles contained by the current object.
float Cone
The opening angle of the TShowerState cone of the corresponding TReconShower.
A summary of the reconstruction information in a TReconPID.
std::string FullName
A unique Id used for reconstruction objects.
virtual void InitializeBranches()
Called to let the module setup the appropriate branches.
std::string AlgorithmName
The name of the algorithm which produced this object.
Contains a summary of the reconstruction information in a TReconTrack.
int fNClusters
The TSFGCluster vector of results.
std::vector< int > Hits
Holds internal Ids of Hits pertinent to this reconstruction node.
OType_t
The reconstruction object type that this internal Id refers to.
TLorentzVector PosVariance
Variance on the position of the corresponding object.
std::vector< int > Clusters
The indices of the clusters contained by the current object.
int Parent
The index of the parent algorithm for this algorithm result. This will be -1 if this doesn't have a p...
TSFGPartContainer * fParticles
The TSFGParticle vector of results.
Contains a summary of the reconstruction information in a TReconNode.
std::string AlgorithmName
The name of the algorithm which produced this object.
int TrueParticlePur
Purity of Geant4 particle associated to a TSFGTrack.
std::vector< int > Clusters
The indices of the clusters contained by the current object.
virtual int FillAlgorithmResult(const ND::THandle< ND::TAlgorithmResult >, int)
Fill an algorithm result and all of it's subsidiary reconstruction objects.
float Width
The 'width' of the shower, the extent perpendicular to the direction.
TSFGNodeContainer * fNodes
The TSFGNode vector of results.
std::map< ND::THandle< ND::THit >, int > HitMap
Scratch space to keep track of already summarised THits.
std::vector< int > HitSegTruePDG
True particle PDG of the track contributing to the hit segment.
std::vector< int > Hits
The indices of the hits contained by the current object.
int id
An internal Id for each Reconstruction object.
int Status
The reported Status of the corresponding ND::TReconPID.
float EDeposit
Holds internal Ids of Hits pertinent to this reconstruction node.
int NDOF
object. Uses ND::TReconBase::GetQuality
Contains a summary of the reconstruction information in a TReconCluster.
std::vector< float > HitSegTrueP
True momentum of the track contributing to the hit segment.
std::vector< float > Truth_ChargeShare
The number of THits that each truth trajectory contributed to.
std::vector< int > Hits
Holds index of the TSFGNode objects that are pertinent to this algorithm result.
UInt_t UniqueId
A unique Id used for reconstruction objects.
The representation of the information store in each SFG TReconVertex object.
std::vector< int > Vertices
Holds index of the TSFGVertex objects that are pertinent to this algorithm result.
ND::THandle< ND::TG4TrajectoryContainer > fTrueTraj
std::vector< int > Particles
Holds index of the TSFGVertex objects that are pertinent to this algorithm result.
std::vector< int > Truth_PrimaryTrajIds
The vector of primary true trajectory Ids which contribute to the ND::THits which are constituents of...
std::vector< float > PID_weight
PID weights for each PID in TSFGParticle::PID.
int NDOF
The Number of Degrees of Freedom in the reconstruction of the corresponding object. Retrieved from ND::TReconBase::GetNDOF.
std::vector< int > Nodes
The indices of the nodes contained by the current object.
std::string AlgorithmName
The name of the algorithm that generated this object.
int Status
The reported Status of the corresponding object. Use ND::TReconBase::StateBits to check the which sta...
int NDOF
The Number of Degrees of Freedom in the vertex. Retrieved from ND::TReconBase::GetNDOF.
std::vector< int > Nodes
Holds index of the TSFGCluster objects that are pertinent to this algorithm result.
TVector3 DirVariance
Direction variance of the corresponding object.
UInt_t GeomId
Geometry Id of the TSingleHit.
float Quality
The reported reconstruction 'quality' of the corresponding object. Uses ND::TReconBase::GetQuality.
TClonesArray TSFGShowerContainer
TLorentzVector Position
Position of the corresponding object.
float Charge
Reconstructed hit charge without attenuation correction from thE corresponding TSingleHit.
int TrueParticleEff
Efficiency of Geant4 particle associated to a TSFGTrack.
std::vector< int > PID
Potential PIDs (ND::TReconPID::ParticleId) matching with TSFGParticle::PID_Weight values...
std::vector< TVector3 > HitSegDirection
True hit segments inside the cube direction (3D)
int fNHits
The TSFGHit vector of hits.
TVector3 DirVariance
Direction variance of the corresponding object.
An internal Id and object type for each Reconstruction object.
TClonesArray TSFGNodeContainer
std::vector< int > Truth_PrimaryTrajIds
Primary Ids of truth trajectories See the TSFGVertex object for documentation.
int TrueParticleEff
Efficiency of the True G4 particle associated to a TSFGParticle.
TLorentzVector PosVariance
Variance on the position of the corresponding object.
std::vector< int > Truth_PrimaryTrajIds
Primary Ids of truth trajectories.
std::vector< int > Showers
Holds index of the TSFGTrack objects that are pertinent to this algorithm result. ...
TSFGHitContainer * fFibers
The TSFGHit vector of hits for each fiber.
ClassDef(ND::TSFGReconModule::TSFGParticle, 1)
std::vector< int > Truth_TrajIds
True trajectory Ids.
TSFGTrackContainer * fTracks
The TSFGTrack vector of results.
std::vector< int > AlgoResults
The path to the result inside the event.
int UnusedHitCluster
The index of the cluster that contains all of the hits not used by this algorithm result...
float Moments[arraySize]
Moments of the cluster stored as a flat 3x3 matrix.
TClonesArray TSFGTrackContainer
std::vector< float > Truth_ChargeShare
Carge share o true trajectory.
TSFGVertexContainer * fVertices
The TSFGVertex vector of results.
std::vector< int > Tracks
Holds index of the TSFGParticle objects that are pertinent to this algorithm result.
std::vector< int > Truth_PrimaryTrajIds
Primary Ids of truth trajectories.
float Length
The 'width' of the shower, the extent perpendicular to the direction.
float Length
The length of the track calculated by summing over the distances between the constituent TReconNodes...
float Momentum
The reconstructed momentum of the corresponding TReconPID.
std::vector< int > Vertices
The indices of the vertices contained by the current object.
TClonesArray TSFGHitContainer
int TrkHitTag
Single/multiple track hit tagging Notation: 1 = multiple track hits, 2 = single track hits...
std::vector< int > Nodes
The indices of the nodes contained by the current object.
TSFGShowerContainer * fShowers
The TSFGShower vector of results.
int fNFibers
The TSFGHit vector of hits for each fiber.
ClassDef(ND::TSFGReconModule::TSFGNode, 1)
std::string AlgorithmName
The name of the algorithm which produced this object.
The representation of the information store in each SFG TAlgorithmResult object.
int AddHit(const ND::THandle< ND::THit >, int &nDest, ND::TSFGReconModule::TSFGHitContainer *dest)
Add a hit to the destination container and return the index.
std::vector< int > Truth_HitCount
Nmber of hits contributed by each true trajectory See the TSFGVertex object for documentation.
std::vector< int > Showers
The indices of the showers contained by the current object.
ClassDef(ND::TSFGReconModule::TSFGHit, 1)
std::vector< int > Truth_PrimaryTrajIds
The RMS length of the shower, the extent parallel to the direction.
double EDeposit_fit
Fitted energy deposit for each node.
ClassDef(ND::TSFGReconModule::TSFGShower, 1)
int fNParticles
The TSFGParticle vector of results.
A base class for analysis output modules which contain reconstructed event information.
ClassDef(ND::TSFGReconModule::TSFGTrack, 1)
int TrueParticlePur
Purity of Geant4 particle associated to a TSFGTrack.