BmnRoot
Loading...
Searching...
No Matches
BmnNdetCell.cxx
Go to the documentation of this file.
1
8#include "BmnNdetCell.h"
9
10#include "BmnDetectorList.h"
11
13 : FairHit()
15 , fAddress(0)
16 , fSignal(0)
17{
18 SetTimeStamp(0.);
19 SetDetectorID(kNDET);
20}
21
22BmnNdetCell::BmnNdetCell(uint32_t address,
23 double time,
24 double signal,
25 TVector3 posHit,
26 TVector3 posHitErr,
27 int pointIndx)
28 : FairHit(kNDET, posHit, posHitErr, pointIndx)
30 , fAddress(address)
31 , fSignal(signal)
32{
33 SetTimeStamp(time);
34}
35
36// Copy constructor
38 : FairHit(other)
40 , fAddress(other.fAddress)
41 , fSignal(other.fSignal)
42{}
43
44// Move constructor
46 : FairHit(std::move(other))
48 , fAddress(other.fAddress)
49 , fSignal(other.fSignal)
50{
51 other.fAddress = 0;
52 other.fSignal = 0;
53}
54
55// Copy assignment operator
57{
58 if (this != &other) {
59 FairHit::operator=(other);
60 fAddress = other.fAddress;
61 fSignal = other.fSignal;
62 }
63 return *this;
64}
65
66// Move assignment operator
68{
69 if (this != &other) {
70 FairHit::operator=(std::move(other));
71 fAddress = other.fAddress;
72 fSignal = other.fSignal;
73 other.fAddress = 0;
74 other.fSignal = 0;
75 }
76 return *this;
77}
78
80
81void BmnNdetCell::Print(Option_t* option) const
82{
83 printf("%s: %s\n", GetClassName(), BmnNdetAddress::GetInfoString(GetAddress()).c_str());
84 printf(" Signal: %.2f\n", fSignal);
85 printf(" Time: %.2f\n", GetTime());
86}
87
89{
90 SetSignal(0.);
91 SetTimeStamp(0.);
92 ResetLinks();
93 SetRefIndex(-1);
94}
95
97{
99 TVector3 zero;
100 SetPosition(zero);
101 SetPositionError(zero);
102}
@ kNDET
interface to use the address methods
static std::string GetInfoString(uint32_t address)
Return a formatted string with all address components.
uint32_t GetAddress() const
Definition BmnNdetCell.h:44
void SetSignal(double signal)
Definition BmnNdetCell.h:40
double GetTime() const
Definition BmnNdetCell.h:46
virtual ~BmnNdetCell()
virtual void Print(Option_t *option="") const override
BmnNdetCell & operator=(const BmnNdetCell &)
void ResetTimeEnergy()
virtual const char * GetClassName() const
Definition BmnNdetCell.h:33
STL namespace.