ATLAS Offline Software
Loading...
Searching...
No Matches
MenuTruthThinning.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// MenuTruthThinning, (c) ATLAS Detector software
8
9#ifndef DERIVATIONFRAMEWORK_MENUTRUTHTHINNINGTOOL_H
10#define DERIVATIONFRAMEWORK_MENUTRUTHTHINNINGTOOL_H
11
12#include <string>
13#include <unordered_set>
14#include <atomic>
15
21#include "GaudiKernel/ToolHandle.h"
23
24
25namespace DerivationFramework {
26
27 class MenuTruthThinning : public extends<AthAlgTool, IThinningTool> {
28 public:
29 MenuTruthThinning(const std::string& t, const std::string& n, const IInterface* p);
30 virtual ~MenuTruthThinning();
31 virtual StatusCode initialize() override;
32 virtual StatusCode finalize() override;
33 virtual StatusCode doThinning() const override;
34
35 bool isAccepted(const xAOD::TruthParticle*) const;
36 bool matchHadronIncTau(const xAOD::TruthParticle* part) const;
37 bool matchQuarkIncTau(const xAOD::TruthParticle* part) const;
38 bool isOrphanIncTau(const xAOD::TruthParticle* part) const;
40 std::vector<int> &targetIDs, std::vector<int> &intermediateIDs,
41 bool targetsAreRange) const;
42 bool isLeptonFromTau(const xAOD::TruthParticle*) const;
44 std::unordered_set<int>& barcode_trace) const;
45 static bool isttHFHadron(const xAOD::TruthParticle*) ;
46 bool isFsrFromLepton(const xAOD::TruthParticle*) const;
47 bool parentIsLongLived(const xAOD::TruthParticle*) const;
48
49
50 private:
51 // THE MENU
52
53 StringProperty m_streamName
54 { this, "StreamName", "", "Name of the stream being thinned" };
56 { this, "ParticlesKey", "TruthParticles", "TruthParticle container name" };
58 { this, "VerticesKey", "TruthVertices", "TruthVertex container name" };
59
62
65
68
71
74
78
81
84
88
91
94
97
100
103
106
109
112
115
118
121
126 bool m_preserveImmediate; // parents, siblings, children only
127 bool m_preserveHadVtx; // hadronization vertices for above
128
130 std::vector<int> m_pdgIdsToKeep;
131
133 std::vector<int> m_longLivedPdgIds;
134
135 // counters
136 mutable std::atomic<unsigned int> m_totpart;
137 mutable std::atomic<unsigned int> m_removedpart;
138 mutable std::atomic<int> m_eventCount{};
139
140 };
141}
142
143#endif // DERIVATIONFRAMEWORK_MENUTRUTHTHINNING_H
HandleKey object for adding thinning to an object.
static bool isttHFHadron(const xAOD::TruthParticle *)
bool matchQuarkIncTau(const xAOD::TruthParticle *part) const
std::atomic< unsigned int > m_removedpart
bool matchGenParticle(const xAOD::TruthParticle *part, std::vector< int > &targetIDs, std::vector< int > &intermediateIDs, bool targetsAreRange) const
std::atomic< unsigned int > m_totpart
float m_geantPhotonPtThresh
Parameter: Write Geant photons with Pt above this threshold.
bool isAccepted(const xAOD::TruthParticle *) const
bool m_writeGeant
Parameter: Keep geant particles?
bool m_writeTauHad
Parameter: Keep hadronic tau decays?
std::vector< int > m_longLivedPdgIds
Parameter: List of PDG IDs of long lived particles so that one can keep their children.
bool m_writeNotPhysical
Parameter: Write particles with status code 3.
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_particlesKey
bool parentIsLongLived(const xAOD::TruthParticle *) const
bool m_writeTopAndDecays
Parameter: Write top and decay products.
bool m_writeBHadrons
Parameter: Keep b-hadrons?
bool m_writeLeptonsNotFromHadrons
Parameter: Write all leptons.
virtual StatusCode finalize() override
bool m_writePartons
Parameter: Keep partons?
bool m_preserveDescendants
Parameter: preserve descendant/ancestor graph completeness.
float m_partonPtThresh
Parameter: Write partons with Pt above this threshold.
bool m_writeEverything
Parameter: Write absolutely everything.
SG::ThinningHandleKey< xAOD::TruthVertexContainer > m_verticesKey
int m_writeFirstN
Parameter: First N particles to write.
bool matchHadronIncTau(const xAOD::TruthParticle *part) const
bool isOrphanIncTau(const xAOD::TruthParticle *part) const
virtual StatusCode doThinning() const override
MenuTruthThinning(const std::string &t, const std::string &n, const IInterface *p)
bool m_writettHFHadrons
Parameter: Write particles for tt+HF classification.
bool m_writeHadrons
Parameter: Keep hadrons?
std::vector< int > m_pdgIdsToKeep
Parameter: List of PDG IDs to always keep.
bool m_writeBSMProducts
Parameter: Write BSM decay products.
bool m_writeBSM
Parameter: Keep BSM particles?
bool m_writeBosons
Parameter: Keep bosons?
bool m_writeAllLeptons
Parameter: Write all leptons.
bool isFsrFromLepton(const xAOD::TruthParticle *) const
virtual StatusCode initialize() override
bool m_writeBosonProducts
Parameter: Write boson decay products.
bool m_writeCHadrons
Parameter: Keep c-hadrons?
bool isLeptonFromTau(const xAOD::TruthParticle *) const
bool isFromTau(const xAOD::TruthParticle *, std::unordered_set< int > &barcode_trace) const
HandleKey object for adding thinning to an object.
THE reconstruction tool.
TruthParticle_v1 TruthParticle
Typedef to implementation.