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
10/// \cond CLASSIMP
12/// \endcond
13
15{
16 // Default Constructor
17#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
18 Class()->IgnoreTObjectStreamer(kTRUE);
19#endif
20 Clear();
21}
22
24
26{
27 // Copy Constructor
28#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
29 Class()->IgnoreTObjectStreamer(kTRUE);
30#endif
31 Clear();
32 rhs.Copy(*this);
33}
34
35void TFippsTACHit::Copy(TObject& rhs) const
36{
37 // Copies a TFippsTACHit
39}
40
41void TFippsTACHit::Copy(TObject& obj, bool) const
42{
43 Copy(obj);
44}
45
46Double_t TFippsTACHit::GetTempCorrectedCharge(TGraph* correction_graph) const {
47 //Applies the kValue ot the charge
48 if(!correction_graph){
49 std::cout << "Graph for temperture corrections is null" << std::endl;
50 }
51
52 return GetCharge()*correction_graph->Eval(GetTime()/1e9);//The graph should be defined in seconds
53}
54
55Double_t TFippsTACHit::TempCorrectedCharge(TGraph* correction_graph) const {
56 //Returns the raw charge with no kValue applied
57 if(!correction_graph){
58 std::cout << "Graph for temperture corrections is null" << std::endl;
59 }
60
61 return Charge()*correction_graph->Eval(GetTime()/1e9);//The graph should be defined in seconds
62}
63
64Double_t TFippsTACHit::GetTempCorrectedEnergy(TGraph* correction_graph) const {
65 //This will not overwrite the normal energy, nor will it get stored as the energy.
66 if(!correction_graph){
67 std::cout << "Graph for temperture corrections is null" << std::endl;
68 }
69
70 TChannel* channel = GetChannel();
71 if(channel == nullptr) {
72 return 0.0;
73 }
74 if(fKValue > 0) {
75 return channel->CalibrateENG(TempCorrectedCharge(correction_graph), (int)fKValue);
76 } else if(channel->UseCalFileIntegration()) {
77 return channel->CalibrateENG(TempCorrectedCharge(correction_graph), 0);
78 }
79 return channel->CalibrateENG(TempCorrectedCharge(correction_graph));
80}
81
82void TFippsTACHit::Clear(Option_t*)
83{
84 // Clears the TACHit
86}
87
88void TFippsTACHit::Print(Option_t*) const
89{
90 // Prints the TACHit. Returns:
91 // Detector
92 // Energy
93 // Time
94 Print(std::cout);
95}
96
97void TFippsTACHit::Print(std::ostream& out) const
98{
99 std::ostringstream str;
100 str<<"TAC Detector: "<<GetDetector()<<std::endl;
101 str<<"TAC hit energy: "<<GetEnergy()<<std::endl;
102 str<<"TAC hit time: "<<GetTime()<<std::endl;
103 out<<str.str();
104}
ClassImp(THILMnemonic) void THILMnemonic
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 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!
Short_t fKValue
integration value.
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 Copy(TObject &, bool) const override
!
void Print(Option_t *opt="") const override
!
Double_t TempCorrectedCharge(TGraph *correction_graph) const