Hi,
So I made a script that creates some histograms in a loop, and I have a hitmap (TH2F) that I create before the loop and then reset it before every iteration in the loop. After creating the hitmap, I have an if statement to save e.g. the histograms with >100 entries, like shown below. Now the problem is, even when I know there is for sure only 1 histogram with Np>100, the script saves the correct histogram (with Np>100), the cout shows the correct number of entries (which is > 100), but the Draw function does not draw the correct histogram, but instead it draws the last one created in the loop (even though that histogram has <100 entries). Why is this the case? I don’t use the Draw function anywhere else in the code.
if (Np>100) {
cout<<"The number of entries is "<<hitmap1->GetEntries()<<endl;
File->cd();
hitmap1->Write();
File->Close();
hitmap1->Draw("colz");}
_ROOT Version: 6.12/04
_Platform: MacOS 10.12.6,
_Compiler: clang 9.0
