Hi Philip,
In addition to the solution to use the concatenation of TString, note that
you can also use wilcarding to create a TChain, eg
TChain run1("h45");
run1.Add("/nfs/farm/babar/AWG11/Charmonium/Etac/ntp13/good_1999-b1-s0-r10B-on_all_*.root")
run1.Add("/nfs/farm/babar/AWG11/Charmonium/Etac/ntp13/good_2000-b1-s0-r10B-on_all_*.root")
Rene Brun
On Fri, 6 Sep 2002, Philip Clark wrote:
>
> Hi Everyone,
>
> Currently, I am trying to loop over files and make chains. In PAW I would do:-
>
> MACRO run1
> do i=1,12
> chain run1 good_1999-b1-s0-r10B-on_all_[i].hbook
> enddo
> do i=1,57
> chain run1 good_2000-b1-s0-r10B-on_all_[i].hbook
> enddo
> etc
>
> I root I am trying to do something like
>
> TChain run1("h45");
> for (Int_t i=1; i<13, i++)
> {
> run1.Add("/nfs/farm/babar/AWG11/Charmonium/Etac/ntp13/good_1999-b1-s0-r10B-on_all_[i].root");
> }
> for (Int_t i=1; i<58, i++)
> {
> run1.Add("/nfs/farm/babar/AWG11/Charmonium/Etac/ntp13/good_2000-b1-s0-r10B-on_all_[i].root");
> }
>
> Obviously [i] wont work here... Any ideas instead? I need to loop over
> several thousand files in this manner. So a better solution would help a
> lot.
>
> Also a way to substitute the path
> /nfs/farm/babar/AWG11/Charmonium/Etac/ntp13/
> which is the same all the time would be good as well.
>
> Thanks
>
> -Phil
>
> --
> Philip J. Clark MS41 (Bristol), SLAC
> tel: 1-650-926-3761 Stanford University
> fax: 1-650-926-3767 P.O. Box 20450
> pclark@slac.stanford.edu Stanford, California 94309
>
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:51:08 MET