NAIA
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
UnbExtHit.h
Go to the documentation of this file.
1 
7 #ifndef NAIA_UNBEXTHIT_H
8 #define NAIA_UNBEXTHIT_H
9 
10 // gbatch headers
11 #ifdef ENABLE_PRODUCTION_CODE
12 #include "root.h"
13 #endif
14 
16 #include "Containers/Tof.h"
17 #include "Containers/Utils.h"
18 
19 #include <array>
20 #include <map>
21 #include <vector>
22 
23 namespace NAIA {
24 
28 template <class T> using HitChargeVariable = std::map<TrTrack::ChargeRecoType, T>;
29 
35 class UnbExtHitBaseData : public TObject {
36 public:
41  enum class ExtHit : char { L1 = 0, L9 = 1 };
42 
43 #ifdef ENABLE_PRODUCTION_CODE
44  void Fill(AMSEventR *evPtr);
45 
46  void SetBeta(double beta) { _beta = beta; }
47  void SetMC(bool isMC) { _isMC = isMC; }
48 #endif
49 
54  void Clear();
55 
60  void Dump() const;
61 
67  bool IsHitPresent(ExtHit hit) const { return m_hits.find(hit) != end(m_hits); }
68 
75  int ChargeStatus(ExtHit hit) { return m_hits[hit].ChargeStatus; }
76 
83  float HitPosX(ExtHit hit) { return m_hits[hit].HitPosX; }
84 
91  float HitPosY(ExtHit hit) { return m_hits[hit].HitPosY; }
92 
100  float Charge(ExtHit hit, TrTrack::ChargeRecoType chType) { return m_hits[hit].Charge[chType]; }
101 
102  const TofBaseData *tofBase = nullptr;
103 
104  struct HitData {
105  int ChargeStatus = 0xFFFFFFFF;
106 
107  float HitPosX = std::numeric_limits<float>::max();
108  float HitPosY = std::numeric_limits<float>::max();
109 
111  };
112 
113 private:
114  bool _isMC = false;
115  float _beta = 1.0f;
116 
117  std::map<ExtHit, HitData> m_hits;
118 
119  ClassDef(UnbExtHitBaseData, 1)
120 };
121 
130 class UnbExtHitBase : public OnDemandContainer<UnbExtHitBase>, public UnbExtHitBaseData {
131 public:
132  static const std::string BranchName;
133 
135 };
136 
137 } // namespace NAIA
138 #endif
int ChargeStatus(ExtHit hit)
Get the charge status for required hit.
Definition: UnbExtHit.h:75
needed to get basic info without computing twice
Definition: UnbExtHit.h:104
OnDemandContainer container class description.
float HitPosX(ExtHit hit)
Hit position, X side.
Definition: UnbExtHit.h:83
float HitPosY(ExtHit hit)
Hit position, Y side.
Definition: UnbExtHit.h:91
std::map< TrTrack::ChargeRecoType, T > HitChargeVariable
Definition: UnbExtHit.h:28
Container class for base Tof info.
Definition: Tof.h:46
static const std::string BranchName
Definition: UnbExtHit.h:132
Accessor class for base unbiased external hits info.
Definition: UnbExtHit.h:130
Container class for base unbiased external hits info.
Definition: UnbExtHit.h:35
ChargeRecoType
Definition: Utils.h:84
bool IsHitPresent(ExtHit hit) const
Checks if there is a hit on required layer.
Definition: UnbExtHit.h:67
Mixin class to add &quot;read-on-demand&quot; behavior to an existing container class.
void Clear()
Clear container content.
Definition: UnbExtHit.cpp:9
void Dump() const
Dump on screen container content.
Definition: UnbExtHit.cpp:15
Tof container class description.
float Charge(ExtHit hit, TrTrack::ChargeRecoType chType)
Hit charge.
Definition: UnbExtHit.h:100
const TofBaseData * tofBase
Definition: UnbExtHit.h:102
HitChargeVariable< float > Charge
Definition: UnbExtHit.h:110
SingleTreeChain::EventItr end(SingleTreeChain &chain)
std::map< ExtHit, HitData > m_hits
Definition: UnbExtHit.h:117
ExtHit
Handy enum to distinguish L1 and L9.
Definition: UnbExtHit.h:41