#include <EstTofCaliSvc.h>
Inheritance diagram for EstTofCaliSvc:
Public Member Functions | |
const double | BTCorr1 (double ADC, double zHit, unsigned int id) |
const double | BTCorr1 (double ADC, double zHit, unsigned int id) |
const double | BTCorr2 (double ADC, double zHit, unsigned int id) |
const double | BTCorr2 (double ADC, double zHit, unsigned int id) |
const double | BTCorrOffset1 (double zHit, unsigned int id) |
const double | BTCorrOffset1 (double zHit, unsigned int id) |
const double | BTCorrOffset2 (double zHit, unsigned int id) |
const double | BTCorrOffset2 (double zHit, unsigned int id) |
const double | BTime1 (double ADC, double TDC, double zHit, unsigned id) |
const double | BTime1 (double ADC, double TDC, double zHit, unsigned id) |
const double | BTime2 (double ADC, double TDC, double zHit, unsigned id) |
const double | BTime2 (double ADC, double TDC, double zHit, unsigned id) |
BTofCal * | BTof (unsigned id) const |
BTofCal * | BTof (unsigned id) const |
BTofCommonCal * | BTofCommon () const |
BTofCommonCal * | BTofCommon () const |
void | Dump () |
void | Dump () |
EstTofCaliSvc (const std::string &name, ISvcLocator *svcloc) | |
EstTofCaliSvc (const std::string &name, ISvcLocator *svcloc) | |
const double | ETime (double ADC, double TDC, double rHit, unsigned id) |
const double | ETime (double ADC, double TDC, double rHit, unsigned id) |
ETofCal * | ETof (unsigned id) const |
ETofCal * | ETof (unsigned id) const |
virtual StatusCode | finalize () |
virtual StatusCode | finalize () |
void | handle (const Incident &) |
void | handle (const Incident &) |
virtual StatusCode | initialize () |
virtual StatusCode | initialize () |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
const double | TOffset () |
const double | TOffset () |
const bool | ValidInfo () |
const bool | ValidInfo () |
~EstTofCaliSvc () | |
~EstTofCaliSvc () | |
Static Public Member Functions | |
const InterfaceID & | interfaceID () |
const InterfaceID & | interfaceID () |
Private Member Functions | |
StatusCode | FillfromDatabase () |
StatusCode | FillfromDatabase () |
Private Attributes | |
std::vector< BTofCal * > | fBTofCal |
std::vector< BTofCal * > | fBTofCal |
std::vector< BTofCommonCal * > | fBTofCommonCal |
std::vector< BTofCommonCal * > | fBTofCommonCal |
std::vector< ETofCal * > | fETofCal |
std::vector< ETofCal * > | fETofCal |
bool | m_hasbeeninitialized |
IDataProviderSvc * | m_pCalibDataSvc |
IDataProviderSvc * | m_pCalibDataSvc |
IntegerProperty | m_run |
bool | m_st |
|
00043 : Service(name, svcloc) {
00044 declareProperty("Run",m_run=1);
00045 }
|
|
00096 { 00097 for(vector<BTofCal*>::iterator it1 = fBTofCal.begin(); it1 != fBTofCal.end(); it1++) { delete (*it1); } 00098 fBTofCal.clear(); 00099 for(vector<ETofCal*>::iterator it2 = fETofCal.begin(); it2 != fETofCal.end(); it2++) { delete (*it2); } 00100 fETofCal.clear(); 00101 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); } 00102 fBTofCommonCal.clear(); 00103 return; 00104 }
|
|
|
|
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00240 { 00241 MsgStream log(msgSvc(), name()); 00242 00243 double tcorr1 = BTCorr1( ADC, z, id ); 00244 double tcorr2 = BTCorrOffset1( z, id ); 00245 double tcorr3 = fBTofCommonCal[0]->getOffset(0); 00246 00247 log << MSG::DEBUG << "BTime1 id =" << id << " tcorr=" << tcorr1 << " toffset=" << tcorr2 << " total offset=" << tcorr3 << endreq; 00248 00249 double time = TDC - tcorr1 - tcorr2 - tcorr3; 00250 00251 if(time<0.) { 00252 log<<MSG::WARNING<<"TofCaliSvc::BTime1() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq; 00253 } 00254 return time; 00255 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00258 { 00259 MsgStream log(msgSvc(), name()); 00260 00261 double tcorr1 = BTCorr2( ADC, z, id ); 00262 double tcorr2 = BTCorrOffset2( z, id ); 00263 double tcorr3 = fBTofCommonCal[0]->getOffset(0); 00264 00265 log << MSG::DEBUG << "BTime2 id =" << id << " tcorr=" << tcorr1 << " toffset=" << tcorr2 << " total offset=" << tcorr3 << endreq; 00266 00267 double time = TDC - tcorr1 - tcorr2 - tcorr3; 00268 00269 if(time<0.) { 00270 log<<MSG::WARNING<<"TofCaliSvc::BTime2() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" z = "<<z<<" ID = "<<id<<endreq; 00271 } 00272 return time; 00273 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00297 { 00298 return fBTofCal[id]; 00299 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00305 { 00306 return fBTofCommonCal[0]; 00307 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00309 { 00310 std::cout<<"Now We can get the TOF Calibtration Service"<<std::endl; 00311 std::cout<<"Barrel TOF Counter Number = "<<fBTofCal.size()<<std::endl; 00312 std::cout<<"Endcap TOF Counter Number = "<<fETofCal.size()<<std::endl; 00313 00314 cout<<"The O Barrel TOF PMT1 p1[0] is"<<" "<<BTof(0)->getP1(0)<<endl; 00315 cout<<"The 0 Barrel TOF PMT1 p1[1] is"<<" "<<BTof(0)->getP1(1)<<endl; 00316 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00276 { 00277 MsgStream log(msgSvc(), name()); 00278 00279 double p[nEndPar]; 00280 for( int i=0; i<static_cast<int>(nEndPar); i++ ) { 00281 p[i]=fETofCal[id]->getP(i); 00282 } 00283 00284 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; 00285 00286 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); 00287 00288 if(time<0.) { 00289 MsgStream log(msgSvc(), name()); 00290 log<<MSG::WARNING<<"TofCaliSvc::ETime() -- A minus time is given : "<< time <<" [Input] ADC = "<<ADC<<" TDC = "<<TDC<<" r = "<< rHit <<" ID = "<<id<<endreq; 00291 } 00292 00293 return time; 00294 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00301 { 00302 return fETofCal[id]; 00303 }
|
|
|
|
00105 { 00106 00107 MsgStream log(msgSvc(), name()); 00108 std::string fullPath = "/Calib/EstTofCal"; 00109 log << MSG::INFO<<" Tof calib fullPath = "<<fullPath<< endreq; 00110 SmartDataPtr<CalibData::TofCalibData> test(m_pCalibDataSvc, fullPath); 00111 if(!test){ 00112 log << MSG::FATAL << "EstTofCaliSvc could not find TofCalibData in TCDS!!" << endreq; 00113 m_st=false; 00114 return StatusCode::FAILURE; 00115 } 00116 00117 m_st=true; 00118 00119 for(vector<BTofCal*>::iterator it1 = fBTofCal.begin(); it1 != fBTofCal.end(); it1++) { delete (*it1); } 00120 fBTofCal.clear(); 00121 for(vector<ETofCal*>::iterator it2 = fETofCal.begin(); it2 != fETofCal.end(); it2++) { delete (*it2); } 00122 fETofCal.clear(); 00123 for(vector<BTofCommonCal*>::iterator it3 = fBTofCommonCal.begin(); it3 != fBTofCommonCal.end(); it3++) { delete (*it3); } 00124 fBTofCommonCal.clear(); 00125 00126 for(int ib =0;ib<176;ib++){ 00127 BTofCal* btof = new BTofCal; 00128 for(int i=0;i<static_cast<int>(nBarPar);i++){ 00129 btof->setP1(i,test->getBTofPleft(ib,i)); 00130 btof->setP2(i,test->getBTofPright(ib,i)); 00131 } 00132 for( int j=0; j<static_cast<int>(nBarParOff); j++){ 00133 btof->setPOff1(j,test->getBTofPoffleft(ib,j)); 00134 btof->setPOff2(j,test->getBTofPoffright(ib,j)); 00135 } 00136 fBTofCal.push_back(btof); 00137 } 00138 00139 for(int ie=0;ie<96;ie++){ 00140 ETofCal* etof= new ETofCal; 00141 for(int i=0;i<static_cast<int>(nEndPar);i++){ 00142 etof->setP(i,test->getETofP(ie,i)); 00143 } 00144 fETofCal.push_back(etof); 00145 } 00146 00147 BTofCommonCal* bcomtof = new BTofCommonCal; 00148 for(int i=0; i<static_cast<int>(nBarOffset); i++) { 00149 bcomtof->setOffset( i, test->getBTofOffset(i) ); 00150 } 00151 fBTofCommonCal.push_back(bcomtof); 00152 00153 return StatusCode::SUCCESS; 00154 00155 }
|
|
|
|
00090 { 00091 MsgStream log(msgSvc(), name()); 00092 log << MSG::INFO << name() << ": End of Run" << endreq; 00093 return StatusCode::SUCCESS; 00094 }
|
|
|
|
00318 { 00319 MsgStream log( messageService(), name() ); 00320 log << MSG::DEBUG << "handle: " << inc.type() << endreq; 00321 00322 if ( inc.type() == "NewRun" ){ 00323 log << MSG::DEBUG << "New Run" << endreq; 00324 // if(!m_hasbeeninitialized){ 00325 StatusCode sc= FillfromDatabase(); 00326 if(sc.isSuccess()){ 00327 m_hasbeeninitialized=true; 00328 } 00329 // } 00330 } 00331 }
|
|
|
|
00057 { 00058 m_hasbeeninitialized=false; 00059 m_st=false; 00060 00061 MsgStream log(msgSvc(), name()); 00062 log << MSG::INFO << name() << ": Start of run initialisation" << endreq; 00063 00064 StatusCode sc = Service::initialize(); 00065 if ( sc.isFailure() ) return sc; 00066 00067 IIncidentSvc* incsvc; 00068 sc = service("IncidentSvc", incsvc); 00069 int priority = 100; 00070 if( sc.isSuccess() ){ 00071 incsvc -> addListener(this, "NewRun", priority); 00072 } 00073 00074 StatusCode scc; 00075 00076 log<<MSG::INFO << "setProperties()" << endreq; 00077 scc = service("CalibDataSvc", m_pCalibDataSvc, true); 00078 if ( !scc.isSuccess() ) { 00079 log<<MSG::ERROR<<"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"<<endreq; 00080 return scc; 00081 } else { 00082 log << MSG::DEBUG<< "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"<<endreq; 00083 } 00084 // Get properties from the JobOptionsSvc 00085 scc = setProperties(); 00086 00087 return sc; 00088 }
|
|
00017 { return IID_IEstTofCaliSvc; }
|
|
00017 { return IID_IEstTofCaliSvc; }
|
|
|
|
00047 { 00048 00049 if ( IID_IEstTofCaliSvc.versionMatch(riid) ) { 00050 *ppvInterface = static_cast<IEstTofCaliSvc*> (this); 00051 } else { 00052 return Service::queryInterface(riid, ppvInterface) ; 00053 } 00054 return StatusCode::SUCCESS; 00055 }
|
|
Implements IEstTofCaliSvc. |
|
Implements IEstTofCaliSvc. 00234 { 00235 double toffset = fBTofCommonCal[0]->getOffset(0); 00236 return toffset; 00237 }
|
|
Implements IEstTofCaliSvc. 00046 {return m_st;};
|
|
Implements IEstTofCaliSvc. 00046 {return m_st;};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|