File indexing completed on 2025-08-06 08:11:56
0001 void EdepPercentSmall ()
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 int var = 11;
0012 double intnum[1000] = {0};
0013 double varnum[1000] = {0};
0014 int i = 0;
0015
0016
0017
0018
0019
0020 sprintf(infile, "/sphenix/user/jpinkenburg/ShowerSize/ntuple/anti_neutron_eta0_50GeV.root");
0021 char hname [100];
0022 sprintf(hname, "anti_neutron50");
0023 TH1F *h1 = new TH1F(hname, hname, 8000, 0, 2);
0024 TFile *f = TFile::Open(infile);
0025 gROOT->cd();
0026 TNtuple *nt = (TNtuple *)f->Get("de");
0027 nt->Project(hname,"dtotal","(ID<=2)*edep","",100000);
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053 f->Close();
0054 h1->Draw();
0055
0056 while (var <= 8001)
0057 {
0058 intnum[i] = h1->Integral(1,var);
0059 varnum[i] = .005*(i+1);
0060 var+=11;
0061 i++;
0062 }
0063
0064
0065
0066
0067
0068
0069
0070
0071 char fname [100];
0072 sprintf(fname, "anti_neutron_ThinBins.root");
0073 TFile *fout = TFile::Open(fname,"UPDATE");
0074 h1->Write();
0075 fout->Write();
0076
0077 TH2 *h2 = new TH2F("meanvals","anti_neutron",1,0,4,1,0,50);
0078 gStyle->SetOptStat(0);
0079 TMarker *mean = new TMarker();
0080 mean->SetMarkerStyle(20);
0081 mean->SetMarkerColor(3);
0082 TCanvas *c2 = new TCanvas("c2","stupid graph",1);
0083
0084 TGraph *gr = new TGraph((i+1),varnum,intnum);
0085 gr->Draw("AC*");
0086 fout->Write();
0087 fout->Close();
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131 }
0132 void EdepSmall(const char *calo="HOe", const char *part = "e")
0133 {
0134 int pz[9] = {1,2,4,8,12,16,32,40,50};
0135 double x[9];
0136 double y[9];
0137 double xer[9] = {0};
0138 double yer[9];
0139 char hname[100];
0140 char fname[100];
0141 sprintf(fname,"%sShowerEdepPercent.root",part);
0142 char area[100];
0143 sprintf(area,"%s",calo);
0144 TFile *fin = TFile::Open(fname);
0145 gROOT->cd();
0146 for (int i=0; i<9; i++)
0147 {
0148 x[i] = pz[i];
0149 sprintf(hname,"%s%s%dd",calo,part,pz[i]);
0150 TH1 *h1 = (TH1F *) fin->Get(hname);
0151 y[i] = h1->GetMean(1);
0152 yer[i] = h1->GetRMS(1);
0153 }
0154 gr = new TGraphErrors(9,x,y,xer,yer);
0155 gr->SetTitle(area);
0156 gr->Draw("ALP");
0157 gr->SetMarkerStyle(20);
0158 gr->SetMarkerColor(2);
0159 fin->Close();
0160 }