18class UseTof : public Algorithm {
21 UseTof(const std::string& name, ISvcLocator* pSvcLocator);
23 StatusCode initialize();
27 StatusCode finalize();
30 IDataProviderSvc* m_pCalibDataSvc;
31 ICalibRootSvc* m_pRootSvc;
32 // Maybe something to say which kind of data to look up?
37//static const AlgFactory<UseTof> Factory;
38//const IAlgFactory& UseCalibFactory = Factory;
39//const IAlgFactory& UseTofFactory = Factory;
41#include "CalibData/Tof/BarrelElec.h"
42#include "CalibData/Tof/EndcapElec.h"
43#include "CalibData/Tof/TofElecData.h"
44#include "TDirectory.h"
51 : Algorithm( name, pSvcLocator ), m_pCalibDataSvc( 0 ) {
57 MsgStream log(
msgSvc(), name() );
58 log << MSG::INFO <<
"Initialize()" << endmsg;
63 log << MSG::INFO <<
"setProperties()" << endmsg;
65 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true );
67 if ( !sc.isSuccess() )
69 log << MSG::ERROR <<
"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
74 { log << MSG::DEBUG <<
"Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" << endmsg; }
76 sc = service(
"CalibRootCnvSvc", m_pRootSvc,
true );
77 if ( !sc.isSuccess() )
79 log << MSG::ERROR <<
"Could not get ICalibRootSvc interface of CalibRootCnvSvc" << endmsg;
86 return StatusCode::SUCCESS;
91 MsgStream log(
msgSvc(), name() );
95 std::string fullPath =
"/Calib/TofQElec";
96 log << MSG::INFO <<
"execute() fullPath = " << fullPath << endmsg;
98 SmartDataPtr<CalibData::TofElecData> btof( m_pCalibDataSvc, fullPath );
100 for (
int i = 0; i < 96; i++ )
104 std::cout <<
"i===========" << i << std::endl;
105 for (
int j = 0; j < 4; j++ )
107 std::cout <<
"getNumEast==" << aa.
getNumEast( j )
108 <<
" getNumWest==" << aa.
getNumWest( j ) << std::endl;
109 std::cout <<
"getEast==" << bb.
getNum( j ) << std::endl;
111 for (
int j = 0; j < 10; j++ )
113 std::cout <<
"j===" << j << std::endl;
114 std::cout <<
" getP1==" << aa.
getP1( j ) << std::endl;
115 std::cout <<
" getP2==" << aa.
getP2( j ) << std::endl;
116 std::cout <<
" getSimP1==" << aa.
getSimP1( j ) << std::endl;
117 std::cout <<
" getSimP2==" << aa.
getSimP2( j ) << std::endl;
118 std::cout <<
" getP==" << bb.
getP( j ) << std::endl;
119 std::cout <<
" getSimP==" << bb.
getSimP( j ) << std::endl;
126 return StatusCode::SUCCESS;
133 MsgStream log(
msgSvc(), name() );
134 log << MSG::INFO <<
" UseTof FINALIZE!! " << endmsg;
136 return StatusCode::SUCCESS;
double getSimP1(int idx) const
unsigned int getNumWest(int idx) const
double getP1(int idx) const
double getP2(int idx) const
double getSimP2(int idx) const
unsigned int getNumEast(int idx) const
double getSimP(unsigned int idx) const
double getP(unsigned int idx) const
unsigned int getNum(unsigned int idx) const
UseEstTof(const std::string &name, ISvcLocator *pSvcLocator)