10#include "GaudiKernel/CnvFactory.h"
11#include "GaudiKernel/IOpaqueAddress.h"
12#include "GaudiKernel/DataObject.h"
13#include "GaudiKernel/IAddressCreator.h"
14#include "GaudiKernel/IDataProviderSvc.h"
15#include "GaudiKernel/IConversionSvc.h"
16#include "GaudiKernel/MsgStream.h"
44 m_treeSvc (0), m_metaSvc(0), m_instrSvc(0),m_outFile(0), m_ttree(0), m_inFile(0), m_saveDir(0) {}
47 StatusCode status = Converter::initialize();
56 serviceLocator()->getService (
"CalibDataSvc",
57 IDataProviderSvc::interfaceID(),
65 IInterface*
m_treeSvc = serviceLocator()->service(
"CalibTreeCnvSvc");
75 IInterface*
m_metaSvc = serviceLocator()->service(
"CalibMySQLCnvSvc");
79 IInterface*
m_instrSvc = serviceLocator()->service(
"CalibDataSvc");
85 return Converter::finalize();
93 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
95 <<
"createRoot method not implemented for this calibration type"
97 return StatusCode::FAILURE;
109 return StatusCode::SUCCESS;
114 DataObject*& refpObject) {
119 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
120 log << MSG::DEBUG<<
"TreeCalBaseCnv::createObj( starting ...."<<endreq;
136 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
137 log << MSG::DEBUG<<
"TreeCalBaseCnv::internalCreateObj( starting ..... "<<endreq;
139 CLID classId =
address->clID();
141 IConverter* conv = this->conversionSvc()->converter(classId);
144 <<
"No proper converter found for classID " << classId
145 <<
", the default converter"
146 <<
" will be used. " << endreq;
149 if (0 == converter) {
151 <<
"The converter found for classID " << classId
152 <<
" was not a descendent of TreeCalBaseCnv as it should be "
153 <<
"( was of type " <<
typeid (*converter).name() <<
"). "
154 <<
"The default converter will be used" << endreq;
168 if (sc.isFailure()) {
175 if (sc.isSuccess()) {
176 log << MSG::DEBUG <<
"Successfully created calib. object " << endreq;
188 return StatusCode::FAILURE;
194 return StatusCode::SUCCESS;
199 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
200 log << MSG::DEBUG<<
"set the runfrm and runto Numbers in the converter"<<endreq;
unsigned const char CALIBTREE_StorageType
void setrunfrm(int runfrm)
int getRunFrom()
get run from
virtual StatusCode initialize()
virtual ~TreeCalBaseCnv()
virtual StatusCode fillRoot(CalibData::CalibBase *pTDSObj, TObject *pRootObj)
virtual StatusCode i_processObj(DataObject *pObject, IOpaqueAddress *address)
In case there is additional work to do on the created object.
virtual StatusCode finalize()
TreeCalBaseCnv(ISvcLocator *svc, const CLID &clid)
ICalibMetaCnvSvc * m_metaSvc
virtual StatusCode i_createObj(IOpaqueAddress *address, DataObject *&refpObject)
virtual StatusCode createObj(IOpaqueAddress *addr, DataObject *&refpObject)
IInstrumentName * m_instrSvc
ICalibTreeSvc * m_treeSvc
virtual StatusCode internalCreateObj(DataObject *&refpObject, IOpaqueAddress *address)
virtual StatusCode createRoot(const std::string &fname, CalibData::CalibBase1 *pTDSObj)
void setBaseInfo(CalibData::CalibBase1 *pObj)
Another utility for derived classes to use.