CbmRoot
core/data/tof/CbmTofHit.h
Go to the documentation of this file.
1 
10 #ifndef CBMTOFHIT_H_
11 #define CBMTOFHIT_H_
12 
13 #include <Rtypes.h> // for ClassDef
14 #include <RtypesCore.h> // for Int_t, Double_t
15 #include <TMath.h> // for Sqrt
16 #include <TVector3.h> // for TVector3
17 
18 #include <string> // for string
19 
20 #include "CbmHit.h" // for CbmHit
21 #include "CbmPixelHit.h" // for CbmPixelHit
22 
23 #include <boost/serialization/access.hpp>
24 #include <boost/serialization/base_object.hpp>
25 
26 class CbmTofHit : public CbmPixelHit {
27 public:
31  CbmTofHit();
32 
36  CbmTofHit(Int_t address,
37  TVector3 pos,
38  TVector3 dpos,
39  Int_t refIndex,
40  Double_t time,
41  Double_t dtime,
42  Int_t flag,
43  Int_t channel);
44 
48  CbmTofHit(Int_t address,
49  TVector3 pos,
50  TVector3 dpos,
51  Int_t refIndex,
52  Double_t tof,
53  Int_t flag,
54  Int_t channel);
55 
59  CbmTofHit(Int_t address,
60  TVector3 pos,
61  TVector3 dpos,
62  Int_t refIndex,
63  Double_t tof,
64  Int_t flag);
65 
69  CbmTofHit(Int_t address,
70  TVector3 pos,
71  TVector3 dpos,
72  Int_t refIndex,
73  Double_t tof);
74 
78  virtual ~CbmTofHit();
79 
83  virtual std::string ToString() const;
84 
88  Int_t GetPlaneId() const { return 0; }
89 
91  Int_t GetFlag() const { return fFlag; }
92  Int_t GetCh() const { return fChannel; }
93 
94  Double_t GetR() const {
95  return TMath::Sqrt(GetX() * GetX() + GetY() * GetY() + GetZ() * GetZ());
96  }
97  Double_t GetRt() const {
98  return TMath::Sqrt(GetX() * GetX() + GetY() * GetY());
99  }
100  Double_t GetCosThe() const { return GetZ() / GetR(); }
101  Double_t GetSinThe() const {
102  return TMath::Sqrt(GetX() * GetX() + GetY() * GetY()) / GetR();
103  }
104  Double_t GetCosPhi() const { return GetX() / GetRt(); }
105  Double_t GetSinPhi() const { return GetY() / GetRt(); }
106 
108  void SetFlag(Int_t flag) { fFlag = flag; };
109 
110  // Make this method otherwise inherited from CbmHit through CbmPixelHit
111  // private to prevent its usage
112  Int_t GetRefId() const __attribute__((deprecated)) { return -1; }
113  // Field is instead used to store the number of strips used to generate the hit
114  Int_t GetClusterSize() { return CbmHit::GetRefId(); }
115 
116 private:
117  Int_t fFlag;
118  Int_t fChannel;
119 
121 
122  template<class Archive>
123  void serialize(Archive& ar, const unsigned int /*version*/) {
124  ar& fFlag;
125  ar& fChannel;
126  }
127 
128  ClassDef(CbmTofHit, 4)
129 };
130 
131 #endif
CbmTofHit::GetSinPhi
Double_t GetSinPhi() const
Definition: core/data/tof/CbmTofHit.h:105
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmTofHit::GetClusterSize
Int_t GetClusterSize()
Definition: core/data/tof/CbmTofHit.h:114
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmTofHit::serialize
void serialize(Archive &ar, const unsigned int)
Definition: core/data/tof/CbmTofHit.h:123
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
CbmTofHit::GetCh
Int_t GetCh() const
Definition: core/data/tof/CbmTofHit.h:92
CbmTofHit::CbmTofHit
CbmTofHit()
Default constructor.
Definition: CbmTofHit.cxx:17
CbmTofHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition: CbmTofHit.cxx:71
__attribute__
nsL1vector __attribute__
CbmHit.h
dpos
TVector3 dpos
Definition: CbmMvdSensorDigiToHitTask.cxx:61
CbmTofHit::GetRefId
Int_t GetRefId() const __attribute__((deprecated))
Definition: core/data/tof/CbmTofHit.h:112
CbmTofHit::~CbmTofHit
virtual ~CbmTofHit()
Destructor.
Definition: CbmTofHit.cxx:69
CbmTofHit::GetR
Double_t GetR() const
Definition: core/data/tof/CbmTofHit.h:94
CbmPixelHit.h
CbmTofHit::GetFlag
Int_t GetFlag() const
Definition: core/data/tof/CbmTofHit.h:91
CbmPixelHit::ClassDef
ClassDef(CbmPixelHit, 1)
CbmTofHit::GetSinThe
Double_t GetSinThe() const
Definition: core/data/tof/CbmTofHit.h:101
CbmTofHit::fFlag
Int_t fFlag
Flag for general purposes [TDC, event tagging...].
Definition: core/data/tof/CbmTofHit.h:117
CbmTofHit::GetRt
Double_t GetRt() const
Definition: core/data/tof/CbmTofHit.h:97
CbmTofHit::access
friend class boost::serialization::access
Definition: core/data/tof/CbmTofHit.h:120
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmPixelHit
Definition: CbmPixelHit.h:21
CbmTofHit
Definition: core/data/tof/CbmTofHit.h:26
CbmTofHit::fChannel
Int_t fChannel
Channel identifier.
Definition: core/data/tof/CbmTofHit.h:118
CbmTofHit::GetCosThe
Double_t GetCosThe() const
Definition: core/data/tof/CbmTofHit.h:100
CbmTofHit::GetCosPhi
Double_t GetCosPhi() const
Definition: core/data/tof/CbmTofHit.h:104
CbmTofHit::SetFlag
void SetFlag(Int_t flag)
Definition: core/data/tof/CbmTofHit.h:108
CbmTofHit::GetPlaneId
Int_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition: core/data/tof/CbmTofHit.h:88