Re: [ROOT] Strings

From: Christian Holm Christensen (cholm@hehi03.nbi.dk)
Date: Wed Oct 24 2001 - 14:59:18 MEST


Hi, 

On Wed, 24 Oct 2001 11:24:55 +0200 (MET DST)
"Sidoti Antonio tel. +39+0461 88 1525" <sidoti@science.unitn.it> wrote
concerning "Re: [ROOT] Strings":
> Hi Alberto,
> Why don't you use simple char? In that case you can do:
> 
> char text[256];
> TCut mycut;
> Double_t pippo;
> pippo = (pluto * paperino)/minnie;
> sprintf(text,"BRANCH.phi0<= %f",pippo);
  ^^^^^^^
  |||||||

This is why you don't want to use simple chars.  Instead do 

  TCut mycut(Form("phi <= %g", phiCut)); 

much simpler, much more C++-like, though the best thing would probably
something like 

  TString cutStr; 
  cutStr << "phi=" << setprecision(10) << setw(20) << phiCut; 

Yours, 

Christian Holm Christensen -------------------------------------------
Address: Sankt Hansgade 23, 1. th.           Phone:  (+45) 35 35 96 91 
         DK-2200 Copenhagen N                Cell:   (+45) 28 82 16 23
         Denmark                             Office: (+45) 353  25 305 
Email:   cholm@nbi.dk                        Web:    www.nbi.dk/~cholm



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