(no subject)

From: Daniel Barna (barnad@rmki.kfki.hu)
Date: Tue May 05 1998 - 14:19:40 MEST


Hi,
I would like to plot a function with two different parameters on the same
canvas. I tried the following:

I wrote the C function in a separate file (func.C)
for simplicity it is now:

Double_t func(Double_t *arg,Double_t *par)
{
  return arg[0]*par[0];
}

And now:

gROOT->LoadMacro("func.C");

TF1 f1("f1",func,-1,1,1);
f1.SetParameter(0,1);
f1.Draw();  // ok, it works

TF1 f2("f2",func,-1,1,1);
f2.SetParameter(0,2);
f2.Draw("same");

 *** Break *** segmentation violation

What did I do wrong?

--------------------------------
something else:

If I want to write multiple statements between { }s, only the first line
seems to be executed:

int a=0; 
int b=0; 
for(int i=0; i<10; i++) {a++;
b++; }

now a=10, but b=1 !
but if I try

int a=0; 
int b=0; 
for(int i=0; i<10; i++) {a++; b++; }

now a=10,b=10.

Thanks
Daniel



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:34:32 MET