Hall C ROOT/C++ Analyzer (hcana)
THcRawDCHit.cxx
Go to the documentation of this file.
1 
9 #include "THcRawDCHit.h"
10 #include <stdexcept>
11 
12 
14  THcRawHit(plane, counter), fTdcHit()
15 {}
16 
17 
19  THcRawHit::operator=(right);
20 
21  if (this != &right) {
22  fTdcHit = right.fTdcHit;
23  }
24 
25  return *this;
26 }
27 
28 
30 
31 
33  THcRawHit::Clear(opt);
34 
35  fTdcHit.Clear();
36 }
37 
38 
39 void THcRawDCHit::SetData(Int_t signal, Int_t data) {
40  if (signal == 0) {
41  fTdcHit.SetTime(data);
42  }
43  else {
44  throw std::out_of_range(
45  "`THcRawDCHit::SetData`: only signal `0` available!"
46  );
47  }
48 }
49 
50 
51 void THcRawDCHit::SetReference(Int_t signal, Int_t reference) {
52  if (signal == 0) {
53  fTdcHit.SetRefTime(reference);
54  }
55  else {
56  throw std::out_of_range(
57  "`THcRawDCHit::SetReference`: only signal `0` available!"
58  );
59  }
60 }
61 
62 void THcRawDCHit::SetReferenceDiff(Int_t signal, Int_t reference) {
63  if (signal == 0) {
64  fTdcHit.SetRefDiffTime(reference);
65  }
66  else {
67  throw std::out_of_range(
68  "`THcRawDCHit::SetReference`: only signal `0` available!"
69  );
70  }
71 }
72 
73 
75  if (signal == 0) {
76  return fTdcHit.GetTime();
77  }
78  else {
79  throw std::out_of_range(
80  "`THcRawDCHit::GetData`: only signal `0` available!"
81  );
82  }
83 }
84 
85 
87  if (signal == 0) {
88  return fTdcHit.GetTimeRaw();
89  }
90  else {
91  throw std::out_of_range(
92  "`THcRawDCHit::GetRawData`: only signal `0` available!"
93  );
94  }
95 }
96 
97 
99  if (signal == 0) {
100  return fTdcHit.GetRefTime();
101  }
102  else {
103  throw std::out_of_range(
104  "`THcRawDCHit::GetReference`: only signal `0` available!"
105  );
106  }
107 }
108 
110  if (signal == 0) {
111  return fTdcHit.GetRefDiffTime();
112  }
113  else {
114  throw std::out_of_range(
115  "`THcRawDCHit::GetReference`: only signal `0` available!"
116  );
117  }
118 }
119 
120 
122  if (signal == 0) {
123  return kTDC;
124  }
125  else {
126  throw std::out_of_range(
127  "`THcRawDCHit::GetReference`: only signal `0` available!"
128  );
129  }
130 }
131 
132 
134  return fNTdcSignals;
135 }
136 
137 
139  if (signal == 0) {
140  return fTdcHit.HasRefTime();
141  }
142  else {
143  throw std::out_of_range(
144  "`THcRawDCHit::HasReference`: only signal `0` available!"
145  );
146  }
147 }
148 
149 
151  return fTdcHit;
152 }
153 
154 
virtual void Clear(Option_t *="")
Int_t GetTimeRaw(UInt_t iHit=0) const
Gets raw TDC time. In channels.
THcRawDCHit(Int_t plane=0, Int_t counter=0)
Definition: THcRawDCHit.cxx:13
const char Option_t
virtual Int_t GetReferenceDiff(Int_t signal)
virtual Int_t GetNSignals()
THcRawTdcHit & GetRawTdcHit()
virtual void SetReferenceDiff(Int_t signal, Int_t reference)
Definition: THcRawDCHit.cxx:62
int Int_t
bool Bool_t
Class representing a single raw TDC hit.
Definition: THcRawTdcHit.h:7
void SetTime(Int_t time)
Sets raw TDC time from the modules. In channels.
virtual void Clear(Option_t *opt="")
Definition: THcRawDCHit.cxx:32
virtual void SetReference(Int_t signal, Int_t reference)
Definition: THcRawDCHit.cxx:51
static const Int_t fNTdcSignals
Definition: THcRawDCHit.h:35
virtual void Clear(Option_t *opt="")
Clears variables before next event.
THcRawTdcHit fTdcHit
Definition: THcRawDCHit.h:37
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
Int_t GetRefDiffTime() const
virtual Bool_t HasReference(Int_t signal)
virtual Int_t GetReference(Int_t signal)
Definition: THcRawDCHit.cxx:98
Bool_t HasRefTime() const
Queries whether reference time has been set.
virtual ~THcRawDCHit()
Definition: THcRawDCHit.cxx:29
Base class detector specific raw hit that go into hit lists.
Definition: THcRawHit.h:11
Class representing for drift chamber wire (or other device with a single multihit TDC channel per det...
Definition: THcRawDCHit.h:8
virtual ESignalType GetSignalType(Int_t signal)
virtual Int_t GetRawData(Int_t signal)
Definition: THcRawDCHit.cxx:86
Int_t GetTime(UInt_t iHit=0) const
Gets TDC time. In channels.
virtual void SetData(Int_t signal, Int_t data)
Definition: THcRawDCHit.cxx:39
ClassImp(THcDCLookupTTDConv) THcDCLookupTTDConv
THcRawDCHit & operator=(const THcRawDCHit &right)
Definition: THcRawDCHit.cxx:18
virtual Int_t GetData(Int_t signal)
Definition: THcRawDCHit.cxx:74
Int_t GetRefTime() const
Gets reference time. In channels.
void SetRefDiffTime(Int_t refDiffTime)
THcRawHit & operator=(const THcRawHit &rhs)
Definition: THcRawHit.h:17