NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
TrTrack.h
Go to the documentation of this file.
1 
7 #ifndef NAIA_TRTRACK_H
8 #define NAIA_TRTRACK_H
9 
10 // gbatch headers
11 #ifdef ENABLE_PRODUCTION_CODE
12 #include "root.h"
13 #endif
14 
16 #include "Containers/Utils.h"
17 
18 #include <array>
19 #include <map>
20 #include <vector>
21 
22 namespace NAIA {
23 
27 template <class T> using TrackChargeVariable = std::map<TrTrack::ChargeRecoType, T>;
33 template <class T> using TrackFitVariable = std::map<TrTrack::Fit, std::map<TrTrack::Span, T>>;
37 template <class T> using TrackFitOnlyVariable = std::map<TrTrack::Fit, T>;
41 template <class T> using TrackSideVariable = std::map<TrTrack::Side, T>;
45 template <class T> using TrackFitPosVariable = std::map<TrTrack::FitPositionHeight, T>;
49 template <class T> using TrackDistanceVariable = std::map<TrTrack::DistanceFromTrack, T>;
50 
51 #ifdef ENABLE_PRODUCTION_CODE
52 enum class TrTrackFillType { Full, SecondTrack, Standalone };
53 #endif
54 
62 class TrTrackBaseData : public TObject {
63  friend class TrdKBaseData;
64  friend class TrTrackPlusData;
65 
66 public:
67  // clang-format off
68  // hit-related
70 
71  // fit-related
75 
76  // charge-related
83 
84  float FitCharge;
85  // clang-format on
86 
87 #ifdef ENABLE_PRODUCTION_CODE
88  bool Fill(TrTrackR *trackPtr, TrTrackFillType type = TrTrackFillType::Full);
89  bool FillElectronVars(TrTrackR *trackPtr, float zEcalCOG, bool refitKalman = false);
90 
91  void SetBeta(double beta) { _beta = beta; }
92  void SetMC(bool isMC) { _isMC = isMC; }
93 
94  TrTrack::Span _GetBestSpan(TrTrack::Fit fit = TrTrack::Fit::Choutko) const;
95  bool _FitIDExists(TrTrack::Fit fit, TrTrack::Span span) const;
96 #endif
97 
102  void Clear();
103 
108  void Dump() const;
109 
117 
124  bool FitIDExists(TrTrack::Fit fit, TrTrack::Span span) const;
125 
133  std::bitset<9> GetTrackPattern(TrTrack::Side side);
134 
135 private:
136  bool _isMC = false;
137  float _beta = 1.0f;
139  int _tmpCharge = 1;
140 
141  ClassDef(TrTrackBaseData, 3)
142 };
143 
151 class TrTrackPlusData : public TObject {
152 public:
153  // clang-format off
154  // hit-related
156 
157  // fit-related
160 
170 
171  // charge-related
180 
181  std::array<float, 2> DirectionalStoermerCutoff{0.0f, 0.0f};
182  // clang-format on
183 
184 #ifdef ENABLE_PRODUCTION_CODE
185  bool Fill(TrTrackR *trackPtr);
186  bool FillElectronVars(TrTrackR *trackPtr, bool refitKalman = false);
187 #endif
188 
193  void Clear();
194 
199  void Dump() const;
200 
201  const TrTrackBaseData *trkBase = nullptr;
202 
203 private:
205 
206  ClassDef(TrTrackPlusData, 2)
207 };
208 
217 class TrTrackBase : public OnDemandContainer<TrTrackBase>, public TrTrackBaseData {
218 public:
219  static const std::string BranchName;
220 
222 };
223 
232 class TrTrackPlus : public OnDemandContainer<TrTrackPlus>, public TrTrackPlusData {
233 public:
234  static const std::string BranchName;
235 
237 };
238 
247 class SecondTrTrackBase : public OnDemandContainer<SecondTrTrackBase>, public TrTrackBaseData {
248 public:
249  static const std::string BranchName;
250 
252 };
253 
262 class TrTrackBaseStandalone : public OnDemandContainer<TrTrackBaseStandalone>, public TrTrackBaseData {
263 public:
264  static const std::string BranchName;
265 
267 };
268 
269 } // namespace NAIA
270 #endif
LayerVariable< TrackFitOnlyVariable< float > > PartialRigidity
Rigidity obtained from a fit where the hit on an a given layer &#39;i&#39; is not considered. See TrTrack::Fit for available fits.
Definition: TrTrack.h:166
std::map< TrTrack::Fit, std::map< TrTrack::Span, T >> TrackFitVariable
Definition: TrTrack.h:33
LayerVariable< TrackDistanceVariable< TrackSideVariable< unsigned int > > > NClusters
Total number of tracker clusters for each layer, within a given distance from the track...
Definition: TrTrack.h:174
TrackFitVariable< int > _fit_ID
Definition: TrTrack.h:138
LayerVariable< TrackSideVariable< float > > LayerEdep
Track hit (X and Y-side) energy deposition for each layer.
Definition: TrTrack.h:173
static const std::string BranchName
Definition: TrTrack.h:264
std::map< TrTrack::DistanceFromTrack, T > TrackDistanceVariable
Definition: TrTrack.h:49
LayerVariable< TrackFitOnlyVariable< float > > PartialInvRigErr
Inverse rigidity error obtained from a fit where a given layer &#39;i&#39; was excluded. See TrTrack::Fit for...
Definition: TrTrack.h:167
TrackChargeVariable< float > ChargeRMS
Track charge RMS (including external layers) for each charge reconstruction. See TrTrack::ChargeRecoT...
Definition: TrTrack.h:79
OnDemandContainer container class description.
LayerVariable< float > ClusterSignalRatio
Ratio between cluster amplitude and its neighbouring 10 strips, for each layer.
Definition: TrTrack.h:178
TrackFitVariable< float > Theta
theta of track direction in AMS coordinate system, for each available fit and span. See TrTrack::Fit and TrTrack::Span for available fits and spans.
Definition: TrTrack.h:158
std::map< TrTrack::FitPositionHeight, T > TrackFitPosVariable
Definition: TrTrack.h:45
std::map< TrTrack::ChargeRecoType, T > TrackChargeVariable
Definition: TrTrack.h:27
bool FitIDExists(TrTrack::Fit fit, TrTrack::Span span) const
Check if a given combination of fit and span is available for this track.
Definition: TrTrack.cpp:14
LayerVariable< TrackChargeVariable< float > > LayerChargeXY
Track hit charge (for each single layer, using both sides clusters) for each available reconstruction...
Definition: TrTrack.h:82
LayerVariable< int > LayerChargeStatus
Track hit charge reconstruction status for each layer (this is a bitmask. Bits 0-11 refer to the X-si...
Definition: TrTrack.h:81
static const std::string BranchName
Definition: TrTrack.h:249
LayerVariable< TrackFitOnlyVariable< TrackSideVariable< float > > > PartialTrTrackFitPos
Track X and Y position obtained from a fit where a given layer &#39;i&#39; was excluded. See TrTrack::Fit for...
Definition: TrTrack.h:169
TrackChargeVariable< float > InnerChargeRMS
Track charge RMS (inner tracker only) for each charge reconstruction. See TrTrack::ChargeRecoType for...
Definition: TrTrack.h:80
void Dump() const
Dump on screen container content.
Definition: TrTrack.cpp:133
std::map< TrTrack::Fit, T > TrackFitOnlyVariable
Definition: TrTrack.h:37
LayerVariable< TrackFitOnlyVariable< TrackSideVariable< float > > > PartialTrTrackResidual
Track X and Y residuals obtained from a fit where the hit on an a given layer &#39;i&#39; is not considered...
Definition: TrTrack.h:165
Container class for base Trd info.
Definition: TrdK.h:57
LayerVariable< float > TrackFeetDistance
Track distance to the inner tracker supporting feet for each layer.
Definition: TrTrack.h:155
LayerVariable< TrackDistanceVariable< TrackSideVariable< float > > > ClustersEdep
Total energy deposition of tracker clusters for each layer, within a given distance from the track...
Definition: TrTrack.h:175
LayerVariable< TrackFitOnlyVariable< TrackSideVariable< float > > > PartialTrChiSq
Normalized chi-square obtained from a fit where a given layer &#39;i&#39; was excluded. See TrTrack::Fit for ...
Definition: TrTrack.h:168
LayerVariable< TrackSideVariable< float > > MaxClusterDistance
Distance from the track of the cluster with the highest energy deposition for each layer...
Definition: TrTrack.h:177
std::map< unsigned int, T > LayerVariable
Definition: Utils.h:54
Container class for base TrTrack info.
Definition: TrTrack.h:62
TrackFitVariable< TrackSideVariable< float > > TrChiSq
Normalized track chi-square (X and Y) for each available fit and span. See TrTrack::Fit and TrTrack::...
Definition: TrTrack.h:73
std::map< TrTrack::Side, T > TrackSideVariable
Definition: TrTrack.h:41
TrTrack::Span GetBestSpan(TrTrack::Fit fit=TrTrack::Fit::Choutko) const
Get the best Span available for this track.
Definition: TrTrack.cpp:18
TrackChargeVariable< float > UnbiasedCharge
&quot;Unbiased&quot; tracker charge for each charge reconstruction. It is a simple truncated mean between the h...
Definition: TrTrack.h:172
Mixin class to add &quot;read-on-demand&quot; behavior to an existing container class.
TrackFitPosVariable< TrackFitVariable< TrackSideVariable< float > > > TrTrackFitPos
Track X and Y position at different heights in AMS and for each available fit and span...
Definition: TrTrack.h:74
std::array< float, 2 > DirectionalStoermerCutoff
Stoermer cutoff estimated by the TrdK track direction (for both negative and positive particles) ...
Definition: TrTrack.h:181
TrackFitVariable< float > Phi
phi of track direction in AMS coordinate system, for each available fit and span. See TrTrack::Fit an...
Definition: TrTrack.h:159
TrackChargeVariable< float > InnerCharge
Track charge (inner tracker only) for each available reconstruction. See TrTrack::ChargeRecoType for ...
Definition: TrTrack.h:78
LayerVariable< TrackSideVariable< float > > MaxClusterEdep
Max cluster energy deposit for each layer, for each side.
Definition: TrTrack.h:176
LayerVariable< std::array< float, 3 > > TrTrackHitPos
X,Y and Z position of hit on each layer, if available.
Definition: TrTrack.h:69
void Clear()
Clear container content.
Definition: TrTrack.cpp:27
Container class for additional TrTrack info.
Definition: TrTrack.h:151
LayerVariable< TrackChargeVariable< TrackSideVariable< float > > > LayerCharge
Track hit charge (X and Y-side) for each layer, for each charge reconstruction. See TrTrack::ChargeRe...
Definition: TrTrack.h:179
TrackFitVariable< float > InvRigErr
Error on the deflection ( = 1 / rigidity) estimation, for each available fit and span. See TrTrack::Fit and TrTrack::Span for available fits and spans.
Definition: TrTrack.h:163
Accessor class for additional TrTrack info.
Definition: TrTrack.h:232
TrackFitVariable< float > RigidityRICH
Track rigidity at RICH for each available fit and span (only available for Kalman fit)...
Definition: TrTrack.h:162
Accessor class for base TrTrack info.
Definition: TrTrack.h:217
Accessor class for base TrTrack info reconstructed without Tof information.
Definition: TrTrack.h:262
static const std::string BranchName
Definition: TrTrack.h:234
std::bitset< 9 > GetTrackPattern(TrTrack::Side side)
Get the track pattern for a given tracker side. One bit per layer, set to 1 if there is a hit on that...
Definition: TrTrack.cpp:196
TrackFitVariable< int > _fit_ID
needed to get basic info without computing twice
Definition: TrTrack.h:204
static const std::string BranchName
Definition: TrTrack.h:219
TrackFitVariable< float > Rigidity
Track rigidity, corrected for time-dependent rigidity scale shifts and geometry volume correction...
Definition: TrTrack.h:72
TrackFitVariable< float > RigidityTOI
Track rigidity at Top-Of-Instrument, for both downward and upward going partitcles, for each available fit and span (only available for Kalman fit). See TrTrack::Fit and TrTrack::Span for available fits and spans.
Definition: TrTrack.h:161
TrackChargeVariable< float > Charge
Track charge (including external layers) for each available reconstruction. See TrTrack::ChargeRecoTy...
Definition: TrTrack.h:77
const TrTrackBaseData * trkBase
Definition: TrTrack.h:201
void Dump() const
Dump on screen container content.
Definition: TrTrack.cpp:71
standard track fit
Definition: Utils.h:180
LayerVariable< TrackFitVariable< TrackSideVariable< float > > > TrTrackResidual
Track X and Y residuals in each layer for each available fit and span. See TrTrack::Fit and TrTrack::...
Definition: TrTrack.h:164
float FitCharge
Initial charge estimate used for track re-fitting.
Definition: TrTrack.h:84
Accessor class for base TrTrack info about the second track.
Definition: TrTrack.h:247
void Clear()
Clear container content.
Definition: TrTrack.cpp:45