#include <UseEmc.h>
Public Member Functions | |
UseEmc (const std::string &name, ISvcLocator *pSvcLocator) | |
StatusCode | initialize () |
StatusCode | execute () |
StatusCode | finalize () |
Private Attributes | |
IDataProviderSvc * | m_pCalibDataSvc |
ICalibRootSvc * | m_pRootSvc |
Definition at line 18 of file UseEmc.h.
UseEmc::UseEmc | ( | const std::string & | name, | |
ISvcLocator * | pSvcLocator | |||
) |
Definition at line 42 of file UseEmc.cxx.
00044 : Algorithm ( name, pSvcLocator ), m_pCalibDataSvc(0) 00045 { 00046 // Declare properties here. 00047 00048 }
StatusCode UseEmc::execute | ( | ) |
Definition at line 90 of file UseEmc.cxx.
References genRecEmupikp::i, Bes_Common::INFO, m_pCalibDataSvc, m_pRootSvc, msgSvc(), CalibData::EmcCalibData::setDigiCalibConst(), CalibData::CalibBase1::setrunfrm(), CalibData::CalibBase1::setrunto(), deljobs::string, test, and ICalibRootSvc::writeToRoot().
00090 { 00091 00092 MsgStream log(msgSvc(), name()); 00093 int i; 00094 std::vector<double> emccalib; 00095 CalibData::EmcCalibData* emc = new CalibData::EmcCalibData; 00096 //set emcCalibdata-------------------------------- 00097 for(i=0;i<6000;i++) 00098 { emccalib.push_back(i); 00099 } 00100 00101 emc->setDigiCalibConst(&emccalib); 00102 emc->setrunfrm(0); 00103 emc->setrunto(0); 00104 00105 //register the emcCalibData into the TCDS ; nelectable 00106 std::string fullPath = "/Calib/EmcCal"; 00107 log << MSG::INFO<<"execute() fullPath = "<<fullPath<< endreq; 00108 m_pCalibDataSvc->registerObject(fullPath,emc); 00109 00110 //write the EmcCalibData to the rootfile; 00111 m_pRootSvc->writeToRoot("./Emc_dat.root", fullPath); 00112 //another way,write the EmcCalibData without TCDS 00113 m_pRootSvc->writeToRoot("./Emc_dat1.root", emc); 00114 //retrieve DataObject from the TCDS----------------- 00115 SmartDataPtr<CalibData::EmcCalibData> test(m_pCalibDataSvc, fullPath); 00116 if(!test); 00117 return StatusCode::SUCCESS; 00118 }
StatusCode UseEmc::finalize | ( | ) |
Definition at line 119 of file UseEmc.cxx.
References Bes_Common::INFO, and msgSvc().
00119 { 00120 00121 MsgStream log(msgSvc(), name()); 00122 log << MSG::INFO 00123 << " UseEmc FINALIZE!! " 00124 << endreq; 00125 00126 return StatusCode::SUCCESS; 00127 }
StatusCode UseEmc::initialize | ( | ) |
Definition at line 51 of file UseEmc.cxx.
References Bes_Common::DEBUG, calibUtil::ERROR, Bes_Common::INFO, m_pCalibDataSvc, m_pRootSvc, and msgSvc().
00051 { 00052 StatusCode sc; 00053 MsgStream log(msgSvc(), name()); 00054 log << MSG::INFO << "Initialize()" << endreq; 00055 00056 // So far don't have any properties, but in case we do some day.. 00057 // setProperties(); 00058 00059 log<<MSG::INFO << "setProperties()" << endreq; 00060 00061 sc = service("CalibDataSvc", m_pCalibDataSvc, true); 00062 00063 if ( !sc.isSuccess() ) { 00064 log << MSG::ERROR 00065 << "Could not get IDataProviderSvc interface of CalibXmlCnvSvc" 00066 << endreq; 00067 return sc; 00068 } else { 00069 log << MSG::DEBUG 00070 << "Retrieved IDataProviderSvc interface of CalibXmlCnvSvc" 00071 << endreq; 00072 } 00073 00074 sc = service("CalibRootCnvSvc", m_pRootSvc, true); 00075 if ( !sc.isSuccess() ) { 00076 log << MSG::ERROR 00077 << "Could not get ICalibRootSvc interface of CalibRootCnvSvc" 00078 << endreq; 00079 return sc; 00080 } 00081 // Get properties from the JobOptionsSvc 00082 00083 sc = setProperties(); 00084 00085 return StatusCode::SUCCESS; 00086 00087 }
IDataProviderSvc* UseEmc::m_pCalibDataSvc [private] |
ICalibRootSvc* UseEmc::m_pRootSvc [private] |