CbmRoot
CbmHit.cxx
Go to the documentation of this file.
1 
8 #include "CbmHit.h"
9 
10 #include "CbmMatch.h" // for CbmMatch
11 
12 #include <TObject.h> // for TObject
13 
14 CbmHit::CbmHit() : CbmHit(kHIT, 0., 0., -1, -1, -1., -1.) {}
15 
17  Double_t _z,
18  Double_t _dz,
19  Int_t _refId,
20  Int_t _address,
21  Double_t _time,
22  Double_t _timeError)
23  : TObject()
24  , fType(_type)
25  , fZ(_z)
26  , fDz(_dz)
27  , fRefId(_refId)
28  , fAddress(_address)
29  , fTime(_time)
30  , fTimeError(_timeError)
31  , fMatch(nullptr) {}
32 
33 // Only shallow copy needed
35  : TObject(rhs)
36  , fType(rhs.fType)
37  , fZ(rhs.fZ)
38  , fDz(rhs.fDz)
39  , fRefId(rhs.fRefId)
40  , fAddress(rhs.fAddress)
41  , fTime(rhs.fTime)
42  , fTimeError(rhs.fTimeError)
43  , fMatch(nullptr) {}
44 
45 // Only shallow copy needed
47 
48  if (this != &rhs) {
49  TObject::operator=(rhs);
50  fType = rhs.fType;
51  fZ = rhs.fZ;
52  fDz = rhs.fDz;
53  fRefId = rhs.fRefId;
54  fAddress = rhs.fAddress;
55  fTime = rhs.fTime;
56  fTimeError = rhs.fTimeError;
57  fMatch = nullptr;
58  }
59  return *this;
60 }
61 
63  if (fMatch) delete fMatch;
64 }
65 
66 void CbmHit::SetMatch(CbmMatch* match) {
67  if (fMatch) delete fMatch;
68  fMatch = match;
69 }
70 
CbmMatch
Definition: CbmMatch.h:22
CbmHit::~CbmHit
virtual ~CbmHit()
Destructor.
Definition: CbmHit.cxx:62
CbmHit::fTimeError
Double_t fTimeError
Error of hit time [ns].
Definition: CbmHit.h:124
CbmHit::CbmHit
CbmHit()
Default constructor.
Definition: CbmHit.cxx:14
CbmMatch.h
CbmHit::fType
HitType fType
hit type
Definition: CbmHit.h:118
CbmHit::fRefId
Int_t fRefId
some reference id (usually to cluster, digi or MC point)
Definition: CbmHit.h:121
CbmHit.h
HitType
HitType
Definition: CbmHit.h:16
CbmHit::fTime
Double_t fTime
Hit time [ns].
Definition: CbmHit.h:123
kHIT
@ kHIT
Definition: CbmHit.h:17
ClassImp
ClassImp(CbmHit)
CbmHit::operator=
CbmHit & operator=(const CbmHit &)
Definition: CbmHit.cxx:46
CbmHit
Definition: CbmHit.h:38
CbmHit::SetMatch
void SetMatch(CbmMatch *match)
Definition: CbmHit.cxx:66
CbmHit::fMatch
CbmMatch * fMatch
Monte-Carlo information.
Definition: CbmHit.h:125
CbmHit::fZ
Double_t fZ
Z position of hit [cm].
Definition: CbmHit.h:119
CbmHit::fDz
Double_t fDz
Z position error [cm].
Definition: CbmHit.h:120
CbmHit::fAddress
Int_t fAddress
detector unique identifier
Definition: CbmHit.h:122