GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TEagleHit.cxx
Go to the documentation of this file.
1#include "TEagleHit.h"
2
3#include <iostream>
4#include <algorithm>
5#include <climits>
6
7#include "Globals.h"
8#include "TEagle.h"
9#include "TGRSIOptions.h"
10
12{
13 // Default Constructor
14#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
15 Class()->IgnoreTObjectStreamer(kTRUE);
16#endif
17 Clear();
18}
19
20TEagleHit::~TEagleHit() = default;
21
23{
24 // Copy Constructor
25#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
26 Class()->IgnoreTObjectStreamer(kTRUE);
27#endif
28 Clear();
29 rhs.Copy(*this);
30}
31
32TEagleHit::TEagleHit(const uint8_t& id, const uint16_t& energy, const uint16_t& time, const uint64_t& eventTime)
33{
34 SetAddress(0x100 + id);
35 SetCharge(energy);
36 SetKValue(1);
37 SetTimeStamp(eventTime);
38 SetCfd(time);
39}
40
41void TEagleHit::Copy(TObject& rhs) const
42{
43 // Copies a TEagleHit
45}
46
47void TEagleHit::Copy(TObject& obj, bool waveform) const
48{
49 Copy(obj);
50 if(waveform) {
51 CopyWave(obj);
52 }
53}
54
55TVector3 TEagleHit::GetPosition(Double_t) const
56{
57 // Gets the position of the current TEagleHit
58 auto vec = TEagle::GetPosition(GetDetector());
59 return TVector3(vec.X(), vec.Y(), vec.Z());
60}
61
62TVector3 TEagleHit::GetPosition() const
63{
64 // Gets the position of the current TEagleHit
66}
67
68void TEagleHit::Clear(Option_t*)
69{
70 // Clears the EagleHit
72}
73
74void TEagleHit::Print(Option_t*) const
75{
76 /// Prints the EagleHit information
77 Print(std::cout);
78}
79
80void TEagleHit::Print(std::ostream& out) const
81{
82 /// Prints the EagleHit information in a thread-safe way
83 std::ostringstream str;
84 str << "Eagle Address: 0x" << std::setw(4) << std::hex << std::setfill('0') << GetAddress() << std::setfill(' ') << std::dec << std::endl;
85 str << "Eagle Detector: " << std::setw(16) << GetDetector() << std::endl;
86 str << "Eagle hit energy: " << std::setw(16) << GetEnergy() << std::endl;
87 str << "Eagle hit time stamp: " << std::setw(16) << GetTimeStamp() << std::endl;
88 str << "Eagle CFD: " << std::setw(16) << GetCfd() << std::endl;
89 out << str.str();
90}
void SetKValue(const Short_t &temp_kval)
!
virtual UInt_t GetAddress() const
!
virtual void SetCfd(const Float_t &val)
!
virtual Long64_t GetTimeStamp(Option_t *="") const
virtual double GetEnergy(Option_t *opt="") const
void SetCharge(const Float_t &temp_charge)
!
void Clear(Option_t *opt="") override
!
virtual Int_t GetDetector() const
!
virtual Float_t GetCfd() const
!
void Copy(TObject &) const override
!
void SetAddress(const UInt_t &temp_address)
!
virtual void SetTimeStamp(const Long64_t &val)
!
virtual void CopyWave(TObject &) const
!
void Print(Option_t *opt="") const override
!
Definition TEagleHit.cxx:74
~TEagleHit() override
Double_t GetDefaultDistance() const
Definition TEagleHit.h:46
void Copy(TObject &) const override
!
Definition TEagleHit.cxx:41
void Clear(Option_t *opt="") override
!
Definition TEagleHit.cxx:68
TVector3 GetPosition() const override
!
Definition TEagleHit.cxx:62
static ROOT::Math::Polar3DVector GetPosition(int DetNbr)
!
Definition TEagle.h:42