BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
McEventCnv.cxx
Go to the documentation of this file.
1#include "GaudiKernel/MsgStream.h"
2#include "GaudiKernel/StatusCode.h"
3
4#include "EventModel/EventHeader.h"
5
6#include "McAddress.h"
7#include "McCnvSvc.h"
8#include "McEventCnv.h"
9
10// Instantiation of a static factory class used by clients to create
11// instances of this service
12// static CnvFactory<McEventCnv> s_factory;
13// const ICnvFactory& McEventCnvFactory = s_factory;
14
15McEventCnv::McEventCnv( ISvcLocator* svcloc )
16 : Converter( McCnvSvc::storageType(), classID(), svcloc ) {}
17
18StatusCode McEventCnv::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
31
void setRunNumber(int value)
Update run number.
void setEventNumber(int value)
Update event number.
unsigned int eventNumber() const
Definition McAddress.h:39
int runNumber() const
Definition McAddress.h:38
static unsigned char storageType()
storage type
Definition McCnvSvc.cxx:86
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
static unsigned char storageType()
Storage type and class ID.
virtual long repSvcType() const
McEventCnv(ISvcLocator *svcloc)
static const CLID & classID()
Definition McEventCnv.h:29