Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ShSizeHist.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file ShSizeHist.C
1 
2 void ShSizeHist(const char *part = "e")
3 {
4  int rad[11] = {0,1,2,3,4,5,6,7,8,9,100};
5  int pz[8] = {1,2,4,8,16,32,40,50};
6  char *calo[] = {"E","HO","HI","BH","MAG"};
7  double x[11];
8  double y[11];
9  double xer[11] = {0};
10  double yer[11];
11  char hname[100];
12  char fname[100];
13  sprintf(fname,"%spercent.root",part);
14  char area[100];
15  sprintf(area,"%s",part);
16  TFile *fin = TFile::Open(fname);
17  gROOT->cd();
18  for (int i=0; i<8; i++)
19  {
20  for (int j=0; j<5; j++)
21  {
22  for (int k=0; k<11;k++)
23  {
24  // TFile *fin = TFile::Open(fname);
25  x[k] = rad[k];
26  sprintf(hname,"%sSH%dRad%d%s",part,pz[i],rad[k],calo[j]);
27  TH1 *h1 = (TH1F *) fin->Get(hname);
28  if (! fin)
29  {
30  cout << "DEATH BY STUPIDITY" << endl;
31  }
32  cout << hname << endl;
33  y[k] = h1->GetMean(1);
34  yer[k] = h1->GetRMS(1);
35  }
36  gr = new TGraphErrors(10,x,y,xer,yer);
37  char gname[100];
38  sprintf(gname, "%s%d%sRADERR",part,pz[i],calo[j]);
39  gr->SetTitle(gname);
40  gr->SetName(gname);
41  gr->Draw("ALP");
42  gr->SetMarkerStyle(20);
43  gr->SetMarkerColor(2);
44  char fname[100];
45  sprintf(fname,"%sShEdepErr.root",part);
46  TFile *fout = TFile::Open(fname, "UPDATE");
47  gr->Write();
48  fout->Write();
49  fout->Close();
50  for (int m=0; m<11;m++)
51  {
52  y[m] = 0;
53  yer[m] = 0;
54  x[m] = 0;
55  }
56  }
57  }
58  fin->Close();
59 }