CbmRoot
MQ/hitbuilder/CbmTofHit.h
Go to the documentation of this file.
1 
10 #ifndef CBMTOFHIT_H_
11 #define CBMTOFHIT_H_
12 
13 #include "CbmPixelHit.h"
14 #include "TMath.h"
15 
16 #include <boost/serialization/access.hpp>
17 #include <boost/serialization/base_object.hpp>
18 
19 class CbmTofHit : public CbmPixelHit {
20 public:
25 
29  CbmTofHit(Int_t address,
30  TVector3 pos,
31  TVector3 dpos,
32  Int_t refIndex,
33  Double_t time,
34  Double_t dtime,
35  Int_t flag,
36  Int_t channel);
37 
41  CbmTofHit(Int_t address,
42  TVector3 pos,
43  TVector3 dpos,
44  Int_t refIndex,
45  Double_t tof,
46  Int_t flag,
47  Int_t channel);
48 
52  CbmTofHit(Int_t address,
53  TVector3 pos,
54  TVector3 dpos,
55  Int_t refIndex,
56  Double_t tof,
57  Int_t flag);
58 
62  CbmTofHit(Int_t address,
63  TVector3 pos,
64  TVector3 dpos,
65  Int_t refIndex,
66  Double_t tof);
67 
71  virtual ~CbmTofHit();
72 
76  virtual std::string ToString() const;
77 
81  Int_t GetPlaneId() const { return 0; }
82 
84  Int_t GetFlag() const { return fFlag; }
85  Int_t GetCh() const { return fChannel; }
86 
87  Double_t GetR() const {
88  return TMath::Sqrt(GetX() * GetX() + GetY() * GetY() + GetZ() * GetZ());
89  }
90  Double_t GetRt() const {
91  return TMath::Sqrt(GetX() * GetX() + GetY() * GetY());
92  }
93  Double_t GetCosThe() const { return GetZ() / GetR(); }
94  Double_t GetSinThe() const {
95  return TMath::Sqrt(GetX() * GetX() + GetY() * GetY()) / GetR();
96  }
97  Double_t GetCosPhi() const { return GetX() / GetRt(); }
98  Double_t GetSinPhi() const { return GetY() / GetRt(); }
99 
101  void SetFlag(Int_t flag) { fFlag = flag; };
102 
103  // Make this method otherwise inherited from CbmHit through CbmPixelHit
104  // private to prevent its usage
105  Int_t GetRefId() const __attribute__((deprecated)) { return -1; }
106  // Field is instead used to store the number of strips used to generate the hit
107  Int_t GetClusterSize() { return CbmHit::GetRefId(); }
108 
109 private:
110  Int_t fFlag;
111  Int_t fChannel;
112 
113  friend class boost::serialization::access;
114 
115  template<class Archive>
116  void serialize(Archive& ar, const unsigned int /*version*/) {
117  ar& fFlag;
118  ar& fChannel;
119  }
120 
121  ClassDef(CbmTofHit, 4)
122 };
123 
124 #endif
CbmTofHit::GetSinPhi
Double_t GetSinPhi() const
Definition: MQ/hitbuilder/CbmTofHit.h:98
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmTofHit::CbmTofHit
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t tof, Int_t flag, Int_t channel)
Constructor with hit parameters (1a).
CbmTofHit::GetClusterSize
Int_t GetClusterSize()
Definition: MQ/hitbuilder/CbmTofHit.h:107
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmTofHit::serialize
void serialize(Archive &ar, const unsigned int)
Definition: MQ/hitbuilder/CbmTofHit.h:116
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
CbmTofHit::GetCh
Int_t GetCh() const
Definition: MQ/hitbuilder/CbmTofHit.h:85
CbmTofHit::CbmTofHit
CbmTofHit()
Default constructor.
__attribute__
nsL1vector __attribute__
dpos
TVector3 dpos
Definition: CbmMvdSensorDigiToHitTask.cxx:61
CbmTofHit::GetRefId
Int_t GetRefId() const __attribute__((deprecated))
Definition: MQ/hitbuilder/CbmTofHit.h:105
CbmTofHit::GetR
Double_t GetR() const
Definition: MQ/hitbuilder/CbmTofHit.h:87
CbmPixelHit.h
CbmTofHit::CbmTofHit
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t tof, Int_t flag)
Constructor with hit parameters (1).
CbmTofHit::GetFlag
Int_t GetFlag() const
Definition: MQ/hitbuilder/CbmTofHit.h:84
CbmTofHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
CbmPixelHit::ClassDef
ClassDef(CbmPixelHit, 1)
CbmTofHit::CbmTofHit
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t time, Double_t dtime, Int_t flag, Int_t channel)
Constructor with hit parameters (1b).
CbmTofHit::GetSinThe
Double_t GetSinThe() const
Definition: MQ/hitbuilder/CbmTofHit.h:94
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: MQ/hitbuilder/CbmTofHit.h:90
CbmTofHit::~CbmTofHit
virtual ~CbmTofHit()
Destructor.
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::CbmTofHit
CbmTofHit(Int_t address, TVector3 pos, TVector3 dpos, Int_t refIndex, Double_t tof)
Constructor with hit parameters (2) [not the flag].
CbmTofHit::GetCosThe
Double_t GetCosThe() const
Definition: MQ/hitbuilder/CbmTofHit.h:93
CbmTofHit::GetCosPhi
Double_t GetCosPhi() const
Definition: MQ/hitbuilder/CbmTofHit.h:97
CbmTofHit::SetFlag
void SetFlag(Int_t flag)
Definition: MQ/hitbuilder/CbmTofHit.h:101
CbmTofHit::GetPlaneId
Int_t GetPlaneId() const
Inherited from CbmBaseHit.
Definition: MQ/hitbuilder/CbmTofHit.h:81