ATLAS Offline Software
Loading...
Searching...
No Matches
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
9
10#include "Gaudi/Property.h"
11#include "GaudiKernel/ServiceHandle.h"
12
13#include <utility> /* pair */
14
16
27public:
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
50private:
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"};
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
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
helper base class IPileUpTool::toProcess().
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
virtual StatusCode initialize() override final
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop.
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
return false if not interested in certain xing times (in ns) implemented by default in PileUpToolBase...
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int nInputEvents) override final
called before the subevts loop.
SimpleMergeMcEventCollTool(const std::string &type, const std::string &name, const IInterface *parent)
McEventCollection * m_outputMcEventCollection
StatusCode saveHeavyIonInfo(const McEventCollection *pMcEvtColl, McEventCollection *outputMcEventCollection)
Common methods.
StatusCode processEvent(const McEventCollection *pMcEvtColl, McEventCollection *outputMcEventCollection, const int currentBkgEventIndex, int bunchCrossingTime, int pileupType)
virtual StatusCode processBunchXing(int, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
void printDetailsOfMergedMcEventCollection(McEventCollection *outputMcEventCollection) const