Belle II Software development
DQMHistAnalysisTRGGDL.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9// Own header.
10#include <dqm/analysis/modules/DQMHistAnalysisTRGGDL.h>
11
12#include <TH1F.h>
13#include <TH2F.h>
14#include <TCanvas.h>
15#include <TPaveText.h>
16#include <TLine.h>
17#include <TClass.h>
18#include <TStyle.h>
19#include <TROOT.h>
20
21#include <fstream>
22#include <iostream>
23#include <vector>
24#include <algorithm>
25
26using namespace std;
27using namespace Belle2;
28
29//-----------------------------------------------------------------
30// Register module
31//-----------------------------------------------------------------
32
33REG_MODULE(DQMHistAnalysisTRGGDL);
34
37{
38 // set module description (e.g. insert text)
39 setDescription("Modify and analyze the data quality histograms of TRGGDL");
41 addParam("debug", m_debug, "debug mode", false);
42 addParam("alert", m_enableAlert, "Enable color alert", true);
43}
44
46{
47#ifdef _BELLE2_EPICS
48 if (getUseEpics()) {
49 if (ca_current_context()) ca_context_destroy();
50 }
51#endif
52}
53
55{
56 gROOT->cd();
57
58 for (unsigned iskim = 0; iskim < nskim_gdldqm; iskim++) {
59 char charhist_eff[1000];
60 sprintf(charhist_eff, "hGDL_ana_eff_%s", skim_smap[iskim].c_str());
61 m_h_eff[iskim] = new TH1D(charhist_eff, charhist_eff, n_eff, 0, n_eff);
62 sprintf(charhist_eff, "hGDL_ana_eff_fast_%s", skim_smap[iskim].c_str());
63 m_h_eff_fast[iskim] = new TH1D(charhist_eff, charhist_eff, n_eff, 0, n_eff);
64 for (int i = 0; i < n_eff; i++) {
65 m_h_eff[iskim]->GetXaxis()->SetBinLabel(i + 1, c_eff[i]);
66 m_h_eff_fast[iskim]->GetXaxis()->SetBinLabel(i + 1, c_eff[i]);
67 }
68 char charhist_c_eff[1000];
69 sprintf(charhist_c_eff, "TRGGDL/hGDL_ana_eff_%s", skim_smap[iskim].c_str());
70 m_c_eff[iskim] = new TCanvas(charhist_c_eff);
71 sprintf(charhist_c_eff, "TRGGDL/hGDL_ana_eff_fast_%s", skim_smap[iskim].c_str());
72 m_c_eff_fast[iskim] = new TCanvas(charhist_c_eff);
73 }
74
75 m_h_eff_shifter = new TH1D("hGDL_ana_eff_shifter", "hGDL_ana_eff_shifter", n_eff_shifter, 0, n_eff_shifter);
76 m_h_eff_shifter->GetYaxis()->SetTitle("efficiency");
77 m_h_eff_shifter_fast = new TH1D("hGDL_ana_eff_shifter_fast", "hGDL_ana_eff_shifter_fast", n_eff_shifter, 0, n_eff_shifter);
78 m_h_eff_shifter_fast->GetYaxis()->SetTitle("efficiency");
79 for (int i = 0; i < n_eff_shifter; i++) {
80 m_h_eff_shifter->GetXaxis()->SetBinLabel(i + 1, c_eff_shifter[i]);
81 m_h_eff_shifter_fast->GetXaxis()->SetBinLabel(i + 1, c_eff_shifter[i]);
84 }
85 m_c_eff_shifter = new TCanvas("TRGGDL/hGDL_ana_eff_shifter");
86 m_c_eff_shifter_fast = new TCanvas("TRGGDL/hGDL_ana_eff_shifter_fast");
87
88 m_h_pure_eff = new TH1D("hGDL_ana_pure_eff", "hGDL_ana_pure_eff", n_pure_eff, 0, n_pure_eff);
89 for (int i = 0; i < n_pure_eff; i++) {
90 m_h_pure_eff->GetXaxis()->SetBinLabel(i + 1, c_pure_eff[i]);
91 }
92 m_c_pure_eff = new TCanvas("TRGGDL/hGDL_ana_pure_eff");
93
94
95
96#ifdef _BELLE2_EPICS
97 if (getUseEpics()) {
98 if (!ca_current_context()) SEVCHK(ca_context_create(ca_disable_preemptive_callback), "ca_context_create");
99 for (int i = 0; i < n_eff_shifter; i++) {
100 std::string aa = "TRGAna:eff_shift_" + std::to_string(i);
101 SEVCHK(ca_create_channel(aa.c_str(), NULL, NULL, 10, &mychid[i]), "ca_create_channel failure");
102 // Read LO and HI limits from EPICS, seems this needs additional channels?
103 // SEVCHK(ca_get(DBR_DOUBLE,mychid[i],(void*)&data),"ca_get failure"); // data is only valid after ca_pend_io!!
104 }
105 for (int i = 0; i < nskim_gdldqm; i++) {
106 std::string aa = "TRGAna:entry_" + std::to_string(i);
107 SEVCHK(ca_create_channel(aa.c_str(), NULL, NULL, 10, &mychid_entry[i]), "ca_create_channel failure");
108 }
109 SEVCHK(ca_pend_io(5.0), "ca_pend_io failure");
110 }
111#endif
112
113 B2DEBUG(20, "DQMHistAnalysisTRGGDL: initialized.");
114}
115
116
118{
119
120 for (unsigned iskim = 0; iskim < nskim_gdldqm; iskim++) {
121
122 //get histo
123 char c_psn[1000];
124 sprintf(c_psn, "TRGGDL/hGDL_psn_extra_fast_%s", skim_smap[iskim].c_str());
125 m_h_psn_extra_fast[iskim] = (TH1D*)findHist(c_psn);
127 if (m_h_psn_extra_fast[iskim] == nullptr) {
128 B2WARNING("Histogram/canvas named TRGGDL/hGDL_psn_extra_fast is not found.");
129 continue;
130 }
131
132 //fill efficiency values
133 if (m_h_psn_extra_fast[iskim]->GetBinContent(0 + 1) == 0)continue;
134 if (m_h_psn_extra_fast[iskim]->GetBinContent(5 + 1) == 0)continue;
135 m_h_eff_fast[iskim]->SetBinContent(1, m_h_psn_extra_fast[iskim]->GetBinContent(1 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
136 5 + 1)); //fff with c4|hie
137 m_h_eff_fast[iskim]->SetBinContent(2, m_h_psn_extra_fast[iskim]->GetBinContent(2 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
138 5 + 1)); //ffo with c4|hie
139 m_h_eff_fast[iskim]->SetBinContent(3, m_h_psn_extra_fast[iskim]->GetBinContent(3 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
140 5 + 1)); //ffb with c4|hie
141 m_h_eff_fast[iskim]->SetBinContent(4, m_h_psn_extra_fast[iskim]->GetBinContent(19 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
142 5 + 1)); //ffy with c4|hie
143 m_h_eff_fast[iskim]->SetBinContent(5, m_h_psn_extra_fast[iskim]->GetBinContent(20 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
144 5 + 1)); //fyo with c4|hie
145 m_h_eff_fast[iskim]->SetBinContent(6, m_h_psn_extra_fast[iskim]->GetBinContent(21 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
146 5 + 1)); //fyb with c4|hie
147 m_h_eff_fast[iskim]->SetBinError(1, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(1 + 1)) /
148 m_h_psn_extra_fast[iskim]->GetBinContent(
149 5 + 1)); //fff with c4|hie
150 m_h_eff_fast[iskim]->SetBinError(2, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(2 + 1)) /
151 m_h_psn_extra_fast[iskim]->GetBinContent(
152 5 + 1)); //ffo with c4|hie
153 m_h_eff_fast[iskim]->SetBinError(3, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(3 + 1)) /
154 m_h_psn_extra_fast[iskim]->GetBinContent(
155 5 + 1)); //ffb with c4|hie
156 m_h_eff_fast[iskim]->SetBinError(4, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(19 + 1)) /
157 m_h_psn_extra_fast[iskim]->GetBinContent(
158 5 + 1)); //ffy with c4|hie
159 m_h_eff_fast[iskim]->SetBinError(5, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(20 + 1)) /
160 m_h_psn_extra_fast[iskim]->GetBinContent(
161 5 + 1)); //fyo with c4|hie
162 m_h_eff_fast[iskim]->SetBinError(6, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(21 + 1)) /
163 m_h_psn_extra_fast[iskim]->GetBinContent(
164 5 + 1)); //fyb with c4|hie
165
166 if (m_h_psn_extra_fast[iskim]->GetBinContent(6 + 1) == 0)continue;
167 m_h_eff_fast[iskim]->SetBinContent(7, m_h_psn_extra_fast[iskim]->GetBinContent(27 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
168 6 + 1)); //hie with fff|ffo|ffb
169 m_h_eff_fast[iskim]->SetBinContent(8, m_h_psn_extra_fast[iskim]->GetBinContent(26 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
170 6 + 1)); //c4 with fff|ffo|ffb
171 m_h_eff_fast[iskim]->SetBinContent(9, m_h_psn_extra_fast[iskim]->GetBinContent(28 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
172 6 + 1)); //lml0 with fff|ffo|ffb
173 m_h_eff_fast[iskim]->SetBinContent(10, m_h_psn_extra_fast[iskim]->GetBinContent(29 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
174 6 + 1)); //lml1 with fff|ffo|ffb
175 m_h_eff_fast[iskim]->SetBinContent(11, m_h_psn_extra_fast[iskim]->GetBinContent(30 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
176 6 + 1)); //lml2 with fff|ffo|ffb
177 m_h_eff_fast[iskim]->SetBinContent(12, m_h_psn_extra_fast[iskim]->GetBinContent(31 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
178 6 + 1)); //lml3 with fff|ffo|ffb
179 m_h_eff_fast[iskim]->SetBinContent(13, m_h_psn_extra_fast[iskim]->GetBinContent(32 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
180 6 + 1)); //lml4 with fff|ffo|ffb
181 m_h_eff_fast[iskim]->SetBinContent(14, m_h_psn_extra_fast[iskim]->GetBinContent(33 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
182 6 + 1)); //lml5 with fff|ffo|ffb
183 m_h_eff_fast[iskim]->SetBinContent(15, m_h_psn_extra_fast[iskim]->GetBinContent(34 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
184 6 + 1)); //lml6 with fff|ffo|ffb
185 m_h_eff_fast[iskim]->SetBinContent(16, m_h_psn_extra_fast[iskim]->GetBinContent(35 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
186 6 + 1)); //lml7 with fff|ffo|ffb
187 m_h_eff_fast[iskim]->SetBinContent(17, m_h_psn_extra_fast[iskim]->GetBinContent(36 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
188 6 + 1)); //lml8 with fff|ffo|ffb
189 m_h_eff_fast[iskim]->SetBinContent(18, m_h_psn_extra_fast[iskim]->GetBinContent(37 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
190 6 + 1)); //lml9 with fff|ffo|ffb
191 m_h_eff_fast[iskim]->SetBinContent(19, m_h_psn_extra_fast[iskim]->GetBinContent(38 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
192 6 + 1)); //lml10 with fff|ffo|ffb
193 m_h_eff_fast[iskim]->SetBinContent(20, m_h_psn_extra_fast[iskim]->GetBinContent(39 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
194 6 + 1)); //lml12 with fff|ffo|ffb
195 m_h_eff_fast[iskim]->SetBinContent(21, m_h_psn_extra_fast[iskim]->GetBinContent(40 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
196 6 + 1)); //lml13 with fff|ffo|ffb
197 m_h_eff_fast[iskim]->SetBinContent(22, m_h_psn_extra_fast[iskim]->GetBinContent(9 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
198 0 + 1)); //bha3d with all
199 m_h_eff_fast[iskim]->SetBinContent(23, m_h_psn_extra_fast[iskim]->GetBinContent(42 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
200 6 + 1)); //mu_b2b with fff|ffo|ffb
201 m_h_eff_fast[iskim]->SetBinError(7, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(27 + 1)) /
202 m_h_psn_extra_fast[iskim]->GetBinContent(
203 6 + 1)); //hie with fff|ffo|ffb
204 m_h_eff_fast[iskim]->SetBinError(8, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(26 + 1)) /
205 m_h_psn_extra_fast[iskim]->GetBinContent(
206 6 + 1)); //c4 with fff|ffo|ffb
207 m_h_eff_fast[iskim]->SetBinError(9, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(28 + 1)) /
208 m_h_psn_extra_fast[iskim]->GetBinContent(
209 6 + 1)); //lml0 with fff|ffo|ffb
210 m_h_eff_fast[iskim]->SetBinError(10, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(29 + 1)) /
211 m_h_psn_extra_fast[iskim]->GetBinContent(
212 6 + 1)); //lml1 with fff|ffo|ffb
213 m_h_eff_fast[iskim]->SetBinError(11, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(30 + 1)) /
214 m_h_psn_extra_fast[iskim]->GetBinContent(
215 6 + 1)); //lml2 with fff|ffo|ffb
216 m_h_eff_fast[iskim]->SetBinError(12, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(31 + 1)) /
217 m_h_psn_extra_fast[iskim]->GetBinContent(
218 6 + 1)); //lml3 with fff|ffo|ffb
219 m_h_eff_fast[iskim]->SetBinError(13, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(32 + 1)) /
220 m_h_psn_extra_fast[iskim]->GetBinContent(
221 6 + 1)); //lml4 with fff|ffo|ffb
222 m_h_eff_fast[iskim]->SetBinError(14, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(33 + 1)) /
223 m_h_psn_extra_fast[iskim]->GetBinContent(
224 6 + 1)); //lml5 with fff|ffo|ffb
225 m_h_eff_fast[iskim]->SetBinError(15, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(34 + 1)) /
226 m_h_psn_extra_fast[iskim]->GetBinContent(
227 6 + 1)); //lml6 with fff|ffo|ffb
228 m_h_eff_fast[iskim]->SetBinError(16, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(35 + 1)) /
229 m_h_psn_extra_fast[iskim]->GetBinContent(
230 6 + 1)); //lml7 with fff|ffo|ffb
231 m_h_eff_fast[iskim]->SetBinError(17, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(36 + 1)) /
232 m_h_psn_extra_fast[iskim]->GetBinContent(
233 6 + 1)); //lml8 with fff|ffo|ffb
234 m_h_eff_fast[iskim]->SetBinError(18, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(37 + 1)) /
235 m_h_psn_extra_fast[iskim]->GetBinContent(
236 6 + 1)); //lml9 with fff|ffo|ffb
237 m_h_eff_fast[iskim]->SetBinError(19, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(38 + 1)) /
238 m_h_psn_extra_fast[iskim]->GetBinContent(
239 6 + 1)); //lml10 with fff|ffo|ffb
240 m_h_eff_fast[iskim]->SetBinError(20, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(39 + 1)) /
241 m_h_psn_extra_fast[iskim]->GetBinContent(
242 6 + 1)); //lml12 with fff|ffo|ffb
243 m_h_eff_fast[iskim]->SetBinError(21, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(40 + 1)) /
244 m_h_psn_extra_fast[iskim]->GetBinContent(
245 6 + 1)); //lml13 with fff|ffo|ffb
246 m_h_eff_fast[iskim]->SetBinError(22, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(9 + 1)) /
247 m_h_psn_extra_fast[iskim]->GetBinContent(
248 0 + 1)); //bha3d with all
249 m_h_eff_fast[iskim]->SetBinError(23, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(42 + 1)) /
250 m_h_psn_extra_fast[iskim]->GetBinContent(
251 6 + 1)); //mu_b2b with fff|ffo|ffb
252
253 if (m_h_psn_extra_fast[iskim]->GetBinContent(14 + 1) == 0)continue;
254 m_h_eff_fast[iskim]->SetBinContent(24, m_h_psn_extra_fast[iskim]->GetBinContent(48 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
255 14 + 1)); //mu_b2b with lml|eclmumu
256 m_h_eff_fast[iskim]->SetBinContent(25, m_h_psn_extra_fast[iskim]->GetBinContent(49 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
257 14 + 1)); //mu_eb2b with lml|eclmumu
258 m_h_eff_fast[iskim]->SetBinContent(26, m_h_psn_extra_fast[iskim]->GetBinContent(50 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
259 14 + 1)); //cdcklm1 with fff|ffo|ffb
260 m_h_eff_fast[iskim]->SetBinContent(27, m_h_psn_extra_fast[iskim]->GetBinContent(51 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
261 14 + 1)); //cdcklm2 with fff|ffo|ffb
262 m_h_eff_fast[iskim]->SetBinContent(28, m_h_psn_extra_fast[iskim]->GetBinContent(15 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
263 14 + 1)); //fff with lml|eclmumu
264 m_h_eff_fast[iskim]->SetBinContent(29, m_h_psn_extra_fast[iskim]->GetBinContent(16 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
265 14 + 1)); //ffo with lml|eclmumu
266 m_h_eff_fast[iskim]->SetBinContent(30, m_h_psn_extra_fast[iskim]->GetBinContent(17 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
267 14 + 1)); //ffb with lml|eclmumu
268 m_h_eff_fast[iskim]->SetBinContent(31, m_h_psn_extra_fast[iskim]->GetBinContent(11 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
269 14 + 1)); //ff with lml|eclmumu
270 m_h_eff_fast[iskim]->SetBinContent(32, m_h_psn_extra_fast[iskim]->GetBinContent(13 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
271 14 + 1)); //f with lml|eclmumu
272 m_h_eff_fast[iskim]->SetBinContent(33, m_h_psn_extra_fast[iskim]->GetBinContent(23 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
273 14 + 1)); //ffy with lml|eclmumu
274 m_h_eff_fast[iskim]->SetBinContent(34, m_h_psn_extra_fast[iskim]->GetBinContent(24 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
275 14 + 1)); //fyo with lml|eclmumu
276 m_h_eff_fast[iskim]->SetBinContent(35, m_h_psn_extra_fast[iskim]->GetBinContent(25 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
277 14 + 1)); //fyb with lml|eclmumu
278 m_h_eff_fast[iskim]->SetBinError(24, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(48 + 1)) /
279 m_h_psn_extra_fast[iskim]->GetBinContent(
280 14 + 1)); //mu_b2b with lml|eclmumu
281 m_h_eff_fast[iskim]->SetBinError(25, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(49 + 1)) /
282 m_h_psn_extra_fast[iskim]->GetBinContent(
283 14 + 1)); //mu_eb2b with lml|eclmumu
284 m_h_eff_fast[iskim]->SetBinError(26, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(50 + 1)) /
285 m_h_psn_extra_fast[iskim]->GetBinContent(
286 14 + 1)); //cdcklm1 with lml|eclmumu
287 m_h_eff_fast[iskim]->SetBinError(27, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(51 + 1)) /
288 m_h_psn_extra_fast[iskim]->GetBinContent(
289 14 + 1)); //cdcklm2 with lml|eclmumu
290 m_h_eff_fast[iskim]->SetBinError(28, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(15 + 1)) /
291 m_h_psn_extra_fast[iskim]->GetBinContent(
292 14 + 1)); //fff with lml|eclmumu
293 m_h_eff_fast[iskim]->SetBinError(29, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(16 + 1)) /
294 m_h_psn_extra_fast[iskim]->GetBinContent(
295 14 + 1)); //ffo with lml|eclmumu
296 m_h_eff_fast[iskim]->SetBinError(30, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(17 + 1)) /
297 m_h_psn_extra_fast[iskim]->GetBinContent(
298 14 + 1)); //ffb with lml|eclmumu
299 m_h_eff_fast[iskim]->SetBinError(31, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(11 + 1)) /
300 m_h_psn_extra_fast[iskim]->GetBinContent(
301 14 + 1)); //ff with lml|eclmumu
302 m_h_eff_fast[iskim]->SetBinError(32, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(13 + 1)) /
303 m_h_psn_extra_fast[iskim]->GetBinContent(
304 14 + 1)); //f with lml|eclmumu
305 m_h_eff_fast[iskim]->SetBinError(33, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(23 + 1)) /
306 m_h_psn_extra_fast[iskim]->GetBinContent(
307 14 + 1)); //ffy with lml|eclmumu
308 m_h_eff_fast[iskim]->SetBinError(34, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(24 + 1)) /
309 m_h_psn_extra_fast[iskim]->GetBinContent(
310 14 + 1)); //fyo with lml|eclmumu
311 m_h_eff_fast[iskim]->SetBinError(35, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(25 + 1)) /
312 m_h_psn_extra_fast[iskim]->GetBinContent(
313 14 + 1)); //fyb with lml|eclmumu
314
315 m_h_eff_fast[iskim]->SetBinContent(36, m_h_psn_extra_fast[iskim]->GetBinContent(55 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
316 6 + 1)); //cdcecl2 with fff|ffo|ffb
317 m_h_eff_fast[iskim]->SetBinContent(37, m_h_psn_extra_fast[iskim]->GetBinContent(68 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
318 14 + 1)); //ecleklm with lml|eclmumu
319 m_h_eff_fast[iskim]->SetBinContent(38, m_h_psn_extra_fast[iskim]->GetBinContent(74 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
320 5 + 1)); //syo with c4|hie
321 m_h_eff_fast[iskim]->SetBinContent(39, m_h_psn_extra_fast[iskim]->GetBinContent(75 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
322 5 + 1)); //yioiecl1 with c4|hie
323 m_h_eff_fast[iskim]->SetBinContent(40, m_h_psn_extra_fast[iskim]->GetBinContent(76 + 1) / m_h_psn_extra_fast[iskim]->GetBinContent(
324 5 + 1)); //stt with c4|hie
325
326 m_h_eff_fast[iskim]->SetBinError(36, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(55 + 1)) /
327 m_h_psn_extra_fast[iskim]->GetBinContent(
328 6 + 1)); //cdcecl2 with fff|ffo|ffb
329 m_h_eff_fast[iskim]->SetBinError(37, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(68 + 1)) /
330 m_h_psn_extra_fast[iskim]->GetBinContent(
331 14 + 1)); //ecleklm with lml|eclmumu
332 m_h_eff_fast[iskim]->SetBinError(38, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(74 + 1)) /
333 m_h_psn_extra_fast[iskim]->GetBinContent(
334 5 + 1)); //syo with c4|hie
335 m_h_eff_fast[iskim]->SetBinError(39, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(75 + 1)) /
336 m_h_psn_extra_fast[iskim]->GetBinContent(
337 5 + 1)); //yioiecl1 with c4|hie
338 m_h_eff_fast[iskim]->SetBinError(40, sqrt(m_h_psn_extra_fast[iskim]->GetBinContent(76 + 1)) /
339 m_h_psn_extra_fast[iskim]->GetBinContent(
340 5 + 1)); //stt with c4|hie
341 }
342
343 for (unsigned iskim = 0; iskim < nskim_gdldqm; iskim++) {
344
345 //get histo
346 char c_psn[1000];
347 sprintf(c_psn, "TRGGDL/hGDL_psn_extra_%s", skim_smap[iskim].c_str());
348 m_h_psn_extra[iskim] = (TH1D*)findHist(c_psn);
350 if (m_h_psn_extra[iskim] == nullptr) {
351 B2WARNING("Histogram/canvas named TRGGDL/hGDL_psn_extra is not found.");
352 continue;
353 }
354
355 //fill efficiency values
356 if (m_h_psn_extra[iskim]->GetBinContent(0 + 1) == 0)continue;
357 if (m_h_psn_extra[iskim]->GetBinContent(5 + 1) == 0)continue;
358 m_h_eff[iskim]->SetBinContent(1, m_h_psn_extra[iskim]->GetBinContent(1 + 1) / m_h_psn_extra[iskim]->GetBinContent(
359 5 + 1)); //fff with c4|hie
360 m_h_eff[iskim]->SetBinContent(2, m_h_psn_extra[iskim]->GetBinContent(2 + 1) / m_h_psn_extra[iskim]->GetBinContent(
361 5 + 1)); //ffo with c4|hie
362 m_h_eff[iskim]->SetBinContent(3, m_h_psn_extra[iskim]->GetBinContent(3 + 1) / m_h_psn_extra[iskim]->GetBinContent(
363 5 + 1)); //ffb with c4|hie
364 m_h_eff[iskim]->SetBinContent(4, m_h_psn_extra[iskim]->GetBinContent(19 + 1) / m_h_psn_extra[iskim]->GetBinContent(
365 5 + 1)); //ffy with c4|hie
366 m_h_eff[iskim]->SetBinContent(5, m_h_psn_extra[iskim]->GetBinContent(20 + 1) / m_h_psn_extra[iskim]->GetBinContent(
367 5 + 1)); //fyo with c4|hie
368 m_h_eff[iskim]->SetBinContent(6, m_h_psn_extra[iskim]->GetBinContent(21 + 1) / m_h_psn_extra[iskim]->GetBinContent(
369 5 + 1)); //fyb with c4|hie
370 m_h_eff[iskim]->SetBinError(1, sqrt(m_h_psn_extra[iskim]->GetBinContent(1 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
371 5 + 1)); //fff with c4|hie
372 m_h_eff[iskim]->SetBinError(2, sqrt(m_h_psn_extra[iskim]->GetBinContent(2 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
373 5 + 1)); //ffo with c4|hie
374 m_h_eff[iskim]->SetBinError(3, sqrt(m_h_psn_extra[iskim]->GetBinContent(3 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
375 5 + 1)); //ffb with c4|hie
376 m_h_eff[iskim]->SetBinError(4, sqrt(m_h_psn_extra[iskim]->GetBinContent(19 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
377 5 + 1)); //ffy with c4|hie
378 m_h_eff[iskim]->SetBinError(5, sqrt(m_h_psn_extra[iskim]->GetBinContent(20 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
379 5 + 1)); //fyo with c4|hie
380 m_h_eff[iskim]->SetBinError(6, sqrt(m_h_psn_extra[iskim]->GetBinContent(21 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
381 5 + 1)); //fyb with c4|hie
382
383 if (m_h_psn_extra[iskim]->GetBinContent(6 + 1) == 0)continue;
384 m_h_eff[iskim]->SetBinContent(7, m_h_psn_extra[iskim]->GetBinContent(27 + 1) / m_h_psn_extra[iskim]->GetBinContent(
385 6 + 1)); //hie with fff|ffo|ffb
386 m_h_eff[iskim]->SetBinContent(8, m_h_psn_extra[iskim]->GetBinContent(26 + 1) / m_h_psn_extra[iskim]->GetBinContent(
387 6 + 1)); //c4 with fff|ffo|ffb
388 m_h_eff[iskim]->SetBinContent(9, m_h_psn_extra[iskim]->GetBinContent(28 + 1) / m_h_psn_extra[iskim]->GetBinContent(
389 6 + 1)); //lml0 with fff|ffo|ffb
390 m_h_eff[iskim]->SetBinContent(10, m_h_psn_extra[iskim]->GetBinContent(29 + 1) / m_h_psn_extra[iskim]->GetBinContent(
391 6 + 1)); //lml1 with fff|ffo|ffb
392 m_h_eff[iskim]->SetBinContent(11, m_h_psn_extra[iskim]->GetBinContent(30 + 1) / m_h_psn_extra[iskim]->GetBinContent(
393 6 + 1)); //lml2 with fff|ffo|ffb
394 m_h_eff[iskim]->SetBinContent(12, m_h_psn_extra[iskim]->GetBinContent(31 + 1) / m_h_psn_extra[iskim]->GetBinContent(
395 6 + 1)); //lml3 with fff|ffo|ffb
396 m_h_eff[iskim]->SetBinContent(13, m_h_psn_extra[iskim]->GetBinContent(32 + 1) / m_h_psn_extra[iskim]->GetBinContent(
397 6 + 1)); //lml4 with fff|ffo|ffb
398 m_h_eff[iskim]->SetBinContent(14, m_h_psn_extra[iskim]->GetBinContent(33 + 1) / m_h_psn_extra[iskim]->GetBinContent(
399 6 + 1)); //lml5 with fff|ffo|ffb
400 m_h_eff[iskim]->SetBinContent(15, m_h_psn_extra[iskim]->GetBinContent(34 + 1) / m_h_psn_extra[iskim]->GetBinContent(
401 6 + 1)); //lml6 with fff|ffo|ffb
402 m_h_eff[iskim]->SetBinContent(16, m_h_psn_extra[iskim]->GetBinContent(35 + 1) / m_h_psn_extra[iskim]->GetBinContent(
403 6 + 1)); //lml7 with fff|ffo|ffb
404 m_h_eff[iskim]->SetBinContent(17, m_h_psn_extra[iskim]->GetBinContent(36 + 1) / m_h_psn_extra[iskim]->GetBinContent(
405 6 + 1)); //lml8 with fff|ffo|ffb
406 m_h_eff[iskim]->SetBinContent(18, m_h_psn_extra[iskim]->GetBinContent(37 + 1) / m_h_psn_extra[iskim]->GetBinContent(
407 6 + 1)); //lml9 with fff|ffo|ffb
408 m_h_eff[iskim]->SetBinContent(19, m_h_psn_extra[iskim]->GetBinContent(38 + 1) / m_h_psn_extra[iskim]->GetBinContent(
409 6 + 1)); //lml10 with fff|ffo|ffb
410 m_h_eff[iskim]->SetBinContent(20, m_h_psn_extra[iskim]->GetBinContent(39 + 1) / m_h_psn_extra[iskim]->GetBinContent(
411 6 + 1)); //lml12 with fff|ffo|ffb
412 m_h_eff[iskim]->SetBinContent(21, m_h_psn_extra[iskim]->GetBinContent(40 + 1) / m_h_psn_extra[iskim]->GetBinContent(
413 6 + 1)); //lml13 with fff|ffo|ffb
414 m_h_eff[iskim]->SetBinContent(22, m_h_psn_extra[iskim]->GetBinContent(9 + 1) / m_h_psn_extra[iskim]->GetBinContent(
415 0 + 1)); //bha3d with all
416 m_h_eff[iskim]->SetBinContent(23, m_h_psn_extra[iskim]->GetBinContent(42 + 1) / m_h_psn_extra[iskim]->GetBinContent(
417 6 + 1)); //mu_b2b with fff|ffo|ffb
418 m_h_eff[iskim]->SetBinError(7, sqrt(m_h_psn_extra[iskim]->GetBinContent(27 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
419 6 + 1)); //hie with fff|ffo|ffb
420 m_h_eff[iskim]->SetBinError(8, sqrt(m_h_psn_extra[iskim]->GetBinContent(26 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
421 6 + 1)); //c4 with fff|ffo|ffb
422 m_h_eff[iskim]->SetBinError(9, sqrt(m_h_psn_extra[iskim]->GetBinContent(28 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
423 6 + 1)); //lml0 with fff|ffo|ffb
424 m_h_eff[iskim]->SetBinError(10, sqrt(m_h_psn_extra[iskim]->GetBinContent(29 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
425 6 + 1)); //lml1 with fff|ffo|ffb
426 m_h_eff[iskim]->SetBinError(11, sqrt(m_h_psn_extra[iskim]->GetBinContent(30 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
427 6 + 1)); //lml2 with fff|ffo|ffb
428 m_h_eff[iskim]->SetBinError(12, sqrt(m_h_psn_extra[iskim]->GetBinContent(31 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
429 6 + 1)); //lml3 with fff|ffo|ffb
430 m_h_eff[iskim]->SetBinError(13, sqrt(m_h_psn_extra[iskim]->GetBinContent(32 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
431 6 + 1)); //lml4 with fff|ffo|ffb
432 m_h_eff[iskim]->SetBinError(14, sqrt(m_h_psn_extra[iskim]->GetBinContent(33 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
433 6 + 1)); //lml5 with fff|ffo|ffb
434 m_h_eff[iskim]->SetBinError(15, sqrt(m_h_psn_extra[iskim]->GetBinContent(34 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
435 6 + 1)); //lml6 with fff|ffo|ffb
436 m_h_eff[iskim]->SetBinError(16, sqrt(m_h_psn_extra[iskim]->GetBinContent(35 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
437 6 + 1)); //lml7 with fff|ffo|ffb
438 m_h_eff[iskim]->SetBinError(17, sqrt(m_h_psn_extra[iskim]->GetBinContent(36 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
439 6 + 1)); //lml8 with fff|ffo|ffb
440 m_h_eff[iskim]->SetBinError(18, sqrt(m_h_psn_extra[iskim]->GetBinContent(37 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
441 6 + 1)); //lml9 with fff|ffo|ffb
442 m_h_eff[iskim]->SetBinError(19, sqrt(m_h_psn_extra[iskim]->GetBinContent(38 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
443 6 + 1)); //lml10 with fff|ffo|ffb
444 m_h_eff[iskim]->SetBinError(20, sqrt(m_h_psn_extra[iskim]->GetBinContent(39 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
445 6 + 1)); //lml12 with fff|ffo|ffb
446 m_h_eff[iskim]->SetBinError(21, sqrt(m_h_psn_extra[iskim]->GetBinContent(40 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
447 6 + 1)); //lml13 with fff|ffo|ffb
448 m_h_eff[iskim]->SetBinError(22, sqrt(m_h_psn_extra[iskim]->GetBinContent(9 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
449 0 + 1)); //bha3d with all
450 m_h_eff[iskim]->SetBinError(23, sqrt(m_h_psn_extra[iskim]->GetBinContent(42 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
451 6 + 1)); //mu_b2b with fff|ffo|ffb
452
453 if (m_h_psn_extra[iskim]->GetBinContent(14 + 1) == 0)continue;
454 m_h_eff[iskim]->SetBinContent(24, m_h_psn_extra[iskim]->GetBinContent(48 + 1) / m_h_psn_extra[iskim]->GetBinContent(
455 14 + 1)); //mu_b2b with lml|eclmumu
456 m_h_eff[iskim]->SetBinContent(25, m_h_psn_extra[iskim]->GetBinContent(49 + 1) / m_h_psn_extra[iskim]->GetBinContent(
457 14 + 1)); //mu_eb2b with lml|eclmumu
458 m_h_eff[iskim]->SetBinContent(26, m_h_psn_extra[iskim]->GetBinContent(50 + 1) / m_h_psn_extra[iskim]->GetBinContent(
459 14 + 1)); //cdcklm1 with fff|ffo|ffb
460 m_h_eff[iskim]->SetBinContent(27, m_h_psn_extra[iskim]->GetBinContent(51 + 1) / m_h_psn_extra[iskim]->GetBinContent(
461 14 + 1)); //cdcklm2 with fff|ffo|ffb
462 m_h_eff[iskim]->SetBinContent(28, m_h_psn_extra[iskim]->GetBinContent(15 + 1) / m_h_psn_extra[iskim]->GetBinContent(
463 14 + 1)); //fff with lml|eclmumu
464 m_h_eff[iskim]->SetBinContent(29, m_h_psn_extra[iskim]->GetBinContent(16 + 1) / m_h_psn_extra[iskim]->GetBinContent(
465 14 + 1)); //ffo with lml|eclmumu
466 m_h_eff[iskim]->SetBinContent(30, m_h_psn_extra[iskim]->GetBinContent(17 + 1) / m_h_psn_extra[iskim]->GetBinContent(
467 14 + 1)); //ffb with lml|eclmumu
468 m_h_eff[iskim]->SetBinContent(31, m_h_psn_extra[iskim]->GetBinContent(11 + 1) / m_h_psn_extra[iskim]->GetBinContent(
469 14 + 1)); //ff with lml|eclmumu
470 m_h_eff[iskim]->SetBinContent(32, m_h_psn_extra[iskim]->GetBinContent(13 + 1) / m_h_psn_extra[iskim]->GetBinContent(
471 14 + 1)); //f with lml|eclmumu
472 m_h_eff[iskim]->SetBinContent(33, m_h_psn_extra[iskim]->GetBinContent(23 + 1) / m_h_psn_extra[iskim]->GetBinContent(
473 14 + 1)); //ffy with lml|eclmumu
474 m_h_eff[iskim]->SetBinContent(34, m_h_psn_extra[iskim]->GetBinContent(24 + 1) / m_h_psn_extra[iskim]->GetBinContent(
475 14 + 1)); //fyo with lml|eclmumu
476 m_h_eff[iskim]->SetBinContent(35, m_h_psn_extra[iskim]->GetBinContent(25 + 1) / m_h_psn_extra[iskim]->GetBinContent(
477 14 + 1)); //fyb with lml|eclmumu
478 m_h_eff[iskim]->SetBinError(24, sqrt(m_h_psn_extra[iskim]->GetBinContent(48 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
479 14 + 1)); //mu_b2b with lml|eclmumu
480 m_h_eff[iskim]->SetBinError(25, sqrt(m_h_psn_extra[iskim]->GetBinContent(49 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
481 14 + 1)); //mu_eb2b with lml|eclmumu
482 m_h_eff[iskim]->SetBinError(26, sqrt(m_h_psn_extra[iskim]->GetBinContent(50 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
483 14 + 1)); //cdcklm1 with lml|eclmumu
484 m_h_eff[iskim]->SetBinError(27, sqrt(m_h_psn_extra[iskim]->GetBinContent(51 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
485 14 + 1)); //cdcklm2 with lml|eclmumu
486 m_h_eff[iskim]->SetBinError(28, sqrt(m_h_psn_extra[iskim]->GetBinContent(15 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
487 14 + 1)); //fff with lml|eclmumu
488 m_h_eff[iskim]->SetBinError(29, sqrt(m_h_psn_extra[iskim]->GetBinContent(16 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
489 14 + 1)); //ffo with lml|eclmumu
490 m_h_eff[iskim]->SetBinError(30, sqrt(m_h_psn_extra[iskim]->GetBinContent(17 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
491 14 + 1)); //ffb with lml|eclmumu
492 m_h_eff[iskim]->SetBinError(31, sqrt(m_h_psn_extra[iskim]->GetBinContent(11 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
493 14 + 1)); //ff with lml|eclmumu
494 m_h_eff[iskim]->SetBinError(32, sqrt(m_h_psn_extra[iskim]->GetBinContent(13 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
495 14 + 1)); //f with lml|eclmumu
496 m_h_eff[iskim]->SetBinError(33, sqrt(m_h_psn_extra[iskim]->GetBinContent(23 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
497 14 + 1)); //ffy with lml|eclmumu
498 m_h_eff[iskim]->SetBinError(34, sqrt(m_h_psn_extra[iskim]->GetBinContent(24 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
499 14 + 1)); //fyo with lml|eclmumu
500 m_h_eff[iskim]->SetBinError(35, sqrt(m_h_psn_extra[iskim]->GetBinContent(25 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
501 14 + 1)); //fyb with lml|eclmumu
502
503 m_h_eff[iskim]->SetBinContent(36, m_h_psn_extra[iskim]->GetBinContent(55 + 1) / m_h_psn_extra[iskim]->GetBinContent(
504 6 + 1)); //cdcecl2 with fff|ffo|ffb
505 m_h_eff[iskim]->SetBinContent(37, m_h_psn_extra[iskim]->GetBinContent(68 + 1) / m_h_psn_extra[iskim]->GetBinContent(
506 14 + 1)); //ecleklm with lml|eclmumu
507 m_h_eff[iskim]->SetBinContent(38, m_h_psn_extra[iskim]->GetBinContent(74 + 1) / m_h_psn_extra[iskim]->GetBinContent(
508 5 + 1)); //syo with c4|hie
509 m_h_eff[iskim]->SetBinContent(39, m_h_psn_extra[iskim]->GetBinContent(75 + 1) / m_h_psn_extra[iskim]->GetBinContent(
510 5 + 1)); //yioiecl1 with c4|hie
511 m_h_eff[iskim]->SetBinContent(40, m_h_psn_extra[iskim]->GetBinContent(76 + 1) / m_h_psn_extra[iskim]->GetBinContent(
512 5 + 1)); //stt with c4|hie
513
514 m_h_eff[iskim]->SetBinError(36, sqrt(m_h_psn_extra[iskim]->GetBinContent(55 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
515 6 + 1)); //cdcecl2 with fff|ffo|ffb
516 m_h_eff[iskim]->SetBinError(37, sqrt(m_h_psn_extra[iskim]->GetBinContent(68 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
517 14 + 1)); //ecleklm with lml|eclmumu
518 m_h_eff[iskim]->SetBinError(38, sqrt(m_h_psn_extra[iskim]->GetBinContent(74 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
519 5 + 1)); //syo with c4|hie
520 m_h_eff[iskim]->SetBinError(39, sqrt(m_h_psn_extra[iskim]->GetBinContent(75 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
521 5 + 1)); //yioiecl1 with c4|hie
522 m_h_eff[iskim]->SetBinError(40, sqrt(m_h_psn_extra[iskim]->GetBinContent(76 + 1)) / m_h_psn_extra[iskim]->GetBinContent(
523 5 + 1)); //stt with c4|hie
524 }
525 //fill efficiency for shifter
526 m_h_eff_shifter_fast->SetBinContent(1, m_h_eff_fast[9] ->GetBinContent(0 + 1)); //fff with c4|hie
527 m_h_eff_shifter_fast->SetBinContent(2, m_h_eff_fast[9] ->GetBinContent(1 + 1)); //ffo with c4|hie
528 m_h_eff_shifter_fast->SetBinContent(3, m_h_eff_fast[9] ->GetBinContent(3 + 1)); //ffy with c4|hie
529 m_h_eff_shifter_fast->SetBinContent(4, m_h_eff_fast[9] ->GetBinContent(4 + 1)); //fyo with c4|hie
530 m_h_eff_shifter_fast->SetBinContent(5, m_h_eff_fast[9] ->GetBinContent(6 + 1)); //hie with fff|ffo|ffb
531 m_h_eff_shifter_fast->SetBinContent(6, m_h_eff_fast[9] ->GetBinContent(7 + 1)); //c4 with fff|ffo|ffb
532 m_h_eff_shifter_fast->SetBinContent(7, m_h_eff_fast[10]->GetBinContent(23 + 1)); //mu_b2b with lml|eclmumu
533 m_h_eff_shifter_fast->SetBinContent(8, m_h_eff_fast[10]->GetBinContent(24 + 1)); //mu_eb2b with lml|eclmumu
534 m_h_eff_shifter_fast->SetBinContent(9, m_h_eff_fast[10]->GetBinContent(26 + 1)); //cdcklm2 with lml|eclmumu
535 m_h_eff_shifter_fast->SetBinContent(10, m_h_eff_fast[10]->GetBinContent(35 + 1)); //cdcecl2 with fff|ffo|ffb
536 m_h_eff_shifter_fast->SetBinContent(11, m_h_eff_fast[10]->GetBinContent(36 + 1)); //ecleklm with lml|eclmumu
537 m_h_eff_shifter_fast->SetBinContent(12, m_h_eff_fast[9] ->GetBinContent(37 + 1)); //syo with c4|hie
538 m_h_eff_shifter_fast->SetBinContent(13, m_h_eff_fast[9] ->GetBinContent(38 + 1)); //yioiecl1 with c4|hie
539 m_h_eff_shifter_fast->SetBinContent(14, m_h_eff_fast[9] ->GetBinContent(39 + 1)); //stt with c4|hie
540 m_h_eff_shifter_fast->SetBinError(1, m_h_eff_fast[9] ->GetBinError(0 + 1)); //fff with c4|hie
541 m_h_eff_shifter_fast->SetBinError(2, m_h_eff_fast[9] ->GetBinError(1 + 1)); //ffo with c4|hie
542 m_h_eff_shifter_fast->SetBinError(3, m_h_eff_fast[9] ->GetBinError(3 + 1)); //ffy with c4|hie
543 m_h_eff_shifter_fast->SetBinError(4, m_h_eff_fast[9] ->GetBinError(4 + 1)); //fyo with c4|hie
544 m_h_eff_shifter_fast->SetBinError(5, m_h_eff_fast[9] ->GetBinError(6 + 1)); //hie with fff|ffo|ffb
545 m_h_eff_shifter_fast->SetBinError(6, m_h_eff_fast[9] ->GetBinError(7 + 1)); //c4 with fff|ffo|ffb
546 m_h_eff_shifter_fast->SetBinError(7, m_h_eff_fast[10]->GetBinError(23 + 1)); //mu_b2b with lml|eclmumu
547 m_h_eff_shifter_fast->SetBinError(8, m_h_eff_fast[10]->GetBinError(24 + 1)); //mu_eb2b with lml|eclmumu
548 m_h_eff_shifter_fast->SetBinError(9, m_h_eff_fast[10]->GetBinError(26 + 1)); //cdcklm2 with lml|eclmumu
549 m_h_eff_shifter_fast->SetBinError(10, m_h_eff_fast[10]->GetBinError(35 + 1)); //cdcecl2 with fff|ffo|ffb
550 m_h_eff_shifter_fast->SetBinError(11, m_h_eff_fast[10]->GetBinError(36 + 1)); //ecleklm with lml|eclmumu
551 m_h_eff_shifter_fast->SetBinError(12, m_h_eff_fast[9] ->GetBinError(37 + 1)); //syo with c4|hie
552 m_h_eff_shifter_fast->SetBinError(13, m_h_eff_fast[9] ->GetBinError(38 + 1)); //yioiecl1 with c4|hie
553 m_h_eff_shifter_fast->SetBinError(14, m_h_eff_fast[9] ->GetBinError(39 + 1)); //stt with c4|hie
554
555 m_h_eff_shifter->SetBinContent(1, m_h_eff[9] ->GetBinContent(0 + 1)); //fff with c4|hie
556 m_h_eff_shifter->SetBinContent(2, m_h_eff[9] ->GetBinContent(1 + 1)); //ffo with c4|hie
557 m_h_eff_shifter->SetBinContent(3, m_h_eff[9] ->GetBinContent(3 + 1)); //ffy with c4|hie
558 m_h_eff_shifter->SetBinContent(4, m_h_eff[9] ->GetBinContent(4 + 1)); //fyo with c4|hie
559 m_h_eff_shifter->SetBinContent(5, m_h_eff[9] ->GetBinContent(6 + 1)); //hie with fff|ffo|ffb
560 m_h_eff_shifter->SetBinContent(6, m_h_eff[9] ->GetBinContent(7 + 1)); //c4 with fff|ffo|ffb
561 m_h_eff_shifter->SetBinContent(7, m_h_eff[10]->GetBinContent(23 + 1)); //mu_b2b with lml|eclmumu
562 m_h_eff_shifter->SetBinContent(8, m_h_eff[10]->GetBinContent(24 + 1)); //mu_eb2b with lml|eclmumu
563 m_h_eff_shifter->SetBinContent(9, m_h_eff[10]->GetBinContent(26 + 1)); //cdcklm2 with lml|eclmumu
564 m_h_eff_shifter->SetBinContent(10, m_h_eff[10]->GetBinContent(35 + 1)); //cdcecl2 with fff|ffo|ffb
565 m_h_eff_shifter->SetBinContent(11, m_h_eff[10]->GetBinContent(36 + 1)); //ecleklm with lml|eclmumu
566 m_h_eff_shifter->SetBinContent(12, m_h_eff[9] ->GetBinContent(37 + 1)); //syo with c4|hie
567 m_h_eff_shifter->SetBinContent(13, m_h_eff[9] ->GetBinContent(38 + 1)); //yioiecl1 with c4|hie
568 m_h_eff_shifter->SetBinContent(14, m_h_eff[9] ->GetBinContent(39 + 1)); //stt with c4|hie
569 m_h_eff_shifter->SetBinError(1, m_h_eff[9] ->GetBinError(0 + 1)); //fff with c4|hie
570 m_h_eff_shifter->SetBinError(2, m_h_eff[9] ->GetBinError(1 + 1)); //ffo with c4|hie
571 m_h_eff_shifter->SetBinError(3, m_h_eff[9] ->GetBinError(3 + 1)); //ffy with c4|hie
572 m_h_eff_shifter->SetBinError(4, m_h_eff[9] ->GetBinError(4 + 1)); //fyo with c4|hie
573 m_h_eff_shifter->SetBinError(5, m_h_eff[9] ->GetBinError(6 + 1)); //hie with fff|ffo|ffb
574 m_h_eff_shifter->SetBinError(6, m_h_eff[9] ->GetBinError(7 + 1)); //c4 with fff|ffo|ffb
575 m_h_eff_shifter->SetBinError(7, m_h_eff[10]->GetBinError(23 + 1)); //mu_b2b with lml|eclmumu
576 m_h_eff_shifter->SetBinError(8, m_h_eff[10]->GetBinError(24 + 1)); //mu_eb2b with lml|eclmumu
577 m_h_eff_shifter->SetBinError(9, m_h_eff[10]->GetBinError(26 + 1)); //cdcklm2 with lml|eclmumu
578 m_h_eff_shifter->SetBinError(10, m_h_eff[10]->GetBinError(35 + 1)); //cdcecl2 with fff|ffo|ffb
579 m_h_eff_shifter->SetBinError(11, m_h_eff[10]->GetBinError(36 + 1)); //ecleklm with lml|eclmumu
580 m_h_eff_shifter->SetBinError(12, m_h_eff[9] ->GetBinError(37 + 1)); //syo with c4|hie
581 m_h_eff_shifter->SetBinError(13, m_h_eff[9] ->GetBinError(38 + 1)); //yioiecl1 with c4|hie
582 m_h_eff_shifter->SetBinError(14, m_h_eff[9] ->GetBinError(39 + 1)); //stt with c4|hie
583
584
585 //fill efficiency with offline selection
586 m_h_psn_pure_extra = (TH1D*)findHist("TRGGDL/hGDL_psn_pure_extra_all");
587 if (m_h_psn_pure_extra == nullptr) {
588 B2WARNING("Histogram/canvas named hGDL_psn_pure_extra is not found.");
589 } else {
590 if (m_h_psn_pure_extra->GetBinContent(0 + 1) != 0)
591 m_h_pure_eff->SetBinContent(1, m_h_psn_pure_extra->GetBinContent(1 + 1) / m_h_psn_pure_extra->GetBinContent(
592 0 + 1)); //fff with c4|hie
593 if (m_h_psn_pure_extra->GetBinContent(3 + 1) != 0)
594 m_h_pure_eff->SetBinContent(2, m_h_psn_pure_extra->GetBinContent(4 + 1) / m_h_psn_pure_extra->GetBinContent(
595 3 + 1)); //ffo with c4|hie
596 if (m_h_psn_pure_extra->GetBinContent(6 + 1) != 0)
597 m_h_pure_eff->SetBinContent(3, m_h_psn_pure_extra->GetBinContent(7 + 1) / m_h_psn_pure_extra->GetBinContent(
598 6 + 1)); //ffb with c4|hie
599 if (m_h_psn_pure_extra->GetBinContent(0 + 1) != 0)
600 m_h_pure_eff->SetBinContent(4, m_h_psn_pure_extra->GetBinContent(2 + 1) / m_h_psn_pure_extra->GetBinContent(
601 0 + 1)); //ffy with c4|hie
602 if (m_h_psn_pure_extra->GetBinContent(3 + 1) != 0)
603 m_h_pure_eff->SetBinContent(5, m_h_psn_pure_extra->GetBinContent(5 + 1) / m_h_psn_pure_extra->GetBinContent(
604 3 + 1)); //fyo with c4|hie
605 if (m_h_psn_pure_extra->GetBinContent(6 + 1) != 0)
606 m_h_pure_eff->SetBinContent(6, m_h_psn_pure_extra->GetBinContent(8 + 1) / m_h_psn_pure_extra->GetBinContent(
607 6 + 1)); //fyb with c4|hie
608 if (m_h_psn_pure_extra->GetBinContent(9 + 1) != 0)
609 m_h_pure_eff->SetBinContent(7, m_h_psn_pure_extra->GetBinContent(10 + 1) / m_h_psn_pure_extra->GetBinContent(
610 9 + 1)); //hie with fff|ffo|ffb
611 if (m_h_psn_pure_extra->GetBinContent(11 + 1) != 0)
612 m_h_pure_eff->SetBinContent(8, m_h_psn_pure_extra->GetBinContent(12 + 1) / m_h_psn_pure_extra->GetBinContent(
613 11 + 1)); //hie with fff|ffo|ffb
614 }
615
616 for (unsigned iskim = 0; iskim < nskim_gdldqm; iskim++) {
617 m_c_eff[iskim]->Clear();
618 m_c_eff[iskim]->cd();
619 m_h_eff[iskim]->SetMinimum(0);
620 m_h_eff[iskim]->Draw();
621 m_c_eff[iskim]->Update();
622 }
623
624 for (unsigned iskim = 0; iskim < nskim_gdldqm; iskim++) {
625 m_c_eff_fast[iskim]->Clear();
626 m_c_eff_fast[iskim]->cd();
627 m_h_eff_fast[iskim]->SetMinimum(0);
628 m_h_eff_fast[iskim]->Draw();
629 m_c_eff_fast[iskim]->Update();
630 }
631
632 m_c_eff_shifter->Clear();
633 m_c_eff_shifter->cd();
634 m_h_eff_shifter->SetMaximum(1.1);
635 m_h_eff_shifter->SetMinimum(0);
636 m_h_eff_shifter->SetLineWidth(2);
637 m_h_eff_shifter->SetMarkerStyle(20);
638 m_h_eff_shifter_fast->SetLineColor(2);
639 m_h_eff_shifter_fast->SetLineStyle(3);
640 m_h_eff_shifter_fast->SetMaximum(1.1);
641 m_h_eff_shifter_fast->SetMinimum(0);
642 m_h_eff_shifter_fast->SetLineWidth(2);
643 m_h_eff_shifter_fast->SetMarkerStyle(20);
644 m_h_eff_shifter_fast->SetMarkerColor(2);
645 m_h_eff_shifter->SetTitle("TRG efficiency");
646 m_h_eff_shifter_fast->SetTitle("TRG efficiency");
647 m_c_eff_shifter->SetFrameLineColor(1);
648 m_h_eff_shifter->GetXaxis()->SetLabelColor(1);
649 m_h_eff_shifter->GetXaxis()->SetAxisColor(1);
650 m_h_eff_shifter->GetYaxis()->SetTitleColor(1);
651 m_h_eff_shifter->GetYaxis()->SetLabelColor(1);
652 m_h_eff_shifter->GetYaxis()->SetAxisColor(1);
653 m_c_eff_shifter_fast->SetFrameLineColor(1);
654 m_h_eff_shifter_fast->GetXaxis()->SetLabelColor(1);
655 m_h_eff_shifter_fast->GetXaxis()->SetAxisColor(1);
656 m_h_eff_shifter_fast->GetYaxis()->SetTitleColor(1);
657 m_h_eff_shifter_fast->GetYaxis()->SetLabelColor(1);
658 m_h_eff_shifter_fast->GetYaxis()->SetAxisColor(1);
659
660 m_IsPhysicsRun = (getRunType() == "physics");
661 if (m_IsPhysicsRun == true) {
662 int error_check = 0;
663 for (int i = 0; i < n_eff_shifter; i++) {
664 double eff = m_h_eff_shifter->GetBinContent(i + 1);
665 double err = m_h_eff_shifter->GetBinError(i + 1);
666 double eff_err_min = eff - 2 * err;
667 double eff_err_max = eff + 2 * err;
668 double eff_fast = m_h_eff_shifter_fast->GetBinContent(i + 1);
669 double err_fast = m_h_eff_shifter_fast->GetBinError(i + 1);
670 double eff_err_min_fast = eff_fast - 2 * err_fast;
671 double eff_err_max_fast = eff_fast + 2 * err_fast;
672 if (
673 (eff_err_max < m_limit_low_shifter[i]) || (eff_err_min > m_limit_high_shifter[i]) ||
674 (eff_err_max_fast < m_limit_low_shifter[i]) || (eff_err_min_fast > m_limit_high_shifter[i])
675 ) {error_check = 1;}
676 }
677
678 if (error_check == 1) {
679 m_c_eff_shifter->SetFillColor(2);
680 m_c_eff_shifter_fast->SetFillColor(2);
681 m_c_eff_shifter->SetFrameFillColor(10);
682 m_c_eff_shifter_fast->SetFrameFillColor(10);
683 m_h_eff_shifter->SetTitle("Call TRG expert: bad efficiency");
684 m_h_eff_shifter_fast->SetTitle("Call TRG expert: bad efficiency");
685 m_c_eff_shifter->SetFrameLineColor(1);
686 m_h_eff_shifter->GetXaxis()->SetLabelColor(1);
687 m_h_eff_shifter->GetXaxis()->SetAxisColor(1);
688 m_h_eff_shifter->GetYaxis()->SetTitleColor(1);
689 m_h_eff_shifter->GetYaxis()->SetLabelColor(1);
690 m_h_eff_shifter->GetYaxis()->SetAxisColor(1);
691 m_c_eff_shifter_fast->SetFrameLineColor(1);
692 m_h_eff_shifter_fast->GetXaxis()->SetLabelColor(1);
693 m_h_eff_shifter_fast->GetXaxis()->SetAxisColor(1);
694 m_h_eff_shifter_fast->GetYaxis()->SetTitleColor(1);
695 m_h_eff_shifter_fast->GetYaxis()->SetLabelColor(1);
696 m_h_eff_shifter_fast->GetYaxis()->SetAxisColor(1);
697 } else {
698 m_c_eff_shifter->SetFillColor(kGreen);
699 m_c_eff_shifter->SetFrameFillColor(10);
700 m_c_eff_shifter_fast->SetFillColor(kGreen);
701 m_c_eff_shifter_fast->SetFrameFillColor(10);
702 }
703 } else {
704 m_h_eff_shifter->SetTitle("Ignore this plot during non-physic run");
705 m_h_eff_shifter_fast->SetTitle("Ignore this plot during non-physic run");
706 }
707
708
709 m_h_eff_shifter->Draw();
710 m_h_eff_shifter_fast->Draw("same");
711
712 for (int i = 0; i < n_eff_shifter; i++) {
713 m_line_limit_low_shifter[i]-> SetLineColor(1);
714 m_line_limit_low_shifter[i]-> SetLineStyle(2);
715 m_line_limit_low_shifter[i]-> SetLineWidth(2);
716 m_line_limit_low_shifter[i]-> Draw("same");
717 m_line_limit_high_shifter[i]->SetLineColor(1);
718 m_line_limit_high_shifter[i]->SetLineStyle(2);
719 m_line_limit_high_shifter[i]-> SetLineWidth(2);
720 m_line_limit_high_shifter[i]->Draw("same");
721 }
722 m_c_eff_shifter->Update();
723
724 m_c_eff_shifter_fast->Clear();
726 m_h_eff_shifter_fast->Draw();
727 for (int i = 0; i < n_eff_shifter; i++) {
728 m_line_limit_low_shifter[i]-> SetLineColor(1);
729 m_line_limit_low_shifter[i]-> SetLineStyle(2);
730 m_line_limit_low_shifter[i]-> SetLineWidth(2);
731 m_line_limit_low_shifter[i]-> Draw("same");
732 m_line_limit_high_shifter[i]->SetLineColor(1);
733 m_line_limit_high_shifter[i]->SetLineStyle(2);
734 m_line_limit_high_shifter[i]-> SetLineWidth(2);
735 m_line_limit_high_shifter[i]->Draw("same");
736 }
737 m_c_eff_shifter_fast->Update();
738
739 m_c_pure_eff->Clear();
740 m_c_pure_eff->cd();
741 m_h_pure_eff->SetMinimum(0);
742 m_h_pure_eff->Draw();
743 m_c_pure_eff->Update();
744
745
746#ifdef _BELLE2_EPICS
747 if (getUseEpics()) {
748 for (auto i = 0; i < n_eff_shifter; i++) {
749 double data;
750 //data = m_h_eff_shifter->GetBinContent(i + 1);
751 data = m_h_eff_shifter_fast->GetBinContent(i + 1);
752 if (mychid[i]) SEVCHK(ca_put(DBR_DOUBLE, mychid[i], (void*)&data), "ca_set failure");
753 }
754 for (auto i = 0; i < nskim_gdldqm; i++) {
755 double data = 0;
756 if (m_h_psn_extra[i] == nullptr) {
757 B2WARNING("Histogram/canvas named hGDL_psn_extra is not found.");
758 } else if (m_h_psn_extra[6] == nullptr) {
759 B2WARNING("Histogram/canvas named hGDL_psn_extra is not found.");
760 } else {
761 if (i == 0 || i == 6) {
762 data = m_h_psn_extra[i]->GetBinContent(0 + 1);
763 } else if (m_h_psn_extra[6]->GetBinContent(0 + 1) != 0) {
764 data = m_h_psn_extra[i]->GetBinContent(0 + 1) / m_h_psn_extra[6]->GetBinContent(0 + 1);
765 }
766 }
767
768 if (mychid_entry[i]) SEVCHK(ca_put(DBR_DOUBLE, mychid_entry[i], (void*)&data), "ca_set failure");
769 }
770 SEVCHK(ca_pend_io(5.0), "ca_pend_io failure");
771 }
772#endif
773
774}
775
777{
778 B2DEBUG(20, "DQMHistAnalysisTRGGDL : endRun called");
779}
780
782{
783#ifdef _BELLE2_EPICS
784 if (getUseEpics()) {
785 for (auto i = 0; i < n_eff_shifter; i++) {
786 if (mychid[i]) SEVCHK(ca_clear_channel(mychid[i]), "ca_clear_channel failure");
787 }
788 for (auto i = 0; i < nskim_gdldqm; i++) {
789 if (mychid_entry[i]) SEVCHK(ca_clear_channel(mychid_entry[i]), "ca_clear_channel failure");
790 }
791 SEVCHK(ca_pend_io(5.0), "ca_pend_io failure");
792 }
793#endif
794 B2DEBUG(20, "terminate called");
795}
796
The base class for the histogram analysis module.
static TH1 * findHist(const std::string &histname, bool onlyIfUpdated=false)
Get histogram from list (no other search).
static const std::string & getRunType(void)
Get the Run Type.
bool getUseEpics(void)
Getter for EPICS usage.
TH1D * m_h_eff_shifter_fast
Histogram for TRGGDL efficiency, simplified one for CR shifter.
void initialize() override final
Initialize the Module.
static const int n_eff_shifter
number of bins for the simplified efficiency histogram
TCanvas * m_c_eff_shifter_fast
Canvas for TRGGDL efficiency, simplified one for CR shifter.
TCanvas * m_c_eff_fast[nskim_gdldqm]
Canvas for TRGGDL efficiency in each HLT skim.
bool m_IsPhysicsRun
Run type flag for physics runs.
TH1D * m_h_eff_fast[nskim_gdldqm]
Histogram for TRGGDL efficiency in each HLT skim.
bool m_enableAlert
Enable alert by base color of canvases.
static const int nskim_gdldqm
number of HLT skims
TLine * m_line_limit_high_shifter[n_eff_shifter]
upper limit line for the simplified efficiency histogram
double m_limit_low_shifter[n_eff_shifter]
lower limit value in each bin
TH1D * m_h_pure_eff
Histogram for TRGGDL efficiency with offline selection.
TLine * m_line_limit_low_shifter[n_eff_shifter]
lower limit line for the simplified efficiency histogram
void terminate() override final
Termination action.
TH1D * m_h_eff[nskim_gdldqm]
Histogram for TRGGDL efficiency in each HLT skim.
const char * c_eff[n_eff]
label of bins for the efficiency histogram
void event() override final
Event processor.
std::string skim_smap[nskim_gdldqm]
name of HLT skims
TH1D * m_h_eff_shifter
Histogram for TRGGDL efficiency, simplified one for CR shifter.
TH1D * m_h_psn_extra_fast[nskim_gdldqm]
DQM Histogram for PSN bits in each HLT skim.
double m_limit_high_shifter[n_eff_shifter]
upper limit value in each bin
TH1D * m_h_psn_pure_extra
DQM Histogram for PSN bits with offline selection.
static const int n_pure_eff
number of bins for the efficiency histogram with offline selection
TH1D * m_h_psn_extra[nskim_gdldqm]
DQM Histogram for PSN bits in each HLT skim.
TCanvas * m_c_pure_eff
Canvas for TRGGDL efficiency with offline selection.
void endRun() override final
End-of-run action.
TCanvas * m_c_eff[nskim_gdldqm]
Canvas for TRGGDL efficiency in each HLT skim.
const char * c_pure_eff[n_pure_eff]
label of bins for the efficiency histogram with offline selection
TCanvas * m_c_eff_shifter
Canvas for TRGGDL efficiency, simplified one for CR shifter.
static const int n_eff
number of bins for the efficiency histogram
const char * c_eff_shifter[n_eff_shifter]
label of bins for the simplified efficiency histogram
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:208
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition: Module.h:80
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:650
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.
STL namespace.