eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TTRExReconModule.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 /// 11-07-2014: Current collaborator responsible for this module is
6 /// Pip Hamilton (p.hamilton11@imperial.ac.uk)
7 ///
8 #ifndef TTRExReconModule_hxx_seen
9 #define TTRExReconModule_hxx_seen
10 
11 #include <iostream>
12 #include <sstream>
13 #include <string>
14 
15 #include "TClonesArray.h"
16 #include "TNamed.h"
17 #include "TTree.h"
18 
19 #include "TGeometryDatabase.hxx"
20 #include "TIntegerDatum.hxx"
21 #include "TND280Event.hxx"
22 #include "TP0DVetoForTPC.hxx"
23 #include "TReconCluster.hxx"
24 #include "TReconHit.hxx"
25 #include "TReconPID.hxx"
26 #include "TReconShower.hxx"
27 #include "TReconTrack.hxx"
28 #include "TrackTruthInfo.hxx"
29 
30 // Headers from TREx modules
31 // Some of these probably aren't necessary!
32 #include "TDatum.hxx"
33 #include "TGeomInfo.hxx"
34 #include "TIntegerDatum.hxx"
35 
36 #include "TIntegerDatum.hxx"
37 #include "TOARuntimeParams.hxx"
38 #include "TRealDatum.hxx"
39 #include "TrackingUtils.hxx"
40 
41 #include "TIntegerDatum.hxx"
42 #include "TMultiHit.hxx"
43 #include "TRealDatum.hxx"
44 #include "TrackingUtils.hxx"
45 
47 
48 namespace ND {
49 class TTRExReconModule;
50 };
51 
52 /** TTRExReconModule - Object that contains information related to reconstructed
53 object from the extended TPC reconstruction package, TREx.
54 
55 This eventAnalysis module provides information gleaned from the output of the TREx
56 reconstruction package.
57 
58 The main objects provided are:
59 
60 - TPC patterns - connected networks of tracks ("Paths") and vertices
61 ("Junctions")
62 - TPC junctions - points at which paths meet
63 - TPC paths - collections of hits resembling a particle track.
64 
65 Users are encouraged to add information to this module.
66 
67 Originally documented by Pip Hamilton.
68 
69 */
70 
72  //========================================================================
73 
74  public:
75  /// TTPCAnaPattern
76  /// The master object for any connected system of hits in a TPC.
77  class TTPCAnaPattern : public TObject {
78  public:
79  virtual ~TTPCAnaPattern();
81  Junctions = new TClonesArray("ND::TTRExReconModule::TTPCAnaJunction", 40);
82  Paths = new TClonesArray("ND::TTRExReconModule::TTPCAnaPath", 40);
83  };
84 
85  Bool_t S1Sflag; ///< A flag to say whether this pattern would pass the TPC gas Stage 1 Selection
86  Int_t PatternID; ///< The ID of the pattern
87 
88  Int_t NJunctions; ///< The number of junctions in the pattern.
89  TClonesArray *Junctions; ///< The constituent junctions of the pattern
90 
91  Int_t NPaths; ///< The number of paths.
92  TClonesArray *Paths; ///< The constituent paths of the pattern.
93 
94  Int_t TPC; ///< The TPC in which the pattern resides.
95 
97  };
98 
99  //======================================================================
100 
101  public:
102  /// TTPCAnaJunction
103  /// An object describing a meeting point of two or more paths, and containing
104  /// all associated paths.
105  class TTPCAnaJunction : public TObject {
106  public:
107  virtual ~TTPCAnaJunction();
109 
110  Int_t JunctionID; ///< A unique identifier for the junction within the pattern.
111 
112  Int_t JunctionMatchingID; //< A unique identifier for the junction within the event.
113 
114  TLorentzVector Position; ///< The spatial coordinates of the junction
115 
116  Int_t NPaths; ///< The number of paths connected to the junction.
117  Int_t *PathIDs; //[NPaths]
118  ///^ The unique identifiers of the associated paths.
119 
120  TVector3 MaximumCoordinates; ///< The most extreme hit positions in the positive direction
121  TVector3 MinimumCoordinates; ///< The most extreme hit positions in the negative direction
122 
124  };
125 
126  //=====================================================================
127 
128  public:
129  /// TTPCAnaPath
130  /// An object describing a track-like grouping of hits in the TPC.
131  class TTPCAnaPath : public TObject {
132  public:
133  virtual ~TTPCAnaPath();
135 
136  Int_t PathID; ///< A unique identifier for the path within the pattern.
137  Int_t G4ID; ///< G4 ID of the primary true trajectory associated with this path.
138  Int_t
139  PathMatchingID; //< A unique identifier for the path within the event.
140 
141  TVector3 FirstPosition; ///< The start position of the path.
142  TVector3 LastPosition; ///< The end position of the path.
143  Double_t Time; ///< The T0 for the path.
144  Double_t Length; ///< The length of the path.
145  Double_t Momentum; ///< The momentum of the path.
146  Double_t MomentumError; ///< The momentum error of the path.
147  TVector3 Direction; ///< The direction of the path.
148  Bool_t IsContained; ///< True if the path does not leave the TPC; false otherwise.
149  Bool_t LikFit; ///< True if the likelihood fit was performed
150  Bool_t Success; ///< True if the likelihood fit succeeded
151  Double_t FitLikelihood; ///< Value of log likelihood from fit
152  Int_t T0Source; ///< Enumerator of T0 sources.
153  Int_t NClusters; ///< Number of clusters in the path.
154  Double_t Charge; ///< Charge of the path
155 
156  /// Pull-related values
157  Double_t ElePull;
158  Double_t EleExp;
159  Double_t EleSigma;
160  Double_t MuonPull;
161  Double_t MuonExp;
162  Double_t MuonSigma;
163  Double_t PionPull;
164  Double_t PionExp;
165  Double_t PionSigma;
166  Double_t ProtonPull;
167  Double_t ProtonExp;
168  Double_t ProtonSigma;
169  Double_t KaonPull;
170  Double_t KaonExp;
171  Double_t KaonSigma;
172  Double_t PDist;
173  Double_t PEField;
174  Double_t T0Range [2];
175  Double_t T0RangeDeltaX [2];
176 
177  //ND::TReconPID::ParticleId PID;
178  Int_t PID; ///< The PID of the path.
179  Double_t NetCharge; ///< The total charge left by the path on the micromegas
180 
181  Int_t NJunctions; ///< The number of junctions to which the path connects.
182  Int_t *JunctionIDs; //[NJunctions]
183  ///^ The unique identifiers of the associated junctions
184 
185  Int_t NMatchingPaths; ///< The number of paths to which this path might be matched.
186  Int_t *MatchingPathIDs; //[NMatchingPaths]
187  ///^ The unique identifiers of the paths
188  Double_t *PathMatchingLikelihood; //[NMatchingPaths]
189  ///^ The likelihood of matching to that path.
190 
192  Int_t *MatchingPatternIDs; //[NMatchingPatterns]
193  Int_t *MatchingPatternPathIDs; //[NMatchingPatterns]
194  Double_t *PatternMatchingLikelihood; //[NMatchingPatterns]
195 
197  };
198 
199  //=====================================================================
200 
201  TTRExReconModule(const char *name = "TREx",
202  const char *title = "TPC Recon Extension Module");
203  virtual ~TTRExReconModule();
204 
205  virtual Bool_t ProcessFirstEvent(ND::TND280Event &event);
206 
207  /// Returns true if there is at least one recon object.
208  /// If so, and -preselection=TTRExReconModule is specified,
209  /// the full oaEvent event will be output for this event
210  virtual bool IsFullEventWorthSaving(ND::TND280Event &event);
211 
212  /// Returns TPC in which the pattern was found for all 3 possible input types
213  int GetTPCFromPattern(ND::THandle<ND::TReconVertex>);
214  int GetTPCFromPattern(ND::THandle<ND::TReconPID>);
215  int GetTPCFromPattern(ND::THandle<ND::TReconTrack>);
216 
217  /// Fills a TTPCAnaPath with information from either a TReconTrack or a
218  /// TReconPID
219  void FillPathInfo(TTPCAnaPath *outputPath, ND::THandle<ND::TReconPID> path,
220  std::list<ND::THandle<ND::TReconBase> > patternpaths,
221  ND::THandle<ND::TReconObjectContainer> patterns,
222  ND::THandle<ND::TReconBase> parent_pattern);
223  void FillPathInfo(TTPCAnaPath *outputPath, ND::THandle<ND::TReconTrack> path,
224  std::list<ND::THandle<ND::TReconBase> > patternpaths,
225  ND::THandle<ND::TReconObjectContainer> patterns,
226  ND::THandle<ND::TReconBase> parent_pattern);
227 
228  bool FGDHitVeto(int FGD, int nhits_threshold, ND::TND280Event &event,
229  int mode);
231  TTPCAnaPath *outputPath, ND::THandle<ND::TReconBase> path,
232  std::list<ND::THandle<ND::TReconBase> > patternpaths,
233  ND::THandle<ND::TReconObjectContainer> patterns,
234  ND::THandle<ND::TReconBase> parent_pattern);
235 
236  protected:
237  virtual void InitializeModule();
238  virtual void InitializeBranches();
239  virtual bool FillTree(ND::TND280Event &);
240 
241  public:
242  /// Tree Entries
243  Int_t fNPatterns;
244 
245  Bool_t fIsMC;
246 
247  TClonesArray *fPatterns;
248 
251 
252  private:
253 };
254 
255 // A predicate to sort hits using time
256 struct timeLessThan : public std::binary_function<ND::THandle<ND::THit>,
257  ND::THandle<ND::THit>, bool> {
258  bool operator()(ND::THandle<ND::THit> lhs, ND::THandle<ND::THit> rhs) {
259  return (lhs->GetTime() < rhs->GetTime());
260  }
261 };
262 
263 #endif
Int_t NMatchingPaths
^ The unique identifiers of the associated junctions
virtual Bool_t ProcessFirstEvent(ND::TND280Event &event)
Is called after the first event is loaded in.
Double_t ElePull
Pull-related values.
Int_t PatternID
The ID of the pattern.
TTPCAnaJunction An object describing a meeting point of two or more paths, and containing all associa...
ClassDef(TTRExReconModule::TTPCAnaPath, 1)
TTRExReconModule(const char *name="TREx", const char *title="TPC Recon Extension Module")
TTPCAnaPath An object describing a track-like grouping of hits in the TPC.
Int_t PathID
A unique identifier for the path within the pattern.
Double_t * PathMatchingLikelihood
^ The unique identifiers of the paths
bool FGDHitVeto(int FGD, int nhits_threshold, ND::TND280Event &event, int mode)
Double_t FitLikelihood
Value of log likelihood from fit.
Double_t Length
The length of the path.
virtual void InitializeModule()
Initialize Module, override if necessary.
Double_t MomentumError
The momentum error of the path.
TVector3 LastPosition
The end position of the path.
Int_t NMatchingPatterns
^ The likelihood of matching to that path.
TClonesArray * Paths
The constituent paths of the pattern.
Int_t G4ID
G4 ID of the primary true trajectory associated with this path.
Int_t TPC
The TPC in which the pattern resides.
Bool_t S1Sflag
A flag to say whether this pattern would pass the TPC gas Stage 1 Selection.
ClassDef(TTRExReconModule::TTPCAnaJunction, 1)
TTRExReconModule::TTPCAnaJunction hackPatten
Int_t JunctionID
A unique identifier for the junction within the pattern.
Double_t Time
The T0 for the path.
Int_t NClusters
Number of clusters in the path.
Bool_t LikFit
True if the likelihood fit was performed.
Int_t NJunctions
The number of junctions in the pattern.
void FillPathInfo(TTPCAnaPath *outputPath, ND::THandle< ND::TReconPID > path, std::list< ND::THandle< ND::TReconBase > > patternpaths, ND::THandle< ND::TReconObjectContainer > patterns, ND::THandle< ND::TReconBase > parent_pattern)
Fills a TTPCAnaPath with information from either a TReconTrack or a TReconPID.
TTRExReconModule - Object that contains information related to reconstructed object from the extende...
Int_t fNPatterns
Tree Entries.
Int_t NJunctions
The number of junctions to which the path connects.
Double_t Momentum
The momentum of the path.
TTRExReconModule::TTPCAnaPath hackPath
TVector3 FirstPosition
The start position of the path.
virtual void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
bool operator()(ND::THandle< ND::THit > lhs, ND::THandle< ND::THit > rhs)
Int_t T0Source
Enumerator of T0 sources.
TTPCAnaPattern The master object for any connected system of hits in a TPC.
ClassDef(TTRExReconModule::TTPCAnaPattern, 1)
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
TVector3 MaximumCoordinates
^ The unique identifiers of the associated paths.
virtual bool IsFullEventWorthSaving(ND::TND280Event &event)
Returns true if there is at least one recon object.
Bool_t IsContained
True if the path does not leave the TPC; false otherwise.
TVector3 MinimumCoordinates
The most extreme hit positions in the negative direction.
TVector3 Direction
The direction of the path.
int GetTPCFromPattern(ND::THandle< ND::TReconVertex >)
Returns TPC in which the pattern was found for all 3 possible input types.
Int_t NPaths
The number of paths connected to the junction.
Double_t NetCharge
The total charge left by the path on the micromegas.
Int_t NPaths
The number of paths.
Double_t Charge
Charge of the path.
TLorentzVector Position
The spatial coordinates of the junction.
TClonesArray * Junctions
The constituent junctions of the pattern.
Int_t PID
The PID of the path.
Bool_t Success
True if the likelihood fit succeeded.
A base class for analysis output modules which contain reconstructed event information.
void FillPathMatchingInfo(TTPCAnaPath *outputPath, ND::THandle< ND::TReconBase > path, std::list< ND::THandle< ND::TReconBase > > patternpaths, ND::THandle< ND::TReconObjectContainer > patterns, ND::THandle< ND::TReconBase > parent_pattern)

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

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