CbmRoot
CbmLitHit.h
Go to the documentation of this file.
1 
8 #ifndef CBMLITHIT_H_
9 #define CBMLITHIT_H_
10 
11 #include "base/CbmLitEnums.h"
12 #include "base/CbmLitFloat.h"
13 
14 #include "TObject.h"
15 
16 #include <functional>
17 #include <string>
18 using std::string;
19 
26 class CbmLitHit {
27 public:
32  : fRefId(0)
34  , fZ(0.)
35  , fDz(0.)
36  , fT(0.)
37  , fDt(0.)
38  , fDetectorId(0) {}
39 
43  virtual ~CbmLitHit() {}
44 
45  /* Getters */
46  Int_t GetRefId() const { return fRefId; }
47  LitHitType GetType() const { return fHitType; }
48  litfloat GetZ() const { return fZ; }
49  litfloat GetDz() const { return fDz; }
50  litfloat GetT() const { return fT; }
51  litfloat GetDt() const { return fDt; }
54  }
55  Int_t GetStation() const {
56  return (fDetectorId & (WL_STATION << SB_STATION)) >> SB_STATION;
57  }
58 
59  /* Setters */
60  void SetRefId(Int_t refId) { fRefId = refId; }
61  void SetHitType(LitHitType hitType) { fHitType = hitType; }
62  void SetZ(litfloat z) { fZ = z; }
63  void SetDz(litfloat dz) { fDz = dz; }
64  void SetT(litfloat t) { fT = t; }
65  void SetDt(litfloat dt) { fDt = dt; }
66  void SetDetectorId(LitSystemId sysId, Int_t station) {
67  fDetectorId = (sysId << SB_SYSTEM) | (station << SB_STATION);
68  }
69 
74  virtual string ToString() const { return ""; }
75 
76 private:
77  Int_t fRefId; // reference to MC
79  fHitType; // type of the hit (strip, pixel, etc). Used to safely cast to the proper type.
80  litfloat fZ; // Z position of the hit [cm]
81  litfloat fDz; // Z position error of the hit [cm]
84 
85  // The detector ID consists of:
86  // system ID (0-15), bits 0-3
87  // station number (0-31), bits 4-9
88  Int_t fDetectorId; // Unique detector ID
89 
90  // Length of the index of the corresponding volume
91  static const Int_t WL_SYSTEM = 15;
92  static const Int_t WL_STATION = 31;
93  // Start bit for each volume
94  static const Int_t SB_SYSTEM = 0;
95  static const Int_t SB_STATION = 4;
96 };
97 
102  public std::binary_function<const CbmLitHit*, const CbmLitHit*, bool> {
103 public:
104  bool operator()(const CbmLitHit* hit1, const CbmLitHit* hit2) const {
105  return hit1->GetZ() < hit2->GetZ();
106  }
107 };
108 
113  public std::binary_function<const CbmLitHit*, const CbmLitHit*, bool> {
114 public:
115  bool operator()(const CbmLitHit* hit1, const CbmLitHit* hit2) const {
116  return hit1->GetZ() > hit2->GetZ();
117  }
118 };
119 
120 #endif /*CBMLITHIT_H_*/
CbmLitHit::GetT
litfloat GetT() const
Definition: CbmLitHit.h:50
CbmLitHit::WL_STATION
static const Int_t WL_STATION
Definition: CbmLitHit.h:92
CbmLitHit::SetZ
void SetZ(litfloat z)
Definition: CbmLitHit.h:62
CbmLitHit::SB_SYSTEM
static const Int_t SB_SYSTEM
Definition: CbmLitHit.h:94
litfloat
double litfloat
Definition: CbmLitFloat.h:15
CbmLitHit::SB_STATION
static const Int_t SB_STATION
Definition: CbmLitHit.h:95
CbmLitHit::GetZ
litfloat GetZ() const
Definition: CbmLitHit.h:48
CbmLitHit::fRefId
Int_t fRefId
Definition: CbmLitHit.h:77
CbmLitHit::GetDz
litfloat GetDz() const
Definition: CbmLitHit.h:49
CompareHitPtrZMore
Definition: CbmLitHit.h:113
CbmLitHit::fDetectorId
Int_t fDetectorId
Definition: CbmLitHit.h:88
CbmLitHit::GetRefId
Int_t GetRefId() const
Definition: CbmLitHit.h:46
CbmLitHit::SetDetectorId
void SetDetectorId(LitSystemId sysId, Int_t station)
Definition: CbmLitHit.h:66
CbmLitHit::SetDt
void SetDt(litfloat dt)
Definition: CbmLitHit.h:65
CbmLitEnums.h
Define enumerations used in littrack.
CbmLitHit::~CbmLitHit
virtual ~CbmLitHit()
Destructor.
Definition: CbmLitHit.h:43
CbmLitHit::SetRefId
void SetRefId(Int_t refId)
Definition: CbmLitHit.h:60
CbmLitHit::ToString
virtual string ToString() const
Return string representation of class.
Definition: CbmLitHit.h:74
CbmLitHit::fT
litfloat fT
Definition: CbmLitHit.h:82
CbmLitHit
Base data class for hits.
Definition: CbmLitHit.h:26
CbmLitHit::SetT
void SetT(litfloat t)
Definition: CbmLitHit.h:64
kLITPIXELHIT
@ kLITPIXELHIT
Definition: CbmLitEnums.h:16
CbmLitFloat.h
Define floating point number type litfloat.
CbmLitHit::SetHitType
void SetHitType(LitHitType hitType)
Definition: CbmLitHit.h:61
CbmLitHit::GetStation
Int_t GetStation() const
Definition: CbmLitHit.h:55
CbmLitHit::fHitType
LitHitType fHitType
Definition: CbmLitHit.h:79
LitHitType
LitHitType
Definition: CbmLitEnums.h:14
CbmLitHit::GetDt
litfloat GetDt() const
Definition: CbmLitHit.h:51
CbmLitHit::SetDz
void SetDz(litfloat dz)
Definition: CbmLitHit.h:63
LitSystemId
LitSystemId
Definition: CbmLitEnums.h:40
CbmLitHit::fZ
litfloat fZ
Definition: CbmLitHit.h:80
CompareHitPtrZMore::operator()
bool operator()(const CbmLitHit *hit1, const CbmLitHit *hit2) const
Definition: CbmLitHit.h:115
CompareHitPtrZLess
Definition: CbmLitHit.h:102
CbmLitHit::WL_SYSTEM
static const Int_t WL_SYSTEM
Definition: CbmLitHit.h:91
CompareHitPtrZLess::operator()
bool operator()(const CbmLitHit *hit1, const CbmLitHit *hit2) const
Definition: CbmLitHit.h:104
CbmLitHit::GetSystem
LitSystemId GetSystem() const
Definition: CbmLitHit.h:52
CbmLitHit::fDt
litfloat fDt
Definition: CbmLitHit.h:83
CbmLitHit::GetType
LitHitType GetType() const
Definition: CbmLitHit.h:47
CbmLitHit::fDz
litfloat fDz
Definition: CbmLitHit.h:81
CbmLitHit::CbmLitHit
CbmLitHit()
Constructor.
Definition: CbmLitHit.h:31