ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigTauHypo
src
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
18
#include "
AthenaMonitoringKernel/Monitored.h
"
19
#include "
TrigCompositeUtils/TrigCompositeUtils.h
"
20
#include "
xAODTau/TauJetContainer.h
"
21
#include "GaudiKernel/SystemOfUnits.h"
22
23
#include "
TrigTauCaloHypoTool.h
"
24
25
26
using namespace
TrigCompositeUtils
;
27
28
TrigTauCaloHypoTool::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
35
StatusCode
TrigTauCaloHypoTool::initialize
()
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
47
bool
TrigTauCaloHypoTool::decide
(
const
ITrigTauJetHypoTool::ToolInfo
& input)
const
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
94
StatusCode
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
TauJetContainer.h
TrigCompositeUtils.h
TrigTauCaloHypoTool.h
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
Monitored::Group
Group of local monitoring quantities and retain correlation when filling histograms
Definition
MonitoredGroup.h:53
Monitored::Scalar
Declare a monitored scalar variable.
Definition
MonitoredScalar.h:34
TrigTauCaloHypoTool::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition
TrigTauCaloHypoTool.h:49
TrigTauCaloHypoTool::m_acceptAll
Gaudi::Property< bool > m_acceptAll
Definition
TrigTauCaloHypoTool.h:47
TrigTauCaloHypoTool::m_decisionId
HLT::Identifier m_decisionId
Definition
TrigTauCaloHypoTool.h:43
TrigTauCaloHypoTool::m_ptMin
Gaudi::Property< float > m_ptMin
Definition
TrigTauCaloHypoTool.h:45
TrigTauCaloHypoTool::decide
virtual StatusCode decide(std::vector< ITrigTauJetHypoTool::ToolInfo > &input) const override
Definition
TrigTauCaloHypoTool.cxx:94
TrigTauCaloHypoTool::TrigTauCaloHypoTool
TrigTauCaloHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TrigTauCaloHypoTool.cxx:28
TrigTauCaloHypoTool::initialize
virtual StatusCode initialize() override
Definition
TrigTauCaloHypoTool.cxx:35
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition
HLTResultReader.h:26
Identifier
Definition
IdentifierFieldParser.cxx:14
TrigCompositeUtils
Definition
TrigComposite.h:19
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition
TrigCompositeUtilsRoot.cxx:118
TrigCompositeUtils::addDecisionID
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
Definition
TrigCompositeUtilsRoot.cxx:59
xAOD::TauJet
TauJet_v3 TauJet
Definition of the current "tau version".
Definition
TauJet.h:17
xAOD::TauJetContainer
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
Definition
TauJetContainer.h:17
ITrigTauJetHypoTool::ToolInfo
Definition
ITrigTauJetHypoTool.h:23
type
Generated on
for ATLAS Offline Software by
1.17.0