ATLAS Offline Software
Loading...
Searching...
No Matches
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
41#include "GaudiKernel/ToolHandle.h"
44
45
46namespace 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" };
71 { this, "TruthParticles", "", "truth particle container name" };
73 { this, "TruthVertices", "", "truth vertex container name" };
74
75 // TruthJet parameters
80 float m_isolR;
82
83 // Counters
84 mutable std::atomic<int> m_evtCount{};
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
Property holding a SG store/key/clid from which a ReadHandle is made.
HandleKey object for adding thinning to an object.
virtual StatusCode doThinning() const override
SG::ThinningHandleKey< xAOD::TruthVertexContainer > m_truthVertexName
virtual StatusCode initialize() override
static void printxAODTruth(long long evnum, const xAOD::TruthParticleContainer *truths)
HardTruthThinning(const std::string &t, const std::string &n, const IInterface *p)
SG::ThinningHandleKey< xAOD::TruthParticleContainer > m_truthParticleName
virtual StatusCode finalize() override
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_hardParticleKey
SG::ReadHandleKey< xAOD::JetContainer > m_truthJetsKey
static int getDescendants(const xAOD::TruthParticle *p, std::vector< const xAOD::TruthParticle * > &d)
Property holding a SG store/key/clid from which a ReadHandle is made.
HandleKey object for adding thinning to an object.
THE reconstruction tool.
TruthParticle_v1 TruthParticle
Typedef to implementation.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.