7 #ifndef TTrackerECALReconModule_hxx_seen
8 #define TTrackerECALReconModule_hxx_seen
15 #include "TClonesArray.h"
20 #include "TG4Trajectory.hxx"
21 #include "TIntegerDatum.hxx"
22 #include "TND280Event.hxx"
23 #include "TReconCluster.hxx"
24 #include "TReconHit.hxx"
25 #include "TReconPID.hxx"
26 #include "TReconShower.hxx"
27 #include "TReconTrack.hxx"
28 #include "TReconVertex.hxx"
29 #include "vertexReconstruction/TECALVertexing.hxx"
34 namespace TTrackerECALReconModule {
38 #ifdef TTRACKERECALRECONMODULE_USE_EXP
41 class TECALReconVertexCandidate;
42 class TECALReconTrack;
43 class TECALReconShower;
44 class TECALReconCluster;
45 class TECALReconObject;
46 class TECALReconUnmatchedObject;
47 class TECALReconVertexCluster;
48 class TECALReconVertexTrack;
49 class TECALReconVertexCrossing;
51 #ifdef TTRACKERECALRECONMODULE_USE_EXP
58 class TECALReconHit :
public TObject {
59 const static int MaxAssocs = 20;
65 void AddAssocUID(
unsigned int tuid);
75 TLorentzVector Position;
77 TVector3 PosUncertainty;
84 ClassDef(ND::TTrackerECALReconModule::TECALReconHit, 1);
133 const ND::TECALReconVertex &, ND::THandle<ND::TReconVertex>,
bool,
137 ND::THandle<ND::TReconVertex>, UInt_t,
bool,
void *pos = NULL);
411 ND::THandle<ND::TReconPID>,
bool,
413 bool Allocate =
true);
421 ND::THandle<ND::TReconPID>,
bool,
423 bool Allocate =
true);
483 ND::THandle<ND::TReconCluster>,
bool,
void *pos = NULL);
614 #ifdef USE_FULL_VERTEX_TRACK_INFO
615 Float_t CompletenessSingle;
617 Float_t CleanlinessSingle;
619 TVector3 Single_FrontPosition;
621 TVector3 Single_FrontDirection;
623 double Single_FrontG4PointDist;
625 TVector3 Single_BackPosition;
627 TVector3 Single_BackDirection;
630 double Single_BackG4PointDist;
634 Float_t CompletenessPrimary;
636 Float_t CleanlinessPrimary;
640 Float_t CompletenessRecursive;
642 Float_t CleanlinessRecursive;
644 Int_t SubTrack_UniqueID[2];
646 Int_t SubTrack_NHits[2];
648 Int_t SubTrack_Angle[2];
650 Int_t SubTrack_FrontLayerNumber[2];
652 Int_t SubTrack_BackLayerNumber[2];
654 Int_t SubTrack_DOCA[2];
656 Float_t SubTrack_TotalCharge[2];
658 Int_t SubTrack_G4IDSingle[2];
660 Float_t SubTrack_CompletenessSingle[2];
662 Float_t SubTrack_CleanlinessSingle[2];
664 Int_t SubTrack_G4IDPrimary[2];
667 Float_t SubTrack_CompletenessPrimary[2];
669 Float_t SubTrack_CleanlinessPrimary[2];
672 Int_t SubTrack_G4IDRecursive[2];
674 Float_t SubTrack_CompletenessRecursive[2];
676 Float_t SubTrack_CleanlinessRecursive[2];
714 ND::THandle<ND::TReconPID>,
bool,
void *pos = NULL,
715 ND::THandle<ND::TG4TrajectoryContainer> trajectories =
716 ND::THandle<ND::TG4TrajectoryContainer>(NULL),
717 bool Allocate =
true);
768 const char *title =
"Tracker ECal Recon Module");
781 std::cout << indent <<
"=SaveVertexCandy: Will Save reconstructed "
783 << indent <<
" candidate info" << std::endl;
785 <<
"=SaveTheHoff: Will save the bare Hough transform results."
787 std::cout << indent <<
"=RunVertexing: will run\n"
788 <<indent <<
" vertexing if the container\n"
789 << indent <<
" is not found" << std::endl;
790 #ifdef TTRACKERECALRECONMODULE_USE_EXP
791 std::cout << indent <<
"=SaveHitInfo: Will save hit info\n" << std::endl;
793 std::cout << indent <<
"**Experimental functionality enabled**"
802 virtual bool FillTree(ND::TND280Event &);
805 ND::THandle<ND::TAlgorithmResult> ecalFinalResult,
806 ND::THandle<ND::TG4TrajectoryContainer> trajectories);
810 ND::THandle<ND::TAlgorithmResult> ecalFinalResult,
811 ND::THandle<ND::TG4TrajectoryContainer> trajectories);
817 ND::THandle<ND::TAlgorithmResult> ecalFinalResult,
818 ND::THandle<ND::TG4TrajectoryContainer> trajectories);
827 #ifdef TTRACKERECALRECONMODULE_USE_EXP
832 void SaveUsedHit(ND::THandle<ND::THit> hit,
unsigned int UID,
833 bool overwritePrevious =
false);
840 inline unsigned long TECALHitHasher(ND::THandle<ND::THit> hit) {
841 return (hit->GetGeomId().AsInt() * 1000 +
842 (int(hit->GetTime()) / 100) % 1000);
851 std::map<unsigned long, unsigned int> fSavedHitMap;
876 #ifdef TTRACKERECALRECONMODULE_USE_EXP
890 #ifdef TTRACKERECALRECONMODULE_USE_EXP
891 TClonesArray *fUsedHits;
double PID_FrontBackRatio
The ratio of the charge in equal length blocks at each end of the track.
Int_t NCrossings
Number of track crossings.
Int_t MinPerpBarHit
The minimum bar number hit perpendicular to the beam axis.
void FillHitInfo(TECALReconObject *obj, ND::THandle< ND::THitSelection > hitsel)
Method to fill hit info is seperate to help keep things tidy.
double EMEnergyFit_Likelihood_energyGrad
Energy fit experts please fill this in.
double EMEnergyFit_Para_QSum
The summed charge present in the cluster in units of MIPs.
Int_t G4IDPrimary
The G4ID of the primary contributor to the cluster.
double EMEnergyFit_Likelihood_qsum_like
Energy fit experts please fill this in.
void FillHoughTransformInformation(ND::THandle< ND::TAlgorithmResult > ecalFinalResult, ND::THandle< ND::TG4TrajectoryContainer > trajectories)
Handles saving of the results of the ecalRecon Hough transform.
Float_t CleanlinessRecursive
The cleanliness (hit purity) of the recursive contributor to the cluster.
double PID_Circularity
Pid Variables, For more info on the Pid variable see the documentation in ecalRecon or the technical ...
Int_t G4ID_Single
The single true particle that contributed most hits to this object. Should be the same as G4ID in mos...
void FillVertexingInformation(ND::THandle< ND::TAlgorithmResult > ecalFinalResult, ND::THandle< ND::TG4TrajectoryContainer > trajectories)
TClonesArray * fUnmatchedObjects
The Unmatched Objects.
int NLayersTwoHits
The number of layers which have at least 2 hits.
Int_t G4IDRecursive
The G4ID of the recursive contributor to the cluster.
virtual ~TECALReconTrack()
Double_t Completeness_Primary
Truth-matching completeness for G4ID_Primary.
The main object that contains ECAL shower information.
double PID_ShowerAngle
The angle from the start of an object to its width at its charge centre.
int FirstLayerManyHits
The number of the first layer in which there are at least 2 hits.
Int_t NTracks
The number of tracks that contributed to the fitted position.
TLorentzVector Position
The shower position.
double EMEnergyFit_Uncertainty
The uncertainty of the EM energy fit to the cluster.
Int_t MinLayerHit
The minimum layer number hit.
virtual ~TECALReconUnmatchedObject()
TECalVertexing * fVertexRecon
Helper object which performs vertex candidate reconstruction.
double PID_LLR_MIP_EM_LowMomentum
A combined discriminator for separating MIPs from EM showers. This is similar to LLR_MIP_EM but train...
UInt_t VertexClusterUID
The UID of the associated TECALReconVertexCluster.
virtual ~TECALReconVertexCrossing()
TVector3 FrontPosition
Position of the end of the cluster closest to the tracker.
ClassDef(ND::TTrackerECALReconModule::TECALReconVertexCluster, 1)
virtual Bool_t ProcessFirstEvent(ND::TND280Event &event)
Is called after the first event is loaded in.
Double_t Completeness_Recursive
Truth-matching completeness for G4ID_Recursive.
Double_t Cleanliness_Single
Truth-matching cleanliness for G4ID_Single.
double MatchingLikelihood
The matching likelihood.
virtual void InitializeBranches()
Initialize Branches. Don't do anything else in this function.
Int_t G4ID_Primary
G4ID of the primary particle associated with this object. See TShowerTruthInfo in oaUtility for detai...
Double_t TotalHitCharge
Sum of charges of the consitituent hits in reconstructed object.
void ProcessOtherContainer(ND::THandle< ND::TReconObjectContainer > other)
Processes any results in the ecalRecon other container.
TVector3 CalculatePointing(ND::THandle< ND::THitSelection > hits)
Calculates the pointing vector.
Int_t G4ID
Truth-matched particle ID.
TLorentzVector BackPosition
The position of the end of the track.
Int_t NHits
Number of hits directly associated with the crossing.
bool fDoSaveVertexCandidates
Whether to calcluate and save the reconstructed vertx candidaties. [false].
Double_t ObjectLength
Recon object length in mm.
double EMEnergyFit_Result
The result from the EM energy fit to the cluster.
Float_t CleanlinessPrimary
The cleanliness (hit purity) of the primary contributor to the cluster.
void ProcessFinalContainer(ND::THandle< ND::TReconObjectContainer > final)
Processes any results in the ecalRecon final container.
Responsible for setting up output tree, looping over oaEvent containers, and filling output objects...
double TotalHitCharge
Summed hit charge in the cluster in units of MIPs.
std::string Module
Name of ECal module the cluster is reconstructed in.
Float_t CompletenessRecursive
The Completeness of the Recursive contributor to the cluster.
Int_t Clustering_3DSeedType
The 3D seed type from the 3D clustering algorithm (-1 means was not created by 3D clustering...
double PID_TruncatedMaxRatio
A truncated Max Ratio. See ecalRecon docs for the full definition.
TClonesArray * fReconObjects
The TECALRecon Objects.
OutputManager(const char *name="TrackerECal", const char *title="Tracker ECal Recon Module")
Int_t MaxLayerHit
The maximum layer number hit.
The main object that contains ECAL recon information.
Int_t MostDownStreamLayerHit
The layer furthest from the tracker that was hit by the object. This is layer number 30 (the 31st lay...
Int_t G4ID_Single
The single true particle that contributed most hits to this object. Should be the same as G4ID in mos...
void SayAvailableOpts(std::string indent="")
Subclasses should override this to let a user know what options are available.
TVector3 Direction
The shower direction.
TECALReconTrack Track
Objects to store information for a track.
Int_t fNReconObjects
Tree Entries.
Int_t N2DTracksMin
The minimum number of 2D tracks found in a view.
double EMEnergyFit_Likelihood_energy_qsumGrad
Energy fit experts please fill this in.
TLorentzVector PositionVar
The shower position variance.
Double_t AverageHitTime
Average time of hits in reconstructed object.
Int_t NTracks
Number of reconstructed tracks.
int MaxHitChargeLayer
The layer which received the highest hit charge.
Int_t NHits
The number of hits that were included in fitted tracks or were closer to this vertex candidate than a...
TLorentzVector Position
The reconstruction position of the crossing.
Object containing information about 2D unmatched clusters from the ECALs.
double AverageHitTime
Average time of the cluster in ns.
Int_t G4IDSingle
The G4ID of the single biggest contributor to the cluster.
bool fDoVertexing
Whether to re-run the vertexing (N.B.
TECALReconShower Shower
Objects to store information for a shower.
void FillDatumInfo(TECALReconObject *obj, ND::THandle< ND::TReconBase > trb)
Method to add information in RealDatums stored in the tracks or showers.
Int_t G4ID_Recursive
G4ID of the highest-level parent particle that enters the ECal module, and which had a daughter that ...
TClonesArray * Tracks
The constituent tracks TClonesArray.
double AverageZPosition
Unweighted average Z position of object-constituent hits.
double PID_LLR_Quality
A quality flag for the likelihood PID variables. Good quality = 0, Bad quality != 0...
int MostDownStreamLayerHit
The layer furthest from the tracker that was hit by the cluster.
TVector3 Direction
The track direction.
UInt_t UniqueID
Unique ID of the crossing.
UInt_t UniqueID
UniqueID of the cluster.
TLorentzVector Position
The fitted position of the vertex candidate.
virtual ~TECALReconCluster()
Double_t Cleanliness_Recursive
Truth-matching cleanliness for G4ID_Recursive.
virtual ~TECALReconShower()
Int_t G4IDRecursive
The G4ID of the Recursive contributor to the cluster.
virtual ~TECALReconVertexCandidate()
Int_t MinBarHit
The minimum bar number hit in a cluster The minimum value of this is 0 for all ECals.
virtual ~TECALReconVertexCluster()
ClassDef(ND::TTrackerECALReconModule::TECALReconObject, 1)
double PID_LLR_EM_HIP
A combined discriminator for separating protons from electrons.
double EMEnergyFit_Para_QRMS
The RMS of the hit charges for the cluster in units of MIPs.
Int_t G4ID_Recursive4
G4ID of the highest-level parent particle that enters the ECal module, and which had a daughter that ...
Int_t G4ID_Recursive2
G4ID of the highest-level parent particle that enters the ECal module, and which had a daughter that ...
Int_t NLayersHit
Number of layers hit by this object.
UInt_t UniqueID
Unique ID number to allow matching to Global Recon object.
TECALReconUnmatchedObject * TECALReconUnmatchedObjectFactory(ND::THandle< ND::TReconCluster > cluster, bool IsMC, void *pos)
Method that fills the data members from the unmatched cluster hits.
double PID_Angle
The zenith angle with respect to each detector.
TLorentzVector BackPosition
The charge weighted position of the end of the shower.
Float_t CleanlinessSingle
The cleanliness (hit purity) of the single biggest contributor to the cluster.
Float_t TotalCharge
The total charge of the cluster.
TECALReconUnmatchedObject()
ClassDef(ND::TTrackerECALReconModule::TECALReconTrack, 1)
ClassDef(ND::TTrackerECALReconModule::TECALReconUnmatchedObject, 1)
Float_t DOCA
The distance of closest approach of the two lines.
Float_t CleanlinessPrimary
The cleanliness (hit purity) of the primary contributor to the cluster.
TVector3 ConeAngle
The shower opening angle.
double EMEnergyFit_Para_QSkew
The skew of hit charges for the cluster in units of MIPs.
Bool_t Configure(std::string &option)
Provides CLI for enabling fDoSaveHitInfo and fDoSaveVertexCandidates.
TLorentzVector PositionVar
The track starting 4-position variance.
Int_t NHits
Number of hits in this object.
TLorentzVector Position
The cluster position.
Int_t N2DTracksMax
The maximum number of 2D tracks found in a view.
virtual void InitializeModule()
Initialize Module, override if necessary.
double EDeposit
The charge deposited by the cluster.
The main object that contains ECAL cluster information.
ClassDef(ND::TTrackerECALReconModule::TECALReconCluster, 1)
double PID_LLR_MIP_Pion
Discriminator for tagging showering pions in a sample of MIP-like tracks.
double PID_TransverseChargeRatio
A variable sensitive to the charge distribution in the plane transverse to a shower/track direction...
virtual bool IsFullEventWorthSaving(ND::TND280Event &event)
Returns true if there is at least one Recon object in the Tracker ECals.
bool FilledAsTrack
Was filled by a Track-like TReconPID.
double EDeposit
The energy deposited in the shower.
TVector3 Pointing
Pointing vector.
TECALReconObject * TECALReconObjectFactory(ND::THandle< ND::TReconTrack > track, ND::THandle< ND::TReconPID > pid, bool IsMC, void *pos, bool Allocate)
Handles Filling from a PID's track hypothesis constituent.
Int_t NIsZHits
Number of hits with precise Z information in the object.
int NHits
Number of hits in the cluster.
TECALReconVertexCandidate()
double PID_LLR_MIP_EM
A combined discriminator for separating MIPs from EM showers.
virtual ~TECALReconObject()
void FillECalIsoVertexingInformation(ND::THandle< ND::TAlgorithmResult > ecalFinalResult, ND::THandle< ND::TG4TrajectoryContainer > trajectories)
Just saves the final ECal-iso vertexing results.
Float_t CompletenessPrimary
The Completeness of the primary contributor to the cluster.
TECALReconCluster Cluster
Objects to store information for a cluster.
Float_t CompletenessRecursive
The Completeness of the recursive contributor to the cluster.
TClonesArray * fReconVertexClusters
The Reconstructed Vertices.
TVector3 BackPosition
Position in end of the cluster furthest from the tracker.
TLorentzVector Position
The track starting 4-position.
Reconstructed ECal vertex candidate, contains fitted position and associated track UIDs...
Int_t fNReconVertexClusters
TClonesArray * Crossings
The constituent crossings TClonesArray.
Int_t G4ID_Primary
G4ID of the primary particle associated with this object.
The main object that contains ECAL track information.
Int_t fNVertexCandidateTracks
int MostUpStreamLayerHit
The layer closest to the tracker that was hit by the cluster.
TClonesArray * fVertexCandidates
The reconstructed vertex candidates.
std::string ECalModule
The ECalModule that this vertex was reconstructed in.
Float_t CompletenessSingle
The Completeness of the single biggest contributor to the cluster.
TClonesArray * fVertexCandidateTracks
The tracks associated with the reconstructed vertex candidates.
TLorentzVector Position
Position of cluster.
Int_t G4ID
G4ID for truth matched objects, using TrackTruthInfo the original truth-matching algorithm).
Int_t NHits
Number of hits in cluster.
Int_t G4ID_Recursive
G4ID of the highest-level parent particle that enters the ECal module, and which had a daughter that ...
bool FilledAsShower
Was filled by a Shower-like TReconPID.
int NDOF
The number of degrees of freedom in the reconstruction.
double Containment
Containment: contained = 1.0, not-contained = 0.0, default = -1.0. An object is classed as contained ...
Int_t MaxParaBarHit
The maximum bar number hit in a cluster, for layers parallel to the beam axis.
Float_t CompletenessSingle
The Completeness of the single biggest contributor to the cluster.
TECALReconVertexCrossing()
TECALReconVertexCandidate * TECALVertexCandidateFactory(const TECALReconVertex &rv, ND::THandle< ND::TReconVertex > top_vertex, bool IsMC, void *pos)
ClassDef(ND::TTrackerECALReconModule::TECALReconVertexCrossing, 1)
Int_t MaxParaBarHit
The maximum bar number hit parallel to the beam axis.
ClassDef(ND::TTrackerECALReconModule::TECALReconVertexCandidate, 1)
Int_t MaxPerpBarHit
\ The maximum bar number hit in a cluster, for layers perpendicular to the beam axis ...
Int_t G4IDPrimary
The G4ID of the primary contributor to the cluster.
Int_t G4ID_Recursive3
G4ID of the highest-level parent particle that enters the ECal module, and which had a daughter that ...
Int_t MinParaBarHit
The minimum bar number hit parallel to the beam axis.
double EDeposit
The charge deposited by the track in units of MIPs.
TECALReconVertexCluster()
double EMEnergyFit_Para_QMax
The maximum hit charge in units of MIPs.
Double_t Cleanliness_Primary
Truth-matching cleanliness for G4ID_Primary.
void PerEvReset()
Handles clearing and resetting of event level variables/arrays.
TLorentzVector PositionVar
The cluster position variance.
ClassDef(ND::TTrackerECALReconModule::TECALReconShower, 1)
Int_t G4IDSingle
The G4ID of the single biggest contributor to the cluster.
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
bool fDoSaveHoughResults
Whether to output the bare Hough transform results.
Float_t CleanlinessSingle
The cleanliness (hit purity) of the single biggest contributor to the cluster.
Float_t CleanlinessRecursive
The cleanliness (hit purity) of the Recursive contributor to the cluster.
std::string Module
Name of ECAL module in which object was reconstructed.
int View
View of the cluster. View 0 - Y measuring (odd) Layers and View 1 - X measuring (even) layers...
Int_t NTracks
The number of tracks which created this crossing.
int NLayersThreeHits
The number of layers which have at least 3 hits.
int NHitsAtLayersWithManyHits
The number of hits in a layer when there are at least 2 hits.
int MaxHitsInALayer
The layer which received the maximum number of hits.
Int_t MostUpStreamLayerHit
The layer closest to the tracker that was hit by the object. 0 indexed.
Int_t NIsXHits
Number of hits with precise X information in the object.
std::map< UInt_t, Int_t > fSavedVertexTrackIds
Which tracks have already been saved.
Int_t NIsYHits
Number of hits with precise Y information in the object.
Double_t Completeness_Single
Truth-matching completeness for G4ID_Single.
TECALReconVertexTrack * TECALReconVertexTrackFactory(ND::THandle< ND::TReconPID > trk, bool IsMC, void *pos, ND::THandle< ND::TG4TrajectoryContainer > trajectories, bool Allocate)
TLorentzVector FindBackPosition(ND::THandle< ND::THitSelection > hits, int MostDownStreamLayerHit)
Method to calculate the position in the last layer reached by the particle.
double PID_Asymmetry
Ratio of the big width of an object by its small width.
int LastLayerManyHits
The last layer in which there are at least 2 hits.
double EMEnergyFit_Para_QMean
The mean charge of hits in the cluster in units of MIPs.
Float_t CompletenessPrimary
The Completeness of the primary contributor to the cluster.
A base class for analysis output modules which contain reconstructed event information.
double CalculateFrontBackRatio(ND::THandle< ND::THitSelection > hits)
Method to calculate the FrontBackRatio variable.
Int_t MaxPerpBarHit
The maximum bar number hit perpendicular to the beam axis.