RE: [ROOTDEV] TF1 draw problem

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Fri, 17 Apr 2009 16:01:46 +0200


I see it also with the latest version. I am looking at it. Cheers,
oc

-----Original Message-----
From: owner-rootdev_at_root.cern.ch [mailto:owner-rootdev_at_root.cern.ch] On Behalf Of Smbat Grigoryan
Sent: Friday, April 17, 2009 3:28 PM
To: rootdev_at_root.cern.ch
Cc: roottalk_at_root.cern.ch
Subject: [ROOTDEV] TF1 draw problem

Hi,
I'm trying to draw the TF1 given below in the log-scale in the x-range (0,xmax). For small xmax the macro works ok. But for xmax > 18 it draws the function in the range (0,18) and the rest is always equal to zero.
Could someone please modify this macro in order to draw the function in log-scale in the given x-range? I'm using ROOT 5.23/02 or 5.21/01 with gcc 3.4.6 Thanks in advance,
Smbat

Double_t fpt( Double_t *px, Double_t */*dummy*/) {

  Double_t kpt0 = 5.807;
  Double_t kxn  = 4.071;
  Double_t x=px[0];
  Double_t pass1 = 1.+(x/kpt0)*(x/kpt0);
  return x/TMath::Power(pass1,kxn);
}

void drawtest() {

   Double_t xmax=30.;
   TF1 *pt = new TF1("pt",fpt,0,xmax,0);    TCanvas *c2 = new TCanvas("c2","c2",10,10,900,700);    c2->SetLogy();
   pt->Draw();
}
Received on Fri Apr 17 2009 - 16:02:01 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 17 2009 - 23:50:01 CEST