35 std::string varNameList_Full =
"ModeDiscriminator_BDTVariableNames_CellBased_" +
m_Name_ModeCase;
38 std::string varDefaultValueList_Full =
"ModeDiscriminator_BDTVariableDefaults_CellBased_" +
m_Name_ModeCase;
45 ATH_MSG_ERROR(
"Number of variable names does not match number of default values! Check jobOptions!");
46 return StatusCode::FAILURE;
50 for (
unsigned int iPtBin=0; iPtBin<(
m_BinEdges_Pt.size() - 1); iPtBin++) {
54 std::string curPtBin =
"ET_" + bin_lowerStr +
"_" + bin_upperStr;
58 curWeightFile +=
"TrainModes_";
59 curWeightFile +=
"CellBased_";
60 curWeightFile += curPtBin +
"_";
66 if (resolvedWeightFileName.empty()) {
67 ATH_MSG_ERROR(
"Weight file " << curWeightFile <<
" not found!");
68 return StatusCode::FAILURE;
72 std::unique_ptr<TFile> fBDT = std::make_unique<TFile>( resolvedWeightFileName.c_str() );
73 TTree* tBDT =
dynamic_cast<TTree*
> (fBDT->Get(
"BDT"));
74 std::unique_ptr<MVAUtils::BDT> curBDT = std::make_unique<MVAUtils::BDT>(tBDT);
75 if (curBDT ==
nullptr) {
76 ATH_MSG_ERROR(
"Failed to create MVAUtils::BDT for " << resolvedWeightFileName );
77 return StatusCode::FAILURE;
84 return StatusCode::SUCCESS;
102 ATH_MSG_DEBUG(
"\tUse default value as the feature (the one below this line) was not calculated");
108 list_BDTVariableValues[iVar] =
static_cast<float>(newValue);
129 for (
unsigned int iPtBin=0; iPtBin<
m_BinEdges_Pt.size()-1; iPtBin++) {
136 ATH_MSG_WARNING(
"Could not find ptBin for tau seed with pt " << inSeed->
p4().Pt());
144 return m_MVABDT_List[ptBin]->GetGradBoostMVA(list_BDTVariableValues);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
static StatusCode bindToolHandle(ToolHandle< T > &, std::string)
virtual FourMom_t p4() const
The full 4-momentum of the particle as a TLoretzVector.
bool isOfTechnicalQuality(int pantauSeed_TechnicalQuality) const
const xAOD::TauJet * getTauJet() const
const PanTau::TauFeature * getFeatures() const
Class containing features of a tau seed.
bool addFeature(const std::string &name, const double value)
adds a new feature
double value(const std::string &name, bool &isValid) const
returns the value of the feature given by its name
virtual double pt() const
The transverse momentum ( ) of the particle.