Re: [ROOT] Axis Range CINT limitation

From: Rene Brun (Rene.Brun@cern.ch)
Date: Thu Mar 15 2001 - 08:48:31 MET


Hi Mike,

CINT does not like calling a function with one or more arguments specified
as calls to another function. Proceed in two steps:

  Int_t binmin = h1->GetMaximumBin() - 100;
  Int_t binmax = h1->GetMaximumBin() - xxx (cannot be 400 !)
  h1->GetXaxis->SetRange(binmin,binmax);

Rene Brun

 

Michael Kordosky wrote:
> 
> Hi,
> 
> I am trying to set the axis range on a histogram with the following lines:
> 
> TFile* f = new TFile("mode-04-plots.root","READ");
> 
> TH1F* h1 = (TH1F*)f->Get("channel_0");
> 
> can->cd(4); //A divided TCanvas
> 
> h1->GetXaxis->SetRange(((h1->GetMaximumBin())-100),
> ((h1->GetMaximumBin())-400));
> h1->DrawCopy();
> 
> These lines produce the error message:
> 
> Error: Can't call
> TH1F::GetXaxis->SetRange(((h1->GetMaximumBin())-100),
> ((h1->GetMaximumBin())-400))
> in current scope FILE:mode-04-plots.C LINE:54
> Possible candidates are...
> filename       line:size busy function type and name  (in TH1F)
> filename       line:size busy function type and name  (in TH1)
> filename       line:size busy function type and name  (in TNamed)
> filename       line:size busy function type and name  (in TObject)
> filename       line:size busy function type and name  (in TAttLine)
> filename       line:size busy function type and name  (in TAttFill)
> filename       line:size busy function type and name  (in TAttMarker)
> filename       line:size busy function type and name  (in TArrayF)
> filename       line:size busy function type and name  (in TArray)
> *** Interpreter error recovered ***
> 
> Could someone point out what I am doing wrong?
> 
> Mike Kordosky
> 
> --
> Graduate Research Assistant  // High Energy Physics Lab
> kordosky@hep.utexas.edu     // University of Texas at Austin
> ph: (512) 471-8426 (RLM Lab, Office)
>     (512) 475-8673 (ENS Lab)



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:50:39 MET