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