ATLAS Offline Software
DebugComboHypoTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include <algorithm>
8 #include <cmath>
9 
10 using namespace TrigCompositeUtils;
11 
13  const std::string& name,
14  const IInterface* parent)
16 { }
17 
18 
20  return StatusCode::SUCCESS;
21 }
22 
23 
24 bool DebugComboHypoTool::executeAlg(const std::vector<Combo::LegDecision>& combination) const {
25  ATH_MSG_ALWAYS("Next Combination:");
26  using namespace TrigCompositeUtils;
27  // Passes if *at least one* physics object with pT > 45 MeV is supplied on *each* leg.
28  // NOTE: Chains with only one leg have legMultiplicity().size() == 0
29  std::vector<uint8_t> legPasses(std::max((int) legMultiplicity().size(), 1), 0);
30  for (const Combo::LegDecision& ld : combination) {
31  DecisionID id = ld.first; // Specifies which leg this physics object is being supplied on for this combination
32  ElementLink<DecisionContainer> d = ld.second; // The physics object's navigation Decision Object.
33  ElementLink<xAOD::IParticleContainer> f = (*d)->objectLink<xAOD::IParticleContainer>(featureString()); // The actual physics object itself.
34  ATH_MSG_ALWAYS("-- " << HLT::Identifier(id) << " f:" << f.dataID() << " i:" << f.index() << " pT:" << (*f)->pt());
35  if ((*f)->pt() > 45.0) {
36  const size_t index = (legMultiplicity().size() > 0 ? getIndexFromLeg(id) : 0);
37  legPasses.at( index ) = 1;
38  }
39  }
40  for (const uint8_t pass : legPasses) {
41  if (!pass) {
42  return false;
43  }
44  }
45  return true;
46 }
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition: TrigComposite_v1.h:27
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
index
Definition: index.py:1
hist_file_dump.d
d
Definition: hist_file_dump.py:137
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
DebugComboHypoTool.h
ComboHypoToolBase
Base class for tools which cut on properties of multi-object or multi-leg chains. User should derive ...
Definition: ComboHypoToolBase.h:26
DebugComboHypoTool::executeAlg
bool executeAlg(const std::vector< Combo::LegDecision > &combination) const override
Only a dummy implementation exists in ComboHypoToolBase.
Definition: DebugComboHypoTool.cxx:24
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
ComboHypoToolBase::legMultiplicity
const std::vector< int > & legMultiplicity() const
Gets the number of legs and the multiplicity required on each leg.
Definition: ComboHypoToolBase.h:54
DebugComboHypoTool::initialize
virtual StatusCode initialize() override
Definition: DebugComboHypoTool.cxx:19
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition: AthMsgStreamMacros.h:35
hist_file_dump.f
f
Definition: hist_file_dump.py:135
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
DebugComboHypoTool::DebugComboHypoTool
DebugComboHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: DebugComboHypoTool.cxx:12
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigCompositeUtils::getIndexFromLeg
int32_t getIndexFromLeg(const HLT::Identifier &legIdentifier)
Extract the numeric index of a leg identifier.
Definition: TrigCompositeUtilsRoot.cxx:191
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigCompositeUtils
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:19
geometry_dat_to_json.ld
ld
Definition: geometry_dat_to_json.py:32
TrigRoiDescriptorCollection.h
Combo::LegDecision
std::pair< TrigCompositeUtils::DecisionID, ElementLink< TrigCompositeUtils::DecisionContainer > > LegDecision
LegDecision keeps a given Decision Object associated with a specific leg when being used inside a sin...
Definition: IComboHypoTool.h:33