19 #define _X_MIN_ (1E-5)
21 #if defined(_SHOW_PURITY_) || defined(_SHOW_KINEMATICS_)
22 #define _X_BNUM_ (5*5*1)
24 #define _X_BNUM_ (200)
26 #define _LOGX_BWID_ ((log(_X_MAX_)-log(_X_MIN_))/_X_BNUM_)
29 #define _Q2_MAX_ (1E3)
30 #if defined(_SHOW_PURITY_) || defined(_SHOW_KINEMATICS_)
31 #define _Q2_BNUM_ (3*4)
33 #define _Q2_BNUM_ (200)
35 #define _LOGQ2_BWID_ ((log(_Q2_MAX_)-log(_Q2_MIN_))/_Q2_BNUM_)
37 #define _Y_BNUM_ (200)
39 void analysis(
const char *dir,
unsigned nn = 1)
41 #if defined(_SHOW_PURITY_) && defined(_SHOW_KINEMATICS_)
42 printf(
"defined(_SHOW_PURITY_) && defined(_SHOW_KINEMATICS_): one at a time, please!\n");
46 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
47 gStyle->SetOptStat(0);
48 gStyle->SetPalette(55, 0);
49 gStyle->SetLabelSize(0.04,
"xy");
50 gStyle->SetPadLeftMargin(0.12);
51 gStyle->SetPadBottomMargin(0.13);
52 gStyle->SetTextFont(52);
56 memset(ok, 0x00,
sizeof(ok));
57 memset(in, 0x00,
sizeof(in));
74 TH1D *y1d =
new TH1D(
"y1d",
"",
_Y_BNUM_, 0.01, 1.0);
76 TH1D *q1d =
new TH1D(
"q1d",
"q1d",
_Q2_BNUM_, q2b);
80 #ifndef _EXPECT_SUBDIRECTORIES_
85 for(
unsigned iqn=0; iqn<nn; iqn++) {
87 #ifdef _EXPECT_SUBDIRECTORIES_
88 snprintf(qdir, 128-1,
"/%05d/", iqn);
90 TString mcInFile = TString(dir) + TString(qdir) +
"simulation.root";
91 TString rcInFile = TString(dir) + TString(qdir) +
"reconstruction.root";
109 unsigned rcIx = mg->GetXaxis()->FindBin(rcKin->
mX) - 1;
110 unsigned rcIq = mg->GetYaxis()->FindBin(rcKin->
mQ2) - 1;
115 unsigned mcIx = mg->GetXaxis()->FindBin(mcKin->
mX) - 1;
116 unsigned mcIq = mg->GetYaxis()->FindBin(mcKin->
mQ2) - 1;
120 if (mcIx == rcIx && mcIq == rcIq)
129 xx->Fill (mcKin->
mX, rcKin->
mX);
130 yy->Fill (mcKin->
mY, rcKin->
mY);
131 y1d->Fill(mcKin->
mY);
132 qq->Fill (mcKin->
mQ2, rcKin->
mQ2);
134 q1d->Fill(mcKin->
mQ2);
135 xq->Fill (mcKin->
mX, mcKin->
mQ2);
141 printf(
"chunk# %4d: corrupted (or missing)\n", iqn);
148 double value = ok[ix][iq] ? 1.0*ok[ix][iq]/(ok[ix][iq]+in[ix][iq]) : 0.0;
149 mg->SetBinContent(ix+1, iq+1, value);
152 #if !defined(_SHOW_PURITY_) && !defined(_SHOW_KINEMATICS_)
153 TCanvas *c11 =
new TCanvas(
"c11",
"c11", 0, 0, 1400, 400);
160 yy->GetXaxis()->SetTitle(
"Simulated Y");
161 yy->GetXaxis()->SetTitleSize(0.05);
162 yy->GetXaxis()->SetTitleFont(52);
163 yy->GetXaxis()->SetLabelSize(0.04);
164 yy->GetXaxis()->SetLabelFont(52);
165 yy->GetXaxis()->SetTitleOffset(1.2);
166 yy->GetYaxis()->SetTitle(
"Reconstructed Y");
167 yy->GetYaxis()->SetTitleSize(0.05);
168 yy->GetYaxis()->SetTitleFont(52);
169 yy->GetYaxis()->SetLabelSize(0.04);
170 yy->GetYaxis()->SetLabelFont(52);
178 xx->GetXaxis()->SetTitle(
"Simulated X_{Bj}");
179 xx->GetXaxis()->SetTitleSize(0.05);
180 xx->GetXaxis()->SetTitleFont(52);
181 xx->GetXaxis()->SetLabelSize(0.04);
182 xx->GetXaxis()->SetLabelFont(52);
183 xx->GetXaxis()->SetTitleOffset(1.2);
184 xx->GetYaxis()->SetTitle(
"Reconstructed X_{Bj}");
185 xx->GetYaxis()->SetTitleSize(0.05);
186 xx->GetYaxis()->SetTitleFont(52);
187 xx->GetYaxis()->SetLabelSize(0.04);
188 xx->GetYaxis()->SetLabelFont(52);
196 qq->GetXaxis()->SetTitle(
"Simulated Q^{2}, [GeV^{2}]");
197 qq->GetXaxis()->SetTitleSize(0.05);
198 qq->GetXaxis()->SetTitleFont(52);
199 qq->GetXaxis()->SetLabelSize(0.04);
200 qq->GetXaxis()->SetLabelFont(52);
201 qq->GetXaxis()->SetTitleOffset(1.2);
202 qq->GetYaxis()->SetTitle(
"Reconstructed Q^{2}, [GeV^{2}]");
203 qq->GetYaxis()->SetTitleSize(0.05);
204 qq->GetYaxis()->SetTitleFont(52);
205 qq->GetYaxis()->SetLabelSize(0.04);
206 qq->GetYaxis()->SetLabelFont(52);
209 TCanvas *c11 =
new TCanvas(
"c11",
"c11", 0, 0, 700, 450);
219 hh->GetXaxis()->SetTitle(
"Simulated X_{Bj}");
220 hh->GetXaxis()->SetTitleSize(0.05);
221 hh->GetXaxis()->SetTitleFont(52);
222 hh->GetXaxis()->SetLabelSize(0.04);
223 hh->GetXaxis()->SetLabelFont(52);
224 hh->GetXaxis()->SetTitleOffset(1.2);
225 hh->GetYaxis()->SetTitle(
"Simulated Q^{2}, [GeV^{2}]");
226 hh->GetYaxis()->SetTitleSize(0.05);
227 hh->GetYaxis()->SetTitleFont(52);
228 hh->GetYaxis()->SetLabelSize(0.04);
229 hh->GetYaxis()->SetLabelFont(52);
234 TF1 *y01 =
new TF1(
"y01",
"0.01*140*140*x");
235 y01->SetLineColor(kBlack);
237 TText *t01 =
new TText(0.025, 2.5,
"y = 0.01");
238 t01->SetTextAngle(45);
241 TF1 *y10 =
new TF1(
"y10",
"0.10*140*140*x");
242 y10->SetLineColor(kBlack);
244 TText *t10 =
new TText(0.0025, 2.5,
"y = 0.10");
245 t10->SetTextAngle(45);
248 TF1 *y95 =
new TF1(
"y95",
"0.95*140*140*x");
249 y95->SetLineColor(kBlack);
251 TText *t95 =
new TText(0.00025, 2.5,
"y = 0.95");
252 t95->SetTextAngle(45);