Re: Error in macro to add histo files

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Jan 14 2000 - 18:31:20 MET


Hi David,
Thanks for reporting the problem in the example macro hadd.C
It is now fixed.
I agree that this should become a compiled facility somewhere.
but, I do not want to put this functionality in TFile.

Rene Brun

David d'Enterria wrote:
> 
> Hello,
> 
> The macro reported in page
> http://root.cern.ch/root/html/examples/hadd.C.html contains an error:
> 
>       while (afile) { //loop on all files starting at second file
>         char* base=strstr(dact->GetPath(),":"); base+=2;
> ------------------------^^^
> 
> should read:
> 
>       while (afile) { //loop on all files starting at second file
>         char* base=strstr(root->GetPath(),":"); base+=2;
> -----------------------^^^
> 
> dact is declared as  "static TDirectory" so, as desired, it does not
> change its value when recursively calling the AddRecursive(TDirectory
> *root,TDirectory* node) method
> but as it is written now it prevents from adding the histograms found in
> OTHER (sub)directories (notably in the "root" one) ...
> 
> BTW, why not implementing a method, e.g. like "HistosAdd", in class
> TFile for performing the same work ?
> 
> Best regards,
> 
> David d'Enterria
> ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
> Groupe Photons Subatech
> http://www-subatech.in2p3.fr/~photons/subatech/
> mailto:enterria@in2p3.fr      phone: +33.2.51.85.85.60
> ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬
> Grup Física Radiacions UAB    http://cc.uab.es/~iffr2/
> mailto:d.enterria@cc.uab.es   phone: +3493.581.13.64
> 
> "In science, there is only physics; all the rest is stamp collecting",
> Ernest Rutherford



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:17 MET