BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RawDataProviderSvc/RawDataProviderSvc-00-03-46/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:
11 TofValue();
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:
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:
69 PmtData();
70 ~PmtData();
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; }
77 int adcChannel();
78 double qtc();
79 double adc();
80 int qclock();
81 int tdcChannel();
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
120 public:
121 TofData();
122 ~TofData();
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
154 int adcChannelEast();
155 int tdcChannelEast();
156 int adcChannelWest();
157 int tdcChannelWest();
158 int adcChannel();
159 int tdcChannel();
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
TTree * data
std::multimap< unsignedint, TofData * >::iterator IterTofDataMap
Adc()
Definition: TofData.cxx:69
void setValue(Identifier identify, int value)
Definition: TofData.cxx:77
void qtimespp()
Definition: TofData.cxx:370
int qtimes()
Definition: TofData.cxx:402
bool tused()
Definition: TofData.cxx:447
int tdcChannel()
Definition: TofData.cxx:331
void setAdc(Adc *adc)
Definition: TofData.cxx:468
double tdc()
Definition: TofData.cxx:340
bool qused()
Definition: TofData.cxx:438
int ttimes()
Definition: TofData.cxx:411
void qtimesmm()
Definition: TofData.cxx:378
double adc()
Definition: TofData.cxx:293
int tnumber()
Definition: TofData.cxx:429
void setTdc(Tdc *tdc)
Definition: TofData.cxx:478
void timespp()
Definition: TofData.cxx:358
void ttimesmm()
Definition: TofData.cxx:394
void timesmm()
Definition: TofData.cxx:364
~PmtData()
Definition: TofData.cxx:255
PmtData()
Definition: TofData.cxx:246
int adcChannel()
Definition: TofData.cxx:270
void ttimespp()
Definition: TofData.cxx:386
int qnumber()
Definition: TofData.cxx:420
double qtc()
Definition: TofData.cxx:279
void clear()
Definition: TofData.cxx:499
int tclock()
Definition: TofData.cxx:349
PmtData & operator=(const PmtData &source)
Definition: TofData.cxx:260
bool used()
Definition: TofData.cxx:456
void setUsed()
Definition: TofData.cxx:488
int qclock()
Definition: TofData.cxx:322
void setValue(int value)
Definition: TofData.cxx:49
int tdcChannel()
Definition: TofData.cxx:764
double qtc2()
Definition: TofData.cxx:701
int qnumber2()
Definition: TofData.cxx:899
int qtimes2()
Definition: TofData.cxx:845
void setUsed()
Definition: TofData.cxx:1019
bool tused2()
Definition: TofData.cxx:944
unsigned int westTimes()
Definition: TofData.cxx:872
int ttimes1()
Definition: TofData.cxx:836
bool qused1()
Definition: TofData.cxx:917
bool tused1()
Definition: TofData.cxx:926
double adc2()
Definition: TofData.cxx:656
int tclock1()
Definition: TofData.cxx:782
void setForward(PmtData *pmt)
Definition: TofData.cxx:983
int qclock1()
Definition: TofData.cxx:773
int tclock()
Definition: TofData.cxx:818
double adc()
Definition: TofData.cxx:674
double tdc2()
Definition: TofData.cxx:665
double qtc1()
Definition: TofData.cxx:692
TofData & operator=(const TofData &source)
Definition: TofData.cxx:542
int tdcChannelWest()
Definition: TofData.cxx:746
int adcChannel()
Definition: TofData.cxx:755
void clear()
Definition: TofData.cxx:1030
bool used2()
Definition: TofData.cxx:962
int qtimes1()
Definition: TofData.cxx:827
int tnumber1()
Definition: TofData.cxx:890
int adcChannelWest()
Definition: TofData.cxx:737
bool qused2()
Definition: TofData.cxx:935
double tdc1()
Definition: TofData.cxx:647
void setBackward(PmtData *pmt)
Definition: TofData.cxx:1001
int qnumber1()
Definition: TofData.cxx:881
int adcChannelEast()
Definition: TofData.cxx:719
int qclock()
Definition: TofData.cxx:809
int ttimes2()
Definition: TofData.cxx:854
double adc1()
Definition: TofData.cxx:638
int qclock2()
Definition: TofData.cxx:791
unsigned int eastTimes()
Definition: TofData.cxx:863
int tnumber2()
Definition: TofData.cxx:908
bool used1()
Definition: TofData.cxx:953
~TofData()
Definition: TofData.cxx:563
double tdc()
Definition: TofData.cxx:683
void setIdentify(Identifier identify)
Definition: TofData.cxx:577
int tclock2()
Definition: TofData.cxx:800
int tdcChannelEast()
Definition: TofData.cxx:728
double qtc()
Definition: TofData.cxx:710
TofData()
Definition: TofData.cxx:522
bool used()
Definition: TofData.cxx:971
void timespp()
Definition: TofData.cxx:37
TofValue & operator=(const TofValue &source)
Definition: TofData.cxx:26
void timesmm()
Definition: TofData.cxx:43
virtual ~TofValue()
Definition: TofData.cxx:23
TofValue()
Definition: TofData.cxx:12