CbmRoot
Loading...
Searching...
No Matches
CbmPixelHit.cxx
Go to the documentation of this file.
1/* Copyright (C) 2009-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer], Andrey Lebedev */
4
10#include "CbmPixelHit.h"
11
12#include <TVector3.h> // for TVector3
13
14#include <sstream> // for operator<<, basic_ostream, stringstream
15
16using std::endl;
17using std::stringstream;
18
19CbmPixelHit::CbmPixelHit() : CbmPixelHit(-1, 0., 0., 0., 0., 0., 0., 0., -1) {}
20
21CbmPixelHit::CbmPixelHit(int32_t address, const TVector3& pos, const TVector3& err, double dxy, int32_t refId,
22 double time, double timeError)
23 : CbmPixelHit(address, pos.X(), pos.Y(), pos.Z(), err.X(), err.Y(), err.Z(), dxy, refId, time, timeError)
24{
25}
26
27CbmPixelHit::CbmPixelHit(int32_t address, double x, double y, double z, double dx, double dy, double dz, double dxy,
28 int32_t refId, double time, double timeError)
29 : CbmHit(kPIXELHIT, z, dz, refId, address, time, timeError)
30 , fX(x)
31 , fY(y)
32 , fDx(dx)
33 , fDy(dy)
34 , fDxy(dxy)
35{
36}
37
39
40std::string CbmPixelHit::ToString() const
41{
42 stringstream ss;
43 ss << "CbmPixelHit: address=" << GetAddress() << " pos=(" << GetX() << "," << GetY() << "," << GetZ() << ") err=("
44 << GetDx() << "," << GetDy() << "," << GetDz() << ") dxy=" << GetDxy() << " refId=" << GetRefId() << endl;
45
46 return ss.str();
47}
48
49void CbmPixelHit::Position(TVector3& pos) const { pos.SetXYZ(GetX(), GetY(), GetZ()); }
50
51void CbmPixelHit::PositionError(TVector3& dpos) const { dpos.SetXYZ(GetDx(), GetDy(), GetDz()); }
52
53void CbmPixelHit::SetPosition(const TVector3& pos)
54{
55 SetX(pos.X());
56 SetY(pos.Y());
57 SetZ(pos.Z());
58}
59
61{
62 SetDx(dpos.X());
63 SetDy(dpos.Y());
64 SetDz(dpos.Z());
65}
66
@ kPIXELHIT
Definition CbmHit.h:23
TVector3 dpos
ClassImp(CbmPixelHit)
void SetDz(double dz)
Definition CbmHit.h:81
double GetDz() const
Definition CbmHit.h:72
int32_t GetAddress() const
Definition CbmHit.h:74
void SetZ(double z)
Definition CbmHit.h:80
double GetZ() const
Definition CbmHit.h:71
int32_t GetRefId() const
Definition CbmHit.h:73
void SetDx(double dx)
Definition CbmPixelHit.h:94
double GetDy() const
Definition CbmPixelHit.h:76
void Position(TVector3 &pos) const
Copies hit position to pos.
double GetDx() const
Definition CbmPixelHit.h:75
void PositionError(TVector3 &dpos) const
Copies hit position error to pos.
void SetX(double x)
Definition CbmPixelHit.h:92
double GetY() const
Definition CbmPixelHit.h:74
CbmPixelHit()
Default constructor.
virtual std::string ToString() const
Inherited from CbmBaseHit.
void SetY(double y)
Definition CbmPixelHit.h:93
void SetPositionError(const TVector3 &dpos)
virtual ~CbmPixelHit()
double GetX() const
Definition CbmPixelHit.h:73
void SetDy(double dy)
Definition CbmPixelHit.h:95
double GetDxy() const
Definition CbmPixelHit.h:77
void SetPosition(const TVector3 &pos)
Sets position of the hit.