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"
18#include "facilities/Util.h"
19#include "CalibDataSvc/ICalibRootSvc.h"
20#include "CalibDataSvc/ICalibMetaCnvSvc.h"
21#include "CalibDataSvc/IInstrumentName.h"
22#include "CalibData/CalibBase.h"
23#include "CalibData/CalibBase1.h"
29#include "DatabaseSvc/IDatabaseSvc.h"
30#include "CalibMySQLCnv/TreeAddress.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(),
62 serviceLocator()->getService (
"CalibTreeCnvSvc",
71 serviceLocator()->getService(
"CalibMySQLCnvSvc",
75 serviceLocator()->getService (
"CalibDataSvc",
83 return Converter::finalize();
91 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
93 <<
"createRoot method not implemented for this calibration type"
95 return StatusCode::FAILURE;
107 return StatusCode::SUCCESS;
112 DataObject*& refpObject) {
117 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
118 log << MSG::DEBUG<<
"TreeCalBaseCnv::createObj( starting ...."<<endreq;
134 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
135 log << MSG::DEBUG<<
"TreeCalBaseCnv::internalCreateObj( starting ..... "<<endreq;
137 CLID classId =
address->clID();
139 IConverter* conv = this->conversionSvc()->converter(classId);
142 <<
"No proper converter found for classID " << classId
143 <<
", the default converter"
144 <<
" will be used. " << endreq;
147 if (0 == converter) {
149 <<
"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" << endreq;
166 if (sc.isFailure()) {
173 if (sc.isSuccess()) {
174 log << MSG::DEBUG <<
"Successfully created calib. object " << endreq;
186 return StatusCode::FAILURE;
192 return StatusCode::SUCCESS;
197 MsgStream log(
msgSvc(),
"TreeCalBaseCnv");
198 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.