ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
Digitization
MCTruthSimAlgs
src
SimpleMergeMcEventCollTool.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MCTRUTHSIMALGS_SIMPLEMERGEMCEVENTCOLLTOOL_H
6
#define MCTRUTHSIMALGS_SIMPLEMERGEMCEVENTCOLLTOOL_H
7
8
#include "
PileUpTools/PileUpToolBase.h
"
9
10
#include "Gaudi/Property.h"
11
#include "GaudiKernel/ServiceHandle.h"
12
13
#include <utility>
/* pair */
14
15
class
McEventCollection
;
16
17
#include "
AtlasHepMC/GenParticle_fwd.h
"
18
#include "
AtlasHepMC/GenVertex_fwd.h
"
26
class
SimpleMergeMcEventCollTool
:
public
PileUpToolBase
{
27
public
:
28
SimpleMergeMcEventCollTool
(
const
std::string&
type
,
29
const
std::string& name,
30
const
IInterface* parent);
31
virtual
StatusCode
initialize
()
override
final
;
34
virtual
StatusCode
prepareEvent
(
const
EventContext& ctx,
unsigned
int
nInputEvents)
override
final
;
37
virtual
StatusCode
mergeEvent
(
const
EventContext& ctx)
override
final
;
40
virtual
StatusCode
41
processBunchXing
(
int
/*bunchXing*/
,
42
SubEventIterator
bSubEvents,
43
SubEventIterator
eSubEvents)
override
final
;
46
// virtual bool toProcess(int bunchXing) const;
47
48
virtual
StatusCode
processAllSubEvents
(
const
EventContext& ctx)
override
final
;
49
50
private
:
51
//** Ensure that any GenEvent::HeavyIon info is stored in the signal GenEvent.
52
StatusCode
saveHeavyIonInfo
(
const
McEventCollection
*pMcEvtColl,
McEventCollection
*outputMcEventCollection);
53
//** Add the required information from the current GenEvent to the output McEventCollection
54
StatusCode
processEvent
(
const
McEventCollection
*pMcEvtColl,
McEventCollection
*outputMcEventCollection,
const
int
currentBkgEventIndex,
int
bunchCrossingTime,
int
pileupType);
55
//** Print out detailed debug info if required.
56
void
printDetailsOfMergedMcEventCollection
(
McEventCollection
*outputMcEventCollection)
const
;
57
//** Handle for the PileUpMergeSvc (provides input McEventCollections)
58
ServiceHandle<PileUpMergeSvc>
m_pMergeSvc
{
this
,
"PileUpMergeSvc"
,
"PileUpMergeSvc"
,
""
};
59
StringProperty
m_truthCollOutputKey
{
this
,
"TruthCollOutputKey"
,
"TruthEvent"
,
"Name of output McEventCollection"
};
60
McEventCollection
*
m_outputMcEventCollection
{};
61
//** Name of input McEventCollection
62
StringProperty
m_truthCollInputKey
{
this
,
"TruthCollInputKey"
,
"TruthEvent"
,
""
};
63
//** Override the event numbers to be the current background event index
64
BooleanProperty
m_overrideEventNumbers
{
this
,
"OverrideEventNumbers"
,
false
,
""
};
65
//** Just save the Signal GenEvent
66
BooleanProperty
m_onlySaveSignalTruth
{
this
,
"OnlySaveSignalTruth"
,
false
,
"Just save the Signal GenEvent"
};
67
//** Bool to indicate that the next GenEvent is a new signal event
68
bool
m_newevent
{
true
};
69
//** The total number of GenEvents that will be passed for the current signal event
70
unsigned
int
m_nInputMcEventColls
{0};
71
//** How many background events have been read so far for this signal event
72
unsigned
int
m_nBkgEventsReadSoFar
{0};
73
};
74
#endif
//MCTRUTHSIMALGS_SIMPLEMERGEMCEVENTCOLLTOOL_H
GenParticle_fwd.h
GenVertex_fwd.h
SubEventIterator
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition
IPileUpTool.h:22
PileUpToolBase.h
helper base class IPileUpTool::toProcess().
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
Definition
McEventCollection.h:31
PileUpToolBase::PileUpToolBase
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PileUpToolBase.cxx:7
ServiceHandle
Definition
ClusterMakerTool.h:36
SimpleMergeMcEventCollTool::m_pMergeSvc
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
Definition
SimpleMergeMcEventCollTool.h:58
SimpleMergeMcEventCollTool::initialize
virtual StatusCode initialize() override final
Definition
SimpleMergeMcEventCollTool.cxx:19
SimpleMergeMcEventCollTool::mergeEvent
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop.
Definition
SimpleMergeMcEventCollTool.cxx:77
SimpleMergeMcEventCollTool::m_nBkgEventsReadSoFar
unsigned int m_nBkgEventsReadSoFar
Definition
SimpleMergeMcEventCollTool.h:72
SimpleMergeMcEventCollTool::m_nInputMcEventColls
unsigned int m_nInputMcEventColls
Definition
SimpleMergeMcEventCollTool.h:70
SimpleMergeMcEventCollTool::processAllSubEvents
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
Definition
SimpleMergeMcEventCollTool.cxx:90
SimpleMergeMcEventCollTool::prepareEvent
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int nInputEvents) override final
called before the subevts loop.
Definition
SimpleMergeMcEventCollTool.cxx:29
SimpleMergeMcEventCollTool::m_newevent
bool m_newevent
Definition
SimpleMergeMcEventCollTool.h:68
SimpleMergeMcEventCollTool::SimpleMergeMcEventCollTool
SimpleMergeMcEventCollTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
SimpleMergeMcEventCollTool.cxx:12
SimpleMergeMcEventCollTool::m_outputMcEventCollection
McEventCollection * m_outputMcEventCollection
Definition
SimpleMergeMcEventCollTool.h:60
SimpleMergeMcEventCollTool::saveHeavyIonInfo
StatusCode saveHeavyIonInfo(const McEventCollection *pMcEvtColl, McEventCollection *outputMcEventCollection)
Common methods.
Definition
SimpleMergeMcEventCollTool.cxx:136
SimpleMergeMcEventCollTool::m_truthCollOutputKey
StringProperty m_truthCollOutputKey
Definition
SimpleMergeMcEventCollTool.h:59
SimpleMergeMcEventCollTool::processEvent
StatusCode processEvent(const McEventCollection *pMcEvtColl, McEventCollection *outputMcEventCollection, const int currentBkgEventIndex, int bunchCrossingTime, int pileupType)
Definition
SimpleMergeMcEventCollTool.cxx:148
SimpleMergeMcEventCollTool::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
SimpleMergeMcEventCollTool.cxx:49
SimpleMergeMcEventCollTool::m_overrideEventNumbers
BooleanProperty m_overrideEventNumbers
Definition
SimpleMergeMcEventCollTool.h:64
SimpleMergeMcEventCollTool::printDetailsOfMergedMcEventCollection
void printDetailsOfMergedMcEventCollection(McEventCollection *outputMcEventCollection) const
Definition
SimpleMergeMcEventCollTool.cxx:183
SimpleMergeMcEventCollTool::m_onlySaveSignalTruth
BooleanProperty m_onlySaveSignalTruth
Definition
SimpleMergeMcEventCollTool.h:66
SimpleMergeMcEventCollTool::m_truthCollInputKey
StringProperty m_truthCollInputKey
Definition
SimpleMergeMcEventCollTool.h:62
type
Generated on
for ATLAS Offline Software by
1.17.0