8 void runTree(
char* dir=
"hist_pAu2",
char* filter=
"16142010",
unsigned int neventsIn = 0){
10 if( neventsIn <= 0 ) neventsIn = 1<<31-1;
12 TSystemDirectory DIR(dir, dir);
13 TList *files = DIR.GetListOfFiles();
14 TChain* trees =
new TChain();
20 while ((file=(TSystemFile*)next())) {
21 fname = file->GetName();
22 if (!file->IsDirectory() && fname.BeginsWith(filter) && fname.EndsWith(
"tree.root")) {
23 cout << Form(
"Adding %s/%s to TChain",dir,fname.Data())<<endl;
24 trees->AddFile(Form(
"%s/%s/dipi0",dir,fname.Data()));
29 cout << Form(
"%d files added",nfile) << endl;
32 std::cout <<
"***** Loading libraries *****" << endl;
36 analysisChain =
new StChain(
"dipi0Chain");
42 gSystem->Load(
"StFmsDiPi0");
44 TString filenameDiPi0(Form(
"%s/%s.dipi0.root",dir,filter));
45 cout <<
"DiPi0 outfile name = " << filenameDiPi0.Data()<<endl;
46 dipi0->setFileName(filenameDiPi0.Data());
47 dipi0->setReadTree(trees);
49 analysisChain->Init();
53 for( ; nevents < neventsIn && !ierr; ++nevents ){
54 if(nevents%10000==0) cout <<
"event: "<< nevents <<endl;
55 analysisChain->
Clear();
56 ierr = analysisChain->
Make();
67 gROOT->Macro(
"loadMuDst.C");
68 gSystem->Load(
"StStarLogger");
virtual void Delete(Option_t *opt="")
virtual void Clear(Option_t *option="")
User defined functions.