CbmRoot
CbmHit.h
Go to the documentation of this file.
1 
13 #ifndef CBMHIT_H_
14 #define CBMHIT_H_
15 
16 enum HitType {
27  kECALHIT
28 };
29 
30 #include <Rtypes.h> // for THashConsistencyHolder, ClassDef
31 #include <RtypesCore.h> // for Double_t, Int_t
32 #include <TObject.h> // for TObject
33 
34 #include <string> // for string, basic_string
35 
36 class CbmMatch;
37 
38 class CbmHit : public TObject {
39 public:
43  CbmHit();
44 
55  CbmHit(HitType _type,
56  Double_t _z,
57  Double_t _dz,
58  Int_t _refId,
59  Int_t _address,
60  Double_t _time = -1.,
61  Double_t _timeError = -1.);
62 
66  virtual ~CbmHit();
67 
68  /* Accessors */
69  HitType GetType() const { return fType; }
70  Double_t GetZ() const { return fZ; }
71  Double_t GetDz() const { return fDz; }
72  Int_t GetRefId() const { return fRefId; }
73  Int_t GetAddress() const { return fAddress; }
74  CbmMatch* GetMatch() const { return fMatch; }
75  Double_t GetTime() const { return fTime; }
76  Double_t GetTimeError() const { return fTimeError; }
77 
78  /* Setters */
79  void SetZ(Double_t z) { fZ = z; }
80  void SetDz(Double_t dz) { fDz = dz; }
81  void SetRefId(Int_t refId) { fRefId = refId; }
82  void SetAddress(Int_t address) { fAddress = address; }
83  void SetMatch(CbmMatch* match);
84  void SetTime(Double_t time) { fTime = time; }
85  void SetTime(Double_t time, Double_t error) {
86  fTime = time;
87  fTimeError = error;
88  }
89  void SetTimeError(Double_t error) { fTimeError = error; }
90 
97  virtual Int_t GetPlaneId() const { return -1; }
98 
103  virtual std::string ToString() const {
104  return "Has to be implemented in derrived class";
105  }
106 
107 protected:
112  void SetType(HitType type) { fType = type; }
113  CbmHit(const CbmHit&);
114  CbmHit& operator=(const CbmHit&);
115 
116 
117 private:
119  Double_t fZ;
120  Double_t fDz;
121  Int_t fRefId;
122  Int_t fAddress;
123  Double_t fTime;
124  Double_t fTimeError;
126 
128 };
129 
130 #endif /* CBMHIT_H_ */
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmMatch
Definition: CbmMatch.h:22
CbmHit::~CbmHit
virtual ~CbmHit()
Destructor.
Definition: CbmHit.cxx:62
CbmHit::fTimeError
Double_t fTimeError
Error of hit time [ns].
Definition: CbmHit.h:124
kMVDHIT
@ kMVDHIT
Definition: CbmHit.h:21
CbmHit::ToString
virtual std::string ToString() const
Virtual function. Must be implemented in derived class. Has to return string representation of the ob...
Definition: CbmHit.h:103
CbmHit::CbmHit
CbmHit()
Default constructor.
Definition: CbmHit.cxx:14
CbmHit::SetDz
void SetDz(Double_t dz)
Definition: CbmHit.h:80
kTOFHIT
@ kTOFHIT
Definition: CbmHit.h:26
kECALHIT
@ kECALHIT
Definition: CbmHit.h:27
kSTRIPHIT
@ kSTRIPHIT
Definition: CbmHit.h:19
CbmHit::SetAddress
void SetAddress(Int_t address)
Definition: CbmHit.h:82
CbmHit::SetType
void SetType(HitType type)
Sets hit type.
Definition: CbmHit.h:112
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
CbmHit::GetTimeError
Double_t GetTimeError() const
Definition: CbmHit.h:76
CbmHit::GetPlaneId
virtual Int_t GetPlaneId() const
Definition: CbmHit.h:97
CbmHit::SetRefId
void SetRefId(Int_t refId)
Definition: CbmHit.h:81
CbmHit::GetMatch
CbmMatch * GetMatch() const
Definition: CbmHit.h:74
CbmHit::fType
HitType fType
hit type
Definition: CbmHit.h:118
CbmHit::fRefId
Int_t fRefId
some reference id (usually to cluster, digi or MC point)
Definition: CbmHit.h:121
CbmHit::SetTime
void SetTime(Double_t time, Double_t error)
Definition: CbmHit.h:85
HitType
HitType
Definition: CbmHit.h:16
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmHit::fTime
Double_t fTime
Hit time [ns].
Definition: CbmHit.h:123
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
kHIT
@ kHIT
Definition: CbmHit.h:17
kPIXELHIT
@ kPIXELHIT
Definition: CbmHit.h:18
kTRDHIT
@ kTRDHIT
Definition: CbmHit.h:25
CbmHit::SetTimeError
void SetTimeError(Double_t error)
Definition: CbmHit.h:89
CbmHit::SetTime
void SetTime(Double_t time)
Definition: CbmHit.h:84
CbmHit::ClassDef
ClassDef(CbmHit, 3)
CbmHit::operator=
CbmHit & operator=(const CbmHit &)
Definition: CbmHit.cxx:46
CbmHit::SetZ
void SetZ(Double_t z)
Definition: CbmHit.h:79
kSTSHIT
@ kSTSHIT
Definition: CbmHit.h:20
CbmHit
Definition: CbmHit.h:38
kMUCHSTRAWHIT
@ kMUCHSTRAWHIT
Definition: CbmHit.h:24
kMUCHPIXELHIT
@ kMUCHPIXELHIT
Definition: CbmHit.h:23
CbmHit::SetMatch
void SetMatch(CbmMatch *match)
Definition: CbmHit.cxx:66
CbmHit::fMatch
CbmMatch * fMatch
Monte-Carlo information.
Definition: CbmHit.h:125
CbmHit::fZ
Double_t fZ
Z position of hit [cm].
Definition: CbmHit.h:119
CbmHit::fDz
Double_t fDz
Z position error [cm].
Definition: CbmHit.h:120
kRICHHIT
@ kRICHHIT
Definition: CbmHit.h:22
CbmHit::GetType
HitType GetType() const
Definition: CbmHit.h:69
CbmHit::fAddress
Int_t fAddress
detector unique identifier
Definition: CbmHit.h:122
CbmHit::GetDz
Double_t GetDz() const
Definition: CbmHit.h:71