Changing Range after performing TTree::Draw

Hey Everyone,

I was wondering how exactly does changing range work for TTree::Draw of two friended Tree? for example; I have

[code] //OPEN Main Tree and read the branch
TFile *fin=TFile::Open(“Ch1_Total.root”,“UPDATE”);
TTree tout = (TTree)fin->Get(“Total_Data”);
//Friend with the second tree
tout->AddFriend(“Total_Data”,“Ch2_Total.root”);
//Draw the comparion data
tout->SetMarkerStyle(8);
tout->Draw(“Total_Data.VS2:VS1”);
//Labeling Axis/title
TH2F htemp = (TH2F)gPad->GetPrimitive(“htemp”);
htemp->GetXaxis()->SetTitle(“PMT 1 ©”);
htemp->GetYaxis()->SetTitle(“PMT 2 ©”);
htemp->SetTitle(“Votlage Sum Comparison”);
htemp->Write();
gPad->Update();

	fin -> Close();[/code] 

Should I add htemp->GetXaxis()->SetRange(xmin,xmax); to change the range on that x axis? If so that doesn’t really seem to work.

Thanks for the assistance.
Best,
Ken

Hi Ken,

SetRange expects the bin numbers. Perhaps in your case the right method is SetRangeUser:
root.cern.ch/doc/master/classTA … 8d7810e199

Cheers,
Danilo

[quote=“dpiparo”]Hi Ken,

SetRange expects the bin numbers. Perhaps in your case the right method is SetRangeUser:
root.cern.ch/doc/master/classTA … 8d7810e199

Cheers,
Danilo[/quote]

Should it be htemp->GetXAxis->SetRangeUser?

That also didn’t really work

Hi,

what code are you actually running?

D