ATLAS Offline Software
Loading...
Searching...
No Matches
TruthCollectionMakerBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKERBASE_H
6#define DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKERBASE_H
7
8#include <string>
9
11#include "Gaudi/Property.h"
13#include "GaudiKernel/ToolHandle.h"
14#include "GaudiKernel/ServiceHandle.h"
16// Handles and keys
21
22// Forward declarations
23class StoreGateSvc;
24
25namespace DerivationFramework {
26
27 class TruthCollectionMakerBase : public extends<AthAlgTool, IAugmentationTool> {
28 public:
29
30 using base_class::base_class;
31
32 virtual StatusCode initialize() override final;
33 virtual StatusCode finalize() override final;
34 virtual StatusCode addBranches(const EventContext& ctx) const override final;
35 protected:
36 virtual std::vector<int> updateMask(const xAOD::TruthParticleContainer*) const;
37 private:
38 mutable std::atomic<unsigned int> m_ntotpart{};
39 mutable std::atomic<unsigned int> m_npasspart{};
40 // R/W handles
42 {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"};
44 {this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"};
45 // Non-handle properties
46 Gaudi::Property<bool> m_buildingW{this, "BuildingW", false, "Are we building W bosons?"};
47 Gaudi::Property<bool> m_buildingZ{this, "BuildingZ", false, "Are we building Z bosons?"};
48 Gaudi::Property<bool> m_do_compress
49 {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"};
50 Gaudi::Property<bool> m_do_sherpa
51 {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"};
52 Gaudi::Property<bool> m_keep_navigation_info
53 {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"};
54 // Decor handles
56 {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"};
58 {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};
60 {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"};
62 {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
64 {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"};
66 {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"};
68 {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"};
70 {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"};
71
72 // Decorations to be read from elements of the "TruthParticles" container
73 // to be copied onto elements of the output container.
75 {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"};
77 {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"};
79 {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"};
81 {this, "inputClassification", m_particlesKey, "Classification", "Classification code"};
82
83 ServiceHandle<StoreGateSvc> m_metaStore{this, "MetaDataStore", "MetaDataStore"};
84 };
85}
86
87#endif // DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKERBASE_H
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Handle class for recording to StoreGate.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hadronOriginDecoratorKey
virtual std::vector< int > updateMask(const xAOD::TruthParticleContainer *) const
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_linkDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeReadDecorKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeReadDecorKey
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originReadDecorKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
The Athena Transient Store API.
THE reconstruction tool.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.