BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
EstTofCaliSvc.cxx
Go to the documentation of this file.
1//********************************************************
2//
3// Class: EstTofCaliSvc
4// Sun Shengsen <[email protected]>
5//
6// Description:
7// This service is used to get Tof Calibrarion constants
8// from DataBase and do the Tof data reconstruction.
9//
10//*********************************************************
11#include "EstTofCaliSvc/EstTofCaliSvc.h"
12#include "EstTofCaliSvc/BTofCal.h"
13#include "EstTofCaliSvc/BTofCommonCal.h"
14#include "EstTofCaliSvc/ETofCal.h"
15#include "EstTofCaliSvc/EtfCal.h"
16#include "EstTofCaliSvc/TofInfoCal.h"
17#include "GaudiKernel/Kernel.h"
18#include "GaudiKernel/IInterface.h"
19#include "GaudiKernel/StatusCode.h"
20#include "GaudiKernel/SvcFactory.h"
21#include "GaudiKernel/MsgStream.h"
22#include "TMath.h"
23#include <math.h>
24#include <iostream>
25#include <fstream>
26#include "GaudiKernel/IIncidentSvc.h"
27#include "GaudiKernel/Incident.h"
28#include "GaudiKernel/IIncidentListener.h"
29#include "GaudiKernel/IDataProviderSvc.h"
30#include "GaudiKernel/Service.h"
31#include "GaudiKernel/MsgStream.h"
32#include "GaudiKernel/SmartDataPtr.h"
33#include "CalibData/Tof/TofCalibData.h"
34#include "CalibData/Tof/bTofCalibBase.h"
35#include "CalibData/CalibModel.h"
36#include "GaudiKernel/DataSvc.h"
37
38using namespace std;
39
40// static double radius_Inner = 81.35;
41// static double radius_Outer = 87.05;
42
43EstTofCaliSvc::EstTofCaliSvc( const std::string& name, ISvcLocator* svcloc ) : Service(name, svcloc) {
44 declareProperty("Run",m_run=1);
45}
46
47StatusCode EstTofCaliSvc::queryInterface (const InterfaceID& riid, void** ppvInterface ){
48
49 if ( IID_IEstTofCaliSvc.versionMatch(riid) ) {
50 *ppvInterface = static_cast<IEstTofCaliSvc*> (this);
51 } else {
52 return Service::queryInterface(riid, ppvInterface) ;
53 }
54 return StatusCode::SUCCESS;
55}
56
58 m_hasbeeninitialized=false;
59 m_st=false;
60
61 MsgStream log(msgSvc(), name());
62 log << MSG::INFO << name() << ": Start of run initialisation" << endreq;
63
64 StatusCode sc = Service::initialize();
65 if ( sc.isFailure() ) return sc;
66
67 IIncidentSvc* incsvc;
68 sc = service("IncidentSvc", incsvc);
69 int priority = 100;
70 if( sc.isSuccess() ){
71 incsvc -> addListener(this, "NewRun", priority);
72 }
73
74 StatusCode scc;
75
76 log<<MSG::INFO << "setProperties()" << endreq;
77 scc = service("CalibDataSvc", m_pCalibDataSvc, true);
78 if ( !scc.isSuccess() ) {
79 log<<MSG::ERROR<<"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"<<endreq;
80 return scc;
81 } else {
82 log << MSG::DEBUG<< "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"<<endreq;
83 }
84 // Get properties from the JobOptionsSvc
85 scc = setProperties();
86
87 return sc;
88}
89
91 MsgStream log(msgSvc(), name());
92 log << MSG::INFO << name() << ": End of Run" << endreq;
93 return StatusCode::SUCCESS;
94}
95
97 for(vector<BTofCal*>::iterator it1 = fBTofCal.begin(); it1 != fBTofCal.end(); it1++) { delete (*it1); }
98 fBTofCal.clear();
99 for(vector<ETofCal*>::iterator it2 = fETofCal.begin(); it2 != fETofCal.end(); it2++) { delete (*it2); }
100 fETofCal.clear();
101 if( fEtfCal.size()!=0 ) {
102 for(vector<EtfCal*>::iterator it5 = fEtfCal.begin(); it5 != fEtfCal.end(); it5++) { delete (*it5); }
103 fEtfCal.clear();
104 }
105 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); }
106 fBTofCommonCal.clear();
107 for(vector<TofInfoCal*>::iterator it4 = fTofInfoCal.begin(); it4 != fTofInfoCal.end(); it4++) { delete (*it4); }
108 fTofInfoCal.clear();
109 return;
110}
111StatusCode EstTofCaliSvc::FillfromDatabase(){
112
113 MsgStream log(msgSvc(), name());
114 std::string fullPath = "/Calib/EstTofCal";
115 log << MSG::INFO<<" Tof calib fullPath = "<<fullPath<< endreq;
116 SmartDataPtr<CalibData::TofCalibData> test(m_pCalibDataSvc, fullPath);
117 if(!test){
118 log << MSG::FATAL << "EstTofCaliSvc could not find TofCalibData in TCDS!!" << endreq;
119 m_st=false;
120 return StatusCode::FAILURE;
121 }
122
123 m_st=true;
124
125 for(vector<BTofCal*>::iterator it1 = fBTofCal.begin(); it1 != fBTofCal.end(); it1++) { delete (*it1); }
126 fBTofCal.clear();
127 for(vector<ETofCal*>::iterator it2 = fETofCal.begin(); it2 != fETofCal.end(); it2++) { delete (*it2); }
128 fETofCal.clear();
129 if( fEtfCal.size()!=0 ) {
130 for(vector<EtfCal*>::iterator it5 = fEtfCal.begin(); it5 != fEtfCal.end(); it5++) { delete (*it5); }
131 fEtfCal.clear();
132 }
133 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); }
134 fBTofCommonCal.clear();
135 for(vector<TofInfoCal*>::iterator it4 = fTofInfoCal.begin(); it4 != fTofInfoCal.end(); it4++) { delete (*it4); }
136 fTofInfoCal.clear();
137
138 unsigned int ibSize = test->getBTofSize();
139 unsigned int ibcomSize = test->getBTofComSize();
140 unsigned int ieSize = test->getETofSize();
141 unsigned int ietfSize = test->getEtfSize();
142 ietfSize = ietfSize/12;
143 unsigned int iinfoSize = test->getTofInfoSize();
144
145 for(int ib=0;ib<ibSize;ib++){
146 BTofCal* btof = new BTofCal;
147 for( int j=0; j<static_cast<int>(nBarPar); j++){
148 btof->setP1(j,test->getBTofPleft(ib,j));
149 btof->setP2(j,test->getBTofPright(ib,j));
150 }
151 fBTofCal.push_back(btof);
152 }
153
154 for(int ie=0;ie<ieSize;ie++){
155 ETofCal* etof= new ETofCal;
156 for(int i=0;i<static_cast<int>(nEndPar);i++){
157 etof->setP(i,test->getETofP(ie,i));
158 }
159 fETofCal.push_back(etof);
160 }
161
162 for(int ietf=0;ietf<ietfSize;ietf++) {
163 for(int jetf=0;jetf<12;jetf++) {
164 EtfCal* etf= new EtfCal;
165 for( int k=0; k<static_cast<int>(nEtfPar); k++ ) {
166 etf->setP( k,test->getEtfPcombine(ietf,jetf,k));
167 etf->setP1(k,test->getEtfPleft(ietf,jetf,k));
168 etf->setP2(k,test->getEtfPright(ietf,jetf,k));
169 }
170 fEtfCal.push_back(etf);
171 }
172 }
173
174 for( int ibcom=0; ibcom<ibcomSize; ibcom++ ) {
175 BTofCommonCal* bcomtof = new BTofCommonCal;
176 for(int i=0; i<static_cast<int>(nBarOffset); i++) {
177 bcomtof->setOffset( i, test->getBTofOffset(ibcom, i) );
178 }
179 fBTofCommonCal.push_back(bcomtof);
180 }
181
182 for( int iinfo=0; iinfo<iinfoSize; iinfo++ ) {
183 TofInfoCal* tofinfo = new TofInfoCal;
184 tofinfo->setRunFrom( test->getRunFrom( iinfo ) );
185 tofinfo->setRunTo( test->getRunTo( iinfo ) );
186 tofinfo->setEventFrom( test->getEventFrom( iinfo ) );
187 tofinfo->setEventTo( test->getEventTo( iinfo ) );
188 fTofInfoCal.push_back(tofinfo);
189 }
190
191 return StatusCode::SUCCESS;
192
193}
194
195
196StatusCode EstTofCaliSvc::chooseConstants(int run, int event ) {
197
198 MsgStream log(msgSvc(), name());
199
200 m_sequence = 0;
201 bool filled = false;
202 unsigned int inumber = 0;
203 std::vector<TofInfoCal*>::iterator it = fTofInfoCal.begin();
204 if( (*it)->getRunFrom() == -1 ) {
205 if( fTofInfoCal.size() == 1 ) {
206 log << MSG::INFO << "EstTofCaliSvc::chooseConstants() -- Run From is equal to -1! The ONLY TOF calibration constants are used!" << endreq;
207 return StatusCode::SUCCESS;
208 }
209 else {
210 log << MSG::ERROR << "EstTofCaliSvc::chooseConstants() -- Run From is equal to -1! The NUMBER of calibration constants are NOT equal to 1!" << endreq;
211 return StatusCode::FAILURE;
212 }
213 }
214
215 for( ; it!= fTofInfoCal.end(); it++, inumber++ ) {
216 if( ( (*it)->getRunTo() != -1 ) && ( (*it)->getRunTo() < (*it)->getRunFrom() ) ) {
217 log << MSG::ERROR << "EstTofCaliSvc::chooseConstants() -- The " << inumber << "th calibration constatns is ABNORMAL! Run From is LARGER than RUN To!" << endreq;
218 return StatusCode::FAILURE;
219 }
220 if( ( (*it)->getRunFrom() == (*it)->getRunTo() ) && ( (*it)->getEventFrom() != -1 ) && ( (*it)->getEventTo() != -1 ) && ( (*it)->getEventFrom() > (*it)->getEventTo() ) ) {
221 log << MSG::ERROR << "EstTofCaliSvc::chooseConstants() -- The " << inumber << "th calibration constatns is ABNORMAL! Event From is LARGER than Event To!" << endreq;
222 return StatusCode::FAILURE;
223 }
224 }
225
226 it = fTofInfoCal.begin();
227 inumber = 0;
228 for( ; it!= fTofInfoCal.end(); it++, inumber++ ) {
229 int runFrom = (*it)->getRunFrom();
230 int runTo = (*it)->getRunTo();
231 int eventFrom = (*it)->getEventFrom();
232 int eventTo = (*it)->getEventTo();
233 if( ( run == runFrom ) && ( ( eventFrom == -1 ) || ( event >= eventFrom ) ) ) {
234 if( ( run < runTo ) || ( ( run == runTo ) && ( ( eventTo == -1 ) || ( event <= eventTo ) ) ) ) {
235 filled = true;
236 break;
237 }
238 }
239 if( run > runFrom ) {
240 if( ( run < runTo ) || ( ( run == runTo ) && ( ( eventTo == -1 ) || ( event <= eventTo ) ) ) ) {
241 filled = true;
242 break;
243 }
244 }
245 }
246
247 if( filled ) {
248 m_sequence = inumber;
249 }
250 else {
251 log << MSG::ERROR << "EstTofCaliSvc::chooseConstants() -- The event with run number " << run << " and event number " << event << " is NOT suitable for this group of calibration constants"
252 << endreq;
253 return StatusCode::FAILURE;
254 }
255
256 return StatusCode::SUCCESS;
257}
258
259
260const double EstTofCaliSvc::BTCorr1(double ADC,double z,unsigned id){
261 MsgStream log(msgSvc(), name());
262
263 double p1[nBarPar];
264 for( int i=0; i<static_cast<int>(nBarPar); i++ ) {
265 p1[i]=fBTofCal[176*m_sequence+id]->getP1(i);
266 }
267
268 log << MSG::DEBUG << "BTCorr1 id =" << id << " 1=" << p1[0] << " 2=" << p1[1] << " 3=" << p1[2] << " 4=" << p1[3] << " 5=" << p1[4] << " 6=" << p1[5] << " 7=" << p1[6] << " 8=" << p1[7] << " 9=" << p1[8] << endreq;
269
270 double tcorr1 = p1[0] + p1[1]/TMath::Sqrt(ADC) + p1[2]*z/TMath::Sqrt(ADC) + p1[3]/ADC + p1[4]*z + p1[5]*z*z + p1[6]*z*z*z;
271
272 return tcorr1;
273}
274
275
276const double EstTofCaliSvc::BTCorr2(double ADC,double z,unsigned id){
277 MsgStream log(msgSvc(), name());
278
279 double p2[nBarPar];
280 for( int i=0; i<static_cast<int>(nBarPar); i++ ) {
281 p2[i]=fBTofCal[176*m_sequence+id]->getP2(i);
282 }
283
284 log << MSG::DEBUG << "BTCorr2 id =" << id << " 1=" << p2[0] << " 2=" << p2[1] << " 3=" << p2[2] << " 4=" << p2[3] << " 5=" << p2[4] << " 6=" << p2[5] << " 7=" << p2[6] << " 8=" << p2[7] << " 9=" << p2[8] << endreq;
285
286 double tcorr2 = p2[0] + p2[1]/TMath::Sqrt(ADC) + p2[2]*z/TMath::Sqrt(ADC) + p2[3]/ADC + p2[4]*z + p2[5]*z*z + p2[6]*z*z*z;
287
288 return tcorr2;
289}
290
291
293 double toffset = fBTofCommonCal[m_sequence]->getOffset(0);
294 return toffset;
295}
296
297
298const double EstTofCaliSvc::BTime1(double ADC,double TDC,double z,unsigned id){
299 MsgStream log(msgSvc(), name());
300
301 double tcorr1 = BTCorr1( ADC, z, id );
302 double tcorr3 = fBTofCommonCal[m_sequence]->getOffset(0);
303
304 log << MSG::DEBUG << "BTime1 id =" << id << " tcorr=" << tcorr1 << " total offset=" << tcorr3 << endreq;
305
306 double time = TDC - tcorr1 - tcorr3;
307
308 if(time<0.) {
309 log<<MSG::WARNING<<"TofCaliSvc::BTime1() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq;
310 }
311 return time;
312}
313
314
315const double EstTofCaliSvc::BTime2(double ADC,double TDC,double z,unsigned id){
316 MsgStream log(msgSvc(), name());
317
318 double tcorr1 = BTCorr2( ADC, z, id );
319 double tcorr3 = fBTofCommonCal[m_sequence]->getOffset(0);
320
321 log << MSG::DEBUG << "BTime2 id =" << id << " tcorr=" << tcorr1 << " total offset=" << tcorr3 << endreq;
322
323 double time = TDC - tcorr1 - tcorr3;
324
325 if(time<0.) {
326 log<<MSG::WARNING<<"TofCaliSvc::BTime2() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq;
327 }
328 return time;
329}
330
331
332const double EstTofCaliSvc::ETime(double ADC,double TDC,double rHit,unsigned id){
333 MsgStream log(msgSvc(), name());
334
335 double p[nEndPar];
336 for( int i=0; i<static_cast<int>(nEndPar); i++ ) {
337 p[i]=fETofCal[96*m_sequence+id]->getP(i);
338 }
339
340 log << MSG::DEBUG << "ETime id =" << id << " 1=" << p[0] << " 2=" << p[1] << " 3=" << p[2] << " 4=" << p[3] << " 5=" << p[4] << " 6=" << p[5] << " 7=" << p[6] << endreq;
341
342 double time=TDC-(p[0]+p[1]/TMath::Sqrt(ADC)+p[2]/ADC+p[3]*ADC+p[4]*rHit+p[5]*rHit*rHit+p[6]*rHit*rHit*rHit);
343
344 if(time<0.) {
345 log<<MSG::WARNING<<"TofCaliSvc::ETime() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" r = "<< rHit <<" ID = "<<id<<endreq;
346 }
347
348 return time;
349}
350
351
352const double EstTofCaliSvc::EtfTime(double ADC1,double ADC2,double TDC1,double TDC2,unsigned id,unsigned int strip){
353 MsgStream log(msgSvc(), name());
354
355 double q = (ADC1+ADC2)/2.0;
356 double t = (TDC1+TDC2)/2.0;
357
358 double p[nEtfPar];
359 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
360 p[i]=fEtfCal[72*12*m_sequence+12*id+strip]->getP(i);
361 }
362
363 double tcorr = p[0]
364 + p[1]/TMath::Sqrt(q)
365 + p[2]/q
366 + p[3]*q
367 + p[4]*q*q
368 + p[5]*q*q*q
369 + p[6]*q*q*q*q;
370 double time = t - tcorr;
371
372 log << MSG::DEBUG << "EtfTime module =" << id << " strip=" << strip << " 1=" << p[0] << " 2=" << p[1] << " 3=" << p[2] << " 4=" << p[3] << " 5=" << p[4] << " 6=" << p[5] << " 7=" << p[6] << " 8=" << p[7] << " 9=" << p[8] << " tcorr=" << tcorr << " time=" << time << endreq;
373 if( time<0.) {
374 log<<MSG::WARNING<<"TofCaliSvc::EtfTime() -- A minus time is given : "<< time <<" [Input] ADC1 = "<<ADC1<<" ADC2 = "<<ADC2<<" TDC1 = "<<TDC1<<" TDC2 = "<<TDC2<<" ID = "<<id<<" Strip = "<<strip<<endreq;
375 }
376
377 return time;
378}
379
380
381const double EstTofCaliSvc::EtfTime1(double ADC,double TDC,double z,unsigned id,unsigned int strip){
382 MsgStream log(msgSvc(), name());
383
384 double p1[nEtfPar];
385 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
386 p1[i]=fEtfCal[72*12*m_sequence+12*id+strip]->getP1(i);
387 }
388
389 double tcorr1 = p1[0]
390 + p1[1]/TMath::Sqrt(ADC)
391 + p1[2]*ADC
392 + p1[3]*ADC*ADC
393 + p1[4]*ADC*ADC*ADC
394 + p1[5]*ADC*ADC*ADC*ADC
395 + p1[6]*z/TMath::Sqrt(ADC)
396 + p1[7]/ADC
397 + p1[8]*z/ADC
398 + p1[9]*z*ADC
399 + p1[10]*z
400 + p1[11]*z*z
401 + p1[12]*z*z*z;
402 double time1 = TDC - tcorr1;
403
404 log << MSG::DEBUG << "EtfTime1 module =" << id << " strip=" << strip << " 1=" << p1[0] << " 2=" << p1[1] << " 3=" << p1[2] << " 4=" << p1[3] << " 5=" << p1[4] << " 6=" << p1[5] << " 7=" << p1[6] << " 8=" << p1[7] << " 9=" << p1[8] << " tcorr=" << tcorr1 << " time1=" << time1 << endreq;
405 if( time1<0.) {
406 log<<MSG::WARNING<<"TofCaliSvc::EtfTime1() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<" Strip = "<<strip<<endreq;
407 }
408
409 return time1;
410}
411
412
413const double EstTofCaliSvc::EtfTime2(double ADC,double TDC,double z,unsigned id,unsigned int strip){
414 MsgStream log(msgSvc(), name());
415
416 double p2[nEtfPar];
417 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
418 p2[i]=fEtfCal[72*12*m_sequence+12*id+strip]->getP2(i);
419 }
420
421 double tcorr2 = p2[0]
422 + p2[1]/TMath::Sqrt(ADC)
423 + p2[2]*ADC
424 + p2[3]*ADC*ADC
425 + p2[4]*ADC*ADC*ADC
426 + p2[5]*ADC*ADC*ADC*ADC
427 + p2[6]*z/TMath::Sqrt(ADC)
428 + p2[7]/ADC
429 + p2[8]*z/ADC
430 + p2[9]*z*ADC
431 + p2[10]*z
432 + p2[11]*z*z
433 + p2[12]*z*z*z;
434 double time2 = TDC - tcorr2;
435
436 log << MSG::DEBUG << "EtfTime2 module =" << id << " strip=" << strip << " 1=" << p2[0] << " 2=" << p2[1] << " 3=" << p2[2] << " 4=" << p2[3] << " 5=" << p2[4] << " 6=" << p2[5] << " 7=" << p2[6] << " 8=" << p2[7] << " 9=" << p2[8] << " tcorr=" << tcorr2 << " time2=" << time2 << endreq;
437 if( time2<0.) {
438 log<<MSG::WARNING<<"TofCaliSvc::EtfTime2() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<" Strip = "<<strip<<endreq;
439 }
440
441 return time2;
442}
443
444
445const double EstTofCaliSvc::EtfTime(double TDC1,double TDC2,unsigned id,unsigned int strip){
446 MsgStream log(msgSvc(), name());
447
448 double time = -99;
449 double t, tcorr;
450
451 if( TDC1>0 && TDC2>0 ) {
452 t = (TDC1+TDC2)/2.0;
453 tcorr = fEtfCal[72*12*m_sequence+12*id+strip]->getP(0);
454 time = t - tcorr;
455 log << MSG::DEBUG << "EtfTime module =" << id << " strip=" << strip << " t1=" << TDC1 << " t2=" << TDC2 << " combine const=" << tcorr << " time=" << time << endreq;
456 }
457 else if( TDC1>0 && TDC2<0 ) {
458 t = TDC1;
459 tcorr = fEtfCal[72*12*m_sequence+12*id+strip]->getP1(0);
460 time = t - tcorr;
461 log << MSG::DEBUG << "EtfTime module =" << id << " strip=" << strip << " t1=" << TDC1 << " left const=" << tcorr << " time=" << time << endreq;
462 }
463 else if( TDC1<0 && TDC2>0 ) {
464 t = TDC2;
465 tcorr = fEtfCal[72*12*m_sequence+12*id+strip]->getP2(0);
466 time = t - tcorr;
467 log << MSG::DEBUG << "EtfTime module =" << id << " strip=" << strip << " t2=" << TDC2 << " right const=" << tcorr << " time=" << time << endreq;
468 }
469
470 if( time<0.) {
471 log<<MSG::WARNING<<"TofCaliSvc::EtfTime() -- A minus time is given : "<< time <<" [Input] TDC1 = "<<TDC1<<" TDC2 = "<<TDC2<<" ID = "<<id<<" Strip = "<<strip<<endreq;
472 }
473
474 return time;
475}
476
477
478BTofCal* EstTofCaliSvc::BTof(unsigned id) const{
479 return fBTofCal[176*m_sequence+id];
480}
481
482ETofCal* EstTofCaliSvc::ETof(unsigned id) const{
483 return fETofCal[96*m_sequence+id];
484}
485
486EtfCal* EstTofCaliSvc::EtfTof(unsigned id) const{
487 return fEtfCal[72*12*m_sequence+id];
488}
489
491 return fBTofCommonCal[m_sequence];
492}
493
494
496 return fTofInfoCal[m_sequence];
497}
498
499
501 std::cout<<"Now We can get the TOF Calibtration Service"<<std::endl;
502 std::cout<<"Barrel TOF Counter Number = "<<fBTofCal.size()<<std::endl;
503 std::cout<<"Endcap TOF Counter Number = "<<fETofCal.size()<<std::endl;
504
505 cout<<"The O Barrel TOF PMT1 p1[0] is"<<" "<<BTof(0)->getP1(0)<<endl;
506 cout<<"The 0 Barrel TOF PMT1 p1[1] is"<<" "<<BTof(0)->getP1(1)<<endl;
507}
508
509void EstTofCaliSvc::handle(const Incident& inc){
510 MsgStream log( messageService(), name() );
511 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
512
513 if ( inc.type() == "NewRun" ){
514 log << MSG::DEBUG << "New Run" << endreq;
515 // if(!m_hasbeeninitialized){
516 StatusCode sc= FillfromDatabase();
517 if(sc.isSuccess()){
518 m_hasbeeninitialized=true;
519 }
520 // }
521 }
522}
std::string test
Definition: CalibModel.cxx:43
Double_t time
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition: KKsem.h:33
const unsigned int nBarOffset
const unsigned int nEndPar
const unsigned int nEtfPar
const unsigned int nBarPar
TTree * t
Definition: binning.cxx:23
virtual StatusCode initialize()
ETofCal * ETof(unsigned id) const
void handle(const Incident &)
virtual StatusCode finalize()
BTofCal * BTof(unsigned id) const
const double ETime(double ADC, double TDC, double rHit, unsigned int id)
StatusCode chooseConstants(int run, int number)
const double TOffset()
const double EtfTime1(double ADC, double TDC, double zHit, unsigned int id, unsigned int strip)
const double EtfTime2(double ADC, double TDC, double zHit, unsigned int id, unsigned int strip)
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
const double BTime2(double ADC, double TDC, double zHit, unsigned id)
EstTofCaliSvc(const std::string &name, ISvcLocator *svcloc)
EtfCal * EtfTof(unsigned int id) const
const double BTime1(double ADC, double TDC, double zHit, unsigned id)
const double BTCorr1(double ADC, double zHit, unsigned int id)
TofInfoCal * TofInfo() const
const double BTCorr2(double ADC, double zHit, unsigned int id)
const double EtfTime(double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip)
BTofCommonCal * BTofCommon() const