ATLAS Offline Software
Loading...
Searching...
No Matches
DebugComboHypoTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
7#include <algorithm>
8#include <cmath>
9
10using namespace TrigCompositeUtils;
11
13 const std::string& name,
14 const IInterface* parent)
15 : ComboHypoToolBase(type, name, parent)
16{ }
17
18
20 return StatusCode::SUCCESS;
21}
22
23
24bool DebugComboHypoTool::executeAlg(const std::vector<Combo::LegDecision>& combination,
25 const EventContext& /*ctx*/) const {
26 ATH_MSG_ALWAYS("Next Combination:");
27 using namespace TrigCompositeUtils;
28 // Passes if *at least one* physics object with pT > 45 MeV is supplied on *each* leg.
29 // NOTE: Chains with only one leg have legMultiplicity().size() == 0
30 std::vector<uint8_t> legPasses(std::max((int) legMultiplicity().size(), 1), 0);
31 for (const Combo::LegDecision& ld : combination) {
32 DecisionID id = ld.first; // Specifies which leg this physics object is being supplied on for this combination
33 ElementLink<DecisionContainer> d = ld.second; // The physics object's navigation Decision Object.
34 ElementLink<xAOD::IParticleContainer> f = (*d)->objectLink<xAOD::IParticleContainer>(featureString()); // The actual physics object itself.
35 ATH_MSG_ALWAYS("-- " << HLT::Identifier(id) << " f:" << f.dataID() << " i:" << f.index() << " pT:" << (*f)->pt());
36 if ((*f)->pt() > 45.0) {
37 const size_t index = (legMultiplicity().size() > 0 ? getIndexFromLeg(id) : 0);
38 legPasses.at( index ) = 1;
39 }
40 }
41 for (const uint8_t pass : legPasses) {
42 if (!pass) {
43 return false;
44 }
45 }
46 return true;
47}
#define ATH_MSG_ALWAYS(x)
const std::vector< int > & legMultiplicity() const
Gets the number of legs and the multiplicity required on each leg.
ComboHypoToolBase(const std::string &type, const std::string &name, const IInterface *parent)
bool executeAlg(const std::vector< Combo::LegDecision > &combination, const EventContext &ctx) const override
Only a dummy implementation exists in ComboHypoToolBase.
DebugComboHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
unsigned int DecisionID
const std::string & featureString()
int32_t getIndexFromLeg(const HLT::Identifier &legIdentifier)
Extract the numeric index of a leg identifier.
Definition index.py:1
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.