17class UseEmc : public Algorithm {
20 UseEmc(const std::string& name, ISvcLocator* pSvcLocator);
22 StatusCode initialize();
26 StatusCode finalize();
29 IDataProviderSvc* m_pCalibDataSvc;
30 ICalibRootSvc* m_pRootSvc;
31 // Maybe something to say which kind of data to look up?
36//static const AlgFactory<UseEmc> Factory;
37//const IAlgFactory& UseCalibFactory = Factory;
38//const IAlgFactory& UseEmcFactory = Factory;
42 : Algorithm( name, pSvcLocator ), m_pCalibDataSvc( 0 ) {
48 MsgStream log(
msgSvc(), name() );
49 log << MSG::INFO <<
"Initialize()" << endmsg;
54 log << MSG::INFO <<
"setProperties()" << endmsg;
56 sc = service(
"CalibDataSvc", m_pCalibDataSvc,
true );
58 if ( !sc.isSuccess() )
60 log << MSG::ERROR <<
"Could not get IDataProviderSvc interface of CalibXmlCnvSvc"
65 { log << MSG::DEBUG <<
"Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" << endmsg; }
67 sc = service(
"CalibRootCnvSvc", m_pRootSvc,
true );
68 if ( !sc.isSuccess() )
70 log << MSG::ERROR <<
"Could not get ICalibRootSvc interface of CalibRootCnvSvc" << endmsg;
77 return StatusCode::SUCCESS;
82 MsgStream log(
msgSvc(), name() );
84 std::vector<double> emccalib;
87 for ( i = 0; i < 6000; i++ ) { emccalib.push_back( i ); }
94 std::string fullPath =
"/Calib/EmcCal";
95 log << MSG::INFO <<
"execute() fullPath = " << fullPath << endmsg;
96 m_pCalibDataSvc->registerObject( fullPath, emc );
99 m_pRootSvc->writeToRoot(
"./Emc_dat.root", fullPath );
101 m_pRootSvc->writeToRoot(
"./Emc_dat1.root", emc );
103 SmartDataPtr<CalibData::EmcCalibData>
test( m_pCalibDataSvc, fullPath );
106 return StatusCode::SUCCESS;
110 MsgStream log(
msgSvc(), name() );
111 log << MSG::INFO <<
" UseEmc FINALIZE!! " << endmsg;
113 return StatusCode::SUCCESS;
void setrunfrm(int runfrm)
void setDigiCalibConst(const vector< double > *DigiCalibConst)
UseEmc(const std::string &name, ISvcLocator *pSvcLocator)