NAIA
 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:
50 
51 #ifdef ENABLE_PRODUCTION_CODE
52  void Fill(BetaR *betaPtr, BetaHR *betahPtr, bool standalone = false);
53 
54  void SetMC(bool isMC) { _isMC = isMC; }
55 #endif
56 
61  void Clear();
62 
67  void Dump() const;
68 
77  TVector3 InterpolateAtZ(float z) const;
78 
79  // ugly but better than saving 6 doubles for every event
80  // NB: it's gonna throw if the Tof object is not valid
81  // NB2: thanks ROOT for not supporting std::vector<std::array>.
82 
88  const TVector3 &GetLinePoint() const { return m_pointAndDir.at(0); }
94  const TVector3 &GetLineDirection() const { return m_pointAndDir.at(1); }
95 
96 private:
97  // this is used to store point and direction of the TOF reconstruction
98  std::vector<TVector3> m_pointAndDir;
99 
100  bool _isMC = false;
101 
102  ClassDef(TofBaseData, 1)
103 };
104 
112 class TofPlusData : public TObject {
113 public:
114  // clang-format off
115  float Chi2Coo;
116  float Chi2Time;
117 
118  short NTrkClusters;
121 
123 
125  std::vector<bool> LayerGoodPathl;
126  std::vector<float> LayerCharge;
131  // clang-format on
132 
133 #ifdef ENABLE_PRODUCTION_CODE
134  void Fill(BetaR *betaPtr, BetaHR *betahPtr, bool standalone = false);
135 #endif
136 
141  void Clear();
142 
147  void Dump() const;
148 
149 private:
150  void ResizeMembers();
151 
152  ClassDef(TofPlusData, 1)
153 };
154 
163 class TofBase : public OnDemandContainer<TofBase>, public TofBaseData {
164 public:
165  static const std::string BranchName;
166 
168 };
169 
178 class TofPlus : public OnDemandContainer<TofPlus>, public TofPlusData {
179 public:
180  static const std::string BranchName;
181 
183 };
184 
192 class TofBaseStandalone : public OnDemandContainer<TofBaseStandalone>, public TofBaseData {
193 public:
194  static const std::string BranchName;
195 
197 };
198 
206 class TofPlusStandalone : public OnDemandContainer<TofPlusStandalone>, public TofPlusData {
207 public:
208  static const std::string BranchName;
209 
211 };
212 
213 } // namespace NAIA
214 
215 #endif
const TVector3 & GetLinePoint() const
Get the origin of the Tof clusters linear fit.
Definition: Tof.h:88
TofBetaVariable< float > Beta
Beta measurement, one for each type. See Tof::BetaType for list of types.
Definition: Tof.h:48
void Dump() const
Dump on screen container content.
Definition: Tof.cpp:76
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:128
OnDemandContainer container class description.
Accessor class for base Tof info.
Definition: Tof.h:163
float ChargeLikelihood
Likelihood probability of the discrete charge estimation.
Definition: Tof.h:122
LayerVariable< TofClusterTypeVariable< float > > AverageDTime
Average delta-t for tof clusters on each layer. See Tof::BetaClusterType for list of cluster types...
Definition: Tof.h:129
Container class for additional Tof info.
Definition: Tof.h:112
LayerVariable< float > LayerEdep
Energy deposition in each tof layer.
Definition: Tof.h:127
Container class for base Tof info.
Definition: Tof.h:46
short NChargeClusters
Total number of clusters used for charge estimation.
Definition: Tof.h:120
TofBase()
Definition: Tof.h:167
Accessor class for base Tof info (standalone reconstruction)
Definition: Tof.h:192
TofPlus()
Definition: Tof.h:182
TofBetaVariable< short > BetaPattern
Tof layer pattern used for the beta reconstruction (for each beta type). See Tof::BetaType for list o...
Definition: Tof.h:124
short NTrkClusters
Total number of clusters matching Tracker track.
Definition: Tof.h:118
float Chi2Coo
Tof clusters spatial reconstruction normalized chi-square. The tof cluster residuals are computed w...
Definition: Tof.h:115
static const std::string BranchName
Definition: Tof.h:180
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:208
std::vector< float > LayerCharge
Charge estimation for each tof layer.
Definition: Tof.h:126
LayerVariable< TofClusterTypeVariable< float > > AverageEdep
Average cluster energy deposition on each tof layer. See Tof::BetaClusterType for list of cluster typ...
Definition: Tof.h:130
void ResizeMembers()
Definition: TofFill.cpp:40
std::map< Tof::BetaType, T > TofBetaVariable
Definition: Tof.h:33
bool _isMC
Definition: Tof.h:100
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:119
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, one for each type. See Tof::ChargeType for list of types.
Definition: Tof.h:49
std::vector< bool > LayerGoodPathl
Pathlength check for each tof layer. False if the track (or the cluster line-fit in case of standalon...
Definition: Tof.h:125
Accessor class for additional Tof info.
Definition: Tof.h:178
Accessor class for additional Tof info (standalone reconstruction)
Definition: Tof.h:206
float Chi2Time
Tof clusters temporal reconstruction normalized chi-square. (Good luck finding out how this is comput...
Definition: Tof.h:116
std::vector< TVector3 > m_pointAndDir
Definition: Tof.h:98
static const std::string BranchName
Definition: Tof.h:194
const TVector3 & GetLineDirection() const
Get the direction of the Tof clusters linear fit.
Definition: Tof.h:94
std::map< Tof::ChargeType, T > TofChargeVariable
Definition: Tof.h:29
static const std::string BranchName
Definition: Tof.h:165