NAIA  1.0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Ecal.h
Go to the documentation of this file.
1 
8 #ifndef NAIA_ECAL_H
9 #define NAIA_ECAL_H
10 
11 // gbatch headers
12 #ifdef ENABLE_PRODUCTION_CODE
13 #include "root.h"
14 #endif
15 
17 #include "Containers/Utils.h"
18 
19 #include "TVector3.h"
20 
21 namespace NAIA {
22 
26 template <class T> using EcalEnergyVariable = std::vector<T>;
30 template <class T> using EcalLikelihoodVariable = std::vector<T>;
34 template <class T> using EcalBDTVariable = std::vector<T>;
35 
43 class EcalBaseData : public TObject {
44 public:
45  // hit-related
46  short TotalHits;
47  short ShowerHits;
48 
49  // energy-related
50  // clang-format off
52 
53  // shower reconstruction related
55  // clang-format on
56 
61  void Clear();
62 
67  void Dump() const;
68 
69 #ifdef ENABLE_PRODUCTION_CODE
70 
77  bool Fill(EcalShowerR *showerPtr);
78 #endif
79 
80  // ugly but better than saving 6 doubles for every event
81  // NB: it's gonna throw if the Ecal object is not valid
82  // NB2: thanks ROOT for not supporting std::vector<std::array>. Hopefully this is the only case where we have
83  // to use TVector3
84 
90  const TVector3 &GetCOG() const { return m_pointAndDir.at(0); }
91 
97  const TVector3 &GetDirection() const { return m_pointAndDir.at(1); }
98 
99 private:
100  void ResizeMembers();
101 
102  // this is used to store COG and direction of the Ecal axis reconstruction
103  std::vector<TVector3> m_pointAndDir;
104 
105  float _beta = 1.0;
106 
108 };
109 
117 class EcalPlusData : public TObject {
118 public:
119  // shower reconstruction related
122  // clang-format off
124  // clang-format on
126 
131  void Clear();
132 
137  void Dump() const;
138 
139 #ifdef ENABLE_PRODUCTION_CODE
140 
147  bool Fill(EcalShowerR *showerPtr);
148 #endif
149 
150 private:
151  void ResizeMembers();
152 
154 };
155 
164 class EcalBase : public OnDemandContainer<EcalBase>, public EcalBaseData {
165 public:
166  static const std::string BranchName;
167 
169 };
170 
179 class EcalPlus : public OnDemandContainer<EcalPlus>, public EcalPlusData {
180 public:
181  static const std::string BranchName;
182 
184 };
185 
186 } // namespace NAIA
187 #endif // __ECAL_H__
int EcalKHadronicFlag
Hadronic interaction flag (W. Xu reconstruction)
Definition: Ecal.h:121
std::vector< T > EcalLikelihoodVariable
Definition: Ecal.h:30
const TVector3 & GetCOG() const
Get the shower COG coordinates.
Definition: Ecal.h:90
short ShowerHits
Total number of Ecal hits in the shower.
Definition: Ecal.h:47
OnDemandContainer container class description.
ClassDef(EcalBaseData, 1)
void Clear()
Clear container content.
Definition: Ecal.cpp:18
std::vector< TVector3 > m_pointAndDir
Definition: Ecal.h:103
void Dump() const
Dump on screen container content.
Definition: Ecal.cpp:25
EcalBDTVariable< float > BDT
Ecal BDT estimator for e/p separation. See Ecal::BDTType for a list of available types.
Definition: Ecal.h:54
void Clear()
Clear container content.
Definition: Ecal.cpp:9
short TotalHits
Total number of Ecal hits.
Definition: Ecal.h:46
LayerVariable< float > MaxEnergyFraction
Energy fraction in the cell with the highest edep, for each Ecal layer.
Definition: Ecal.h:125
std::map< unsigned int, T > LayerVariable
Definition: Utils.h:54
void ResizeMembers()
Definition: EcalFill.cpp:38
Accessor class for EcalPlus info.
Definition: Ecal.h:179
void Dump() const
Dump on screen container content.
Definition: Ecal.cpp:62
Mixin class to add &quot;read-on-demand&quot; behavior to an existing container class.
int EcalKNShowers
Number of reconstructed showers (W. Xu reconstruction)
Definition: Ecal.h:120
std::vector< T > EcalEnergyVariable
Definition: Ecal.h:26
static const std::string BranchName
Definition: Ecal.h:166
std::vector< T > EcalBDTVariable
Definition: Ecal.h:34
EcalLikelihoodVariable< float > Likelihood
Likelihood variable for e/p separation (W. Xu reconstruction). See Ecal::LikelihoodType for a list of...
Definition: Ecal.h:123
static const std::string BranchName
Definition: Ecal.h:181
EcalEnergyVariable< float > Energy
Reconstructed shower energy. See Ecal::EnergyRecoType for a list of available energy reconstructions...
Definition: Ecal.h:51
void ResizeMembers()
Definition: EcalFill.cpp:8
const TVector3 & GetDirection() const
Get the shower Direction.
Definition: Ecal.h:97
ClassDef(EcalPlusData, 1)
Container class for additional Ecal info.
Definition: Ecal.h:117
Container class for base Ecal info.
Definition: Ecal.h:43
Accessor class for EcalBase info.
Definition: Ecal.h:164