BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TofCaliSvc.cxx
Go to the documentation of this file.
1//********************************************************
2//
3// BESIII Tof Reconstruction
4// Class: TofCaliSvc
5// Sun Shengsen <[email protected]>
6//
7// Description:
8// This service is used to get Tof Calibrarion constants
9// from DataBase and do the Tof data reconstruction.
10//
11//*********************************************************
12#include "TofCaliSvc/TofCaliSvc.h"
13#include "TofCaliSvc/BTofCal.h"
14#include "TofCaliSvc/BTofCommonCal.h"
15#include "TofCaliSvc/ETofCal.h"
16#include "TofCaliSvc/EtfCal.h"
17#include "TofCaliSvc/EtfBunchCal.h"
18#include "TofCaliSvc/TofInfoCal.h"
19#include "GaudiKernel/Kernel.h"
20#include "GaudiKernel/IInterface.h"
21#include "GaudiKernel/StatusCode.h"
22#include "GaudiKernel/SvcFactory.h"
23#include "GaudiKernel/MsgStream.h"
24#include "TMath.h"
25#include <math.h>
26#include <iostream>
27#include <fstream>
28#include "GaudiKernel/IIncidentSvc.h"
29#include "GaudiKernel/Incident.h"
30#include "GaudiKernel/IIncidentListener.h"
31#include "GaudiKernel/IDataProviderSvc.h"
32#include "GaudiKernel/Service.h"
33#include "GaudiKernel/MsgStream.h"
34#include "GaudiKernel/SmartDataPtr.h"
35#include "CalibData/Tof/TofCalibData.h"
36#include "CalibData/Tof/bTofCalibBase.h"
37#include "CalibData/CalibModel.h"
38#include "GaudiKernel/DataSvc.h"
39
40using namespace std;
41
42// static double radius_Inner = 81.35;
43// static double radius_Outer = 87.05;
44
45TofCaliSvc::TofCaliSvc( const std::string& name, ISvcLocator* svcloc ) : Service(name, svcloc) {
46 declareProperty("Run",m_run=1);
47}
48
49StatusCode TofCaliSvc::queryInterface (const InterfaceID& riid, void** ppvInterface ) {
50 if ( IID_ITofCaliSvc.versionMatch(riid) ) {
51 *ppvInterface = static_cast<ITofCaliSvc*> (this);
52 } else {
53 return Service::queryInterface(riid, ppvInterface) ;
54 }
55 return StatusCode::SUCCESS;
56}
57
58StatusCode TofCaliSvc::initialize ( ) {
59 m_hasbeeninitialized=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
90StatusCode TofCaliSvc::finalize ( ) {
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
102 if( fEtfCal.size()!=0 ) {
103 for(vector<EtfCal*>::iterator it5 = fEtfCal.begin(); it5 != fEtfCal.end(); it5++) { delete (*it5); }
104 fEtfCal.clear();
105 }
106 if( fEtfBunchCal.size()!=0 ) {
107 for(vector<EtfBunchCal*>::iterator it6 = fEtfBunchCal.begin(); it6 != fEtfBunchCal.end(); it6++) { delete (*it6); }
108 fEtfBunchCal.clear();
109 }
110 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); }
111 fBTofCommonCal.clear();
112 for(vector<TofInfoCal*>::iterator it4 = fTofInfoCal.begin(); it4 != fTofInfoCal.end(); it4++) { delete (*it4); }
113 fTofInfoCal.clear();
114 return;
115}
116
117StatusCode TofCaliSvc::FillfromDatabase(){
118
119 MsgStream log(msgSvc(), name());
120 std::string fullPath = "/Calib/TofCal";
121 log << MSG::INFO<<" Tof calib fullPath = "<<fullPath<< endreq;
122 SmartDataPtr<CalibData::TofCalibData> test(m_pCalibDataSvc, fullPath);
123 if(!test){
124 log << MSG::FATAL << "TofCaliSvc could not find TofCalibData in TCDS!!" << endreq;
125 return StatusCode::FAILURE;
126 }
127
128 for(vector<BTofCal*>::iterator it1 = fBTofCal.begin(); it1 != fBTofCal.end(); it1++) { delete (*it1); }
129 fBTofCal.clear();
130 for(vector<ETofCal*>::iterator it2 = fETofCal.begin(); it2 != fETofCal.end(); it2++) { delete (*it2); }
131 fETofCal.clear();
132 if( fEtfCal.size()!=0 ) {
133 for(vector<EtfCal*>::iterator it5 = fEtfCal.begin(); it5 != fEtfCal.end(); it5++) { delete (*it5); }
134 fEtfCal.clear();
135 }
136 if( fEtfBunchCal.size()!=0 ) {
137 for(vector<EtfBunchCal*>::iterator it6 = fEtfBunchCal.begin(); it6 != fEtfBunchCal.end(); it6++) { delete (*it6); }
138 fEtfBunchCal.clear();
139 }
140 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); }
141 fBTofCommonCal.clear();
142 for(vector<TofInfoCal*>::iterator it4 = fTofInfoCal.begin(); it4 != fTofInfoCal.end(); it4++) { delete (*it4); }
143 fTofInfoCal.clear();
144
145 for(int ib=0;ib<176;ib++){
146 BTofCal* btof = new BTofCal;
147 for( int j=0; j<static_cast<int>(nBarAtten); j++ ) {
148 btof->setAtten(j,test->getBTofAtten(ib,j));
149 }
150 for( int j=0; j<static_cast<int>(nBarSpeed); j++ ) {
151 btof->setVeff(j,test->getBTofSpeed(ib,j));
152 }
153 for( int j=0; j<static_cast<int>(nBarPar); j++){
154 btof->setP1(j,test->getBTofPleft(ib,j));
155 btof->setP2(j,test->getBTofPright(ib,j));
156 }
157 for( int j=0; j<static_cast<int>(nBarParOff); j++){
158 btof->setPOff1_bunch0(j,test->getBTofPoffleft_bunch0(ib,j));
159 btof->setPOff2_bunch0(j,test->getBTofPoffright_bunch0(ib,j));
160 btof->setPOff1_bunch1(j,test->getBTofPoffleft_bunch1(ib,j));
161 btof->setPOff2_bunch1(j,test->getBTofPoffright_bunch1(ib,j));
162 btof->setPOff1_bunch2(j,test->getBTofPoffleft_bunch2(ib,j));
163 btof->setPOff2_bunch2(j,test->getBTofPoffright_bunch2(ib,j));
164 btof->setPOff1_bunch3(j,test->getBTofPoffleft_bunch3(ib,j));
165 btof->setPOff2_bunch3(j,test->getBTofPoffright_bunch3(ib,j));
166 }
167 for( int j=0; j<static_cast<int>(nBarSigma); j++){
168 btof->setFPLeft(j,test->getBTofFleft(ib,j));
169 btof->setFPRight(j,test->getBTofFright(ib,j));
170 }
171 for( int j=0; j<static_cast<int>(nBarSigCnt); j++){
172 btof->setFPCounter(j,test->getBTofFcounter(ib,j));
173 }
174
175 fBTofCal.push_back(btof);
176 }
177
178 for(int ie=0;ie<96;ie++){
179 ETofCal* etof= new ETofCal;
180 for( int j=0; j<static_cast<int>(nEndAtten); j++ ) {
181 etof->setAtten(j,test->getETofAtten(ie,j));
182 }
183 for( int j=0; j<static_cast<int>(nEndSpeed); j++ ) {
184 etof->setVeff(j,test->getETofSpeed(ie,j));
185 }
186 for( int j=0; j<static_cast<int>(nEndPar); j++ ) {
187 etof->setP(j,test->getETofP(ie,j));
188 }
189 for( int j=0; j<static_cast<int>(nEndSigma); j++ ) {
190 etof->setFPCounter(j,test->getETofFP(ie,j));
191 }
192 fETofCal.push_back(etof);
193 }
194
195 for(int ietf=0;ietf<72;ietf++) {
196 for(int jetf=0;jetf<12;jetf++) {
197 EtfCal* etf= new EtfCal;
198 for( int k=0; k<static_cast<int>(nEtfSpeed); k++ ) {
199 etf->setVeff(k,test->getEtfSpeed(ietf,jetf,k));
200 }
201 for( int k=0; k<static_cast<int>(nEtfPar); k++ ) {
202 etf->setP( k,test->getEtfPcombine(ietf,jetf,k));
203 etf->setP1(k,test->getEtfPleft(ietf,jetf,k));
204 etf->setP2(k,test->getEtfPright(ietf,jetf,k));
205 }
206 fEtfCal.push_back(etf);
207 }
208 }
209
210 EtfBunchCal* etfbunch= new EtfBunchCal;
211 for( int k=0; k<static_cast<int>(nEtfBunch); k++ ) {
212 etfbunch->setBunchP(k,test->getEtfPBunch(k));
213 }
214 fEtfBunchCal.push_back(etfbunch);
215
216 BTofCommonCal* bcomtof = new BTofCommonCal;
217 for(int i=0; i<static_cast<int>(nBarOffset); i++) {
218 bcomtof->setOffset( i, test->getBTofOffset(i) );
219 }
220 for(int i=0; i<static_cast<int>(nBarSigCor); i++) {
221 bcomtof->setSigmaCorr( i, test->getBTofSigmaCorr(i) );
222 }
223 fBTofCommonCal.push_back(bcomtof);
224
225 TofInfoCal* tofinfo = new TofInfoCal;
226 tofinfo->setRunBegin( test->getRunBegin() );
227 tofinfo->setRunEnd( test->getRunEnd() );
228 tofinfo->setVersion( test->getVersion() );
229 tofinfo->setQCorr( test->getQCorr() );
230 tofinfo->setQElec( test->getQElec() );
231 tofinfo->setMisLable( test->getMisLable() );
232 for( unsigned int i=0; i<5; i++ ) {
233 tofinfo->setBrEast( i, test->getBrEast(i) );
234 tofinfo->setBrWest( i, test->getBrWest(i) );
235 if( (test->getVersion())<=8 ) { // useless
236 tofinfo->setEndcap( i, test->getEndcap(i) );
237 }
238 else {
239 tofinfo->setEtf( i, test->getEndcap(i) );
240 }
241 }
242 fTofInfoCal.push_back(tofinfo);
243
244 return StatusCode::SUCCESS;
245}
246
247
248const double TofCaliSvc::BTDelay1(unsigned id) {
249 double tdelay = 0.0;
250 if( id < 176 ) {
251 tdelay = fBTofCal[id]->getP1(0);
252 }
253 else {
254 MsgStream log(msgSvc(), name());
255 log<<MSG::ERROR<<"TofCaliSvc::BTDelay1() -- Wrong TOFID is provided! ID = "<<id<<endreq;
256 }
257 return tdelay;
258}
259
260
261const double TofCaliSvc::BTDelay2(unsigned id) {
262 double tdelay = 0.0;
263 if( id < 176 ) {
264 tdelay = fBTofCal[id]->getP2(0);
265 }
266 else {
267 MsgStream log(msgSvc(), name());
268 log<<MSG::ERROR<<"TofCaliSvc::BTDelay2() -- Wrong TOFID is provided! ID = "<<id<<endreq;
269 }
270 return tdelay;
271}
272
273
274const double TofCaliSvc::ETDelay(unsigned id) {
275 double tdelay = 0.0;
276 if( id < 96 ) {
277 tdelay = fETofCal[id]->getP(0);
278 }
279 else {
280 MsgStream log(msgSvc(), name());
281 log<<MSG::ERROR<<"TofCaliSvc::ETDelay() -- Wrong TOFID is provided! ID = "<<id<<endreq;
282 }
283 return tdelay;
284}
285
286
287const double TofCaliSvc::BTCorr1(double ADC,double z,unsigned id){
288 MsgStream log(msgSvc(), name());
289
290 double p1[nBarPar];
291 for( int i=0; i<static_cast<int>(nBarPar); i++ ) {
292 p1[i]=fBTofCal[id]->getP1(i);
293 }
294
295 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;
296
297 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;
298
299 return tcorr1;
300}
301
302
303const double TofCaliSvc::BTCorr2(double ADC,double z,unsigned id){
304 MsgStream log(msgSvc(), name());
305
306 double p2[nBarPar];
307 for( int i=0; i<static_cast<int>(nBarPar); i++ ) {
308 p2[i]=fBTofCal[id]->getP2(i);
309 }
310
311 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;
312
313 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;
314
315 return tcorr2;
316}
317
318
319const double TofCaliSvc::BTCorrOffset1(double z,unsigned id,double t0){
320 MsgStream log(msgSvc(), name());
321
322 int numBunch = fTofInfoCal[0]->getRunEnd();
323 int whichBunch = (static_cast<int>(t0/(12000./499.8/(numBunch*1.0))+0.1))%numBunch;
324
325 double poff1[nBarParOff];
326 if( whichBunch==0 ) {
327 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
328 poff1[i]=fBTofCal[id]->getPOff1_bunch0(i);
329 }
330 }
331 else if( whichBunch==1 ) {
332 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
333 poff1[i]=fBTofCal[id]->getPOff1_bunch1(i);
334 }
335 }
336 else if( whichBunch==2 ) {
337 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
338 poff1[i]=fBTofCal[id]->getPOff1_bunch2(i);
339 }
340 }
341 else if( whichBunch==3 ) {
342 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
343 poff1[i]=fBTofCal[id]->getPOff1_bunch3(i);
344 }
345 }
346
347 double tCorrOffset1 = 0.0;
348 if( z>=0.0 ) {
349 tCorrOffset1 = poff1[0] + poff1[1]*z + poff1[2]*z*z + poff1[3]*z*z*z + poff1[4]*z*z*z*z + poff1[5]*z*z*z*z*z + poff1[6]*z*z*z*z*z*z;
350 }
351 else {
352 tCorrOffset1 = poff1[10] + poff1[11]*z + poff1[12]*z*z + poff1[13]*z*z*z + poff1[14]*z*z*z*z + poff1[15]*z*z*z*z*z + poff1[16]*z*z*z*z*z*z;
353 }
354
355 log << MSG::DEBUG << "BTCorrOff1 id =" << id << " bunch number=" << whichBunch << " TCorrOffset1=" << tCorrOffset1 << " 1=" << poff1[0] << " 2=" << poff1[1] << " 3=" << poff1[2] << " 4=" << poff1[3] << " 5=" << poff1[4] << " 6=" << poff1[5] << " 7=" << poff1[6] << " 8=" << poff1[7] << " 9=" << poff1[8] << endreq;
356
357 return tCorrOffset1;
358}
359
360
361const double TofCaliSvc::BTCorrOffset2(double z,unsigned id,double t0){
362 MsgStream log(msgSvc(), name());
363
364 int numBunch = fTofInfoCal[0]->getRunEnd();
365 int whichBunch = (static_cast<int>(t0/(12000./499.8/(numBunch*1.0))+0.1))%numBunch;
366
367 double poff2[nBarParOff];
368 if( whichBunch==0 ) {
369 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
370 poff2[i]=fBTofCal[id]->getPOff2_bunch0(i);
371 }
372 }
373 else if( whichBunch==1 ) {
374 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
375 poff2[i]=fBTofCal[id]->getPOff2_bunch1(i);
376 }
377 }
378 else if( whichBunch==2 ) {
379 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
380 poff2[i]=fBTofCal[id]->getPOff2_bunch2(i);
381 }
382 }
383 else if( whichBunch==3 ) {
384 for( int i=0; i<static_cast<int>(nBarParOff); i++ ) {
385 poff2[i]=fBTofCal[id]->getPOff2_bunch3(i);
386 }
387 }
388
389 double tCorrOffset2 = 0.0;
390 if( z>=0.0 ) {
391 tCorrOffset2 = poff2[0] + poff2[1]*z + poff2[2]*z*z + poff2[3]*z*z*z + poff2[4]*z*z*z*z + poff2[5]*z*z*z*z*z + poff2[6]*z*z*z*z*z*z;
392 }
393 else {
394 tCorrOffset2 = poff2[10] + poff2[11]*z + poff2[12]*z*z + poff2[13]*z*z*z + poff2[14]*z*z*z*z + poff2[15]*z*z*z*z*z + poff2[16]*z*z*z*z*z*z;
395 }
396
397 log << MSG::DEBUG << "BTCorrOff2 id =" << id << " bunch number=" << whichBunch << " TCorrOffset2=" << tCorrOffset2 << " 1=" << poff2[0] << " 2=" << poff2[1] << " 3=" << poff2[2] << " 4=" << poff2[3] << " 5=" << poff2[4] << " 6=" << poff2[5] << " 7=" << poff2[6] << " 8=" << poff2[7] << " 9=" << poff2[8] << endreq;
398
399 return tCorrOffset2;
400}
401
402
403const double TofCaliSvc::TOffset() {
404 double toffset = fBTofCommonCal[0]->getOffset(0);
405 return toffset;
406}
407
408
409const double TofCaliSvc::BTime1(double ADC,double TDC,double z,unsigned id,double t0){
410 MsgStream log(msgSvc(), name());
411
412 double tcorr1 = BTCorr1( ADC, z, id );
413 double tcorr2 = BTCorrOffset1( z, id, t0);
414 double tcorr3 = fBTofCommonCal[0]->getOffset(0);
415
416 log << MSG::DEBUG << "BTime1 id =" << id << " tcorr=" << tcorr1 << " toffset=" << tcorr2 << " total offset=" << tcorr3 << endreq;
417
418 double time = TDC - tcorr1 - tcorr2 - tcorr3;
419
420 if(time<0.) {
421 log<<MSG::WARNING<<"TofCaliSvc::BTime1() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq;
422 }
423 return time;
424}
425
426
427const double TofCaliSvc::BTime2(double ADC,double TDC,double z,unsigned id, double t0){
428 MsgStream log(msgSvc(), name());
429
430 double tcorr1 = BTCorr2( ADC, z, id );
431 double tcorr2 = BTCorrOffset2( z, id ,t0);
432 double tcorr3 = fBTofCommonCal[0]->getOffset(0);
433
434 log << MSG::DEBUG << "BTime2 id =" << id << " tcorr=" << tcorr1 << " toffset=" << tcorr2 << " total offset=" << tcorr3 << endreq;
435
436 double time = TDC - tcorr1 - tcorr2 - tcorr3;
437
438 if(time<0.) {
439 log<<MSG::WARNING<<"TofCaliSvc::BTime2() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq;
440 }
441 return time;
442}
443
444
445/*
446const double TofCaliSvc::BTime(double tleft,double tright,double z,unsigned id){
447 for(int i=0;i<4;i++)
448 m_w[i]=fBTofCal[id]->getW(i);
449 double f1=m_w[0]+m_w[1]*z+m_w[2]*z*z;
450 double f2=1-f1;
451 double wt=f1*tleft+f2*tright+m_w[3];
452 if(wt<0.) {
453 MsgStream log(msgSvc(), name());
454 log<<MSG::WARNING<<"TofCaliSvc::BTime() -- A minus time is given : "<<wt <<" [Input] TDC1 = "<<tleft<<" TDC2 = "<<tright<<" z = "<<z<<" ID = "<<id<<endreq;
455 }
456
457 return wt;
458}
459*/
460
461
462const double TofCaliSvc::BTimeCounter(double tleft,double tright,double z,unsigned id){
463
464 double sigmaCorr = fBTofCommonCal[0]->getSigmaCorr(0);
465 double sigmaCorr2 = sigmaCorr*sigmaCorr;
466
467 double sigmaLeft = BSigma1( z, id );
468 double sigmaLeft2 = sigmaLeft*sigmaLeft;
469 double sigmaRight = BSigma2( z, id );
470 double sigmaRight2 = sigmaRight*sigmaRight;
471
472 double fraction = ( sigmaRight2 - sigmaCorr2 )/( sigmaLeft2 + sigmaRight2 - 2.0*sigmaCorr2);
473
474 double wt=fraction*tleft + (1.0-fraction)*tright;
475 if(wt<0.) {
476 MsgStream log(msgSvc(), name());
477 log<<MSG::WARNING<<"TofCaliSvc::BTimeCounter() -- A minus time is given : "<<wt <<" [Input] z = "<<z<<" ID = "<<id<<endreq;
478 }
479
480 return wt;
481}
482
483const double TofCaliSvc::BTimeCluster(double tlayer1,double tlayer2,double z1,double z2,unsigned id1, unsigned id2){
484
485 double sigmaCorr = fBTofCommonCal[0]->getSigmaCorr(0);
486 double sigmaCorr2 = sigmaCorr*sigmaCorr;
487
488 double sigmaInner = BSigmaCounter( z1, id1 );
489 double sigmaInner2 = sigmaInner*sigmaInner;
490 double sigmaOuter = BSigmaCounter( z2, id2 );
491 double sigmaOuter2 = sigmaOuter*sigmaOuter;
492
493 double fraction = ( sigmaOuter2 - sigmaCorr2 )/( sigmaInner2 + sigmaOuter2 - 2.0*sigmaCorr2);
494
495 double wt=fraction*tlayer1 + (1.0-fraction)*tlayer2;
496 if(wt<0.) {
497 MsgStream log(msgSvc(), name());
498 log<<MSG::WARNING<<"TofCaliSvc::BTimeCluster() -- A minus time is given : "<<wt <<" [Input] z1 = "<<z1<<" [Input] z2 = "<<z2<<" ID1 = "<< id1 << " ID2=" << id2 << endreq;
499 }
500 return wt;
501}
502
503
504const double TofCaliSvc::BSigma1(double z, unsigned id) {
505 MsgStream log(msgSvc(), name());
506
507 double fpleft[nBarSigma];
508 for( int i=0; i<static_cast<int>(nBarSigma); i++ ) {
509 fpleft[i]=fBTofCal[id]->getFPLeft(i);
510 }
511
512 log << MSG::DEBUG << "BSigma1 id =" << id << " 1=" << fpleft[0] << " 2=" << fpleft[1] << " 3=" << fpleft[2] << " 4=" << fpleft[3] << " 5=" << fpleft[4] << endreq;
513
514 double sigmaLeft = fpleft[0] + fpleft[1]*z + fpleft[2]*z*z + fpleft[3]*z*z*z + fpleft[4]*z*z*z*z;
515
516 return sigmaLeft;
517}
518
519
520const double TofCaliSvc::BSigma2(double z, unsigned id) {
521 MsgStream log(msgSvc(), name());
522
523 double fpright[nBarSigma];
524 for( int i=0; i<static_cast<int>(nBarSigma); i++ ) {
525 fpright[i]=fBTofCal[id]->getFPRight(i);
526 }
527
528 log << MSG::DEBUG << "BSigma2 id =" << id << " 1=" << fpright[0] << " 2=" << fpright[1] << " 3=" << fpright[2] << " 4=" << fpright[3] << " 5=" << fpright[4] << endreq;
529
530 double sigmaRight = fpright[0] + fpright[1]*z + fpright[2]*z*z + fpright[3]*z*z*z + fpright[4]*z*z*z*z;
531
532 return sigmaRight;
533}
534
535
536const double TofCaliSvc::BSigmaCounter(double z, unsigned id) {
537 MsgStream log(msgSvc(), name());
538
539 double fplayer[nBarSigCnt];
540 for( int i=0; i<static_cast<int>(nBarSigCnt); i++ ) {
541 fplayer[i]=fBTofCal[id]->getFPCounter(i);
542 }
543
544 log << MSG::DEBUG << "BSigmaCounter id =" << id << " 1=" << fplayer[0] << " 2=" << fplayer[1] << " 3=" << fplayer[2] << " 4=" << fplayer[3] << " 5=" << fplayer[4] << endreq;
545
546 double sigma = fplayer[0] + fplayer[1]*z + fplayer[2]*z*z + fplayer[3]*z*z*z + fplayer[4]*z*z*z*z;
547
548 return sigma;
549}
550
551
552const double TofCaliSvc::BSigmaCluster(double z1, double z2, unsigned id1, unsigned id2) {
553 double sigmaInner = BSigmaCounter(z1, id1);
554 double sigmaInner2 = sigmaInner*sigmaInner;
555 double sigmaOuter = BSigmaCounter(z2, id2);
556 double sigmaOuter2 = sigmaOuter*sigmaOuter;
557 double sigmaCorr = fBTofCommonCal[0]->getSigmaCorr(0);
558 double sigmaCorr2 = sigmaCorr*sigmaCorr;
559 double sigma = (sigmaInner2*sigmaOuter2-sigmaCorr2*sigmaCorr2)/(sigmaInner2+sigmaOuter2-2.0*sigmaCorr2);
560 sigma = sqrt(sigma);
561 return sigma;
562}
563
564
565const double TofCaliSvc::ETime(double ADC,double TDC,double rHit,unsigned id){
566 MsgStream log(msgSvc(), name());
567
568 double p[nEndPar];
569 for( int i=0; i<static_cast<int>(nEndPar); i++ ) {
570 p[i]=fETofCal[id]->getP(i);
571 }
572
573 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;
574
575 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);
576
577 if(time<0.) {
578 MsgStream log(msgSvc(), name());
579 log<<MSG::WARNING<<"TofCaliSvc::ETime() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" r = "<< rHit <<" ID = "<<id<<endreq;
580 }
581
582 return time;
583}
584
585
586const double TofCaliSvc::ESigma(double r, unsigned id) {
587 MsgStream log(msgSvc(), name());
588
589 double fp[nEndSigma];
590 for( int i=0; i<static_cast<int>(nEndSigma); i++) {
591 fp[i]=fETofCal[id]->getFPCounter(i);
592 }
593
594 log << MSG::DEBUG << "ESigma id =" << id << " 1=" << fp[0] << " 2=" << fp[1] << " 3=" << fp[2] << endreq;
595
596 double sigma = fp[0] + fp[1]*r + fp[2]*r*r;
597
598 return sigma;
599}
600
601
602const double TofCaliSvc::EtfTime(double ADC1,double ADC2,double TDC1,double TDC2,unsigned id,unsigned int strip,double t0){
603 MsgStream log(msgSvc(), name());
604
605 double q = (ADC1+ADC2)/2.0;
606 double t = (TDC1+TDC2)/2.0;
607
608 double p[nEtfPar];
609 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
610 p[i]=fEtfCal[12*id+strip]->getP(i);
611 }
612
613 double tcorr = p[0]
614 + p[1]/TMath::Sqrt(q)
615 + p[2]/q
616 + p[3]*q
617 + p[4]*q*q
618 + p[5]*q*q*q
619 + p[6]*q*q*q*q;
620 double time = t - tcorr;
621
622 int ibunch = static_cast<int>(t0/(8.0*12000./499.8/8./4. )+0.1)%4;
623 double pbunch = EtfBunchP(ibunch);
624
625 time = time - pbunch;
626
627 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 << " t0=" << t0 << " pbunch=" << pbunch << " time=" << time << endreq;
628
629 return time;
630}
631
632
633const double TofCaliSvc::EtfTime1(double ADC,double TDC,double z,unsigned id,unsigned int strip,double t0){
634 MsgStream log(msgSvc(), name());
635
636 double p1[nEtfPar];
637 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
638 p1[i]=fEtfCal[12*id+strip]->getP1(i);
639 }
640
641 double tcorr1 = p1[0]
642 + p1[1]/TMath::Sqrt(ADC)
643 + p1[2]*ADC
644 + p1[3]*ADC*ADC
645 + p1[4]*ADC*ADC*ADC
646 + p1[5]*ADC*ADC*ADC*ADC
647 + p1[6]*z/TMath::Sqrt(ADC)
648 + p1[7]/ADC
649 + p1[8]*z/ADC
650 + p1[9]*z*ADC
651 + p1[10]*z
652 + p1[11]*z*z
653 + p1[12]*z*z*z;
654 double time1 = TDC - tcorr1;
655
656 int ibunch = static_cast<int>(t0/(8.0*12000./499.8/8./4. )+0.1)%4;
657 double pbunch = EtfBunchP(ibunch);
658
659 time1 = time1 - pbunch;
660
661 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 << " t0=" << t0 << " pbunch=" << pbunch << " time1=" << time1 << endreq;
662
663 return time1;
664}
665
666
667const double TofCaliSvc::EtfTime2(double ADC,double TDC,double z,unsigned id,unsigned int strip,double t0){
668 MsgStream log(msgSvc(), name());
669
670 double p2[nEtfPar];
671 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
672 p2[i]=fEtfCal[12*id+strip]->getP2(i);
673 }
674
675 double tcorr2 = p2[0]
676 + p2[1]/TMath::Sqrt(ADC)
677 + p2[2]*ADC
678 + p2[3]*ADC*ADC
679 + p2[4]*ADC*ADC*ADC
680 + p2[5]*ADC*ADC*ADC*ADC
681 + p2[6]*z/TMath::Sqrt(ADC)
682 + p2[7]/ADC
683 + p2[8]*z/ADC
684 + p2[9]*z*ADC
685 + p2[10]*z
686 + p2[11]*z*z
687 + p2[12]*z*z*z;
688 double time2 = TDC - tcorr2;
689
690 int ibunch = static_cast<int>(t0/(8.0*12000./499.8/8./4. )+0.1)%4;
691 double pbunch = EtfBunchP(ibunch);
692
693 time2 = time2 - pbunch;
694
695 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 << " t0=" << t0 << " pbunch=" << pbunch << " time2=" << time2 << endreq;
696
697 return time2;
698}
699
700
701const double TofCaliSvc::EtfTimeMC(double ADC1,double ADC2,double TDC1,double TDC2,unsigned id,unsigned int strip,double t0){
702 MsgStream log(msgSvc(), name());
703
704 double q = (ADC1+ADC2)/2.0;
705 double t = (TDC1+TDC2)/2.0;
706
707 double p[nEtfPar];
708 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
709 p[i]=fEtfCal[12*id+strip]->getP(i);
710 }
711
712 double tcorr = p[0] + p[1]/TMath::Sqrt(q);
713 double time = t - tcorr;
714
715 log << MSG::DEBUG << "EtfTime module =" << id << " strip=" << strip << " 1=" << p[0] << " 2=" << p[1] << " tcorr=" << tcorr << " t0=" << t0 << " time=" << time << endreq;
716
717 return time;
718}
719
720
721const double TofCaliSvc::EtfTimeMC1(double ADC,double TDC,double z,unsigned id,unsigned int strip,double t0){
722 MsgStream log(msgSvc(), name());
723
724 double p1[nEtfPar];
725 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
726 p1[i]=fEtfCal[12*id+strip]->getP1(i);
727 }
728
729 double tcorr1 = p1[0] + p1[1]/TMath::Sqrt(ADC) + p1[2]*z;
730 double time1 = TDC - tcorr1;
731
732 log << MSG::DEBUG << "EtfTime1 module =" << id << " strip=" << strip << " 1=" << p1[0] << " 2=" << p1[1] << " 3=" << p1[2] << " tcorr=" << tcorr1 << " t0=" << t0 << " time1=" << time1 << endreq;
733
734 return time1;
735}
736
737
738const double TofCaliSvc::EtfTimeMC2(double ADC,double TDC,double z,unsigned id,unsigned int strip,double t0){
739 MsgStream log(msgSvc(), name());
740
741 double p2[nEtfPar];
742 for( int i=0; i<static_cast<int>(nEtfPar); i++ ) {
743 p2[i]=fEtfCal[12*id+strip]->getP2(i);
744 }
745
746 double tcorr2 = p2[0] + p2[1]/TMath::Sqrt(ADC) + p2[2]*z;
747 double time2 = TDC - tcorr2;
748
749 log << MSG::DEBUG << "EtfTime2 module =" << id << " strip=" << strip << " 1=" << p2[0] << " 2=" << p2[1] << " 3=" << p2[2] << " tcorr=" << tcorr2 << " t0=" << t0 << " time2=" << time2 << endreq;
750
751 return time2;
752}
753
754
755const double TofCaliSvc::EtfTime(double tleft,double tright){
756 MsgStream log(msgSvc(), name());
757
758 double time = (tleft+tright)/2.0;
759 log << MSG::DEBUG << "EtfTime tleft=" << tleft << " tright=" << tright << " time=" << time << endreq;
760
761 return time;
762}
763
764
765const double TofCaliSvc::EtfBunchP(int index){
766 MsgStream log(msgSvc(), name());
767
768 double pbunch = 0.0;
769 if( fEtfBunchCal.size()>0 && index>=0 && index<4 ) {
770 pbunch=fEtfBunchCal[0]->getBunchP(index);
771 }
772
773 return pbunch;
774}
775
776
777const double TofCaliSvc::BPulseHeight1( double ADC, double zHit, double sint, unsigned int id ) {
778 double length = 230.0;
779 double A = 1.0;
780 double Latten = fBTofCal[id]->getAtten(0);
781 double q0 = ADC*sint*TMath::Exp((0.5*length-zHit)/Latten)/A;
782 return q0;
783}
784
785
786const double TofCaliSvc::BPulseHeight2( double ADC, double zHit, double sint, unsigned int id ) {
787 double length = 230.0;
788 double A = 1.0;
789 double Latten = fBTofCal[id]->getAtten(0);
790 double q0 = ADC*sint*TMath::Exp((0.5*length+zHit)/Latten)/A;
791 return q0;
792}
793
794
795const double TofCaliSvc::BPulseHeight( double ADC1, double ADC2, double zHit, double sint, unsigned int id ) {
796 double length = 230.0;
797 double Latten = fBTofCal[id]->getAtten(0);
798 double gainRatio = fBTofCal[id]->getAtten(1);
799 double A2 = fBTofCal[id]->getAtten(2);
800 double q = ( ADC1*sint*TMath::Exp((0.5*length-zHit)/Latten)+ADC2*sint*TMath::Exp((0.5*length+zHit)/Latten) )/( A2*(1.0+TMath::Exp(gainRatio)) );
801 return q;
802}
803
804
805const double TofCaliSvc::BPh( double ADC1, double ADC2, double zHit, unsigned int id ) {
806 double length = 230.0;
807 double Latten = fBTofCal[id]->getAtten(0);
808 double gainRatio = fBTofCal[id]->getAtten(1);
809 double q = ( ADC1*TMath::Exp((0.5*length-zHit)/Latten)+ADC2*TMath::Exp((0.5*length+zHit)/Latten) )/(1.0+TMath::Exp(gainRatio));
810 return q;
811}
812
813
814const double TofCaliSvc::EPulseHeight( double ADC, double rHit, double cost, unsigned int id ) {
815 double length = 44.5;
816 double a0 = fETofCal[id]->getAtten(0);
817 double a1 = fETofCal[id]->getAtten(1);
818 double a2 = fETofCal[id]->getAtten(2);
819 double a3 = fETofCal[id]->getAtten(3);
820
821 double q0 = ADC*fabs(cost)*TMath::Exp(-(a1*(rHit-length)+a2*(rHit-length)*(rHit-length)))/a3;
822
823 return q0;
824}
825
826
827const double TofCaliSvc::EPh( double ADC, double rHit, unsigned int id ) {
828 double length = 44.5;
829 double a0 = fETofCal[id]->getAtten(0);
830 double a1 = fETofCal[id]->getAtten(1);
831 double a2 = fETofCal[id]->getAtten(2);
832 double q0 = ADC*TMath::Exp(-(a0+a1*(rHit-length)+a2*(rHit-length)*(rHit-length)));
833 return q0;
834}
835
836
837const double TofCaliSvc::getQ0(unsigned id){
838 return fBTofCal[id]->getAtten(3);
839}
840
841
842const double TofCaliSvc::BVeff(unsigned id){
843 if(id<176){
844 return fBTofCal[id]->getVeff(0);
845 }else{
846 std::cout<<"bad id="<<id<<std::endl;
847 return 0.;}
848}
849
850
851const double TofCaliSvc::BAtten(unsigned id){
852 if( id > 175 ) return -1;
853 return fBTofCal[id]->getAtten(0);
854}
855
856const double TofCaliSvc::BGainForward(unsigned id){
857 if( id > 175 ) return -1;
858 double gainRatio = fBTofCal[id]->getAtten(1);
859 double A2 = fBTofCal[id]->getAtten(2);
860 double A1 = A2*TMath::Exp(gainRatio);
861 return A1;
862}
863
864const double TofCaliSvc::BGainBackward(unsigned id){
865 if( id > 175 ) return -1;
866 return fBTofCal[id]->getAtten(2);
867}
868
869const double TofCaliSvc::EVeff(unsigned id){
870 if( id > 175 ) return -1;
871 return fETofCal[id]->getVeff(0);
872}
873
874const double TofCaliSvc::EtfVeff(unsigned int id, unsigned int strip){
875 if(id<72 && strip<12){
876 return fEtfCal[12*id+strip]->getVeff(0);
877 }else{
878 std::cout<<"bad id="<<id<<" strip="<<strip<<std::endl;
879 return 0.;
880 }
881}
882
883
884const double TofCaliSvc::ZTDC(double tleft, double tright, unsigned id) {
885 double ztdc = -1000.0;
886 if( id > 175 ) return ztdc;
887 double veff = fBTofCal[id]->getVeff(0);
888 double delay = fBTofCal[id]->getVeff(1);
889 ztdc = 0.5*veff*(tright-tleft-delay);
890 return ztdc;
891}
892
893const double TofCaliSvc::ZTDC1(double tright, unsigned id, double z) {
894 double tleft = -1000.0;
895 if( id > 175 ) return tleft;
896 if( tright < -900.0 ) return tleft;
897 double veff = fBTofCal[id]->getVeff(0);
898 double delay = fBTofCal[id]->getVeff(1);
899 tleft = tright-delay-2.0*z/veff;
900 return tleft;
901}
902
903const double TofCaliSvc::ZTDC2(double tleft, unsigned id, double z) {
904 double tright = -1000.0;
905 if( id > 175 ) return tright;
906 if( tleft < -900.0 ) return tright;
907 double veff = fBTofCal[id]->getVeff(0);
908 double delay = fBTofCal[id]->getVeff(1);
909 tright = tleft+delay+2.0*z/veff;
910 return tright;
911}
912
913const double TofCaliSvc::ZADC(double qleft, double qright, unsigned id) {
914 double zadc = -1000.0;
915 if( id > 175 ) return zadc;
916 if( qright < 1.0e-6 ) return zadc;
917 double ldecay = fBTofCal[id]->getAtten(0);
918 double a1overa2 = fBTofCal[id]->getAtten(1);
919 double q1overq2 = log(qleft/qright);
920 zadc = 0.5*ldecay*( q1overq2 - a1overa2 );
921 return zadc;
922}
923
924const double TofCaliSvc::ZADC1(double qright, unsigned id, double z) {
925 double qleft = -1000.0;
926 if( id > 175 ) return qleft;
927 if( qright < 1.0e-6 ) return qleft;
928 double ldecay = fBTofCal[id]->getAtten(0);
929 double a1overa2 = fBTofCal[id]->getAtten(1);
930 double q1overq2 = 2.0*z/ldecay + a1overa2;
931 qleft = qright*exp(q1overq2);
932 return qleft;
933}
934
935const double TofCaliSvc::ZADC2(double qleft, unsigned id, double z) {
936 double qright = -1000.0;
937 if( id > 175 ) return qright;
938 if( qleft < 1.0e-6 ) return qright;
939 double ldecay = fBTofCal[id]->getAtten(0);
940 double a1overa2 = fBTofCal[id]->getAtten(1);
941 double q1overq2 = 2.0*z/ldecay + a1overa2;
942 qright = qleft*exp(-q1overq2);
943 return qright;
944}
945
946const double TofCaliSvc::EtfZTDC(double tleft, double tright, unsigned id, unsigned int strip) {
947 double ztdc = -1000.0;
948 if( id>71 || strip>11 ) return ztdc;
949 double delay = fEtfCal[12*id+strip]->getVeff(0);
950 double veff = fEtfCal[12*id+strip]->getVeff(1);
951 ztdc = (tright-tleft-delay)/veff;
952 return ztdc;
953}
954
955
956const double TofCaliSvc::EAtten(unsigned id){
957 if( id > 95 ) return -1;
958 return fETofCal[id]->getAtten(0);
959}
960
961const double TofCaliSvc::EGain(unsigned id){
962 if( id > 95 ) return -1;
963 return fETofCal[id]->getAtten(1);
964}
965
967 return fTofInfoCal[0]->getRunBegin();
968}
969
971 return fTofInfoCal[0]->getRunEnd();
972}
973
975 return fTofInfoCal[0]->getVersion();
976}
977
978const int TofCaliSvc::QCorr() {
979 return fTofInfoCal[0]->getQCorr();
980}
981
982const int TofCaliSvc::QElec() {
983 return fTofInfoCal[0]->getQElec();
984}
985
987 return fTofInfoCal[0]->getMisLable();
988}
989
990const int TofCaliSvc::BrEast(unsigned int im) {
991 return fTofInfoCal[0]->getBrEast(im);
992}
993
994const int TofCaliSvc::BrWest(unsigned int im) {
995 return fTofInfoCal[0]->getBrWest(im);
996}
997
998const int TofCaliSvc::Endcap(unsigned int im) {
999 return fTofInfoCal[0]->getEndcap(im);
1000}
1001
1002const int TofCaliSvc::Etf(unsigned int im) {
1003 return fTofInfoCal[0]->getEndcap(im);
1004}
1005
1006BTofCal* TofCaliSvc::BTof(unsigned id) const{
1007 return fBTofCal[id];
1008}
1009
1010ETofCal* TofCaliSvc::ETof(unsigned id) const{
1011 return fETofCal[id];
1012}
1013
1014EtfCal* TofCaliSvc::EtfTof(unsigned id) const{
1015 return fEtfCal[id];
1016}
1017
1019 return fBTofCommonCal[0];
1020}
1021
1023 return fTofInfoCal[0];
1024}
1025
1027 std::cout<<"Now We can get the TOF Calibtration Service"<<std::endl;
1028 std::cout<<"Barrel TOF Counter Number = "<<fBTofCal.size()<<std::endl;
1029 std::cout<<"Endcap TOF Counter Number = "<<fETofCal.size()<<std::endl;
1030
1031 cout<<"The O Barrel TOF PMT1 p1[0] is"<<" "<<BTof(0)->getP1(0)<<endl;
1032 cout<<"The 0 Barrel TOF PMT1 p1[1] is"<<" "<<BTof(0)->getP1(1)<<endl;
1033 cout<<"The 0 Barrel TOF veff is"<<" "<<BTof(0)->getVeff(0)<<endl;
1034 // cout<<"The 22rd Endcap TOF PMT veff is"<<" "<<ETof(22)->getVeff()<<endl;
1035}
1036
1037void TofCaliSvc::handle(const Incident& inc){
1038 MsgStream log( messageService(), name() );
1039 log << MSG::DEBUG << "handle: " << inc.type() << endreq;
1040
1041 if ( inc.type() == "NewRun" ){
1042 log << MSG::DEBUG << "New Run" << endreq;
1043 // if(!m_hasbeeninitialized){
1044 StatusCode sc= FillfromDatabase();
1045 if(sc.isSuccess()){
1046 m_hasbeeninitialized=true;
1047 }
1048 // }
1049 }
1050}
std::string test
Definition: CalibModel.cxx:43
Double_t time
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
****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 nBarParOff
const unsigned int nEndPar
const unsigned int nEtfPar
const unsigned int nBarPar
const unsigned int nBarSigma
const unsigned int nEndSigma
const unsigned int nBarSigCor
const unsigned int nEndSpeed
const unsigned int nEtfSpeed
const unsigned int nEtfBunch
const unsigned int nBarSpeed
const unsigned int nEndAtten
const unsigned int nBarAtten
const unsigned int nBarSigCnt
void setPOff1_bunch0(int idx, double poff1_bunch0)
void setPOff2_bunch1(int idx, double poff2_bunch1)
void setPOff1_bunch2(int idx, double poff1_bunch2)
void setAtten(int idx, double atten)
void setFPCounter(int idx, double fp3)
void setPOff1_bunch3(int idx, double poff1_bunch3)
void setPOff2_bunch2(int idx, double poff2_bunch2)
void setPOff2_bunch3(int idx, double poff2_bunch3)
void setPOff2_bunch0(int idx, double poff2_bunch0)
void setPOff1_bunch1(int idx, double poff1_bunch1)
void setAtten(int idx, double atten)
void setVeff(int idx, double veff)
const double BTimeCounter(double tleft, double tright, double z, unsigned int id)
const double ZADC(double qleft, double qright, unsigned int id)
const double EtfTime(double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip, double t0)
const double BPulseHeight1(double ADC, double zHit, double sint, unsigned int id)
Definition: TofCaliSvc.cxx:777
const double BPh(double ADC1, double ADC2, double zHit, unsigned int id)
Definition: TofCaliSvc.cxx:805
const int RunBegin()
Definition: TofCaliSvc.cxx:966
const double ZTDC2(double tleft, unsigned int id, double z)
const double BPulseHeight2(double ADC, double zHit, double sint, unsigned int id)
Definition: TofCaliSvc.cxx:786
const int MisLable()
Definition: TofCaliSvc.cxx:986
const double EGain(unsigned int id)
const double BTimeCluster(double tlayer1, double tlayer2, double z1, double z2, unsigned int id1, unsigned int id2)
const double EPh(double ADC, double rHit, unsigned int id)
Definition: TofCaliSvc.cxx:827
const double ZTDC1(double tright, unsigned int id, double z)
TofInfoCal * TofInfo() const
const double BPulseHeight(double ADC1, double ADC2, double zHit, double sint, unsigned int id)
Definition: TofCaliSvc.cxx:795
const int QCorr()
Definition: TofCaliSvc.cxx:978
const int BrEast(unsigned int No)
Definition: TofCaliSvc.cxx:990
const double BGainForward(unsigned int id)
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
Definition: TofCaliSvc.cxx:49
const int Etf(unsigned int No)
const double EtfBunchP(int index)
Definition: TofCaliSvc.cxx:765
const double BTCorrOffset2(double zHit, unsigned int id, double t0)
const double BTime2(double ADC, double TDC, double zHit, unsigned int id, double t0)
const double EPulseHeight(double ADC, double rHit, double cost, unsigned int id)
Definition: TofCaliSvc.cxx:814
const double BSigma1(double zHit, unsigned int id)
const double BAtten(unsigned int id)
virtual StatusCode finalize()
Definition: TofCaliSvc.cxx:90
const double EtfTimeMC(double ADC1, double ADC2, double TDC1, double TDC2, unsigned int id, unsigned int strip, double t0)
const double BSigma2(double zHit, unsigned int id)
const double EtfTime1(double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double BTime1(double ADC, double TDC, double zHit, unsigned int id, double t0)
BTofCal * BTof(unsigned int id) const
const double ETime(double ADC, double TDC, double rHit, unsigned int id)
const double BTCorrOffset1(double zHit, unsigned int id, double t0)
const double EtfTimeMC1(double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double EtfTimeMC2(double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double EtfTime2(double ADC, double TDC, double zHit, unsigned int id, unsigned int strip, double t0)
const double BSigmaCluster(double zHit1, double zHit2, unsigned int id1, unsigned int id2)
const double EtfVeff(unsigned int id, unsigned int strip)
Definition: TofCaliSvc.cxx:874
const double ZADC1(double qright, unsigned int id, double z)
virtual StatusCode initialize()
Definition: TofCaliSvc.cxx:58
const double BGainBackward(unsigned int id)
const double BVeff(unsigned int id)
const double ESigma(double rHit, unsigned int id)
const int Version()
Definition: TofCaliSvc.cxx:974
const double EtfZTDC(double tleft, double tright, unsigned int id, unsigned int strip)
const double ZADC2(double qleft, unsigned int id, double z)
const double getQ0(unsigned int id)
const int BrWest(unsigned int No)
Definition: TofCaliSvc.cxx:994
const int RunEnd()
Definition: TofCaliSvc.cxx:970
const double ZTDC(double tleft, double tright, unsigned int id)
const double ETDelay(unsigned int id)
const double EVeff(unsigned int id)
const double TOffset()
Definition: TofCaliSvc.cxx:403
const double EAtten(unsigned int id)
const int Endcap(unsigned int No)
Definition: TofCaliSvc.cxx:998
const double BTCorr2(double ADC, double zHit, unsigned int id)
const int QElec()
Definition: TofCaliSvc.cxx:982
BTofCommonCal * BTofCommon() const
const double BTCorr1(double ADC, double zHit, unsigned int id)
void handle(const Incident &)
const double BTDelay1(unsigned int id)
const double BTDelay2(unsigned int id)
EtfCal * EtfTof(unsigned int id) const
TofCaliSvc(const std::string &name, ISvcLocator *svcloc)
Definition: TofCaliSvc.cxx:45
ETofCal * ETof(unsigned int id) const
const double BSigmaCounter(double zHit, unsigned int id)
int t()
Definition: t.c:1