GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TTipHit.cxx
Go to the documentation of this file.
1#include "TTip.h"
2#include "TTipHit.h"
3#include "TGRSIOptions.h"
4
5////////////////////////////////////////////////////////////
6//
7// TTipHit
8//
9// The TTipHit class defines the observables and algorithms used
10// when analyzing TIP hits. It includes detector positions, etc.
11//
12////////////////////////////////////////////////////////////
13
15{
16 Clear();
17}
18
20{
21 frag.Copy(*this);
22 // SetVariables(frag);
23 if(TGRSIOptions::AnalysisOptions()->IsWaveformFitting() && !IsCsI()) {
24 SetWavefit(frag);
25 } else if(TGRSIOptions::AnalysisOptions()->IsWaveformFitting() && IsCsI()) {
26 SetPID(frag);
27 }
28}
29
31{
32 Clear();
33 rhs.Copy(*this);
34}
35
36void TTipHit::Copy(TObject& rhs) const
37{
39 TDetectorHit::CopyWave(rhs); //waveforms are basically always needed (for TIP PID)
40 static_cast<TTipHit&>(rhs).fFilter = fFilter;
41 static_cast<TTipHit&>(rhs).fPID = fPID;
42 static_cast<TTipHit&>(rhs).fTipChannel = fTipChannel;
43 static_cast<TTipHit&>(rhs).fTimeFit = fTimeFit;
44 static_cast<TTipHit&>(rhs).fFitType = fFitType;
45 static_cast<TTipHit&>(rhs).fSig2Noise = fSig2Noise;
46 static_cast<TTipHit&>(rhs).fChiSq = fChiSq;
47}
48
49void TTipHit::Copy(TObject& rhs, bool waveform) const
50{
51 Copy(rhs);
52 if(waveform) {
53 CopyWave(rhs);
54 }
55}
56
57TVector3 TTipHit::GetPosition() const
58{
59 return TTip::GetPosition(*this);
60}
61
63{
64 // check if the desired filter is in wanted filter;
65 // return the answer;
66 return true;
67}
68
69void TTipHit::Clear(Option_t*)
70{
71 fFilter = 0;
72 fPID = 0;
73 fTipChannel = 0;
74 fTimeFit = 0;
75}
76
77void TTipHit::Print(Option_t*) const
78{
79 Print(std::cout);
80}
81
82void TTipHit::Print(std::ostream& out) const
83{
84 std::ostringstream str;
85 str << "Tip Detector: " << GetDetector() << std::endl;
86 str << "Tip hit energy: " << GetEnergy() << std::endl;
87 str << "Tip hit time: " << GetTime() << std::endl;
88 out << str.str();
89}
90
92{
93 TPulseAnalyzer pulse(frag);
94 if(pulse.IsSet()) {
95 fTimeFit = pulse.fit_newT0();
96 fSig2Noise = pulse.get_sig2noise();
97 }
98}
99
100void TTipHit::SetPID(const TFragment& frag)
101{
102 TPulseAnalyzer pulse(frag);
103 if(pulse.IsSet()) {
104 fPID = pulse.CsIPID();
105 fTimeFit = pulse.CsIt0();
106 fChiSq = pulse.GetCsIChiSq();
107 fFitType = pulse.GetCsIFitType();
108 }
109}
virtual double GetEnergy(Option_t *opt="") const
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
!
static TAnalysisOptions * AnalysisOptions()
bool IsSet() const
Int_t fTipChannel
Definition TTipHit.h:41
TVector3 GetPosition() const override
!
Definition TTipHit.cxx:57
void SetWavefit(const TFragment &)
Definition TTipHit.cxx:91
void Print(Option_t *opt="") const override
!
Definition TTipHit.cxx:77
TTipHit()
Definition TTipHit.cxx:14
Double_t fSig2Noise
Definition TTipHit.h:44
bool IsCsI() const
!
Definition TTipHit.h:60
void Copy(TObject &) const override
!
Definition TTipHit.cxx:36
bool InFilter(Int_t)
!
Definition TTipHit.cxx:62
Int_t fChiSq
Definition TTipHit.h:32
void Clear(Option_t *opt="") override
!
Definition TTipHit.cxx:69
Int_t fFitType
Definition TTipHit.h:33
Double_t fTimeFit
Definition TTipHit.h:43
void SetPID(Double_t x)
!
Definition TTipHit.h:49
Double_t fPID
Definition TTipHit.h:31
Int_t fFilter
Definition TTipHit.h:30
static TVector3 GetPosition(int DetNbr)
!
Definition TTip.cxx:181