StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
selectAllM8.C
1 void selectAllM8(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  StEStructCutBin* cb = StEStructCutBin::Instance();
25  cb->setMode(8);
26 
27  //--> do all of the following
28  const char* oname[] = {"all","soft","neck","hard","softNeck","softHar","neckHard"};
29 
30  const int _map[6] = {0, 1, 2, 3, 4, 5};
31 
32  int parentSum[3][2] = { 0,0, 1,1, 2,2 };
33  int nParentSum[2];
34 
35  cout << "all" << endl;
36  TString fname(dirname); fname += "/"; fname += fileBase; fname+="all.root";
37  parentSum[0][0] = 0; parentSum[0][1] = 0;
38  parentSum[1][0] = 1; parentSum[1][1] = 1;
39  parentSum[2][0] = 2; parentSum[2][1] = 2;
40  int ndata = 0;
41  nParentSum[0] = 3;
42  nParentSum[1] = 3;
43  adder.addCuts(fname.Data(),tf,_map,6,parentSum,nParentSum,1);
44 
45  cout << "soft" << endl;
46  TString fname(dirname); fname += "/"; fname += fileBase; fname+="soft.root";
47  parentSum[0][0] = 0; parentSum[0][1] = 0;
48  int ndata = 0;
49  nParentSum[0] = 1;
50  nParentSum[1] = 1;
51  adder.addCuts(fname.Data(),tf,&ndata,1,parentSum,nParentSum);
52 
53  cout << "neck" << endl;
54  TString fname(dirname); fname += "/"; fname += fileBase; fname+="neck.root";
55  parentSum[0][0] = 1; parentSum[0][1] = 1;
56  int ndata = 1;
57  nParentSum[0] = 1;
58  nParentSum[1] = 1;
59  adder.addCuts(fname.Data(),tf,&ndata,1,parentSum,nParentSum);
60 
61  cout << "hard" << endl;
62  TString fname(dirname); fname += "/"; fname += fileBase; fname+="hard.root";
63  parentSum[0][0] = 2; parentSum[0][1] = 2;
64  int ndata = 2;
65  nParentSum[0] = 1;
66  nParentSum[1] = 1;
67  adder.addCuts(fname.Data(),tf,&ndata,1,parentSum,nParentSum);
68 
69  cout << "soft-neck" << endl;
70  TString fname(dirname); fname += "/"; fname += fileBase; fname+="softNeck.root";
71  parentSum[0][0] = 0; parentSum[0][1] = 1;
72  int ndata = 3;
73  nParentSum[0] = 1;
74  nParentSum[1] = 1;
75  adder.addCuts(fname.Data(),tf,&ndata,1,parentSum,nParentSum);
76 
77  cout << "soft-hard" << endl;
78  TString fname(dirname); fname += "/"; fname += fileBase; fname+="softHard.root";
79  parentSum[0][0] = 0; parentSum[0][1] = 2;
80  int ndata = 4;
81  nParentSum[0] = 1;
82  nParentSum[1] = 1;
83  adder.addCuts(fname.Data(),tf,&ndata,1,parentSum,nParentSum);
84 
85  cout << "neck-hard" << endl;
86  TString fname(dirname); fname += "/"; fname += fileBase; fname+="neckHard.root";
87  parentSum[0][0] = 1; parentSum[0][1] = 2;
88  int ndata = 5;
89  nParentSum[0] = 1;
90  nParentSum[1] = 1;
91  adder.addCuts(fname.Data(),tf,&ndata,1,parentSum,nParentSum);
92 
93 
94  for(int k=1;k<7;k++) {
95  int nin = num[k];
96  int *ndata = &_map[k];
97  }
98 
99  TString fname(dirname);
100  fname+="/";
101  fname+=fileBase;
102  fname+="_pairDensities.root";
103  adder.addDensities(fname.Data(),tf);
104 };
105 
106