ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTauCaloHypoTool Class Reference

HLT CaloMVA step TauJet selection hypothesis tools. More...

#include <TrigTauCaloHypoTool.h>

Inheritance diagram for TrigTauCaloHypoTool:
Collaboration diagram for TrigTauCaloHypoTool:

Public Member Functions

 TrigTauCaloHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
virtual StatusCode decide (std::vector< ITrigTauJetHypoTool::ToolInfo > &input) const override
virtual bool decide (const ITrigTauJetHypoTool::ToolInfo &i) const override

Private Attributes

HLT::Identifier m_decisionId
Gaudi::Property< float > m_ptMin {this, "PtMin", 0, "Tau pT minimum cut"}
Gaudi::Property< bool > m_acceptAll {this, "AcceptAll", false, "Ignore selection"}
ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "", "Monitoring tool"}

Detailed Description

HLT CaloMVA step TauJet selection hypothesis tools.

Definition at line 33 of file TrigTauCaloHypoTool.h.

Constructor & Destructor Documentation

◆ TrigTauCaloHypoTool()

TrigTauCaloHypoTool::TrigTauCaloHypoTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 28 of file TrigTauCaloHypoTool.cxx.

29 : base_class(type, name, parent), m_decisionId(HLT::Identifier::fromToolName(name))
30{
31
32}
static HLT::Identifier fromToolName(const std::string &tname)
HLT::Identifier m_decisionId

Member Function Documentation

◆ decide() [1/2]

bool TrigTauCaloHypoTool::decide ( const ITrigTauJetHypoTool::ToolInfo & i) const
overridevirtual

Definition at line 47 of file TrigTauCaloHypoTool.cxx.

48{
49 // Monitoring config
50 auto passedCuts = Monitored::Scalar<unsigned int>("CutCounter", 0);
51 auto pT = Monitored::Scalar<float>("pT", 0);
52 auto mon = Monitored::Group(m_monTool, passedCuts, pT);
53
54
55 // Get TauJet collection
56 const xAOD::TauJetContainer* tauJets = input.tauContainer;
57
58 if(tauJets->empty()){
59 ATH_MSG_DEBUG("No taus in input collection: Rejecting");
60 return false;
61 }
62
63
64 // Tau pass flag
65 bool pass = false;
66
67 if(m_acceptAll) {
68 pass = true;
69 ATH_MSG_DEBUG("AcceptAll property is set: taking all events");
70 }
71
72
73 // There should only be a single TauJet in the container (one TauJet in the view);
74 // just in case we still run the loop
75 for(const xAOD::TauJet* tau : *tauJets) {
76 ATH_MSG_DEBUG(" New HLT TauJet candidate");
77
78 ATH_MSG_DEBUG(" pT: " << tau->pt() / Gaudi::Units::GeV);
79
80 // Evaluate minimum pT cut
81 if(!(tau->pt() > m_ptMin)) continue;
82 passedCuts++;
83 pT = tau->pt() / Gaudi::Units::GeV;
84
85 pass = true;
86
87 ATH_MSG_DEBUG(" Pass hypo tool: " << pass);
88 }
89
90 return pass;
91}
#define ATH_MSG_DEBUG(x)
bool empty() const noexcept
Returns true if the collection is empty.
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< bool > m_acceptAll
Gaudi::Property< float > m_ptMin
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".

◆ decide() [2/2]

StatusCode TrigTauCaloHypoTool::decide ( std::vector< ITrigTauJetHypoTool::ToolInfo > & input) const
overridevirtual

Definition at line 94 of file TrigTauCaloHypoTool.cxx.

95{
96 for(ITrigTauJetHypoTool::ToolInfo& i : input) {
97 if(passed(m_decisionId.numeric(), i.previousDecisionIDs)) {
98 if(decide(i)) {
99 addDecisionID(m_decisionId, i.decision);
100 }
101 }
102 }
103 return StatusCode::SUCCESS;
104}
virtual StatusCode decide(std::vector< ITrigTauJetHypoTool::ToolInfo > &input) const override
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.

◆ initialize()

StatusCode TrigTauCaloHypoTool::initialize ( )
overridevirtual

Definition at line 35 of file TrigTauCaloHypoTool.cxx.

36{
37 if(!m_monTool.empty()) ATH_CHECK(m_monTool.retrieve());
38
39 ATH_MSG_DEBUG("Tool configured for chain/id: " << m_decisionId);
40 ATH_MSG_DEBUG(" - PtMin: " << m_ptMin.value());
41 ATH_MSG_DEBUG(" - AcceptAll: " << m_acceptAll.value());
42
43 return StatusCode::SUCCESS;
44}
#define ATH_CHECK
Evaluate an expression and check for errors.

Member Data Documentation

◆ m_acceptAll

Gaudi::Property<bool> TrigTauCaloHypoTool::m_acceptAll {this, "AcceptAll", false, "Ignore selection"}
private

Definition at line 47 of file TrigTauCaloHypoTool.h.

47{this, "AcceptAll", false, "Ignore selection"};

◆ m_decisionId

HLT::Identifier TrigTauCaloHypoTool::m_decisionId
private

Definition at line 43 of file TrigTauCaloHypoTool.h.

◆ m_monTool

ToolHandle<GenericMonitoringTool> TrigTauCaloHypoTool::m_monTool {this, "MonTool", "", "Monitoring tool"}
private

Definition at line 49 of file TrigTauCaloHypoTool.h.

49{this, "MonTool", "", "Monitoring tool"};

◆ m_ptMin

Gaudi::Property<float> TrigTauCaloHypoTool::m_ptMin {this, "PtMin", 0, "Tau pT minimum cut"}
private

Definition at line 45 of file TrigTauCaloHypoTool.h.

45{this, "PtMin", 0, "Tau pT minimum cut"};

The documentation for this class was generated from the following files: