eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TFgdOnlyModule.hxx
Go to the documentation of this file.
1 ///
2 /// For questions or suggestions about this module please contact the
3 /// current responsible and CC in the eventAnalysis package manager.
4 ///
5 /// 16-Feb-2016: Current responsible for this module is,
6 /// Mark Scott (mscott [*a*t*] triumf.ca)
7 ///
8 #ifndef _TFgdOnlyModule_hxx_seen
9 #define _TFgdOnlyModule_hxx_seen
10 
11 #include <TClonesArray.h>
12 #include <TVector3.h>
13 #include <TG4Trajectory.hxx>
14 #include <TReconCluster.hxx>
15 #include <TReconPID.hxx>
16 #include <TReconTrack.hxx>
17 #include <map>
18 #include <string>
19 #include <vector>
21 #include "TFGDPid.hxx"
22 
23 namespace ND {
24 class TFgdOnlyModule;
25 }
26 
28  public:
29  class TFgd2DIsoTrack : public TObject {
30  public:
31  virtual ~TFgd2DIsoTrack();
32 
33  // info on isorecon tracks
34  std::string AlgorithmName;
35 
36  int NHits;
37 
38  double Angle; ///< Angle
39  double SumCharge; ///< Charge Sum
40  double Range; ///< Range
41 
42  TLorentzVector Origin; ///< Origin
43  TLorentzVector OriginVariance; ///< Variance on origin
44  TVector3 Direction; ///< Direection
45 
46  std::vector<TVector3*> HitPositions; ///< Hit positions
47 
48  int TrajId; ///< Trajectory id`
49  double Completeness; ///< Completeness
50  double Cleanliness; ///< Cleanlikness
51 
53  };
54 
55  class TFgd3DIsoTrack : public TObject {
56  public:
57  virtual ~TFgd3DIsoTrack();
58 
59  // info on isorecon tracks
60  std::string AlgorithmName; ///< Algorithm name
61 
62  int NHits; ///< Number of hits
63 
64  double SumCharge; ///< Sum of charge
65  double Range; ///< Range
66 
67  TLorentzVector Origin; ///< Origin
68  TLorentzVector OriginVariance; ///< Variance on origin
69  TVector3 Direction; ///< Direection
70 
71  double muonPull; ///< Muon pull
72  double pionPull; ///< Pion pull
73  double protonPull; ///< Proton pull
74 
75  std::vector<TVector3 *> XZHitPositions; ///< XZ Hit Positions
76 
77  std::vector<TVector3 *> YZHitPositions; ///< YZ Hit Positions
78 
79  int TrajId; ///< Trajectory id`
80  double Completeness; ///< Completeness
81  double Cleanliness; ///< Cleanlikness
82 
84  };
85 
86  public:
87  /// TFgd2DCluster
88  /// The main object that contains information on clusters of hits after the 2D
89  /// reconstruction
90  /// stage of the FGD shower-based reconstruciton.
91  class TFgd2DCluster : public TObject {
92  public:
93  virtual ~TFgd2DCluster();
94 
95  std::string AlgorithmName; ///< The name of the algorithm..
96 
97  TLorentzVector Position; ///< Charge-weighted position of the cluster.
98 
99  TVector3 PCADirection; ///< Primary PCA eigenvector, associated with the direction of the cluster.
100  TVector3 StartPosition; ///< Identified "start" position of the cluster, from extrapolating along PCADrection.
101  TVector3 EndPosition; ///< Identified "end" position of the cluster, from extrapolating along PCADirection.
102  double Range; ///< Range of shower along PCADirection
103 
104  double AvgHitTime; ///< Average time of hits in the cluster
105  double EDeposit; ///< The energy deposited in the cluster.
106  int NumHits; ///< The number of hits contributing to this cluster.
107 
108  std::map<int, int> Trajectories; ///< Map of true trajectory IDs to the number of G4 contributors that contributed to this cluster.
109 
110  int NDOF; ///< The number of degrees of freedom in the reconstruction.
111  double Quality; ///< The goodness of fit for the reconstruction.
112  int Status; ///< The fit status.
113 
115  };
116 
117  public:
118  /// TFgd3DShowerHyp
119  /// Information on a specific hypothesis of an FGD shower. There are two
120  /// hypotheses - one for a
121  /// forward-going particle, one for a backward-going particle.
122  class TFgd3DShowerHyp : public TObject {
123  public:
124  virtual ~TFgd3DShowerHyp();
125 
126  TLorentzVector Position; ///< Identified start position of the shower.
127  TLorentzVector
128  PositionVar; ///< Variance on the start position of the shower.
129 
130  TVector3
131  Direction; ///< Identified direction of the shower, found using PCA.
132  TVector3 DirectionVar; ///< Variance on the direction of the shower.
133 
134  TVector3 ConeAngle; ///< Opening angle of the cone describing this shower.
135  TVector3 ConeAngleVar; ///< Variance on the cone opening angle.
136 
137  double EDeposit; ///< Energy deposited in this shower.
138  /// Hits are split into three groups based on their distance from the start
139  /// of the shower.
140  /// The X, Y and Z components of this variable contain the average charge of
141  /// hits in the
142  /// 1st, 2nd and 3rd groups, respectively.
143  TVector3 QAvgInThirds; // Charge of hits in 1st, 2nd and 3rd groups, based
144  // on distance from the start of the shower.
145 
146  /// Hits are split into three groups based on their distance from the start
147  /// of the shower.
148  /// The X, Y and Z components of this variable contain the average
149  /// transverse spread of hits
150  /// in the 1st, 2nd and 3rd groups, respectively. Transverse spread is
151  /// defined as the distance
152  /// from a hit to the closest position on the PCA major axis.
153  TVector3 SpreadInThirds; // Average transverse spread of hits in the 1st,
154  // 2nd and 3rd groups, defined as the distance
155  // from a hit to the closest position on the PCA
156  // major axis.
157 
159  };
160 
161  public:
162  /// TFgd3DShowerPID
163  /// Information on an object reconstructed using the FGD shower-based
164  /// reconstruction.
165  /// There is currently no particle identification, although variables that can
166  /// be used
167  /// for a PID are stored. There are two hypotheses saved for each
168  /// reconstructed object -
169  /// one for a forward-going particle, one for a backward-going particle.
170  class TFgd3DShowerPID : public TObject {
171  public:
172  virtual ~TFgd3DShowerPID();
173 
175  Hyp1; ///< Information assuming the particle is forward-going.
177  Hyp2; ///< Information assuming the particle is backward-going.
178 
179  TVector3 PCAEigenValues; ///< The three PCA eigenvalues.
180  int NumHits; ///< The number of hits contributing to this cluster.
181 
182  /// The MVA likelihood value returned when matching 2D clusters in the XZ
183  /// and YZ
184  /// views into a single 3D cluster. Values range from 0 -> 1, with higher
185  /// values
186  /// indicating better matches.
187  double MatchingLikelihood3D; // MVA likelihood value when matching 2D
188  // clusters in the XZ and YZ views into a
189  // single 3D cluster.
190 
191  /// Dan Scully's Circularity variable, adapted for FGDs. Value goes from 0
192  /// (spherical)
193  /// -> 1 (track).
194  double Circularity; // Dan Scully's Circularity variable, adapted for FGDs.
195 
196  std::map<int, int> Trajectories; ///< Map of true trajectory IDs to the number of G4 contributors that contributed to this cluster
197 
198  int NDOF; ///< The number of degrees of freedom in the reconstruction.
199  double Quality; ///< The goodness of fit for the reconstruction.
200  int Status; ///< The fit status.
201 
203  };
204 
205  public:
206  TFgdOnlyModule(const char* name = "FGDOnly",
207  const char* title = "FGD Only Recon Module");
208 
209  virtual ~TFgdOnlyModule();
210 
211  virtual Bool_t ProcessFirstEvent(ND::TND280Event& event);
212 
213  protected:
214  // virtual void InitializeModule();
215 
216  virtual void InitializeBranches();
217 
218  virtual bool FillTree(ND::TND280Event&);
219 
220  private:
221  void Fill2DIsoTrack(ND::THandle<ND::TReconTrack> tr,
222  ND::THandle<ND::TTrackState> state,
223  TFgd2DIsoTrack* isoTrack, char Axis);
224  void Fill3DIsoTrack(ND::THandle<ND::TReconTrack> tr,
225  ND::THandle<ND::TTrackState> state,
226  TFgd3DIsoTrack* isoTrack);
227  void Fill2DCluster(TFgd2DCluster* TempObject,
228  ND::THandle<ND::TReconCluster> cluster);
229  void Fill3DShower(TFgd3DShowerPID* TempObject,
230  ND::THandle<ND::TReconPID> pid);
231  TFgd3DShowerHyp Fill3DShowerHyp(ND::THandle<ND::TReconPID> hyp);
232 
233  public:
234  /// These tracks use only hits unused by the TPC+FGD fits
235  Int_t* fNXZTracks;
236  TClonesArray** fXZTracks;
237 
238  /// These tracks use only hits unused by the TPC+FGD fits
239  Int_t* fNYZTracks;
240  TClonesArray** fYZTracks;
241 
242  /// These tracks use only hits unused by the TPC+FGD fits
243  Int_t* fNXYZTracks;
244  TClonesArray** fXYZTracks;
245 
246  /// All and only FGD hits used for these tracks
248  TClonesArray** fXZTracksAllFGD;
249 
250  /// All and only FGD hits used for these tracks
252  TClonesArray** fYZTracksAllFGD;
253 
254  /// All and only FGD hits used for these tracks
256  TClonesArray** fXYZTracksAllFGD;
257 
258  /// Number of Showers
259  Int_t fN3DShowers;
260  /// Showers
261  TClonesArray* f3DShowers;
262 
263  /// Number of 2D constituents of showers
265  /// 2D constituents of showers
266  TClonesArray* f2DClustersXZ;
267 
268  /// Number of 2D constituents of showers
270  /// 2D constituents of showers
271  TClonesArray* f2DClustersYZ;
272 
273  private:
274  std::vector<const char*> fTrackAlgorithms;
275  std::vector<const char*> fPids;
276  TFGDPid* fFGDPid;
277 
278 };
279 
280 #endif
Int_t fN2DClustersYZ
Number of 2D constituents of showers.
int NumHits
The number of hits contributing to this cluster.
TClonesArray ** fXZTracksAllFGD
TLorentzVector OriginVariance
Variance on origin.
int NumHits
The number of hits contributing to this cluster.
TVector3 Direction
Identified direction of the shower, found using PCA.
TClonesArray ** fYZTracks
std::string AlgorithmName
Algorithm name.
TFgd3DShowerHyp Information on a specific hypothesis of an FGD shower.
std::string AlgorithmName
The name of the algorithm..
TVector3 ConeAngle
Opening angle of the cone describing this shower.
TLorentzVector Position
Identified start position of the shower.
TClonesArray ** fXYZTracksAllFGD
std::vector< const char * > fTrackAlgorithms
double EDeposit
Energy deposited in this shower.
ClassDef(TFgdOnlyModule::TFgd2DIsoTrack, 2)
std::map< int, int > Trajectories
Map of true trajectory IDs to the number of G4 contributors that contributed to this cluster...
TFgdOnlyModule(const char *name="FGDOnly", const char *title="FGD Only Recon Module")
TVector3 DirectionVar
Variance on the direction of the shower.
TClonesArray * f2DClustersYZ
2D constituents of showers
TClonesArray * f2DClustersXZ
2D constituents of showers
std::vector< const char * > fPids
double MatchingLikelihood3D
The MVA likelihood value returned when matching 2D clusters in the XZ and YZ views into a single 3D c...
TLorentzVector Position
Charge-weighted position of the cluster.
std::vector< TVector3 * > HitPositions
Hit positions.
TClonesArray * f3DShowers
Showers.
TLorentzVector PositionVar
Variance on the start position of the shower.
Int_t fN2DClustersXZ
Number of 2D constituents of showers.
Int_t fN3DShowers
Number of Showers.
TFgd3DShowerHyp Fill3DShowerHyp(ND::THandle< ND::TReconPID > hyp)
TVector3 QAvgInThirds
Hits are split into three groups based on their distance from the start of the shower.
ClassDef(TFgdOnlyModule::TFgd3DShowerPID, 1)
ClassDef(TFgdOnlyModule::TFgd3DIsoTrack, 2)
void Fill2DIsoTrack(ND::THandle< ND::TReconTrack > tr, ND::THandle< ND::TTrackState > state, TFgd2DIsoTrack *isoTrack, char Axis)
Int_t * fNXZTracksAllFGD
All and only FGD hits used for these tracks.
TClonesArray ** fXZTracks
int NDOF
The number of degrees of freedom in the reconstruction.
std::vector< TVector3 * > YZHitPositions
YZ Hit Positions.
double Circularity
Dan Scully&#39;s Circularity variable, adapted for FGDs.
TClonesArray ** fXYZTracks
void Fill3DShower(TFgd3DShowerPID *TempObject, ND::THandle< ND::TReconPID > pid)
double EDeposit
The energy deposited in the cluster.
int NDOF
The number of degrees of freedom in the reconstruction.
Int_t * fNXZTracks
These tracks use only hits unused by the TPC+FGD fits.
TVector3 SpreadInThirds
Hits are split into three groups based on their distance from the start of the shower.
double Range
Range of shower along PCADirection.
TFgd2DCluster The main object that contains information on clusters of hits after the 2D reconstructi...
TFgd3DShowerPID Information on an object reconstructed using the FGD shower-based reconstruction...
TLorentzVector OriginVariance
Variance on origin.
TFgd3DShowerHyp Hyp1
Information assuming the particle is forward-going.
ClassDef(TFgdOnlyModule::TFgd3DShowerHyp, 1)
ClassDef(TFgdOnlyModule::TFgd2DCluster, 1)
double Quality
The goodness of fit for the reconstruction.
TVector3 StartPosition
Identified &quot;start&quot; position of the cluster, from extrapolating along PCADrection. ...
void Fill2DCluster(TFgd2DCluster *TempObject, ND::THandle< ND::TReconCluster > cluster)
TClonesArray ** fYZTracksAllFGD
virtual Bool_t ProcessFirstEvent(ND::TND280Event &event)
Is called after the first event is loaded in.
TVector3 EndPosition
Identified &quot;end&quot; position of the cluster, from extrapolating along PCADirection.
Int_t * fNYZTracks
These tracks use only hits unused by the TPC+FGD fits.
double Quality
The goodness of fit for the reconstruction.
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
void Fill3DIsoTrack(ND::THandle< ND::TReconTrack > tr, ND::THandle< ND::TTrackState > state, TFgd3DIsoTrack *isoTrack)
TVector3 PCADirection
Primary PCA eigenvector, associated with the direction of the cluster.
std::map< int, int > Trajectories
Map of true trajectory IDs to the number of G4 contributors that contributed to this cluster...
Int_t * fNXYZTracks
These tracks use only hits unused by the TPC+FGD fits.
std::vector< TVector3 * > XZHitPositions
XZ Hit Positions.
virtual void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
TVector3 PCAEigenValues
The three PCA eigenvalues.
TFgd3DShowerHyp Hyp2
Information assuming the particle is backward-going.
Int_t * fNYZTracksAllFGD
All and only FGD hits used for these tracks.
A base class for analysis output modules which contain reconstructed event information.
double AvgHitTime
Average time of hits in the cluster.
TVector3 ConeAngleVar
Variance on the cone opening angle.
Int_t * fNXYZTracksAllFGD
All and only FGD hits used for these tracks.

Package Summary
Package Name: eventAnalysis
Package Version: 7.0-49-g0ac7482
Package Manager:

Generated on Mon Mar 25 2024 14:43:58 for eventAnalysis by doxygen 1.8.5