ATLAS Offline Software
Loading...
Searching...
No Matches
TruthCollectionMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKER_H
6#define DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKER_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// Exprssion evaluator
23
24// Forward declarations
25class StoreGateSvc;
26
27namespace DerivationFramework {
28
29 class TruthCollectionMaker : public extends<ExpressionParserUser<AthAlgTool>, IAugmentationTool> {
30 public:
31
32 using base_class::base_class;
33
34 virtual StatusCode initialize() override final;
35 virtual StatusCode finalize() override final;
36 virtual StatusCode addBranches(const EventContext& ctx) const override final;
37
38 private:
39 mutable std::atomic<unsigned int> m_ntotpart{};
40 mutable std::atomic<unsigned int> m_npasspart{};
41 // R/W handles
43 {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"};
45 {this, "OutputCollectionName", "", "WriteHandleKey for new TruthParticleContainer"};
46 // Non-handle properties
47 Gaudi::Property<std::string> m_partString
48 {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"};
49 Gaudi::Property<bool> m_do_compress
50 {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"};
51 Gaudi::Property<bool> m_do_sherpa
52 {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"};
53 Gaudi::Property<bool> m_keep_navigation_info
54 {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"};
55 // Decor handles
57 {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"};
59 {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};
61 {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"};
63 {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
65 {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"};
67 {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"};
69 {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"};
71 {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"};
72
73 // Decorations to be read from elements of the "TruthParticles" container
74 // to be copied onto elements of the output container.
76 {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"};
78 {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"};
80 {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"};
82 {this, "inputClassification", m_particlesKey, "Classification", "Classification code"};
83
84 ServiceHandle<StoreGateSvc> m_metaStore{this, "MetaDataStore", "MetaDataStore"};
85 };
86}
87
88#endif // DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKER_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.
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
virtual StatusCode finalize() override final
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originReadDecorKey
virtual StatusCode initialize() override final
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
virtual StatusCode addBranches(const EventContext &ctx) const override final
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeReadDecorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_linkDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationReadDecorKey
Gaudi::Property< std::string > m_partString
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hadronOriginDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeReadDecorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
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.