ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTauCaloHypoTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6 *
7 * NAME: TrigTauCaloHypoTool.cxx
8 * PACKAGE: Trigger/TrigHypothesis/TrigTauHypo
9 *
10 * AUTHORS: P.O. DeViveiros, J.Y. Beaucamp
11 * CREATED: Sometime in early 2015
12 *
13 * DESCRIPTION: Implementation of CaloMVA cuts. Based on the original
14 * TrigTauGenericHypo.
15 *
16 *********************************************************************/
17
21#include "GaudiKernel/SystemOfUnits.h"
22
23#include "TrigTauCaloHypoTool.h"
24
25
26using namespace TrigCompositeUtils;
27
28TrigTauCaloHypoTool::TrigTauCaloHypoTool(const std::string& type, const std::string& name, const IInterface* parent)
29 : base_class(type, name, parent), m_decisionId(HLT::Identifier::fromToolName(name))
30{
31
32}
33
34
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}
45
46
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}
92
93
94StatusCode TrigTauCaloHypoTool::decide(std::vector<ITrigTauJetHypoTool::ToolInfo>& input) const
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}
105
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Header file to be included by clients of the Monitored infrastructure.
bool empty() const noexcept
Returns true if the collection is empty.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< bool > m_acceptAll
HLT::Identifier m_decisionId
Gaudi::Property< float > m_ptMin
virtual StatusCode decide(std::vector< ITrigTauJetHypoTool::ToolInfo > &input) const override
TrigTauCaloHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize() override
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
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.
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".