BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EventCnv.cxx
Go to the documentation of this file.
1// File and Version Information:
2// Description:
3// EventCnv is the concrete converter for the event header on the TDS /Event
4//
5
6#define EventCnv_CXX
7
8#include "GaudiKernel/DataObject.h"
9#include "GaudiKernel/IDataProviderSvc.h"
10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/SmartDataPtr.h"
12
13#include "EventModel/Event.h"
14#include "RootCnvSvc/EventCnv.h"
15#include "RootCnvSvc/RootAddress.h"
16#include "RootCnvSvc/RootCnvSvc.h"
17
18// Instantiation of a static factory class used by clients to create
19// instances of this service
20// static CnvFactory<EventCnv> s_factory;
21// const ICnvFactory& EventCnvFactory = s_factory;
22
23EventCnv::EventCnv( ISvcLocator* svc ) : RootEventBaseCnv( classID(), svc ) {
24 // Here we associate this converter with the /Event path on the TDS.
25 // declareObject("/Event", objType(), "","");
26
27 MsgStream log( msgSvc(), "EventCnv" );
28 log << MSG::DEBUG << "EventCnv::EventCnv()" << endmsg;
29}
30
31StatusCode EventCnv::createObj( IOpaqueAddress* addr, DataObject*& refpObject ) {
32 // Purpose and Method: This converter creates an Event on
33 // the TDS. Registering was already done in GlastEventSelector
34 // Information is dummy as long as no real datafile has been read
35 m_common.clear();
36 MsgStream log( msgSvc(), "EventCnv" );
37 log << MSG::DEBUG << "createObj" << endmsg;
38 Event::EventH* evh = new Event::EventH();
39 refpObject = evh;
40 return StatusCode::SUCCESS;
41}
42
43// StatusCode EventCnv::DataObjectToTObject(DataObject* obj, RootAddress* rootaddr) {
44StatusCode EventCnv::createRep( DataObject* obj, RootAddress* rootaddr ) {
45
46 MsgStream log( msgSvc(), "EventCnv" );
47 log << MSG::DEBUG << "EventCnv::DataObjectToObject" << endmsg;
48
49 Event::EventH* evh = dynamic_cast<Event::EventH*>( obj );
50 if ( !evh )
51 {
52 log << MSG::ERROR << "Could not downcast Event" << endmsg;
53 return StatusCode::FAILURE;
54 }
55 // nothing to do, will be done in lower converters
56 return StatusCode::SUCCESS;
57}
IMessageSvc * msgSvc()
EventCnv(ISvcLocator *svc)
Definition EventCnv.cxx:23
StatusCode createRep(DataObject *obj, RootAddress *addr)
transform from TDS to ROOT
Definition EventCnv.cxx:44
StatusCode createObj(IOpaqueAddress *addr, DataObject *&refpObject)
transform from ROOT to TDS
Definition EventCnv.cxx:31
Definition of a Root address, derived from IOpaqueAddress.
RootEventBaseCnv(const CLID &clid, ISvcLocator *svc)