eventAnalysis  7.0-49-g0ac7482
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TGlobalReconModule.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 /// 21-Dec-2011: Current responsible for this module is,
6 /// Per Jonsson (per.jonsson@imperial.ac.uk)
7 /// Previous author:
8 /// Anselmo Cervera Villanueva (anselmo [*a*t*] cervera@cern.ch)
9 ///
10 #ifndef TGlobalReconModule_hxx_seen
11 #define TGlobalReconModule_hxx_seen
12 
13 #include <string>
14 
15 #include <TClonesArray.h>
16 #include <TLorentzVector.h>
17 #include <TNamed.h>
18 #include <TTree.h>
19 
20 #include <TND280Event.hxx>
21 
22 #include <TReconPID.hxx>
23 #include <TReconVertex.hxx>
24 
25 #include <TComboHit.hxx>
26 #include <TDigit.hxx>
27 #include <TFGDmcDigit.hxx>
28 #include <TG4HitSegment.hxx>
29 #include <TG4PrimaryVertex.hxx>
30 #include <TG4Trajectory.hxx>
31 #include <TMCDigit.hxx>
32 #include <TMCHit.hxx>
33 #include <TMultiHit.hxx>
34 #include <TTFBmcDigit.hxx>
35 #include <TTPCmcDigit.hxx>
36 
37 #include <EeventAnalysis.hxx>
38 #include "eventAnalysisEnums.hxx"
40 #include "TGlobalBaseObjects.hxx"
41 #include "TTrueVertex.hxx"
42 #include "recpack/HelixEquation.h"
43 #include "recpack/Surface.h"
44 #include "recpack/Trajectory.h"
45 #include "recpack/Volume.h"
46 
47 #include "TTrueVertex.hxx"
48 
49 const int NDETSEXTRAP = 25;
50 const int NDETSUSED = 23;
51 const int NCONSTITUENTS = 20;
52 const int NSVERTICES = 20;
53 const int NTIMEBINS = 8;
54 
55 namespace ND {
56 class TGlobalReconModule;
57 OA_EXCEPTION(EeventAnalysisInfiniteLoop2, EeventAnalysis);
58 };
59 
60 /// This module summarizes the information from global reconstruction.
62  public:
63  /// An object to store subdetector-agnostic hit information.
64  class TGlobalHit : public TObject {
65  public:
66  virtual ~TGlobalHit();
67  double Charge; ///< Deposited charge
68  double Time; ///< Hit time [ns]
69  TVector3 Position; ///< Hit position in global ND coordinates [mm]
70  TVector3 PositionError; ///< The variance on ND::TGlobalReconModule::TGlobalHit::Position [mm]
71  int Type; ///< The hit 'type': (0=X,1=Y,2=Z)
73  };
74 
75  /// An object to store hit information for the SMRD subdetector
76  class TSMRDHit : public TObject {
77  public:
78  virtual ~TSMRDHit();
79  int Wall; ///< SMRD wall number, 0=Top, 1=Bottom, 2= Right, 3= Left.
80  int Yoke; ///< Yoke ring number.
81  int Layer; ///< SMRD hit layer number.
82  int Tower; ///< SMRD Tower number.
83  int Counter; ///< SMRD scint number.
84  double Charge; ///< Deposited charge
85  double Time; ///< Hit time [ns]
86  TVector3 Position; ///< Hit position in global ND coordinates [mm]
87  TVector3 PositionError; ///< The variance on ND::TGlobalReconModule::TSMRDHit::Position [mm]
88  int Type; ///< The hit 'type': (0=X,1=Y,2=Z)
90  };
91 
92  /// An object to store the outermost hits in x,y, and z.
93  class TOutermostHits : public TObject {
94  public:
95  virtual ~TOutermostHits();
96  TGlobalHit hitMinX; ///< Hit with lowest X position.
97  TGlobalHit hitMaxX; ///< Hit with highest X position.
98  TGlobalHit hitMinY; ///< Hit with lowest Y position.
99  TGlobalHit hitMaxY; ///< Hit with highest Y position.
100  TGlobalHit hitMinZ; ///< Hit with lowest Z position.
101  TGlobalHit hitMaxZ; ///< Hit with highest Z position.
103  };
104 
105  /// An object to store information about an FGD Time Bin.
106  class TFgdTimeBin : public TObject {
107  public:
108  TFgdTimeBin();
109  virtual ~TFgdTimeBin();
110  double minTime; ///< Bin start time.
111  double maxTime; ///< Bin end time.
112  int nHits[2]; ///< Number of hits in FGD1 (nHits[0]), and 2 (nHits[1])
113  double rawChargeSum[2]; ///< Summed hit charge in FGD1 (rawChargeSum[0]), and 2 (rawChargeSum[1])
114  float chargePerLayer[2][30]; ///<\brief Summed hit charge for layer x in FGD1 (chargePerLayer[0][x]), and 2 (chargePerLayer[1][x])
115  TVector3 chargeWeightedPos[2]; ///<\brief Charge weighted average hit position in FGD1 chargeWeightedPos[0]) and 2 (chargeWeightedPos[1])
116  TOutermostHits FGD1OutermostHits; ///< A named collection of the outermost hits in X,Y, and Z from FGD1
117  TOutermostHits FGD2OutermostHits; ///< A named collection of the outermost hits in X,Y, and Z from FGD2
118  std::vector<int> FGD1HitLayer; ///< Vector to store the layer number of each hit in FGD1
119  std::vector<float> FGD1HitPosition; ///< Vector to store the X or Y position of each hit in FGD1
120  std::vector<float> FGD1HitQ; ///< Vector to store the charge of each hit in FGD1
121  std::vector<float> FGD1HitTrueE; ///< Vector to store the true edeposit of each hit in FGD1
122  std::vector<float> FGD1HitT; ///< Vector to store the time of each hit in FGD1
123  std::vector<int> FGD1HitTrajID; ///< Vector to store the ID of the Trajectory that created the hit in FGD1
124  std::vector<int> FGD2HitLayer; ///< Vector to store the layer number of each hit in FGD2
125  std::vector<float> FGD2HitPosition; ///< Vector to store the X or Y position of each hit in FGD2
126  std::vector<float> FGD2HitQ; ///< Vector to store the charge of each hit in FGD2
127  std::vector<float> FGD2HitT; ///< Vector to store the time of each hit in FGD2
128  std::vector<int> FGD2HitTrajID; ///< Vector to store the ID of the Trajectory that created the hit in FGD1
129  Int_t NFGD1Unused; ///< Number of hits unused in FGD1
130  TClonesArray* FGD1Unused; ///< The vector unused hits in FGD1
131  Int_t NFGD2Unused; ///< Number of hits unused in FGD2
132  TClonesArray* FGD2Unused; ///< The vector unused hits in FGD2
133  int g4ID; ///< The ID for the G4 trajectory that contributed most to this time bin.
134  TGlobalHit hackFGDUnused; ///< This is just here to fool TFile::MakeProject, not a real object.
136  };
137 
138  /// An object to store information about an SFG Time Bin.
139  class TSfgTimeBin : public TObject {
140  public:
141  TSfgTimeBin();
142  virtual ~TSfgTimeBin();
143  double minTime; ///< Bin start time.
144  double maxTime; ///< Bin end time.
145  double rawChargeSum; ///< Summed hit charge in SFG
146 
147  TVector3 chargeWeightedPos; ///<\brief Charge weighted average hit position in SFG
148  TOutermostHits SFGOutermostHits; ///< A named collection of the outermost hits in X,Y, and Z from SFG
149 
150  int nHits; ///< Number of hits in SFG
151 
152  std::vector<float> SFGHitPositionX; ///< Vector to store the Xposition of each hit in SFG
153  std::vector<float> SFGHitPositionY; ///< Vector to store the Y position of each hit in SFG
154  std::vector<float> SFGHitPositionZ; ///< Vector to store the X or Y position of each hit in SFG
155  std::vector<float> SFGHitQ; ///< Vector to store the charge of each hit in SFG
156  std::vector<float> SFGHitT; ///< Vector to store the time of each hit in SFG
157  std::vector<int> SFGHitTrajID; ///< Vector to store the ID of the Trajectory that created the hit in SFG
158  Int_t NSFGUnused; ///< Number of hits unused in SFG
159  TClonesArray* SFGUnused; ///< The vector unused hits in SFG
160  TGlobalHit hackSFGUnused; ///< This is just here to fool TFile::MakeProject, not a real object.
161  int g4ID; ///< The ID for the G4 trajectory that contributed most to this time bin.
162 
164  };
165 
166 
167  /// An object to hold a reconstructed vertex constituent track
168  class TVertexConstituent : public TObject {
169  public:
170  virtual ~TVertexConstituent();
171  int Charge; ///< Charge of the constituent track
172  double Quality; ///< Quality (chi2) of the constituent track
173  TVector3 Momentum; ///< 3-momentum of the constituent track
174  int PID; ///< The TGlobalPID of the constituent track
176  };
177 
178  /// An object to describe a reconstructed primary vertex candidate.
179  class TGlobalVertex : public TObject {
180  public:
181  TGlobalVertex();
182  virtual ~TGlobalVertex();
183  int Type; ///< Vertex type (0: Global vertex | 1: SFG vertex)
184  int PrimaryIndex; ///< The index of the corresponding primary vertex
185  std::string AlgorithmName; ///< The name of the algorithm that created this object.
186  int Status; ///< The status for the fit.
187  double Quality; ///< The quality of the fit.
188 /// For Vertices created using -O TGlobalReconModule=UseECalVertices the quality denotes
189  /// whether all constituents were correctly found 1: for all found 0: for not all found
190  /// Not finding them is an internal TGlobalReconModule error and these vertices should not
191  /// be trusted.
192  int NDOF; ///< The number of degrees of freedom.
193  TLorentzVector Position; ///< The position of the vertex.
194  TLorentzVector Variance; ///< The position variance;
195  Int_t NTrueVertices; ///< The true vertex
196  TClonesArray* TrueVertices; ///< The true vertex
197  Int_t NConstituents; ///< Constituent tracks
198  TClonesArray* Constituents; ///< Constituent tracks
199  TTrueVertex hackTrueVertexObject; ///< This is just here to fool TFile::MakeProject, not a real object.
200  TVertexConstituent hackVertexConstituentObject; ///< This is just here to fool TFile::MakeProject, not a real object.
202  };
203 
204  /// An object to described a P0D shower
206  public:
207  virtual ~TP0DObject();
208  double Width; ///< The width of the shower (perpendicular to the direction).
209  double avgtime; ///< Averaged corrected node time.
210  std::vector<int> ParticleId; ///< A vector of potential PIDs, sorted by weight, c.f. TP0DObject::PIDWeight.
211  std::vector<double> PIDWeight; ///< The weights for the PID hypotheses, c.f. TP0DObject::ParticleId
213  };
214 
215  /// Describes a reconstructed ECalObject
217  public:
218  virtual ~TECALObject();
219  double Length ;///< The length of the track or shower, its value depends on if the object is reconstructed as track-like or shower-like.
220  ///< If IsTrackLike Length is set by RecPack ND::tman().ComputeObjectLength
221  ///< If IsShowerLike length is set by Tracker ECal reconstruction and is the distance between the charge weighted position of
222  ///< hits in the first layer and the charge weighted position of hits in the last layer.
223  double EDeposit ;///< Deposited energy. Its value depends on if the object is reconstructed as track-like or shower-like If IsTrackLike EDeposit is the total charge in the cluster in MEU. If IsShowerLike it is the result of the Tracker ECal EMEnergyFit in MeV.
224  double LLR_Quality; ///<\brief PID quality flag. A non-zero indicates an bad quality. If this value is non-zero the PID values are set to -9999.
225  double LLR_MIP_EM; ///<\brief Value to separate MIP-like objects (e.g. muons) from EM showers e.g. photons/electrons). -9999 indicates an error.
226  double LLR_MIP_Pion; ///<\brief Value to separate MIP-like objects (e.g. muons) from showering pions. -9999 indicates an error.
227  double LLR_EM_HIP; ///<\brief Value to separate light tracks/MIP-like objects (e.g. muons) from heavy tracks / Highly-ionising particles (specifically proton). -9999 indicates an error.
228  double LLR_MIP_EM_LowMomentum; ///< UNSTABLE: A combined discriminator for separating MIPs from EM showers. This is similar to LLR_MIP_EM but trained specifically on low-momentum electrons and muon. NB: this variable is still being developed and should be considered to be unstable. Positive values = electron-like; Negative values = muon-like. See the ecalRecon documentation for more details. -9999 indicates an error.
229  double LLR_MIP_HIP_VACut; ///< UNSTABLE: Only filled for FilledAsType == 2 Recalculates PID variables for a vertex track where the X% (20% by default) hits nearest to the reconstructed vertex are ignored.
230  double AverageHitTime; ///< The charged weighted average time for the ECal cluster
231  double AverageZPosition; ///< Unweighted average Z position of object-constituent hits.
232  double EMEnergyFit_Result; ///< The result from the EM energy fit to the cluster
233  double EMEnergyFit_Uncertainty; ///< The uncertainty of the EM energy fit to the cluster
234  int FilledAsType; ///<\brief Whether the object was filled as a shower (or a track.). This is NOT a PID. This lets you know how some of these variables were filled from the original ECal cluster. ECal-iso vertex tracks do not fill many of these variables. Showers and Tracks differ in their definitions of Width and Length, and EDeposit. Cone is filled from the alternate Shower hypothesis for Track-like clusters. 2. ECal-iso vertex track 1. Shower-like 0. Track-like -1. Default value
235  double PID_Circularity; ///< The circularity of the object
236  double PID_Angle; ///< The zenith angle with respect to each detector.
237  double PID_ShowerAngle; ///< The angle from the start of an object to its width at its charge centre
238  double PID_Asymmetry; ///< Ratio of the big width of an object by its small width.
239  double PID_TruncatedMaxRatio; ///< A truncated Max Ratio. See ecalRecon docs for the full definition.
240  double PID_TransverseChargeRatio; ///< \brief A variable sensitive to the charge distribution in the plane transverse to a shower/track direction. See the ecalRecon documentation for the full definition.
241  double PID_FrontBackRatio; ///< The ratio of the charge in equal length blocks at each end of the track. \note Assumes particle is coming from the tracker into the ECal.
242  double Containment; ///< Containment: contained = 1.0, not-contained = 0.0, default = -1.0. An object is classed as contained if it has no hits in the outer bars of the ECal (bar number 0 or the maximum bar in a layer) and no hits in the outermost layer of the ECal.
243  double Thrust; ///< The thrust value
244  TVector3 ThrustOrigin; ///< The origin point of the thrust
245  TVector3 ThrustAxis; ///< The thrust axis
246  int InnerMostLayerHit;///<\brief Zero-indexed layer number of tracker-closest layer with an ECal hit belonging to this object.
247  int OuterMostLayerHit; ///<\brief Zero-indexed layer number of tracker-farthest layer with an ECal hit belonging to this object.
248  TVector3 Width; ///< TrackShower width Filled depending on `FilledAsShower`. * Track: `ND::TReconTrack::GetWidth` * Shower: All three components are = `Length*tan(PID_ShowerAngle)`
250  };
251 
252  /// An object to hold specific TPC variables
253  class TTPCObject : public TSubBaseObject {
254  public:
255  virtual ~TTPCObject();
256  double Charge; ///< Charge from the TPC pid (+1, or -1)
257  double NTrun; ///< 70% of the number of cluster
258  double Craw; // Raw mean charge deposit in PID
259  double Ccorr; ///< Corrected truncated mean charge deposit in PID
260  double PullEle; ///< Pull for TPC pid electron hypothesis
261  double PullMuon; ///< Pull for TPC pid muon hypothesis
262  double PullPion; ///< Pull for TPC pid pion hypothesis
263  double PullKaon; ///< Pull for TPC pid kaon hypothesis
264  double PullProton; ///< Pull for TPC pid proton hypothesis
265  double dEdxexpEle; ///< Estimated dE/dx for electron hypothesis
266  double dEdxexpMuon; ///< Estimated dE/dx for muon hypothesis
267  double dEdxexpPion; ///< Estimated dE/dx for pion hypothesis
268  double dEdxexpKaon; ///< Estimated dE/dx for kaon hypothesis
269  double dEdxexpProton; ///< Estimated dE/dx for proton hypothesis
270  double SigmaEle; ///< Sigma estimated width of TPC pid electron hypothesis
271  double SigmaMuon; ///< Sigma estimated width of TPC pid muon hypothesis
272  double SigmaPion; ///< Sigma estimated width of TPC pid pion hypothesis
273  double SigmaKaon; ///< Sigma estimated width of TPC pid kaon hypothesis
274  double SigmaProton; ///< Sigma estimated width of TPC pid proton hypothesis
275  std::vector<int> T0Source; ///< The T0Source, the values are defined in TTPCFitStatusBranch.hxx, the TTPCT0Source enumeration.
276  std::vector<int>
277  NHorRows; ///< The number of horizontal clusters in the track
278  std::vector<int>
279  NVerRows; ///< The number of vertical clusters in the track
280  int NbFittedVerticalClusters; ///< The number of vertical clusters contributed to the fit, TREx
281  int NbFittedHorizontalClusters; ///< The number of horizontal clusters contributed to the fit, TREx
282  double PDist; ///< Placeholder for momentum of BField refit.
283  double PEField; ///< Placeholder for momentum of EField refit.
284  double TPCLength; ///< TPC track length.
285  int TrackType; ///< Record of why the track was refit with a kalman filter fit instead of the likelihood fit.
286 
287  // Newly added variables
288  double TrueEDeposit; // True energy deposition summing over hit segments
289  double TrueEDeposit_sec; // The same, but use function GetSecondaryDeposition()
290  double TruedEdx; // True dE/dx computed based on hit segment energy deposition and "length"
291  double TruedEdx_sec; // The same, but use function GetSecondaryDeposition()
292 
294  };
295 
296  /// An object to hold specific TPC variables
297  class TTPCOtherObject : public TObject {
298  public:
299  virtual ~TTPCOtherObject();
300  double Charge; ///< Charge
301  int Detector; ///< Detector
302  int NHits; ///< Number of hits
303  double Chi2; ///< Chi squared
304  double EDeposit; ///< Energy deposit
305  TLorentzVector FrontPosition; ///< The Front position of the object.
306  TLorentzVector BackPosition; ///< The Back position of the object.
307  TVector3 FrontDirection; ///< The Front direction of the object.
308  TVector3 BackDirection; ///< The Back direction of the object.
309  double Momentum; ///< the momentum of the object
310  TTrueParticle TrueParticle; ///< The true particle
312  };
313 
314  /// An object to hold specific TRACKER variables
316  public:
317  virtual ~TTrackerObject();
318  double Charge;
321  };
322 
323  /// An object to hold specific SFG variables
324  class TSFGObject : public TSubBaseObject {
325  public:
326  virtual ~TSFGObject();
327 
328  int Type; ///< Object type, 0: Particle, 1: Track, 2: Cluster, 3: Shower, 4: Vertex
329 
330  double avgtime; ///< Average fully corrected SFG hit time.
331  double EDeposit; ///< Energy deposit of the corresponding object.
332  TLorentzVector Position; ///< Position of the correspponding object.
333  TLorentzVector PosVariance; ///< Variance on the position of the corresponding object.
334  TVector3 Direction; ///< Direction of the corresponding object.
335  TVector3 DirVariance; ///< Direction variance of the corresponding object.
336 
337 
338  double PIDWeightProt; ///< PID weights for proton hypothesis
339  double PIDWeightPion; ///< PID weights for pion hypothesis
340  double PIDWeightMuon; ///< PID weights for muon hypothesis
341  double PIDWeightElec; ///< PID weights for electron hypothesis
342 
343 
344  int ProtonBraggCut; ///< Bragg peak cut (only used for SFGD contained tracks)
345  int PionBraggCut; ///< Bragg peak cut (only used for SFGD contained tracks)
346  int NegPionBraggCut; ///< Bragg peak cut (only used for SFGD contained tracks)
347  //============ SFG hit ===================//
348 
349  std::vector<TLorentzVector> HitPosition; ///< Vector to store the position of each hit
350  std::vector<TLorentzVector> HitPosVariance; ///< Vector to store the variance of the position of each hit
351  std::vector<double> HitCharge; ///< Vector to store the charge of each hit
352 
353  std::vector<int> HitTrajID; ///< Vector to store the ID of the Trajectory that created the hit
354 
355  std::vector<std::vector<int>> HitUniqueID; ///< Vector to store the Unique ID of the hit
356 
357  //============ SFG node ===================//
358  std::vector<TLorentzVector> NodePosition; ///< Vector to store the position and time of each node
359 
360  std::vector<TLorentzVector> NodePosVariance; ///< Vector to store the variance on the position and time of each node
361  std::vector<TVector3> NodeDirection; ///< Vector to store the direction of each node
362 
363  std::vector<TVector3> NodeDirVariance; ///< Vector to store the variance on the direction of each node
364  std::vector<double> NodeEDeposit; ///< Vector to store the energy deposit of each node
365 
366  std::vector<double> NodeEDeposit_fit; // Fitted node energy deposit
367 
368  std::vector<int> NodeNHits; ///< Vector to store the number of hits contributing to each node
369 
370  std::vector<std::vector<int>> NodeHits; ///< Vector to store the hits contributing to each node
371  std::vector<std::vector<int>> NodeUniqueID; ///< Vector to store the Unique ID of the node
372 
374  };
375 
376  /// An object to hold specific FGD variables
377  class TFGDObject : public TSubBaseObject {
378  public:
379  virtual ~TFGDObject();
380 
381  double avgtime; ///< Average fully corrected FGD hit time.
382  float chargePerLayer[30];
384 
386  ///< Fully contained PID information. Indicates whether the FGD PID algorithm
387  /// determined the track to be fully contained in FGD1 or FGD2 (=1 or 2),
388  /// stopping in FGD1 or FGD2 (=-1 or -2), or other (0).
389 
390  double E; ///< Measured energy in an FGD.
391  double x; ///< Distance traveled in an FGD.
392  double TrueE; ///< True energy in an FGD
393 
394  double E_exp_muon; ///< Expected energy deposit for a muon.
395  double E_exp_pion; ///< Expected energy deposit for a pion.
396  double E_exp_proton; ///< Expected energy deposit for a proton.
397  double E_exp_electron; ///< Expected energy deposit for an electron.
398 
399  double sigmaE_muon; ///< Expected energy uncertainty for a muon.
400  double sigmaE_pion; ///< Expected energy uncertainty for a pion.
401  double sigmaE_proton; ///< Expected energy uncertainty for a proton.
402  double sigmaE_electron; ///< Expected energy uncertainty for an electron.
403 
404  double PullMuon; ///< The FGD PID pull value for a muon.
405  double PullPion; ///< The FGD PID pull value for a pion.
406  double PullProton; ///< The FGD PID pull value for a proton.
407  double PullElectron; ///< The FGD PID pull value for an electron.
408  double PullNotSet; ///< PullNotSet = 1 if the pull is not set, and 0 otherwise.
409 
410  bool isFgdVA;
412  int globpassVA_flag; /// FGD vertex activity Vertex (1) or Entrance (2)
413  double fgdVA_upMinZ; ///< FGD vertex activity values.
414  double fgdVA_downMaxZ; ///< FGD vertex activity values.
415  double fgdVA_upCosTheta; ///< FGD vertex activity values.
416  double fgdVA_downCosTheta; ///< FGD vertex activity values.
417  double fgdVA_otherUpQ; ///< FGD vertex activity values.
418  double fgdVA_otherDownQ; ///< FGD vertex activity values.
419  double fgdVA_verQ; ///< FGD vertex activity values.
420  double fgdVA_verLayQ; ///< FGD vertex activity values.
421  double fgdVA_verNearQ; ///< FGD vertex activity values.
422  double fgdVA_verNextNearQ; ///< FGD vertex activity values.
423  double fgdVA_verNextNextNearQ; ///< FGD vertex activity values.
424 
425  double fgdVA_verNearQ_rect; ///< FGD vertex activity 2x3.
426  double fgdVA_verNextNearQ_rect; ///< FGD vertex activity 2x5.
427  double fgdVA_verNextNextNearQ_rect; ///< FGD vertex activity 2x7.
428 
429  double fgdVA_totalQ; ///< FGD vertex activity values.
430  double fgdVA_totalCorrE; ///< FGD vertex activity values.
431 
432  bool isFgdEA;
434  int globpassEA_flag; /// FGD end activity End (1) or Exit (2)
435  double fgdEA_otherUpQ; ///< FGD end activity values.
436  double fgdEA_otherDownQ; ///< FGD end activity values.
437  double fgdEA_verQ; ///< FGD end activity values.
438  double fgdEA_verLayQ; ///< FGD end activity values.
439  double fgdEA_verNearQ; ///< FGD end activity values.
440  double fgdEA_verNextNearQ; ///< FGD end activity values.
441  double fgdEA_verNextNextNearQ; ///< FGD end activity values.
442 
443  double fgdEA_verNearQ_rect; ///< FGD end activity values.
444  double fgdEA_verNextNearQ_rect; ///< FGD end activity values.
445  double fgdEA_verNextNextNearQ_rect; ///< FGD end activity values.
446 
447  std::vector<int> fgdhits_Layer; ///< Vector to store the layer number of each hit
448  std::vector<TVector3> fgdhits_Position; ///< Vector to store the X or Y position of each hit
449  std::vector<float> fgdhits_Time; ///< Vector to store the time of each hit
450  std::vector<float> fgdhits_Charge; ///< Vector to store the charge of each hit
451  std::vector<int> fgdhits_TrajID; ///< Vector to store the ID of the Trajectory that created the hit
452 
453  // Node information
454  std::vector<TLorentzVector> NodePosition; ///< FGD Node positions
455  std::vector<double> NodeEDeposit; /// FGD Node Energy Deposits
456 
458  };
459 
460  /// An object to hold specific SMRD variables
461  class TSMRDObject : public TSubBaseObject {
462  public:
463  virtual ~TSMRDObject();
464  double avgtime; // Avergaed light-propagation corrected hit time
465 
467  };
468 
469  /// An object to describe a reconstructed PID.
470  class TTpcPID : public TObject {
471  public:
472  // TTpcPID();
473  virtual ~TTpcPID();
474  std::string AlgorithmName; ///< The name of the algorithm that created this object.
475  unsigned long Detectors; ///< Detectors used, defined according to the algorithm in GetDetectorNumber.
476  unsigned long Status; ///< The status for the fit, from: object->CheckStatus(object->kSuccess).
477  int NDOF; ///< The number of degrees of freedom.
478  double Chi2; ///< The chi2 of the fit.
479  int NNodes; ///< The number of nodes
480  int NHits; ///< The number of hits.
481  int NConstituents; ///< The number of constituents.
482  bool isForward; ///< Sense of object.
483  double Charge; ///< The Charge
484  double EDeposit; ///< The deposited charge for the object.
485  TVector3 Cone; ///< The opening angles of the cone (only for showers)
486  double Width; ///< The width of the shower (perpendicular to the direction)
487  double Length; ///< The total length of the object
488  std::vector<double> Likelihoods; /// the PID likelihoods for combined PID
489  TLorentzVector FrontPosition; ///< The position of the object.
490  TLorentzVector BackPosition; ///< The position of the object.
491  TLorentzVector FrontPositionVar; ///< The position variance;
492  TLorentzVector BackPositionVar; ///< The position variance;
493  TVector3 FrontDirection; ///< The direction of the object.
494  TVector3 BackDirection; ///< The direction of the object.
495  TVector3 FrontDirectionVar; ///< The direction variance of the object.
496  TVector3 BackDirectionVar; ///< The direction variance of the object.
497  double FrontMomentum; ///< the momentum of the object
498  double BackMomentum; ///< the momentum of the object
499  double FrontMomentumError; ///< the error on the momentum of the object
500  double BackMomentumError; ///< the error on the momentum of the object
501 
502  // Kinematics at vertex
503  TLorentzVector PositionAtTrueVertex; ///< Position at true vertex.
504  TLorentzVector
505  PositionVarAtTrueVertex; ///< The position variance at the true vertex.
506  TVector3 DirectionAtTrueVertex; ///< Direction at the true vertex.
507  TVector3 DirectionVarAtTrueVertex; ///< The direction variance at the true vertex.
508  double MomentumAtTrueVertex; ///< Momentum at the true vertex.
509  double MomentumErrorAtTrueVertex; ///< The momentum variance at the true vertex.
510 
511  std::vector<TLorentzVector*> EntrancePosition; ///< the position of the object at the entrance of each subdetector
512  std::vector<TLorentzVector*> ExitPosition; ///< the position of the object at the exit of each subdetector
513  TTrueParticle TrueParticle; ///< The true particle
515  };
516 
517  /// An object to describe a reconstructed PID.
518  class TGlobalPIDAlternate : public TObject {
519  public:
521  virtual ~TGlobalPIDAlternate(){};
522 
523  unsigned long Detectors; ///< Detectors used, defined according to the formula in GetDetectorNumber.
524  bool DetectorUsed[NDETSUSED]; ///< Detectors used (NDETSUSED = 23)
525  unsigned long Status; ///< The status for the fit.
526  int NDOF; ///< The number of degrees of freedom.
527  double Chi2; ///< The chi2 of the fit.
528  double Charge; ///< The Charge
529  double Length; ///< The length of the track or shower (RMS)
530  int ParticleId; ///< the PDG code obtained in the recon combined PID
531  double PIDWeight; ///< the PID weight for this hypothesis
532 
533  TLorentzVector FrontPosition; ///< The position of the object.
534  TLorentzVector BackPosition; ///< The position of the object.
535  TLorentzVector FrontPositionVar; ///< The position variance;
536  TLorentzVector BackPositionVar; ///< The position variance;
537  TVector3 FrontDirection; ///< The direction of the object.
538  TVector3 BackDirection; ///< The direction of the object.
539  TVector3 FrontDirectionVar; ///< The direction variance of the object.
540  TVector3 BackDirectionVar; ///< The direction variance of the object.
541  double FrontMomentum; ///< the momentum of the object
542  double BackMomentum; ///< the momentum of the object
543  double FrontMomentumError; ///< the error on the momentum of the object
544  double BackMomentumError; ///< the error on the momentum of the object
545 
546  // Kinematics at vertex
547  TLorentzVector PositionAtTrueVertex; ///< The position at the true vertex.
548  TLorentzVector
549  PositionVarAtTrueVertex; ///< The position variance at the true vertex.
550  TVector3 DirectionAtTrueVertex; ///< The direction at the true vertex.
551  TVector3 DirectionVarAtTrueVertex; ///< The direction variance at the true vertex.
552  double MomentumAtTrueVertex; ///< The momentum at the true vertex.
553  double MomentumErrorAtTrueVertex; ///< The error of the momentum at the true vertex.
555  };
556 
557  /// An object to describe a reconstructed PID.
558  class TGlobalPID : public TObject {
559  public:
560  TGlobalPID();
561  virtual ~TGlobalPID();
562  UInt_t UniqueID; ///< Unique identifier for global recon objects (needed fro broken association)
563  std::vector<UInt_t> BrokenUniqueIDs; ///< the broken partners unique IDs
564  std::string
565  AlgorithmName; ///< The name of the algorithm that created this object.
566  unsigned long Detectors; ///< Detectors used
567  bool DetectorUsed[NDETSUSED]; ///< Detectors used. Index order from 0 to 26
568  unsigned long Status; ///< The status for the fit.
569  int NDOF; ///< The number of degrees of freedom.
570  double Chi2; ///< The chi2 of the fit.
571  int NNodes; ///< The number of nodes.
572  int NHits; ///< The number of hits.
573  int NConstituents; ///< The number of constituents.
574  bool isForward; ///< Sense of object.
575  bool SenseOK; ///< Sense of object.
576  bool IsCurvBack; ///< A curving-back object
577  bool IsFgdECalIncremental; ///< A track created by FGD-ECal matching algorithm
578  double Charge; ///< The Charge
579  double EDeposit; ///< The deposited charge for the object.
580  TVector3 Cone; ///< The opening angles of the cone (only for showers)
581  double Width; ///< The width of the shower (perpendicular to the direction)
582  double Length; ///< The length of the track or shower (RMS)
583 
584  // Position of each node
585  std::vector<TLorentzVector> NodePosition;
586  // Position of each hit
587  std::vector<TLorentzVector> HitPosition;
588  std::vector<int>
589  ParticleIds; ///< the PDG codes obtained in the recon combined PID
590 
591  std::vector<double> PIDWeights; ///< the PID likelihoods for combined PID
592 
593 
594  TLorentzVector FrontPosition; ///< The position of the object.
595  TLorentzVector BackPosition; ///< The position of the object
596  TVector3 FrontDirection; ///< The direction of the object.
597  TVector3 BackDirection; ///< The direction of the object.
598  double FrontMomentum; ///< the momentum of the object
599  double FrontCharge; ///< the charge of the object at the first state
600  double BackMomentum; ///< the momentum of the object
601  double BackCharge; ///< the momentum of the object at the back state
602  double FrontMomentumError; ///< the error on the momentum of the object
603  double BackMomentumError; ///< the error on the momentum of the object
604  double FrontStateCov[7][7]; ///< full covariance matrix for front state: pos, dir, qp
605  double BackStateCov[7][7]; ///< full covariance matrix for last state: pos, dir, qp
606  double RangeMomentumMuon; ///< the momentum by range for the muon hypothesis
607  double RangeMomentumMuonFlip; ///< the momentum by range for the flipped muon hypothesis
608  double RangeMomentumPion; ///< the momentum by range for the pion hypothesis
609  double RangeMomentumPionFlip; ///< the momentum by range for the flipped pion hypothesis
610  double RangeMomentumElectron; ///< the momentum by range for the electron hypothesis
611  double RangeMomentumElectronFlip; ///< the momentum by range for the flipped electron hypothesis
612  double RangeMomentumProton; ///< the momentum by range for the proton hypothesis
613  double RangeMomentumProtonFlip; ///< the momentum by range for the flipped proton hypothesis
614  double RangeMomentumEndToTPCMuon; ///< the momentum by range for the muon hypothesis (from end to a TPC)
615  double RangeMomentumEndToTPCPion; ///< the momentum by range for the pion hypothesis (from end to a TPC)
616  double RangeMomentumEndToTPCElectron; ///< the momentum by range for the electron hypothesis (from end to a TPC)
617  double RangeMomentumEndToTPCProton; ///< the momentum by range for the proton hypothesis (from end to a TPC)
618 
619 
620  std::vector<std::pair<unsigned long, TVector2> > NodeTimes; ///< vector of pairs, sub-detecor number and time-stamps of edge nodes in this subdetector
621  TLorentzVector PositionAtTrueVertex; ///< Position at the true vertex.
622  TVector3 DirectionAtTrueVertex; ///< Direction at the true vertex.
623  double MomentumAtTrueVertex; ///< Momentum at the true vertex.
624  double MomentumErrorAtTrueVertex; ///< Error of the momentum at the true vertex.
625  double ChargeAtTrueVertex; ///< Charge at the true vertex.
626  double StateCovAtTrueVertex[7][7]; ///< Full covariance matrix for the state: pos, dir, qp at the true vertex.
627 
628  // the position, direction and momentum, of the object at the entrance and
629  // exit of each subdetector
630  int EntranceOK [NDETSEXTRAP]; ///< Status of the subdetector entrance.
631  int ExitOK [NDETSEXTRAP]; ///< Status of the subdetector exit.
632  TLorentzVector EntrancePosition [NDETSEXTRAP]; ///< The position of the object at the entrance of each subdetector.
633  TLorentzVector ExitPosition [NDETSEXTRAP]; ///< The position of the object at the exit of each subdetector.
634  TVector3 EntranceDirection [NDETSEXTRAP]; ///< The direction of the object at the entrance of each subdetector volume.
635  TVector3 ExitDirection [NDETSEXTRAP]; ///< The direction of the object at the exit of each subdetector.
636  double EntranceMomentum [NDETSEXTRAP]; ///< The momentum of the object at the entrance of each subdetector.
637  double ExitMomentum [NDETSEXTRAP]; ///< The momentum of the object at the exit of each subdetector.
638  TLorentzVector EntrancePositionErr [NDETSEXTRAP]; ///< The error of the position of the object at the entrance of each subdetector.
639  TLorentzVector ExitPositionErr [NDETSEXTRAP]; ///< The error of the position of the object at the exit of each subdetector.
640  TVector3 EntranceDirectionErr[NDETSEXTRAP]; ///< The error of the direction of the object at the entrance of each subdetector.
641  TVector3 ExitDirectionErr [NDETSEXTRAP]; ///< The error of the direction of the object at the exit of each subdetector.
642  double EntranceMomentumErr [NDETSEXTRAP]; ///< The error of the momentum of the object at the entrance of each subdetector.
643  double ExitMomentumErr [NDETSEXTRAP]; ///< The error of the momentum of the object at the exit of each subdetector.
644 
645  Int_t NHitsSaved; ///< Number of entries in the HitsSaved array.
646  TClonesArray* HitsSaved; ///< the two first and two last hits (TGlobalHit).
647  TTrueParticle TrueParticle; ///< The true particle
648 
649  // The subdetector specific variables
650  Int_t NTRACKERs; ///< Number of Tracker objects.
651  TClonesArray* TRACKER; ///< Tracker specific variables.
652  Int_t NTPCs; ///< Number of TPC objects.
653  TClonesArray* TPC; ///< TPC specific variables.
654  Int_t NFGDs; ///< Number of FGD objects.
655  TClonesArray* FGD; ///< FGD specific variables.
656  Int_t NSFGs; ///< Number of SFG objects.
657  TClonesArray* SFG; ///< SFG specific variables.
658  Int_t NECALs; ///< Number of ECAL objects.
659  Int_t NDsECALs; ///< Number of DsECAL objects.
660  Int_t NTrECALs; ///< Number of TrECAL objects.
661  TClonesArray* ECAL; ///< ECAL specific variables.
662  Int_t NP0DECALs; ///< Number of P0DECAL objects.
663  TClonesArray* P0DECAL; ///< P0DECAL specific variables.
664  Int_t NP0Ds; ///< Number of P0D objects.
665  TClonesArray* P0D; ///< P0D specific variables.
666  Int_t NSMRDs; ///< Number of SMRD objects.
667  TClonesArray* SMRD; ///< SMRD specific variables.
668  Int_t NAlternates; ///< Number of entries in the alternate hypotheses list.
669  TClonesArray* Alternates; ///< List of alternate hypotheses
670 
671  /// Variables to get the association between the global track and the gas
672  /// ouptut involved
673  /// The vectorS of path, junction, pattern ids of the underlying TPC gas
674  /// output
675  // (in principle could store this info for the TPC constituents but it may
676  // lead to "doubling" the info, so keep it here for the moment)
677  std::vector<int> TPCGasPatternIDs; ///< The IDs of the TREx patterns which contributed to the object
678  std::vector<int> TPCGasPathIDs; ///< The IDs of the TREx paths which contributed to the object
679  std::vector<int> TPCGasJunctionIDs; ///< The IDs of the TREx junctions which contributed to the object
680 
681  // JIMHACK - Just for now include an instance of TPC, ECAL and FGD objects
682  // here as
683  // TFile::MakeProject does not seem able to find them when they are hidden
684  // inside a
685  // TClonesArray. Nothing is done with these - it is just an ugly workaround.
686  TTPCObject hackTPCObject; ///< This is just here to fool TFile::MakeProject, not a real object.
687  TFGDObject hackFGDObject; ///< This is just here to fool TFile::MakeProject, not a real object.
688  TSFGObject hackSFGObject; ///< This is just here to fool TFile::MakeProject, not a real object.
689  TECALObject hackECALObject; ///< This is just here to fool TFile::MakeProject, not a real object.
690  TP0DObject hackP0DObject; ///< This is just here to fool TFile::MakeProject, not a real object.
691  TSMRDObject hackSMRDObject; ///< This is just here to fool TFile::MakeProject, not a real object.
692  TTrackerObject hackTrackerObject; ///< This is just here to fool TFile::MakeProject, not a real object.
693  TGlobalPIDAlternate hackGlobalPIDAlternate; ///< This is just here to fool TFile::MakeProject, not a real object.
694 
696  };
697 
698  public:
699  /// Default Constructor
700  TGlobalReconModule(const char* name = "Global",
701  const char* title = "Global Recon Module");
702 
703  virtual ~TGlobalReconModule();
704 
705  virtual Bool_t ProcessFirstEvent(ND::TND280Event& event);
706 
707  void SayAvailableOpts(std::string indent = "") {
708  std::cout << indent << "=UseECalVertices: Will assume global vertexing\n"
709  << indent << "\t used the results of ECal-iso vertexing."
710  << std::endl;
711  }
712 
713  protected:
714  virtual void InitializeModule();
715  void FillConfigTree(TTree* configTree);
716  Bool_t Configure(std::string& opt);
717 
718  int GetNumberOfHits(ND::THandle<ND::TReconBase> object);
719 
720  virtual void InitializeBranches();
721  virtual bool FillTree(ND::TND280Event&);
722 
723  bool FillVertex(ND::TND280Event& event,ND::THandle<ND::TReconVertex> vertex, bool primary);
724 
725  void MatchTrueVertex(ND::THandle<ND::TG4PrimaryVertexContainer> g4PrimVert);
726 
727  void FillGlobalPIDs(ND::TND280Event& event,
728  ND::THandle<ND::TReconBase> object);
729 
730  void FillGlobalPIDAlternates(ND::THandle<ND::TG4Trajectory> G4track,
731  ND::THandle<ND::TReconBase> object,
732  TGlobalPID& globalObject);
733  void FillGlobalPIDAlternate(ND::THandle<ND::TG4Trajectory> G4track,
734  ND::THandle<ND::TReconBase> object,
735  TGlobalPIDAlternate& PIDAlternate);
736 
737  void FillTPCPID(ND::THandle<ND::TReconBase> object);
738 
739  ND::THandle<ND::TG4PrimaryVertex> GetG4Vertex(const ND::TReconBase& object,
740  double& pur, double& eff);
741  bool GetG4Vertex(ND::THandle<ND::TG4Trajectory> G4track,
742  ND::TG4PrimaryVertex& G4vertex);
743 
744  void FillTrueParticle(ND::THandle<ND::TG4Trajectory> G4track, double pur,
745  double eff, ND::TTrueParticle& part);
746  void FillTrueVertex(bool, const ND::TG4PrimaryVertex& G4vertex, double pur,
747  double eff, ND::TTrueVertex& vertex);
748 
749  void FillSubBaseObject(ND::THandle<ND::TReconBase> object,
750  TSubBaseObject& sub, int det);
751  void FillTPCObject(ND::THandle<ND::TReconBase> object, TTPCObject& sub,
752  int det);
753 
754  void FillP0DECALInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
755  void FillECALInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
756  void FillTPCInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
757  void FillFGDInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
758  void FillSFGInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
759  void FillP0DInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
760  void FillSMRDInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
761  void FillTrackerInfo(ND::THandle<ND::TReconBase> object, TGlobalPID& pid);
762 
763  void FillTPCOther(ND::TND280Event& event);
764  void FillSFGOther(ND::TND280Event& event);
765  void FillUnusedHits(ND::TND280Event& event);
766  void FillGlobalHit(ND::THandle<ND::THit> hit, TGlobalHit& gHit);
767  void FillGlobalHit(ND::THandle<ND::THit> hit, TSMRDHit& smrdHit);
768 
769  // a function to fill info related to smrd hit
770  void FillSmrdHit(ND::THandle<ND::THit> hit, TSMRDHit& smrdHit);
771 
772  void FillDetectorUsed(ND::THandle<ND::TReconBase> object, bool dets[]);
773  void FillOutermostHits(ND::THitSelection& hits, double charge_cut,
774  TOutermostHits& outer);
775  void FillFirstLastHits(ND::THitSelection& hits, TGlobalPID& globalObject);
776  void FillAllHits(ND::THitSelection& hits, TGlobalPID& globalObject);
777 
778  double MedianObjectTime(ND::THandle<ND::TReconBase> object);
779 
780  void GetFGDSimpleVA(ND::TND280Event& event,
781  ND::THandle<ND::TReconBase>& object,
782  TLorentzVector& vertexPos, int globpass, int vaea);
783 
784  void CheckFGDdist(TLorentzVector& FGDPos, TVector3 fFGDActiveMin,
785  TVector3 fFGDActiveMax);
786 
787  void FillFgdTimeBins(ND::TND280Event& event);
788  void FillSfgTimeBins(ND::TND280Event& event);
789  void FillVertexInfo(ND::TND280Event& event,
790  ND::THandle<ND::TReconObjectContainer> globalObjects);
791 
792  int GetTrackerDetectorNumber(ND::THandle<ND::TReconBase> object);
793  unsigned long GetDetectorNumber(ND::THandle<ND::TReconBase> object);
794  int CountDetector (ND::THandle<ND::TReconBase> object);
795 
796  std::string GetObjectType(ND::THandle<ND::TReconBase> object);
797  bool IsTrackLike(ND::THandle<ND::TReconBase> object);
798 
799  ND::THandle<ND::TG4Trajectory> GetParent(
800  ND::THandle<ND::TG4Trajectory> G4track);
801 
802  bool GetIncomingParticle(const ND::TG4PrimaryVertex& G4vertex,
803  ND::TG4PrimaryParticle& incoming);
804 
806  void FillExtrapolationToDetectors(ND::THandle<ND::TReconBase> object,
807  TGlobalPID& globalObject);
808  void FillExtrapolationToDetectors(ND::THandle<ND::TReconBase> object,
809  TGlobalPID& globalObject, Trajectory& traj,
810  int sense);
811 
812  void FillKinematicsAtTrueVertex(ND::THandle<ND::TG4Trajectory> G4track,
813  ND::THandle<ND::TReconBase> object,
814  TLorentzVector& pos, TVector3& dir,
815  double& mom, double& momErr, double& charge,
816  double (&cov)[7][7]);
817 
818  void FillKinematicsAtTrueVertex(ND::THandle<ND::TG4Trajectory> G4track,
819  ND::THandle<ND::TReconBase> object,
820  TLorentzVector& pos, TLorentzVector& posVar,
821  TVector3& dir, TVector3& dirVar, double& mom,
822  double& momErr);
823 
824  void FillKinematics(ND::THandle<ND::TReconState> state, TLorentzVector& pos,
825  TVector3& dir, double& mom, double& momErr,
826  double& charge, double (&cov)[7][7]);
827 
828  void FillKinematics(ND::THandle<ND::TReconState> state, TLorentzVector& pos,
829  TLorentzVector& posVar, TVector3& dir, TVector3& dirVar,
830  double& mom, double& momErr);
831 
832  double ComputeTrackLength(ND::THandle<ND::TReconBase> object);
833 
834  int ComputeParticleId(ND::THandle<ND::TReconPID> PID);
835 
836  void GetConstituentsInTracker(ND::THandle<ND::TReconBase> t1,
837  ND::TReconObjectContainer& trackerObjects);
838  bool IsTrackerOnly(ND::THandle<ND::TReconBase> t1);
840  const ND::TReconObjectContainer& globalObjects,
841  const ND::TReconObjectContainer& trackerObjects);
842 
843  ND::THandle<ND::TG4Trajectory> GetG4Trajectory(const ND::TReconBase& object,
844  double& pur, double& eff);
845  void GetHitsAssociatedToG4Trajectory(const ND::THitSelection& hits,
846  ND::THandle<ND::TG4Trajectory> traj,
847  ND::THitSelection& traj_hits);
848  void UpdateCoincidences(ND::THandle<ND::TMCHit> mch, ND::TMCDigit* mcdigit,
849  std::vector<int>& coinc, int& nhits);
850  ND::THandle<ND::TG4Trajectory> GetMainContributor(
851  ND::THandle<ND::TMCHit> mch,
852  ND::THandle<ND::TG4TrajectoryContainer> trajectories);
853 
854  void FillBrokenTracksMap(const ND::TReconObjectContainer& globalObjects);
855  bool GetBrokenIDs(ND::THandle<ND::TReconBase> object,
856  std::vector<UInt_t>& brokenIDs1,
857  std::vector<UInt_t>& brokenIDs2);
858 
859  // Keep track if recpack is initialized.
861 
862  std::vector<std::string> fALLMODULES;
863  HelixEquation fEquation; //!
864  dict::dictionary<int> fDetIndex; //!
865  surface_vector fDetSurfaces[NDETSEXTRAP]; //!
867 
869 
870  std::map<ND::THandle<ND::TReconBase>, int> fGlobalIndexMap; //!
871  std::map<ND::THandle<ND::TReconBase>, int> fTrackerGlobalIndexMap; //!
872 
873  std::map<ND::THandle<ND::TReconBase>, std::vector<UInt_t> >
875 
876  ND::THandle<ND::TReconBase> GetTrackerReconVersionOfFGDIsoTrack(
877  ND::THandle<ND::TReconBase> object);
878 
879  /// Method to find FGD constituent track from a matching object and fill
880  /// matchingFailure_flag
882  ND::THandle<ND::TReconBase> reco);
883 
884  /// A getter for TPC Datums to work both with TREx and TPC info
885  template <class T, typename I>
886  bool GetTPCDatum(ND::THandle<ND::TReconBase> object, const std::string& datum,
887  std::vector<I>& vector) const;
888 
889  public:
890  // this is just for tests
891  bool fTestTPCInfo; ///< For tests only.
892  Int_t fNTPCPIDs; ///< For tests only.
893  TClonesArray* fTPCPIDs; ///< For tests only (TTpcPID).
894 
895  //---- Actual information saved in the tree -----------------------------
896 
897  Int_t fNVertices; ///< The number of added primary vertices.
898  TClonesArray* fVertices; ///< The TGlobalVertex vector of vertices.
899  Int_t fNPIDs; ///< The number of global objects.
900  TClonesArray* fPIDs; ///< The vector of TGlobalPID.
901  Int_t fNTPCOthers; ///< The number of TPC other objects.
902  TClonesArray* fTPCOthers; ///< The vector of TPC other objects (TTPCOtherObject).
903  Int_t fNSFGClusters; ///< The number of SFG cluster objects.
904  TClonesArray* fSFGClusters; ///< The vector of SFG cluster objects.
905  Int_t fNP0DUnused; ///< Number of hits unused in the P0D.
906  TClonesArray* fP0DUnused; ///< The vector unused hits in the P0D (TGlobalHit).
907  Int_t fNSMRDTopUnused; ///< Number of hits unused in the SMRDTop.
908  Int_t fNSMRDBottomUnused; ///< Number of hits unused in the SMRDBottom.
909  Int_t fNSMRDLeftUnused; ///< Number of hits unused in the SMRDLeft.
910  Int_t fNSMRDRightUnused; ///< Number of hits unused in the SMRDRight.
911  Int_t fNSMRDUnused; ///< Number of all hits unused in the SMRD
912  TClonesArray* fSMRDUnused; ///< The vector unused hits in the SMRD (TSMRDHit).
913  Int_t fPVInd; ///< The last primary vertex index.
914  Int_t fNSVertices; ///< Number of added secondary vertices.
915  Int_t fNTPCUnused; ///< Number of hits unused in the TPC.
916  Int_t fNFGD1Unused; ///< Number of hits unused in the FGD1.
917  Int_t fNFGD2Unused; ///< Number of hits unused in the FGD2.
918  Int_t fNSFGUnused; ///< Number of hits unused in the SFG.
919 
920  // Int_t fNECALUnused; //! Number of hits unused in ECAL
921 
922  TOutermostHits fP0DOutermostHits; ///< Outermost hits in the P0D.
923  double
924  fEarliestTrackMedianHitTime; ///< Median hit time of the earliest track.
925 
926  // Information about unused FGD hits and outermost FGD hits is saved for each
927  // time bin
928 
929  Int_t fNFgdTimeBins; ///< Number of hit time bins in the FGD as determined by fgdRecon.
930  TClonesArray* fFgdTimeBins; ///< Information for each hit time bin (TFgdTimeBins).
931 
932  // Information about unused SFG hits is saved for each time bin
933 
934  Int_t fNSfgTimeBins; ///< Number of hit time bins in the SFG as determined by sfgRecon.
935  TClonesArray* fSfgTimeBins; ///< Information for each hit time bin (TSfgTimeBins).
936 
937  Int_t fNP0DECAL; ///< Number of objects containing the P0DECAL.
938  Int_t fNDsECAL; ///< Number of objects containing the DsECAL.
939  Int_t fNTrECAL; ///< Number of objects containing the TrECAL.
940  Int_t fNTPC; ///< Number of objects containing the TPC.
941  Int_t fNFGD; ///< Number of objects containing the FGD.
942  Int_t fNSFG; ///< Number of objects containing the SFG.
943  Int_t fNP0D; ///< Number of objects containing the P0D.
944  Int_t fNSMRD; ///< Number of objects containing the SMRD.
945  Int_t fNP0DECALIso; ///< Number of objects in the P0DECAL only.
946  Int_t fNTrECALIso; ///< Number of objects in the TrECAL only.
947  Int_t fNDsECALIso; ///< Number of objects in the DsECAL only.
948  Int_t fNTPCIso; ///< Number of objects in the TPC only.
949  Int_t fNFGDIso; ///< Number of objects in the FGD only.
950  Int_t fNSFGIso; ///< Number of objects in the SFG only.
951  Int_t fNP0DIso; ///< Number of objects in the P0D only.
952  Int_t fNSMRDIso; ///< Number on objects in the SMRD only.
953 
954 };
955 #endif
Int_t fNP0DECAL
Number of objects containing the P0DECAL.
double PIDWeightMuon
PID weights for muon hypothesis.
void FillSMRDInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
const int NDETSUSED
double PullPion
The FGD PID pull value for a pion.
double LLR_MIP_EM
Value to separate MIP-like objects (e.g. muons) from EM showers e.g. photons/electrons). -9999 indicates an error.
bool IsTrackLike(ND::THandle< ND::TReconBase > object)
TGlobalHit hackFGDUnused
This is just here to fool TFile::MakeProject, not a real object.
double PIDWeightProt
PID weights for proton hypothesis.
void FillGlobalPIDAlternates(ND::THandle< ND::TG4Trajectory > G4track, ND::THandle< ND::TReconBase > object, TGlobalPID &globalObject)
void FillGlobalHit(ND::THandle< ND::THit > hit, TGlobalHit &gHit)
double dEdxexpMuon
Estimated dE/dx for muon hypothesis.
double Length
The length of the track or shower, its value depends on if the object is reconstructed as track-like ...
void GetConstituentsInTracker(ND::THandle< ND::TReconBase > t1, ND::TReconObjectContainer &trackerObjects)
TVector3 BackDirection
The direction of the object.
int ExitOK[NDETSEXTRAP]
Status of the subdetector exit.
Int_t NECALs
Number of ECAL objects.
void FillP0DInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
double Quality
The quality of the fit.
double PID_TruncatedMaxRatio
A truncated Max Ratio. See ecalRecon docs for the full definition.
Int_t NTRACKERs
Number of Tracker objects.
double RangeMomentumEndToTPCProton
the momentum by range for the proton hypothesis (from end to a TPC)
TGlobalPIDAlternate hackGlobalPIDAlternate
This is just here to fool TFile::MakeProject, not a real object.
float chargePerLayer[2][30]
Summed hit charge for layer x in FGD1 (chargePerLayer[0][x]), and 2 (chargePerLayer[1][x]) ...
double PullMuon
The FGD PID pull value for a muon.
double PullElectron
The FGD PID pull value for an electron.
TLorentzVector Position
The position of the vertex.
Int_t fNSMRDRightUnused
Number of hits unused in the SMRDRight.
TClonesArray * Constituents
Constituent tracks.
An object to describe a reconstructed PID.
UInt_t UniqueID
Unique identifier for global recon objects (needed fro broken association)
double SigmaEle
Sigma estimated width of TPC pid electron hypothesis.
int NDOF
The number of degrees of freedom.
TLorentzVector BackPosition
The position of the object.
double fgdEA_verNextNextNearQ_rect
FGD end activity values.
double fgdVA_verNearQ
FGD vertex activity values.
double LLR_MIP_EM_LowMomentum
UNSTABLE: A combined discriminator for separating MIPs from EM showers. This is similar to LLR_MIP_EM...
double RangeMomentumEndToTPCPion
the momentum by range for the pion hypothesis (from end to a TPC)
double ExitMomentumErr[NDETSEXTRAP]
The error of the momentum of the object at the exit of each subdetector.
virtual void InitializeBranches()
Initialize Branches. Don&#39;t do anything else in this function.
double FrontMomentumError
the error on the momentum of the object
double fgdVA_totalQ
FGD vertex activity values.
std::vector< int > fgdhits_TrajID
Vector to store the ID of the Trajectory that created the hit.
TClonesArray * FGD2Unused
The vector unused hits in FGD2.
std::vector< int > TPCGasPathIDs
The IDs of the TREx paths which contributed to the object.
TLorentzVector BackPosition
The position of the object.
std::vector< std::string > fALLMODULES
std::vector< float > SFGHitPositionX
Vector to store the Xposition of each hit in SFG.
ClassDef(TGlobalReconModule::TSMRDObject, 1)
Int_t NDsECALs
Number of DsECAL objects.
void FillUnusedHits(ND::TND280Event &event)
std::vector< float > SFGHitPositionY
Vector to store the Y position of each hit in SFG.
TLorentzVector PositionVarAtTrueVertex
The position variance at the true vertex.
const int NDETSEXTRAP
For questions or suggestions about this module please contact the current responsible and CC in the e...
Int_t NFGDs
Number of FGD objects.
double fgdEA_verNearQ_rect
FGD end activity values.
int g4ID
The ID for the G4 trajectory that contributed most to this time bin.
double RangeMomentumProton
the momentum by range for the proton hypothesis
virtual Bool_t ProcessFirstEvent(ND::TND280Event &event)
Is called after the first event is loaded in.
unsigned long Detectors
Detectors used, defined according to the formula in GetDetectorNumber.
Int_t NSFGUnused
Number of hits unused in SFG.
int OuterMostLayerHit
Zero-indexed layer number of tracker-farthest layer with an ECal hit belonging to this object...
double SigmaPion
Sigma estimated width of TPC pid pion hypothesis.
OA_EXCEPTION(EeventAnalysis, EoaCore)
Generate a base exception for the Analysis library.
An object to describe a reconstructed PID.
TTrueParticle TrueParticle
The true particle.
double ComputeTrackLength(ND::THandle< ND::TReconBase > object)
double Chi2
The chi2 of the fit.
TClonesArray * fVertices
The TGlobalVertex vector of vertices.
TVector3 FrontDirection
The direction of the object.
ClassDef(TGlobalReconModule::TOutermostHits, 1)
void FillDetectorUsed(ND::THandle< ND::TReconBase > object, bool dets[])
int NegPionBraggCut
Bragg peak cut (only used for SFGD contained tracks)
void FillTrueParticle(ND::THandle< ND::TG4Trajectory > G4track, double pur, double eff, ND::TTrueParticle &part)
std::vector< std::vector< int > > NodeUniqueID
Vector to store the Unique ID of the node.
void FillSfgTimeBins(ND::TND280Event &event)
double fgdVA_verQ
FGD vertex activity values.
TLorentzVector BackPosition
The position of the object.
double LLR_MIP_Pion
Value to separate MIP-like objects (e.g. muons) from showering pions. -9999 indicates an error...
int EntranceOK[NDETSEXTRAP]
Status of the subdetector entrance.
double fgdVA_verNextNearQ
FGD vertex activity values.
TLorentzVector BackPositionVar
The position variance;.
bool GetIncomingParticle(const ND::TG4PrimaryVertex &G4vertex, ND::TG4PrimaryParticle &incoming)
TClonesArray * fSFGClusters
The vector of SFG cluster objects.
int GetTrackerDetectorNumber(ND::THandle< ND::TReconBase > object)
TVector3 DirectionVarAtTrueVertex
The direction variance at the true vertex.
bool IsTrackerOnly(ND::THandle< ND::TReconBase > t1)
ClassDef(TGlobalReconModule::TGlobalPIDAlternate, 1)
void FillFgdTimeBins(ND::TND280Event &event)
TVertexConstituent hackVertexConstituentObject
This is just here to fool TFile::MakeProject, not a real object.
std::vector< int > TPCGasPatternIDs
Variables to get the association between the global track and the gas ouptut involved The vectorS of ...
std::vector< std::vector< int > > HitUniqueID
Vector to store the Unique ID of the hit.
TVector3 FrontDirection
The direction of the object.
Int_t fNDsECAL
Number of objects containing the DsECAL.
An object to hold specific TPC variables.
std::vector< float > FGD1HitT
Vector to store the time of each hit in FGD1.
double BackMomentum
the momentum of the object
double MomentumAtTrueVertex
Momentum at the true vertex.
TVector3 DirectionAtTrueVertex
Direction at the true vertex.
std::map< ND::THandle< ND::TReconBase >, int > fTrackerGlobalIndexMap
std::vector< float > FGD1HitPosition
Vector to store the X or Y position of each hit in FGD1.
int TrackType
Record of why the track was refit with a kalman filter fit instead of the likelihood fit...
std::vector< TVector3 > NodeDirVariance
Vector to store the variance on the direction of each node.
int PionBraggCut
Bragg peak cut (only used for SFGD contained tracks)
int CountDetector(ND::THandle< ND::TReconBase > object)
bool GetTPCDatum(ND::THandle< ND::TReconBase > object, const std::string &datum, std::vector< I > &vector) const
A getter for TPC Datums to work both with TREx and TPC info.
Int_t fNTPCOthers
The number of TPC other objects.
Int_t NSFGs
Number of SFG objects.
double RangeMomentumEndToTPCMuon
the momentum by range for the muon hypothesis (from end to a TPC)
double fgdEA_verQ
FGD end activity values.
double BackMomentum
the momentum of the object
double avgtime
Averaged corrected node time.
std::vector< int > NodeNHits
Vector to store the number of hits contributing to each node.
std::vector< std::pair< unsigned long, TVector2 > > NodeTimes
vector of pairs, sub-detecor number and time-stamps of edge nodes in this subdetector ...
void CheckMatchingFailure(TTrackerObject *result, ND::THandle< ND::TReconBase > reco)
Method to find FGD constituent track from a matching object and fill matchingFailure_flag.
An object to hold specific TRACKER variables.
int ComputeParticleId(ND::THandle< ND::TReconPID > PID)
TClonesArray * fFgdTimeBins
Information for each hit time bin (TFgdTimeBins).
std::vector< float > SFGHitPositionZ
Vector to store the X or Y position of each hit in SFG.
ClassDef(TGlobalReconModule::TGlobalVertex, 1)
Int_t fNP0D
Number of objects containing the P0D.
TLorentzVector ExitPosition[NDETSEXTRAP]
The position of the object at the exit of each subdetector.
void FillSFGInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
void FillTPCPID(ND::THandle< ND::TReconBase > object)
std::vector< TLorentzVector > HitPosition
TClonesArray * fP0DUnused
The vector unused hits in the P0D (TGlobalHit).
double PID_ShowerAngle
The angle from the start of an object to its width at its charge centre.
An object to store hit information for the SMRD subdetector.
double SigmaMuon
Sigma estimated width of TPC pid muon hypothesis.
double Length
The length of the track or shower (RMS)
double FrontCharge
the charge of the object at the first state
TClonesArray * HitsSaved
the two first and two last hits (TGlobalHit).
TClonesArray * TRACKER
Tracker specific variables.
double RangeMomentumMuonFlip
the momentum by range for the flipped muon hypothesis
void UpdateCoincidences(ND::THandle< ND::TMCHit > mch, ND::TMCDigit *mcdigit, std::vector< int > &coinc, int &nhits)
TLorentzVector FrontPosition
The position of the object.
int NConstituents
The number of constituents.
double PullProton
Pull for TPC pid proton hypothesis.
double TrueE
True energy in an FGD.
TVector3 FrontDirectionVar
The direction variance of the object.
double SigmaKaon
Sigma estimated width of TPC pid kaon hypothesis.
bool fPassedDetector[NDETSEXTRAP]
unsigned long GetDetectorNumber(ND::THandle< ND::TReconBase > object)
void FillTPCObject(ND::THandle< ND::TReconBase > object, TTPCObject &sub, int det)
std::vector< float > FGD2HitT
Vector to store the time of each hit in FGD2.
Int_t fNTrECALIso
Number of objects in the TrECAL only.
Int_t fPVInd
The last primary vertex index.
double MomentumAtTrueVertex
The momentum at the true vertex.
Int_t fNTPC
Number of objects containing the TPC.
TVector3 FrontDirection
The Front direction of the object.
TLorentzVector ExitPositionErr[NDETSEXTRAP]
The error of the position of the object at the exit of each subdetector.
double Momentum
the momentum of the object
TClonesArray * fSfgTimeBins
Information for each hit time bin (TSfgTimeBins).
TLorentzVector Position
Position of the correspponding object.
double LLR_MIP_HIP_VACut
UNSTABLE: Only filled for FilledAsType == 2 Recalculates PID variables for a vertex track where the X...
TLorentzVector PosVariance
Variance on the position of the corresponding object.
TTrueVertex hackTrueVertexObject
This is just here to fool TFile::MakeProject, not a real object.
std::vector< double > PIDWeight
The weights for the PID hypotheses, c.f. TP0DObject::ParticleId.
double FrontMomentumError
the error on the momentum of the object
Int_t fNSFGClusters
The number of SFG cluster objects.
Int_t fNVertices
The number of added primary vertices.
bool GetBrokenIDs(ND::THandle< ND::TReconBase > object, std::vector< UInt_t > &brokenIDs1, std::vector< UInt_t > &brokenIDs2)
An object to store subdetector-agnostic hit information.
int Charge
Charge of the constituent track.
void FillKinematics(ND::THandle< ND::TReconState > state, TLorentzVector &pos, TVector3 &dir, double &mom, double &momErr, double &charge, double(&cov)[7][7])
double PEField
Placeholder for momentum of EField refit.
ClassDef(TGlobalReconModule::TFGDObject, 1)
FGD Node Energy Deposits.
double sigmaE_pion
Expected energy uncertainty for a pion.
double MomentumAtTrueVertex
Momentum at the true vertex.
TVector3 chargeWeightedPos[2]
Charge weighted average hit position in FGD1 chargeWeightedPos[0]) and 2 (chargeWeightedPos[1]) ...
int ParticleId
the PDG code obtained in the recon combined PID
double PID_Circularity
The circularity of the object.
double avgtime
Average fully corrected SFG hit time.
int NDOF
For Vertices created using -O TGlobalReconModule=UseECalVertices the quality denotes.
double BackMomentumError
the error on the momentum of the object
void FillConfigTree(TTree *configTree)
Int_t fNFgdTimeBins
Number of hit time bins in the FGD as determined by fgdRecon.
TClonesArray * TPC
TPC specific variables.
std::vector< float > FGD2HitQ
Vector to store the charge of each hit in FGD2.
unsigned long Detectors
Detectors used, defined according to the algorithm in GetDetectorNumber.
TECALObject hackECALObject
This is just here to fool TFile::MakeProject, not a real object.
int PrimaryIndex
The index of the corresponding primary vertex.
ND::THandle< ND::TG4Trajectory > GetG4Trajectory(const ND::TReconBase &object, double &pur, double &eff)
TGlobalHit hitMaxZ
Hit with highest Z position.
double RangeMomentumEndToTPCElectron
the momentum by range for the electron hypothesis (from end to a TPC)
double BackCharge
the momentum of the object at the back state
TLorentzVector EntrancePosition[NDETSEXTRAP]
The position of the object at the entrance of each subdetector.
double fgdEA_verNextNearQ_rect
FGD end activity values.
double E_exp_electron
Expected energy deposit for an electron.
std::vector< int > fgdhits_Layer
Vector to store the layer number of each hit.
double sigmaE_muon
Expected energy uncertainty for a muon.
double ChargeAtTrueVertex
Charge at the true vertex.
TClonesArray * fTPCOthers
The vector of TPC other objects (TTPCOtherObject).
double Containment
Containment: contained = 1.0, not-contained = 0.0, default = -1.0. An object is classed as contained ...
double PID_Angle
The zenith angle with respect to each detector.
dict::dictionary< int > fDetIndex
double EDeposit
The deposited charge for the object.
TVector3 Direction
Direction of the corresponding object.
Int_t fNTPCUnused
Number of hits unused in the TPC.
bool DetectorUsed[NDETSUSED]
Detectors used (NDETSUSED = 23)
TVector3 BackDirectionVar
The direction variance of the object.
double Length
The total length of the object.
int NbFittedHorizontalClusters
The number of horizontal clusters contributed to the fit, TREx.
ClassDef(TGlobalReconModule::TECALObject, 2)
double FrontMomentum
the momentum of the object
double Charge
Charge from the TPC pid (+1, or -1)
int Layer
SMRD hit layer number.
Int_t fNFGD
Number of objects containing the FGD.
double EMEnergyFit_Uncertainty
The uncertainty of the EM energy fit to the cluster.
double fgdVA_verNextNextNearQ_rect
FGD vertex activity 2x7.
TVector3 EntranceDirection[NDETSEXTRAP]
The direction of the object at the entrance of each subdetector volume.
TSFGObject hackSFGObject
This is just here to fool TFile::MakeProject, not a real object.
double MomentumErrorAtTrueVertex
Error of the momentum at the true vertex.
Int_t fNTPCIso
Number of objects in the TPC only.
void FillTPCInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
double MomentumErrorAtTrueVertex
The error of the momentum at the true vertex.
An object to hold specific FGD variables.
double EntranceMomentum[NDETSEXTRAP]
The momentum of the object at the entrance of each subdetector.
std::vector< int > FGD1HitLayer
Vector to store the layer number of each hit in FGD1.
double fgdEA_verNextNearQ
FGD end activity values.
double fgdEA_verNextNextNearQ
FGD end activity values.
double PID_TransverseChargeRatio
A variable sensitive to the charge distribution in the plane transverse to a shower/track direction...
double PullNotSet
PullNotSet = 1 if the pull is not set, and 0 otherwise.
TClonesArray * FGD1Unused
The vector unused hits in FGD1.
double PDist
Placeholder for momentum of BField refit.
int Type
Vertex type (0: Global vertex | 1: SFG vertex)
double fgdEA_verLayQ
FGD end activity values.
int PID
The TGlobalPID of the constituent track.
Int_t fNSFG
Number of objects containing the SFG.
Int_t fNPIDs
The number of global objects.
double PullProton
The FGD PID pull value for a proton.
ClassDef(TGlobalReconModule::TSfgTimeBin, 1)
std::vector< TLorentzVector > NodePosition
Vector to store the position and time of each node.
TVector3 DirVariance
Direction variance of the corresponding object.
double PullKaon
Pull for TPC pid kaon hypothesis.
Int_t fNTrECAL
Number of objects containing the TrECAL.
Int_t fNSMRD
Number of objects containing the SMRD.
Int_t fNSFGIso
Number of objects in the SFG only.
TClonesArray * fSMRDUnused
The vector unused hits in the SMRD (TSMRDHit).
Describes a reconstructed ECalObject.
double fgdVA_verNearQ_rect
FGD vertex activity 2x3.
Int_t fNSMRDLeftUnused
Number of hits unused in the SMRDLeft.
ND::THandle< ND::TReconBase > GetTrackerReconVersionOfFGDIsoTrack(ND::THandle< ND::TReconBase > object)
Int_t NSMRDs
Number of SMRD objects.
TClonesArray * SFG
SFG specific variables.
double fgdVA_otherUpQ
FGD vertex activity values.
Int_t NHitsSaved
Number of entries in the HitsSaved array.
ClassDef(TGlobalReconModule::TSFGObject, 1)
std::vector< std::vector< int > > NodeHits
Vector to store the hits contributing to each node.
bool DetectorUsed[NDETSUSED]
Detectors used. Index order from 0 to 26.
An object to describe a reconstructed PID.
std::vector< int > T0Source
The T0Source, the values are defined in TTPCFitStatusBranch.hxx, the TTPCT0Source enumeration...
Int_t fNSMRDTopUnused
Number of hits unused in the SMRDTop.
double MedianObjectTime(ND::THandle< ND::TReconBase > object)
std::vector< int > ParticleIds
the PDG codes obtained in the recon combined PID
void FillFirstLastHits(ND::THitSelection &hits, TGlobalPID &globalObject)
double Ccorr
Corrected truncated mean charge deposit in PID.
void FillAllHits(ND::THitSelection &hits, TGlobalPID &globalObject)
TSMRDObject hackSMRDObject
This is just here to fool TFile::MakeProject, not a real object.
This module summarizes the information from global reconstruction.
double fgdVA_totalCorrE
FGD vertex activity values.
Int_t NP0DECALs
Number of P0DECAL objects.
std::vector< TLorentzVector > NodePosition
FGD Node positions.
double x
Distance traveled in an FGD.
TVector3 Momentum
3-momentum of the constituent track
An object to hold a reconstructed vertex constituent track.
TVector3 ExitDirection[NDETSEXTRAP]
The direction of the object at the exit of each subdetector.
ClassDef(TGlobalReconModule::TGlobalPID, 1)
TGlobalHit hackSFGUnused
This is just here to fool TFile::MakeProject, not a real object.
TVector3 ExitDirectionErr[NDETSEXTRAP]
The error of the direction of the object at the exit of each subdetector.
std::vector< int > NHorRows
The number of horizontal clusters in the track.
double BackStateCov[7][7]
full covariance matrix for last state: pos, dir, qp
TP0DObject hackP0DObject
This is just here to fool TFile::MakeProject, not a real object.
double RangeMomentumPion
the momentum by range for the pion hypothesis
ClassDef(TGlobalReconModule::TP0DObject, 1)
std::vector< int > HitTrajID
Vector to store the ID of the Trajectory that created the hit.
An object to described a P0D shower.
ND::THandle< ND::TG4Trajectory > GetMainContributor(ND::THandle< ND::TMCHit > mch, ND::THandle< ND::TG4TrajectoryContainer > trajectories)
double Chi2
The chi2 of the fit.
void FillSFGOther(ND::TND280Event &event)
void FillGlobalPIDAlternate(ND::THandle< ND::TG4Trajectory > G4track, ND::THandle< ND::TReconBase > object, TGlobalPIDAlternate &PIDAlternate)
double EDeposit
Deposited energy. Its value depends on if the object is reconstructed as track-like or shower-like If...
TClonesArray * SMRD
SMRD specific variables.
double E_exp_pion
Expected energy deposit for a pion.
std::vector< TLorentzVector > NodePosition
Int_t fNP0DECALIso
Number of objects in the P0DECAL only.
An object to hold specific SMRD variables.
std::vector< float > fgdhits_Charge
Vector to store the charge of each hit.
std::vector< double > PIDWeights
the PID likelihoods for combined PID
double EMEnergyFit_Result
The result from the EM energy fit to the cluster.
int Type
Object type, 0: Particle, 1: Track, 2: Cluster, 3: Shower, 4: Vertex.
int ProtonBraggCut
Bragg peak cut (only used for SFGD contained tracks)
double PIDWeightElec
PID weights for electron hypothesis.
std::vector< double > NodeEDeposit
Vector to store the energy deposit of each node.
double sigmaE_proton
Expected energy uncertainty for a proton.
double fgdEA_verNearQ
FGD end activity values.
TGlobalHit hitMinX
Hit with lowest X position.
double avgtime
Average fully corrected FGD hit time.
TVector3 DirectionVarAtTrueVertex
The direction variance at the true vertex.
double RangeMomentumPionFlip
the momentum by range for the flipped pion hypothesis
const int NTIMEBINS
ClassDef(TGlobalReconModule::TTPCOtherObject, 1)
TVector3 Width
TrackShower width Filled depending on FilledAsShower. * Track: ND::TReconTrack::GetWidth * Shower: Al...
void SayAvailableOpts(std::string indent="")
Subclasses should override this to let a user know what options are available.
std::vector< int > FGD2HitLayer
Vector to store the layer number of each hit in FGD2.
Int_t fNFGDIso
Number of objects in the FGD only.
void FillVertexInfo(ND::TND280Event &event, ND::THandle< ND::TReconObjectContainer > globalObjects)
std::vector< TVector3 > NodeDirection
Vector to store the direction of each node.
virtual bool FillTree(ND::TND280Event &)
Fill all the stuff that goes in the output tree.
double PullPion
Pull for TPC pid pion hypothesis.
TClonesArray * FGD
FGD specific variables.
TVector3 Position
Hit position in global ND coordinates [mm].
Int_t NFGD2Unused
Number of hits unused in FGD2.
TVector3 BackDirection
The direction of the object.
void FillOutermostHits(ND::THitSelection &hits, double charge_cut, TOutermostHits &outer)
ClassDef(TGlobalReconModule::TVertexConstituent, 1)
double FrontMomentum
the momentum of the object
bool IsCurvBack
A curving-back object.
double PID_Asymmetry
Ratio of the big width of an object by its small width.
Int_t NTrECALs
Number of TrECAL objects.
ND::THandle< ND::TG4PrimaryVertex > GetG4Vertex(const ND::TReconBase &object, double &pur, double &eff)
unsigned long Status
The status for the fit.
TVector3 BackDirectionVar
The direction variance of the object.
Int_t fNFGD1Unused
Number of hits unused in the FGD1.
void DoAssociationBetweenTrackerAndGlobalObjects(const ND::TReconObjectContainer &globalObjects, const ND::TReconObjectContainer &trackerObjects)
double dEdxexpPion
Estimated dE/dx for pion hypothesis.
virtual void InitializeModule()
Initialize Module, override if necessary.
TLorentzVector PositionVarAtTrueVertex
The position variance at the true vertex.
TVector3 DirectionAtTrueVertex
Direction at the true vertex.
TVector3 FrontDirectionVar
The direction variance of the object.
double EDeposit
The deposited charge for the object.
std::vector< float > SFGHitT
Vector to store the time of each hit in SFG.
std::string AlgorithmName
The name of the algorithm that created this object.
TClonesArray * P0D
P0D specific variables.
An object to store the outermost hits in x,y, and z.
TLorentzVector FrontPosition
The Front position of the object.
void GetFGDSimpleVA(ND::TND280Event &event, ND::THandle< ND::TReconBase > &object, TLorentzVector &vertexPos, int globpass, int vaea)
double fgdVA_downMaxZ
FGD vertex activity values.
void FillTrackerInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
double fgdVA_downCosTheta
FGD vertex activity values.
TOutermostHits FGD2OutermostHits
A named collection of the outermost hits in X,Y, and Z from FGD2.
double PullMuon
Pull for TPC pid muon hypothesis.
void FillFGDInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
TLorentzVector FrontPositionVar
The position variance;.
std::map< ND::THandle< ND::TReconBase >, int > fGlobalIndexMap
Describes a true G4 particle associated to a TGlobalPID.
double MomentumErrorAtTrueVertex
The momentum variance at the true vertex.
const int NSVERTICES
double E_exp_proton
Expected energy deposit for a proton.
std::vector< int > ParticleId
A vector of potential PIDs, sorted by weight, c.f. TP0DObject::PIDWeight.
double dEdxexpProton
Estimated dE/dx for proton hypothesis.
double fgdEA_otherDownQ
FGD end activity values.
int NDOF
The number of degrees of freedom.
int FilledAsType
Whether the object was filled as a shower (or a track.). This is NOT a PID. This lets you know how so...
void FillTrueVertex(bool, const ND::TG4PrimaryVertex &G4vertex, double pur, double eff, ND::TTrueVertex &vertex)
TClonesArray * ECAL
ECAL specific variables.
double BackMomentumError
the error on the momentum of the object
int Type
The hit &#39;type&#39;: (0=X,1=Y,2=Z)
An object to store information about an SFG Time Bin.
int GetNumberOfHits(ND::THandle< ND::TReconBase > object)
double BackMomentum
the momentum of the object
TClonesArray * Alternates
List of alternate hypotheses.
std::vector< UInt_t > BrokenUniqueIDs
the broken partners unique IDs
std::vector< double > HitCharge
Vector to store the charge of each hit.
std::string AlgorithmName
The name of the algorithm that created this object.
An object to hold specific TPC variables.
double PullEle
Pull for TPC pid electron hypothesis.
Int_t fNDsECALIso
Number of objects in the DsECAL only.
TLorentzVector EntrancePositionErr[NDETSEXTRAP]
The error of the position of the object at the entrance of each subdetector.
TVector3 BackDirection
The Back direction of the object.
unsigned long Status
The status for the fit, from: object-&gt;CheckStatus(object-&gt;kSuccess).
std::vector< int > SFGHitTrajID
Vector to store the ID of the Trajectory that created the hit in SFG.
void FillECALInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
TVector3 Cone
The opening angles of the cone (only for showers)
TClonesArray * fTPCPIDs
For tests only (TTpcPID).
TTPCObject hackTPCObject
This is just here to fool TFile::MakeProject, not a real object.
TLorentzVector PositionAtTrueVertex
Position at true vertex.
double AverageHitTime
The charged weighted average time for the ECal cluster.
double E_exp_muon
Expected energy deposit for a muon.
double PIDWeight
the PID weight for this hypothesis
TGlobalHit hitMinY
Hit with lowest Y position.
bool fTestTPCInfo
For tests only.
TGlobalHit hitMaxX
Hit with highest X position.
bool FillVertex(ND::TND280Event &event, ND::THandle< ND::TReconVertex > vertex, bool primary)
int fgdContainment
Fully contained PID information.
int InnerMostLayerHit
Zero-indexed layer number of tracker-closest layer with an ECal hit belonging to this object...
double PID_FrontBackRatio
The ratio of the charge in equal length blocks at each end of the track.
double RangeMomentumElectronFlip
the momentum by range for the flipped electron hypothesis
double dEdxexpKaon
Estimated dE/dx for kaon hypothesis.
double fgdVA_verNextNearQ_rect
FGD vertex activity 2x5.
double Width
The width of the shower (perpendicular to the direction).
double fgdEA_otherUpQ
FGD end activity End (1) or Exit (2)
TTrackerObject hackTrackerObject
This is just here to fool TFile::MakeProject, not a real object.
int Type
The hit &#39;type&#39;: (0=X,1=Y,2=Z)
ClassDef(TGlobalReconModule::TSMRDHit, 1)
TClonesArray * P0DECAL
P0DECAL specific variables.
Int_t fNSMRDBottomUnused
Number of hits unused in the SMRDBottom.
double EntranceMomentumErr[NDETSEXTRAP]
The error of the momentum of the object at the entrance of each subdetector.
std::vector< float > FGD2HitPosition
Vector to store the X or Y position of each hit in FGD2.
ClassDef(TGlobalReconModule::TGlobalHit, 1)
Int_t fNSMRDUnused
Number of all hits unused in the SMRD.
int NConstituents
The number of constituents.
std::vector< float > fgdhits_Time
Vector to store the time of each hit.
Int_t fNSVertices
Number of added secondary vertices.
Int_t fNFGD2Unused
Number of hits unused in the FGD2.
TVector3 chargeWeightedPos
Charge weighted average hit position in SFG.
double BackMomentumError
the error on the momentum of the object
Int_t fNP0DIso
Number of objects in the P0D only.
TLorentzVector PositionAtTrueVertex
Position at the true vertex.
double Length
The length of the track or shower (RMS)
int NDOF
The number of degrees of freedom.
std::map< ND::THandle< ND::TReconBase >, std::vector< UInt_t > > fBrokenIndexMap
An object to hold specific SFG variables.
TLorentzVector BackPositionVar
The position variance;.
TTrueParticle TrueParticle
The true particle.
void MatchTrueVertex(ND::THandle< ND::TG4PrimaryVertexContainer > g4PrimVert)
double LLR_Quality
PID quality flag. A non-zero indicates an bad quality. If this value is non-zero the PID values are s...
double PIDWeightPion
PID weights for pion hypothesis.
double FrontStateCov[7][7]
full covariance matrix for front state: pos, dir, qp
TVector3 ThrustOrigin
The origin point of the thrust.
TLorentzVector PositionAtTrueVertex
The position at the true vertex.
double SigmaProton
Sigma estimated width of TPC pid proton hypothesis.
TOutermostHits FGD1OutermostHits
A named collection of the outermost hits in X,Y, and Z from FGD1.
double AverageZPosition
Unweighted average Z position of object-constituent hits.
std::vector< TLorentzVector > HitPosition
Vector to store the position of each hit.
Int_t fNTPCPIDs
For tests only.
TLorentzVector FrontPosition
The position of the object.
std::vector< int > FGD2HitTrajID
Vector to store the ID of the Trajectory that created the hit in FGD1.
double FrontMomentumError
the error on the momentum of the object
void FillSubBaseObject(ND::THandle< ND::TReconBase > object, TSubBaseObject &sub, int det)
double RangeMomentumProtonFlip
the momentum by range for the flipped proton hypothesis
bool IsFgdECalIncremental
A track created by FGD-ECal matching algorithm.
std::vector< TLorentzVector * > ExitPosition
the position of the object at the exit of each subdetector
double fgdVA_upMinZ
FGD vertex activity Vertex (1) or Entrance (2)
std::string GetObjectType(ND::THandle< ND::TReconBase > object)
double RangeMomentumMuon
the momentum by range for the muon hypothesis
double StateCovAtTrueVertex[7][7]
Full covariance matrix for the state: pos, dir, qp at the true vertex.
void FillBrokenTracksMap(const ND::TReconObjectContainer &globalObjects)
double fEarliestTrackMedianHitTime
Median hit time of the earliest track.
int Wall
SMRD wall number, 0=Top, 1=Bottom, 2= Right, 3= Left.
double Quality
Quality (chi2) of the constituent track.
TVector3 PositionError
The variance on ND::TGlobalReconModule::TSMRDHit::Position [mm].
std::vector< int > TPCGasJunctionIDs
The IDs of the TREx junctions which contributed to the object.
double sigmaE_electron
Expected energy uncertainty for an electron.
double fgdVA_upCosTheta
FGD vertex activity values.
ClassDef(TGlobalReconModule::TTrackerObject, 1)
An object to describe the true G4 vertex associated to the TGlobalVertex.
Definition: TTrueVertex.hxx:14
std::vector< float > FGD1HitTrueE
Vector to store the true edeposit of each hit in FGD1.
void FillTPCOther(ND::TND280Event &event)
TVector3 EntranceDirectionErr[NDETSEXTRAP]
The error of the direction of the object at the entrance of each subdetector.
Int_t NFGD1Unused
Number of hits unused in FGD1.
double LLR_EM_HIP
Value to separate light tracks/MIP-like objects (e.g. muons) from heavy tracks / Highly-ionising part...
std::string AlgorithmName
The name of the algorithm that created this object.
TVector3 BackDirection
The direction of the object.
An object to store information about an FGD Time Bin.
TOutermostHits fP0DOutermostHits
Outermost hits in the P0D.
ClassDef(TGlobalReconModule::TTpcPID, 1)
void CheckFGDdist(TLorentzVector &FGDPos, TVector3 fFGDActiveMin, TVector3 fFGDActiveMax)
TGlobalReconModule(const char *name="Global", const char *title="Global Recon Module")
Default Constructor.
double RangeMomentumElectron
the momentum by range for the electron hypothesis
void FillP0DECALInfo(ND::THandle< ND::TReconBase > object, TGlobalPID &pid)
double fgdVA_otherDownQ
FGD vertex activity values.
double rawChargeSum
Summed hit charge in SFG.
const int NCONSTITUENTS
TClonesArray * TrueVertices
The true vertex.
Provides data members common to reconstructed showers from all sub detectors.
double rawChargeSum[2]
Summed hit charge in FGD1 (rawChargeSum[0]), and 2 (rawChargeSum[1])
void FillExtrapolationToDetectors(ND::THandle< ND::TReconBase > object, TGlobalPID &globalObject)
Int_t fNSFGUnused
Number of hits unused in the SFG.
int nHits[2]
Number of hits in FGD1 (nHits[0]), and 2 (nHits[1])
std::vector< float > SFGHitQ
Vector to store the charge of each hit in SFG.
TVector3 Position
Hit position in global ND coordinates [mm].
Provides data members common to reconstructed objects from all sub detectors.
TGlobalHit hitMaxY
Hit with highest Y position.
TClonesArray * fPIDs
The vector of TGlobalPID.
TVector3 FrontDirection
The direction of the object.
std::vector< TVector3 > fgdhits_Position
Vector to store the X or Y position of each hit.
void FillGlobalPIDs(ND::TND280Event &event, ND::THandle< ND::TReconBase > object)
std::vector< int > NVerRows
The number of vertical clusters in the track.
double ExitMomentum[NDETSEXTRAP]
The momentum of the object at the exit of each subdetector.
TVector3 Cone
The opening angles of the cone (only for showers)
double FrontMomentum
the momentum of the object
An object to describe a reconstructed primary vertex candidate.
double fgdVA_verLayQ
FGD vertex activity values.
std::vector< float > FGD1HitQ
Vector to store the charge of each hit in FGD1.
std::vector< TLorentzVector * > EntrancePosition
the position of the object at the entrance of each subdetector
ND::THandle< ND::TG4Trajectory > GetParent(ND::THandle< ND::TG4Trajectory > G4track)
Int_t fNSMRDIso
Number on objects in the SMRD only.
TLorentzVector FrontPosition
the PID likelihoods for combined PID
Int_t NTPCs
Number of TPC objects.
void FillKinematicsAtTrueVertex(ND::THandle< ND::TG4Trajectory > G4track, ND::THandle< ND::TReconBase > object, TLorentzVector &pos, TVector3 &dir, double &mom, double &momErr, double &charge, double(&cov)[7][7])
TVector3 PositionError
The variance on ND::TGlobalReconModule::TGlobalHit::Position [mm].
TVector3 DirectionAtTrueVertex
The direction at the true vertex.
Int_t fNP0DUnused
Number of hits unused in the P0D.
TGlobalHit hitMinZ
Hit with lowest Z position.
unsigned long Status
The status for the fit.
void FillSmrdHit(ND::THandle< ND::THit > hit, TSMRDHit &smrdHit)
unsigned long Detectors
Detectors used.
int g4ID
The ID for the G4 trajectory that contributed most to this time bin.
TLorentzVector FrontPositionVar
The position variance;.
TLorentzVector Variance
The position variance;.
std::vector< TLorentzVector > HitPosVariance
Vector to store the variance of the position of each hit.
double E
Measured energy in an FGD.
double dEdxexpEle
Estimated dE/dx for electron hypothesis.
std::vector< TLorentzVector > NodePosVariance
Vector to store the variance on the position and time of each node.
double Width
The width of the shower (perpendicular to the direction)
surface_vector fDetSurfaces[NDETSEXTRAP]
std::vector< int > FGD1HitTrajID
Vector to store the ID of the Trajectory that created the hit in FGD1.
double fgdVA_verNextNextNearQ
FGD vertex activity values.
Int_t NP0Ds
Number of P0D objects.
ClassDef(TGlobalReconModule::TTPCObject, 1)
TOutermostHits SFGOutermostHits
A named collection of the outermost hits in X,Y, and Z from SFG.
TFGDObject hackFGDObject
This is just here to fool TFile::MakeProject, not a real object.
A base class for analysis output modules which contain reconstructed event information.
TLorentzVector BackPosition
The Back position of the object.
Int_t NAlternates
Number of entries in the alternate hypotheses list.
double Width
The width of the shower (perpendicular to the direction)
ClassDef(TGlobalReconModule::TFgdTimeBin, 1)
Int_t fNSfgTimeBins
Number of hit time bins in the SFG as determined by sfgRecon.
void GetHitsAssociatedToG4Trajectory(const ND::THitSelection &hits, ND::THandle< ND::TG4Trajectory > traj, ND::THitSelection &traj_hits)
int NbFittedVerticalClusters
The number of vertical clusters contributed to the fit, TREx.
TClonesArray * SFGUnused
The vector unused hits in SFG.
double NTrun
70% of the number of cluster
TTrueParticle TrueParticle
The true particle.
double EDeposit
Energy deposit of the corresponding object.
Bool_t Configure(std::string &opt)
A function that allows the module to be configured from an external class without any dependencies...

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