Set LogY Scale in case we have Data/Mc


ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


meeeee.pdf (14.7 KB)

Hi,

I want to Set logy scale for my Data/MC comparaison histogram, but when i do that i can only see Data and MC vanish . when i go back to the normal scale i can see both data and MC.

can anyone tell why i can’t see MC distribution when set logy scale ?

To understand what’s going on we will need a small reproducer macro.

at least you should show the same with linear Y-scale.
I guess your MC data are all below 0.1
Otto

Thanks for reply.

TCanvas *c2 = new TCanvas("c2","MET Data/MC(Weight) ID{1,5} |eta|< 2.4 mupt > 50 Gev  ",1900, 1600);


 //Histogram Normalieation 
Double_t norm = h0->Integral();
Double_t scale = norm/(h1->Integral());
h1->Scale(scale);


HistoStyle (h1, 8, 3001);
h0-> SetMarkerStyle(8);


THStack *a = new THStack ("a", "MET Data/MC(Weight) ID{1,5} |eta|< 2.4 mupt > 50 Gev ;#slash{E}_{T}(GeV); Numbre of events");
  
a->Add(h1, "HIST");
a->Add(h0, "PLC PMC");
a->Draw("nostack");

So if MC is below 0.1 How can i change logy scale ?

Th

Log_Scal.pdf (110.4 KB)

my guess was wrong, your MC and data have
similar y values (no surprise after Scale(…))
You must provide the complete macro producing
the stack.
Btw. you still dont show the plot with linear Y-scale.

Otto

Yes, You will find closed the complete macro.

Thank you very much. Wmet5.C (10.0 KB)

Hi.
your macro looks different now:

        HistoStyle (h1, 8, 3001);
        h0-> SetMarkerStyle(8);

        /*
        THStack *a = new THStack ("a", "MET Data/MC(Weight) ID{1,5} |eta|< 2.4 mupt > 50 Gev ;#slash{E}_{T}(GeV); Numbre of events");
          
        a->Add(h1, "HIST");
        a->Add(h0, "PLC PMC");
        a->Draw("nostack");
        */

        h1->Draw ("SAME"); 
        h0->Draw ("ALP"); 

The part with THStack is commented out,
instead you draw the histos directly.
However the order is wrong:
You first draw with option SAME then with ALP.
It should be the other way round.

Otto

Note that “A” is not needed (ALP is usually a TGraph option). try:

    h0->Draw ("LP"); 
    h1->Draw ("SAME"); 

Hi,

I did that but i still get only Data and MC vanish.

Cheers,

Your macro uses two files we do not have.
Can you post them (or a subset of them) ?

Hi,

Sorry for being late, i have tired to fixed the problem and i find what’s caused the problem.
I have just change SetMinimum(0) to SetMinimum(1) and it worked.

Thank you very much.
Cheers

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