ATLAS Offline Software
Loading...
Searching...
No Matches
ThinGeantTruthAlg.h
Go to the documentation of this file.
1
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef THINNINGUTILS_ThinGeantTruthAlg_H
8#define THINNINGUTILS_ThinGeantTruthAlg_H
9
13
14// STL includes
15#include <atomic>
16#include <string>
17
18// FrameWork includes
20#include "GaudiKernel/ServiceHandle.h"
21#include "GaudiKernel/ToolHandle.h"
29
31{
32public:
33 using AthReentrantAlgorithm::AthReentrantAlgorithm;
34 virtual StatusCode initialize() override;
35 virtual StatusCode finalize() override;
36 virtual StatusCode execute(const EventContext& ctx) const override final;
37
40 std::vector<bool>&,
41 std::unordered_set<int>&) const;
43 std::vector<bool>&,
44 std::unordered_set<int>&) const;
45
46private:
47 StringProperty m_streamName{ this,
48 "StreamName",
49 "",
50 "Stream for which thinning is to be done." };
51
52 Gaudi::Property<float> m_etaMaxEgTruth{ this,
53 "EtaMaxEGammaTruth",
54 2.525,
55 "Max eta value for e-gamma truth particles" };
56
57 Gaudi::Property<bool> m_keepMuons{ this, "keepMuons", true };
58 Gaudi::Property<bool> m_keepEGamma{ this, "keepEGamma", true };
59
61 Gaudi::Property<std::string> m_truthLinkDecor{this, "TruthLinkDecor", "truthParticleLink"};
64
65 Gaudi::Property<std::vector<int>> m_longlived{
66 this,
67 "LongLivedParticleList",
68 { 310, 3122, 3222, 3112, 3322, 3312 },
69 "List of long lifetime particles which are likely to be decayed by "
70 "Geant but whose children must be kept"
71 };
72
74 this,
75 "TruthParticlesKey",
76 "TruthParticles",
77 "Name of the input Truth Particle container"
78 };
79
81 this,
82 "TruthVerticesKey",
83 "TruthVertices",
84 "Name of the input Truth Vertices container"
85 };
86
88 this,
89 "ElectronsKey",
90 "Electrons",
91 "Name of the input electron container"
92 };
93
95 this,
96 "FwdElectronsKey",
97 "",
98 "Name of the input forward electron container"
99 };
100
102 this,
103 "PhotonsKey",
104 "Photons",
105 "Name of the input photon container"
106 };
107
109 m_muonsKey{ this, "MuonsKey", "Muons", "Name of the input muon container" };
110
112 this,
113 "EGammaTruthKey",
114 "egammaTruthParticles",
115 "Name of the input egammaTruth container"
116 };
117
119 mutable std::atomic<unsigned long> m_nEventsProcessed{};
120 mutable std::atomic<unsigned long> m_nParticlesProcessed{};
121 mutable std::atomic<unsigned long> m_nVerticesProcessed{};
122 mutable std::atomic<unsigned long> m_nParticlesThinned{};
123 mutable std::atomic<unsigned long> m_nVerticesThinned{};
124};
125
126#endif //> !THINNINGUTILS_ThinGeantTruthAlg_H
HandleKey object for adding thinning to an object.
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid from which a ReadHandle is made.
HandleKey object for adding thinning to an object.
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
std::atomic< unsigned long > m_nParticlesThinned
void ancestors(const xAOD::TruthParticle *, std::vector< bool > &, std::unordered_set< int > &) const
Inline method.
std::atomic< unsigned long > m_nVerticesProcessed
std::atomic< unsigned long > m_nVerticesThinned
Gaudi::Property< std::string > m_truthLinkDecor
Truth particle link decorations.
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonsKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_egammaTruthKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ThinningHandleKey< xAOD::TruthVertexContainer > m_truthVerticesKey
StringProperty m_streamName
virtual StatusCode initialize() override
void descendants(const xAOD::TruthParticle *, std::vector< bool > &, std::unordered_set< int > &) const
Gaudi::Property< std::vector< int > > m_longlived
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
std::atomic< unsigned long > m_nEventsProcessed
Counters.
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_readDecorKeys
Schedule the algorithm's dependency on the truth particle link.
virtual StatusCode finalize() override
Gaudi::Property< bool > m_keepMuons
Gaudi::Property< bool > m_keepEGamma
std::atomic< unsigned long > m_nParticlesProcessed
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticlesKey
Gaudi::Property< float > m_etaMaxEgTruth
SG::ReadHandleKey< xAOD::ElectronContainer > m_fwdElectronsKey
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
TruthParticle_v1 TruthParticle
Typedef to implementation.