StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
selectAllM0.C
1 void selectAllM0(const char* dirname, const char *fileBase ){
2 
3  // -- example for recombining histograms by selection in new root file
4  //
5  // root.exe -q -b selectAllM0.C'("dirContainingRootFile","fileBase")
6  // fileBase is the file name without the .root extension.
7  //
8 
9  gROOT->LoadMacro("load2ptLibs.C");
10  load2ptLibs();
11  gSystem->Load("StEStructPoolSupport.so");
12 
13  TString inFile(dirname);
14  inFile+="/";
15  inFile+=fileBase;
16  inFile+=".root";
17 
18  StEStructHAdd adder;
19 
20  TFile * tf=new TFile(inFile.Data());
21  if(!tf){
22  cout<<"error opening file "<<endl;
23  return ;
24  };
25 
26  TString fname(dirname);
27  fname+="/";
28  fname+=fileBase;
29  fname+="Symm.root";
30 
31  int ndata[] = {0};
32  int parentSum[1][2] = {0, 0};
33  int nPararentSum[] = {1,1};
34  adder.addCuts(fname.Data(),tf,ndata,1,parentSum,nParentSum);
35 
36  TString fname(dirname);
37  fname+="/";
38  fname+=fileBase;
39  fname+="_pairDensities.root";
40  adder.addDensities(fname.Data(),tf);
41 };
42 
43