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
7/// \cond CLASSIMP
8//ClassImp(TDemandHit)
9/// \endcond
10
15
17{
18 Clear();
19
20 rhs.Copy(*this);
21}
22
24{
25 frag.Copy(*this);
26 frag.CopyWave(*this);
27
28 SetCcShort(frag.GetCcShort());
29 SetCcLong(frag.GetCcLong());
30
31 /*if(TDemandHit::SetWave()) {
32 if(frag.GetWaveform()->empty()) {
33 std::cout << "Warning, TDemandHit::SetWave() set, but data waveform size is zero!" << std::endl;
34 }
35 frag.CopyWave(*this);
36
37 //if(!GetWaveform()->empty()) {
38 // AnalyzeWaveform();
39 //}
40 }*/
41}
42
43void TDemandHit::Copy(TObject& rhs) const
44{
47 static_cast<TDemandHit&>(rhs).fFilter = fFilter;
48 static_cast<TDemandHit&>(rhs).fCcShort = fCcShort;
49 static_cast<TDemandHit&>(rhs).fCcLong = fCcLong;
50}
51
52void TDemandHit::Copy(TObject& rhs, bool waveform) const
53{
54 Copy(rhs);
55 if(waveform) {
56 CopyWave(rhs);
57 }
58}
59
61{
62 // check if the desired filter is in wanted filter;
63 // return the answer;
64 return true;
65}
66
67void TDemandHit::Clear(Option_t* opt)
68{
69 TDetectorHit::Clear(opt); // clears the base (address, position and waveform)
70 fFilter = 0;
71 fCcShort = 0;
72 fCcLong = 0;
73}
74
75void TDemandHit::Print(Option_t*) const
76{
77 Print(std::cout);
78}
79
80void TDemandHit::Print(std::ostream& out) const
81{
82 std::ostringstream str;
83 str << "Demand Detector: " << GetDetector() << std::endl;
84 str << "Demand Energy: " << GetEnergy() << std::endl;
85 str << "Demand hit time: " << GetTime() << std::endl;
86 out << str.str();
87}
88
90{
91 return TDemand::GetPosition(*this);
92}
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:71
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