Hall C ROOT/C++ Analyzer (hcana)
Loading...
Searching...
No Matches
THcRawHodoHit.cxx
Go to the documentation of this file.
1
13#include "THcRawHodoHit.h"
14
15#include <iostream>
16#include <stdexcept>
17
18
20 THcRawHit(plane, counter), fAdcHits(), fTdcHits()
21{}
22
23
26
27 if (this != &right) {
28 for (Int_t iAdcSig=0; iAdcSig<fNAdcSignals; ++iAdcSig) {
29 fAdcHits[iAdcSig] = right.fAdcHits[iAdcSig];
30 }
31 for (Int_t iTdcSig=0; iTdcSig<fNTdcSignals; ++iTdcSig) {
32 fTdcHits[iTdcSig] = right.fTdcHits[iTdcSig];
33 }
34 }
35
36 return *this;
37}
38
39
41
42
45
46 for (Int_t iAdcSig=0; iAdcSig<fNAdcSignals; ++iAdcSig) {
47 fAdcHits[iAdcSig].Clear();
48 }
49 for (Int_t iTdcSig=0; iTdcSig<fNTdcSignals; ++iTdcSig) {
50 fTdcHits[iTdcSig].Clear();
51 }
52}
53
54
56 if (0 <= signal && signal < fNAdcSignals) {
57 fAdcHits[signal].SetData(data);
58 }
59 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
61 }
62 else {
63 throw std::out_of_range(
64 "`THcRawHodoHit::SetData`: only signals `0` to `3` available!"
65 );
66 }
67}
68
69
71 if (0 <= signal && signal < fNAdcSignals) {
72 fAdcHits[signal].SetSample(data);
73 }
74 else {
75 throw std::out_of_range(
76 "`THcRawHodoHit::SetSample`: only signals `0` and `1` available!"
77 );
78 }
79}
80
82 if (0 <= signal && signal < fNAdcSignals) {
83 fAdcHits[signal].SetSampThreshold(thres);
84 }
85 else {
86 throw std::out_of_range(
87 "`THcRawHodoHit::SetSampThreshold`: only signals `0` and `1` available!"
88 );
89 }
90}
91
92
94 Int_t signal, Int_t data, Int_t time, Int_t pedestal, Int_t peak
95) {
96 if (0 <= signal && signal < fNAdcSignals) {
98 }
99 else {
100 throw std::out_of_range(
101 "`THcRawHodoHit::SetDataTimePedestalPeak`: only signals `0` and `1` available!"
102 );
103 }
104}
105
107 if (0 <= signal && signal < fNAdcSignals) {
109 }
110 else {
111 throw std::out_of_range(
112 "`THcRawHodoHit::SetDataTimePedestalPeak`: only signals `0` and `1` available!"
113 );
114 }
115}
116
117
118void THcRawHodoHit::SetReference(Int_t signal, Int_t reference) {
119 if (signal < fNAdcSignals) {
120 fAdcHits[signal].SetRefTime(reference);
121 } else if (signal < fNAdcSignals+fNTdcSignals) {
122 fTdcHits[signal-fNAdcSignals].SetRefTime(reference);
123 } else {
124 throw std::out_of_range(
125 "`THcRawHodoHit::SetReference`: only signals `2` and `3` available!"
126 );
127 }
128}
129
130void THcRawHodoHit::SetReferenceDiff(Int_t signal, Int_t referenceDiff) {
131 if (signal < fNAdcSignals) {
132 fAdcHits[signal].SetRefDiffTime(referenceDiff);
133 } else if (signal < fNAdcSignals+fNTdcSignals) {
134 fTdcHits[signal-fNAdcSignals].SetRefDiffTime(referenceDiff);
135 } else {
136 throw std::out_of_range(
137 "`THcRawHodoHit::SetReference`: only signals `2` and `3` available!"
138 );
139 }
140}
141
142
143
145 if (0 <= signal && signal < fNAdcSignals) {
146 return fAdcHits[signal].GetPulseInt();
147 }
148 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
149 return fTdcHits[signal-fNAdcSignals].GetTime();
150 }
151 else {
152 throw std::out_of_range(
153 "`THcRawHodoHit::GetData`: only signals `0` to `3` available!"
154 );
155 }
156}
157
158
160 if (0 <= signal && signal < fNAdcSignals) {
161 return fAdcHits[signal].GetPulseIntRaw();
162 }
163 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
164 return fTdcHits[signal-fNAdcSignals].GetTimeRaw();
165 }
166 else {
167 throw std::out_of_range(
168 "`THcRawHodoHit::GetRawData`: only signals `0` to `3` available!"
169 );
170 }
171}
172
173
175 if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
176 return fTdcHits[signal-fNAdcSignals].GetRefTime();
177 }
178 else {
179 throw std::out_of_range(
180 "`THcRawHodoHit::GetReference`: only signals `2` and `3` available!"
181 );
182 }
183}
184
186 if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
187 return fTdcHits[signal-fNAdcSignals].GetRefDiffTime();
188 }
189 else {
190 throw std::out_of_range(
191 "`THcRawHodoHit::GetReference`: only signals `2` and `3` available!"
192 );
193 }
194}
195
196
198 if (0 <= signal && signal < fNAdcSignals) {
199 return kADC;
200 }
201 else if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
202 return kTDC;
203 }
204 else {
205 throw std::out_of_range(
206 "`THcRawHodoHit::GetSignalType`: only signals `0` to `3` available!"
207 );
208 }
209}
210
211
215
217 if (fNAdcSignals <= signal && signal < fNAdcSignals+fNTdcSignals) {
218 return fTdcHits[signal-fNAdcSignals].HasRefTime();
219 }
220 else {
221 throw std::out_of_range(
222 "`THcRawHodoHit::HasReference`: only signals `2` and `3` available!"
223 );
224 }
225}
226
227
231
232
236
237
241
242
246
247
249 for (Int_t iAdcSig=0; iAdcSig<fNAdcSignals; ++iAdcSig) {
250 fAdcHits[iAdcSig].SetF250Params(NSA, NSB, NPED);
251 }
252}
253
254
int Int_t
uint32_t NSB
std::vector< uint32_t > peak
uint32_t NSA
uint32_t pedestal
uint32_t time
bool Bool_t
double Double_t
const char Option_t
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
ClassImp(VDC::AnalyticTTDConv) using namespace std
Class representing a single raw ADC hit.
Definition THcRawAdcHit.h:7
void SetData(Int_t data)
Sets raw ADC value.
void SetRefDiffTime(Int_t refDiffTime)
void SetDataTimePedestalPeak(Int_t data, Int_t time, Int_t pedestal, Int_t peak)
Sets various bits of ADC data.
void SetSampThreshold(Double_t thres)
void SetSampIntTimePedestalPeak()
Int_t GetPulseIntRaw(UInt_t iPulse=0) const
Gets raw pulse integral. In channels.
void SetSample(Int_t data)
Sets raw signal sample.
virtual void Clear(Option_t *opt="")
Clears variables before next event.
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
Sets F250 parameters used for pedestal subtraction.
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
Double_t GetPulseInt(UInt_t iPulse=0) const
Gets pedestal subtracted pulse integral. In channels.
Base class detector specific raw hit that go into hit lists.
Definition THcRawHit.h:11
THcRawHit & operator=(const THcRawHit &rhs)=default
Class representing a single raw hit for a hodoscope paddle.
THcRawAdcHit & GetRawAdcHitPos()
virtual Int_t GetRawData(Int_t signal)
static const Int_t fNTdcSignals
virtual void SetReference(Int_t signal, Int_t reference)
THcRawTdcHit fTdcHits[fNTdcSignals]
virtual Bool_t HasReference(Int_t signal)
virtual Int_t GetData(Int_t signal)
THcRawAdcHit & GetRawAdcHitNeg()
virtual void SetSample(Int_t signal, Int_t data)
virtual Int_t GetNSignals()
virtual void SetReferenceDiff(Int_t signal, Int_t referenceDiff)
THcRawHodoHit & operator=(const THcRawHodoHit &right)
virtual void SetSampIntTimePedestalPeak(Int_t signal)
THcRawHodoHit(Int_t plane=0, Int_t counter=0)
THcRawTdcHit & GetRawTdcHitNeg()
virtual ESignalType GetSignalType(Int_t signal)
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
virtual void SetSampThreshold(Int_t signal, Double_t thres)
virtual void SetDataTimePedestalPeak(Int_t signal, Int_t data, Int_t time, Int_t pedestal, Int_t peak)
THcRawAdcHit fAdcHits[fNAdcSignals]
static const Int_t fNAdcSignals
virtual void Clear(Option_t *opt="")
THcRawTdcHit & GetRawTdcHitPos()
virtual Int_t GetReferenceDiff(Int_t signal)
virtual void SetData(Int_t signal, Int_t data)
virtual ~THcRawHodoHit()
virtual Int_t GetReference(Int_t signal)
Class representing a single raw TDC hit.
Definition THcRawTdcHit.h:7
Int_t GetRefTime() const
Gets reference time. In channels.
Int_t GetTimeRaw(UInt_t iHit=0) const
Gets raw TDC time. In channels.
void SetRefDiffTime(Int_t refDiffTime)
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
Int_t GetTime(UInt_t iHit=0) const
Gets TDC time. In channels.
Bool_t HasRefTime() const
Queries whether reference time has been set.
void SetTime(Int_t time)
Sets raw TDC time from the modules. In channels.
Int_t GetRefDiffTime() const
virtual void Clear(Option_t *opt="")
Clears variables before next event.
virtual void Clear(Option_t *="")