StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
selectAllM10.C
1 void selectAllM10(const char* dirname, const char *fileBase ){
2 
3  // -- example for recombining histograms by selection in new root file
4  //
5  // root.exe -q -b selectASNS.C'("dirContainingFinal.rootFile")
6  //
7 
8  gROOT->LoadMacro("load2ptLibs.C");
9  load2ptLibs();
10  TString inFile(dirname);
11  inFile+="/";
12  inFile+=fileBase;
13  inFile+=".root";
14  gSystem->Load("StEStructPoolSupport.so");
15 
16  StEStructHAdd adder;
17 
18  TFile * tf=new TFile(inFile.Data());
19 
20  if(!tf){
21  cout<<"error opening file "<<endl;
22  return ;
23  };
24 
25  //--> do all of the following
26  const char* oname[]={"all","marg1","marg2","marg3","marg4","marg5","marg6","marg7","marg8","marg9","ytlow"};
27 
28  const int _map[11][45]={ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
29  0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
30  1, 9, 10, 11, 12, 13, 14, 15, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
31  2, 10, 17, 18, 19, 20, 21, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
32  3, 11, 18, 24, 25, 26, 27, 28, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
33  4, 12, 19, 25, 30, 31, 32, 33, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
34  5, 13, 20, 26, 31, 35, 36, 37, 38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
35  6, 14, 21, 27, 32, 36, 39, 40, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
36  7, 15, 22, 28, 33, 37, 40, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
37  8, 16, 23, 29, 34, 38, 41, 43, 44, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
38  0, 1, 2, 3, 4, 5, 9, 10, 11, 12, 13, 17, 18, 19, 20, 18, 19, 20, 24, 25, 26, 30, 31, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
39 
40  int num[11]={45,9,9,9,9,9,9,9,9,9,24};
41 
42 
43  int nParentSum[2];
44  int parentSum[3][2] = { 0,0, 1,1, 2,2 };
45  for(int k=0;k<10;k++){
46  int nin = num[k];
47  int * ndata=_map[k];
48  for(int i=0;i<45;i++) cout<<ndata[i]<<",";
49  cout<<" = "<<nin<<endl;
50 
51  TString fname(dirname);
52  fname+="/";
53  fname+=fileBase;
54  fname+=oname[k];
55  fname+=".root";
56  nParentSum[0] = 3;
57  nParentSum[1] = 3;
58  adder.addCuts(fname.Data(),tf,ndata,nin,parentSum,nParentSum,1);
59  }
60 
61  TString fname(dirname);
62  fname+="/";
63  fname+=fileBase;
64  fname+="_pairDensities.root";
65  adder.addDensities(fname.Data(),tf);
66 };
67 
68