4#ifndef TRUTH_PARENT_DECORATOR_ALG
5#define TRUTH_PARENT_DECORATOR_ALG
20 const std::vector<int>& pids);
22 const std::vector<MatchedParent>& parents)
const;
35 using IPMap = std::map<int, std::set<const xAOD::TruthParticle*>>;
42 virtual StatusCode
execute (
const EventContext&)
const override;
43 virtual StatusCode
finalize ()
override;
48 this,
"targetContainer",
"",
"target container to decorate"
51 this,
"decoratorPrefix",
"parentBoson",
"prefix for decorations"
54 this,
"parentPdgIds", {},
"PDGIDs of allowed parent particles"
57 this,
"cascadePdgIds", {},
"PDGIDs of particles in the decay chain"
60 this,
"addBsToCascade",
false,
"add all bhadrons to cascade"
63 this,
"addCsToCascade",
false,
"add all chadrons to cascade"
66 this,
"vetoSoftLeptonCascade",
false,
67 "veto soft lepton decays from cascade"
70 this,
"vetoSoftCharmCascade",
false,
71 "veto soft charm decays from cascade"
74 this,
"matchDeltaR", -1,
75 "width of delta R cone for matching (zero or less -> infinite)"
78 this,
"parents",
"",
"truth parent container"
81 this,
"cascades", {},
"truth hadron container"
94 this,
"countChildrenInCascadeWithPdgIds", {},
95 "Create one counter for each entry, named by key. Counts children "
96 "with at least one overlapping value in the cascade."
102 this,
"allowMissingChildrenPdgIds", {},
103 "Allow particles matching these PDG IDs to have missing children"
106 this,
"missingChildrenFractionWarningThreshold", 0.01,
107 "Turn the missing children info into a warning above this"
110 this,
"warnMissingChildrenPdgIds", {},
111 "Warn if particles matching these PDF IDs have missing children"
119 this,
"useBarcode",
false,
"use barcode rather than UID"
An algorithm that can be simultaneously executed in multiple threads.
void decorate(const SG::AuxElement &target, const std::vector< MatchedParent > &parents) const
SG::AuxElement::Decorator< unsigned char > m_dec
CascadeCountDecorator(const std::string &name, const std::vector< int > &pids)
void decorateDefault(const SG::AuxElement &target) const
void lock(const xAOD::IParticleContainer *target) const
std::vector< int > m_pids
ElementLink implementation for ROOT usage.
Base class for elements of a container that can have aux data.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide constant type-safe access to aux data.
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.
SG::WriteDecorHandleKeyArray< JC > m_cascade_count_writer_keys
std::map< std::string, std::vector< int > > cascade_counter_property_t
void addTruthContainer(Barcodex &, IPMap &, const TPC &) const
Gaudi::Property< std::unordered_set< int > > m_allow_missing_children_pdgids
Gaudi::Property< bool > m_add_c
Gaudi::Property< bool > m_veto_soft_lepton
Gaudi::Property< bool > m_add_b
SG::WriteDecorHandleKey< JC > m_target_index_key
TruthParentDecoratorAlg(const std::string &name, ISvcLocator *loc)
std::vector< CascadeCountDecorator > m_cascade_count_decorators
SG::WriteDecorHandleKey< JC > m_target_n_matched_key
std::atomic< unsigned long long > m_total_children
Gaudi::Property< bool > m_use_barcode
SG::WriteDecorHandleKey< JC > m_match_children_key
Gaudi::Property< cascade_counter_property_t > m_counts_matching_cascade
SG::WriteDecorHandleKey< JC > m_target_pdgid_key
Gaudi::Property< std::vector< int > > m_cascade_pdgids
Gaudi::Property< std::string > m_prefix
std::map< int, std::set< const xAOD::TruthParticle * > > IPMap
Gaudi::Property< bool > m_veto_soft_charm
SG::ReadHandleKeyArray< TPC > m_cascades_key
SG::WriteDecorHandleKey< JC > m_match_link_key
virtual StatusCode initialize() override
Gaudi::Property< std::vector< int > > m_parent_pdgids
Gaudi::Property< float > m_missing_children_fraction_warning_threshold
SG::WriteDecorHandleKey< JC > m_target_match_mask_key
virtual StatusCode execute(const EventContext &) const override
std::map< int, std::set< int > > Barcodex
SG::WriteDecorHandleKey< JC > m_target_link_key
SG::WriteDecorHandleKey< JC > m_target_dr_truth_key
SG::ReadHandleKey< JC > m_target_container_key
SG::ConstAccessor< int > m_uid
std::atomic< unsigned long long > m_missing_n_warned
SG::WriteDecorHandleKey< JC > m_match_pdgid_key
xAOD::IParticleContainer JC
SG::ReadHandleKey< TPC > m_parents_key
virtual StatusCode finalize() override
Gaudi::Property< std::unordered_set< int > > m_warn_missing_children_pdgids
Gaudi::Property< float > m_match_delta_r
xAOD::TruthParticleContainer TPC
std::atomic< unsigned long long > m_missing_n_ignored
Class providing the definition of the 4-vector interface.
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
size_t auxid_t
Identifier for a particular aux data item.
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.