ATLAS Offline Software
Loading...
Searching...
No Matches
MergeTruthParticlesTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MCTRUTHSIMALGS_MERGETRUTHPARTICLESTOOL_H
6#define MCTRUTHSIMALGS_MERGETRUTHPARTICLESTOOL_H
7
9
11
12#include "Gaudi/Property.h"
13#include "GaudiKernel/ServiceHandle.h"
14#include "GaudiKernel/ToolHandle.h"
16#include "GaudiKernel/SystemOfUnits.h"
17
18#include <string>
19
24public:
25 MergeTruthParticlesTool(const std::string& type,
26 const std::string& name,
27 const IInterface* parent);
29 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 processBunchXing(int bunchXing,
39 SubEventIterator bSubEvents,
40 SubEventIterator eSubEvents) override final;
42 virtual StatusCode processAllSubEvents(const EventContext& ctx) override final;
43
44private:
46 virtual StatusCode processTruthParticleContainer(const xAOD::TruthParticleContainer* inputTruthParticleContainer,
47 xAOD::TruthParticleContainer *outputTruthParticleContainer,
48 int eventNumber);
49 StatusCode record(const xAOD::TruthParticleContainer* pTruthParticles, const std::string& truthParticleContainerName) const;
50 ServiceHandle<PileUpMergeSvc> m_pMergeSvc{this, "PileUpMergeSvc", "PileUpMergeSvc", ""};
51 Gaudi::Property<std::string> m_inputTruthParticleCollKey{this, "InputTruthParticleCollKey", "TruthPileupParticles", ""};
52 Gaudi::Property<std::string> m_inTimeOutputTruthParticleCollKey{this, "InTimeOutputTruthParticleCollKey", "TruthPileupParticles", ""};
53 Gaudi::Property<bool> m_includeSignalTruthParticles{this, "IncludeSignalTruthParticles", false, ""};
55 bool m_first_event{true};
56};
57#endif //MCTRUTHSIMALGS_MERGETRUTHPARTICLESTOOL_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().
StatusCode record(const xAOD::TruthParticleContainer *pTruthParticles, const std::string &truthParticleContainerName) const
Gaudi::Property< std::string > m_inTimeOutputTruthParticleCollKey
Gaudi::Property< std::string > m_inputTruthParticleCollKey
virtual StatusCode processTruthParticleContainer(const xAOD::TruthParticleContainer *inputTruthParticleContainer, xAOD::TruthParticleContainer *outputTruthParticleContainer, int eventNumber)
TruthParticleContainer Loop.
virtual StatusCode mergeEvent(const EventContext &ctx) override final
called at the end of the subevts loop.
xAOD::TruthParticleContainer * m_inTimeOutputTruthParticleContainer
virtual StatusCode prepareEvent(const EventContext &ctx, unsigned int nInputEvents) override final
called before the subevts loop.
MergeTruthParticlesTool(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode initialize() override final
Initialize.
ServiceHandle< PileUpMergeSvc > m_pMergeSvc
virtual StatusCode processBunchXing(int bunchXing, SubEventIterator bSubEvents, SubEventIterator eSubEvents) override final
called for each active bunch-crossing to process current SubEvents bunchXing is in ns
virtual StatusCode processAllSubEvents(const EventContext &ctx) override final
Merge the Truth TruthParticleContainers using the PileUpMergeSvc.
Gaudi::Property< bool > m_includeSignalTruthParticles
PileUpToolBase(const std::string &type, const std::string &name, const IInterface *parent)
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.