I’m trying to draw multiple ROC curves on one canvas in root. To be able to do that, first I need to extract ROC curves from the files. So far I tried the following code which I found:
// Open .root file
TFile *f1 = TFile::Open(“TMVA_2022.root”);
// Set pointer to directory containing ROC-curve
TDirectory* dir = gFile->GetDirectory(“/dataset/plots”);
TString objectName( “rejBvsS” );
// Extract ROC-curve
// Set Canvas
TCanvas *c = new TCanvas(“c”);
// more style options etc…
// Draw and save
c->SaveAs(objectName + “.png”);
But I get following error:
Error in : Trying to dereference null pointer or trying to call routine taking non-null arguments.
Execution of your code was aborted.
ROOT_prompt_4:1:1: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
It would be great if anyone has the solution to this problem. One person, as I saw, had the exact problem and the problem was that the top level directory wasn’t included, but that doesn’t seem to be the problem in my case. Thanks in advance for any help!
ROOT Version: 6.22.08
_Ubuntu Version: 20.04.4 LTS