ATLAS Offline Software
Loading...
Searching...
No Matches
ComboHypoToolBase.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef DECISIONHANDLING_COMBOHYPOTOOLBASE_H
5#define DECISIONHANDLING_COMBOHYPOTOOLBASE_H
6
7// Package includes
9
10// Framework includes
14
15// STL includes
16#include <string>
17#include <vector>
18
25
26class ComboHypoToolBase : public extends<AthAlgTool, IComboHypoTool> {
27
28public:
29 ComboHypoToolBase(const std::string& type, const std::string& name, const IInterface* parent);
30
36 virtual StatusCode decide(Combo::LegDecisionsMap& passingLegs, const EventContext& ctx) const override;
37
41 virtual HLT::Identifier decisionId() const { return m_decisionId; }
42
49 StatusCode setLegMultiplicity(const Combo::MultiplicityReqMap& multiplicityRequiredMap);
50
54 const std::vector<int>& legMultiplicity() const { return m_legMultiplicities; }
55
60 HLT::Identifier legDecisionId(size_t i) const { return m_legDecisionIds.at(i); }
61
66 const std::vector<HLT::Identifier>& legDecisionIds() const { return m_legDecisionIds; }
67
72 virtual StatusCode decideOnSingleObject(TrigCompositeUtils::Decision*, const std::vector<const TrigCompositeUtils::DecisionIDContainer*>&) const;
73
74 protected:
75
82 virtual bool executeAlg(const std::vector<Combo::LegDecision>& combination, const EventContext& ctx) const;
83
88 StatusCode selectLegs(const Combo::LegDecisionsMap& IDCombMap, std::vector<std::vector<Combo::LegDecision>>& leg_decisions) const;
89
94 void updateLegDecisionsMap(const std::vector<std::vector<Combo::LegDecision>>& passing_comb, Combo::LegDecisionsMap & passingLegs) const;
95
99 void eraseFromLegDecisionsMap(Combo::LegDecisionsMap &passingLegs) const;
100
104 void printDebugInformation(const Combo::LegDecisionsMap & passingLegs) const;
105
106 Gaudi::Property<size_t> m_combinationsThresholdWarn {this, "CombinationsThresholdWarn", 1000,
107 "Events processing this many combinations will generate a WARNING message."};
108
109 Gaudi::Property<size_t> m_combinationsThresholdBreak {this, "CombinationsThresholdBreak", 10000,
110 "Events processing this many combinations will generate a second WARNING message, and the loop over combinations will be terminated at this point."};
111
112 Gaudi::Property<bool> m_modeOR {this, "ModeOR", true,
113 "Accepts based on the logical OR over all calls to executeAlg. If this flag is set to false then the logical AND is required instead."};
114
115 Gaudi::Property<bool> m_enableOverride {this, "EnableOverride", false,
116 "Stops processing combinations as soon as a valid combination is found in OR mode, or as soon as an invalid combination is found in AND mode. This is to save CPU."};
117
118 // TODO - add optional write out of the data stored in passingCombinations in the decide function.
119
120private:
121
123 std::vector<HLT::Identifier> m_legDecisionIds;
124 std::vector<int> m_legMultiplicities;
125
126};
127
128#endif // DECISIONHANDLING_COMBOHYPOTOOLBASE_H
const std::vector< int > & legMultiplicity() const
Gets the number of legs and the multiplicity required on each leg.
Gaudi::Property< bool > m_modeOR
HLT::Identifier legDecisionId(size_t i) const
Retrieves this ComboHypoTool's chain's decision ID for a given leg.
virtual bool executeAlg(const std::vector< Combo::LegDecision > &combination, const EventContext &ctx) const
Only a dummy implementation exists in ComboHypoToolBase.
StatusCode selectLegs(const Combo::LegDecisionsMap &IDCombMap, std::vector< std::vector< Combo::LegDecision > > &leg_decisions) const
Creates the per-leg vectors of Decision objects starting from the initial LegDecision map,...
virtual StatusCode decideOnSingleObject(TrigCompositeUtils::Decision *, const std::vector< const TrigCompositeUtils::DecisionIDContainer * > &) const
Alternate method called by BPhysics ComboHypoAlgs instead of the base method decide(....
void printDebugInformation(const Combo::LegDecisionsMap &passingLegs) const
Print the output of the tool, after having removed failed Decision Objects.
Gaudi::Property< size_t > m_combinationsThresholdWarn
void eraseFromLegDecisionsMap(Combo::LegDecisionsMap &passingLegs) const
For when the tool rejects all combinations.
HLT::Identifier m_decisionId
The DecisionID of the chain, obtained from the Tool's name.
ComboHypoToolBase(const std::string &type, const std::string &name, const IInterface *parent)
std::vector< HLT::Identifier > m_legDecisionIds
The DecisionIDs of the individual legs, derived from both m_decisionId and m_legMultiplicities.
Gaudi::Property< size_t > m_combinationsThresholdBreak
virtual HLT::Identifier decisionId() const
retrieves this ComboHypoTool's chain's decision ID
std::vector< int > m_legMultiplicities
The number of legs, and the required multiplicity on each leg.
virtual StatusCode decide(Combo::LegDecisionsMap &passingLegs, const EventContext &ctx) const override
retrieves the decisions associated to this decId, make their combinations and apply the algorithm
const std::vector< HLT::Identifier > & legDecisionIds() const
Retrieves this ComboHypoTool's chain's decision IDs for all legs.
Gaudi::Property< bool > m_enableOverride
void updateLegDecisionsMap(const std::vector< std::vector< Combo::LegDecision > > &passing_comb, Combo::LegDecisionsMap &passingLegs) const
For when the tool accepts some/all combinations.
StatusCode setLegMultiplicity(const Combo::MultiplicityReqMap &multiplicityRequiredMap)
Sets the number of legs and the multiplicity required on each leg.