Problem with histograms using EP mode

Hello, I was plotting the difference between two histograms

TH1F *diff0 = (TH1F *)hBIB0->Clone("diff0");
    if (!(diff0->GetSumw2N() > 0))diff0->Sumw2(kTRUE);
	diff0->Add(hBkg0,-1);
	diff0-> SetLineColor(kGreen);
	diff0->SetOption("HIST"); 
	diff0->Draw("EP");

and I notice that in the left part of the difference plot there are two lines

but they disappear if I don’t use EP mode to raw the difference plot

Moreover, I noticed the double line in the parent histogram if I don’t set:
hBIB0->SetOption("HIST"); hBkg0->SetOption("HIST");

then I directly checked the data without using a macro. If I plot them using EP mode in a ROOT command line, i.e. simply:
tree->Draw("e0 >> htempBkg0(8000, 0., 8000.)","","EP");

I get the double line in the histogram too

is it a problem of data or should I not use the EP mode to draw the difference, as it happens when I select EP mode?
bibbkgdifftree.c (4.3 KB)

EP means : Errors and Markers. It should not be a problem.
I will check your macro.

Well … the data files are missing.

One quick check: zoom in on the lowest bins of that histogram, e.g. from energy 0 to 500; maybe the points are actually “jumping” up and down and only seem like 2 histos because of the visual compression due to the wide range.

Thank you the both @couet and @dastudillo

@couet : ok, I will upload the root files tomorrow…they are quite big

@dastudillo here the zoom of the parent histogram with EP option

and here without EP option

So it looks like the data is jumping, it’s not two lines.

Yes the 2 representations are correct . No need to upload le files.

To see it better do bigger zoom for instance with the range 200-250
on a plot done with:

hist->Draw("HIST");
hist->Draw("EP SAME");

Thank you the both @dastudillo and @couet
It looks like it was a problem in the ROOT file.
Making again it, we don’t have the jumping!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.