Commit 74db9407 authored by Nils Erik Krumnack's avatar Nils Erik Krumnack
Browse files

Merge branch '21.2-BJT' into '21.2'

Changes to JetQGTaggerBDT

See merge request !43169
parents 7731387e c74eaedb
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef JETQGTAGGERBDT_H_
......@@ -32,11 +32,11 @@ namespace CP {
/// IJetSelectorTool interface
virtual Root::TAccept& tag(const xAOD::Jet& jet) const override;
private:
/// Retrieve BDT score
float getScore(const xAOD::Jet& jet) const;
private:
/// Update the jet substructure variables for each jet to use in BDT
bool getJetProperties(const xAOD::Jet& jet) const;
......@@ -56,9 +56,6 @@ namespace CP {
std::string m_tmvaConfigFileName;
std::string m_tmvaConfigFilePath;
//string for cut function
std::string m_strScoreCut;
// variables for TMVA
mutable float m_pt;
mutable float m_eta;
......@@ -68,6 +65,9 @@ namespace CP {
int m_mode;
/// Decorators
std::unique_ptr< SG::AuxElement::Decorator< float > > m_dec_score;
};
} /* namespace CP */
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "BoostedJetTaggers/JetQGTaggerBDT.h"
......@@ -110,6 +110,9 @@ namespace CP {
// configure the bdt
m_bdtTagger->BookMVA( m_BDTmethod.c_str(), m_tmvaConfigFilePath.c_str() );
/// Set up score decorator
m_dec_score = std::make_unique< SG::AuxElement::Decorator<float> >( "QGTaggerBDTScore" );
/// Call base class initialize
ATH_CHECK( JSSTaggerBase::initialize() );
......@@ -133,12 +136,15 @@ namespace CP {
float jet_score = getScore(jet);
ATH_MSG_DEBUG(TString::Format("jet score %g",jet_score) );
//get cut from cut function
/// Decorate score to jet
(*m_dec_score)(jet) = jet_score;
/// Get cut from cut function
float cut = m_funcScoreCut->Eval(jet.pt()/1000.);
if(jet_score < cut) m_accept.setCutResult("QuarkJetTag", true);
// return the TAccept object that you created and filled
/// Return the TAccept object that you created and filled
return m_accept;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment