Re: [ROOT] uncertain file order after TChain::Add("<regular expression>")

From: Rene Brun (Rene.Brun@cern.ch)
Date: Wed Aug 20 2003 - 08:52:25 MEST


Hi Maksim,

Thanks for this remark.
I have modified TChain::Add in CVS to sort the files in alphanumeric order
in case a regular expression is used in the argument.

Rene Brun

"Maksim A. Nikulin" wrote:
> 
> Hi,
> 
> Firstly, mandatory info: root-3.05.07 gcc2.95.2 RedHat-7.3 binary
> installation.
> 
> I noticed that file order in a chain after
> Int_t TChain::Add(const char *name, Int_t nentries)
> is depends on file creation sequence, if I use a regular expression.
> I think the file file1.root should be before file2.root when
> chain->Add("file[1-2].root") is used.
> 
> If chain1 have a friend chain2 then inappropriate file order in any
> chain leads to wrong entry accordance.
> 
> See the script wrong_order in the attachment. Four files
> tree1.root, tree2.root, friend2.root, friend1.root are created and
> merged. I get
> <session>
> $ root wrong_order.C
> <skip />
> ************************************
> *    Row   *       var * friend_va *
> ************************************
> *        0 *         1 *         2 *
> *        1 *         2 *         1 *
> ************************************
> </session>
> 
> I expect
> <expected>
> ************************************
> *    Row   *       var * friend_va *
> ************************************
> *        0 *         1 *         1 *
> *        1 *         2 *         2 *
> ************************************
> </expected>
> 
> I think this effect takes place because of simple loop other directory
> without sorting in the
> Int_t TChain::Add(const char *name, Int_t nentries)
> implementation.
> 
> Best regards,
> Maksim Nikulin
> 
>   --------------------------------------------------------------------------------
>                     Name: wrong_order.C
>    wrong_order.C    Type: Plain Text (text/plain)
>                 Encoding: 7bit



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:14 MET