ATLAS Offline Software
PhysicsAnalysis
DerivationFramework
DerivationFrameworkMCTruth
DerivationFrameworkMCTruth
HardTruthThinning.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// HardTruthThinning, (c) ATLAS Detector software
7
// Author: Frank Paige
8
// Thinning tool to use with CompactHardTruth and truth jets.
9
// Selects:
10
// (1) Stable TruthEvent particles matching HardTruth barcodes.
11
// (2) Constituents of truth jets.
12
// (3) Selected particles (e.g., B's) and their decays.
13
// (4) Stable particles within cone around hard leptons/photons.
14
// Treatment of Geant particles not yet implemented.
15
//
16
// Required parameter Type MCGN2 key
17
// EventInfo EventInfo "EventInfo"
18
// TruthParticles TruthParticleContainer "TruthParticle"
19
// TruthVertices TruthVertexContainer key "TruthVertex"
20
// HardParticles TruthParticleContainer "TruthHardParticle"
21
//
22
// Parameters that turn on features:
23
// JetName If not empty, save constituents with cuts
24
// KeepIds If pdgId list not empty, save particles and decay chains
25
// IsolRadius If positive, save stable particles in isolation cones
26
//
28
29
#ifndef DERIVATIONFRAMEWORK_HARDTRUTHTHINNINGTOOL_H
30
#define DERIVATIONFRAMEWORK_HARDTRUTHTHINNINGTOOL_H
31
32
#include <string>
33
#include <atomic>
34
35
#include "
AthenaBaseComps/AthAlgTool.h
"
36
#include "
DerivationFrameworkInterfaces/IThinningTool.h
"
37
#include "
xAODTruth/TruthParticleContainer.h
"
38
#include "
xAODTruth/TruthVertexContainer.h
"
39
#include "
xAODEventInfo/EventInfo.h
"
40
#include "
xAODJet/JetContainer.h
"
41
#include "GaudiKernel/ToolHandle.h"
42
#include "
StoreGate/ReadHandleKey.h
"
43
#include "
StoreGate/ThinningHandleKey.h
"
44
45
46
namespace
DerivationFramework
{
47
48
class
HardTruthThinning
:
public
extends<AthAlgTool, IThinningTool> {
49
public
:
50
51
HardTruthThinning
(
const
std::string&
t
,
const
std::string&
n
,
const
IInterface*
p
);
52
virtual
~HardTruthThinning
();
53
virtual
StatusCode
initialize
()
override
;
54
virtual
StatusCode
finalize
()
override
;
55
virtual
StatusCode
doThinning
()
const override
;
56
57
static
int
getDescendants
(
const
xAOD::TruthParticle
*
p
,
58
std::vector<const xAOD::TruthParticle*>&
d
) ;
59
static
void
printxAODTruth
(
long
long
evnum,
60
const
xAOD::TruthParticleContainer
* truths) ;
61
62
private
:
63
64
SG::ReadHandleKey<xAOD::EventInfo>
m_eventInfoKey
{
this
,
"EvtInfo"
,
"EventInfo"
,
"EventInfo name"
};
65
SG::ReadHandleKey<xAOD::TruthParticleContainer>
m_hardParticleKey
{
this
,
"HardParticles"
,
""
,
"Hard particle container name"
};
66
SG::ReadHandleKey<xAOD::JetContainer>
m_truthJetsKey
{
this
,
"JetName"
,
""
,
"Truth jet container name"
};
67
68
StringProperty
m_streamName
69
{
this
,
"StreamName"
,
""
,
"Name of the stream being thinned"
};
70
SG::ThinningHandleKey<xAOD::TruthParticleContainer>
m_truthParticleName
71
{
this
,
"TruthParticles"
,
""
,
"truth particle container name"
};
72
SG::ThinningHandleKey<xAOD::TruthVertexContainer>
m_truthVertexName
73
{
this
,
"TruthVertices"
,
""
,
"truth vertex container name"
};
74
75
// TruthJet parameters
76
float
m_jetPtCut
;
77
float
m_jetEtaCut
;
78
float
m_jetConstPtCut
;
79
float
m_jetPhotonPtCut
;
80
float
m_isolR
;
81
float
m_isolPtCut
;
82
83
// Counters
84
mutable
std::atomic<int>
m_evtCount
{};
85
int
m_maxCount
;
86
mutable
std::atomic<int>
m_errCount
{};
87
88
// Special particles to keep (with descendants)
89
std::vector<int>
m_keepIds
;
90
91
};
92
}
//end namespace
93
94
#endif // DERIVATIONFRAMEWORK_HARDTRUTHTHINNING_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
DerivationFramework::HardTruthThinning::m_truthJetsKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetsKey
Definition:
HardTruthThinning.h:66
DerivationFramework::HardTruthThinning::printxAODTruth
static void printxAODTruth(long long evnum, const xAOD::TruthParticleContainer *truths)
Definition:
HardTruthThinning.cxx:417
DerivationFramework::HardTruthThinning::m_isolR
float m_isolR
Definition:
HardTruthThinning.h:80
DerivationFramework::HardTruthThinning::initialize
virtual StatusCode initialize() override
Definition:
HardTruthThinning.cxx:92
SG::ThinningHandleKey
HandleKey object for adding thinning to an object.
Definition:
ThinningHandleKey.h:38
hist_file_dump.d
d
Definition:
hist_file_dump.py:142
TruthVertexContainer.h
TruthParticleContainer.h
DerivationFramework::HardTruthThinning::m_evtCount
std::atomic< int > m_evtCount
Definition:
HardTruthThinning.h:84
IThinningTool.h
DerivationFramework::HardTruthThinning::m_streamName
StringProperty m_streamName
Definition:
HardTruthThinning.h:69
DerivationFramework::HardTruthThinning::getDescendants
static int getDescendants(const xAOD::TruthParticle *p, std::vector< const xAOD::TruthParticle * > &d)
Definition:
HardTruthThinning.cxx:365
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
DerivationFramework::HardTruthThinning::m_errCount
std::atomic< int > m_errCount
Definition:
HardTruthThinning.h:86
SG::ReadHandleKey< xAOD::EventInfo >
DerivationFramework::HardTruthThinning
Definition:
HardTruthThinning.h:48
DerivationFramework::HardTruthThinning::m_jetPhotonPtCut
float m_jetPhotonPtCut
Definition:
HardTruthThinning.h:79
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:209
DerivationFramework::HardTruthThinning::doThinning
virtual StatusCode doThinning() const override
Definition:
HardTruthThinning.cxx:127
beamspotman.n
n
Definition:
beamspotman.py:727
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition:
TruthParticle_v1.h:37
AthAlgTool.h
DerivationFramework::HardTruthThinning::HardTruthThinning
HardTruthThinning(const std::string &t, const std::string &n, const IInterface *p)
Definition:
HardTruthThinning.cxx:42
DerivationFramework
THE reconstruction tool.
Definition:
ParticleSortingAlg.h:24
DataVector
Derived DataVector<T>.
Definition:
DataVector.h:794
DerivationFramework::HardTruthThinning::m_hardParticleKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_hardParticleKey
Definition:
HardTruthThinning.h:65
DerivationFramework::HardTruthThinning::~HardTruthThinning
virtual ~HardTruthThinning()
Definition:
HardTruthThinning.cxx:84
DerivationFramework::HardTruthThinning::m_jetEtaCut
float m_jetEtaCut
Definition:
HardTruthThinning.h:77
DerivationFramework::HardTruthThinning::m_jetPtCut
float m_jetPtCut
Definition:
HardTruthThinning.h:76
DerivationFramework::HardTruthThinning::m_isolPtCut
float m_isolPtCut
Definition:
HardTruthThinning.h:81
EventInfo.h
DerivationFramework::HardTruthThinning::finalize
virtual StatusCode finalize() override
Definition:
HardTruthThinning.cxx:110
JetContainer.h
DerivationFramework::HardTruthThinning::m_truthVertexName
SG::ThinningHandleKey< xAOD::TruthVertexContainer > m_truthVertexName
Definition:
HardTruthThinning.h:73
ThinningHandleKey.h
HandleKey object for adding thinning to an object.
DerivationFramework::HardTruthThinning::m_maxCount
int m_maxCount
Definition:
HardTruthThinning.h:85
DerivationFramework::HardTruthThinning::m_truthParticleName
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticleName
Definition:
HardTruthThinning.h:71
DerivationFramework::HardTruthThinning::m_keepIds
std::vector< int > m_keepIds
Definition:
HardTruthThinning.h:89
DerivationFramework::HardTruthThinning::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition:
HardTruthThinning.h:64
DerivationFramework::HardTruthThinning::m_jetConstPtCut
float m_jetConstPtCut
Definition:
HardTruthThinning.h:78
Generated on Mon Sep 29 2025 21:11:02 for ATLAS Offline Software by
1.8.18