| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

RootIOCnvSvc Class Reference

Service to coordinate conversion with Root IO. More...

#include <RootIOCnvSvc.h>

Inheritance diagram for RootIOCnvSvc:

[legend]
Collaboration diagram for RootIOCnvSvc:
[legend]
List of all members.

Public Types

typedef std::vector< WorkerEntry > Workers
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
 CONVERSIONSVC_NO_ERROR
 NO_CONVERTER
 INVALID_ADDRESS
 INVALID_OBJECT
 NO_MEMORY
 BAD_STORAGE_TYPE
 NO_SOURCE_OBJECT
 ICONVERSIONSVC_LAST_ERROR
enum  Status
enum  Status
typedef std::map< std::string,
RootInputStream * > 
InputStreamMap
 Access the complete set of input streams.
typedef std::map< std::string,
std::string > 
FileMap
 Get copy of the output file map.

Public Member Functions

 RootIOCnvSvc (const std::string &name, ISvcLocator *svc)
virtual ~RootIOCnvSvc ()
virtual StatusCode initialize ()
virtual StatusCode reinitialize ()
virtual StatusCode finalize ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppint)
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string *par, const unsigned long *ip, IOpaqueAddress *&newAddr)
 Create a Generic address using explicit arguments to identify a single object.
virtual IDataProviderSvcdataSvc ()
 Get the event data provider service.
virtual IDataManagerSvcdataMgrSvc ()
 Get the event data manager service.
virtual StatusCode createAddress (DataObject *obj, RootOutputAddress *&newAddr)
 Extend ConversionSvc interface to create address based on existing DataObject.
RootOutputStreamoutputStream (const RootOutputAddress &roa)
 Return a root output stream for the given address (needs clid and tespath filled in).
const std::string & outputFilename (const std::string &tespath)
 Get the output filename coresonding to the path.
void associateOutput (const char *filename, const char *streamname)
 Associate an output file name with a stream name.
FileMap fileMap ()
RootInputStreaminputStream (const RootInputAddress &ria)
 Return a root input stream for the given address (needs clid and tespath to be filled in).
InputStreamMapinputStreams ()
 Access the complete set of input streams.
std::vector< std::string > inputFilenames (const std::string &tespath)
 Get the input filename coresponding to the path.
bool isReadoutForced () const
 True if Readout object should be written to output.
virtual long repSvcType () const
const CLIDobjType () const
virtual StatusCode setDataProvider (IDataProviderSvc *pService)
virtual IDataProviderSvcdataProvider () const
virtual StatusCode setConversionSvc (IConversionSvc *svc)
virtual IConversionSvcconversionSvc () const
virtual StatusCode setAddressCreator (IAddressCreator *creator)
virtual IAddressCreatoraddressCreator () const
virtual StatusCode createObj (IOpaqueAddress *pAddress, DataObject *&refpObject)
virtual StatusCode fillObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateObj (IOpaqueAddress *pAddress, DataObject *refpObject)
virtual StatusCode updateObjRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode createRep (DataObject *pObject, IOpaqueAddress *&refpAddress)
virtual StatusCode fillRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateRep (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode updateRepRefs (IOpaqueAddress *pAddress, DataObject *pObject)
virtual StatusCode addConverter (const CLID &clid)
virtual StatusCode addConverter (IConverter *pConverter)
virtual StatusCode removeConverter (const CLID &clid)
virtual IConverterconverter (const CLID &wanted)
virtual StatusCode connectOutput (const std::string &outputFile, const std::string &openMode)
virtual StatusCode connectOutput (const std::string &output)
virtual StatusCode commitOutput (const std::string &output, bool do_commit)
virtual StatusCode createAddress (long svc_type, const CLID &clid, const std::string &refAddress, IOpaqueAddress *&refpAddress)
virtual StatusCode convertAddress (const IOpaqueAddress *pAddress, std::string &refAddress)
virtual StatusCode updateServiceState (IOpaqueAddress *pAddress)
virtual unsigned long addRef ()
virtual unsigned long release ()
virtual const std::string & name () const
virtual const InterfaceIDtype () const
virtual StatusCode configure ()
virtual StatusCode start ()
virtual StatusCode stop ()
virtual StatusCode terminate ()
virtual Gaudi::StateMachine::State FSMState () const
virtual Gaudi::StateMachine::State targetFSMState () const
virtual StatusCode restart ()
virtual StatusCode sysInitialize ()
virtual StatusCode sysStart ()
virtual StatusCode sysStop ()
virtual StatusCode sysFinalize ()
virtual StatusCode sysReinitialize ()
virtual StatusCode sysRestart ()
virtual StatusCode setProperty (const Property &p)
virtual StatusCode setProperty (const std::string &s)
virtual StatusCode setProperty (const std::string &n, const std::string &v)
StatusCode setProperty (const std::string &name, const TYPE &value)
virtual StatusCode getProperty (Property *p) const
virtual const PropertygetProperty (const std::string &name) const
virtual StatusCode getProperty (const std::string &n, std::string &v) const
virtual const std::vector<
Property * > & 
getProperties () const
ISvcLocatorserviceLocator () const
IMessageSvcmsgSvc ()
IMessageSvcmsgSvc () const
IMessageSvcmessageService ()
IMessageSvcmessageService () const
StatusCode setProperties ()
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
IAuditorSvcauditorSvc () const

Static Public Member Functions

static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()

Public Attributes

 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
 CONVERSIONSVC_NO_ERROR
 NO_CONVERTER

Protected Member Functions

StatusCode doInitialize ()
void initializeInputStream (const std::string &path, const std::string &filename)
void initializeInputStream (const std::string &path, const std::vector< std::string > &filename_list)
virtual IAddressCreatoraddressCreator ()
virtual IConvertercreateConverter (long typ, const CLID &clid, const ICnvFactory *fac)
virtual StatusCode configureConverter (long typ, const CLID &clid, IConverter *cnv)
virtual StatusCode initializeConverter (long typ, const CLID &clid, IConverter *cnv)
virtual StatusCode activateConverter (long typ, const CLID &clid, IConverter *cnv)
virtual void loadConverter (DataObject *pObject)
StatusCode makeCall (int typ, bool ignore_add, bool ignore_obj, bool update, IOpaqueAddress *&pAddress, DataObject *&pObject)
int outputLevel () const

Protected Attributes

std::map< std::string, std::string > m_outputFileMap
 Property: "OutputFileMap": maping of TES path to output filename.
std::map< std::string, RootOutputStream * > m_outputStreamMap
std::string m_defaultOutputFilename
 Property: "DefaultOutput": name of file to use if TES path not found in path.
std::map< std::string, std::vector<
std::string > > 
m_inputFileMap
 Property: "InputFileMap": maping of TES path to a list of input filenames.
InputStreamMap m_inputStreamMap
std::vector< std::string > m_defaultInputFilenames
 Property: "DefaultInput": list of names of files to use if TES path not found in the InputFileMap.
std::string m_dataSvcName
 Property: "EventDataService": name of event data service.
IDataProviderSvcm_dataSvc
IDataManagerSvcm_dataMgr
IAddressCreatorm_addressCreator
long m_type
Workersm_workers
IntegerProperty m_outputLevel
Gaudi::StateMachine::State m_state
Gaudi::StateMachine::State m_targetState
IMessageSvcm_messageSvc

Private Attributes

bool m_forceReadout
 True if Readout object should be written to output.

Friends

friend class ServiceManager

Detailed Description

Service to coordinate conversion with Root IO.

TES objects are mapped to TTrees in TFiles. An object's location in the TES is reflected by its TTree location in the TFile. The mapping to files is a user configurable property.

This class is inspired by RootCnvSvc.

bv@bnl.gov Wed Jun 25 12:08:44 2008

Definition at line 34 of file RootIOCnvSvc.h.


Member Typedef Documentation

typedef std::map<std::string,RootInputStream*> IRootIOSvc::InputStreamMap [inherited]

Access the complete set of input streams.

Definition at line 36 of file IRootIOSvc.h.

typedef std::map<std::string,std::string> IRootIOSvc::FileMap [inherited]

Get copy of the output file map.

Definition at line 43 of file IRootIOSvc.h.


Constructor & Destructor Documentation

RootIOCnvSvc::RootIOCnvSvc ( const std::string &  name,
ISvcLocator svc 
)

RootIOCnvSvc::~RootIOCnvSvc (  )  [virtual]

Definition at line 39 of file RootIOCnvSvc.cc.

00040 {
00041 }


Member Function Documentation

StatusCode RootIOCnvSvc::initialize (  )  [virtual]

Reimplemented from ConversionSvc.

Definition at line 56 of file RootIOCnvSvc.cc.

00057 {
00058     MsgStream log(msgSvc(), "RootIOCnvSvc");
00059     log << MSG::DEBUG << "initializing @" << (void*)this << endreq;
00060     StatusCode sc = ConversionSvc::initialize();
00061     if (sc.isFailure()) {
00062         log << MSG::ERROR << "parent class failed to initialize" << endreq;
00063         return sc;
00064     }
00065     sc= this->doInitialize();
00066     log << MSG::DEBUG << "initialized @" << (void*)this << endreq;
00067     return sc;
00068 }

StatusCode RootIOCnvSvc::reinitialize (  )  [virtual]

Reimplemented from ConversionSvc.

Definition at line 43 of file RootIOCnvSvc.cc.

00044 {
00045     MsgStream log(msgSvc(), "RootIOCnvSvc");
00046     log << MSG::DEBUG << "reinitializing @" << (void*)this << endreq;
00047     StatusCode sc = ConversionSvc::initialize();
00048     if (sc.isFailure()) {
00049         log << MSG::ERROR << "parent class failed to initialize" << endreq;
00050         return sc;
00051     }
00052     sc= this->doInitialize();
00053     log << MSG::DEBUG << "reinitialized @" << (void*)this << endreq;
00054     return sc;
00055 }

StatusCode RootIOCnvSvc::finalize (  )  [virtual]

Reimplemented from ConversionSvc.

Definition at line 477 of file RootIOCnvSvc.cc.

00478 {
00479     map<string,RootOutputStream*>::iterator it, done = m_outputStreamMap.end();
00480     for (it = m_outputStreamMap.begin(); it != done; ++it) {
00481         bool okay = it->second->close();
00482         if (!okay) {
00483             MsgStream log(msgSvc(), "RootIOCnvSvc");
00484             log << MSG::WARNING
00485                 << "error in closing file for " << it->first
00486                 << endreq;
00487         }            
00488     }
00489     if (m_outputStreamMap.size()) {
00490         RootOutputFileManager::get().setIncidentSvc(0); // trigger a release
00491     }
00492     return ConversionSvc::finalize();
00493 }

StatusCode RootIOCnvSvc::queryInterface ( const InterfaceID riid,
void **  ppint 
) [virtual]

Reimplemented from ConversionSvc.

Definition at line 500 of file RootIOCnvSvc.cc.

00501 {
00502     MsgStream log(msgSvc(), "RootIOCnvSvc");
00503 
00504     if (IID_IRootIOSvc.versionMatch(riid)) {
00505         log << MSG::DEBUG << "queryInterface("<<riid<<") --> (IRootIOSvc*)" 
00506             << (void*)this
00507             << endreq;
00508         *ppint = (IRootIOSvc*)this;
00509     }
00510     else if (IID_IConversionSvc.versionMatch(riid)) {
00511         log << MSG::DEBUG << "queryInterface("<<riid<<") --> (IConversionSvc*)"
00512             << (void*)this
00513             << endreq;        
00514         *ppint = (IConversionSvc*)this;
00515     }
00516     else {
00517         return this->ConversionSvc::queryInterface(riid,ppint);
00518     }
00519     addRef();
00520     return StatusCode::SUCCESS;
00521 }

virtual StatusCode RootIOCnvSvc::createAddress ( long  svc_type,
const CLID clid,
const std::string *  par,
const unsigned long *  ip,
IOpaqueAddress *&  newAddr 
) [virtual]

Create a Generic address using explicit arguments to identify a single object.

Reimplemented from ConversionSvc.

virtual IDataProviderSvc* RootIOCnvSvc::dataSvc (  )  [inline, virtual]

Get the event data provider service.

Implements IRootIOSvc.

Definition at line 63 of file RootIOCnvSvc.h.

00063 { return m_dataSvc; }

virtual IDataManagerSvc* RootIOCnvSvc::dataMgrSvc (  )  [inline, virtual]

Get the event data manager service.

Implements IRootIOSvc.

Definition at line 66 of file RootIOCnvSvc.h.

00066 { return m_dataMgr; }

StatusCode RootIOCnvSvc::createAddress ( DataObject obj,
RootOutputAddress *&  newAddr 
) [virtual]

Extend ConversionSvc interface to create address based on existing DataObject.

Called by RootIOBaseCnv.

Implements IRootIOSvc.

Definition at line 442 of file RootIOCnvSvc.cc.

00443 {
00444     // wangzhe: There is no ObjectReg created for RegistrationSequence
00445     // So there is no ganrantee there is Registry alive for each RegistrationSequence
00446     string tespath;
00447     if(obj->clID()==DayaBay::RegistrationSequence::classID()) {
00448       tespath=DayaBay::RegistrationSequence::defaultLocation();
00449     } else {
00450       tespath = obj->registry()->identifier();
00451     }
00452     // wz
00453 
00454     string filename = m_defaultOutputFilename;
00455     map<string,string>::iterator it = m_outputFileMap.find(tespath);
00456     if (it != m_outputFileMap.end()) 
00457         filename = it->second;
00458 
00459     if ("" == filename) {
00460         MsgStream log(msgSvc(), "RootIOCnvSvc");
00461         static map<string,int> errorMap;
00462         if (!errorMap[tespath]) {
00463             log << MSG::WARNING
00464                 << "Can not create address for " << tespath
00465                 << " no output file specified, I won't tell you again." 
00466                 << endreq;
00467             errorMap[tespath] = 1;
00468         }
00469         return StatusCode::FAILURE;
00470     }
00471 
00472     newAddr = new RootOutputAddress(obj->clID(),tespath);
00473     return StatusCode::SUCCESS;
00474 }

RootOutputStream * RootIOCnvSvc::outputStream ( const RootOutputAddress roa  )  [virtual]

Return a root output stream for the given address (needs clid and tespath filled in).

The current associated output file is set on the stream.

Implements IRootIOSvc.

Definition at line 288 of file RootIOCnvSvc.cc.

00289 {
00290     MsgStream log(msgSvc(), "RootIOCnvSvc");
00291 
00292     const string& filename = this->outputFilename(roa.tespath());
00293     if ("" == filename) {
00294         log << MSG::ERROR << "Bad (empty) output filename, no ouput stream for " 
00295             << roa.tespath() << endreq;
00296         return 0;
00297     }
00298 
00299     RootOutputStream* os = m_outputStreamMap[roa.tespath()];
00300     if (os) {
00301         os->newFile(filename); // noop unless filename differs from old one
00302         log << MSG::DEBUG << "outputStream for " << roa.tespath() 
00303             << " cached, file = " << filename << endreq;
00304         return os;
00305     }
00306 
00307     IConverter*  cnv  = converter(roa.clID());
00308     if (!cnv) {
00309         log << MSG::WARNING
00310             << "Failed to get converter for class ID = " << roa.clID()
00311             << " tespath = " << roa.tespath() << endreq;
00312         return 0;
00313     }
00314 
00315     RootIOBaseCnv* riocnv = dynamic_cast<RootIOBaseCnv*>(cnv);
00316     if (!riocnv) {
00317         log << MSG::WARNING 
00318             << "Converter not a RootIOBaseCnv for class ID = " << roa.clID()
00319             << " tespath = " << roa.tespath() << endreq;
00320         return 0;
00321     }
00322 
00323     os = riocnv->makeOutputStream(roa);
00324     if (!os) {
00325         log << MSG::WARNING
00326             << "Converter failed to make new output stream for class ID = " 
00327             << roa.clID()
00328             << " tespath = " << roa.tespath() << endreq;
00329         return 0;
00330     }
00331 
00332     m_outputStreamMap[roa.tespath()] = os;
00333     os->newFile(filename);
00334     log << MSG::DEBUG << "outputStream for " << roa.tespath() 
00335         << " new, file = " << filename << endreq;
00336     return os;
00337 }

const std::string& RootIOCnvSvc::outputFilename ( const std::string &  tespath  ) 

Get the output filename coresonding to the path.

void RootIOCnvSvc::associateOutput ( const char *  filename,
const char *  streamname 
) [virtual]

Associate an output file name with a stream name.

Implements IRootIOSvc.

Definition at line 276 of file RootIOCnvSvc.cc.

00277 {
00278     m_outputFileMap[streamname] = filename;
00279     if (string("default") == streamname) {
00280         m_defaultOutputFilename = filename;
00281     }
00282 }

IRootIOSvc::FileMap RootIOCnvSvc::fileMap (  )  [virtual]

Implements IRootIOSvc.

Definition at line 283 of file RootIOCnvSvc.cc.

00284 {
00285     return m_outputFileMap;
00286 }

RootInputStream * RootIOCnvSvc::inputStream ( const RootInputAddress ria  )  [virtual]

Return a root input stream for the given address (needs clid and tespath to be filled in).

If newly created the set of associated input files will be set.

Implements IRootIOSvc.

Definition at line 339 of file RootIOCnvSvc.cc.

00340 {
00341     MsgStream log(msgSvc(), "RootIOCnvSvc");
00342 
00343     vector<string> filenames = this->inputFilenames(ria.tespath());
00344     if (0 == filenames.size()) {
00345         log << MSG::DEBUG << "Bad (empty) input filename, no input stream for " 
00346             << ria.tespath() << endreq;
00347         return 0;
00348     }
00349 
00350     RootInputStream* ris = m_inputStreamMap[ria.tespath()];
00351     if (ris) {
00352         log << MSG::DEBUG << "inputStream for " << ria.tespath()
00353             << " cached, files = [";
00354         for (size_t ind=0; ind<filenames.size(); ++ind) {
00355             log << " " << filenames[ind];
00356         }
00357         log << "]" << endreq;
00358         return ris;
00359     }
00360 
00361     IConverter*  cnv  = converter(ria.clID());
00362     if (!cnv) {
00363         log << MSG::WARNING
00364             << "Failed to get converter for class ID = " << ria.clID()
00365             << " tespath = " << ria.tespath() << endreq;
00366         return 0;
00367     }
00368 
00369     RootIOBaseCnv* riocnv = dynamic_cast<RootIOBaseCnv*>(cnv);
00370     if (!riocnv) {
00371         log << MSG::WARNING 
00372             << "Converter not a RootIOBaseCnv for class ID = " << ria.clID()
00373             << " tespath = " << ria.tespath() << endreq;
00374         return 0;
00375     }
00376 
00377     ris = riocnv->makeInputStream(ria);
00378     if (!ris) {
00379         log << MSG::WARNING
00380             << "Converter failed to make new input stream for class ID = " 
00381             << ria.clID()
00382             << " tespath = " << ria.tespath() << endreq;
00383         return 0;
00384     }
00385 
00386     for (size_t ind = 0; ind < filenames.size(); ++ind) {
00387         bool okay = ris->append(filenames[ind]);
00388         if (!okay) {
00389             log << MSG::ERROR
00390                 << "failed to append file " << filenames[ind] << " to input stream for " 
00391                 << ria.tespath() << endreq;
00392             return 0;
00393         }
00394     }
00395 
00396     m_inputStreamMap[ria.tespath()] = ris;
00397 
00398     log << MSG::DEBUG << "inputStream for " << ria.tespath() 
00399         << " new, files = [";
00400     for (size_t ind=0; ind<filenames.size(); ++ind) {
00401         log << " " << filenames[ind];
00402     }
00403     log << "]" << endreq;
00404 
00405     return ris;    
00406 }

InputStreamMap& RootIOCnvSvc::inputStreams (  )  [inline, virtual]

Access the complete set of input streams.

Implements IRootIOSvc.

Definition at line 94 of file RootIOCnvSvc.h.

00094 { return m_inputStreamMap; }

std::vector<std::string> RootIOCnvSvc::inputFilenames ( const std::string &  tespath  ) 

Get the input filename coresponding to the path.

If not explicitly in the map then the map's default entry is used, unless a default was explicitly set then that is returned.

bool RootIOCnvSvc::isReadoutForced (  )  const [virtual]

True if Readout object should be written to output.

Implements IRootIOSvc.

Definition at line 495 of file RootIOCnvSvc.cc.

00496 {
00497     return m_forceReadout;
00498 }

StatusCode RootIOCnvSvc::doInitialize (  )  [protected]

Definition at line 70 of file RootIOCnvSvc.cc.

00071 {
00072     MsgStream log(msgSvc(), "RootIOCnvSvc");
00073 
00074     if (0 == m_defaultInputFilenames.size()  && 0 == m_inputFileMap.size() &&
00075         "" == m_defaultOutputFilename && 0 == m_outputFileMap.size())
00076     {
00077         log << MSG::WARNING 
00078             << "No input nor output files specified.  Why am I here?"
00079             << endreq;
00080         return StatusCode::FAILURE;
00081     }
00082         
00083 
00084     // --- ouput --- //
00085     {                           
00086         map<string,string>::iterator it, done = m_outputFileMap.end();
00087         log << MSG::INFO 
00088             << " default output = \"" << m_defaultOutputFilename << "\""
00089             << " output file map (" << m_outputFileMap.size() << " entries):";
00090         for (it = m_outputFileMap.begin(); it != done; ++it) {
00091             log << "\n\t\"" << it->first << "\" ==> \"" << it->second << "\"";
00092         }
00093         log << endreq;
00094     }
00095     if (m_defaultOutputFilename.size()) { // if set, it should override "default" in map
00096         m_outputFileMap["default"] = m_defaultOutputFilename;
00097     }
00098     else { 
00099         map<string,string>::iterator it = m_outputFileMap.find("default");
00100         if (it == m_outputFileMap.end()) {
00101             log << MSG::WARNING 
00102                 << " no \"default\" output file name specified, "
00103                 "unregistered TES paths will not be saved." << endreq;
00104         }
00105         else {
00106             m_defaultOutputFilename = it->second;
00107         }
00108     }
00109     
00110     // If we have output, configure the output file manager
00111     if (m_outputFileMap.size()) {
00112         IIncidentSvc *incsvc = 0;
00113         StatusCode sc = service("IncidentSvc", incsvc, true);
00114         if(sc.isFailure()){
00115             log << MSG::ERROR << "Unable start IncidentSvc service" 
00116                 << endreq;
00117             return sc;
00118         }
00119         RootOutputFileManager::get().setIncidentSvc(incsvc);
00120 
00121         // make sure we get finalized before IncidentSvc does.
00122         // SmartIF<ISvcManager> mgr(IID_ISvcManager, serviceLocator());
00123         // int pri_inc = mgr->getPriority("IncidentSvc");
00124         // log << MSG::INFO << "Setting my priority to one more than IncidentSvc (" << pri_inc << ")" << endreq;
00125         // mgr->setPriority("RootIOCnvSvc",pri_inc + 1);
00126     }
00127 
00128 
00129     // --- input --- //
00130     {
00131         map<string,vector<string> >::iterator it, done = m_inputFileMap.end();
00132         string defin =  "";
00133         if (m_defaultInputFilenames.size()) defin = m_defaultInputFilenames[0];
00134         log << MSG::INFO
00135             << " default input = \"" << defin << "\""
00136             << " input file map (" << m_inputFileMap.size() << " entries):";
00137         for (it = m_inputFileMap.begin(); it != done; ++it) {
00138             log << "\t" << it->first << " : [";
00139             vector<string>& vec = it->second;
00140             for (size_t ind = 0; ind < vec.size(); ++ind) {
00141                 log << " " << vec[ind];
00142             }
00143             log << "]\n";
00144         }
00145         log << endreq;
00146     }
00147 
00148     if (0 == m_defaultInputFilenames.size()) {
00149         map<string,vector<string> >::iterator it = m_inputFileMap.find("default");
00150         if (it == m_inputFileMap.end()) {
00151             log << MSG::WARNING
00152                 << " no \"default\" input file name specified, "
00153                 "unregistered TES paths will not be saved." << endreq;
00154         }
00155         else {
00156             m_defaultInputFilenames = it->second;
00157         }
00158     }
00159     {
00160         map<string,vector<string> >::iterator it, done = m_inputFileMap.end();
00161         for (it = m_inputFileMap.begin(); it != done; ++it) {
00162             if (it->first == "default") continue;
00163             if (!it->second.size()) {
00164                 log << MSG::WARNING
00165                     << "Skipping input stream with no files: "
00166                     << it->first << endreq;
00167                 continue;
00168             }
00169             initializeInputStream(it->first,it->second);
00170         }
00171         if (m_defaultInputFilenames.size())
00172             initializeInputStream("default",m_defaultInputFilenames);
00173     }
00174     
00175     log << MSG::DEBUG << "Initialized input and output streams." << endreq;
00176 
00177     // Get DataSvc
00178     log << MSG::DEBUG << "Getting " << m_dataSvcName << " as IService" << endreq;
00179     IService* isvc = 0;
00180     StatusCode sc = service(m_dataSvcName, isvc, true);
00181     if(sc.isFailure()){
00182         log << MSG::ERROR << "Unable start EventData service" 
00183             << m_dataSvcName << endreq;
00184         return sc;
00185     }
00186     isvc->addRef();
00187 
00188     log << MSG::DEBUG << "Querying " << m_dataSvcName << " for IID_IDataProviderSvc" << endreq;
00189     sc = isvc->queryInterface(IID_IDataProviderSvc, (void**)&m_dataSvc);
00190     if(sc.isFailure()){
00191         log << MSG::ERROR << "EventData service " << m_dataSvcName 
00192             << "not an IDataProviderSvc" << endreq;
00193         return sc;
00194     }
00195 
00196     log << MSG::DEBUG << "Querying " << m_dataSvcName << " for IID_IDataManagerSvc" << endreq;
00197     sc = isvc->queryInterface(IDataManagerSvc::interfaceID(),
00198                               (void**)(&m_dataMgr));
00199     if (sc.isFailure()) {
00200         log << MSG::ERROR << "EventData service " << m_dataSvcName 
00201             << "not an IDataManagerSvc" << endreq;
00202         return sc;
00203     }
00204 
00205     return StatusCode::SUCCESS;
00206 }

void RootIOCnvSvc::initializeInputStream ( const std::string &  path,
const std::string &  filename 
) [protected]

void RootIOCnvSvc::initializeInputStream ( const std::string &  path,
const std::vector< std::string > &  filename_list 
) [protected]

static const InterfaceID& IRootIOSvc::interfaceID (  )  [inline, static, inherited]

Reimplemented from IInterface.

Definition at line 23 of file IRootIOSvc.h.

00023 { return IID_IRootIOSvc; }


Member Data Documentation

std::map<std::string,std::string> RootIOCnvSvc::m_outputFileMap [protected]

Property: "OutputFileMap": maping of TES path to output filename.

A "path" of "default" can be used to set a file name to use for unregistered paths. The property below will override this.

Definition at line 112 of file RootIOCnvSvc.h.

std::map<std::string,RootOutputStream*> RootIOCnvSvc::m_outputStreamMap [protected]

Definition at line 113 of file RootIOCnvSvc.h.

std::string RootIOCnvSvc::m_defaultOutputFilename [protected]

Property: "DefaultOutput": name of file to use if TES path not found in path.

Definition at line 117 of file RootIOCnvSvc.h.

std::map<std::string,std::vector<std::string> > RootIOCnvSvc::m_inputFileMap [protected]

Property: "InputFileMap": maping of TES path to a list of input filenames.

A "path" of "default" can be used to set a file name to use for unregistered paths. The property below will override this. All trees in default files will be candidates for loading unless their path is explicitly associated with a file.

Definition at line 125 of file RootIOCnvSvc.h.

InputStreamMap RootIOCnvSvc::m_inputStreamMap [protected]

Definition at line 126 of file RootIOCnvSvc.h.

std::vector<std::string> RootIOCnvSvc::m_defaultInputFilenames [protected]

Property: "DefaultInput": list of names of files to use if TES path not found in the InputFileMap.

Definition at line 134 of file RootIOCnvSvc.h.

std::string RootIOCnvSvc::m_dataSvcName [protected]

Property: "EventDataService": name of event data service.

Definition at line 137 of file RootIOCnvSvc.h.

IDataProviderSvc* RootIOCnvSvc::m_dataSvc [protected]

Reimplemented from ConversionSvc.

Definition at line 138 of file RootIOCnvSvc.h.

IDataManagerSvc* RootIOCnvSvc::m_dataMgr [protected]

Definition at line 139 of file RootIOCnvSvc.h.

bool RootIOCnvSvc::m_forceReadout [private]

True if Readout object should be written to output.

Definition at line 145 of file RootIOCnvSvc.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:18:21 2011 for RootIOSvc by doxygen 1.4.7