ATLAS Offline Software
Loading...
Searching...
No Matches
McEventCnv.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include "GaudiKernel/StatusCode.h"
11#include "EventInfo/EventInfo.h"
12#include "EventInfo/EventType.h"
13#include "EventInfo/EventID.h"
14// Externals
15
16McEventCnv::McEventCnv(ISvcLocator* svcloc) :
18}
19
20StatusCode
21McEventCnv::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) {
22 McAddress *pMcAddr;
23 EventType* peT = new EventType();
25 peT->set_user_type("McEvent");
26 if ((pMcAddr = dynamic_cast<McAddress*>(pAddr)) &&
27 (pObj = SG::asStorable (new EventInfo(
28 new EventID(pMcAddr->runNumber(),
29 pMcAddr->eventNumber(),
30 pMcAddr->timeStamp(),
31 0,
32 pMcAddr->lumiBlock(),
33 0),
34 peT) ) //owned by EventInfo --> TDS
35 ) )
36 return StatusCode::SUCCESS;
37 else
38 delete peT;
39 return StatusCode::FAILURE;
40}
41
42long
44
45const CLID&
46McEventCnv::classID() { return EventInfo::classID(); }
47
48
49
50
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
This class provides general information about an event.
uint32_t CLID
The Class ID type.
convert to and from a SG storable
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition EventID.h:35
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition EventType.h:92
void set_user_type(const std::string &user_type)
Add user (string) type.
Definition EventType.cxx:57
static const EventTypeCode IS_SIMULATION
true: IS_SIMULATION, false: IS_DATA
Definition EventType.h:156
void add_type(EventTypeCode type_code)
Add a new event type.
Definition EventType.cxx:51
unsigned int timeStamp() const
Definition McAddress.h:50
uint64_t eventNumber() const
Definition McAddress.h:48
unsigned int lumiBlock() const
Definition McAddress.h:49
unsigned int runNumber() const
Definition McAddress.h:47
static long storageType()
storage type
Definition McCnvSvc.cxx:56
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
McEventCnv(ISvcLocator *svcloc)
static const CLID & classID()
static long storageType()
Storage type and class ID.
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)