CGEM BOSS 6.6.5.h
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/IDataProviderSvc.h"
9#include "GaudiKernel/SmartDataPtr.h"
10#include "GaudiKernel/MsgStream.h"
11#include "GaudiKernel/DataObject.h"
12
13#include "EventModel/Event.h"
14#include "RootCnvSvc/EventCnv.h"
17
18
19// Instantiation of a static factory class used by clients to create
20// instances of this service
21//static CnvFactory<EventCnv> s_factory;
22//const ICnvFactory& EventCnvFactory = s_factory;
23
24EventCnv::EventCnv(ISvcLocator* svc)
25: RootEventBaseCnv(classID(), svc)
26{
27// Here we associate this converter with the /Event path on the TDS.
28 //declareObject("/Event", objType(), "","");
29
30
31 MsgStream log(msgSvc(), "EventCnv");
32 log << MSG::DEBUG << "EventCnv::EventCnv()" << endreq;
33}
34
35StatusCode EventCnv::createObj(IOpaqueAddress *addr, DataObject*& refpObject) {
36 // Purpose and Method: This converter creates an Event on
37 // the TDS. Registering was already done in GlastEventSelector
38 // Information is dummy as long as no real datafile has been read
40 MsgStream log(msgSvc(), "EventCnv");
41 log << MSG::DEBUG << "createObj" << endreq;
42 Event::EventH * evh = new Event::EventH();
43 refpObject=evh;
44 return StatusCode::SUCCESS;
45}
46
47
48//StatusCode EventCnv::DataObjectToTObject(DataObject* obj, RootAddress* rootaddr) {
49StatusCode EventCnv::createRep(DataObject* obj, RootAddress* rootaddr) {
50
51 MsgStream log(msgSvc(), "EventCnv");
52 log << MSG::DEBUG << "EventCnv::DataObjectToObject" << endreq;
53
54 Event::EventH * evh=dynamic_cast<Event::EventH *> (obj);
55 if (!evh) {
56 log << MSG::ERROR << "Could not downcast Event" << endreq;
57 return StatusCode::FAILURE;
58 }
59 // nothing to do, will be done in lower converters
60 return StatusCode::SUCCESS;
61}
62
63
64
65
66
67
68
69
70
71
72
73
74
75
IMessageSvc * msgSvc()
EventCnv(ISvcLocator *svc)
Definition EventCnv.cxx:24
StatusCode createRep(DataObject *obj, RootAddress *addr)
transform from TDS to ROOT
Definition EventCnv.cxx:49
StatusCode createObj(IOpaqueAddress *addr, DataObject *&refpObject)
transform from ROOT to TDS
Definition EventCnv.cxx:35
commonData m_common
Definition EventCnv.h:49
Definition of a Root address, derived from IOpaqueAddress.
Definition RootAddress.h:21
Base class for all Root Converters.