I simplified your macro to make it easier to understand. The following macro produce the first plot produced and the 2 first line I added:
auto f = new TFile("backgroundCut-refinedHiCal2A-part_all.root");
auto c = new TCanvas();
I get many errors (but it seems you do not care) and I get the following image. As you can see the two plots are the same. That’s not a problem of “canvas not updated”. Your data set is like that. Also as long as I get that huge number of error I would not trust the results.
So I think I found the problem, and it had nothing to do with the errors you brought up. Again, those errors had to do with:
The ROOT file I provided is a concatenation of the files ROOT issues error about. When you use
hadd to concatenate the files, the resulting file has friends to the other files. When friends are missing, perhaps that should be downgraded from an “Error” to a “Warning”?
I never saw any error output as to variable mismatch when using
The problem was the naming of the variables. The variables to be drawn all end in “Response”. Once the draw commands were corrected, the PNG file output was what I expected.
makeMVACompareGraphsNew.C (11.8 KB)
Yep, the problem was in the variable name.
I guess ROOT has some sort of autocompletion to variable names when
TTree::Draw()? Because when I moved the ROOT file to another computer (which still had header files to the special classes responsible for the other type of error mentioned above) and ran the macro, I only got error messages about friends to ROOT file missing, not about a mislabeling of variables.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.