From 9e31ea20d5884e5581deac8aacd4bcbd7662a752 Mon Sep 17 00:00:00 2001 From: IftachSadeh Date: Sun, 20 Nov 2016 18:25:49 +0100 Subject: [PATCH] bug fix for ANNZ::doMetricPlots() --- CHANGELOG.md | 12 ++++++------ src/ANNZ_loopReg.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5b1a8e..5a2a98f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,17 +3,17 @@ ## Master version (20/11/2016) - Added the option to to *not* store the full value of pdfs in the output of optimization/evaluation, by setting -```python -glob.annz["doStorePdfBins"] = False -``` + ```python + glob.annz["doStorePdfBins"] = False + ``` In this case, only the average metrics of a pdf are included in the output. - Added the `sampleFrac_errKNN` option, to allow to sub-sample the input dataset for the knn uncertainty calculation (similar to e.g., `sampleFracInp_wgtKNN` and `sampleFracInp_inTrain`). - Added metric plots of the distribution of the KNN error estimator vs. the true bias. The plots are added to the output by setting -```python -glob.annz["doKnnErrPlots"] = True -``` + ```python + glob.annz["doKnnErrPlots"] = True + ``` - Added support for input ROOT files with different Tree names. diff --git a/src/ANNZ_loopReg.cpp b/src/ANNZ_loopReg.cpp index 307a0a8..ccf7ac1 100644 --- a/src/ANNZ_loopReg.cpp +++ b/src/ANNZ_loopReg.cpp @@ -3452,8 +3452,11 @@ void ANNZ::doMetricPlots(TChain * aChain, vector * addPlotVarV, TStri if(doKnnErrPlots) { TString cutStr("_comn"), hisTmpName("his1_TMP"); - TString treeCuts = (TString)getTrainTestCuts(cutStr,0,0,0,var); - TString drawExprs = (TString)regBestNameVal+"-"+zTrgName+">>"+hisTmpName; + int nMLMnow = max(0, glob->GetOptI("nMLMnow")); + TString MLMname = (TString)( (nTagBestMLM == 0) ? getTagName(nMLMnow) : regBestNameVal); + + TString treeCuts = (TString)getTrainTestCuts(cutStr,nMLMnow,0,0,var); + TString drawExprs = (TString)MLMname+"-"+zTrgName+">>"+hisTmpName; TCanvas * tmpCnvs = new TCanvas("tmpCnvs","tmpCnvs"); int nEvtPass = aChain->Draw(drawExprs,treeCuts); DELNULL(tmpCnvs);