File indexing completed on 2025-08-07 08:11:56
0001 void EdepPercentSmall (const char *part="e")
0002 {
0003 char infile[100];
0004 int pz[9] = {1,2,4,8,12,16,32,40,50};
0005 double x[9];
0006 double means[9] = {0};
0007 double y[9];
0008 double mval = 0;
0009 int lastbincont = 0;
0010 bool lastbin = false;
0011
0012 for (int i=0; i<9; i++)
0013 {
0014 x[i] = pz[i];
0015 y[i] = means[i];
0016 sprintf(infile, "/sphenix/user/jpinkenburg/ShowerSize/ntuple/%s_eta0_%dGeV.root",part, pz[i]);
0017 char hname [100];
0018 sprintf(hname, "%s%dd",part,pz[i]);
0019 TH1F *h1 = new TH1F(hname, hname, 8000, 0, 4);
0020 TFile *f = TFile::Open(infile);
0021 gROOT->cd();
0022 TNtuple *nt = (TNtuple *)f->Get("de");
0023 nt->Project(hname,"dtotal","(ID<=2)*edep");
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
0052
0053
0054
0055
0056
0057
0058 char fname [100];
0059 sprintf(fname, "%s_ThinBins.root",part);
0060 TFile *fout = TFile::Open(fname,"UPDATE");
0061 h1->Write();
0062 fout->Write();
0063 cout << h1->Integral() << " " << hname << " " << pz[i] << endl;
0064 fout->Write();
0065 fout->Close();
0066 }
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109 }
0110 void EdepSmall(const char *calo="HOe", const char *part = "e")
0111 {
0112 int pz[9] = {1,2,4,8,12,16,32,40,50};
0113 double x[9];
0114 double y[9];
0115 double xer[9] = {0};
0116 double yer[9];
0117 char hname[100];
0118 char fname[100];
0119 sprintf(fname,"%sShowerEdepPercent.root",part);
0120 char area[100];
0121 sprintf(area,"%s",calo);
0122 TFile *fin = TFile::Open(fname);
0123 gROOT->cd();
0124 for (int i=0; i<9; i++)
0125 {
0126 x[i] = pz[i];
0127 sprintf(hname,"%s%s%dd",calo,part,pz[i]);
0128 TH1 *h1 = (TH1F *) fin->Get(hname);
0129 y[i] = h1->GetMean(1);
0130 yer[i] = h1->GetRMS(1);
0131 }
0132 gr = new TGraphErrors(9,x,y,xer,yer);
0133 gr->SetTitle(area);
0134 gr->Draw("ALP");
0135 gr->SetMarkerStyle(20);
0136 gr->SetMarkerColor(2);
0137 fin->Close();
0138 }