ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ThinningUtils
src
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
19
#include "
AthenaBaseComps/AthReentrantAlgorithm.h
"
20
#include "GaudiKernel/ServiceHandle.h"
21
#include "GaudiKernel/ToolHandle.h"
22
#include "
StoreGate/ThinningHandleKey.h
"
23
#include "
xAODEgamma/ElectronContainer.h
"
24
#include "
xAODEgamma/PhotonContainer.h
"
25
#include "
xAODMuon/MuonContainer.h
"
26
#include "
xAODTruth/TruthParticleContainer.h
"
27
#include "
xAODTruth/TruthVertexContainer.h
"
28
#include "
StoreGate/ReadDecorHandleKeyArray.h
"
29
30
class
ThinGeantTruthAlg
final:
public
AthReentrantAlgorithm
31
{
32
public
:
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
39
void
ancestors
(
const
xAOD::TruthParticle
*,
40
std::vector<bool>&,
41
std::unordered_set<int>&)
const
;
42
void
descendants
(
const
xAOD::TruthParticle
*,
43
std::vector<bool>&,
44
std::unordered_set<int>&)
const
;
45
46
private
:
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"
};
63
SG::ReadDecorHandleKeyArray<xAOD::IParticleContainer>
m_readDecorKeys
{
this
,
"DecorKeys"
, {}};
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
73
SG::ThinningHandleKey<xAOD::TruthParticleContainer>
m_truthParticlesKey
{
74
this
,
75
"TruthParticlesKey"
,
76
"TruthParticles"
,
77
"Name of the input Truth Particle container"
78
};
79
80
SG::ThinningHandleKey<xAOD::TruthVertexContainer>
m_truthVerticesKey
{
81
this
,
82
"TruthVerticesKey"
,
83
"TruthVertices"
,
84
"Name of the input Truth Vertices container"
85
};
86
87
SG::ReadHandleKey<xAOD::ElectronContainer>
m_electronsKey
{
88
this
,
89
"ElectronsKey"
,
90
"Electrons"
,
91
"Name of the input electron container"
92
};
93
94
SG::ReadHandleKey<xAOD::ElectronContainer>
m_fwdElectronsKey
{
95
this
,
96
"FwdElectronsKey"
,
97
""
,
98
"Name of the input forward electron container"
99
};
100
101
SG::ReadHandleKey<xAOD::PhotonContainer>
m_photonsKey
{
102
this
,
103
"PhotonsKey"
,
104
"Photons"
,
105
"Name of the input photon container"
106
};
107
108
SG::ReadHandleKey<xAOD::MuonContainer>
109
m_muonsKey
{
this
,
"MuonsKey"
,
"Muons"
,
"Name of the input muon container"
};
110
111
SG::ReadHandleKey<xAOD::TruthParticleContainer>
m_egammaTruthKey
{
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
AthReentrantAlgorithm.h
ElectronContainer.h
PhotonContainer.h
MuonContainer.h
TruthParticleContainer.h
ReadDecorHandleKeyArray.h
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
TruthVertexContainer.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition
StoreGate/StoreGate/ReadHandleKey.h:40
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition
ThinningHandleKey.h:39
ThinGeantTruthAlg
Definition
ThinGeantTruthAlg.h:31
ThinGeantTruthAlg::m_muonsKey
SG::ReadHandleKey< xAOD::MuonContainer > m_muonsKey
Definition
ThinGeantTruthAlg.h:109
ThinGeantTruthAlg::m_nParticlesThinned
std::atomic< unsigned long > m_nParticlesThinned
Definition
ThinGeantTruthAlg.h:122
ThinGeantTruthAlg::ancestors
void ancestors(const xAOD::TruthParticle *, std::vector< bool > &, std::unordered_set< int > &) const
Inline method.
Definition
ThinGeantTruthAlg.cxx:331
ThinGeantTruthAlg::m_nVerticesProcessed
std::atomic< unsigned long > m_nVerticesProcessed
Definition
ThinGeantTruthAlg.h:121
ThinGeantTruthAlg::m_nVerticesThinned
std::atomic< unsigned long > m_nVerticesThinned
Definition
ThinGeantTruthAlg.h:123
ThinGeantTruthAlg::m_truthLinkDecor
Gaudi::Property< std::string > m_truthLinkDecor
Truth particle link decorations.
Definition
ThinGeantTruthAlg.h:61
ThinGeantTruthAlg::m_photonsKey
SG::ReadHandleKey< xAOD::PhotonContainer > m_photonsKey
Definition
ThinGeantTruthAlg.h:101
ThinGeantTruthAlg::m_egammaTruthKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_egammaTruthKey
Definition
ThinGeantTruthAlg.h:111
ThinGeantTruthAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition
ThinGeantTruthAlg.cxx:85
ThinGeantTruthAlg::m_truthVerticesKey
SG::ThinningHandleKey< xAOD::TruthVertexContainer > m_truthVerticesKey
Definition
ThinGeantTruthAlg.h:80
ThinGeantTruthAlg::m_streamName
StringProperty m_streamName
Definition
ThinGeantTruthAlg.h:47
ThinGeantTruthAlg::initialize
virtual StatusCode initialize() override
Definition
ThinGeantTruthAlg.cxx:41
ThinGeantTruthAlg::descendants
void descendants(const xAOD::TruthParticle *, std::vector< bool > &, std::unordered_set< int > &) const
Definition
ThinGeantTruthAlg.cxx:366
ThinGeantTruthAlg::m_longlived
Gaudi::Property< std::vector< int > > m_longlived
Definition
ThinGeantTruthAlg.h:65
ThinGeantTruthAlg::m_electronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_electronsKey
Definition
ThinGeantTruthAlg.h:87
ThinGeantTruthAlg::m_nEventsProcessed
std::atomic< unsigned long > m_nEventsProcessed
Counters.
Definition
ThinGeantTruthAlg.h:119
ThinGeantTruthAlg::m_readDecorKeys
SG::ReadDecorHandleKeyArray< xAOD::IParticleContainer > m_readDecorKeys
Schedule the algorithm's dependency on the truth particle link.
Definition
ThinGeantTruthAlg.h:63
ThinGeantTruthAlg::finalize
virtual StatusCode finalize() override
Definition
ThinGeantTruthAlg.cxx:73
ThinGeantTruthAlg::m_keepMuons
Gaudi::Property< bool > m_keepMuons
Definition
ThinGeantTruthAlg.h:57
ThinGeantTruthAlg::m_keepEGamma
Gaudi::Property< bool > m_keepEGamma
Definition
ThinGeantTruthAlg.h:58
ThinGeantTruthAlg::m_nParticlesProcessed
std::atomic< unsigned long > m_nParticlesProcessed
Definition
ThinGeantTruthAlg.h:120
ThinGeantTruthAlg::m_truthParticlesKey
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticlesKey
Definition
ThinGeantTruthAlg.h:73
ThinGeantTruthAlg::m_etaMaxEgTruth
Gaudi::Property< float > m_etaMaxEgTruth
Definition
ThinGeantTruthAlg.h:52
ThinGeantTruthAlg::m_fwdElectronsKey
SG::ReadHandleKey< xAOD::ElectronContainer > m_fwdElectronsKey
Definition
ThinGeantTruthAlg.h:94
SG::ReadDecorHandleKeyArray
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
Definition
StoreGate/StoreGate/ReadDecorHandleKeyArray.h:35
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
Generated on
for ATLAS Offline Software by
1.17.0