CbmRoot
CbmPixelHit.cxx
Go to the documentation of this file.
1 
6 #include "CbmPixelHit.h"
7 
8 #include <TVector3.h> // for TVector3
9 
10 #include <sstream> // for operator<<, basic_ostream, stringstream
11 
12 using std::endl;
13 using std::stringstream;
14 
15 CbmPixelHit::CbmPixelHit() : CbmPixelHit(-1, 0., 0., 0., 0., 0., 0., 0., -1) {}
16 
18  const TVector3& pos,
19  const TVector3& err,
20  Double_t dxy,
21  Int_t refId,
22  Double_t time,
23  Double_t timeError)
24  : CbmPixelHit(address,
25  pos.X(),
26  pos.Y(),
27  pos.Z(),
28  err.X(),
29  err.Y(),
30  err.Z(),
31  dxy,
32  refId,
33  time,
34  timeError) {}
35 
37  Double_t x,
38  Double_t y,
39  Double_t z,
40  Double_t dx,
41  Double_t dy,
42  Double_t dz,
43  Double_t dxy,
44  Int_t refId,
45  Double_t time,
46  Double_t timeError)
47  : CbmHit(kPIXELHIT, z, dz, refId, address, time, timeError)
48  , fX(x)
49  , fY(y)
50  , fDx(dx)
51  , fDy(dy)
52  , fDxy(dxy) {}
53 
55 
56 std::string CbmPixelHit::ToString() const {
57  stringstream ss;
58  ss << "CbmPixelHit: address=" << GetAddress() << " pos=(" << GetX() << ","
59  << GetY() << "," << GetZ() << ") err=(" << GetDx() << "," << GetDy() << ","
60  << GetDz() << ") dxy=" << GetDxy() << " refId=" << GetRefId() << endl;
61  return ss.str();
62 }
63 
64 void CbmPixelHit::Position(TVector3& pos) const {
65  pos.SetXYZ(GetX(), GetY(), GetZ());
66 }
67 
68 void CbmPixelHit::PositionError(TVector3& dpos) const {
69  dpos.SetXYZ(GetDx(), GetDy(), GetDz());
70 }
71 
72 void CbmPixelHit::SetPosition(const TVector3& pos) {
73  SetX(pos.X());
74  SetY(pos.Y());
75  SetZ(pos.Z());
76 }
77 
78 void CbmPixelHit::SetPositionError(const TVector3& dpos) {
79  SetDx(dpos.X());
80  SetDy(dpos.Y());
81  SetDz(dpos.Z());
82 }
83 
CbmHit::GetZ
Double_t GetZ() const
Definition: CbmHit.h:70
CbmPixelHit::SetY
void SetY(Double_t y)
Definition: CbmPixelHit.h:103
CbmPixelHit::GetDxy
Double_t GetDxy() const
Definition: CbmPixelHit.h:87
CbmPixelHit::Position
void Position(TVector3 &pos) const
Copies hit position to pos.
Definition: CbmPixelHit.cxx:64
CbmPixelHit::GetX
Double_t GetX() const
Definition: CbmPixelHit.h:83
CbmPixelHit::GetY
Double_t GetY() const
Definition: CbmPixelHit.h:84
CbmPixelHit::GetDx
Double_t GetDx() const
Definition: CbmPixelHit.h:85
ClassImp
ClassImp(CbmPixelHit)
CbmHit::SetDz
void SetDz(Double_t dz)
Definition: CbmHit.h:80
CbmHit::GetRefId
Int_t GetRefId() const
Definition: CbmHit.h:72
CbmPixelHit::GetDy
Double_t GetDy() const
Definition: CbmPixelHit.h:86
CbmPixelHit::SetDy
void SetDy(Double_t dy)
Definition: CbmPixelHit.h:105
dpos
TVector3 dpos
Definition: CbmMvdSensorDigiToHitTask.cxx:61
CbmHit::GetAddress
Int_t GetAddress() const
Definition: CbmHit.h:73
CbmPixelHit::SetPositionError
void SetPositionError(const TVector3 &dpos)
Definition: CbmPixelHit.cxx:78
CbmPixelHit::SetDx
void SetDx(Double_t dx)
Definition: CbmPixelHit.h:104
CbmPixelHit.h
kPIXELHIT
@ kPIXELHIT
Definition: CbmHit.h:18
CbmPixelHit::SetX
void SetX(Double_t x)
Definition: CbmPixelHit.h:102
CbmPixelHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition: CbmPixelHit.cxx:56
CbmHit::SetZ
void SetZ(Double_t z)
Definition: CbmHit.h:79
CbmHit
Definition: CbmHit.h:38
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmPixelHit::SetPosition
void SetPosition(const TVector3 &pos)
Sets position of the hit.
Definition: CbmPixelHit.cxx:72
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmPixelHit::~CbmPixelHit
virtual ~CbmPixelHit()
Definition: CbmPixelHit.cxx:54
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmPixelHit
Definition: CbmPixelHit.h:21
CbmPixelHit::CbmPixelHit
CbmPixelHit()
Default constructor.
Definition: CbmPixelHit.cxx:15
CbmPixelHit::PositionError
void PositionError(TVector3 &dpos) const
Copies hit position error to pos.
Definition: CbmPixelHit.cxx:68
CbmHit::GetDz
Double_t GetDz() const
Definition: CbmHit.h:71