ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
Digitization
MCTruthSimAlgs
src
NewMergeMcEventCollTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MCTRUTHSIMALGS_NEWMERGEMCEVENTCOLLTOOL_H
6
#define MCTRUTHSIMALGS_NEWMERGEMCEVENTCOLLTOOL_H
7
8
#include "Gaudi/Property.h"
9
#include "GaudiKernel/ServiceHandle.h"
10
11
#include "
StoreGate/WriteHandle.h
"
12
#include "
StoreGate/WriteHandleKey.h
"
13
14
#include "
GeneratorObjects/McEventCollection.h
"
15
16
#include "
PileUpTools/PileUpMergeSvc.h
"
17
18
#include "
PileUpTools/PileUpToolBase.h
"
19
24
class
NewMergeMcEventCollTool
:
public
PileUpToolBase
{
25
public
:
26
NewMergeMcEventCollTool
(
const
std::string&
type
,
27
const
std::string& name,
28
const
IInterface* parent);
29
virtual
StatusCode
initialize
()
override
final
;
32
virtual
StatusCode
prepareEvent
(
const
EventContext& ctx,
unsigned
int
nInputEvents)
override
final
;
35
virtual
StatusCode
mergeEvent
(
const
EventContext& ctx)
override
final
;
38
virtual
StatusCode
39
processBunchXing
(
int
/*bunchXing*/
,
40
SubEventIterator
bSubEvents,
41
SubEventIterator
eSubEvents)
override
final
;
42
43
virtual
StatusCode
processAllSubEvents
(
const
EventContext& ctx)
override
final
;
44
45
private
:
46
//** Add the required information from the current GenEvent to the output McEventCollection
47
StatusCode
processEvent
(
const
McEventCollection
*pMcEvtColl,
McEventCollection
*outputMcEventCollection,
int
pileupType,
long
timeOffset=0);
48
//** Print out detailed debug info if required.
49
void
printDetailsOfMergedMcEventCollection
(
McEventCollection
*outputMcEventCollection)
const
;
50
//** Handle for the PileUpMergeSvc (provides input McEventCollections)
51
ServiceHandle<PileUpMergeSvc>
m_pMergeSvc
{
this
,
"PileUpMergeSvc"
,
"PileUpMergeSvc"
,
""
};
52
//** Name of input McEventCollection
53
StringProperty
m_truthCollInputKey
{
this
,
"TruthCollInputKey"
,
"TruthEvent"
,
""
};
54
//** Depends on PileUpTimeEventIndex::PileUpType; provide one instance of this tool for each type
55
Gaudi::Property<int>
m_pileUpType
{
this
,
"PileUpType"
, -1,
""
};
// initialise to PileUpTimeEventIndex::PileUpType::Unknown
56
//** Writing to StoreGate safely in MT
57
SG::WriteHandle<McEventCollection>
m_outputMcEventCollection
{};
58
//** Writing to StoreGate safely in MT
59
SG::WriteHandleKey<McEventCollection>
m_truthCollOutputKey
{
this
,
"TruthCollOutputKey"
,
"TruthEvent"
,
""
};
60
};
61
#endif
//MCTRUTHSIMALGS_NEWMERGEMCEVENTCOLLTOOL_H
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition
IPileUpTool.h:22
McEventCollection.h
PileUpMergeSvc.h
the preferred mechanism to access information from the different event stores in a pileup job.
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
WriteHandle.h
Handle class for recording to StoreGate.
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Definition
McEventCollection.h:31
NewMergeMcEventCollTool::m_truthCollInputKey
StringProperty m_truthCollInputKey
Definition
NewMergeMcEventCollTool.h:53
NewMergeMcEventCollTool::initialize
virtual StatusCode initialize() override final
Definition
NewMergeMcEventCollTool.cxx:15
NewMergeMcEventCollTool::m_outputMcEventCollection
SG::WriteHandle< McEventCollection > m_outputMcEventCollection
Definition
NewMergeMcEventCollTool.h:57
NewMergeMcEventCollTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int nInputEvents) override final
called before the subevts loop.
Definition
NewMergeMcEventCollTool.cxx:24
NewMergeMcEventCollTool::processEvent
StatusCode processEvent(const McEventCollection *pMcEvtColl, McEventCollection *outputMcEventCollection, int pileupType, long timeOffset=0)
Definition
NewMergeMcEventCollTool.cxx:115
NewMergeMcEventCollTool::processBunchXing
virtual StatusCode processBunchXing(int, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
Definition
NewMergeMcEventCollTool.cxx:52
NewMergeMcEventCollTool::NewMergeMcEventCollTool
NewMergeMcEventCollTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
NewMergeMcEventCollTool.cxx:8
NewMergeMcEventCollTool::m_truthCollOutputKey
SG::WriteHandleKey< McEventCollection > m_truthCollOutputKey
Definition
NewMergeMcEventCollTool.h:59
NewMergeMcEventCollTool::m_pMergeSvc
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
Definition
NewMergeMcEventCollTool.h:51
NewMergeMcEventCollTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop.
Definition
NewMergeMcEventCollTool.cxx:72
NewMergeMcEventCollTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Algorithm Approach.
Definition
NewMergeMcEventCollTool.cxx:80
NewMergeMcEventCollTool::printDetailsOfMergedMcEventCollection
void printDetailsOfMergedMcEventCollection(McEventCollection *outputMcEventCollection) const
Definition
NewMergeMcEventCollTool.cxx:144
NewMergeMcEventCollTool::m_pileUpType
Gaudi::Property< int > m_pileUpType
Definition
NewMergeMcEventCollTool.h:55
PileUpToolBase::PileUpToolBase
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PileUpToolBase.cxx:7
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition
StoreGate/StoreGate/WriteHandleKey.h:40
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
ServiceHandle
Definition
ClusterMakerTool.h:36
type
Generated on
for ATLAS Offline Software by
1.17.0