CbmRoot
CbmTrdHit.cxx
Go to the documentation of this file.
1 
6 #include "CbmTrdHit.h"
7 
8 #include "CbmHit.h" // for kTRDHIT
9 
10 #include <TVector3.h> // for TVector3
11 
12 #include <sstream> // for operator<<, basic_ostream, stringstream
13 
14 using std::endl;
15 using std::stringstream;
16 
17 CbmTrdHit::CbmTrdHit() : CbmPixelHit(), fDefine(0), fELoss(-1.) {
19  SetTime(-1);
20  SetTimeError(-1);
21 }
22 
23 CbmTrdHit::CbmTrdHit(Int_t address,
24  const TVector3& pos,
25  const TVector3& dpos,
26  Double_t dxy,
27  Int_t refId,
28  Double_t eLoss,
29  Double_t time,
30  Double_t timeError)
31  : CbmPixelHit(address, pos, dpos, dxy, refId), fDefine(0), fELoss(eLoss) {
33  SetTime(time);
34  SetTimeError(timeError);
35 }
36 
38 
39 std::string CbmTrdHit::ToString() const {
40  stringstream ss;
41  ss << CbmPixelHit::ToString();
42  ss << "CbmTrdHit: time[ns]=" << GetTime() << "+-" << GetTimeError()
43  << " eloss=" << GetELoss();
44  if (GetClassType())
45  ss << " typ[T]" << (GetMaxType() ? "Max{T}" : "Max{R}");
46  else
47  ss << " typ[R]";
48  ss << " RC=" << (IsRowCross() ? 'y' : 'n')
49  << " Ovf=" << (HasOverFlow() ? 'y' : 'n') << endl;
50  return ss.str();
51 }
52 
CbmTrdHit::GetClassType
Bool_t GetClassType() const
Definition: CbmTrdHit.h:80
ClassImp
ClassImp(CbmTrdHit)
CbmTrdHit::~CbmTrdHit
virtual ~CbmTrdHit()
Destructor.
Definition: CbmTrdHit.cxx:37
CbmTrdHit::GetELoss
Double_t GetELoss() const
Definition: CbmTrdHit.h:79
CbmTrdHit
data class for a reconstructed Energy-4D measurement in the TRD
Definition: CbmTrdHit.h:35
CbmTrdHit::GetMaxType
Bool_t GetMaxType() const
Definition: CbmTrdHit.h:81
CbmTrdHit::IsRowCross
Bool_t IsRowCross() const
Definition: CbmTrdHit.h:83
CbmHit::SetType
void SetType(HitType type)
Sets hit type.
Definition: CbmHit.h:112
CbmHit::GetTimeError
Double_t GetTimeError() const
Definition: CbmHit.h:76
CbmHit.h
dpos
TVector3 dpos
Definition: CbmMvdSensorDigiToHitTask.cxx:61
CbmHit::GetTime
Double_t GetTime() const
Definition: CbmHit.h:75
CbmTrdHit.h
Class for hits in TRD detector.
kTRDHIT
@ kTRDHIT
Definition: CbmHit.h:25
CbmPixelHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition: CbmPixelHit.cxx:56
CbmHit::SetTimeError
void SetTimeError(Double_t error)
Definition: CbmHit.h:89
CbmHit::SetTime
void SetTime(Double_t time)
Definition: CbmHit.h:84
CbmTrdHit::ToString
virtual std::string ToString() const
Inherited from CbmBaseHit.
Definition: CbmTrdHit.cxx:39
CbmTrdHit::HasOverFlow
Bool_t HasOverFlow() const
Definition: CbmTrdHit.h:82
CbmTrdHit::CbmTrdHit
CbmTrdHit()
Default constructor.
Definition: CbmTrdHit.cxx:17
pos
TVector3 pos
Definition: CbmMvdSensorDigiToHitTask.cxx:60
CbmPixelHit
Definition: CbmPixelHit.h:21