GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TRF.cxx
Go to the documentation of this file.
1#include "TRF.h"
2
4{
5 Clear();
6}
7
8void TRF::Copy(TObject& rhs) const
9{
10 TDetector::Copy(rhs);
11 static_cast<TRF&>(rhs).fMidasTime = fMidasTime;
12 static_cast<TRF&>(rhs).fTimeStamp = fTimeStamp;
13 static_cast<TRF&>(rhs).fTime = fTime;
14 static_cast<TRF&>(rhs).fPeriod = fPeriod;
15}
16
17TRF::TRF(const TRF& rhs) : TDetector(rhs)
18{
19 rhs.Copy(*this);
20}
21
22void TRF::AddFragment(const std::shared_ptr<const TFragment>& frag, TChannel*)
23{
24
25 fMidasTime = frag->GetDaqTimeStamp();
26 fTimeStamp = frag->GetTimeStamp();
27
28 TPulseAnalyzer pulse(*frag);
29 if(pulse.IsSet()) {
30 fTime = pulse.fit_rf(fPeriod * 0.2); // period taken in half ticks... for reasons
31 } else {
32 //special RF scaler format
33 //no waveform, only fit parameters
34
35 //the phase shift (in cfd units) is stored in the fragment as the cfd
36 //the period (in ns) is stored in the fragment as the charge
37
38 fTime = frag->GetCfd() / 1.6; //convert from cfd units to ns
39 fPeriod = frag->GetCharge();
40 }
41}
42
43void TRF::Clear(Option_t*)
44{
45 fMidasTime = 0.0;
46 fTimeStamp = 0.0;
47 fTime = 0.0;
48
49 fPeriod = 84.8417;
50}
51
52void TRF::Print(Option_t*) const
53{
54 Print(std::cout);
55}
56
57void TRF::Print(std::ostream& out) const
58{
59 std::ostringstream str;
60 str << "time = " << fTime << std::endl;
61 str << "timestamp = " << fTimeStamp << std::endl;
62 str << "midastime = " << fMidasTime << std::endl;
63 out << str.str();
64}
void Copy(TObject &) const override
!
Definition TDetector.cxx:24
double fit_rf(double=2 *8.48409)
bool IsSet() const
Definition TRF.h:18
void Clear(Option_t *opt="") override
!
Definition TRF.cxx:43
void Print(Option_t *opt="") const override
!
Definition TRF.cxx:52
TRF()
Definition TRF.cxx:3
void Copy(TObject &) const override
Definition TRF.cxx:8
double fPeriod
Definition TRF.h:75
time_t fMidasTime
Definition TRF.h:72
Long_t fTimeStamp
Definition TRF.h:73
double fTime
Definition TRF.h:74
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TRF.cxx:22