ATLAS Offline Software
TrigJetHypoTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGJETHYPOTOOL_H
6 #define TRIGJETHYPOTOOL_H
7 /********************************************************************
8  *
9  * NAME: TrigJetHypoTool.h
10  * PACKAGE: Trigger/TrigHypothesis/TrigHLTJetHypo
11  *
12  *
13  *********************************************************************/
14 
15 
20 
22 
24 #include "xAODJet/JetContainer.h"
25 
26 #include <string>
27 #include <optional>
28 
30 
31 public:
32 
33  TrigJetHypoTool(const std::string& type,
34  const std::string& name,
35  const IInterface* parent);
36 
40 
41  // typedef for passing jet - decision object assocation
42  using JetDecision = std::pair<const xAOD::Jet*,TrigCompositeUtils::Decision*>;
43 
46  const TrigCompositeUtils::DecisionIDContainer& previousDecisionIDs,
47  std::vector<JetDecision>& jetHypoInputs) const;
48 
49  const HLT::Identifier& getID(std::size_t) const;
50  const std::vector<HLT::Identifier>& getIDs() const;
51 
52  private:
53 
54  // Identifies is used to keep track of which tool made which decision.
55  // The information is stored in the event store.
56  // There will be as many entries in the IDs vector as there are chain parts.
57  // Howver, the zeroth entry is calculated differently for one and multi
58  // chain part chains.
59 
60  // single chainpart ID, claculated from name of Algorithm
61  // use this to determine whether the hypo should run.
63 
64  //single and Multi chaionpart IDs
65  // if single chain part then single entry, same as m_desionId
66  // else one entry per chain part. the zeroth welement is calculated
67  // using m_decisionID and the chain part index = 0
68  // use these IDs to report participating jets "by leg"
69  std::vector<HLT::Identifier> m_decisionIDs{};
70 
71  ToolHandle<ITrigJetHypoToolHelper> m_helper {
72  this, "helper_tool", {}, "Jet hypo helper AlgTool"};
73 
74  Gaudi::Property<std::size_t> m_startLabelIndex { // no of chain parts + 1
75  this, "startLabelIndex", {0}, "start value for leg indices"};
76 
77  Gaudi::Property<std::size_t> m_endLabelIndex { // no of chain parts + 1
78  this, "endLabelIndex", {0}, "end value for leg indices"};
79 
80  Gaudi::Property<bool> m_visitDebug {
81  this, "visit_debug", false, "debug flag"};
82 
83  Gaudi::Property<std::string> m_chainName {
84  this, "chain_name", {}, "chain name"};
85 
86 
87  mutable std::atomic<size_t> m_id = 0;
88 
89  ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"};
90 
93  const std::unique_ptr<ITrigJetHypoInfoCollector>&) const;
94 
97  const std::vector<JetDecision>& jetHypoInputs) const;
98 
100  reportLeg(const std::vector<const xAOD::Jet*>& jets,
101  const std::vector<JetDecision>& jetHypoInputs,
102  int legInd) const;
103 
104  bool
105  inputJetParticipates(const std::vector<const xAOD::Jet*>& jets,
106  const JetDecision& pair) const;
107 
108 };
109 #endif
TrigJetHypoTool::m_endLabelIndex
Gaudi::Property< std::size_t > m_endLabelIndex
Definition: TrigJetHypoTool.h:83
TrigJetHypoTool::m_decisionID
HLT::Identifier m_decisionID
Definition: TrigJetHypoTool.h:68
TrigJetHypoTool::TrigJetHypoTool
TrigJetHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: TrigJetHypoTool.cxx:37
TrigJetHypoTool::getID
const HLT::Identifier & getID(std::size_t) const
Definition: TrigJetHypoTool.cxx:226
TrigJetHypoTool::m_visitDebug
Gaudi::Property< bool > m_visitDebug
Definition: TrigJetHypoTool.h:86
TrigCompositeUtils.h
GenericMonitoringTool.h
TrigJetHypoTool::m_startLabelIndex
Gaudi::Property< std::size_t > m_startLabelIndex
Definition: TrigJetHypoTool.h:80
TrigJetHypoTool::reportLeg
StatusCode reportLeg(const std::vector< const xAOD::Jet * > &jets, const std::vector< JetDecision > &jetHypoInputs, int legInd) const
Definition: TrigJetHypoTool.cxx:297
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigJetHypoTool::getIDs
const std::vector< HLT::Identifier > & getIDs() const
Definition: TrigJetHypoTool.cxx:221
AthAlgTool.h
TrigJetHypoTool::m_decisionIDs
std::vector< HLT::Identifier > m_decisionIDs
Definition: TrigJetHypoTool.h:75
TrigJetHypoTool::initialize
StatusCode initialize()
Definition: TrigJetHypoTool.cxx:49
TrigJetHypoTool::decide
StatusCode decide(const xAOD::JetContainer *jets, const TrigCompositeUtils::DecisionIDContainer &previousDecisionIDs, std::vector< JetDecision > &jetHypoInputs) const
Definition: TrigJetHypoTool.cxx:100
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigJetHypoTool::checkPassingJets
StatusCode checkPassingJets(const xAODJetCollector &, const std::unique_ptr< ITrigJetHypoInfoCollector > &) const
Definition: TrigJetHypoTool.cxx:232
TrigJetHypoTool::m_id
std::atomic< size_t > m_id
Definition: TrigJetHypoTool.h:93
TrigJetHypoTool::m_chainName
Gaudi::Property< std::string > m_chainName
Definition: TrigJetHypoTool.h:89
TrigJetHypoTool
Definition: TrigJetHypoTool.h:29
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
HLT::Identifier
Definition: TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:20
TrigJetHypoTool::reportPassingJets
StatusCode reportPassingJets(const xAODJetCollector &, const std::vector< JetDecision > &jetHypoInputs) const
Definition: TrigJetHypoTool.cxx:281
TrigJetHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: TrigJetHypoTool.h:95
ITrigJetHypoToolHelper.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigJetHypoTool::~TrigJetHypoTool
~TrigJetHypoTool()
Definition: TrigJetHypoTool.cxx:46
xAODJetCollector
Definition: xAODJetCollector.h:20
TrigJetHypoTool::JetDecision
std::pair< const xAOD::Jet *, TrigCompositeUtils::Decision * > JetDecision
Definition: TrigJetHypoTool.h:48
EventInfo.h
TrigJetHypoTool::finalize
StatusCode finalize()
Definition: TrigJetHypoTool.cxx:94
TrigJetHypoTool::m_helper
ToolHandle< ITrigJetHypoToolHelper > m_helper
Definition: TrigJetHypoTool.h:77
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
JetContainer.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
HLTIdentifier.h
TrigJetHypoTool::inputJetParticipates
bool inputJetParticipates(const std::vector< const xAOD::Jet * > &jets, const JetDecision &pair) const
Definition: TrigJetHypoTool.cxx:325
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
AthAlgTool
Definition: AthAlgTool.h:26