13 if (nBins <= 0)
return;
14 if (max <= 0) max = nBins;
34 const char* load =
"$ALICE_PHYSICS/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C";
35 if (!gROOT->GetClass(
"AliAODForwardMult")) {
37 gROOT->GetInterpreter()->UnloadFile(
gSystem->ExpandPathName(load));
42 Int_t nMax = TMath::Max(
Int_t(nBin * nBin * o + .5)+nBin/2,nBin);
47 TH2D* base =
new TH2D(
"base",
"Basic histogram",
48 nBin,-.5, nBin-.5, nBin, -.5, nBin-.5);
49 base->SetXTitle(
"#eta");
50 base->SetYTitle(
"#varphi");
51 base->SetDirectory(0);
52 base->SetOption(
"colz");
58 TH2D* corr =
new TH2D(
"comp",
"Comparison",
59 tN1, tMin1, tMax1, tN2, tMin2, tMax2);
60 corr->SetXTitle(
"Input");
61 corr->SetYTitle(
"Poisson");
62 corr->SetDirectory(0);
63 corr->SetOption(
"colz");
65 TLine* lcorr =
new TLine(0, 0, tMax2, tMax2);
67 Int_t mm = TMath::Max(
Int_t(nBin * o + .5),nBin/2);
68 tN2=mm*10; tMax2 = mm;
70 Info(
"",
"Making mean w/nbins=%d,range=[%f,%f]", tN2, tMin2, tMax2);
71 TH2D* mean =
new TH2D(
"mean",
"Mean comparison",
72 tN2, tMin2, tMax2, tN2, tMin2, tMax2);
73 mean->SetXTitle(
"Input");
74 mean->SetYTitle(
"Poisson");
75 mean->SetDirectory(0);
76 mean->SetOption(
"colz");
78 TLine* lmean =
new TLine(tMin2, tMin2, tMax2, tMax2);
80 TH1D* dist =
new TH1D(
"dist",
"Distribution of hits", tN1, tMin1, tMax1);
82 dist->SetYTitle(
"P(s)");
83 dist->SetFillColor(kRed+1);
84 dist->SetFillStyle(3001);
85 dist->SetDirectory(0);
87 TH1D* diff =
new TH1D(
"diff",
"P-T", 100, -25, 25);
88 diff->SetXTitle(
"Difference");
89 diff->SetFillColor(kRed+1);
90 diff->SetFillStyle(3001);
91 diff->SetYTitle(
"Prob");
96 for (
Int_t i = 0; i < nEv; i++) {
100 for (
Int_t iEta = 0; iEta < nBin; iEta++) {
101 for (
Int_t iPhi = 0; iPhi < nBin; iPhi++) {
107 base->Fill(iEta, iPhi, m);
110 c->
Fill(iEta, iPhi, m > 0, (useWeights ? m : 1));
119 for (
Int_t iEta = 0; iEta < nBin; iEta++) {
120 for (
Int_t iPhi = 0; iPhi < nBin; iPhi++) {
121 Double_t p = res->GetBinContent(iEta, iPhi);
122 Double_t t = base->GetBinContent(iEta, iPhi);
130 Int_t nn = nBin * nBin;
131 mean->Fill(mBase / nn, mPois / nn);
134 TCanvas*
cc =
new TCanvas(
"c",
"c", 900, 900);
137 cc->SetBorderMode(0);
138 cc->SetRightMargin(0.02);
139 cc->SetTopMargin(0.02);
142 TVirtualPad* pp = cc->cd(1);
145 pp->SetBorderMode(0);
146 pp->SetRightMargin(0.15);
147 pp->SetTopMargin(0.02);
157 pp->SetBorderMode(0);
158 pp->SetRightMargin(0.02);
159 pp->SetTopMargin(0.02);
170 dist->Scale(1. / dist->Integral());
173 m1->Scale(1. / m1->Integral());
176 Double_t ii = 100 * dist->Integral(2, 0);
177 TLatex* ll =
new TLatex(.97, .85,
178 Form(
"Input #bar{m}: %5.3f", mp));
180 ll->SetTextFont(132);
181 ll->SetTextAlign(31);
183 ll->DrawLatex(.97, .75, Form(
"Result #bar{m}: %5.3f", dist->GetMean()));
184 ll->DrawLatex(.97, .65, Form(
"Occupancy: #int_{1}^{#infty}P(s)ds = %6.2f%%",
192 pp->SetBorderMode(0);
193 pp->SetRightMargin(0.15);
194 pp->SetTopMargin(0.02);
202 pp->SetBorderMode(0);
203 pp->SetRightMargin(0.15);
204 pp->SetTopMargin(0.02);
void Reset(const TH2D *base)
TH2D * Result(Bool_t correct=true)
TH1D * GetOccupancy() const
void TestPoisson(Double_t o=.3, bool useWeights=false, bool correct=true)
void Init(Int_t xLumping=-1, Int_t yLumping=-1)
void Fill(UShort_t strip, UShort_t sec, Bool_t hit, Double_t weight=1)
void MakeIntegerAxis(Int_t &nBins, Double_t &min, Double_t &max)
TH2D * GetCorrection() const