BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
TofCalibData.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "CalibData/Tof/bTofCalibBase.h"
3#include "CalibData/Tof/bTofCommonCalibBase.h"
4#include "CalibData/Tof/eTofCalibBase.h"
5#include "CalibData/Tof/etfCalibBase.h"
6#include "CalibData/Tof/TofCalibData.h"
7
8namespace CalibData {
9
10 TofCalibData::TofCalibData(std::vector<bTofCalibBase>* bTofCal,std::vector<bTofCommonCalibBase>* bTofComCal,std::vector<eTofCalibBase>* eTofCal,std::vector<etfCalibBase>* etfCal,std::vector<etfBunchCalibBase>* etfBunchCal,std::vector<tofCalibInfoBase>* tofInfoCal){
11 if(bTofCal){
12 m_bTofCalibData = new std::vector<bTofCalibBase>(*bTofCal);
13 }
14 if(bTofComCal){
15 m_bTofCommonCalibData = new std::vector<bTofCommonCalibBase>(*bTofComCal);
16 }
17 if(eTofCal){
18 m_eTofCalibData = new std::vector<eTofCalibBase>(*eTofCal);
19 }
20
21 m_hasEtf = false;
22 m_etfCalibData = NULL;
23 if( etfCal->size() > 0 ) {
24 m_hasEtf = true;
25 m_etfCalibData = new std::vector<etfCalibBase>(*etfCal);
26 }
27 m_hasEtfBunch = false;
28 m_etfBunchCalibData = NULL;
29 if( etfBunchCal->size() > 0 ) {
30 m_hasEtfBunch = true;
31 m_etfBunchCalibData = new std::vector<etfBunchCalibBase>(*etfBunchCal);
32 }
33
34 if(tofInfoCal){
35 m_tofCalibInfoData = new std::vector<tofCalibInfoBase>(*tofInfoCal);
36 }
37 }
38
39 TofCalibData::TofCalibData(std::vector<bTofCalibBase>* bTofCal,std::vector<bTofCommonCalibBase>* bTofComCal,std::vector<eTofCalibBase>* eTofCal,std::vector<etfCalibBase>* etfCal,std::vector<tofCalibInfoBase>* tofInfoCal){
40 if(bTofCal){
41 m_bTofCalibData = new std::vector<bTofCalibBase>(*bTofCal);
42 }
43 if(bTofComCal){
44 m_bTofCommonCalibData = new std::vector<bTofCommonCalibBase>(*bTofComCal);
45 }
46 if(eTofCal){
47 m_eTofCalibData = new std::vector<eTofCalibBase>(*eTofCal);
48 }
49
50 m_hasEtf = false;
51 m_etfCalibData = NULL;
52 if( etfCal->size() > 0 ) {
53 m_hasEtf = true;
54 m_etfCalibData = new std::vector<etfCalibBase>(*etfCal);
55 }
56 m_hasEtfBunch = false;
57 m_etfBunchCalibData = NULL;
58
59 if(tofInfoCal){
60 m_tofCalibInfoData = new std::vector<tofCalibInfoBase>(*tofInfoCal);
61 }
62 }
63
64 TofCalibData::TofCalibData(std::vector<bTofCalibBase>* bTofCal,std::vector<bTofCommonCalibBase>* bTofComCal,std::vector<eTofCalibBase>* eTofCal,std::vector<tofCalibInfoBase>* tofInfoCal){
65 if(bTofCal){
66 m_bTofCalibData = new std::vector<bTofCalibBase>(*bTofCal);
67 }
68 if(bTofComCal){
69 m_bTofCommonCalibData = new std::vector<bTofCommonCalibBase>(*bTofComCal);
70 }
71 if(eTofCal){
72 m_eTofCalibData = new std::vector<eTofCalibBase>(*eTofCal);
73 }
74 if(tofInfoCal){
75 m_tofCalibInfoData = new std::vector<tofCalibInfoBase>(*tofInfoCal);
76 }
77 m_hasEtf = false;
78 m_etfCalibData = NULL;
79 m_hasEtfBunch = false;
80 m_etfBunchCalibData = NULL;
81 }
82
83 StatusCode TofCalibData::update(CalibBase1& other, MsgStream* log)
84 {
85 TofCalibData& other1 = dynamic_cast<TofCalibData& >(other);
86 std::cout<<"========================================"<<"\n"<<"here is the update in the TofCalibData"<<"\n"<<"========================================"<<std::endl;
87 CalibBase1::update(other, log);
88 delete m_bTofCalibData;
89 m_bTofCalibData = new std::vector<bTofCalibBase>(*(other1.m_bTofCalibData));
90 delete m_bTofCommonCalibData;
91 m_bTofCommonCalibData = new std::vector<bTofCommonCalibBase>(*(other1.m_bTofCommonCalibData));
92 delete m_eTofCalibData;
93 m_eTofCalibData = new std::vector<eTofCalibBase>(*(other1.m_eTofCalibData));
94 delete m_tofCalibInfoData;
95 m_tofCalibInfoData = new std::vector<tofCalibInfoBase>(*(other1.m_tofCalibInfoData));
96
97 if( m_etfCalibData ) { delete m_etfCalibData; }
98 if( other1.m_etfCalibData ) {
99 if( (other1.m_etfCalibData)->size() > 0 ) {
100 m_etfCalibData = new std::vector<etfCalibBase>(*(other1.m_etfCalibData));
101 m_hasEtf = true;
102 }
103 }
104 else {
105 m_etfCalibData = NULL;
106 m_hasEtf = false;
107 }
108
109 if( m_etfBunchCalibData ) { delete m_etfBunchCalibData; }
110 if( other1.m_etfBunchCalibData ) {
111 if( (other1.m_etfBunchCalibData)->size() > 0 ) {
112 m_etfBunchCalibData = new std::vector<etfBunchCalibBase>(*(other1.m_etfBunchCalibData));
113 m_hasEtfBunch = true;
114 }
115 }
116 else {
117 m_etfBunchCalibData = NULL;
118 m_hasEtfBunch = false;
119 }
120
121 return StatusCode::SUCCESS;
122 }
123
124 //get the CalibData
125 unsigned int TofCalibData::getBTofSize() const{
126 return m_bTofCalibData->size();
127 }
128
130 std::vector<bTofCalibBase>::iterator it = m_bTofCalibData->begin();
131 for(int i=0;i!=cnt;i++,it++) {
132 }
133 return *it;
134 }
135
137 return m_bTofCommonCalibData->size();
138 }
139
141 std::vector<bTofCommonCalibBase>::iterator it = m_bTofCommonCalibData->begin();
142 for(int i=0;i!=cnt;i++,it++) {
143 }
144 return *it;
145 }
146
147 unsigned int TofCalibData::getETofSize() const{
148 return m_eTofCalibData->size();
149 }
150
152 std::vector<eTofCalibBase>::iterator it = m_eTofCalibData->begin();
153 for(int i=0;i!=cnt;i++,it++) {
154 }
155 return *it;
156 }
157
158 unsigned int TofCalibData::getEtfSize() const{
159 unsigned int size = 72*12;
160 if( m_hasEtf ) {
161 size = m_etfCalibData->size();
162 }
163 return size;
164 }
165
166 etfCalibBase TofCalibData::getEtf(int cnt,int strip) const{
167 std::vector<etfCalibBase>::iterator it = m_etfCalibData->begin();
168 for(int i=0;i!=cnt;i++) {
169 for( int j=0;j!=12;j++,it++) {
170 }
171 }
172 for( int j=0;j!=strip;j++,it++) {
173 }
174 return *it;
175 }
176
177 unsigned int TofCalibData::getEtfBunchSize() const{
178 unsigned int size = 0;
179 if( m_hasEtfBunch ) {
180 size = m_etfBunchCalibData->size();
181 }
182 return size;
183 }
184
186 std::vector<etfBunchCalibBase>::iterator it = m_etfBunchCalibData->begin();
187 for(int i=0;i!=cnt;i++,it++) {
188 }
189 return *it;
190 }
191
192 unsigned int TofCalibData::getTofInfoSize() const{
193 return m_tofCalibInfoData->size();
194 }
195
197 std::vector<tofCalibInfoBase>::iterator it = m_tofCalibInfoData->begin();
198 for(int i=0;i!=cnt;i++,it++) {
199 }
200 return *it;
201 }
202
203 double TofCalibData::getBTofAtten(int index,int pardex){
204 bTofCalibBase bTof = getBTof(index);
205 return bTof.getAtten(pardex);
206 }
207
208 double TofCalibData::getBTofSpeed(int index,int pardex){
209 bTofCalibBase bTof = getBTof(index);
210 return bTof.getSpeed(pardex);
211 }
212
213 double TofCalibData::getBTofPleft(int index,int pardex){
214 bTofCalibBase bTof = getBTof(index);
215 return bTof.getP1(pardex);
216 }
217
218 double TofCalibData::getBTofPright(int index,int pardex){
219 bTofCalibBase bTof = getBTof(index);
220 return bTof.getP2(pardex);
221 }
222
223 double TofCalibData::getBTofPoffleft_bunch0(int index,int pardex){
224 bTofCalibBase bTof = getBTof(index);
225 return bTof.getPoff1_bunch0(pardex);
226 }
227
228 double TofCalibData::getBTofPoffright_bunch0(int index,int pardex){
229 bTofCalibBase bTof = getBTof(index);
230 return bTof.getPoff2_bunch0(pardex);
231 }
232
233 double TofCalibData::getBTofPoffleft_bunch1(int index,int pardex){
234 bTofCalibBase bTof = getBTof(index);
235 return bTof.getPoff1_bunch1(pardex);
236 }
237
238 double TofCalibData::getBTofPoffright_bunch1(int index,int pardex){
239 bTofCalibBase bTof = getBTof(index);
240 return bTof.getPoff2_bunch1(pardex);
241 }
242
243 double TofCalibData::getBTofPoffleft_bunch2(int index,int pardex){
244 bTofCalibBase bTof = getBTof(index);
245 return bTof.getPoff1_bunch2(pardex);
246 }
247
248 double TofCalibData::getBTofPoffright_bunch2(int index,int pardex){
249 bTofCalibBase bTof = getBTof(index);
250 return bTof.getPoff2_bunch2(pardex);
251 }
252
253 double TofCalibData::getBTofPoffleft_bunch3(int index,int pardex){
254 bTofCalibBase bTof = getBTof(index);
255 return bTof.getPoff1_bunch3(pardex);
256 }
257
258 double TofCalibData::getBTofPoffright_bunch3(int index,int pardex){
259 bTofCalibBase bTof = getBTof(index);
260 return bTof.getPoff2_bunch3(pardex);
261 }
262
263 double TofCalibData::getBTofFleft(int index,int pardex){
264 bTofCalibBase bTof = getBTof(index);
265 return bTof.getFleft(pardex);
266 }
267
268 double TofCalibData::getBTofFright(int index,int pardex){
269 bTofCalibBase bTof = getBTof(index);
270 return bTof.getFright(pardex);
271 }
272
273 double TofCalibData::getBTofFcounter(int index,int pardex){
274 bTofCalibBase bTof = getBTof(index);
275 return bTof.getFcounter(pardex);
276 }
277
278 double TofCalibData::getBTofOffset(int cnt, int pardex){
279 bTofCommonCalibBase bTofCom = getBTofCom(cnt);
280 return bTofCom.getOffset(pardex);
281 }
282
283 double TofCalibData::getBTofSigmaCorr(int cnt, int pardex){
284 bTofCommonCalibBase bTofCom = getBTofCom(cnt);
285 return bTofCom.getSigmaCorr(pardex);
286 }
287
288 double TofCalibData::getETofAtten(int index,int pardex){
289 eTofCalibBase eTof = getETof(index);
290 return eTof.getAtten(pardex);
291 }
292
293 double TofCalibData::getETofSpeed(int index,int pardex){
294 eTofCalibBase eTof = getETof(index);
295 return eTof.getSpeed(pardex);
296 }
297
298 double TofCalibData::getETofP(int index,int pardex){
299 eTofCalibBase eTof = getETof(index);
300 return eTof.getP(pardex);
301 }
302
303 double TofCalibData::getETofFP(int index,int pardex){
304 eTofCalibBase eTof = getETof(index);
305 return eTof.getFP(pardex);
306 }
307
308 double TofCalibData::getEtfSpeed(int index,int strip,int pardex){
309 if( !m_hasEtf ) { return 1.0; }
310 etfCalibBase etf = getEtf(index,strip);
311 return etf.getSpeed(pardex);
312 }
313
314 double TofCalibData::getEtfPcombine(int index,int strip,int pardex){
315 if( !m_hasEtf ) { return 1.0; }
316 etfCalibBase etf = getEtf(index,strip);
317 return etf.getP(pardex);
318 }
319
320 double TofCalibData::getEtfPleft(int index,int strip,int pardex){
321 if( !m_hasEtf ) { return 1.0; }
322 etfCalibBase etf = getEtf(index,strip);
323 return etf.getP1(pardex);
324 }
325
326 double TofCalibData::getEtfPright(int index,int strip,int pardex){
327 if( !m_hasEtf ) { return 1.0; }
328 etfCalibBase etf = getEtf(index,strip);
329 return etf.getP2(pardex);
330 }
331
332 double TofCalibData::getEtfPBunch(int cnt, int pardex){
333 if( !m_hasEtfBunch ) { return 0.0; }
334 etfBunchCalibBase etfBunch = getEtfBunch(cnt);
335 return etfBunch.getPBunch(pardex);
336 }
337
339 tofCalibInfoBase tofInfo = getTofInfo(cnt);
340 return tofInfo.getRunBegin();
341 }
342
344 tofCalibInfoBase tofInfo = getTofInfo(cnt);
345 return tofInfo.getRunEnd();
346 }
347
349 tofCalibInfoBase tofInfo = getTofInfo(cnt);
350 return tofInfo.getVersion();
351 }
352
354 tofCalibInfoBase tofInfo = getTofInfo(cnt);
355 return tofInfo.getQCorr();
356 }
357
359 tofCalibInfoBase tofInfo = getTofInfo(cnt);
360 return tofInfo.getQElec();
361 }
362
364 tofCalibInfoBase tofInfo = getTofInfo(cnt);
365 return tofInfo.getMisLable();
366 }
367
368 int TofCalibData::getBrEast(int cnt, int index){
369 tofCalibInfoBase tofInfo = getTofInfo(cnt);
370 return tofInfo.getBrEast(index);
371 }
372
373 int TofCalibData::getBrWest(int cnt, int index){
374 tofCalibInfoBase tofInfo = getTofInfo(cnt);
375 return tofInfo.getBrWest(index);
376 }
377
378 int TofCalibData::getEndcap(int cnt, int index){
379 tofCalibInfoBase tofInfo = getTofInfo(cnt);
380 return tofInfo.getEndcap(index);
381 }
382
384 tofCalibInfoBase tofInfo = getTofInfo(cnt);
385 return tofInfo.getRunFrom();
386 }
387
389 tofCalibInfoBase tofInfo = getTofInfo(cnt);
390 return tofInfo.getRunTo();
391 }
392
394 tofCalibInfoBase tofInfo = getTofInfo(cnt);
395 return tofInfo.getEventFrom();
396 }
397
399 tofCalibInfoBase tofInfo = getTofInfo(cnt);
400 return tofInfo.getEventTo();
401 }
402
403}
404
405
406
virtual StatusCode update(CalibBase1 &obj, MsgStream *)
Definition: CalibBase1.cxx:33
double getETofFP(int index, int pardex)
double getBTofPoffleft_bunch1(int index, int pardex)
unsigned int getEtfBunchSize() const
unsigned int getEtfSize() const
double getBTofPoffleft_bunch3(int index, int pardex)
double getBTofSpeed(int index, int pardex)
double getBTofOffset(int cnt, int pardex)
double getETofP(int index, int pardex)
double getBTofPoffright_bunch3(int index, int pardex)
unsigned int getETofSize() const
double getEtfPBunch(int cnx, int pardex)
unsigned int getTofInfoSize() const
double getBTofSigmaCorr(int cnt, int pardex)
tofCalibInfoBase getTofInfo(int cnt) const
double getBTofPoffright_bunch2(int index, int pardex)
int getBrWest(int cnt, int index)
double getBTofFleft(int index, int pardex)
double getBTofPoffright_bunch0(int index, int pardex)
etfCalibBase getEtf(int cnt, int strip) const
eTofCalibBase getETof(int cnt) const
double getBTofPoffright_bunch1(int index, int pardex)
double getEtfSpeed(int index, int strip, int pardex)
double getBTofFright(int index, int pardex)
double getBTofFcounter(int index, int pardex)
int getEndcap(int cnt, int index)
double getBTofPoffleft_bunch2(int index, int pardex)
etfBunchCalibBase getEtfBunch(int cnt) const
double getEtfPleft(int index, int strip, int pardex)
double getEtfPcombine(int index, int strip, int pardex)
double getETofAtten(int index, int pardex)
double getBTofAtten(int index, int pardex)
int getBrEast(int cnt, int index)
bTofCommonCalibBase getBTofCom(int cnt) const
virtual StatusCode update(CalibBase1 &other, MsgStream *log)
unsigned int getBTofSize() const
double getBTofPoffleft_bunch0(int index, int pardex)
double getEtfPright(int index, int strip, int pardex)
double getBTofPleft(int index, int pardex)
bTofCalibBase getBTof(int cnt) const
double getETofSpeed(int index, int pardex)
double getBTofPright(int index, int pardex)