BOSS 7.0.4
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
127 std::vector<bTofCalibBase>::iterator it = m_bTofCalibData->begin();
128 for(int i=0;i!=cnt;i++,it++) {
129 }
130 return *it;
131 }
132
134 std::vector<bTofCommonCalibBase>::iterator it = m_bTofCommonCalibData->begin();
135 return *it;
136 }
137
139 std::vector<eTofCalibBase>::iterator it = m_eTofCalibData->begin();
140 for(int i=0;i!=cnt;i++,it++) {
141 }
142 return *it;
143 }
144
145 etfCalibBase TofCalibData::getEtf(int cnt,int strip) const{
146 std::vector<etfCalibBase>::iterator it = m_etfCalibData->begin();
147 for(int i=0;i!=cnt;i++) {
148 for( int j=0;j!=12;j++,it++) {
149 }
150 }
151 for( int j=0;j!=strip;j++,it++) {
152 }
153 return *it;
154 }
155
157 std::vector<etfBunchCalibBase>::iterator it = m_etfBunchCalibData->begin();
158 return *it;
159 }
160
162 std::vector<tofCalibInfoBase>::iterator it = m_tofCalibInfoData->begin();
163 return *it;
164 }
165
166 double TofCalibData::getBTofAtten(int index,int pardex){
167 bTofCalibBase bTof = getBTof(index);
168 return bTof.getAtten(pardex);
169 }
170
171 double TofCalibData::getBTofSpeed(int index,int pardex){
172 bTofCalibBase bTof = getBTof(index);
173 return bTof.getSpeed(pardex);
174 }
175
176 double TofCalibData::getBTofPleft(int index,int pardex){
177 bTofCalibBase bTof = getBTof(index);
178 return bTof.getP1(pardex);
179 }
180
181 double TofCalibData::getBTofPright(int index,int pardex){
182 bTofCalibBase bTof = getBTof(index);
183 return bTof.getP2(pardex);
184 }
185
186 double TofCalibData::getBTofPoffleft_bunch0(int index,int pardex){
187 bTofCalibBase bTof = getBTof(index);
188 return bTof.getPoff1_bunch0(pardex);
189 }
190
191 double TofCalibData::getBTofPoffright_bunch0(int index,int pardex){
192 bTofCalibBase bTof = getBTof(index);
193 return bTof.getPoff2_bunch0(pardex);
194 }
195
196 double TofCalibData::getBTofPoffleft_bunch1(int index,int pardex){
197 bTofCalibBase bTof = getBTof(index);
198 return bTof.getPoff1_bunch1(pardex);
199 }
200
201 double TofCalibData::getBTofPoffright_bunch1(int index,int pardex){
202 bTofCalibBase bTof = getBTof(index);
203 return bTof.getPoff2_bunch1(pardex);
204 }
205
206 double TofCalibData::getBTofPoffleft_bunch2(int index,int pardex){
207 bTofCalibBase bTof = getBTof(index);
208 return bTof.getPoff1_bunch2(pardex);
209 }
210
211 double TofCalibData::getBTofPoffright_bunch2(int index,int pardex){
212 bTofCalibBase bTof = getBTof(index);
213 return bTof.getPoff2_bunch2(pardex);
214 }
215
216 double TofCalibData::getBTofPoffleft_bunch3(int index,int pardex){
217 bTofCalibBase bTof = getBTof(index);
218 return bTof.getPoff1_bunch3(pardex);
219 }
220
221 double TofCalibData::getBTofPoffright_bunch3(int index,int pardex){
222 bTofCalibBase bTof = getBTof(index);
223 return bTof.getPoff2_bunch3(pardex);
224 }
225
226 double TofCalibData::getBTofFleft(int index,int pardex){
227 bTofCalibBase bTof = getBTof(index);
228 return bTof.getFleft(pardex);
229 }
230
231 double TofCalibData::getBTofFright(int index,int pardex){
232 bTofCalibBase bTof = getBTof(index);
233 return bTof.getFright(pardex);
234 }
235
236 double TofCalibData::getBTofFcounter(int index,int pardex){
237 bTofCalibBase bTof = getBTof(index);
238 return bTof.getFcounter(pardex);
239 }
240
241 double TofCalibData::getBTofOffset(int pardex){
243 return bTofCom.getOffset(pardex);
244 }
245
248 return bTofCom.getSigmaCorr(pardex);
249 }
250
251 double TofCalibData::getETofAtten(int index,int pardex){
252 eTofCalibBase eTof = getETof(index);
253 return eTof.getAtten(pardex);
254 }
255
256 double TofCalibData::getETofSpeed(int index,int pardex){
257 eTofCalibBase eTof = getETof(index);
258 return eTof.getSpeed(pardex);
259 }
260
261 double TofCalibData::getETofP(int index,int pardex){
262 eTofCalibBase eTof = getETof(index);
263 return eTof.getP(pardex);
264 }
265
266 double TofCalibData::getETofFP(int index,int pardex){
267 eTofCalibBase eTof = getETof(index);
268 return eTof.getFP(pardex);
269 }
270
271 double TofCalibData::getEtfSpeed(int index,int strip,int pardex){
272 if( !m_hasEtf ) { return 1.0; }
273 etfCalibBase etf = getEtf(index,strip);
274 return etf.getSpeed(pardex);
275 }
276
277 double TofCalibData::getEtfPcombine(int index,int strip,int pardex){
278 if( !m_hasEtf ) { return 1.0; }
279 etfCalibBase etf = getEtf(index,strip);
280 return etf.getP(pardex);
281 }
282
283 double TofCalibData::getEtfPleft(int index,int strip,int pardex){
284 if( !m_hasEtf ) { return 1.0; }
285 etfCalibBase etf = getEtf(index,strip);
286 return etf.getP1(pardex);
287 }
288
289 double TofCalibData::getEtfPright(int index,int strip,int pardex){
290 if( !m_hasEtf ) { return 1.0; }
291 etfCalibBase etf = getEtf(index,strip);
292 return etf.getP2(pardex);
293 }
294
295 double TofCalibData::getEtfPBunch(int pardex){
296 if( !m_hasEtfBunch ) { return 0.0; }
297 etfBunchCalibBase etfBunch = getEtfBunch();
298 return etfBunch.getPBunch(pardex);
299 }
300
302 tofCalibInfoBase tofInfo = getTofInfo();
303 return tofInfo.getRunBegin();
304 }
305
307 tofCalibInfoBase tofInfo = getTofInfo();
308 return tofInfo.getRunEnd();
309 }
310
312 tofCalibInfoBase tofInfo = getTofInfo();
313 return tofInfo.getVersion();
314 }
315
317 tofCalibInfoBase tofInfo = getTofInfo();
318 return tofInfo.getQCorr();
319 }
320
322 tofCalibInfoBase tofInfo = getTofInfo();
323 return tofInfo.getQElec();
324 }
325
327 tofCalibInfoBase tofInfo = getTofInfo();
328 return tofInfo.getMisLable();
329 }
330
332 tofCalibInfoBase tofInfo = getTofInfo();
333 return tofInfo.getBrEast(index);
334 }
335
337 tofCalibInfoBase tofInfo = getTofInfo();
338 return tofInfo.getBrWest(index);
339 }
340
342 tofCalibInfoBase tofInfo = getTofInfo();
343 return tofInfo.getEndcap(index);
344 }
345
346}
347
348
virtual StatusCode update(CalibBase1 &obj, MsgStream *)
Definition: CalibBase1.cxx:33
double getETofFP(int index, int pardex)
etfBunchCalibBase getEtfBunch() const
double getBTofPoffleft_bunch1(int index, int pardex)
double getBTofPoffleft_bunch3(int index, int pardex)
double getBTofSpeed(int index, int pardex)
double getETofP(int index, int pardex)
double getBTofPoffright_bunch3(int index, int pardex)
bTofCommonCalibBase getBTofCom() const
double getBTofPoffright_bunch2(int index, int pardex)
double getBTofSigmaCorr(int pardex)
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)
tofCalibInfoBase getTofInfo() const
double getBTofFright(int index, int pardex)
double getBTofFcounter(int index, int pardex)
int getBrWest(int index)
double getBTofPoffleft_bunch2(int index, int pardex)
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)
virtual StatusCode update(CalibBase1 &other, MsgStream *log)
int getBrEast(int index)
int getEndcap(int index)
double getEtfPBunch(int pardex)
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 getBTofOffset(int pardex)
double getETofSpeed(int index, int pardex)
double getBTofPright(int index, int pardex)