ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Generators
McEventSelector
src
McEventCnv.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
McEventSelector/McEventCnv.h
"
6
7
#include "GaudiKernel/StatusCode.h"
8
#include "
AthenaKernel/StorableConversions.h
"
9
#include "
McEventSelector/McAddress.h
"
10
#include "
McEventSelector/McCnvSvc.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
20
StatusCode
21
McEventCnv::createObj
(IOpaqueAddress* pAddr, DataObject*& pObj) {
22
McAddress
*pMcAddr;
23
EventType
* peT =
new
EventType
();
24
peT->
add_type
(
EventType::IS_SIMULATION
);
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
43
McEventCnv::storageType
() {
return
McCnvSvc::storageType
(); }
44
45
CLID
46
McEventCnv::classID
() {
return
EventInfo::classID(); }
47
48
49
50
EventID.h
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
EventType.h
This class provides general information about an event.
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
McAddress.h
McCnvSvc.h
McEventCnv.h
StorableConversions.h
convert to and from a SG storable
Converter::Converter
Converter()
Definition
Converter.h:29
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition
EventID.h:35
EventType
This class represents the "type of event" where the type is given by one or more "characteristics".
Definition
EventType.h:92
EventType::set_user_type
void set_user_type(const std::string &user_type)
Add user (string) type.
Definition
EventType.cxx:57
EventType::IS_SIMULATION
static const EventTypeCode IS_SIMULATION
true: IS_SIMULATION, false: IS_DATA
Definition
EventType.h:156
EventType::add_type
void add_type(EventTypeCode type_code)
Add a new event type.
Definition
EventType.cxx:51
McAddress
Definition
McAddress.h:27
McAddress::timeStamp
unsigned int timeStamp() const
Definition
McAddress.h:50
McAddress::eventNumber
uint64_t eventNumber() const
Definition
McAddress.h:48
McAddress::lumiBlock
unsigned int lumiBlock() const
Definition
McAddress.h:49
McAddress::runNumber
unsigned int runNumber() const
Definition
McAddress.h:47
McCnvSvc
Definition
McCnvSvc.h:22
McCnvSvc::storageType
static long storageType()
storage type
Definition
McCnvSvc.cxx:56
McEventCnv::createObj
StatusCode createObj(IOpaqueAddress *pAddr, DataObject *&pObj)
Definition
McEventCnv.cxx:21
McEventCnv::McEventCnv
McEventCnv(ISvcLocator *svcloc)
Definition
McEventCnv.cxx:16
McEventCnv::classID
static CLID classID()
Definition
McEventCnv.cxx:46
McEventCnv::storageType
static long storageType()
Storage type and class ID.
Definition
McEventCnv.cxx:43
EventInfo
Definition
EventInfo.py:1
SG::asStorable
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
Definition
DataObjectSharedPtr.h:31
Generated on
for ATLAS Offline Software by
1.17.0