Rene Brun | 2 Dec 2006 12:46
Picon
Picon

[ROOT] ROOT Users Workshop 2007

We are pleased to announce that the 2007 ROOT Users Workshop will take place on 26, 27 and 28 March, 2007 at CERN.

See the web page for the workshop which will allow you to register and has general information on the workshop.
http://root.cern.ch/root/R2007/Welcome.html
We are particularly interested by talks in the following categories:

Use of ROOT as a general framework.
Data analysis scenarios using ROOT, PROOF and Selectors.
Experience with I/O.
Use of the GUI and graphics classes.
Use in DAQ, real time systems and client/servers.
Distributed applications on the GRID.
Statistical analysis tools and classes.
Usage of the different language bindings.
We also invite participants to come with questions, comments, proposals to be discussed in a special Q&A session.
We are looking forward to seeing many of you at the workshop.

The ROOT 2007 organizing committee:

Rene Brun (CERN)
Philippe Canal (FNAL)
Fons Rademakers (CERN)
Nathalie Knoors (CERN)

Till Sawala | 4 Dec 2006 13:10
Picon

[ROOT] TMinuit function arguments

Hi Rooters,

I would like to minimze a likelyhood-function of 1 parameter with Tminuit. At the moment, I use the
following pair of functions (adapted from http://root.cern.ch/root/html/examples/Ifit.C.html):

void NLL(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
{
  Double_t LL = 0.0;              
  const Int_t nbins = 100000;

  for (int i=1; i<nbins; i++)
    {
      LL += TMath::Log(Prob(t[i], sigma[i],par));
    }

  f = -1. * LL;
}

Double_t Prob(Double_t t, Double_t sigma, Double_t *par)
{
  return .5/par[0] * TMath::Exp(.5*sigma*sigma/(par[0]*par[0]) - t/par[0]) *
TMath::Erfc(1/TMath::Sqrt(2) * (sigma/par[0] - t/sigma) );
}

gMinuit->SetFCN(NLL); 

Where NLL is the function to minimize for par[0], and Prob is a function to calculate the probability for
each combination of par[0], t[i] and sigma[i]. However, as the format of NLL is fixed, t and sigma now have
to be global and fixed, i.e. NLL only works for one set of t and sigma. Is there a way to change the format of NLL
in some way, so that I can pass additional references or pointers? Or maybe you have another suggestion?

Cheers,
Till

Rene Brun | 4 Dec 2006 13:59
Picon
Picon

Re: [ROOT] TMinuit function arguments

Hi Till,

Instead of making the arrays t and sigma global, define only one global 
pointer to an object
that includes these 2 arrays.
We are currently considering extensions to the fitter where a pointer to 
an object could be specified
instead of the FCN.

Rene Brun

Till Sawala wrote:
> Hi Rooters,
>
> I would like to minimze a likelyhood-function of 1 parameter with Tminuit. At the moment, I use the
following pair of functions (adapted from http://root.cern.ch/root/html/examples/Ifit.C.html):
>
> void NLL(Int_t &npar, Double_t *gin, Double_t &f, Double_t *par, Int_t iflag)
> {
>   Double_t LL = 0.0;              
>   const Int_t nbins = 100000;
>
>   for (int i=1; i<nbins; i++)
>     {
>       LL += TMath::Log(Prob(t[i], sigma[i],par));
>     }
>
>   f = -1. * LL;
> }
>
> Double_t Prob(Double_t t, Double_t sigma, Double_t *par)
> {
>   return .5/par[0] * TMath::Exp(.5*sigma*sigma/(par[0]*par[0]) - t/par[0]) *
TMath::Erfc(1/TMath::Sqrt(2) * (sigma/par[0] - t/sigma) );
> }
>
> gMinuit->SetFCN(NLL); 
>
> Where NLL is the function to minimize for par[0], and Prob is a function to calculate the probability for
each combination of par[0], t[i] and sigma[i]. However, as the format of NLL is fixed, t and sigma now have
to be global and fixed, i.e. NLL only works for one set of t and sigma. Is there a way to change the format of NLL
in some way, so that I can pass additional references or pointers? Or maybe you have another suggestion?
>
> Cheers,
> Till
>   

OKUMURA, Akira | 4 Dec 2006 14:47
Picon

[ROOT] termios.h and rootcint

Hello ROOTers,

I wrote a class which includes termios.h to control RS232C devices.  
When I tried to generate dictionaries, some errors occurred.

$ make
rootcint -f src/CloudMonitorDict.cxx -c -p include/ARS232C.h include/ 
LinkDef.h
Error: Symbol speed_tfInputSpeed is not defined in current scope   
include/ARS232C.h:39:
Error: Symbol speed_tfOutputSpeed is not defined in current scope   
include/ARS232C.h:40:
Syntax error include/ARS232C.h:59:
Syntax error include/ARS232C.h:60:
Syntax error include/ARS232C.h:61:
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
............

fInputSpeed and fOutputSpeed are member variables of a class ARS232C.  
lines 59, 60 and 61 have a strings "foo(speed_t speed)" where foo is  
name of functions.

like as below
==================
class ARS232C : public TObject {
private:
     speed_t fInputSpeed;
     speed_t fOutputSpeed;
public:
     ARS232C();
     ~ARS232C();

     void func(speed_t speed);
};
==================

What should I do?

Sincerely,

OKUMURA, Akira oxon <at> icrr.u-tokyo.ac.jp
Institute for Cosmic Ray Research, University of Tokyo
5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
Phone/Fax : +81 4-7136-3153
Skype : okumura.akira

Axel Naumann | 4 Dec 2006 15:07
Picon
Picon

Re: [ROOT] termios.h and rootcint

Hi,

make sure that CINT can parse the definition of speed_t, by either
including the file containing the definition in ARS232C.h, or by adding
the file containing the definition to the rootcint call, or by
duplicating the definition in ARS232C.h, surrounding it with a

#ifdef __CINT__
typedef whatever speed_t;
#endif

Cheers, Axel.

OKUMURA, Akira wrote:
> Hello ROOTers,
> 
> I wrote a class which includes termios.h to control RS232C devices. When
> I tried to generate dictionaries, some errors occurred.
> 
> $ make
> rootcint -f src/CloudMonitorDict.cxx -c -p include/ARS232C.h
> include/LinkDef.h
> Error: Symbol speed_tfInputSpeed is not defined in current scope 
> include/ARS232C.h:39:
> Error: Symbol speed_tfOutputSpeed is not defined in current scope 
> include/ARS232C.h:40:
> Syntax error include/ARS232C.h:59:
> Syntax error include/ARS232C.h:60:
> Syntax error include/ARS232C.h:61:
> Warning: Error occurred during reading source files
> Warning: Error occurred during dictionary source generation
> ............
> 
> fInputSpeed and fOutputSpeed are member variables of a class ARS232C.
> lines 59, 60 and 61 have a strings "foo(speed_t speed)" where foo is
> name of functions.
> 
> like as below
> ==================
> class ARS232C : public TObject {
> private:
>     speed_t fInputSpeed;
>     speed_t fOutputSpeed;
> public:
>     ARS232C();
>     ~ARS232C();
> 
>     void func(speed_t speed);
> };
> ==================
> 
> What should I do?
> 
> Sincerely,
> 
> OKUMURA, Akira oxon <at> icrr.u-tokyo.ac.jp
> Institute for Cosmic Ray Research, University of Tokyo
> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
> Phone/Fax : +81 4-7136-3153
> Skype : okumura.akira
> 
> 

OKUMURA, Akira | 4 Dec 2006 15:27
Picon

Re: [ROOT] termios.h and rootcint

Hello Axel,

Thank you for your advice. It goes well with the following additional  
lines.

#ifdef __CINT__
// Eliminate rootcint errors

// Copied from <asm/termbits.h>
typedef unsigned char	cc_t;
typedef unsigned int	speed_t;
typedef unsigned int	tcflag_t;

#define NCCS 19
struct termios {
	tcflag_t c_iflag;		/* input mode flags */
	tcflag_t c_oflag;		/* output mode flags */
	tcflag_t c_cflag;		/* control mode flags */
	tcflag_t c_lflag;		/* local mode flags */
	cc_t c_line;			/* line discipline */
	cc_t c_cc[NCCS];		/* control characters */
};
#endif

Sincerely,

OKUMURA, Akira oxon <at> icrr.u-tokyo.ac.jp
Institute for Cosmic Ray Research, University of Tokyo
5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
Phone/Fax : +81 4-7136-3153
Skype : okumura.akira

On 2006/12/04, at 23:07, Axel Naumann wrote:

> Hi,
>
> make sure that CINT can parse the definition of speed_t, by either
> including the file containing the definition in ARS232C.h, or by  
> adding
> the file containing the definition to the rootcint call, or by
> duplicating the definition in ARS232C.h, surrounding it with a
>
> #ifdef __CINT__
> typedef whatever speed_t;
> #endif
>
> Cheers, Axel.
>
> OKUMURA, Akira wrote:
>> Hello ROOTers,
>>
>> I wrote a class which includes termios.h to control RS232C  
>> devices. When
>> I tried to generate dictionaries, some errors occurred.
>>
>> $ make
>> rootcint -f src/CloudMonitorDict.cxx -c -p include/ARS232C.h
>> include/LinkDef.h
>> Error: Symbol speed_tfInputSpeed is not defined in current scope
>> include/ARS232C.h:39:
>> Error: Symbol speed_tfOutputSpeed is not defined in current scope
>> include/ARS232C.h:40:
>> Syntax error include/ARS232C.h:59:
>> Syntax error include/ARS232C.h:60:
>> Syntax error include/ARS232C.h:61:
>> Warning: Error occurred during reading source files
>> Warning: Error occurred during dictionary source generation
>> ............
>>
>> fInputSpeed and fOutputSpeed are member variables of a class ARS232C.
>> lines 59, 60 and 61 have a strings "foo(speed_t speed)" where foo is
>> name of functions.
>>
>> like as below
>> ==================
>> class ARS232C : public TObject {
>> private:
>>     speed_t fInputSpeed;
>>     speed_t fOutputSpeed;
>> public:
>>     ARS232C();
>>     ~ARS232C();
>>
>>     void func(speed_t speed);
>> };
>> ==================
>>
>> What should I do?
>>
>> Sincerely,
>>
>> OKUMURA, Akira oxon <at> icrr.u-tokyo.ac.jp
>> Institute for Cosmic Ray Research, University of Tokyo
>> 5-1-5 Kashiwanoha Kashiwa Chiba 277-8582 Japan
>> Phone/Fax : +81 4-7136-3153
>> Skype : okumura.akira
>>
>>
>

Christian Holm Christensen | 4 Dec 2006 15:53
Picon
Favicon

Re: [ROOT] TMinuit function arguments

Hi Till,

On Mon, 2006-12-04 at 13:59 +0100, Rene Brun wrote:
> Hi Till,
> 
> Instead of making the arrays t and sigma global, define only one global 
> pointer to an object
> that includes these 2 arrays.
> We are currently considering extensions to the fitter where a pointer to 
> an object could be specified
> instead of the FCN.

In the mean time, do something like in the attached script (a re-write
of Ifit.C) where an object is used, and a special forwarding `minimised'
function is implemented.  Note also, that I use the `TVirtualFitter'
interface - one should _never_ use the TMinuit/TFumili/... classes
directly . 

Run the script like 

	Root> .x Ifit.C+ 

Yours,

--

-- 
 ___  |  Christian Holm Christensen 
  |_| |  -------------------------------------------------------------
    | |  Address: Sankt Hansgade 23, 1. th.  Phone:  (+45) 35 35 96 91
     _|           DK-2200 Copenhagen N       Cell:   (+45) 24 61 85 91
    _|            Denmark                    Office: (+45) 353  25 404
 ____|   Email:   cholm <at> nbi.dk               Web:    www.nbi.dk/~cholm
 | |
Attachment (Ifit.C): text/x-c++src, 3262 bytes

Gmane