TTree:Customized axis using dedicated TCuts

Hi ROOTers

I have 2 leaves, one containing Energy, the other containing the integral values at that energy:

E Integral
30 400
50 100
60 1100
60 1128

Is it possible to draw “integral:integral” but to set the X axis to be for E==50 and the Y axis to be Y==60?

Or do I have to create two histograms in such way that

h50Integrals=> 100 100
h60Integrals=> 1100 1128

and then plot h50Integrals vs. h60Integrals

Is there a proper way to do this?
Thanks you,

what do you mean by “to set the X axis to be for E==50 and the Y axis to be Y==60” ?

Rene

What I mean is that I have two variables, energy and integral (i.e. total counts under the curve), and I would like to plot integral(E1) vs. integral(E2) where E1 and E2 could be any energy that I choose. In this case E1==50 and E2==60. I was thinking as if there were cuts (as a TCut object) except they are specific to an axis.

I hope this make sense…

Just my 2 cents, you can do something like

[code] T->Draw(“integral>>h1”,“E==50”,“goff”);
TH1 h1 = (TH1)gDirectory->FindObject(“h1”);
double xmin = h1->GetXaxis()->GetXmin();
double xmax = h1->GetXaxis()->GetXmax();

T->Draw("integral>>h2","E==60","goff");
TH1 *h2 = (TH1*)gDirectory->FindObject("h2");
double ymin = h1->GetMinimum();
double xmax = h1->GetMaximum();
TH2F *hresult = new TH2F("hresult","integral vs integral",40,xmin,xmax,40,ymin,ymax);

T->Draw("integral:integral>>hresult");[/code]

Rene