BmnRoot
Loading...
Searching...
No Matches
BmnLambdaEmbeddingDrawHistos.cxx
Go to the documentation of this file.
2
4: geoms(nullptr),
5 hGemStripInfo(nullptr),
6 hSiliconStripInfo(nullptr),
7 pEmbSilHitEff(nullptr),
8 pEmbGemHitEff(nullptr),
9 pEffGemStatXY(nullptr),
10 pEffSilStatXY(nullptr),
11 hEtaLambda(nullptr),
12 hNhitsEmbReco(nullptr)
13{
14 const Int_t nActiveAnals = 2;
15 for (Int_t iAnal = 0; iAnal < nActiveAnals; iAnal++)
16 isActive[iAnal] = kFALSE;
17
18 // Get inn. tracker geometry ...
19 geoms = new BmnInnerTrackerGeometryDraw();
20
21 vector <Int_t> naturalGemOrder{11, 10, 5, 6, 8, 9};
22
23 const Int_t nAnalTypes = 2; // mc, afterEmbedding
24
25 enum analType {
26 pureMc, afterEmbedding
27 };
28
29 // Histograms for BmnLambdaEmbeddingQa::DoDigiAnalysis()
30
31 hGemStripInfo = new TH1F****[nAnalTypes];
32 hSiliconStripInfo = new TH1F****[nAnalTypes];
33
34 for (Int_t iType = 0; iType < nAnalTypes; iType++) {
35 const Int_t nStatsGem = geoms->GetGemGeometry()->GetNStations();
36 const Int_t nStatsSil = geoms->GetSiliconGeometry()->GetNStations();
37
38 hGemStripInfo[iType] = new TH1F***[nStatsGem];
39 hSiliconStripInfo[iType] = new TH1F***[nStatsSil];
40
41 TString type = (iType == pureMc) ? "MC-digits" : "Digits after embedding";
42
43 for (Int_t iStat = 0; iStat < nStatsGem; iStat++) {
44 Int_t nMods = geoms->GetGemGeometry()->GetStation(iStat)->GetNModules();
45 hGemStripInfo[iType][iStat] = new TH1F**[nMods];
46
47 for (Int_t iMod = 0; iMod < nMods; iMod++) {
48 Int_t nLays = geoms->GetGemGeometry()->GetStation(iStat)->GetModule(iMod)->GetNStripLayers();
49 hGemStripInfo[iType][iStat][iMod] = new TH1F*[nLays];
50
51 for (Int_t iLay = 0; iLay < nLays; iLay++) {
52 hGemStripInfo[iType][iStat][iMod][iLay] = new TH1F(Form("GEM, Type# %d Stat# %d Mod# %d Lay# %d", iType, iStat, iMod, iLay),
53 Form("%s, Stat# %d (GEM %d), Mod# %d", type.Data(), iStat, naturalGemOrder[iStat], iMod), 1200, 0., 1200.);
54 hGemStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetLabelSize(0.1);
55 hGemStripInfo[iType][iStat][iMod][iLay]->GetYaxis()->SetLabelSize(0.1);
56 hGemStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetTitle("Strips#");
57 hGemStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetTitleOffset(-.28);
58 hGemStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetTitleSize(0.15);
59 hGemStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->CenterTitle();
60
61 }
62 }
63 }
64
65 for (Int_t iStat = 0; iStat < nStatsSil; iStat++) {
66 Int_t nMods = geoms->GetSiliconGeometry()->GetStation(iStat)->GetNModules();
67 hSiliconStripInfo[iType][iStat] = new TH1F**[nMods];
68
69 for (Int_t iMod = 0; iMod < nMods; iMod++) {
70 Int_t nLays = geoms->GetSiliconGeometry()->GetStation(iStat)->GetModule(iMod)->GetNStripLayers();
71 hSiliconStripInfo[iType][iStat][iMod] = new TH1F*[nLays];
72
73 for (Int_t iLay = 0; iLay < nLays; iLay++) {
74 hSiliconStripInfo[iType][iStat][iMod][iLay] = new TH1F(Form("SILICON, Type# %d Stat# %d Mod# %d Lay# %d", iType, iStat, iMod, iLay),
75 Form("%s, Stat# %d, Mod# %d", type.Data(), iStat, iMod), 700, 0., 700.);
76 hSiliconStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetLabelSize(0.1);
77 hSiliconStripInfo[iType][iStat][iMod][iLay]->GetYaxis()->SetLabelSize(0.1);
78 hSiliconStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetTitle("Strips#");
79 hSiliconStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetTitleOffset(-.28);
80 hSiliconStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->SetTitleSize(0.15);
81 hSiliconStripInfo[iType][iStat][iMod][iLay]->GetXaxis()->CenterTitle();
82 }
83 }
84 }
85 }
86
87 // Histograms for BmnLambdaEmbeddingQa::DoEffAnalysis()
88
91
92 const Int_t nSilModsMax = 8;
93 pEmbSilHitEff = new TProfile2D("SILICON eff.", "SILICON eff.", SILICON->GetNStations(), 0., SILICON->GetNStations(), nSilModsMax, 0, nSilModsMax, 0., 1.);
94
95 const Int_t nZones = 2; // 0 --> hot, 1 --> big
96 const Int_t nGemModsMax = 2; // mod0 , mod1
97 pEmbGemHitEff = new TProfile2D*[nZones];
98 TAxis* xAxis = pEmbSilHitEff->GetXaxis();
99 TAxis* yAxis = pEmbSilHitEff->GetYaxis();
100
101 for (Int_t iBin = 0; iBin < SILICON->GetNStations(); iBin++)
102 xAxis->SetBinLabel(iBin + 1, Form("Stat# %d", iBin));
103 for (Int_t iBin = 0; iBin < nSilModsMax; iBin++)
104 yAxis->SetBinLabel(iBin + 1, Form("Mod# %d", iBin));
105 pEmbSilHitEff->GetXaxis()->SetLabelSize(0.07);
106 pEmbSilHitEff->GetYaxis()->SetLabelSize(0.07);
107
108 pEmbSilHitEff->GetXaxis()->SetTitleSize(0.06);
109 pEmbSilHitEff->GetYaxis()->SetTitleSize(0.06);
110
111 pEmbSilHitEff->GetXaxis()->SetTitleOffset(.83);
112 pEmbSilHitEff->GetYaxis()->SetTitleOffset(.77);
113
114 pEmbSilHitEff->SetMarkerSize(2.3);
115
116 for (Int_t iZone = 0; iZone < nZones; iZone++) {
117 TString zone = (iZone == 0) ? "Hot Zone" : "Big Zone";
118 pEmbGemHitEff[iZone] = new TProfile2D(Form("GEM eff., %s", zone.Data()),
119 Form("GEM, %s", zone.Data()), GEM->GetNStations(), 0., GEM->GetNStations(), nGemModsMax, 0., nGemModsMax, 0., 1.);
120
121 xAxis = pEmbGemHitEff[iZone]->GetXaxis();
122 yAxis = pEmbGemHitEff[iZone]->GetYaxis();
123
124 for (Int_t iBin = 0; iBin < GEM->GetNStations(); iBin++)
125 xAxis->SetBinLabel(iBin + 1, Form("Stat# %d", iBin));
126 for (Int_t iBin = 0; iBin < nGemModsMax; iBin++)
127 yAxis->SetBinLabel(iBin + 1, Form("Mod# %d", iBin));
128
129 pEmbGemHitEff[iZone]->GetXaxis()->SetLabelSize(0.07);
130 pEmbGemHitEff[iZone]->GetYaxis()->SetLabelSize(0.07);
131
132 pEmbGemHitEff[iZone]->GetXaxis()->SetTitleSize(0.06);
133 pEmbGemHitEff[iZone]->GetYaxis()->SetTitleSize(0.06);
134
135 pEmbGemHitEff[iZone]->GetXaxis()->SetTitleOffset(.43);
136 pEmbGemHitEff[iZone]->GetYaxis()->SetTitleOffset(.77);
137
138 pEmbGemHitEff[iZone]->SetMarkerSize(2.3);
139 }
140
141 pEffGemStatXY = new TProfile2D*[GEM->GetNStations()];
142 for (Int_t iStat = 0; iStat < GEM->GetNStations(); iStat++) {
143 pEffGemStatXY[iStat] = new TProfile2D(Form("GEM eff. vs. X and Y, stat# %d", iStat),
144 Form("Stat# %d (GEM %d); X [cm]; Y [cm]", iStat, naturalGemOrder[iStat]), 500, -100., +100, 500, -10., +50., 0, 1);
145 pEffGemStatXY[iStat]->GetXaxis()->SetLabelSize(0.07);
146 pEffGemStatXY[iStat]->GetYaxis()->SetLabelSize(0.07);
147
148 pEffGemStatXY[iStat]->GetXaxis()->SetTitleSize(0.06);
149 pEffGemStatXY[iStat]->GetYaxis()->SetTitleSize(0.06);
150
151 pEffGemStatXY[iStat]->GetXaxis()->SetTitleOffset(.83);
152 pEffGemStatXY[iStat]->GetYaxis()->SetTitleOffset(.77);
153 }
154
155 pEffSilStatXY = new TProfile2D*[SILICON->GetNStations()];
156 for (Int_t iStat = 0; iStat < SILICON->GetNStations(); iStat++) {
157 Double_t xLow = (iStat == 0) ? -8. : (iStat == 1) ? -8. : -13.;
158 Double_t xUp = -xLow;
159
160 Double_t yLow = (iStat == 0) ? -12. : (iStat == 1) ? -13. : -20.;
161 Double_t yUp = (iStat == 0) ? +3. : (iStat == 1) ? +4. : +10.;
162
163 pEffSilStatXY[iStat] = new TProfile2D(Form("SILICON eff. vs. X and Y, stat# %d", iStat),
164 Form("Stat# %d; X [cm]; Y [cm]", iStat), 500, xLow, xUp, 500, yLow, yUp, 0., 1.);
165 pEffSilStatXY[iStat]->GetXaxis()->SetLabelSize(0.07);
166 pEffSilStatXY[iStat]->GetYaxis()->SetLabelSize(0.07);
167
168 pEffSilStatXY[iStat]->GetXaxis()->SetTitleSize(0.06);
169 pEffSilStatXY[iStat]->GetYaxis()->SetTitleSize(0.06);
170
171 pEffSilStatXY[iStat]->GetXaxis()->SetTitleOffset(.83);
172 pEffSilStatXY[iStat]->GetYaxis()->SetTitleOffset(.77);
173 }
174
175 const Int_t nParts = 2; // proton, pion
176 const TString particles[nParts] = {"Protons", "Pions"};
177 const Int_t nCuts = 4;
178
179 hEtaLambda = new TH1F**[nParts];
180 hNhitsEmbReco = new TH2F*[nParts];
181
182 for (Int_t iPart = 0; iPart < nParts; iPart++) {
183 hEtaLambda[iPart] = new TH1F*[nCuts];
184
185 hNhitsEmbReco[iPart] = new TH2F(Form("%s", particles[iPart].Data()),
186 Form("%s; Nhits_{reco}; NHits_{emb}", particles[iPart].Data()), 6, 4., 10., 6, 4., 10.);
187 hNhitsEmbReco[iPart]->GetXaxis()->SetLabelSize(0.07);
188 hNhitsEmbReco[iPart]->GetYaxis()->SetLabelSize(0.07);
189
190 hNhitsEmbReco[iPart]->GetXaxis()->SetTitleSize(0.07);
191 hNhitsEmbReco[iPart]->GetYaxis()->SetTitleSize(0.07);
192
193 hNhitsEmbReco[iPart]->GetXaxis()->SetTitleOffset(.53);
194 hNhitsEmbReco[iPart]->GetYaxis()->SetTitleOffset(.77);
195
196 // FIXME!
197 const Int_t nBinsX = 16;
198 const Double_t xLow = 1.;
199 const Double_t xUp = 3.;
200
201 for (Int_t iCut = 0; iCut < nCuts; iCut++) {
202 hEtaLambda[iPart][iCut] = new TH1F(Form("%s %d", particles[iPart].Data(), iCut),
203 Form("%s; #eta_{#Lambda^{0}}; N_{reco} / N_{emb}", particles[iPart].Data()), nBinsX, xLow, xUp);
204 hEtaLambda[iPart][iCut]->GetXaxis()->SetLabelSize(0.07);
205 hEtaLambda[iPart][iCut]->GetYaxis()->SetLabelSize(0.07);
206
207 hEtaLambda[iPart][iCut]->GetXaxis()->SetTitleSize(0.07);
208 hEtaLambda[iPart][iCut]->GetYaxis()->SetTitleSize(0.07);
209
210 hEtaLambda[iPart][iCut]->GetXaxis()->SetTitleOffset(-.53);
211 hEtaLambda[iPart][iCut]->GetYaxis()->SetTitleOffset(.77);
212
213 hEtaLambda[iPart][iCut]->GetYaxis()->SetRangeUser(0., 1.5);
214 }
215 }
216}
217
219 gStyle->SetOptStat(0);
220 gStyle->SetTitleFontSize(0.1);
221 gStyle->SetTitleY(1.0);
222
223 // Filling histogram placement class ...
224 TClonesArray* hPlace = new TClonesArray("HistoPlacement");
225
226 // HistoPlacement(TString canvName, Int_t pad, Int_t subPad, TString det, Int_t type, Int_t stat, Int_t mod)
227 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 1, 1, "SILICON", 0, 0, 0);
228 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 1, 2, "SILICON", 0, 0, 1);
229 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 2, 1, "SILICON", 1, 0, 0);
230 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 2, 2, "SILICON", 1, 0, 1);
231 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 3, 1, "SILICON", 0, 0, 2);
232 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 3, 2, "SILICON", 0, 0, 3);
233 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 4, 1, "SILICON", 1, 0, 2);
234 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("a", 4, 2, "SILICON", 1, 0, 3);
235
236 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("b", 1, 1, "SILICON", 0, 1, 0);
237 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("b", 1, 2, "SILICON", 0, 1, 1);
238 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("b", 2, 1, "SILICON", 1, 1, 0);
239 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("b", 2, 2, "SILICON", 1, 1, 1);
240
241 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 1, 1, "SILICON", 0, 2, 0);
242 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 1, 2, "SILICON", 0, 2, 1);
243 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 2, 1, "SILICON", 1, 2, 0);
244 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 2, 2, "SILICON", 1, 2, 1);
245 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 3, 1, "SILICON", 0, 2, 2);
246 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 3, 2, "SILICON", 0, 2, 3);
247 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 4, 1, "SILICON", 1, 2, 2);
248 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("c", 4, 2, "SILICON", 1, 2, 3);
249
250 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 1, 1, "SILICON", 0, 2, 4);
251 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 1, 2, "SILICON", 0, 2, 5);
252 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 2, 1, "SILICON", 1, 2, 4);
253 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 2, 2, "SILICON", 1, 2, 5);
254 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 3, 1, "SILICON", 0, 2, 6);
255 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 3, 2, "SILICON", 0, 2, 7);
256 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 4, 1, "SILICON", 1, 2, 6);
257 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("d", 4, 2, "SILICON", 1, 2, 7);
258
259 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 1, 1, "GEM", 0, 0, 0);
260 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 1, 2, "GEM", 0, 0, 1);
261 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 2, 1, "GEM", 1, 0, 0);
262 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 2, 2, "GEM", 1, 0, 1);
263 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 3, 1, "GEM", 0, 1, 0);
264 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 3, 2, "GEM", 0, 1, 1);
265 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 4, 1, "GEM", 1, 1, 0);
266 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 4, 2, "GEM", 1, 1, 1);
267 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 5, 1, "GEM", 0, 2, 0);
268 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 5, 2, "GEM", 0, 2, 1);
269 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 6, 1, "GEM", 1, 2, 0);
270 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("e", 6, 2, "GEM", 1, 2, 1);
271
272 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 1, 1, "GEM", 0, 3, 0);
273 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 1, 2, "GEM", 0, 3, 1);
274 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 2, 1, "GEM", 1, 3, 0);
275 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 2, 2, "GEM", 1, 3, 1);
276 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 3, 1, "GEM", 0, 4, 0);
277 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 3, 2, "GEM", 0, 4, 1);
278 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 4, 1, "GEM", 1, 4, 0);
279 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 4, 2, "GEM", 1, 4, 1);
280 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 5, 1, "GEM", 0, 5, 0);
281 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 5, 2, "GEM", 0, 5, 1);
282 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 6, 1, "GEM", 1, 5, 0);
283 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("f", 6, 2, "GEM", 1, 5, 1);
284
285 // HistoPlacement(TString canvName, Int_t pad, TString det, Int_t stat)
286 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("g", 1, "SILICON", 0);
287 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("g", 2, "SILICON", 1);
288 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("g", 3, "SILICON", 2);
289
290 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("h", 1, "GEM", 0);
291 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("h", 2, "GEM", 1);
292 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("h", 3, "GEM", 2);
293 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("h", 4, "GEM", 3);
294 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("h", 5, "GEM", 4);
295 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("h", 6, "GEM", 5);
296
297 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("i", 1, "GEM", 1);
298 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("i", 2, "GEM", 0);
299 new ((*hPlace)[hPlace->GetEntriesFast()]) HistoPlacement("i", 3, "SILICON", 0);
300
301 const Int_t nPads = 6;
302 const Int_t nSubPads = 2;
303
304 // 1. Draw histos from BmnLambdaEmbeddingQa::DoDigiAnalysis() ...
305 if (isActive[0]) {
306 const Int_t nCanvs = 6;
307 TCanvas* a = new TCanvas("a", "a", 1200, 800);
308 TCanvas* b = new TCanvas("b", "b", 1200, 800);
309 TCanvas* c = new TCanvas("c", "c", 1200, 800);
310 TCanvas* d = new TCanvas("d", "d", 1200, 800);
311 TCanvas* e = new TCanvas("e", "e", 1200, 800);
312 TCanvas* f = new TCanvas("f", "f", 1200, 800);
313
314 // TCanvas * arrCanv[nCanvs] = {a, b, c, d, e, f};
315 vector <TCanvas*> arrCanv{a, b, c, d, e, f};
316
317 for (Int_t iCanv = 0; iCanv < nCanvs; iCanv++) {
318 arrCanv[iCanv]->Divide(2, 3);
319 for (Int_t iPad = 1; iPad < nPads + 1; iPad++) {
320 Int_t analType = (iPad % 2 == 1) ? 0 : 1;
321
322 TVirtualPad* vPad = arrCanv[iCanv]->cd(iPad);
323 vPad->Divide(1, 2, 0.01, 0.01);
324
325 for (Int_t iSubPad = 1; iSubPad < nSubPads + 1; iSubPad++) {
326 vPad->cd(iSubPad);
327
328 for (Int_t iPlace = 0; iPlace < hPlace->GetEntriesFast(); iPlace++) {
329
330 HistoPlacement* place = (HistoPlacement*) hPlace->UncheckedAt(iPlace);
331
332 TString name = place->GetCanvasName();
333 Int_t pad = place->GetPad();
334 Int_t subpad = place->GetSubpad();
335 Int_t type = place->GetAnalType();
336 TString det = place->GetDetectorName();
337
338 if ((TString) arrCanv[iCanv]->GetName() != name || iPad != pad || iSubPad != subpad || analType != type)
339 continue;
340
341 Int_t stat = place->GetStat();
342 Int_t mod = place->GetMod();
343
344 if (det.Contains("SILICON")) {
345 hSiliconStripInfo[type][stat][mod][0]->Draw();
346 hSiliconStripInfo[type][stat][mod][0]->SetLineColor(kRed);
347 hSiliconStripInfo[type][stat][mod][1]->Draw("same");
348 hSiliconStripInfo[type][stat][mod][1]->SetLineColor(kBlue);
349 } else if (det.Contains("GEM")) {
350 hGemStripInfo[type][stat][mod][0]->Draw();
351 hGemStripInfo[type][stat][mod][0]->SetLineColor(kRed);
352 hGemStripInfo[type][stat][mod][1]->Draw("same");
353 hGemStripInfo[type][stat][mod][1]->SetLineColor(kBlue);
354 // hGemStripInfo[type][stat][mod][2]->Draw("same");
355 // hGemStripInfo[type][stat][mod][3]->Draw("same");
356 }
357
358 break;
359 }
360 }
361 }
362 }
363 a->SaveAs("siliconMcEmbedded_stat0.pdf");
364 b->SaveAs("siliconMcEmbedded_stat1.pdf");
365 c->SaveAs("siliconMcEmbedded_stat3_1.pdf");
366 d->SaveAs("siliconMcEmbedded_stat3_2.pdf");
367 e->SaveAs("gemMcEmbedded_stat012.pdf");
368 f->SaveAs("gemMcEmbedded_stat345.pdf");
369 }
370
371 // 2. Draw histos from BmnLambdaEmbeddingQa::DoEffAnalysis() ...
372 if (isActive[1]) {
373 TBox*** gemModBoxes = nullptr;
374 TBox**** gemLayBoxes = nullptr;
375 TPolyLine**** gemDeadZones = nullptr;
376 geoms->GetGemBorders(gemModBoxes, gemLayBoxes, gemDeadZones);
377
378 TBox*** silModBoxes = nullptr;
379 TBox**** silLayBoxes = nullptr;
380 TPolyLine**** silDeadZones = nullptr;
381 geoms->GetSiliconBorders(silModBoxes, silLayBoxes, silDeadZones);
382
383 Int_t nCanvs = 2;
384 TCanvas* g = new TCanvas("g", "g", 1200, 800);
385 TCanvas* h = new TCanvas("h", "h", 1200, 800);
386
387 //TCanvas * arrCanv[nCanvs] = {g, h};
388 vector <TCanvas*> arrCanv{g, h};
389 for (Int_t iCanv = 0; iCanv < nCanvs; iCanv++) {
390 arrCanv[iCanv]->Divide(2, 3);
391 for (Int_t iPad = 1; iPad < nPads + 1; iPad++) {
392 arrCanv[iCanv]->cd(iPad);
393 for (Int_t iPlace = 0; iPlace < hPlace->GetEntriesFast(); iPlace++) {
394 HistoPlacement* place = (HistoPlacement*) hPlace->UncheckedAt(iPlace);
395
396 TString name = place->GetCanvasName();
397 Int_t pad = place->GetPad();
398 TString det = place->GetDetectorName();
399
400 if ((TString) arrCanv[iCanv]->GetName() != name || iPad != pad)
401 continue;
402
403 if (det.Contains("SILICON")) {
404 Int_t stat = place->GetStat();
405 pEffSilStatXY[stat]->Draw("colz");
406
407 for (Int_t iMod = 0; iMod < geoms->GetSiliconGeometry()->GetStation(stat)->GetNModules(); iMod++) {
408 silModBoxes[stat][iMod]->Draw("l");
409
410 for (Int_t iLayer = 0; iLayer < geoms->GetSiliconGeometry()->GetStation(stat)->GetModule(iMod)->GetNStripLayers(); iLayer++) {
411 silLayBoxes[stat][iMod][iLayer]->Draw("l");
412 if (stat == 2 && iMod == 7 && (iLayer == 0 || iLayer == 2))
413 silDeadZones[stat][iMod][iLayer]->Draw("l");
414 }
415 }
416 } else if (det.Contains("GEM")) {
417 Int_t stat = place->GetStat();
418 pEffGemStatXY[stat]->Draw("colz");
419
420 for (Int_t iMod = 0; iMod < geoms->GetGemGeometry()->GetStation(stat)->GetNModules(); iMod++) {
421 gemModBoxes[stat][iMod]->Draw("l");
422
423 for (Int_t iLayer = 0; iLayer < geoms->GetGemGeometry()->GetStation(stat)->GetModule(iMod)->GetNStripLayers(); iLayer++) {
424 gemLayBoxes[stat][iMod][iLayer]->Draw("l");
425 gemDeadZones[stat][iMod][iLayer]->Draw("l");
426 }
427 }
428 }
429
430 break;
431 }
432 }
433 }
434
435 g->SaveAs("siliconEff_XY.pdf");
436 h->SaveAs("gemEff_XY.pdf");
437
438 nCanvs = 1;
439 TCanvas* i = new TCanvas("i", "i", 1200, 800);
440 i->Divide(2, 3);
441
442 for (Int_t iPad = 1; iPad < nPads + 1; iPad++) {
443 i->cd(iPad)->SetGrid();
444 for (Int_t iPlace = 0; iPlace < hPlace->GetEntriesFast(); iPlace++) {
445 HistoPlacement* place = (HistoPlacement*) hPlace->UncheckedAt(iPlace);
446
447 TString name = place->GetCanvasName();
448 Int_t pad = place->GetPad();
449 TString det = place->GetDetectorName();
450
451 if ((TString) i->GetName() != name || iPad != pad)
452 continue;
453
454 if (det.Contains("SILICON")) {
455 pEmbSilHitEff->Draw("TEXT");
456 } else if (det.Contains("GEM")) {
457 Int_t zone = place->GetZone();
458 pEmbGemHitEff[zone]->Draw("TEXT");
459 }
460
461 break;
462 }
463 }
464
465 i->SaveAs("gemSiliconEff.pdf");
466
467 TCanvas* j = new TCanvas("j", "j", 1200, 800);
468 j->Divide(2, 3);
469
470 for (Int_t iPad = 1; iPad < 3; iPad++) {
471 j->cd(iPad)->SetGrid();
472
473 hEtaLambda[iPad - 1][0]->SetMarkerStyle(kFullCircle);
474 hEtaLambda[iPad - 1][0]->SetMarkerColor(kRed);
475 hEtaLambda[iPad - 1][0]->Draw("P");
476
477 hEtaLambda[iPad - 1][1]->SetMarkerStyle(kFullSquare);
478 hEtaLambda[iPad - 1][1]->SetMarkerColor(kBlue);
479 hEtaLambda[iPad - 1][1]->Draw("Psame");
480
481 hEtaLambda[iPad - 1][2]->SetMarkerStyle(kFullTriangleUp);
482 hEtaLambda[iPad - 1][2]->SetMarkerColor(kMagenta);
483 hEtaLambda[iPad - 1][2]->Draw("Psame");
484
485 hEtaLambda[iPad - 1][3]->SetMarkerStyle(kFullTriangleDown);
486 hEtaLambda[iPad - 1][3]->Draw("Psame");
487
488 TLegend* legend = new TLegend(0.1, 0.7, 0.58, 0.9);
489 legend->AddEntry(hEtaLambda[iPad - 1][0], "nHitsReco = nHitsMc", "p");
490 legend->AddEntry(hEtaLambda[iPad - 1][1], "|nHitsReco - nHitsMc| / nHitsMc < 0.2", "p");
491 legend->AddEntry(hEtaLambda[iPad - 1][2], "|nHitsReco - nHitsMc| / nHitsMc < 0.4", "p");
492 legend->AddEntry(hEtaLambda[iPad - 1][3], "|nHitsReco - nHitsMc| / nHitsMc < 0.5", "p");
493
494 legend->Draw();
495 }
496
497 for (Int_t iPad = 3; iPad < 5; iPad++) {
498 j->cd(iPad)->SetGrid();
499 j->cd(iPad)->SetLogz();
500 hNhitsEmbReco[iPad - 3]->Draw("colz");
501 }
502
503 j->SaveAs("etaLambda_nReco2Emb.pdf");
504 }
505
506 delete hPlace;
507}
508
509
int Draw(TCanvas *c, vector< TH1 * > hv, vector< string > optV)
const Float_t d
Z-ccordinate of the first GEM-station.
Definition BmnMwpcHit.cxx:7
int i
Definition P4_F32vec4.h:22
float f
Definition P4_F32vec4.h:21
BmnGemStripStation * GetStation(Int_t station_num)
BmnGemStripModule * GetModule(Int_t module_num)
BmnGemStripStationSet * GetGemGeometry()
void GetGemBorders(TBox ***&mods, TBox ****&layers, TPolyLine ****&deadZones)
BmnSiliconStationSet * GetSiliconGeometry()
void GetSiliconBorders(TBox ***&mods, TBox ****&layers, TPolyLine ****&deadZones)
BmnSiliconStation * GetStation(Int_t station_num)
BmnSiliconModule * GetModule(Int_t module_num)