1 #include "sPhenixStyle.C"
2 #include "sPhenixStyle.h"
4 TPad*
getPad(
int j,
int k,
int l,
float cw,
float ch,
const int nEBins,
const int nCutBins);
7 void drawCanvas_invMass(TCanvas *
c, TH1F *hCorr,
int pad_x,
int pad_y, TPad *pad,
int isEta,
float peakPos,
float peakW);
9 void SetHistoStyle(TH1F *histo,
int cutBin,
int eBin,
float low,
float hi,
int isEta);
13 void GetSubtractedDist(TH1F *histOrig, TH1F *histSub, TF1 *invMassFit, TF1 *invMassBG);
16 float eBins[] = {1,2,3,4,5,6,7,8,9,10,11,12,13};
18 float eCuts[] = {0.5,0.6,0.7,0.8,0.9,1.,1.1};
29 TFile *fin =
new TFile(input);
31 string th1List[] = {
"photonE_Reco",
"isoPhotonE_Reco_Tru",
"truthPi0E",
"truthDphoE",
"pi0ETruthReco"};
33 string th1xAxis[] = {
"E_{#gamma}",
"E_{#gamma}^{Iso}",
"E_{#pi^{0}}^{Truth}",
"E_{#gamma_{Dir}}^{Truth}",
"E_{#pi^{0}}^{Reco}/E_{#pi^{0}}^{Truth}"};
35 string th2List[] = {
"clusterChi2",
"clusterProbPhoton",
"isoPhotonChi2",
"isoPhotonProb2",
"tspE",
"tspEiso",
"asymEtruthpi0",
"deltaREtruthpi0"};
37 string th2xAxis[] = {
"Cluster #xhi^{2}",
"Cluster Photon Prob",
"Iso Cluster #chi^{2}",
"Iso Cluster Prob",
"TSP",
"TSP",
"#frac{|E_{1} - E_{2}|}{E_{#pi^0}}",
"#Delta R [rad]"};
39 string th2yAxis[] = {
"E_{Cluster}",
"E_{Cluster}",
"E_{Cluster}",
"E_{Cluster}",
"E_{Cluster}",
"E_{Cluster}",
"E_{#pi^{0}}",
"E_{#pi^{0}}"};
41 string th3List[] = {
"deltaREinvMass",
"asymEinvMass",
"invMassEtaE",
"dphoChi2",
"dphoProb",
"pi0Chi2",
"pi0Prob",
"etaChi2",
"etaProb",
"eChi2",
"eProb",
"hChi2",
"hProb",
"ePi0InvMassEcut0"};
43 string th3xAxis[] = {
"#DeltaR",
"#frac{|E_{1} - E_{2}|}{E_{#pi^0}}",
"M_{#gamma#gamma}",
"#chi^{2}",
"Cluster Photon Prob",
"#chi^{2}",
"Cluster Photon Prob",
"#chi^{2}",
"Cluster Photon Prob",
"#chi^{2}",
"Cluster Photon Prob",
"#chi^{2}",
"Cluster Photon Prob",
"E_{#pi^{0}}^{Reco}"};
45 string th3yAxis[] = {
"E_{#pi^{0}}^{Reco}",
"E_{#pi^{0}}^{Reco}",
"#eta",
" E_{Cluster}^{#gamma} [GeV]",
"E_{Cluster}^{#gamma}[GeV]",
"E_{Cluster}^{#pi^{0}}[GeV]",
"E_{Cluster}^{#pi^{0}}[GeV]",
"E_{Cluster}^{#eta}[GeV]",
"E_{Cluster}^{#eta}[GeV]",
"E_{Cluster}^{e^{#pm}}[GeV]",
"E_{Cluster}^{e^{#pm}}[GeV]",
"E_{Cluster}^{h^{#pm}}[GeV]",
"E_{Cluster}^{h^{#pm}}[GeV]",
"M_{#gamma#gamma}"};
47 string th3zAxis[] = {
"M_{#gamma#gamma}[GeV/c^{2}]",
"M_{#gamma#gamma}[GeV/c^{2}]",
"E^{#gamma}_{Reco}[GeV]",
"E^{#gamma}_{True}[GeV]",
"E^{#gamma}_{True}[GeV]",
"E^{#pi^{0}}_{True}[GeV]",
"E^{#pi^{0}}_{True}[GeV]",
"E^{#eta}_{True}[GeV]",
"E^{#eta}_{True}[GeV]",
"E^{e^{#pm}}_{True}[GeV]",
"E_{e^{#pm}}_{True}[GeV]",
"E_{#pi^{#pm}}_{True}[GeV]",
"E^{#pi^{#pm}}_{True}[GeV]",
"E_{Cut}[GeV]"};
74 const int nTh3 = (int)
sizeof(th3List)/
sizeof(th3List[0]);
75 const int nEBins = (int)
sizeof(
eBins)/
sizeof(
eBins[0]);
76 const int nCutBins = (int)
sizeof(
eCuts)/
sizeof(
eCuts[0]);
80 TGraphErrors *chi2E[5][2];
83 TGraphErrors *probE[5][2];
146 float cw = 2*966, ch = 1.3*637;
149 TPad *pad_invMass[nEBins-1][nCutBins][
nEtaBins];
152 TPad *pad_invMassSub[nEBins-1][nCutBins][
nEtaBins];
155 TPad *pad_matchMass[nEBins-1][nCutBins][
nEtaBins];
160 TGraphErrors *yields[nCutBins][
nEtaBins];
161 TGraphErrors *yieldsMatched[nCutBins][
nEtaBins];
162 TGraphErrors *matchZeroFrac[nCutBins][
nEtaBins];
163 TF1 *invMassFit, *invMassFitBG;
164 int colors[] = {1,2,4,kGreen+2, kViolet,kCyan,kOrange+2,kMagenta+2,kAzure-2};
165 TLegend *leggy =
new TLegend(.161, .729, .722, .939 );
166 leggy -> SetNColumns(3);
170 float xEndFit = 0.25;
171 float xStartFit = 0.07;
172 float xEndHist = 0.25;
173 float xStartHist = 0.07;
174 float invMassWindow[2] = {0.112, 0.162};
175 float peakPos[nEBins - 1][nCutBins][
nEtaBins];
176 float peakW[nEBins - 1][nCutBins][
nEtaBins];
182 cMatchMass[
k] =
new TCanvas(Form(
"cMatchMass_Eta%d",
k),
"Mass from Matched Cluster",cw,ch);
183 cMatchMass[
k] ->
Range(0,0,1,1);
185 cSubMass[
k]=
new TCanvas(Form(
"cMassSubPi0_Eta%d",
k),
"Subtracted Mass Dist",cw,ch);
186 cSubMass[
k] ->
Range(0,0,1,1);
188 cPi0Cut[
k] =
new TCanvas(Form(
"cMassPi0_Eta%d",
k),
"Invariant Mass",cw,ch);
189 cPi0Cut[
k] ->
Range(0,0,1,1);
191 hist[
k] = (TH3F*)fin ->
Get(Form(
"ePi0InvMassEcut_0Match_Eta%d",
k));
192 histMatched[
k] = (TH3F*)fin ->
Get(Form(
"ePi0InvMassEcut_1Match_Eta%d",
k));
194 for(
int i = 0;
i < nEBins - 1;
i++)
196 for(
int j = 0;
j < nCutBins;
j++)
200 mass[
j][
k] =
new TGraphErrors();
203 width[
j][
k] =
new TGraphErrors();
206 yields[
j][
k] =
new TGraphErrors();
209 yieldsMatched[
j][
k] =
new TGraphErrors();
212 matchZeroFrac[
j][
k] =
new TGraphErrors();
216 pad_invMass[
i][
j][
k] =
getPad(
i,
j,
k,cw,ch,nEBins , nCutBins);
217 pad_invMass[
i][
j][
k] ->
cd();
219 pad_invMassSub[
i][
j][
k] =
getPad(
i,
j,
k,cw,ch,nEBins , nCutBins);
221 pad_matchMass[
i][
j][
k] =
getPad(
i,
j,
k,cw,ch,nEBins, nCutBins);
225 TH1F *hist1DMatched = (TH1F*)histMatched[
k] ->
ProjectionY(Form(
"invMass_E%d_Cut%d_eta%d_Matched",
i,
j,
k), histMatched[
k] ->
GetXaxis() -> FindBin(
eBins[
i] + 0.001), histMatched[
k] ->
GetXaxis() -> FindBin(
eBins[
i+1] - 0.0001), histMatched[
k] ->
GetZaxis() -> FindBin(
eCuts[
j] + 0.0001), histMatched[
k] -> GetNbinsZ());
228 TH1F *invMassSub = (TH1F*)hist1D -> Clone();
231 invMassFit =
new TF1(Form(
"invMassFit_E%d_Cut%d_Eta%d",
i,
j,
k),
"[0] + [1]*x + [2]*pow(x,2)+ [3]*pow(x,3)+ [4]*pow(x,4)+ [8]*pow(x,6) +[5]*exp(-(([7]-x)^2)/(2*[6]^2))");
234 invMassFitBG =
new TF1(Form(
"invMassFit_E%d_Cut%d_Eta%dBG",
i,
j,
k),
"[0] + [1]*x + [2]*pow(x,2)+ [3]*pow(x,3)+ [4]*pow(x,4)+ [8]*pow(x,6) +[5]*exp(-(([7]-x)^2)/(2*[6]^2)) - [5]*exp(-(([7]-x)^2)/(2*[6]^2))");
236 invMassFit -> FixParameter(8,0);
243 invMassFit ->
SetParLimits(7, 0.135 - 0.07, 0.135 + 0.07);
246 invMassFit ->
SetParameter(5, hist1D -> GetMaximum()*2);
249 else invMassFit ->
SetParameter(5,hist1D -> GetMaximum());
250 hist1D -> Fit(invMassFit,
"Q",
"",xStartFit, xEndFit);
255 peakPos[
i][
j][
k] = peakPosition;
258 peakW[
i][
j][
k] = peakWidth;
259 Double_t yieldErr, yieldErrMatched;
262 if(hist1D -> Integral() == 0) yield = 0;
263 else yield = invMassSub -> IntegralAndError(invMassSub ->
GetXaxis() -> FindBin((peakPosition - sigma*peakWidth)+0.0001), invMassSub ->
GetXaxis() -> FindBin((peakPosition + sigma*peakWidth)+0.0001), yieldErr,
"");
265 float yieldMatched = hist1DMatched -> IntegralAndError(hist1DMatched -> FindFirstBinAbove(0), hist1DMatched -> GetNbinsX(), yieldErrMatched,
"");
283 float zeroMatchYield = hist1DMatched -> GetBinContent(hist1DMatched -> FindFirstBinAbove(0));
284 float zeroMatchYieldErr = hist1DMatched -> GetBinError(46);
285 float matchYieldRatio = zeroMatchYield/yieldMatched;
286 float zeroMatchYieldRatErr = matchYieldRatio*sqrt(pow(yieldErrMatched/yieldMatched,2) + pow(zeroMatchYieldErr/zeroMatchYieldErr,2));
291 hist1D ->
GetXaxis() -> SetRangeUser(xStartHist,xEndHist);
293 TCanvas *cMassFitCheck =
new TCanvas();
294 hist1D ->
SetTitle(
";M_{#gamma#gamma} [GeV/c^{2}];");
295 hist1D ->
Draw(
"epx0");
298 invMassFitBG ->
Draw(
"same");
300 marks.DrawLatexNDC(0.5,0.3,Form(
"#splitline{E_{Min} > %g GeV}{%g > E_{#pi^{0}} > %g}",
eCuts[
j],
eBins[
i],
eBins[i+1]));
301 cMassFitCheck -> SaveAs(Form(
"plots/invMassFitCheck_%dE_%dCut_Sigma%g_Eta%d.pdf",i,j,sigma,
k));
304 TCanvas *cMassMatchCheck =
new TCanvas();
305 hist1DMatched ->
SetTitle(
";M_{#gamma#gamma} [GeV/c^{2}];");
306 hist1DMatched ->
Draw(
"epx0");
308 marks.DrawLatexNDC(0.5,0.85,Form(
"#splitline{E_{Min} > %g GeV}{%g > E_{#pi^{0}} > %g}",
eCuts[j],
eBins[i],
eBins[i+1]));
309 cMassMatchCheck -> SaveAs(Form(
"plots/invMassMatchCheck_%dE_%dCut_Sigma%g_Eta%dMatch.pdf",i,j,sigma,
k));
311 drawCanvas_invMass(cPi0Cut[
k], hist1D, j, i, pad_invMass[i][j][k], 0, peakPos[i][j][k], sigma*peakW[i][j][k]);
312 invMassFitBG ->
Draw(
"same");
313 pad_invMassSub[
i][
j][
k] ->
cd();
315 invMassSub ->
GetXaxis() -> SetRangeUser(xStartHist, xEndHist);
316 drawCanvas_invMass(cSubMass[k], invMassSub, j, i, pad_invMassSub[i][j][k], 0, peakPos[i][j][k], sigma*peakW[i][j][k]);
318 pad_matchMass[
i][
j][
k] ->
cd();
319 drawCanvas_invMass(cMatchMass[k], hist1DMatched, j, i, pad_matchMass[i][j][k], 1, peakPos[i][j][k], sigma*peakW[i][j][k]);
324 cPi0Cut[
k] -> SaveAs(Form(
"plots/invMassCuts_Sigma%g_Eta%d.pdf",sigma,
k));
325 cSubMass[
k] -> SaveAs(Form(
"plots/invMassCutsSubtracted_Sigma%g_Eta%d.pdf",sigma,
k));
326 cMatchMass[
k] -> SaveAs(Form(
"plots/invMassMatched_Sigma%g_Eta%d.pdf",sigma,
k));
333 cMass[
k] =
new TCanvas();
334 for(
int i = 0;
i < nCutBins;
i++)
339 mass[
i][
k] ->
GetYaxis() -> SetRangeUser(0.130,0.180);
344 else mass[
i][
k] ->
Draw(
"samep");
348 leggy ->
Draw(
"same");
349 cMass[
k] -> SaveAs(Form(
"plots/invMassGraphPeakPos_Sigma%g_Eta%d.pdf",sigma,
k));
355 cWidth[
k] =
new TCanvas();
357 for(
int i = 0;
i < nCutBins;
i++)
361 width[
i][
k] ->
Draw(
"ap");
362 width[
i][
k] ->
GetYaxis() -> SetRangeUser(0.013, 0.028);
367 else width[
i][
k] ->
Draw(
"samep");
370 leggy ->
Draw(
"same");
371 cWidth[
k] -> SaveAs(Form(
"plots/invMassGraphPeakWidth_Sigma%g_Eta%d.pdf",sigma,
k));
377 cYields[
k] =
new TCanvas();
378 for(
int i = 0;
i < nCutBins;
i++)
382 yields[
i][
k] ->
Draw(
"ap");
383 yields[
i][
k] ->
GetYaxis() -> SetRangeUser(1e3,1e7);
387 else yields[
i][
k] ->
Draw(
"samep");
391 leggy ->
Draw(
"same");
392 cYields[
k] -> SaveAs(Form(
"plots/invMassYield_Sigma%g_Eta%d.pdf",sigma,
k));
398 cYieldsMatch[
k] =
new TCanvas();
399 for(
int i = 0;
i < nCutBins;
i++)
403 yieldsMatched[
i][
k] ->
Draw(
"ap");
404 yieldsMatched[
i][
k] ->
GetYaxis() -> SetRangeUser(1e3,1e7);
408 else yields[
i][
k] ->
Draw(
"samep");
412 leggy ->
Draw(
"same");
413 cYields[
k] -> SaveAs(Form(
"plots/invMassYield_Sigma%g_Eta%d_Matched.pdf",sigma,
k));
417 for(
int i = 0;
i <
nEtaBins;
i++) pi0TruSpec[
i] = (TH1F*)fin ->
Get(Form(
"truthPi0E_Eta%d",
i));
418 TGraphErrors *pi0Eff[nCutBins][
nEtaBins];
425 cEff[
k] =
new TCanvas();
428 for(
int i = 0;
i < nCutBins ;
i++)
430 pi0Eff[
i][
k] =
new TGraphErrors();
431 for(
int j = 0;
j < nEBins;
j++)
433 Double_t pi0TruthYieldErr;
434 float pi0TruthYield = pi0TruSpec[
k] -> IntegralAndError(pi0TruSpec[
k] ->
GetXaxis() -> FindBin(
eBins[
j]+0.001), pi0TruSpec[
k] ->
GetXaxis() -> FindBin(
eBins[
j+1]-0.001), pi0TruthYieldErr,
"");
437 Double_t
x, pi0YieldMeas, pi0YieldErr;
438 yields[
i][
k] -> GetPoint(
j, x, pi0YieldMeas);
439 pi0YieldErr = yields[
i][
k] -> GetErrorY(
j);
440 float eff = pi0YieldMeas/pi0TruthYield;
441 float err = eff*sqrt(pow(pi0YieldErr/pi0YieldMeas,2) + pow(pi0TruthYieldErr/pi0TruthYield,2));
442 if(eff < scaleMin) scaleMin = eff;
443 if(eff > scaleMax) scaleMax = eff;
450 pi0Eff[
i][
k] ->
Draw(
"ap");
451 pi0Eff[
i][
k] ->
GetYaxis() -> SetRangeUser(-0.01,scaleMax*1.4);
455 else pi0Eff[
i][
k] ->
Draw(
"samep");
458 leggy ->
Draw(
"same");
459 cEff[
k] -> SaveAs(Form(
"plots/pi0Eff_Sigma%g_Eta%d.pdf",sigma,
k));
462 TGraphErrors *pi0EffMatch[nCutBins][
nEtaBins];
469 cEffMatch[
k] =
new TCanvas();
470 for(
int i = 0;
i < nCutBins ;
i++)
472 pi0EffMatch[
i][
k] =
new TGraphErrors();
473 for(
int j = 0;
j < nEBins - 1;
j++)
475 Double_t pi0TruthYieldErr;
476 float pi0TruthYield = pi0TruSpec[
k] -> IntegralAndError(pi0TruSpec[
k] ->
GetXaxis() -> FindBin(
eBins[
j]+0.001), pi0TruSpec [
k]->
GetXaxis() -> FindBin(
eBins[
j+1]-0.001), pi0TruthYieldErr,
"");
478 Double_t
x, pi0YieldMeas, pi0YieldErr;
479 yieldsMatched[
i][
k] -> GetPoint(
j, x, pi0YieldMeas);
480 pi0YieldErr = yieldsMatched[
i][
k] -> GetErrorY(
j);
481 float eff = pi0YieldMeas/pi0TruthYield;
482 float err = eff*sqrt(pow(pi0YieldErr/pi0YieldMeas,2) + pow(pi0TruthYieldErr/pi0TruthYield,2));
483 if(eff < scaleMin) scaleMin = eff;
484 if(eff > scaleMax) scaleMax = eff;
491 pi0EffMatch[
i][
k] ->
Draw(
"ap");
492 pi0EffMatch[
i][
k] ->
GetYaxis() -> SetRangeUser(-0.01,scaleMax*1.25);
496 else pi0EffMatch[
i][
k] ->
Draw(
"samep");
499 leggy ->
Draw(
"same");
500 cEffMatch[
k] -> SaveAs(Form(
"plots/pi0Eff_Sigma%g_Eta%d_Matched.pdf",sigma,
k));
506 cZeroFrac[
k] =
new TCanvas();
507 for(
int j = 0;
j < nCutBins;
j++)
511 matchZeroFrac[
j][
k] ->
Draw(
"ap");
513 matchZeroFrac[
j][
k] ->
SetTitle(
";E_{#pi^{0}}^{Truth} [GeV]; N^{Unmatched}/N^{Matched}");
515 else matchZeroFrac[
j][
k] ->
Draw(
"samep");
517 leggy ->
Draw(
"same");
518 cZeroFrac[
k] -> SaveAs(Form(
"plots/matchedZeroYieldFrac_Sigma%g_Eta%d.pdf",sigma,
k));
523 TCanvas *cMiss =
new TCanvas();
527 TH3F *unmatchedLocale = (TH3F*)fin ->
Get(
"unmatchedLocale");
529 float eBinsMerge[] = {1,4,5,9,13};
531 for(
int i = 0;
i < 4;
i++)
533 unmatchedLocale ->
GetZaxis() -> SetRangeUser(eBinsMerge[
i], eBinsMerge[i+1]);
534 TH2F *locationProj = (TH2F*)unmatchedLocale -> Project3D(
"yx");
535 locationProj ->
SetTitle(Form(
"%g < E^{#pi^{0}}_{Truth} < %g;#eta;#phi [rad]", eBinsMerge[i], eBinsMerge[i+1]));
536 locationProj ->
Draw(
"colz");
537 marks.DrawLatexNDC(0.2,0.5,Form(
"%g < E^{#pi^{0}}_{Truth} < %g", eBinsMerge[i], eBinsMerge[i+1]));
539 cMiss -> SaveAs(Form(
"plots/missLocationBin_%d.pdf",i));
542 TCanvas *cMassScale =
new TCanvas();
543 TH3F *invMassPhoPi0 = (TH3F*)fin ->
Get(
"invMassPhoPi0");
545 float massZones[] = {0,0.100,0.200,1};
547 for(
int i = 0;
i < 3;
i++)
549 TH1F *pi0EScale = (TH1F*)invMassPhoPi0 -> ProjectionZ(Form(
"pi0EScale_%d",
i),invMassPhoPi0 ->
GetXaxis() -> FindBin(massZones[
i] + 0.0001), invMassPhoPi0 ->
GetXaxis() -> FindBin(massZones[
i + 1] - 0.0001), 1, invMassPhoPi0 -> GetNbinsY());
550 pi0EScale ->
SetTitle(Form(
"%g < M_{#gamma#gamma} < %g; E_{Reco}^{#pi^{0}}/E_{True}^{#pi^{0}};",massZones[
i], massZones[i+1]));
552 marks.DrawLatexNDC(0.7,0.85,Form(
"%g < M_{#gamma#gamma} < %g",massZones[i], massZones[i+1]));
553 cMassScale -> SaveAs(Form(
"plots/pi0EScale_MassBin_%d.pdf",i));
556 TH1F *phoEScale = (TH1F*)invMassPhoPi0 ->
ProjectionY(Form(
"phoEScale_%d",i),invMassPhoPi0 ->
GetXaxis() -> FindBin(massZones[i] + 0.0001), invMassPhoPi0 ->
GetXaxis() -> FindBin(massZones[i + 1] - 0.0001), 1, invMassPhoPi0 -> GetNbinsZ());
557 phoEScale ->
SetTitle(Form(
"%g < M_{#gamma#gamma} < %g; E_{Reco}^{#gamma}/E_{True}^{#gamma};",massZones[i], massZones[i+1]));
559 marks.DrawLatexNDC(0.7,0.85,Form(
"%g < M_{#gamma#gamma} < %g",massZones[i], massZones[i+1]));
561 cMassScale -> SaveAs(Form(
"plots/phoEScale_MassBin_%d.pdf",i));
564 TCanvas *cMassPhi =
new TCanvas();
565 TH3F *invMassEPhi = (TH3F*)fin ->
Get(
"invMassEPhi");
567 for(
int i = 0;
i < 4;
i++)
569 invMassEPhi ->
GetYaxis() -> SetRangeUser(eBinsMerge[
i],eBinsMerge[i+1]);
570 TH2F *invMassPhi = (TH2F*)invMassEPhi -> Project3D(
"xz");
572 invMassPhi ->
SetTitle(Form(
"%g < E^{#pi^{0}}_{Truth} < %g; #phi [rad]; M_{#gamma#gamma};",eBinsMerge[i], eBinsMerge[i+1] ));
573 invMassPhi ->
Draw(
"colz");
574 marks.DrawLatexNDC(0.2,0.18,Form(
"%g < E^{#pi^{0}}_{Truth} < %g",eBinsMerge[i], eBinsMerge[i+1] ));
576 cMassPhi -> SaveAs(Form(
"plots/invMassPhi_EBin_%d.pdf",i));
602 TPad*
getPad(
int j,
int k,
int l,
float cw,
float ch,
const int nEBins,
const int nCutBins)
604 float xpos[nCutBins+1], ypos[nEBins];
606 float marginLeft = 0.07;
607 float marginRight = 0.035;
609 float marginTop = 0.03;
610 float marginBottom = 0.06;
612 float marginColumn = 0.04;
614 float w = (1 - marginLeft - marginRight - marginColumn*(nCutBins-2 + nCutOffset))/(nCutBins - 1+ nCutOffset);
615 float h = (1 - marginTop - marginBottom)/(nEBins - 1);
617 for(
int m = 0;
m < nCutBins + nCutOffset;
m++)
619 if(
m == 0) xpos[
m] = 0;
620 else if(
m == nCutBins - 1+ nCutOffset) xpos[
m] = 1.;
621 else xpos[
m] = marginLeft +
m*w + (
m-1)*marginColumn;
624 for(
int m = 0;
m < nEBins;
m++)
626 if(
m==0) ypos[nEBins -1 -
m] = 0;
627 else if (
m == nEBins - 1) ypos[nEBins-1-
m] = 1.;
628 else ypos[nEBins - 1 -
m] = marginBottom +
m*
h;
631 TPad *myPad =
new TPad(Form(
"pad%d%d%d",j,k,l),Form(
"pad%d%d%d",j,k,l),xpos[k],ypos[j+1],xpos[k+1],ypos[j]);
633 if(k==0) myPad->SetLeftMargin(marginLeft/(xpos[k+1] - xpos[k]));
634 else myPad ->
SetLeftMargin(marginColumn/(xpos[k+1] - xpos[k]));
636 if(k == nCutBins - 2+ nCutOffset) myPad ->
SetRightMargin(marginRight/(xpos[k+1]-xpos[k]));
639 if(j == 0) myPad ->
SetTopMargin(marginTop/(ypos[j] - ypos[j+1]));
642 if(j == nEBins - 2) myPad ->
SetBottomMargin(marginBottom/(ypos[j] - ypos[j+1]));
651 float range = hCorr -> GetMaximum() - hCorr -> GetMinimum();
652 SetHistoStyle(hCorr, pad_x, pad_y, hCorr -> GetMinimum(), hCorr->GetMaximum() + 0.2*range,
mode);
660 TLine *massWindow[2];
665 hCorr ->
Draw(
"epX0");
667 if(mode == 1) gPad ->
SetLogy();
670 massWindow[0] =
new TLine(peakPos - peakW,0,peakPos - peakW,hCorr->GetMaximum());
675 massWindow[1] =
new TLine(peakPos + peakW,0,peakPos + peakW,hCorr->GetMaximum());
678 massWindow[0] ->
Draw(
"same");
679 massWindow[1] ->
Draw(
"same");
690 if(hi > low) histo ->
GetYaxis() -> SetRangeUser(low,hi);
693 histo ->
GetYaxis() -> SetRangeUser(0.1,10*hi);
697 int xTitleBin[3][2] = {{11,3},{11,3},{3,3}};
698 int yTitleBin[3][2] = {{5,0},{5,0},{2,0}};
700 float yTitleOffset[3] = {0.3, 0.4, 1};
701 float xTitleOffset[3] = {0.7, 0.7, 0.7};
703 float yTitleSize[3] = {0.5, 0.5, 0.15};
704 float xTitleSize[3] = {0.28, 0.28, 0.13};
706 if(eBin == xTitleBin[mode][0] && cutBin == xTitleBin[mode][1]) histo ->
GetXaxis() ->
SetTitle(
"M_{#gamma#gamma}");
707 if(eBin == yTitleBin[mode][0] && cutBin == yTitleBin[mode][1]) histo ->
GetYaxis() ->
SetTitle(
"N_{#gamma#gamma}");
709 histo ->
GetXaxis() -> SetTitleSize(xTitleSize[mode]);
710 histo ->
GetXaxis() -> SetTitleOffset(xTitleOffset[mode]);
711 histo ->
GetXaxis() -> CenterTitle();
713 histo ->
GetXaxis() -> SetLabelFont(43);
714 histo ->
GetXaxis() -> SetLabelSize(18);
715 histo ->
GetXaxis() -> SetLabelOffset(0.0);
716 histo -> SetTickLength(0.05,
"X");
717 histo -> SetNdivisions(505,
"x");
720 histo ->
GetYaxis() -> SetNdivisions(505);
721 histo ->
GetYaxis() -> SetTitleSize(yTitleSize[mode]);
722 histo ->
GetYaxis() -> SetTitleOffset(yTitleOffset[mode]);
723 histo ->
GetYaxis() -> CenterTitle();
725 histo ->
GetYaxis() -> SetLabelFont(43);
726 histo ->
GetYaxis() -> SetLabelSize(19);
727 histo ->
GetYaxis() -> SetLabelOffset(0.003);
728 histo ->
GetYaxis() -> SetNoExponent();
729 histo -> SetTickLength(0.04,
"Y");
743 float Y2 = gPad -> GetUymax();
744 float Y1 = gPad -> GetUymin();
745 float rangeY = Y2 - Y1;
746 float xtop[3] = {0.8, -0.1, 0};
747 float xbottom[3] = {0.273152, 1.01, 1.1};
748 double ytop[3] = {Y2+0.01*rangeY, Y2+1*rangeY, Y2+0.01*rangeY};
749 double ybottom[3] = { 0.98*Y2, 0.98*Y2, 0.9*Y2};
760 textCut =
new TText(xtop[mode], ytop[mode], Form(
"Min E > %g GeV",
eCuts[x]));
769 if(mode < 2)textCut =
new TText(xbottom[mode], ybottom[mode], Form(
"%g-%gGeV",
eBins[y],
eBins[y+1]));
770 else textCut =
new TText(xbottom[mode], ybottom[mode], Form(
"%g-%gGeV",
eBinsEta[y],
eBinsEta[y+1]));
771 textCut -> SetTextAngle(270);
783 for(
int i = 0;
i < invMassFit -> GetNpar();
i++)
788 for(
int i = 1;
i < histSub -> GetNbinsX() + 1;
i++)
790 histSub ->
SetBinContent(
i, histOrig -> GetBinContent(
i) - invMassBG -> Eval(histOrig -> GetBinCenter(
i)));