ATLAS Offline Software
Loading...
Searching...
No Matches
BJetThreeValueCheck.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
7
9 const std::string& type,
10 const std::string& name,
11 const IInterface* parent ) :
12 AthAlgTool( type, name, parent ),
13 m_acc(nullptr)
14{
15}
16
18 if (m_cFraction < 0 || 1 < m_cFraction) {
19 ATH_MSG_ERROR("c-jet fraction for b-tagger likelihood ratio calculation should be between 0 and 1!");
20 ATH_MSG_ERROR("c-jet fraction requested: " << m_cFraction);
21 return StatusCode::FAILURE;
22 }
23 if ( not m_monTool.name().empty() ) {
24 ATH_CHECK( m_monTool.retrieve() );
25 ATH_MSG_DEBUG("MonTool name: " << m_monTool);
26 }
27 m_acc.reset(new Accessors {
28 std::string(m_bName),
29 std::string(m_cName),
30 std::string(m_uName)});
31 return StatusCode::SUCCESS;
32}
33
35{
36 float b = m_acc->b(bjet);
37 float c = m_acc->c(bjet);
38 float u = m_acc->u(bjet);
39 float f = m_cFraction;
40 float llr = safeLogRatio(b, f*c + (1-f)*u);
42 return llr > m_threshold;
43}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Header file to be included by clients of the Monitored infrastructure.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Gaudi::Property< std::string > m_llrName
Gaudi::Property< std::string > m_bName
std::unique_ptr< Accessors > m_acc
virtual StatusCode initialize() override
BJetThreeValueCheck(const std::string &type, const std::string &name, const IInterface *parent)
virtual bool passThreshold(const xAOD::Jet &) const override
Gaudi::Property< std::string > m_cName
Gaudi::Property< std::string > m_uName
Gaudi::Property< float > m_threshold
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< float > m_cFraction
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
Jet_v1 Jet
Definition of the current "jet version".
float safeLogRatio(float num, float denom)