GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TTriFoil.cxx
Go to the documentation of this file.
1#include "TTriFoil.h"
2
7
8void TTriFoil::Clear(Option_t* opt)
9{
10 // Clears all of the hits and data
12 fTfWave.clear();
13 fTimestamp = 0;
14 fBeam = false;
15 fTBeam.clear();
16}
17
18void TTriFoil::Copy(TObject& rhs) const
19{
20 TDetector::Copy(rhs);
21 static_cast<TTriFoil&>(rhs).fTfWave = fTfWave;
22 static_cast<TTriFoil&>(rhs).fTimestamp = fTimestamp;
23 static_cast<TTriFoil&>(rhs).fBeam = fBeam;
24 static_cast<TTriFoil&>(rhs).fTBeam = fTBeam;
25}
26
28{
29 rhs.Copy(*this);
30}
31
32void TTriFoil::AddFragment(const std::shared_ptr<const TFragment>& frag, TChannel* chan)
33{
34 if(frag == nullptr || chan == nullptr) {
35 return;
36 }
37
38 if(!(frag->GetWaveform()->empty())) {
39 fTfWave = *(frag->GetWaveform());
40 }
41 fTimestamp = frag->GetTimeStamp();
42 int max = 0;
43 int imax = 0;
44 /*for(size_t i=0;i<fTfWave.size();i++){
45 if(fTfWave[i]>max){
46 max = fTfWave[i];
47 imax = i;
48 }
49 }
50 if(max>1500) {
51 fBeam = true;
52 fTBeam = imax;
53 }*/
54
55 fTBeam.clear();
56
57 for(size_t i = 0; i < fTfWave.size(); i++) {
58 if(fTfWave[i] > 1500 && fTfWave[i] > max) {
59 max = fTfWave[i];
60 imax = i;
61 }
62 if(max != 0 && imax != 0 && (i - imax) > 15) {
63 fTBeam.push_back(imax);
64 max = 0;
65 imax = 0;
66 }
67 }
68}
69
70void TTriFoil::Print(Option_t*) const
71{
72 Print(std::cout);
73}
74
75void TTriFoil::Print(std::ostream&) const
76{
77}
void Copy(TObject &) const override
!
Definition TDetector.cxx:24
void Clear(Option_t *="") override
!
Definition TDetector.h:68
void Clear(Option_t *opt="") override
!
Definition TTriFoil.cxx:8
bool fBeam
Definition TTriFoil.h:52
std::vector< int > fTBeam
Definition TTriFoil.h:53
void AddFragment(const std::shared_ptr< const TFragment > &, TChannel *) override
!
Definition TTriFoil.cxx:32
void Copy(TObject &rhs) const override
Definition TTriFoil.cxx:18
std::vector< Short_t > fTfWave
Definition TTriFoil.h:50
void Print(Option_t *opt="") const override
!
Definition TTriFoil.cxx:70
Long_t fTimestamp
Definition TTriFoil.h:51