[ROOT] TF12->Draw()

From: Anne Stutz (stutz@lpsc.in2p3.fr)
Date: Tue May 25 2004 - 17:28:11 MEST


Hello,
I try to draw a TF12 function without success.
First I have defined a function named "giller" and created a TF2 object 
(ftest) using the giller function. Then I have created a TF12 object. 
The result of the TF12::Eval method seems correct but not the TF12::Draw().
Is there something wrong in what I am doing ?
Best regards,
Anne Stutz



// M.Giller, A.Kacerzyk et al (ICRC 2003)
Double_t giller(Double_t *x, Double_t *par) {
  Double_t E = x[0], age = x[1];
  Double_t a = 1.005, b = 0.06, c = 189, d = 7.06*age + 12.48, C = 
0.111*age + 0.134, Ecr = 80;
  return 
C*E*(1-a*TMath::Exp(-d*E/Ecr))*TMath::Power(1+E/Ecr,-(age+b*TMath::Log(E/Ecr/c)));
}

void test()
{
TCanvas *MyC = new TCanvas("MyC","Energy Distributions",1);
MyC->Divide(1,2);

TF2* ftest = new TF2("giller",giller,0.1,1000.,0.,2.,0);
MyC->cd(1);
ftest->Draw();

TF12* ftestx = new TF12("ftf12",ftest,2.5,"X");
MyC->cd(2);
ftf12->Draw();
 cout<<ftf12->Eval(0.)<<endl;
 cout<<ftf12->Eval(1)<<endl;
 cout<<ftf12->Eval(2)<<endl;

}

-- 

 ====================================== 
| Anne Stutz                           |
| Laboratoire de Physique Subatomique  |
| et de Cosmologie                     |
| 53 Avenue des Martyrs                |
| 38026 GRENOBLE cedex                 |
|--------------------------------------|       
| Tel:[33](0)4 76 28 41 80             |  
| Fax:[33](0)4 76 28 40 04             |
| e-mail : Anne.Stutz@lpsc.in2p3.fr    |
 ======================================      



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:08 MET