GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TFippsTACHit.cxx
Go to the documentation of this file.
1#include "TFippsTACHit.h"
2
3#include <iostream>
4#include <algorithm>
5#include <climits>
6
7#include "Globals.h"
8#include "TFippsTAC.h"
9
11{
12 // Default Constructor
13#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
14 Class()->IgnoreTObjectStreamer(kTRUE);
15#endif
16 Clear();
17}
18
20
22{
23 // Copy Constructor
24#if ROOT_VERSION_CODE < ROOT_VERSION(6, 0, 0)
25 Class()->IgnoreTObjectStreamer(kTRUE);
26#endif
27 Clear();
28 rhs.Copy(*this);
29}
30
31void TFippsTACHit::Copy(TObject& rhs) const
32{
33 // Copies a TFippsTACHit
35}
36
37void TFippsTACHit::Copy(TObject& obj, bool) const
38{
39 Copy(obj);
40}
41
42Double_t TFippsTACHit::GetTempCorrectedCharge(TGraph* correction_graph) const
43{
44 //Applies the kValue ot the charge
45 if(!correction_graph) {
46 std::cout << "Graph for temperture corrections is null" << std::endl;
47 }
48
49 return GetCharge() * correction_graph->Eval(GetTime() / 1e9); //The graph should be defined in seconds
50}
51
52Double_t TFippsTACHit::TempCorrectedCharge(TGraph* correction_graph) const
53{
54 //Returns the raw charge with no kValue applied
55 if(!correction_graph) {
56 std::cout << "Graph for temperture corrections is null" << std::endl;
57 }
58
59 return Charge() * correction_graph->Eval(GetTime() / 1e9); //The graph should be defined in seconds
60}
61
62Double_t TFippsTACHit::GetTempCorrectedEnergy(TGraph* correction_graph) const
63{
64 //This will not overwrite the normal energy, nor will it get stored as the energy.
65 if(!correction_graph) {
66 std::cout << "Graph for temperture corrections is null" << std::endl;
67 }
68
69 TChannel* channel = GetChannel();
70 if(channel == nullptr) {
71 return 0.0;
72 }
73 if(GetKValue() > 0) {
74 return channel->CalibrateENG(TempCorrectedCharge(correction_graph), GetKValue());
75 } else if(channel->UseCalFileIntegration()) {
76 return channel->CalibrateENG(TempCorrectedCharge(correction_graph), 0);
77 }
78 return channel->CalibrateENG(TempCorrectedCharge(correction_graph));
79}
80
81void TFippsTACHit::Clear(Option_t*)
82{
83 // Clears the TACHit
85}
86
87void TFippsTACHit::Print(Option_t*) const
88{
89 // Prints the TACHit. Returns:
90 // Detector
91 // Energy
92 // Time
93 Print(std::cout);
94}
95
96void TFippsTACHit::Print(std::ostream& out) const
97{
98 std::ostringstream str;
99 str << "TAC Detector: " << GetDetector() << std::endl;
100 str << "TAC hit energy: " << GetEnergy() << std::endl;
101 str << "TAC hit time: " << GetTime() << std::endl;
102 out << str.str();
103}
double CalibrateENG(double) const
Definition TChannel.cxx:646
bool UseCalFileIntegration()
Definition TChannel.h:189
virtual Float_t GetCharge() const
!
virtual double GetEnergy(Option_t *opt="") const
virtual Short_t GetKValue() const
!
virtual Float_t Charge() const
!
TChannel * GetChannel() 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!
void Copy(TObject &) const override
!
Double_t GetTempCorrectedEnergy(TGraph *correction_graph) const
void Clear(Option_t *opt="") override
!
~TFippsTACHit() override
Double_t GetTempCorrectedCharge(TGraph *correction_graph) const
void Print(Option_t *opt="") const override
!
Double_t TempCorrectedCharge(TGraph *correction_graph) const