9 #include <TGraphErrors.h>
10 #include <TMultiGraph.h>
38 Double_t invsq2pi = 0.3989422804014;
39 Double_t mpshift = -0.22278298;
55 mpc = par[1] - mpshift * par[0];
58 xlow = x[0] - sc * par[3];
59 xupp = x[0] + sc * par[3];
61 step = (xupp - xlow) / np;
64 for (i = 1.0; i <= np / 2; i++)
66 xx = xlow + (i - .5) *
step;
68 fland = TMath::Landau(xx, mpc, par[0]) / par[0];
69 sum += fland * TMath::Gaus(x[0], xx, par[3]);
71 xx = xupp - (i - .5) *
step;
72 fland = TMath::Landau(xx, mpc, par[0]) / par[0];
73 sum += fland * TMath::Gaus(x[0], xx, par[3]);
76 return (par[2] * step * sum * invsq2pi / par[3]);
83 Output.open(
"meanRMS_v1.txt");
88 { 2181, 2182, 2184, 2185, 2186, 2187, 2188, 2189, 2190, 2192 };
90 { 22, 42, 62, 82, 102, 122, 142, 152, 162, 172 };
97 { 43.4997, 45.6349, 40.8449, 47.7902, 48.4663, 39.2068, 48.3755, 83.1102 };
99 for (
int j = 0;
j < 8;
j++)
102 "/phenix/u/jinhuang/links/sPHENIX_work/Prototype_2016/Production_1101_EMCalSet2_HCalPR12/beam_0000%d-0000_DSTReader.root_DrawPrototype2MIPAnalysis_EMCDistribution_RAW_Valid_HODO_MIP_Col2_PedestalOther_TimingGood.root",
104 TFile *
_file0 = TFile::Open(name);
106 TCanvas *c1 =
new TCanvas(Form(
"getMeanRMS_run%d", runList[j]),
107 Form(
"getMeanRMS_run%d", runList[j]), 1800, 950);
110 for (
int i = 0;
i < 8;
i++)
129 c1->cd(
i + 1)->SetLogy();
130 sprintf(name,
"hEnergy_ieta2_iphi%d",
i);
131 TH1F *
h = (TH1F*) gDirectory->Get(name)->Clone();
135 TF1 *ffit =
new TF1(TString(h->GetName()) +
"_langaufun",
langaufun,
137 ffit->SetParameters(6, 50, 3000, 15);
138 ffit->SetParNames(
"Width",
"MP",
"Area",
"GSigma");
139 ffit->SetParLimits(0,0,20);
140 ffit->SetParLimits(1,0,200);
141 ffit->SetParLimits(2,0,20000);
143 ffit->SetParLimits(3,1,30);
151 Output << runList[
j] <<
"\t" << vert[
j] <<
"\t" <<
i <<
"\t"
152 << ffit->GetParameter(1) <<
"\t" << ffit->GetParError(1) <<
"\t"
153 << h->GetEntries() << endl;
155 mu[
i][
j] = ffit->GetParameter(1);
159 err[
i][
j] = ffit->GetParError(1);
174 SaveCanvas(c1, TString(name) + TString(c1->GetName()), kTRUE);
201 TLegend *
leg =
new TLegend(0.91, 0.51, 0.99, 0.89, NULL,
"brNDC");
203 TCanvas * c1 =
new TCanvas(Form(
"getMeanRMS_Summary"),
204 Form(
"getMeanRMS_Summary"), 1800, 950);
205 gPad->DrawFrame(0, 0, 200, 200);
206 for (
int i = 0;
i < 8;
i++)
208 TGraphErrors *
gr =
new TGraphErrors(7, vt[
i], mu[i], 0, err[i]);
210 gr->SetMarkerStyle(20);
211 gr->SetMarkerColor(i + 1);
217 gr->GetXaxis()->SetTitle(
"vertical position (mm)");
218 gr->GetYaxis()->SetTitle(
"MPV ADC");
227 sprintf(name,
"row %d", i);
228 leg->AddEntry(gr, name,
"p");
233 SaveCanvas(c1, TString(c1->GetName()), kTRUE);