GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TDemandHit.cxx
Go to the documentation of this file.
1#include "TDemand.h"
2#include "TDemandHit.h"
3#include "Globals.h"
4#include "TClass.h"
5#include "TGRSIOptions.h"
6
11
13{
14 Clear();
15
16 rhs.Copy(*this);
17}
18
20{
21 frag.Copy(*this);
22 frag.CopyWave(*this);
23
24 SetCcShort(frag.GetCcShort());
25 SetCcLong(frag.GetCcLong());
26
27 /*if(TDemandHit::SetWave()) {
28 if(frag.GetWaveform()->empty()) {
29 std::cout << "Warning, TDemandHit::SetWave() set, but data waveform size is zero!" << std::endl;
30 }
31 frag.CopyWave(*this);
32
33 //if(!GetWaveform()->empty()) {
34 // AnalyzeWaveform();
35 //}
36 }*/
37}
38
39void TDemandHit::Copy(TObject& rhs) const
40{
43 static_cast<TDemandHit&>(rhs).fFilter = fFilter;
44 static_cast<TDemandHit&>(rhs).fCcShort = fCcShort;
45 static_cast<TDemandHit&>(rhs).fCcLong = fCcLong;
46}
47
48void TDemandHit::Copy(TObject& rhs, bool waveform) const
49{
50 Copy(rhs);
51 if(waveform) {
52 CopyWave(rhs);
53 }
54}
55
57{
58 // check if the desired filter is in wanted filter;
59 // return the answer;
60 return true;
61}
62
63void TDemandHit::Clear(Option_t* opt)
64{
65 TDetectorHit::Clear(opt); // clears the base (address, position and waveform)
66 fFilter = 0;
67 fCcShort = 0;
68 fCcLong = 0;
69}
70
71void TDemandHit::Print(Option_t*) const
72{
73 Print(std::cout);
74}
75
76void TDemandHit::Print(std::ostream& out) const
77{
78 std::ostringstream str;
79 str << "Demand Detector: " << GetDetector() << std::endl;
80 str << "Demand Energy: " << GetEnergy() << std::endl;
81 str << "Demand hit time: " << GetTime() << std::endl;
82 out << str.str();
83}
84
86{
87 return TDemand::GetPosition(*this);
88}
TVector3 GetPosition() const override
!
Int_t fCcLong
this is actually the overflow bit of the energy!
Definition TDemandHit.h:31
void Print(Option_t *opt="") const override
!
Int_t fFilter
Definition TDemandHit.h:29
Int_t fCcShort
the short integration, long integration is stored in fCharge
Definition TDemandHit.h:30
bool InFilter(Int_t)
!
void Clear(Option_t *opt="") override
!
void Copy(TObject &) const override
!
void SetCcShort(const int &x)
!
Definition TDemandHit.h:36
void SetCcLong(const int &x)
!
Definition TDemandHit.h:37
static TVector3 GetPosition(int DetNbr)
!
Definition TDemand.cxx:67
virtual double GetEnergy(Option_t *opt="") const
void Clear(Option_t *opt="") override
!
virtual Int_t GetDetector() const
!
void Copy(TObject &) const override
!
virtual Double_t GetTime(const ETimeFlag &correct_flag=ETimeFlag::kAll, Option_t *opt="") const
Returns a time value to the nearest nanosecond!
virtual void CopyWave(TObject &) const
!
Int_t GetCcLong() const
Definition TFragment.h:66
Int_t GetCcShort() const
Definition TFragment.h:67