NAIA  1.1.1
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, bool use_mc_beta = false);
56 
57  void SetMC(bool isMC) { _isMC = isMC; }
58 #endif
59 
64  void Clear();
65 
70  void Dump() const;
71 
80  [[nodiscard]] 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  [[nodiscard]] const TVector3 &GetLinePoint() const { return m_pointAndDir.at(0); }
97  [[nodiscard]] 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
NAIA::TofPlus
Accessor class for additional Tof info.
Definition: Tof.h:182
NAIA::TofPlusData
Container class for additional Tof info.
Definition: Tof.h:115
NAIA::TofPlusData::AverageDTime
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
NAIA::TofPlusData::ResizeMembers
void ResizeMembers()
Definition: TofFill.cpp:57
NAIA::TofPlusData::Chi2Time
float Chi2Time
Tof clusters temporal reconstruction normalized chi-square. (Good luck finding out how this is comput...
Definition: Tof.h:119
NAIA::TofPlusData::NTrkClusters
short NTrkClusters
Total number of clusters matching Tracker track.
Definition: Tof.h:121
NAIA::TofBaseData::InterpolateAtZ
TVector3 InterpolateAtZ(float z) const
Get Tof track interpolation at given height.
Definition: Tof.cpp:33
NAIA::TofChargeVariable
std::map< Tof::ChargeType, T > TofChargeVariable
Definition: Tof.h:29
NAIA::TofBaseData::ChargeNoPL
TofChargeVariable< float > ChargeNoPL
Charge measurement obtained using every layer, regardless of GoodPathl. One for each type....
Definition: Tof.h:51
NAIA
Definition: Event.h:13
NAIA::TofPlusData::NBetaClusters
short NBetaClusters
Total number of clusters used for beta estimation.
Definition: Tof.h:122
NAIA::OnDemandContainer
Mixin class to add "read-on-demand" behavior to an existing container class.
Definition: OnDemandContainer.h:44
NAIA::TofBaseData::Charge
TofChargeVariable< float > Charge
Charge measurement obtained using only layers for which GoodPathl is true. One for each type....
Definition: Tof.h:50
Utils.h
NAIA::TofBaseData::GetLineDirection
const TVector3 & GetLineDirection() const
Get the direction of the Tof clusters linear fit.
Definition: Tof.h:97
NAIA::TofBaseData::Dump
void Dump() const
Dump on screen container content.
Definition: Tof.cpp:46
NAIA::TofPlusStandalone
Accessor class for additional Tof info (standalone reconstruction)
Definition: Tof.h:210
NAIA::TofBaseData::GetLinePoint
const TVector3 & GetLinePoint() const
Get the origin of the Tof clusters linear fit.
Definition: Tof.h:91
NAIA::TofPlusData::LayerGoodPathl
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
NAIA::TofBaseData::m_pointAndDir
std::vector< TVector3 > m_pointAndDir
Definition: Tof.h:101
NAIA::TofBase::BranchName
static const std::string BranchName
Definition: Tof.h:169
NAIA::TofBase::TofBase
TofBase()
Definition: Tof.h:171
NAIA::TofBaseData::Clear
void Clear()
Clear container content.
Definition: Tof.cpp:11
NAIA::TofBaseStandalone
Accessor class for base Tof info (standalone reconstruction)
Definition: Tof.h:196
NAIA::TofPlusData::LayerEdep
LayerVariable< float > LayerEdep
Energy deposition in each tof layer.
Definition: Tof.h:131
NAIA::TofPlusData::NClusters
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
NAIA::TofPlusData::Dump
void Dump() const
Dump on screen container content.
Definition: Tof.cpp:81
NAIA::TofPlus::TofPlus
TofPlus()
Definition: Tof.h:186
NAIA::TofPlusData::AverageEdep
LayerVariable< TofClusterTypeVariable< float > > AverageEdep
Average cluster energy deposition on each tof layer. See Tof::BetaClusterType for list of cluster typ...
Definition: Tof.h:134
NAIA::TofBaseStandalone::BranchName
static const std::string BranchName
Definition: Tof.h:198
NAIA::TofPlus::BranchName
static const std::string BranchName
Definition: Tof.h:184
NAIA::TofBaseData
Container class for base Tof info.
Definition: Tof.h:46
NAIA::TofPlusData::Chi2Coo
float Chi2Coo
Tof clusters spatial reconstruction normalized chi-square. The tof cluster residuals are computed w....
Definition: Tof.h:118
NAIA::TofClusterTypeVariable
std::map< Tof::BetaClusterType, T > TofClusterTypeVariable
Definition: Tof.h:37
NAIA::TofPlusData::LayerCharge
LayerVariable< float > LayerCharge
Charge estimation for each tof layer.
Definition: Tof.h:130
NAIA::TofPlusData::ChargeLikelihoodEst
float ChargeLikelihoodEst
Likelihood estimation of the event discrete charge.
Definition: Tof.h:125
NAIA::TofPlusStandalone::TofPlusStandalone
TofPlusStandalone()
Definition: Tof.h:214
NAIA::TofPlusStandalone::BranchName
static const std::string BranchName
Definition: Tof.h:212
NAIA::TofBaseStandalone::TofBaseStandalone
TofBaseStandalone()
Definition: Tof.h:200
NAIA::LayerVariable
std::map< unsigned int, T > LayerVariable
Definition: Utils.h:54
NAIA::TofPlusData::BetaPattern
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
NAIA::TofBetaVariable
std::map< Tof::BetaType, T > TofBetaVariable
Definition: Tof.h:33
NAIA::TofBaseData::_isMC
bool _isMC
Definition: Tof.h:103
NAIA::TofPlusData::NChargeClusters
short NChargeClusters
Total number of clusters used for charge estimation.
Definition: Tof.h:123
NAIA::TofBaseData::Beta
TofBetaVariable< float > Beta
Beta measurement, one for each type. See Tof::BetaType for list of types.
Definition: Tof.h:49
NAIA::TofPlusData::Clear
void Clear()
Clear container content.
Definition: Tof.cpp:18
OnDemandContainer.h
OnDemandContainer container class description.
NAIA::TofBase
Accessor class for base Tof info.
Definition: Tof.h:167
NAIA::TofPlusData::ChargeLikelihoodProb
float ChargeLikelihoodProb
Likelihood probability of the event discrete charge estimation.
Definition: Tof.h:126