GRSISort "v4.0.0.5"
An extension of the ROOT analysis Framework
Loading...
Searching...
No Matches
TTdrPlasticHit.cxx
Go to the documentation of this file.
1#include "TTdrPlasticHit.h"
2
3#include <iostream>
4#include <algorithm>
5#include <climits>
6
7#include "Globals.h"
8#include "TTdrPlastic.h"
9#include "TGRSIOptions.h"
10
11/// \cond CLASSIMP
13/// \endcond
14
16{
17 // Default Constructor
18#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
19 Class()->IgnoreTObjectStreamer(kTRUE);
20#endif
21 Clear();
22}
23
25
27{
28 // Copy Constructor
29#if ROOT_VERSION_CODE < ROOT_VERSION(6,0,0)
30 Class()->IgnoreTObjectStreamer(kTRUE);
31#endif
32 Clear();
33 rhs.Copy(*this);
34}
35
37{
39 if(frag.GetWaveform()->empty()) {
40 printf("Warning, TTdrPlastic::SetWave() set, but data waveform size is zero!\n");
41 }
42 if(false) {
43 std::vector<Short_t> x;
44 // Need to reorder waveform data for S1507 data from December 2014
45 // All pairs of samples are swapped.
46 // The first two samples are also delayed by 8.
47 // We choose to throw out the first 2 samples (junk) and the last 6 samples (convience)
48 x = *(frag.GetWaveform());
49 size_t length = x.size() - (x.size() % 8);
50 Short_t temp;
51
52 if(length > 8) {
53 for(size_t i = 0; i < length - 8; i += 8) {
54 x[i] = x[i + 9];
55 x[i + 1] = x[i + 8];
56 temp = x[i + 2];
57 x[i + 2] = x[i + 3];
58 x[i + 3] = temp;
59 temp = x[i + 4];
60 x[i + 4] = x[i + 5];
61 x[i + 5] = temp;
62 temp = x[i + 6];
63 x[i + 6] = x[i + 7];
64 x[i + 7] = temp;
65 }
66 x.resize(length - 8);
67 }
68 SetWaveform(x);
69 } else {
70 frag.CopyWave(*this);
71 }
72 }
73}
74
75void TTdrPlasticHit::Copy(TObject& rhs) const
76{
77 // Copies a TTdrPlasticHit
79 static_cast<TTdrPlasticHit&>(rhs).fFilter = fFilter;
80}
81
82void TTdrPlasticHit::Copy(TObject& obj, bool waveform) const
83{
84 Copy(obj);
85 if(waveform) {
86 CopyWave(obj);
87 }
88}
89
90TVector3 TTdrPlasticHit::GetPosition(Double_t) const
91{
92 // Gets the position of the current TTdrPlasticHit
94}
95
97{
98 // Gets the position of the current TTdrPlasticHit
100}
101
103{
104 // check if the desired filter is in wanted filter;
105 // return the answer;
106 return true;
107}
108
110{
111 // Clears the TdrPlasticHit
112 fFilter = 0;
114}
115
116void TTdrPlasticHit::Print(Option_t*) const
117{
118 // Prints the TdrPlasticHit. Returns:
119 // Detector
120 // Energy
121 // Time
122 Print(std::cout);
123}
124
125void TTdrPlasticHit::Print(std::ostream& out) const
126{
127 std::ostringstream str;
128 str<<"TdrPlastic Detector: "<<GetDetector()<<std::endl;
129 str<<"TdrPlastic hit energy: "<<GetEnergy()<<std::endl;
130 str<<"TdrPlastic hit time: "<<GetTime()<<std::endl;
131 out<<str.str();
132}
133
ClassImp(THILMnemonic) void THILMnemonic
virtual double GetEnergy(Option_t *opt="") const
void SetWaveform(const std::vector< Short_t > &val)
!
const std::vector< Short_t > * GetWaveform() 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!
virtual void CopyWave(TObject &) const
!
void Clear(Option_t *opt="") override
!
bool InFilter(Int_t)
!
void Print(Option_t *opt="") const override
!
TVector3 GetPosition() const override
!
~TTdrPlasticHit() override
Double_t GetDefaultDistance() const
void Copy(TObject &) const override
!
static TVector3 GetPosition(int DetNbr)
!
Definition TTdrPlastic.h:39
static bool SetWave()
!
Definition TTdrPlastic.h:47