File indexing completed on 2025-08-06 08:11:55
0001 void EdepPercentSmall (const char *calo="HO", const char *part="e")
0002 {
0003 char infile[100];
0004
0005
0006 char hname [100];
0007 sprintf(hname, "%s%sd",calo,part);
0008 TH1F *h1 = new TH1F(hname, hname, 100, 0, 10);
0009 for (int i=0; i<3; i++)
0010 {
0011
0012 sprintf(infile, "/sphenix/user/jpinkenburg/ShowerSize/ntuple/%s_eta0_4GeV.root",part);
0013 char hname [100];
0014
0015
0016 TFile *f = TFile::Open(infile);
0017 gROOT->cd();
0018 TNtuple *nt = (TNtuple *)f->Get("de");
0019 char calid [100];
0020 sprintf(calid, "ID==%s", i);
0021 nt->Project(hname,"edep",calid);
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049 f->Close();
0050 h1->Draw();
0051 char fname [100];
0052 sprintf(fname, "%sShowerPercent.root",part);
0053 TFile *fout = TFile::Open(fname,"UPDATE");
0054 h1->Write();
0055 fout->Write();
0056 cout << h1->Integral() << " " << hname << " " endl;
0057
0058 fout->Close();
0059 }
0060 }
0061 void EdepSmall(const char *calo="HOe", const char *part = "e")
0062 {
0063 int pz[9] = {1,2,4,8,12,16,32,40,50};
0064 double x[9];
0065 double y[9];
0066 double xer[9] = {0};
0067 double yer[9];
0068 char hname[100];
0069 char fname[100];
0070 sprintf(fname,"%spercent.root",part);
0071 char area[100];
0072 sprintf(area,"%s",calo);
0073 TFile *fin = TFile::Open(fname);
0074 gROOT->cd();
0075 for (int i=0; i<9; i++)
0076 {
0077 x[i] = pz[i];
0078 sprintf(hname,"%s%s%dd",calo,part,pz[i]);
0079 TH1 *h1 = (TH1F *) fin->Get(hname);
0080 y[i] = h1->GetMean(1);
0081 yer[i] = h1->GetRMS(1);
0082 }
0083 gr = new TGraphErrors(9,x,y,xer,yer);
0084 gr->SetTitle(area);
0085 gr->Draw("ALP");
0086 gr->SetMarkerStyle(20);
0087 gr->SetMarkerColor(2);
0088 fin->Close();
0089 }