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
11/// \cond CLASSIMP
13/// \endcond
14
16{
17 // Default Constructor
18#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
19 Class()->IgnoreTObjectStreamer(kTRUE);
20#endif
21 Clear();
22}
23
24TEagleHit::~TEagleHit() = default;
25
27{
28 // Copy Constructor
29#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
30 Class()->IgnoreTObjectStreamer(kTRUE);
31#endif
32 Clear();
33 rhs.Copy(*this);
34}
35
36TEagleHit::TEagleHit(const uint8_t& id, const uint16_t& energy, const uint16_t& time, const uint64_t& eventTime)
37{
38 fAddress = 0x100 + id;
39 fCharge = energy + gRandom->Uniform();
40 fKValue = 1;
41 fTimeStamp = eventTime;
42 fCfd = time;
43}
44
45void TEagleHit::Copy(TObject& rhs) const
46{
47 // Copies a TEagleHit
49}
50
51void TEagleHit::Copy(TObject& obj, bool waveform) const
52{
53 Copy(obj);
54 if(waveform) {
55 CopyWave(obj);
56 }
57}
58
59TVector3 TEagleHit::GetPosition(Double_t) const
60{
61 // Gets the position of the current TEagleHit
62 auto vec = TEagle::GetPosition(GetDetector());
63 return TVector3(vec.X(), vec.Y(), vec.Z());
64}
65
66TVector3 TEagleHit::GetPosition() const
67{
68 // Gets the position of the current TEagleHit
70}
71
72void TEagleHit::Clear(Option_t*)
73{
74 // Clears the EagleHit
76}
77
78void TEagleHit::Print(Option_t*) const
79{
80 /// Prints the EagleHit information
81 Print(std::cout);
82}
83
84void TEagleHit::Print(std::ostream& out) const
85{
86 /// Prints the EagleHit information in a thread-safe way
87 std::ostringstream str;
88 str<<"Eagle Address: 0x"<<std::setw(4)<<std::hex<<std::setfill('0')<<GetAddress()<<std::setfill(' ')<<std::dec<<std::endl;
89 str<<"Eagle Detector: "<<std::setw(16)<<GetDetector()<<std::endl;
90 str<<"Eagle hit energy: "<<std::setw(16)<<GetEnergy()<<std::endl;
91 str<<"Eagle hit time stamp: "<<std::setw(16)<<GetTimeStamp()<<std::endl;
92 str<<"Eagle CFD: "<<std::setw(16)<<GetCfd()<<std::endl;
93 out<<str.str();
94}
ClassImp(THILMnemonic) void THILMnemonic
virtual UInt_t GetAddress() const
!
virtual Long64_t GetTimeStamp(Option_t *="") const
virtual double GetEnergy(Option_t *opt="") const
Float_t fCharge
charge collected from the hit
UInt_t fAddress
address of the the channel in the DAQ.
void Clear(Option_t *opt="") override
!
virtual Int_t GetDetector() const
!
virtual Float_t GetCfd() const
!
void Copy(TObject &) const override
!
Short_t fKValue
integration value.
Long64_t fTimeStamp
Timestamp given to hit in ns.
Float_t fCfd
CFD time of the Hit.
virtual void CopyWave(TObject &) const
!
void Print(Option_t *opt="") const override
!
Definition TEagleHit.cxx:78
~TEagleHit() override
Double_t GetDefaultDistance() const
Definition TEagleHit.h:46
void Copy(TObject &) const override
!
Definition TEagleHit.cxx:45
void Clear(Option_t *opt="") override
!
Definition TEagleHit.cxx:72
TVector3 GetPosition() const override
!
Definition TEagleHit.cxx:66
static ROOT::Math::Polar3DVector GetPosition(int DetNbr)
!
Definition TEagle.h:41