NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Tof.h
Go to the documentation of this file.
1 
7 #ifndef NAIA_TOF_H
8 #define NAIA_TOF_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 "TVector3.h"
19 
20 #include <array>
21 #include <map>
22 #include <vector>
23 
24 namespace NAIA {
25 
29 template <class T> using TofChargeVariable = std::map<Tof::ChargeType, T>;
33 template <class T> using TofBetaVariable = std::map<Tof::BetaType, T>;
37 template <class T> using TofClusterTypeVariable = std::map<Tof::BetaClusterType, T>;
38 
46 class TofBaseData : public TObject {
47 public:
48  // clang-format off
52  // clang-format on
53 
54 #ifdef ENABLE_PRODUCTION_CODE
55  bool Fill(BetaR *betaPtr, BetaHR *betahPtr, bool standalone = false);
56 
57  void SetMC(bool isMC) { _isMC = isMC; }
58 #endif
59 
64  void Clear();
65 
70  void Dump() const;
71 
80  TVector3 InterpolateAtZ(float z) const;
81 
82  // ugly but better than saving 6 doubles for every event
83  // NB: it's gonna throw if the Tof object is not valid
84  // NB2: thanks ROOT for not supporting std::vector<std::array>.
85 
91  const TVector3 &GetLinePoint() const { return m_pointAndDir.at(0); }
97  const TVector3 &GetLineDirection() const { return m_pointAndDir.at(1); }
98 
99 private:
100  // this is used to store point and direction of the TOF reconstruction
101  std::vector<TVector3> m_pointAndDir;
102 
103  bool _isMC = false;
104 
105  ClassDef(TofBaseData, 2)
106 };
107 
115 class TofPlusData : public TObject {
116 public:
117  // clang-format off
118  float Chi2Coo{0};
119  float Chi2Time{0};
120 
121  short NTrkClusters{0};
122  short NBetaClusters{0};
123  short NChargeClusters{0};
124 
127 
129  std::vector<bool> LayerGoodPathl;
135  // clang-format on
136 
137 #ifdef ENABLE_PRODUCTION_CODE
138  bool Fill(BetaR *betaPtr, BetaHR *betahPtr, bool standalone = false);
139 #endif
140 
145  void Clear();
146 
151  void Dump() const;
152 
153 private:
154  void ResizeMembers();
155 
156  ClassDef(TofPlusData, 2)
157 };
158 
167 class TofBase : public OnDemandContainer<TofBase>, public TofBaseData {
168 public:
169  static const std::string BranchName;
170 
172 };
173 
182 class TofPlus : public OnDemandContainer<TofPlus>, public TofPlusData {
183 public:
184  static const std::string BranchName;
185 
187 };
188 
196 class TofBaseStandalone : public OnDemandContainer<TofBaseStandalone>, public TofBaseData {
197 public:
198  static const std::string BranchName;
199 
201 };
202 
210 class TofPlusStandalone : public OnDemandContainer<TofPlusStandalone>, public TofPlusData {
211 public:
212  static const std::string BranchName;
213 
215 };
216 
217 } // namespace NAIA
218 
219 #endif
const TVector3 & GetLinePoint() const
Get the origin of the Tof clusters linear fit.
Definition: Tof.h:91
TofBetaVariable< float > Beta
Beta measurement, one for each type. See Tof::BetaType for list of types.
Definition: Tof.h:49
float ChargeLikelihoodEst
Likelihood estimation of the event discrete charge.
Definition: Tof.h:125
void Dump() const
Dump on screen container content.
Definition: Tof.cpp:81
LayerVariable< TofClusterTypeVariable< unsigned int > > NClusters
Number of tof clusters on each layer both on-time or off-time (far from trigger). See Tof::BetaCluste...
Definition: Tof.h:132
OnDemandContainer container class description.
Accessor class for base Tof info.
Definition: Tof.h:167
LayerVariable< TofClusterTypeVariable< float > > AverageDTime
Average delta-t for tof clusters on each layer. See Tof::BetaClusterType for list of cluster types...
Definition: Tof.h:133
Container class for additional Tof info.
Definition: Tof.h:115
LayerVariable< float > LayerEdep
Energy deposition in each tof layer.
Definition: Tof.h:131
Container class for base Tof info.
Definition: Tof.h:46
short NChargeClusters
Total number of clusters used for charge estimation.
Definition: Tof.h:123
TofBase()
Definition: Tof.h:171
TofChargeVariable< float > ChargeNoPL
Charge measurement obtained using every layer, regardless of GoodPathl. One for each type...
Definition: Tof.h:51
Accessor class for base Tof info (standalone reconstruction)
Definition: Tof.h:196
float ChargeLikelihoodProb
Likelihood probability of the event discrete charge estimation.
Definition: Tof.h:126
TofPlus()
Definition: Tof.h:186
TofBetaVariable< short > BetaPattern
Tof layer pattern used for the beta reconstruction (for each beta type). See Tof::BetaType for list o...
Definition: Tof.h:128
short NTrkClusters
Total number of clusters matching Tracker track.
Definition: Tof.h:121
float Chi2Coo
Tof clusters spatial reconstruction normalized chi-square. The tof cluster residuals are computed w...
Definition: Tof.h:118
static const std::string BranchName
Definition: Tof.h:184
std::map< unsigned int, T > LayerVariable
Definition: Utils.h:54
void Clear()
Clear container content.
Definition: Tof.cpp:11
Mixin class to add &quot;read-on-demand&quot; behavior to an existing container class.
std::map< Tof::BetaClusterType, T > TofClusterTypeVariable
Definition: Tof.h:37
static const std::string BranchName
Definition: Tof.h:212
LayerVariable< TofClusterTypeVariable< float > > AverageEdep
Average cluster energy deposition on each tof layer. See Tof::BetaClusterType for list of cluster typ...
Definition: Tof.h:134
void ResizeMembers()
Definition: TofFill.cpp:48
std::map< Tof::BetaType, T > TofBetaVariable
Definition: Tof.h:33
bool _isMC
Definition: Tof.h:103
TVector3 InterpolateAtZ(float z) const
Get Tof track interpolation at given height.
Definition: Tof.cpp:33
short NBetaClusters
Total number of clusters used for beta estimation.
Definition: Tof.h:122
void Dump() const
Dump on screen container content.
Definition: Tof.cpp:46
void Clear()
Clear container content.
Definition: Tof.cpp:18
TofChargeVariable< float > Charge
Charge measurement obtained using only layers for which GoodPathl is true. One for each type...
Definition: Tof.h:50
std::vector< bool > LayerGoodPathl
Pathlength check for each tof layer. False if the track crosses a paddle edge, or if this is the stan...
Definition: Tof.h:129
Accessor class for additional Tof info.
Definition: Tof.h:182
Accessor class for additional Tof info (standalone reconstruction)
Definition: Tof.h:210
float Chi2Time
Tof clusters temporal reconstruction normalized chi-square. (Good luck finding out how this is comput...
Definition: Tof.h:119
std::vector< TVector3 > m_pointAndDir
Definition: Tof.h:101
static const std::string BranchName
Definition: Tof.h:198
const TVector3 & GetLineDirection() const
Get the direction of the Tof clusters linear fit.
Definition: Tof.h:97
std::map< Tof::ChargeType, T > TofChargeVariable
Definition: Tof.h:29
static const std::string BranchName
Definition: Tof.h:169
LayerVariable< float > LayerCharge
Charge estimation for each tof layer.
Definition: Tof.h:130