BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
McEventCnv.cxx
Go to the documentation of this file.
2#include "GaudiKernel/CnvFactory.h"
3#include "GaudiKernel/StatusCode.h"
7
8// Instantiation of a static factory class used by clients to create
9// instances of this service
10//static CnvFactory<McEventCnv> s_factory;
11//const ICnvFactory& McEventCnvFactory = s_factory;
12
13McEventCnv::McEventCnv(ISvcLocator* svcloc) :
14 Converter(McCnvSvc::storageType(), classID(), svcloc) {
15}
16
17StatusCode
18McEventCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) {
19 McAddress *pMcAddr;
20 pMcAddr = dynamic_cast<McAddress*>(pAddr);
21
22 Event::EventHeader *eventHeader = new Event::EventHeader;
23 eventHeader->setEventNumber(pMcAddr->eventNumber());
24 eventHeader->setRunNumber(pMcAddr->runNumber());
25 pObj = eventHeader;
26
27 return StatusCode::SUCCESS;
28}
29
30
31unsigned char McEventCnv::storageType() {
32 return McCnvSvc::storageType();
33}
34
36 return McCnvSvc::storageType();
37}
void setRunNumber(int value)
Update run number.
Definition: EventHeader.h:44
void setEventNumber(int value)
Update event number.
Definition: EventHeader.h:39
unsigned int eventNumber() const
Definition: McAddress.h:41
int runNumber() const
Definition: McAddress.h:40
static unsigned char storageType()
storage type
Definition: McCnvSvc.cxx:90
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Definition: McEventCnv.cxx:18
static unsigned char storageType()
Storage type and class ID.
Definition: McEventCnv.cxx:31
virtual long repSvcType() const
Definition: McEventCnv.cxx:35
McEventCnv(ISvcLocator *svcloc)
Definition: McEventCnv.cxx:13