CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RawDataProviderSvc/RawDataProviderSvc-00-03-40/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( int value );
51
52 void setValue_mrpc(int value, int clock);
53
54 void calculate( bool barrel, int tofid, bool east, int identify );
55 double qtc() const { return m_qtc; }
56
57 private:
58 double m_qtc;
59 bool m_corr, m_elec, m_calculated;
60};
61
62
63class Tdc : public TofValue {
64 public:
65 void setValue( int value );
66 private:
67};
68
69
70class PmtData{
71 public:
72 PmtData();
73 ~PmtData();
74
75 // Assignment constructor.
76 PmtData& operator=(const PmtData& source);
77
78 unsigned int iden() const { return m_iden_value; }
79 unsigned int times() const { return m_times; }
80 int adcChannel();
81 void calculate( bool barrel, int tofid, bool east, int m_identify );
82 double qtc();
83 double adc();
84 int qclock();
85 int tdcChannel();
86 double tdc();
87 int tclock();
88 unsigned int quality() const { return m_quality; }
89
90 void timespp();
91 void timesmm();
92 int qtimes();
93 void qtimespp();
94 void qtimesmm();
95 int ttimes();
96 void ttimespp();
97 void ttimesmm();
98
99 int qnumber();
100 int tnumber();
101
102 bool qused();
103 bool tused();
104 bool used();
105
106 void setIdentify( unsigned int iden ) { m_iden_value = iden; }
107 void setAdc( Adc* adc );
108 void setTdc( Tdc* tdc );
109 void setUsed();
110
111 void clear();
112
113 private:
114 unsigned int m_iden_value;
115 unsigned int m_times;
116 unsigned int m_quality; // 0x 0 0 1 (Q) 1 (T)
117 Adc* m_adc;
118 Tdc* m_tdc;
119
120};
121
122
124 public:
125 TofData();
126 ~TofData();
127
128 // Assignment constructor.
129 TofData& operator=(const TofData& source);
130
131 unsigned int identify() const { return m_identify; }
132 bool barrel() const { return m_barrel; }
133 int tofId();
134 int layer() const { return m_layer; }
135 int tofTrackId() const { return m_tofTrackId; }
136
137 unsigned int times() const { return m_times; }
138
139 void data( double& adcEast, double& tdcEast, double& adcWest, double& tdcWest );
140 void data( double& adc, double& tdc );
141
142 PmtData* forward() const { return m_forward; }
143 PmtData* backward() const { return m_backward; }
144
145 double adc1();
146 double tdc1();
147 double adc2();
148 double tdc2();
149 double adc();
150 double tdc();
151
152 double qtc1();
153 double qtc2();
154 double qtc();
155
156 int adcChannelEast();
157 int tdcChannelEast();
158 int adcChannelWest();
159 int tdcChannelWest();
160 int adcChannel();
161 int tdcChannel();
162
163 int qclock1();
164 int tclock1();
165 int qclock2();
166 int tclock2();
167 int qclock();
168 int tclock();
169
170 unsigned int quality() const { return m_quality; }
171 bool tmatched() const { return m_tmatched; }
172
173 int qtimes1();
174 int ttimes1();
175 int qtimes2();
176 int ttimes2();
177 unsigned int eastTimes();
178 unsigned int westTimes();
179
180 int qnumber1();
181 int tnumber1();
182 int qnumber2();
183 int tnumber2();
184
185 bool qused1();
186 bool tused1();
187 bool qused2();
188 bool tused2();
189 bool used1();
190 bool used2();
191 bool used();
192
193 double ztdc() const { return m_ztdc; }
194 double zadc() const { return m_zadc; }
195
196 double zpos() const { return m_zpos; }
197 double energy() const { return m_energy; }
198
199 public:
201 void setMisLable() { m_misLable = true; }
202 void setTofTrackId( int tofTrackId ) { m_tofTrackId = tofTrackId; }
203 void setTimes( unsigned int times ) { m_times = times; }
204 void setForward( PmtData* pmt );
205 void setBackward( PmtData* pmt );
206 void setQuality( unsigned int quality ) { m_quality = quality; }
207 void setTMatched( bool tmatched ) { m_tmatched = tmatched; }
208 void setUsed();
209 void setZTdc( double ztdc ) { m_ztdc = ztdc; }
210 void setZAdc( double zadc ) { m_zadc = zadc; }
211 void setZpos( double zpos ) { m_zpos = zpos; }
212 void setEnergy( double energy ) { m_energy = energy; }
213
214 void clear();
215
216 private:
217
218 unsigned int m_identify;
219 bool m_barrel;
220 int m_tofId;
221 int m_layer;
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:68
void calculate(bool barrel, int tofid, bool east, int identify)
Definition: TofData.cxx:122
void setValue_mrpc(int value, int clock)
Definition: TofData.cxx:77
void setValue(int value)
Definition: TofData.cxx:85
void qtimespp()
Definition: TofData.cxx:300
int qtimes()
Definition: TofData.cxx:332
bool tused()
Definition: TofData.cxx:377
int tdcChannel()
Definition: TofData.cxx:261
void setAdc(Adc *adc)
Definition: TofData.cxx:398
double tdc()
Definition: TofData.cxx:270
bool qused()
Definition: TofData.cxx:368
int ttimes()
Definition: TofData.cxx:341
void calculate(bool barrel, int tofid, bool east, int m_identify)
Definition: TofData.cxx:216
void qtimesmm()
Definition: TofData.cxx:308
double adc()
Definition: TofData.cxx:238
int tnumber()
Definition: TofData.cxx:359
void setTdc(Tdc *tdc)
Definition: TofData.cxx:408
void timespp()
Definition: TofData.cxx:288
void ttimesmm()
Definition: TofData.cxx:324
void timesmm()
Definition: TofData.cxx:294
~PmtData()
Definition: TofData.cxx:192
PmtData()
Definition: TofData.cxx:183
int adcChannel()
Definition: TofData.cxx:207
void ttimespp()
Definition: TofData.cxx:316
int qnumber()
Definition: TofData.cxx:350
double qtc()
Definition: TofData.cxx:224
void clear()
Definition: TofData.cxx:429
int tclock()
Definition: TofData.cxx:279
PmtData & operator=(const PmtData &source)
Definition: TofData.cxx:197
bool used()
Definition: TofData.cxx:386
void setUsed()
Definition: TofData.cxx:418
int qclock()
Definition: TofData.cxx:252
void setValue(int value)
Definition: TofData.cxx:48
int tdcChannel()
Definition: TofData.cxx:688
double qtc2()
Definition: TofData.cxx:625
int tofId()
Definition: TofData.cxx:494
int qnumber2()
Definition: TofData.cxx:823
int qtimes2()
Definition: TofData.cxx:769
void setUsed()
Definition: TofData.cxx:945
bool tused2()
Definition: TofData.cxx:868
unsigned int westTimes()
Definition: TofData.cxx:796
int ttimes1()
Definition: TofData.cxx:760
bool qused1()
Definition: TofData.cxx:841
bool tused1()
Definition: TofData.cxx:850
double adc2()
Definition: TofData.cxx:580
int tclock1()
Definition: TofData.cxx:706
void setForward(PmtData *pmt)
Definition: TofData.cxx:907
int qclock1()
Definition: TofData.cxx:697
int tclock()
Definition: TofData.cxx:742
double adc()
Definition: TofData.cxx:598
double tdc2()
Definition: TofData.cxx:589
double qtc1()
Definition: TofData.cxx:616
TofData & operator=(const TofData &source)
Definition: TofData.cxx:470
int tdcChannelWest()
Definition: TofData.cxx:670
int adcChannel()
Definition: TofData.cxx:679
void clear()
Definition: TofData.cxx:956
bool used2()
Definition: TofData.cxx:886
int qtimes1()
Definition: TofData.cxx:751
int tnumber1()
Definition: TofData.cxx:814
int adcChannelWest()
Definition: TofData.cxx:661
bool qused2()
Definition: TofData.cxx:859
double tdc1()
Definition: TofData.cxx:571
void setBackward(PmtData *pmt)
Definition: TofData.cxx:926
int qnumber1()
Definition: TofData.cxx:805
int adcChannelEast()
Definition: TofData.cxx:643
int qclock()
Definition: TofData.cxx:733
int ttimes2()
Definition: TofData.cxx:778
double adc1()
Definition: TofData.cxx:562
int qclock2()
Definition: TofData.cxx:715
unsigned int eastTimes()
Definition: TofData.cxx:787
int tnumber2()
Definition: TofData.cxx:832
bool used1()
Definition: TofData.cxx:877
~TofData()
Definition: TofData.cxx:489
double tdc()
Definition: TofData.cxx:607
void setIdentify(Identifier identify)
Definition: TofData.cxx:503
int tclock2()
Definition: TofData.cxx:724
int tdcChannelEast()
Definition: TofData.cxx:652
double qtc()
Definition: TofData.cxx:634
TofData()
Definition: TofData.cxx:452
bool used()
Definition: TofData.cxx:895
void timespp()
Definition: TofData.cxx:36
TofValue & operator=(const TofValue &source)
Definition: TofData.cxx:25
void timesmm()
Definition: TofData.cxx:42
virtual void setValue(int value)=0
virtual ~TofValue()
Definition: TofData.cxx:22
TofValue()
Definition: TofData.cxx:11