RE:Re: [ROOT] untegrating funtions CINT pro

From: Matthieu Guillo (guillo@jlab.org)
Date: Tue Sep 04 2001 - 16:31:59 MEST


Hi Masaharu,

I am not sure to understand why you say that the function f2 is not
defined and hence cannot be compiled since in the script I declare:

TF1 *f2 = new TF1("f2", jitter, dLimInf, dLimSup, 1);

I tried Rene's suyggestion to drop the optimization using the .O0 trick.
It worked fine afterwards, that's the only modification I made. 
That's why I think Rene may be right with the optimisation?

Regards,

Matthieu Guillo
University of South Carolina
Thomas Jefferson National Laboratory
Office 71 trailer 16
Phone: 757-269-5551

On Tue, 4 Sep 2001, Masaharu Goto wrote:

> Hello Matthieu and Rene,
> 
> It is hard to tell if this is really a Cint optimization 
> problem.  With this example, reason of the error is simply
> because function f2 is missing.  It can not be compiled
> because it does not exist.   If f2 exists in your original
> and you still have this problem, then the possibility is
> that the function includes somothing that cint can not
> compile. In this case, I need to ask Rene to detect this 
> in Root to avoid repeating error messages. 
> 
> Thank you
> Masaharu Goto
> 
> 
> >Date: Thu, 30 Aug 2001 23:24:11 +0200 (METDST)
> >From: Rene Brun <Rene.Brun@cern.ch>
> >To: Matthieu Guillo <guillo@jlab.org>
> >Cc: roottalk@pcroot.cern.ch, rootdev@pcroot.cern.ch
> >Subject: Re: [ROOT] untegrating funtions CINT problem
> >
> >Hi Matthieu,
> >
> >I can reproduce your problem. This is a CINT optimisation problem.
> >I am forwarding the problem to Masa.
> >
> >You have two ways to circumvent the problem:
> > 1- run with CINT optimisation 0
> >   root > .O0
> >   root > .L jitter.C
> >   root > PlotMissingTriggers(7, 2, 5)
> >
> > 2- run with ACLIC
> >   Add "include "TF1.h" at the beginning of your file, then do:
> >   root > .L jitter.C+
> >   root > PlotMissingTriggers(7, 2, 5)
> >
> >Note that you had a typing mistake in your original function. The line
> > Double_t dResult = c_dNormalize * TMath::Exp(-dX * dX / (2. * dSigma *
> >should be (I think)
> > Double_t dResult = dNormalize * TMath::Exp(-dX * dX / (2. * dSigma *
> >
> >
> >Rene Brun
> >
> >
> >On Thu, 30 Aug 2001, Matthieu Guillo wrote:
> >
> >> Hello Rooters,
> >> 
> >> I wrote a small script to draw a function (the function is a integral of
> >> an other function) based on the example found in
> >> $ROOTSYS/tutorials/FitDemo.C. Here is the script:
> >> 
> >> 
> >> Double_t jitter(Double_t* x, Double_t* par)
> >> {
> >>   Double_t dSigma = par[0];
> >>   Double_t dX = x[0];
> >> 
> >>   Double_t dNormalize = 1. / TMath::Sqrt(2. * TMath::Pi()) / dSigma;
> >> 
> >>   Double_t dResult = c_dNormalize * TMath::Exp(-dX * dX / (2. * dSigma *
> >> dSigma)); 
> >>   
> >>   return (dResult);
> >> }
> >> 
> >> Double_t missTrigg(Double_t* x, Double_t* par)
> >> {
> >> 
> >>   Double_t dSigma = x[0];
> >>   Double_t dTaggerGate = par[0];
> >>   Double_t dSTGate = par[1];
> >> 
> >>   Double_t dLimInf = (dSTGate + dTaggerGate) / 2.;
> >>   Double_t dLimSup = 50.;
> >> 
> >>   TF1 *f2 = new TF1("f2", jitter, dLimInf, dLimSup, 1);
> >>   
> >>   Double_t dResult = f2->Integral(dLimInf, dLimSup, &dSigma);
> >>   
> >>   return (dResult);
> >> }
> >> 
> >> void PlotMissingTriggers(Double_t dTaggerGate, Double_t dSTGate, Double_t
> >> dSigma)
> >> {
> >>   
> >>   Float_t fMin = 0., fMax = 3. * (dTaggerGate + dSTGate) / 2.;
> >>   TF1 *f1 = new TF1("f1", missTrigg, fMin, fMax, 2);
> >>   f1->SetParameters(dTaggerGate, dSTGate);
> >>   
> >>   f1->SetLineWidth(2);
> >>   f1->SetLineColor(4);
> >>   f1->Draw();
> >> } 
> >> 
> >> 
> >> This script is in a file called jitter.C. After stating ROOT I type:
> >> .L jitter.C
> >> PlotMissingTriggers(7, 2, 5);
> >> 
> >> And I receive a bunch of identical mesages (one for each loop in the
> >> Integral method I guess): 
> >> 
> >> Function:f2 cannot be compiled
> >> 
> >> What am I doing wrong? I would appreciate any help.
> >> 
> >> 
> >> 
> >> Matthieu Guillo
> >> University of South Carolina
> >> Thomas Jefferson National Laboratory
> >> Office 71 trailer 16
> >> Phone: 757-269-5551
> >> 
> >
> 



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