Re: [ROOT] getopt + root

From: Martin Hennecke (hennecke@fnal.gov)
Date: Tue Nov 12 2002 - 17:15:21 MET


Hi Rene

Sure, one can do it that way but I think using getopt is more elegant ;-)

Cheers
Martin

On Tue, 12 Nov 2002, Rene Brun wrote:

> Hi Martin,
> 
> Why don't you call your macro with these parameters?
> .x mymacro.C("in.root","out.root",10);
> 
> To do this, your macro must be a named macro, eg:
> void mymacro(const char* in, const char* out, double ptmin)
> 
> You can also specify default arguments, like
> 
> void mymacro(const char* in="a.root", const char* out=b.root, double
> ptmin=10)
> 
> Rene Brun
> 
> 
> On Tue, 12 Nov 2002, Martin Hennecke wrote:
> 
> > 
> > Hi,
> > 
> > I'd like to use "getopt" in conjunction with my root macro, i.e. I want to
> > be able to do something like
> > 
> > myMacroc.C  -i in.root  -o out.root  -ptmin 10  -a  -b
> > 
> > The problem is to pass the options to my script correctly.
> > Has someone managed to do this succesfully and can provide the right
> > command line ? 
> > 
> > 
> > Thanks,
> > Martin
> > 
> > =======================================================================
> >    Martin Hennecke                hennecke@fnal.gov 
> >    Fermilab CDF                 
> >    P.O. Box 500, MS 318        |  Institut fuer Exp. Kernphysik (EKP) 
> >    Batavia, IL 60510, USA      |  Universitaet Karlsruhe 
> >    office: new CDF bldg 03-99  |  Wolfgang-Gaede-Str. 1
> >    phone : +1 (630) 840 2627   |  76131 Karlsruhe/Germany
> >    fax   : +1 (630) 840 8859   |             
> > =======================================================================
> > 
> > 
> 

=======================================================================
   Martin Hennecke                hennecke@fnal.gov 
   Fermilab CDF                 
   P.O. Box 500, MS 318        |  Institut fuer Exp. Kernphysik (EKP) 
   Batavia, IL 60510, USA      |  Universitaet Karlsruhe 
   office: new CDF bldg 03-99  |  Wolfgang-Gaede-Str. 1
   phone : +1 (630) 840 2627   |  76131 Karlsruhe/Germany
   fax   : +1 (630) 840 8859   |             
=======================================================================



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:17 MET