11#include "GaudiKernel/DataObject.h"
12#include "GaudiKernel/IAddressCreator.h"
13#include "GaudiKernel/IConversionSvc.h"
14#include "GaudiKernel/IDataProviderSvc.h"
15#include "GaudiKernel/IOpaqueAddress.h"
16#include "GaudiKernel/MsgStream.h"
18#include "CalibData/CalibBase.h"
19#include "CalibData/CalibBase1.h"
20#include "CalibDataSvc/ICalibMetaCnvSvc.h"
21#include "CalibDataSvc/ICalibRootSvc.h"
22#include "CalibDataSvc/IInstrumentName.h"
23#include "facilities/Util.h"
25#include "CalibMySQLCnvSvc/TreeAddress.h"
26#include "DatabaseSvc/IDatabaseSvc.h"
52 StatusCode status = Converter::initialize();
61 serviceLocator()->getService(
"CalibDataSvc", IDataProviderSvc::interfaceID(),
63 setDataProvider( dp );
69 IInterface*
m_treeSvc = serviceLocator()->service(
"CalibTreeCnvSvc" );
79 IInterface*
m_metaSvc = serviceLocator()->service(
"CalibMySQLCnvSvc" );
83 IInterface*
m_instrSvc = serviceLocator()->service(
"CalibDataSvc" );
94 MsgStream log(
msgSvc(),
"TreeCalBaseCnv" );
95 log << MSG::ERROR <<
"createRoot method not implemented for this calibration type" << endmsg;
96 return StatusCode::FAILURE;
107 return StatusCode::SUCCESS;
116 MsgStream log(
msgSvc(),
"TreeCalBaseCnv" );
117 log << MSG::DEBUG <<
"TreeCalBaseCnv::createObj( starting ...." << endmsg;
132 MsgStream log(
msgSvc(),
"TreeCalBaseCnv" );
133 log << MSG::DEBUG <<
"TreeCalBaseCnv::internalCreateObj( starting ..... " << endmsg;
135 CLID classId =
address->clID();
137 IConverter* conv = this->conversionSvc()->converter( classId );
140 log << MSG::WARNING <<
"No proper converter found for classID " << classId
141 <<
", the default converter"
142 <<
" will be used. " << endmsg;
147 if ( 0 == converter )
149 log << MSG::ERROR <<
"The converter found for classID " << classId
150 <<
" was not a descendent of TreeCalBaseCnv as it should be "
151 <<
"( was of type " <<
typeid( *converter ).name() <<
"). "
152 <<
"The default converter will be used" << endmsg;
166 if ( sc.isFailure() ) {
return sc; }
171 if ( sc.isSuccess() )
172 { log << MSG::DEBUG <<
"Successfully created calib. object " << endmsg; }
183 return StatusCode::FAILURE;
189 return StatusCode::SUCCESS;
194 MsgStream log(
msgSvc(),
"TreeCalBaseCnv" );
195 log << MSG::DEBUG <<
"set the runfrm and runto Numbers in the converter" << endmsg;
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.