NAIA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
TrdK.h
Go to the documentation of this file.
1 
7 #ifndef NAIA_TRDK_H
8 #define NAIA_TRDK_H
9 
10 // gbatch headers
11 #ifdef ENABLE_PRODUCTION_CODE
12 #include "TrdKCluster.h"
13 #include "root.h"
14 #endif
15 
17 #include "Containers/TrTrack.h"
18 #include "Containers/Utils.h"
19 
20 #include "TVector3.h"
21 
22 #include <array>
23 #include <map>
24 #include <vector>
25 
26 namespace NAIA {
27 
32 template <class T> using TrdChargeVariable = std::vector<T>;
36 template <class T> using TrdLikelihoodVariable = std::vector<T>;
40 template <class T> using TrdLikelihoodRVariable = std::vector<T>;
44 template <class T> using TrdOnTrackVariable = std::vector<T>;
45 
53 class TrdKBaseData : public TObject {
54 public:
55  TrdKBaseData() = default;
56 
62  TrdKBaseData(bool standalone) : _isStandalone{standalone} {};
63 
64  // quality-related
65  bool AlignStatus;
66  bool CalibStatus;
67  bool ChargeStatus;
68 
69  // clang-format off
72 
73  // charge-related
75 
76  // likelihood-related
79  // clang-format off
80 
83 
84  float Cleanliness;
85  float IPChi2;
86 
87 #ifdef ENABLE_PRODUCTION_CODE
88  void Fill(TrdKCluster *trdkPtr, TrTrackR *pTrTrack);
89 
90  void SetBeta(double beta) { _beta = beta; }
91  // void SetTrTrackPtr(TrTrackR *trackPtr) { pTrTrack = trackPtr; }
92 #endif
93 
98  void Clear();
99 
104  void Dump() const;
105 
114  TVector3 InterpolateAtZ(float z) const;
115 
116  // ugly but better than saving 6 doubles for every event
117  // NB: it's gonna throw if the TrdK object is not valid
118  // NB2: thanks ROOT for not supporting std::vector<std::array>. Hopefully this is the only case where we have
119  // to use TVector3
120 
126  const TVector3 &GetLinePoint() const { return m_pointAndDir.at(0); }
132  const TVector3 &GetLineDirection() const { return m_pointAndDir.at(1); }
133 
135 
136 protected:
137  bool _isStandalone = false;
138 
139 private:
140  void ResizeMembers();
141 
142  // this is used to store point and direction of the TRD reconstruction
143  std::vector<TVector3> m_pointAndDir;
144 
145  float _beta = 1.0;
146 
147  ClassDef(TrdKBaseData, 1)
148 };
149 
158 class TrdKBase : public OnDemandContainer<TrdKBase>, public TrdKBaseData {
159 public:
160  static const std::string BranchName;
161 
163 };
164 
172 class TrdKBaseStandalone : public OnDemandContainer<TrdKBaseStandalone>, public TrdKBaseData {
173 public:
174  static const std::string BranchName;
175 
177 };
178 
179 } // namespace NAIA
180 
181 #endif
bool ChargeStatus
Charge reconstruction status.
Definition: TrdK.h:67
std::vector< T > TrdOnTrackVariable
Definition: TrdK.h:44
void Clear()
Clear container content.
Definition: TrdK.cpp:79
float Cleanliness
Cleanliness. Whatever this means. I don&#39;t know, go ask Kounine.
Definition: TrdK.h:84
TrdKBaseData(bool standalone)
Constructor used by standalone version of container.
Definition: TrdK.h:62
OnDemandContainer container class description.
Accessor class for base TrdK info.
Definition: TrdK.h:158
bool _isStandalone
Definition: TrdK.h:137
TrdLikelihoodRVariable< double > LikelihoodRatio
Trd likelihood ratio estimator. See TrdK::LikelihoodRType for list of available types.
Definition: TrdK.h:78
const TrTrackBaseData * trkBase
Definition: TrdK.h:134
void ResizeMembers()
Definition: TrdKFill.cpp:11
TrdChargeVariable< float > Charge
Reconstructed charge in different Trd regions. See TrdK::ChargeType for list of available regions...
Definition: TrdK.h:74
std::vector< T > TrdLikelihoodRVariable
Definition: TrdK.h:40
const TVector3 & GetLinePoint() const
Get the origin of the TrdK clusters linear fit.
Definition: TrdK.h:126
LayerVariable< float > Edep
Energy deposition in each Trd layer.
Definition: TrdK.h:81
Container class for base Trd info.
Definition: TrdK.h:53
bool CalibStatus
Calibration status.
Definition: TrdK.h:66
std::vector< T > TrdLikelihoodVariable
Definition: TrdK.h:36
std::map< unsigned int, T > LayerVariable
Definition: Utils.h:54
void Dump() const
Dump on screen container content.
Definition: TrdK.cpp:11
Container class for base TrTrack info.
Definition: TrTrack.h:58
Mixin class to add &quot;read-on-demand&quot; behavior to an existing container class.
TrdLikelihoodVariable< double > Likelihood
Trd likelihood estimator. See TrdK::LikelihoodType for list of available types.
Definition: TrdK.h:77
TVector3 InterpolateAtZ(float z) const
Get Trd track interpolation at given height.
Definition: TrdK.cpp:97
static const std::string BranchName
Definition: TrdK.h:174
TrTrack container class description.
float IPChi2
Impact point chi-square. Whatever this means. I don&#39;t know, go ask Kounine.
Definition: TrdK.h:85
TrdOnTrackVariable< float > Amps
Sum of the amplitude of reconstructed hits on and off main track. See TrdK::QualType for list of avai...
Definition: TrdK.h:71
std::vector< TVector3 > m_pointAndDir
Definition: TrdK.h:143
TrdKBaseData()=default
TrdOnTrackVariable< int > NHits
Number of reconstructed hits on and off main track. See TrdK::QualType for list of available types...
Definition: TrdK.h:70
static const std::string BranchName
Definition: TrdK.h:160
bool AlignStatus
Alignment status.
Definition: TrdK.h:62
LayerVariable< float > Pathlength
Estimated particle pathlength in each Trd layer.
Definition: TrdK.h:82
const TVector3 & GetLineDirection() const
Get the direction of the TrdK clusters linear fit.
Definition: TrdK.h:132
std::vector< T > TrdChargeVariable
Definition: TrdK.h:32
Accessor class for base TrdK info (standalone reconstruction)
Definition: TrdK.h:172