StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DoHiPt.C
1 void DoHiPt(const char* inDir = "links/P02gc.productionCentral.FullField.2001.313.mdst",
2  const char* outFile = "HiPt.Test.hist.root",
3  Int_t cut = 99999999,
4  const char* analysis = "StHiJennsAnalysis",
5  const char* extra="hello",
6  char half = 0,
7  float vertexZSkip=0,
8  float hitAvoid=0,
9  char geomHalf=0)
10 {
11 
12  gSystem->Load("StHiMicroEvent");
13  gSystem->Load("StHiMicroAnalysis");
14 
15  Int_t nevent = 99999;
16  Int_t nfile = 99999;
17 
18  cout << "inDir : " << inDir << endl;
19  cout << "outFile : " << outFile << endl;
20 
21  cout << "*********** Using cut type : " << cut << endl;
22 
23  cout << "*********** Analysis type : " << analysis << endl;
24 
25  // derived classes...
26 
27  StHiBaseAnalysis* hi =0 ;
28 
29  if(strcmp(analysis,"StHiJennsAnalysis")==0){
30  hi = new StHiJennsAnalysis(inDir,outFile);
31  }
32  else if(strcmp(analysis,"StHiSpectra")==0){
33  hi = new StHiSpectra(inDir,outFile,extra);
34  StHiSpectra* hiSpectra=dynamic_cast<StHiSpectra*>(hi);
35  Cut::mDoSpectraCent=1;
36 
37  // if(extra) {
38  // cout << "Setting eff file : " << extra << endl;
39  // hiSpectra->setEfficiencyFileName(extra);
40  // cout << "Reality check " << hiSpectra->efficiencyFileName() << endl;
41  // }
42  }
43  else if(strcmp(analysis,"StDcaAnalysis")==0){
44  hi = new StDcaAnalysis(inDir,outFile);
45  }
46 
47  // additional stuff
48 
49  //This sets all cuts based on the input string
50  // a. Centrality (minbias)
51  // b. Which Centrality definition for Spectra (flow)
52  // c. Which centrality definition for corrections/other (flow)
53  // d. Vertex Range (-200,200)
54  // e. Use only half of TPC or not (none)
55  // f. Numnber of fitpts (20-45)
56  // g. 3d dca cut (1 cm)
57  // h. eta range (0.5)
58  //All 9's is default
59 
60  Cut::SetCut(cut);
61 
62  if(half){
63  if(hitAvoid || Cut::mHitAvoid){
64  cout << "Using hit half : " << half << endl;
65  Cut::SetHitHalf(half);
66  }
67  else{
68  cout << "Using half : " << half << endl;
69  Cut::SetHalf(half); // this overrides the vertex cut
70  }
71  }
72  if(geomHalf){
73  cout << "Using geom half : " << geomHalf << endl;
74  Cut::SetGeomHalf(geomHalf);
75  }
76 
77  if(vertexZSkip){
78  cout << "Skipping vertex region " << vertexZSkip << endl;
79  Cut::SetVertexZSkip(vertexZSkip);
80  }
81  else if(hitAvoid){
82  cout << "Avoiding hits " << hitAvoid << endl;
83  Cut::SetHitAvoid(hitAvoid);
84  }
85 
86  hi->setNEvent(nevent);
87  hi->setNFile(nfile);
88 
89 
90  Int_t stat = hi->Init();
91  if(stat){
92  cout << "Trouble with Init()" << endl;
93  return;
94  }
95 
96  hi->Run();
97  hi->Finish();
98 
99 }