16class checkTof : public Algorithm {
19 checkTof(const std::string& name, ISvcLocator* pSvcLocator);
21 StatusCode initialize();
25 StatusCode finalize();
28 IDataProviderSvc* m_pCalibDataSvc;
29 ICalibTreeSvc* m_pTreeSvc;
30 // Maybe something to say which kind of data to look up?
35//static const AlgFactory<checkTof> Factory;
36//const IAlgFactory& UseCalibFactory = Factory;
37//const IAlgFactory& checkTofFactory = Factory;
41 ISvcLocator* pSvcLocator )
42 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0)
51 MsgStream log(
msgSvc(), name());
52 log << MSG::INFO <<
"Initialize()" << endreq;
57 log<<MSG::INFO <<
"setProperties()" << endreq;
59 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true);
61 if ( !sc.isSuccess() ) {
63 <<
"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
68 <<
"Retrieved IDataProviderSvc interface of CalibXmlCnvSvc"
72 sc = service(
"CalibTreeCnvSvc", m_pTreeSvc,
true);
73 if ( !sc.isSuccess() ) {
75 <<
"Could not get ICalibTreeSvc interface of CalibTreeCnvSvc"
83 return StatusCode::SUCCESS;
90 MsgStream log(
msgSvc(), name());
94 std::string fullPath =
"/Calib/TofCal";
95 log << MSG::INFO<<
"execute() fullPath = "<<fullPath<< endreq;
97 SmartDataPtr<CalibData::TofCalibData> btof(m_pCalibDataSvc, fullPath);
99 for(
int i =0;i<176;i++)
101 double bAtten0 = btof->getBTofAtten(i,0);
102 double bAtten1 = btof->getBTofAtten(i,1);
103 double bP0 = btof->getBTofPleft(i,0);
104 double bP1 = btof->getBTofPleft(i,1);
105 double bP2 = btof->getBTofPleft(i,2);
106 double bP3 = btof->getBTofPleft(i,3);
107 double bP4 = btof->getBTofPleft(i,4);
108 double bP5 = btof->getBTofPleft(i,5);
109 double bP10 = btof->getBTofPright(i,0);
113 double bSpeed0 = btof->getBTofSpeed(i,0);
114 double bSpeed1 = btof->getBTofSpeed(i,1);
119 std::cout<<
"=========================================="<<
"\n";
120 std::cout<<
"cnt ="<<i<<
"\n";
121 std::cout<<
"Atten0="<<bAtten0<<
"Atten1="<<bAtten1<<
"Q="<<
"bQ"<<
"Speed0="<<bSpeed0<<
"Speed1="<<bSpeed1<<
"P0="<<bP0<<
"P1="<<bP1<<
"P2="<<bP2<<
"P3="<<bP3<<
"P4="<<bP4<<
"P10="<<bP10;
123 std::cout<<
"P5="<<bP5<<
"Q="<<
"bQ";
133 for(
int i =0;i<96;i++)
135 double eAtten0 = btof->getETofAtten(i,0);
136 double eAtten1 = btof->getETofAtten(i,1);
137 double eP0 = btof->getETofP(i,0);
138 double eP1 = btof->getETofP(i,1);
139 double eP2 = btof->getETofP(i,2);
140 double eP3 = btof->getETofP(i,3);
141 double eP4 = btof->getETofP(i,4);
142 double eP5 = btof->getETofP(i,5);
143 double eP6 = btof->getETofP(i,6);
145 double eSpeed0 = btof->getETofSpeed(i,0);
146 double eSpeed1 = btof->getETofSpeed(i,1);
148 std::cout<<
"=========================================="<<
"\n";
149 std::cout<<
"cnt ="<<i<<
"\n";
151 std::cout<<
"Atten0="<<eAtten0<<
"Atten1="<<eAtten1<<
"Speed0="<<eSpeed0<<
"Speed1="<<eSpeed1<<
"P0="<<eP0<<
"P1="<<eP1<<
"P2="<<eP2<<
"P3="<<eP3<<
"P4="<<eP4<<
"P6="<<eP6;
153 std::cout<<
"P5="<<eP5;
160 return StatusCode::SUCCESS;
167 MsgStream log(
msgSvc(), name());
169 <<
" checkTof FINALIZE!! "
172 return StatusCode::SUCCESS;
checkTof(const std::string &name, ISvcLocator *pSvcLocator)