ATLAS Offline Software
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 
16 McEventCnv::McEventCnv(ISvcLocator* svcloc) :
17  Converter(McCnvSvc::storageType(), EventInfo::classID(), svcloc) {
18 }
19 
21 McEventCnv::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 
42 long
44 
45 const CLID&
47 
48 
49 
50 
McAddress::timeStamp
unsigned int timeStamp() const
Definition: McAddress.h:50
McEventCnv::classID
static const CLID & classID()
Definition: McEventCnv.cxx:46
EventType::add_type
void add_type(EventTypeCode type_code)
Add a new event type.
Definition: EventType.cxx:51
McEventCnv::McEventCnv
McEventCnv(ISvcLocator *svcloc)
Definition: McEventCnv.cxx:16
McAddress::runNumber
unsigned int runNumber() const
Definition: McAddress.h:47
StorableConversions.h
convert to and from a SG storable
EventType
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition: EventType.h:92
McCnvSvc
Definition: McCnvSvc.h:22
EventInfo
EventInfo
Definition: EventTPCnv.cxx:47
SG::asStorable
DataObject * asStorable(T *pObject)
Definition: StorableConversions.h:158
EventType.h
This class provides general information about an event. It extends EventInfo with a list of sub-evts ...
McCnvSvc::storageType
static long storageType()
storage type
Definition: McCnvSvc.cxx:56
EventInfo::classID
static const CLID & classID()
Definition: EventInfo/EventInfo/EventInfo.h:316
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
McAddress
Definition: McAddress.h:27
McAddress::lumiBlock
unsigned int lumiBlock() const
Definition: McAddress.h:49
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
McEventCnv::createObj
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Definition: McEventCnv.cxx:21
McEventCnv::storageType
static long storageType()
Storage type and class ID.
Definition: McEventCnv.cxx:43
McAddress::eventNumber
uint64_t eventNumber() const
Definition: McAddress.h:48
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
EventType::IS_SIMULATION
static const EventTypeCode IS_SIMULATION
true: IS_SIMULATION, false: IS_DATA
Definition: EventType.h:151
McCnvSvc.h
Converter
Definition: Converter.h:27
McEventCnv.h
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:43
EventType::set_user_type
void set_user_type(const std::string &user_type)
Add user (string) type.
Definition: EventType.cxx:57
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventID.h:35
McAddress.h