ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
DiTauRec
src
DiTauWPDecorator.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
#include "
DiTauRec/DiTauWPDecorator.h
"
6
7
//=================================PUBLIC-PART==================================
8
//______________________________________________________________________________
9
DiTauWPDecorator::DiTauWPDecorator
(
const
std::string&
type
,
const
std::string& name,
const
IInterface * parent) :
10
DiTauToolBase
(
type
, name, parent)
11
{
12
declareInterface<DiTauToolBase > (
this
);
13
}
14
15
//______________________________________________________________________________
16
DiTauWPDecorator::~DiTauWPDecorator
() =
default
;
17
18
//______________________________________________________________________________
19
StatusCode
DiTauWPDecorator::initialize
()
20
{
21
if
(!
m_ditauContainerName
.empty() &&
m_decorWPs
.empty()) {
22
ATH_MSG_ERROR
(
"DiTauContainerName is provided but DecorWPNames is empty"
);
23
return
StatusCode::FAILURE;
24
}
25
26
for
(
size_t
wpIndex=0; wpIndex <
m_decorWPs
.size(); ++wpIndex) {
27
m_charDecors
.emplace_back(SG::AuxElement::Accessor<char>(
m_decorWPs
[wpIndex] ));
28
}
29
30
return
StatusCode::SUCCESS;
31
}
32
33
StatusCode
DiTauWPDecorator::executeObj
(
xAOD::DiTauJet
&xDiTau,
const
EventContext&
/*ctx*/
)
const
34
{
35
const
SG::ConstAccessor<float>
acc_score(
m_scoreName
);
36
float
score = acc_score(xDiTau);
37
38
// Decorate other WPs
39
for
(
size_t
wpIndex=0; wpIndex <
m_decorWPs
.size(); ++wpIndex) {
40
const
SG::Accessor<char>
& decorator =
m_charDecors
[wpIndex];
41
decorator(xDiTau) =
passOmniWP
(score,
m_decorWPCuts
[wpIndex]);
42
}
43
44
return
StatusCode::SUCCESS;
45
}
46
47
bool
DiTauWPDecorator::passOmniWP
(
float
score,
float
wp_thrshold )
const
{
48
return
score > wp_thrshold;
49
}
50
51
52
53
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
DiTauWPDecorator.h
DiTauToolBase::DiTauToolBase
DiTauToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition
DiTauToolBase.cxx:14
DiTauWPDecorator::m_decorWPCuts
Gaudi::Property< std::vector< float > > m_decorWPCuts
Definition
DiTauWPDecorator.h:36
DiTauWPDecorator::m_decorWPs
Gaudi::Property< std::vector< std::string > > m_decorWPs
Definition
DiTauWPDecorator.h:35
DiTauWPDecorator::passOmniWP
bool passOmniWP(float score, float wp_thrshold) const
Definition
DiTauWPDecorator.cxx:47
DiTauWPDecorator::m_scoreName
Gaudi::Property< std::string > m_scoreName
Definition
DiTauWPDecorator.h:34
DiTauWPDecorator::~DiTauWPDecorator
virtual ~DiTauWPDecorator()
DiTauWPDecorator::DiTauWPDecorator
DiTauWPDecorator(const std::string &type, const std::string &name, const IInterface *parent)
Definition
DiTauWPDecorator.cxx:9
DiTauWPDecorator::executeObj
virtual StatusCode executeObj(xAOD::DiTauJet &xDiTau, const EventContext &ctx) const override
Execute - called for each Ditau jet.
Definition
DiTauWPDecorator.cxx:33
DiTauWPDecorator::initialize
virtual StatusCode initialize() override
Tool initializer.
Definition
DiTauWPDecorator.cxx:19
DiTauWPDecorator::m_ditauContainerName
Gaudi::Property< std::string > m_ditauContainerName
Definition
DiTauWPDecorator.h:40
DiTauWPDecorator::m_charDecors
std::vector< SG::AuxElement::Accessor< char > > m_charDecors
Definition
DiTauWPDecorator.h:38
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
xAOD::DiTauJet
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition
DiTauJet.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0