ATLAS Offline Software
Loading...
Searching...
No Matches
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
13
15
17
19
25public:
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
45private:
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
58 //** Writing to StoreGate safely in MT
59 SG::WriteHandleKey<McEventCollection> m_truthCollOutputKey{this, "TruthCollOutputKey","TruthEvent",""};
60};
61#endif //MCTRUTHSIMALGS_NEWMERGEMCEVENTCOLLTOOL_H
std::vector< xAOD::EventInfo::SubEvent >::const_iterator SubEventIterator
Definition IPileUpTool.h:22
the preferred mechanism to access information from the different event stores in a pileup job.
helper base class IPileUpTool::toProcess().
Property holding a SG store/key/clid from which a WriteHandle is made.
Handle class for recording to StoreGate.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
virtual StatusCode initialize() override final
SG::WriteHandle< McEventCollection > m_outputMcEventCollection
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int nInputEvents) override final
called before the subevts loop.
StatusCode processEvent(const McEventCollection *pMcEvtColl, McEventCollection *outputMcEventCollection, int pileupType, long timeOffset=0)
virtual StatusCode processBunchXing(int, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
NewMergeMcEventCollTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::WriteHandleKey< McEventCollection > m_truthCollOutputKey
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop.
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Algorithm Approach.
void printDetailsOfMergedMcEventCollection(McEventCollection *outputMcEventCollection) const
Gaudi::Property< int > m_pileUpType
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Property holding a SG store/key/clid from which a WriteHandle is made.