I am trying to draw an histogram with a secondary axis (showing calibrated values).
I used some exemples from the tutorials. It works well when the secondary scale/axis is a linear function of the main axis. But when I try to use a non-linear one then the result is not what I expect…
Here is a test code which reproduces my problem:
TH1F *ht=new TH1F(“ht”,"",200,0,tmax);
TF1 *f_calib=new TF1(“f_calib”,“pol2”,0,1);
//f_calib->SetParameter(2,0.); // works well!
f_calib->SetParameter(2,1.); // does work with non linear function…
TGaxis *A1 = new TGaxis(0,20,tmax,20,“f_calib”);
cout << " f(0) = " << f_calib->Eval(0) << endl;
cout << " f(100) = " << f_calib->Eval(100) << endl;
cout << " f(200) = " << f_calib->Eval(200) << endl;
In this example, the central value of the secondary axis ( corresponding to for x=100) is expected to be 11110 but the tick on the secondary axis indicates a value of about 30000!
Could anyone explain me clearly how the secondary axis values are calculated from the const char* funcname argument of the constructor?