/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Event/RootCnvSvc/RootCnvSvc-02-01-12/src/EventCnv.cxx

Go to the documentation of this file.
00001 // File and Version Information:
00002 // Description:
00003 //      EventCnv is the concrete converter for the event header on the TDS /Event
00004 //
00005 
00006 #define EventCnv_CXX 
00007 
00008 #include "GaudiKernel/IDataProviderSvc.h"
00009 #include "GaudiKernel/SmartDataPtr.h"
00010 #include "GaudiKernel/MsgStream.h"
00011 #include "GaudiKernel/DataObject.h"
00012 
00013 #include "EventModel/Event.h"
00014 #include "RootCnvSvc/EventCnv.h"
00015 #include "RootCnvSvc/RootCnvSvc.h"
00016 #include "RootCnvSvc/RootAddress.h"
00017 
00018 
00019 // Instantiation of a static factory class used by clients to create
00020 // instances of this service
00021 //static CnvFactory<EventCnv> s_factory;
00022 //const ICnvFactory& EventCnvFactory = s_factory;
00023 
00024 EventCnv::EventCnv(ISvcLocator* svc)
00025 : RootEventBaseCnv(classID(), svc)
00026 {
00027 // Here we associate this converter with the /Event path on the TDS.
00028   //declareObject("/Event", objType(), "","");
00029 
00030 
00031     MsgStream log(msgSvc(), "EventCnv");
00032     log << MSG::DEBUG << "EventCnv::EventCnv()" << endreq;
00033 }
00034 
00035 StatusCode EventCnv::createObj(IOpaqueAddress *addr, DataObject*& refpObject) {
00036     // Purpose and Method:  This converter creates an  Event on
00037     // the TDS. Registering was already done in GlastEventSelector
00038     // Information is dummy as long as no real datafile has been read
00039     m_common.clear();
00040     MsgStream log(msgSvc(), "EventCnv");
00041     log << MSG::DEBUG << "createObj" << endreq;
00042     Event::EventH * evh = new Event::EventH();
00043     refpObject=evh;
00044     return StatusCode::SUCCESS;
00045 }
00046 
00047 
00048 //StatusCode EventCnv::DataObjectToTObject(DataObject* obj, RootAddress* rootaddr) {
00049 StatusCode EventCnv::createRep(DataObject* obj, RootAddress* rootaddr) {
00050 
00051   MsgStream log(msgSvc(), "EventCnv");
00052   log << MSG::DEBUG << "EventCnv::DataObjectToObject" << endreq;
00053 
00054   Event::EventH * evh=dynamic_cast<Event::EventH *> (obj);
00055   if (!evh) {
00056        log << MSG::ERROR << "Could not downcast Event" << endreq;
00057        return StatusCode::FAILURE;
00058   }
00059   // nothing to do, will be done in lower converters
00060   return StatusCode::SUCCESS;
00061 }
00062 
00063 
00064 
00065 
00066 
00067 
00068 
00069 
00070 
00071 
00072 
00073 
00074 
00075 

Generated on Tue Nov 29 22:58:41 2016 for BOSS_7.0.2 by  doxygen 1.4.7