BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/RawDataProviderSvc/RawDataProviderSvc/TofData.h
Go to the documentation of this file.
1// Convert Data Format from Online data to TofData
2//
3#ifndef TOFDATA_H
4#define TOFDATA_H
5#include "Identifier/Identifier.h"
6#include <vector>
7#include <map>
8
9class TofValue{
10 public:
12 virtual ~TofValue();
13
14 // Assignment constructor.
15 TofValue& operator=(const TofValue& source);
16
17 int channel() const { return m_channel; }
18 int times() const { return m_times; }
19 int number() const { return m_number; }
20 int clock() const { return m_clock; }
21 double value() const { return m_value; }
22 bool used() const { return m_used; }
23
24 void timespp();
25 void timesmm();
26 void setNumber( int number ) { m_number = number; }
27 // virtual void setValue( int value ) = 0;
28 void setUsed( bool used ) { m_used = used; }
29
30 protected:
31 int m_clock;
32 int m_channel;
33 double m_value;
34
35 private:
36 int m_times;
37 int m_number;
38 bool m_used;
39
40};
41
42
43class Adc : public TofValue {
44 public:
45 Adc();
46
47 void setCorr() { m_corr = true; }
48 void setElec() { m_elec = true; }
49
50 void setValue( Identifier identify, int value );
51
52 double qtc() const { return m_qtc; }
53
54 private:
55 double m_qtc;
56 bool m_corr, m_elec, m_mrpc;
57};
58
59
60class Tdc : public TofValue {
61 public:
62 void setValue( int value );
63 private:
64};
65
66
67class PmtData{
68 public:
71
72 // Assignment constructor.
73 PmtData& operator=(const PmtData& source);
74
75 unsigned int iden() const { return m_iden_value; }
76 unsigned int times() const { return m_times; }
78 double qtc();
79 double adc();
80 int qclock();
82 double tdc();
83 int tclock();
84 unsigned int quality() const { return m_quality; }
85
86 void timespp();
87 void timesmm();
88 int qtimes();
89 void qtimespp();
90 void qtimesmm();
91 int ttimes();
92 void ttimespp();
93 void ttimesmm();
94
95 int qnumber();
96 int tnumber();
97
98 bool qused();
99 bool tused();
100 bool used();
101
102 void setIdentify( unsigned int iden ) { m_iden_value = iden; }
103 void setAdc( Adc* adc );
104 void setTdc( Tdc* tdc );
105 void setUsed();
106
107 void clear();
108
109 private:
110 unsigned int m_iden_value;
111 unsigned int m_times;
112 unsigned int m_quality; // 0x 0 0 1 (Q) 1 (T)
113 Adc* m_adc;
114 Tdc* m_tdc;
115
116};
117
118
119class TofData{
120 public:
123
124 // Assignment constructor.
125 TofData& operator=(const TofData& source);
126
127 unsigned int identify() const { return m_identify; }
128 bool is_mrpc() const { return m_mrpc; }
129 bool barrel() const { return m_barrel; }
130 int tofId() const { return m_tofId; }
131 int layer() const { return m_layer; }
132 int strip() const { return m_strip; }
133 int tofTrackId() const { return m_tofTrackId; }
134
135 unsigned int times() const { return m_times; }
136
137 void data( double& adcEast, double& tdcEast, double& adcWest, double& tdcWest );
138 void data( double& adc, double& tdc );
139
140 PmtData* forward() const { return m_forward; }
141 PmtData* backward() const { return m_backward; }
142
143 double adc1();
144 double tdc1();
145 double adc2();
146 double tdc2();
147 double adc();
148 double tdc();
149
150 double qtc1();
151 double qtc2();
152 double qtc();
153
160
161 int qclock1();
162 int tclock1();
163 int qclock2();
164 int tclock2();
165 int qclock();
166 int tclock();
167
168 unsigned int quality() const { return m_quality; }
169 bool tmatched() const { return m_tmatched; }
170
171 int qtimes1();
172 int ttimes1();
173 int qtimes2();
174 int ttimes2();
175 unsigned int eastTimes();
176 unsigned int westTimes();
177
178 int qnumber1();
179 int tnumber1();
180 int qnumber2();
181 int tnumber2();
182
183 bool qused1();
184 bool tused1();
185 bool qused2();
186 bool tused2();
187 bool used1();
188 bool used2();
189 bool used();
190
191 double ztdc() const { return m_ztdc; }
192 double zadc() const { return m_zadc; }
193
194 double zpos() const { return m_zpos; }
195 double energy() const { return m_energy; }
196
197 public:
199 void setMisLable() { m_misLable = true; }
200 void setTofTrackId( int tofTrackId ) { m_tofTrackId = tofTrackId; }
201 void setTimes( unsigned int times ) { m_times = times; }
202 void setForward( PmtData* pmt );
203 void setBackward( PmtData* pmt );
204 void setQuality( unsigned int quality ) { m_quality = quality; }
205 void setTMatched( bool tmatched ) { m_tmatched = tmatched; }
206 void setUsed();
207 void setZTdc( double ztdc ) { m_ztdc = ztdc; }
208 void setZAdc( double zadc ) { m_zadc = zadc; }
209 void setZpos( double zpos ) { m_zpos = zpos; }
210 void setEnergy( double energy ) { m_energy = energy; }
211
212 void clear();
213
214 private:
215
216 unsigned int m_identify;
217 bool m_mrpc;
218 bool m_barrel;
219 int m_tofId;
220 int m_layer;
221 int m_strip;
222 int m_tofTrackId;
223
224 bool m_misLable;
225
226 double m_ztdc;
227 double m_zadc;
228
229 double m_zpos; //z-position after calibration
230 double m_energy; //energy deposit after calibration
231
232 unsigned int m_times;
233 unsigned int m_quality;
234 // 0x 0...0 1 (East Q) 1 (East T) 1 (West Q) 1 (West T)
235 // Forward == East ; Backward = West
236 bool m_tmatched;
237 // true, will used for Estime and TOF, false, will used only for EMC
238
239 PmtData* m_forward;
240 PmtData* m_backward;
241
242};
243
244typedef std::multimap<unsigned int, TofData*> TofDataMap;
245typedef std::multimap<unsigned int, TofData*>::iterator IterTofDataMap;
246
247typedef std::vector<TofData*> TofDataVector;
248typedef std::vector<TofData*>::iterator IterTofDataVector;
249
250#endif
std::multimap< unsigned int, TofData * > TofDataMap
std::vector< TofData * >::iterator IterTofDataVector
std::multimap< unsignedint, TofData * >::iterator IterTofDataMap
void setValue(Identifier identify, int value)
void qtimespp()
int qtimes()
bool tused()
int tdcChannel()
void setAdc(Adc *adc)
double tdc()
bool qused()
int ttimes()
void qtimesmm()
double adc()
int tnumber()
void setTdc(Tdc *tdc)
void timespp()
void ttimesmm()
void timesmm()
int adcChannel()
void ttimespp()
int qnumber()
double qtc()
void clear()
int tclock()
PmtData & operator=(const PmtData &source)
bool used()
void setUsed()
int qclock()
void setValue(int value)
int tdcChannel()
double qtc2()
int qnumber2()
void data(double &adc, double &tdc)
int qtimes2()
void setUsed()
bool tused2()
unsigned int westTimes()
int ttimes1()
bool qused1()
void data(double &adcEast, double &tdcEast, double &adcWest, double &tdcWest)
bool tused1()
double adc2()
int tclock1()
void setForward(PmtData *pmt)
int qclock1()
int tclock()
double adc()
Definition: TofData.cxx:674
double tdc2()
double qtc1()
TofData & operator=(const TofData &source)
int tdcChannelWest()
int adcChannel()
void clear()
bool used2()
int qtimes1()
int tnumber1()
int adcChannelWest()
bool qused2()
double tdc1()
void setBackward(PmtData *pmt)
int qnumber1()
int adcChannelEast()
int qclock()
int ttimes2()
double adc1()
int qclock2()
unsigned int eastTimes()
int tnumber2()
bool used1()
double tdc()
Definition: TofData.cxx:683
void setIdentify(Identifier identify)
int tclock2()
int tdcChannelEast()
double qtc()
bool used()
void timespp()
TofValue & operator=(const TofValue &source)
void timesmm()
virtual ~TofValue()