13 #include <trg/gdl/modules/trggdlDQM/TRGGDLDQMModule.h>
14 #include <trg/gdl/modules/trggdlUnpacker/trggdlUnpackerModule.h>
16 #include <framework/datastore/StoreObjPtr.h>
17 #include <framework/datastore/StoreArray.h>
19 #include <TDirectory.h>
20 #include <TPostScript.h>
25 #include <framework/logging/Logger.h>
26 #include <boost/algorithm/string.hpp>
47 addParam(
"eventByEventTimingHistRecord", m_eventByEventTimingHistRecord,
48 "Recording event by event timing distribution histogram or not",
50 addParam(
"dumpVcdFile", m_dumpVcdFile,
51 "Dumping vcd file or not",
53 addParam(
"bitConditionToDumpVcd", m_bitConditionToDumpVcd,
54 "Condition for vcd. alg format with '!' and '+'.",
56 addParam(
"vcdEventStart", m_vcdEventStart,
57 "Start equential event number",
59 addParam(
"vcdNumberOfEvents", m_vcdNumberOfEvents,
60 "Number of events to dump vcd file",
62 addParam(
"bitNameOnBinLabel", m_bitNameOnBinLabel,
63 "Put bitname on BinLabel",
65 addParam(
"generatePostscript", m_generatePostscript,
66 "Genarete postscript file or not",
68 addParam(
"postScriptName", m_postScriptName,
69 "postscript file name",
72 "use skim information or not",
74 B2DEBUG(20,
"eventByEventTimingFlag(" << m_eventByEventTimingHistRecord
75 <<
"), m_dumpVcdFile(" << m_dumpVcdFile
76 <<
"), m_bitConditionToDumpVcd(" << m_bitConditionToDumpVcd
77 <<
"), m_vcdEventStart(" << m_vcdEventStart
78 <<
"), m_vcdNumberOfEvents(" << m_vcdNumberOfEvents);
87 if (!oldDir->Get(
"TRGGDL"))oldDir->mkdir(
"TRGGDL");
90 for (
int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
91 h_c8_gdlL1TocomL1[iskim] =
new TH1I(Form(
"hGDL_gdlL1TocomL1_%s", skim_smap[iskim].c_str()),
"comL1 - gdlL1 [clk8ns]", 100, 0,
95 h_c8_topTogdlL1[iskim] =
new TH1I(Form(
"hGDL_topTogdlL1_%s", skim_smap[iskim].c_str()),
"gdlL1 - top_timing [clk8ns]", 700, 0,
98 h_c8_eclTogdlL1[iskim] =
new TH1I(Form(
"hGDL_eclTogdlL1_%s", skim_smap[iskim].c_str()),
"gdlL1 - ecl_timing [clk8ns]", 500, 0,
101 h_c8_cdcTogdlL1[iskim] =
new TH1I(Form(
"hGDL_cdcTogdlL1_%s", skim_smap[iskim].c_str()),
"gdlL1 - cdc_timing [clk8ns]", 700, 0,
105 h_c8_ecl8mToGDL[iskim] =
new TH1I(Form(
"hGDL_ecl8mToGDL_%s", skim_smap[iskim].c_str()),
"gdlIn^{8MHz} - ecl_timing [clk8ns]",
108 h_c8_topToGDL[iskim] =
new TH1I(Form(
"hGDL_topToGDL_%s", skim_smap[iskim].c_str()),
"gdlIn - top_timing [clk8ns]", 700, 0,
111 h_c8_eclToGDL[iskim] =
new TH1I(Form(
"hGDL_eclToGDL_%s", skim_smap[iskim].c_str()),
"gdlIn - ecl_timing [clk8ns]", 500, 0,
114 h_c8_cdcToGDL[iskim] =
new TH1I(Form(
"hGDL_cdcToGDL_%s", skim_smap[iskim].c_str()),
"gdlIn - cdc_timing [clk8ns]", 700, 0,
118 h_c2_cdcTocomL1[iskim] =
new TH1I(Form(
"hGDL_cdcTocomL1_%s", skim_smap[iskim].c_str()),
"comL1 - cdc_timing [clk2ns]", 520, 0,
121 h_ns_cdcTocomL1[iskim] =
new TH1D(Form(
"hGDL_ns_cdcTocomL1_%s", skim_smap[iskim].c_str()),
"comL1 - cdc_timing [ns]", 2600, 0,
125 h_ns_cdcTogdlL1[iskim] =
new TH1D(Form(
"hGDL_ns_cdcTogdlL1_%s", skim_smap[iskim].c_str()),
"gdlL1 - cdc_timing [ns]", 2600, 0,
130 h_ns_topToecl[iskim] =
new TH1D(Form(
"hGDL_ns_topToecl_%s", skim_smap[iskim].c_str()),
"ecl_timing - top_timing [ns]", 800, 0,
134 h_ns_topTocdc[iskim] =
new TH1D(Form(
"hGDL_ns_topTocdc_%s", skim_smap[iskim].c_str()),
"cdc_timing - top_timing [ns]", 800, 0,
138 h_ns_cdcToecl[iskim] =
new TH1D(Form(
"hGDL_ns_cdcToecl_%s", skim_smap[iskim].c_str()),
"ecl_timing - cdc_timing [ns]", 2000, 0,
143 h_c2_cdcToecl[iskim] =
new TH1I(Form(
"hGDL_cdcToecl_%s", skim_smap[iskim].c_str()),
"ecl_timing - cdc_timing [clk2ns]", 1000, 0,
147 h_timtype[iskim] =
new TH1I(Form(
"hGDL_timtype_%s", skim_smap[iskim].c_str()),
"timtype", 7, 0, 7);
149 h_itd[iskim] =
new TH1I(Form(
"hGDL_itd_%s", skim_smap[iskim].c_str()),
"itd", n_inbit + 1, -1, n_inbit);
150 h_ftd[iskim] =
new TH1I(Form(
"hGDL_ftd_%s", skim_smap[iskim].c_str()),
"ftd", n_outbit + 1, -1, n_outbit);
151 h_psn[iskim] =
new TH1I(Form(
"hGDL_psn_%s", skim_smap[iskim].c_str()),
"psn", n_outbit + 1, -1, n_outbit);
153 h_psn_extra[iskim] =
new TH1I(Form(
"hGDL_psn_extra_%s", skim_smap[iskim].c_str()),
"psn extra", n_output_extra, 0, n_output_extra);
154 for (
int i = 0; i < n_output_extra; i++) {
155 h_psn_extra[iskim]->GetXaxis()->SetBinLabel(i + 1, output_extra[i]);
158 h_psn_effect_to_l1[iskim] =
new TH1I(Form(
"hGDL_psn_effect_to_l1_%s", skim_smap[iskim].c_str()),
"psn effect to l1",
161 for (
int i = 0; i < n_output_overlap; i++) {
162 h_psn_effect_to_l1[iskim]->GetXaxis()->SetBinLabel(i + 1, output_overlap[i]);
165 h_psn_raw_rate[iskim] =
new TH1I(Form(
"hGDL_psn_raw_rate_%s", skim_smap[iskim].c_str()),
"psn raw rate", n_output_overlap, 0,
167 for (
int i = 0; i < n_output_overlap; i++) {
168 h_psn_raw_rate[iskim]->GetXaxis()->SetBinLabel(i + 1, output_overlap[i]);
171 h_psn_pure_extra[iskim] =
new TH1I(Form(
"hGDL_psn_pure_extra_%s", skim_smap[iskim].c_str()),
"psn pure extra", n_output_pure_extra,
172 0, n_output_pure_extra);
173 for (
int i = 0; i < n_output_pure_extra; i++) {
174 h_psn_pure_extra[iskim]->GetXaxis()->SetBinLabel(i + 1, output_pure_extra[i]);
177 h_itd[iskim]->GetXaxis()->SetBinLabel(
h_itd[iskim]->GetXaxis()->FindBin(-1 + 0.5),
"all");
178 h_ftd[iskim]->GetXaxis()->SetBinLabel(
h_ftd[iskim]->GetXaxis()->FindBin(-1 + 0.5),
"all");
179 h_psn[iskim]->GetXaxis()->SetBinLabel(
h_psn[iskim]->GetXaxis()->FindBin(-1 + 0.5),
"all");
180 for (
unsigned i = 0; i < n_inbit; i++) {
181 if (m_bitNameOnBinLabel) {
182 h_itd[iskim]->GetXaxis()->SetBinLabel(
h_itd[iskim]->GetXaxis()->FindBin(i + 0.5), inbitname[i]);
185 for (
unsigned i = 0; i < n_outbit; i++) {
186 if (m_bitNameOnBinLabel) {
187 h_ftd[iskim]->GetXaxis()->SetBinLabel(
h_ftd[iskim]->GetXaxis()->FindBin(i + 0.5), outbitname[i]);
188 h_psn[iskim]->GetXaxis()->SetBinLabel(
h_psn[iskim]->GetXaxis()->FindBin(i + 0.5), outbitname[i]);
193 if (iskim != 0)
continue;
196 for (
unsigned i = 0; i < n_inbit; i++) {
197 h_itd_rise[i][iskim] =
new TH1I(Form(
"hGDL_itd_%s_rise_%s", inbitname[i], skim_smap[iskim].c_str()),
198 Form(
"itd%d(%s) rising", i, inbitname[i]), 48, 0, 48);
199 h_itd_rise[i][iskim]->SetLineColor(kRed);
200 h_itd_fall[i][iskim] =
new TH1I(Form(
"hGDL_itd_%s_fall_%s", inbitname[i], skim_smap[iskim].c_str()),
201 Form(
"itd%d(%s) falling", i, inbitname[i]), 48, 0, 48);
202 h_itd_fall[i][iskim]->SetLineColor(kGreen);
204 for (
unsigned i = 0; i < n_outbit; i++) {
205 h_ftd_rise[i][iskim] =
new TH1I(Form(
"hGDL_ftd_%s_rise_%s", outbitname[i], skim_smap[iskim].c_str()),
206 Form(
"ftd%d(%s) rising", i, outbitname[i]), 48, 0, 48);
207 h_ftd_rise[i][iskim]->SetLineColor(kRed);
208 h_ftd_fall[i][iskim] =
new TH1I(Form(
"hGDL_ftd_%s_fall_%s", outbitname[i], skim_smap[iskim].c_str()),
209 Form(
"ftd%d(%s) falling", i, outbitname[i]), 48, 0, 48);
210 h_ftd_fall[i][iskim]->SetLineColor(kGreen);
211 h_psn_rise[i][iskim] =
new TH1I(Form(
"hGDL_psn_%s_rise_%s", outbitname[i], skim_smap[iskim].c_str()),
212 Form(
"psn%d(%s) rising", i, outbitname[i]), 48, 0, 48);
213 h_psn_rise[i][iskim]->SetLineColor(kRed);
214 h_psn_fall[i][iskim] =
new TH1I(Form(
"hGDL_psn_%s_fall_%s", outbitname[i], skim_smap[iskim].c_str()),
215 Form(
"psn%d(%s) falling", i, outbitname[i]), 48, 0, 48);
216 h_psn_fall[i][iskim]->SetLineColor(kGreen);
228 for (
int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
244 h_itd[iskim]->Reset();
245 h_ftd[iskim]->Reset();
246 h_psn[iskim]->Reset();
247 h_psn_extra[iskim]->Reset();
248 h_psn_pure_extra[iskim]->Reset();
250 h_psn_raw_rate[iskim]->Reset();
251 h_psn_effect_to_l1[iskim]->Reset();
261 start_skim_gdldqm = 0;
263 }
else if (m_skim == 1) {
264 start_skim_gdldqm = 1;
265 end_skim_gdldqm = nskim_gdldqm;
267 start_skim_gdldqm = 0;
268 end_skim_gdldqm = nskim_gdldqm;
271 _exp = bevt->getExperiment();
272 _run = bevt->getRun();
279 for (
int i = 0; i < 320; i++) {
280 LeafBitMap[i] = m_unpacker->getLeafMap(i);
282 for (
int i = 0; i < 320; i++) {
283 strcpy(LeafNames[i], m_unpacker->getLeafnames(i));
294 for (
int i = 0; i < 10; i++) {
299 for (
int i = 0; i < 320; i++) {
300 if (strcmp(LeafNames[i],
"timtype") == 0) _e_timtype = LeafBitMap[i];
301 if (strcmp(LeafNames[i],
"gdll1rvc") == 0) _e_gdll1rvc = LeafBitMap[i];
302 if (strcmp(LeafNames[i],
"coml1rvc") == 0) _e_coml1rvc = LeafBitMap[i];
303 if (strcmp(LeafNames[i],
"toptiming") == 0)_e_toptiming = LeafBitMap[i];
304 if (strcmp(LeafNames[i],
"ecltiming") == 0)_e_ecltiming = LeafBitMap[i];
305 if (strcmp(LeafNames[i],
"cdctiming") == 0)_e_cdctiming = LeafBitMap[i];
306 if (strcmp(LeafNames[i],
"toprvc") == 0) _e_toprvc = LeafBitMap[i];
307 if (strcmp(LeafNames[i],
"eclrvc") == 0) _e_eclrvc = LeafBitMap[i];
308 if (strcmp(LeafNames[i],
"cdcrvc") == 0) _e_cdcrvc = LeafBitMap[i];
309 if (strcmp(LeafNames[i],
"psn0") == 0) ee_psn[0] = LeafBitMap[i];
310 if (strcmp(LeafNames[i],
"psn1") == 0) ee_psn[1] = LeafBitMap[i];
311 if (strcmp(LeafNames[i],
"psn2") == 0) ee_psn[2] = LeafBitMap[i];
312 if (strcmp(LeafNames[i],
"psn3") == 0) ee_psn[3] = LeafBitMap[i];
313 if (strcmp(LeafNames[i],
"psn4") == 0) ee_psn[4] = LeafBitMap[i];
314 if (strcmp(LeafNames[i],
"psn5") == 0) ee_psn[5] = LeafBitMap[i];
315 if (strcmp(LeafNames[i],
"psn6") == 0) ee_psn[6] = LeafBitMap[i];
316 if (strcmp(LeafNames[i],
"psn7") == 0) ee_psn[7] = LeafBitMap[i];
317 if (strcmp(LeafNames[i],
"psn8") == 0) ee_psn[8] = LeafBitMap[i];
318 if (strcmp(LeafNames[i],
"psn9") == 0) ee_psn[9] = LeafBitMap[i];
319 if (strcmp(LeafNames[i],
"ftd0") == 0) ee_ftd[0] = LeafBitMap[i];
320 if (strcmp(LeafNames[i],
"ftd1") == 0) ee_ftd[1] = LeafBitMap[i];
321 if (strcmp(LeafNames[i],
"ftd2") == 0) ee_ftd[2] = LeafBitMap[i];
322 if (strcmp(LeafNames[i],
"ftd3") == 0) ee_ftd[3] = LeafBitMap[i];
323 if (strcmp(LeafNames[i],
"ftd4") == 0) ee_ftd[4] = LeafBitMap[i];
324 if (strcmp(LeafNames[i],
"ftd5") == 0) ee_ftd[5] = LeafBitMap[i];
325 if (strcmp(LeafNames[i],
"ftd6") == 0) ee_ftd[6] = LeafBitMap[i];
326 if (strcmp(LeafNames[i],
"ftd7") == 0) ee_ftd[7] = LeafBitMap[i];
327 if (strcmp(LeafNames[i],
"ftd8") == 0) ee_ftd[8] = LeafBitMap[i];
328 if (strcmp(LeafNames[i],
"ftd9") == 0) ee_ftd[9] = LeafBitMap[i];
329 if (strcmp(LeafNames[i],
"itd0") == 0) ee_itd[0] = LeafBitMap[i];
330 if (strcmp(LeafNames[i],
"itd1") == 0) ee_itd[1] = LeafBitMap[i];
331 if (strcmp(LeafNames[i],
"itd2") == 0) ee_itd[2] = LeafBitMap[i];
332 if (strcmp(LeafNames[i],
"itd3") == 0) ee_itd[3] = LeafBitMap[i];
333 if (strcmp(LeafNames[i],
"itd4") == 0) ee_itd[4] = LeafBitMap[i];
334 if (strcmp(LeafNames[i],
"itd5") == 0) ee_itd[5] = LeafBitMap[i];
335 if (strcmp(LeafNames[i],
"itd6") == 0) ee_itd[6] = LeafBitMap[i];
336 if (strcmp(LeafNames[i],
"itd7") == 0) ee_itd[7] = LeafBitMap[i];
337 if (strcmp(LeafNames[i],
"itd8") == 0) ee_itd[8] = LeafBitMap[i];
338 if (strcmp(LeafNames[i],
"itd9") == 0) ee_itd[9] = LeafBitMap[i];
341 n_inbit = m_dbinput->getninbit();
342 n_outbit = m_dbftdl ->getnoutbit();
343 for (
int i = 0; i < 320; i++) {
344 strcpy(inbitname[i], m_dbinput->getinbitname(i));
346 for (
int i = 0; i < 320; i++) {
347 strcpy(outbitname[i], m_dbftdl->getoutbitname(i));
349 n_leafs = m_unpacker->getnLeafs();
350 n_leafsExtra = m_unpacker->getnLeafsExtra();
351 n_clocks = m_unpacker->getnClks();
352 nconf = m_unpacker->getconf();
353 nword_input = m_unpacker->get_nword_input();
354 nword_output = m_unpacker->get_nword_output();
356 for (
unsigned i = 0; i < n_clocks; i++) {
357 for (
int j = 0; j < n_leafs + n_leafsExtra; j++)h_0_vec.push_back(0);
358 for (
int j = 0; j < n_outbit; j++) h_p_vec.push_back(0);
359 for (
int j = 0; j < n_outbit; j++) h_f_vec.push_back(0);
360 for (
int j = 0; j < n_inbit; j++) h_i_vec.push_back(0);
367 if (m_generatePostscript) {
368 TPostScript* ps =
new TPostScript(m_postScriptName.c_str(), 112);
369 gStyle->SetOptStat(0);
370 TCanvas c1(
"c1",
"", 0, 0, 500, 300);
373 for (
int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
375 h_itd[iskim]->GetXaxis()->SetRange(
h_itd[iskim]->GetXaxis()->FindBin(0.5),
376 h_itd[iskim]->GetXaxis()->FindBin(n_inbit - 0.5));
377 h_itd[iskim]->Draw();
379 h_ftd[iskim]->GetXaxis()->SetRange(
h_ftd[iskim]->GetXaxis()->FindBin(0.5),
380 h_ftd[iskim]->GetXaxis()->FindBin(n_outbit - 0.5));
381 h_ftd[iskim]->Draw();
383 h_psn[iskim]->GetXaxis()->SetRange(
h_psn[iskim]->GetXaxis()->FindBin(0.5),
384 h_psn[iskim]->GetXaxis()->FindBin(n_outbit - 0.5));
385 h_psn[iskim]->Draw();
387 h_ftd[iskim]->SetTitle(
"ftd(green), psnm(red)");
388 h_ftd[iskim]->SetFillColor(kGreen);
389 h_ftd[iskim]->SetBarWidth(0.4);
390 h_ftd[iskim]->Draw(
"bar");
391 h_psn[iskim]->SetFillColor(kRed);
392 h_psn[iskim]->SetBarWidth(0.4);
393 h_psn[iskim]->SetBarOffset(0.5);
394 h_psn[iskim]->Draw(
"bar,same");
431 if (iskim != 0)
continue;
432 for (
unsigned i = 0; i < n_inbit; i++) {
434 h_itd_rise[i][iskim]->SetTitle(Form(
"itd%d(%s) rising(red), falling(green)",
436 h_itd_rise[i][iskim]->Draw();
437 h_itd_fall[i][iskim]->Draw(
"same");
450 static unsigned nvcd = 0;
451 static bool begin_run =
true;
455 if (!entAry || !entAry.getEntries()) {
460 for (
int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
461 if (iskim == 0)
skim.push_back(iskim);
463 if (result_soft.isValid()) {
464 const std::map<std::string, int>& skim_map = result_soft->getResults();
465 for (
int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
467 else if (skim_map.find(skim_menu[iskim]) != skim_map.end()) {
469 if (accepted)
skim.push_back(iskim);
477 for (
int i = 0; i < 320; i++) {
478 if (strcmp(entAry[0]->m_unpackername[i],
"evt") == 0) evtno = entAry[0]->m_unpacker[i];
479 if (strcmp(entAry[0]->m_unpackername[i],
"clk") == 0) clk_map = i;
482 const double clkTo2ns = 1. / .508877;
483 const double clkTo1ns = 0.5 / .508877;
487 for (
unsigned i = 0; i < n_clocks; i++) {
488 for (
int j = 0; j < n_leafs + n_leafsExtra; j++) {
489 h_0_vec[i * (n_leafs + n_leafsExtra) + j] = 0;
491 for (
unsigned j = 0; j < n_outbit; j++) {
492 h_p_vec[i * n_outbit + j] = 0;
494 for (
unsigned j = 0; j < n_outbit; j++) {
495 h_f_vec[i * n_outbit + j] = 0;
497 for (
unsigned j = 0; j < n_inbit; j++) {
498 h_i_vec[i * n_inbit + j] = 0;
505 for (
int ii = 0; ii < entAry.getEntries(); ii++) {
506 std::vector<int*> Bits(n_leafs + n_leafsExtra);
508 for (
int i = 0; i < 320; i++) {
509 if (LeafBitMap[i] != -1) {
510 Bits[LeafBitMap[i]] = &(entAry[ii]->m_unpacker[i]);
513 for (
int leaf = 0; leaf < n_leafs + n_leafsExtra; leaf++) {
514 h_0_vec[(entAry[ii]->m_unpacker[clk_map]) * (n_leafs + n_leafsExtra) + leaf] = *Bits[leaf];
517 int coml1rvc = h_0_vec[0 * (n_leafs + n_leafsExtra) + _e_coml1rvc];
518 int toprvc = h_0_vec[0 * (n_leafs + n_leafsExtra) + _e_toprvc];
519 int eclrvc = h_0_vec[0 * (n_leafs + n_leafsExtra) + _e_eclrvc];
520 int cdcrvc = h_0_vec[0 * (n_leafs + n_leafsExtra) + _e_cdcrvc];
521 int c1_top_timing = h_0_vec[(n_clocks - 1) * (n_leafs + n_leafsExtra) + _e_toptiming];
522 int c1_ecl_timing = h_0_vec[(n_clocks - 1) * (n_leafs + n_leafsExtra) + _e_ecltiming];
523 int c1_cdc_timing = h_0_vec[(n_clocks - 1) * (n_leafs + n_leafsExtra) + _e_cdctiming];
524 int c8_top_timing = c1_top_timing >> 3;
525 int c2_top_timing = c1_top_timing >> 1;
526 int c8_ecl_timing = c1_ecl_timing >> 3;
527 int c2_ecl_timing = c1_ecl_timing >> 1;
528 int c8_cdc_timing = c1_cdc_timing >> 3;
529 int c2_cdc_timing = c1_cdc_timing >> 1;
532 B2DEBUG(20,
"nconf(" << nconf
533 <<
"), n_clocks(" << n_clocks
534 <<
"), n_leafs(" << n_leafs
535 <<
"), n_leafsExtra(" << n_leafsExtra
546 int gdll1_rvc = h_0_vec[(n_clocks - 1) * (n_leafs + n_leafsExtra) + _e_gdll1rvc];
549 for (
unsigned clk = 1; clk <= n_clocks; clk++) {
550 int psn_tmp[10] = {0};
551 int ftd_tmp[10] = {0};
552 int itd_tmp[10] = {0};
553 for (
unsigned j = 0; j < (unsigned)nword_input; j++) {
554 itd_tmp[j] = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + ee_itd[j]];
555 itd[j] |= itd_tmp[j];
556 for (
int i = 0; i < 32; i++) {
557 if (i + j * 32 >= n_inbit)
continue;
558 if (itd_tmp[j] & (1 << i)) h_i_vec[(clk - 1)*n_inbit + i + j * 32] = 1;
562 psn_tmp[0] = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + ee_psn[0]];
563 ftd_tmp[0] = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + ee_ftd[0]];
564 psn[0] |= psn_tmp[0];
565 ftd[0] |= ftd_tmp[0];
566 for (
int i = 0; i < 32; i++) {
567 if (i >= n_outbit)
continue;
568 if (psn_tmp[0] & (1 << i)) h_p_vec[(clk - 1)*n_outbit + i] = 1;
569 if (ftd_tmp[0] & (1 << i)) h_f_vec[(clk - 1)*n_outbit + i] = 1;
571 psn_tmp[1] = h_0_vec[(clk - 1) * n_outbit + ee_psn[2]] * (1 << 16) + h_0_vec[(clk - 1) * n_outbit + ee_psn[1]];
572 ftd_tmp[1] = h_0_vec[(clk - 1) * n_outbit + ee_ftd[2]] * (1 << 16) + h_0_vec[(clk - 1) * n_outbit + ee_ftd[1]];
573 psn[1] |= psn_tmp[1];
574 ftd[1] |= ftd_tmp[1];
575 for (
int i = 0; i < 32; i++) {
576 if (i + 32 >= n_outbit)
continue;
577 if (psn_tmp[1] & (1 << i)) h_p_vec[(clk - 1)*n_outbit + i + 32] = 1;
578 if (ftd_tmp[1] & (1 << i)) h_f_vec[(clk - 1)*n_outbit + i + 32] = 1;
581 for (
unsigned j = 0; j < (unsigned)nword_output; j++) {
582 psn_tmp[j] = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + ee_psn[j]];
583 ftd_tmp[j] = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + ee_ftd[j]];
584 psn[j] |= psn_tmp[j];
585 ftd[j] |= ftd_tmp[j];
586 for (
int i = 0; i < 32; i++) {
587 if (i + j * 32 >= n_outbit)
continue;
588 if (psn_tmp[j] & (1 << i)) h_p_vec[(clk - 1)*n_outbit + i + j * 32] = 1;
589 if (ftd_tmp[j] & (1 << i)) h_f_vec[(clk - 1)*n_outbit + i + j * 32] = 1;
593 int timtype_tmp = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + _e_timtype];
594 timtype = (timtype_tmp == 0) ? timtype : timtype_tmp;
600 fillRiseFallTimings();
607 for (
unsigned ifill = 0; ifill <
skim.size(); ifill++) {
612 for (
int i = 0; i < 32; i++) {
613 for (
unsigned j = 0; j < (unsigned)nword_input; j++) {
614 if (itd[j] & (1 << i))
h_itd[
skim[ifill]]->Fill(i + 0.5 + 32 * j);
616 for (
unsigned j = 0; j < (unsigned)nword_output; j++) {
617 if (ftd[j] & (1 << i))
h_ftd[
skim[ifill]]->Fill(i + 0.5 + 32 * j);
618 if (psn[j] & (1 << i))
h_psn[
skim[ifill]]->Fill(i + 0.5 + 32 * j);
623 int gdlL1TocomL1 = gdll1_rvc < coml1rvc ? coml1rvc - gdll1_rvc : (coml1rvc + 1280) - gdll1_rvc;
626 int topTogdlL1 = gdll1_rvc < c8_top_timing ? (gdll1_rvc + 1280) - c8_top_timing : gdll1_rvc - c8_top_timing;
629 int eclTogdlL1 = gdll1_rvc < c8_ecl_timing ? (gdll1_rvc + 1280) - c8_ecl_timing : gdll1_rvc - c8_ecl_timing;
632 int cdcTogdlL1 = gdll1_rvc < c8_cdc_timing ? (gdll1_rvc + 1280) - c8_cdc_timing : gdll1_rvc - c8_cdc_timing;
635 int c127_ecl_timing = c8_ecl_timing & (((1 << 7) - 1) << 4);
636 int fit8mToGDL = c127_ecl_timing < eclrvc ? eclrvc - c127_ecl_timing : (eclrvc + 1280) - c127_ecl_timing;
639 int topToGDL = c8_top_timing < toprvc ? toprvc - c8_top_timing : (toprvc + 1280) - c8_top_timing;
641 int eclToGDL = c8_ecl_timing < eclrvc ? eclrvc - c8_ecl_timing : (eclrvc + 1280) - c8_ecl_timing;
643 int cdcToGDL = c8_cdc_timing < cdcrvc ? cdcrvc - c8_cdc_timing : (cdcrvc + 1280) - c8_cdc_timing;
646 int c2_comL1 = coml1rvc << 2;
647 int c2_gdlL1 = gdll1_rvc << 2;
648 int c2_diff_cdcTogdlL1 = c2_gdlL1 > c2_cdc_timing ?
649 c2_gdlL1 - c2_cdc_timing :
650 c2_gdlL1 - c2_cdc_timing + (1280 << 2) ;
653 int c2_diff_cdcTocomL1 = c2_comL1 > c2_cdc_timing ?
654 c2_comL1 - c2_cdc_timing :
655 c2_comL1 - c2_cdc_timing + (1280 << 2) ;
659 int c2_diff_cdcToecl = c2_ecl_timing > c2_cdc_timing ?
660 c2_ecl_timing - c2_cdc_timing :
661 c2_ecl_timing - c2_cdc_timing + (1280 << 2);
665 int c1_diff_topToecl = c1_ecl_timing > c1_top_timing ?
666 c1_ecl_timing - c1_top_timing :
667 c1_ecl_timing - c1_top_timing + (1280 << 3);
670 int c2_diff_topTocdc = c2_cdc_timing > c2_top_timing ?
671 c2_cdc_timing - c2_top_timing :
672 c2_cdc_timing - c2_top_timing + (1280 << 2);
679 if (anaBitCondition()) {
681 B2DEBUG(20,
"anaBitCondition fired, evt(" << evtno <<
")");
682 if (m_vcdEventStart <= nvcd && nvcd < m_vcdEventStart + m_vcdNumberOfEvents) {
690 bool TRGGDLDQMModule::anaBitCondition(
void)
692 if (m_bitConditionToDumpVcd.length() == 0)
return true;
693 const char* cst = m_bitConditionToDumpVcd.c_str();
694 bool reading_word =
false;
695 bool result_the_term =
true;
696 bool not_flag =
false;
697 unsigned begin_word = 0;
698 unsigned word_length = 0;
701 for (
unsigned i = 0; i < m_bitConditionToDumpVcd.length(); i++) {
702 if ((
'a' <= cst[i] && cst[i] <=
'z') ||
703 (
'A' <= cst[i] && cst[i] <=
'Z') ||
704 (
'_' == cst[i]) || (
'!' == cst[i]) ||
705 (
'0' <= cst[i] && cst[i] <=
'9')) {
708 if (i == m_bitConditionToDumpVcd.length() - 1) {
709 bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
711 m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
712 <<
"(" << fired <<
")");
713 if (((!not_flag && fired) || (not_flag && !fired)) && result_the_term) {
728 if (i == m_bitConditionToDumpVcd.length() - 1) {
730 bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
732 m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
733 <<
"(" << fired <<
")");
734 if (((!not_flag && fired) || (not_flag && !fired)) && result_the_term) {
740 }
else if (
'+' == cst[i] || i == m_bitConditionToDumpVcd.length() - 1) {
743 if (result_the_term) {
744 bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
746 m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
747 <<
"(" << fired <<
")");
748 if ((!not_flag && fired) || (not_flag && !fired)) {
756 reading_word =
false;
759 if (result_the_term) {
765 result_the_term =
true;
770 reading_word =
false;
771 if (result_the_term) {
773 bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
775 m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
776 <<
"(" << fired <<
")");
777 if ((!not_flag && fired) || (not_flag && !fired)) {
780 result_the_term =
false;
785 reading_word =
false;
794 void TRGGDLDQMModule::genVcd(
void)
796 int prev_i[400] = {0};
797 int prev_f[400] = {0};
798 int prev_p[400] = {0};
800 ofstream outf(Form(
"vcd/e%02dr%08de%08d.vcd", _exp, _run, evtno));
801 outf <<
"$date" << endl;
802 outf <<
" Aug 20, 2018 17:53:52" << endl;
803 outf <<
"$end" << endl;
804 outf <<
"$version" << endl;
805 outf <<
" ChipScope Pro Analyzer 14.7 P.20131013 (Build 14700.13.286.464)" << endl;
806 outf <<
"$end" << endl;
807 outf <<
"$timescale" << endl;
808 if (n_clocks == 32) {
809 outf <<
" 32ns" << endl;
810 }
else if (n_clocks == 48) {
811 outf <<
" 8ns" << endl;
813 outf <<
" 1ns" << endl;
815 outf <<
"$end" << endl;
817 outf <<
"$scope module gdl0067d_icn $end" << endl;
819 for (
unsigned j = 0; j < n_inbit; j++) {
820 outf <<
"$var wire 1 n" << seqnum++ <<
" " << inbitname[j] <<
" $end" << endl;
822 for (
unsigned j = 0; j < n_outbit; j++) {
823 outf <<
"$var wire 1 n" << seqnum++ <<
" ftd." << outbitname[j] <<
" $end" << endl;
825 for (
unsigned j = 0; j < n_outbit; j++) {
826 outf <<
"$var wire 1 n" << seqnum++ <<
" psn." << outbitname[j] <<
" $end" << endl;
829 outf <<
"$upscope $end" << endl;
830 outf <<
"$enddefinitions $end" << endl << endl;
832 for (
unsigned clk = 1; clk <= n_clocks; clk++) {
834 outf <<
"#" << clk - 1 << endl;
835 for (
unsigned k = 1; k <= n_inbit; k++) {
836 if (clk == 1 || prev_i[k - 1] != h_i_vec[(clk - 1)*n_inbit + k - 1]) {
837 prev_i[k - 1] = h_i_vec[(clk - 1) * n_inbit + k - 1];
838 outf << h_i_vec[(clk - 1)*n_inbit + k - 1] <<
"n" << seqnum << endl;
842 for (
unsigned k = 1; k <= n_outbit; k++) {
843 if (clk == 1 || prev_f[k - 1] != h_f_vec[(clk - 1)*n_outbit + k - 1]) {
844 prev_f[k - 1] = h_f_vec[(clk - 1) * n_outbit + k - 1];
845 outf << h_f_vec[(clk - 1)*n_outbit + k - 1] <<
"n" << seqnum << endl;
849 for (
unsigned k = 1; k <= n_outbit; k++) {
850 if (clk == 1 || prev_p[k - 1] != h_p_vec[(clk - 1)*n_outbit + k - 1]) {
851 prev_p[k - 1] = h_p_vec[(clk - 1) * n_outbit + k - 1];
852 outf << h_p_vec[(clk - 1)*n_outbit + k - 1] <<
"n" << seqnum << endl;
880 TRGGDLDQMModule::isFired_quick(
const std::string& bitname,
const bool& isPsnm = 0)
882 int bn = getoutbitnum(bitname.c_str());
883 for (
unsigned clk = 0; clk < n_clocks; clk++) {
886 if (h_p_vec[clk * n_outbit + bn] > 0)
889 if (h_f_vec[clk * n_outbit + bn] > 0)
894 bn = getinbitnum(bitname.c_str());
895 for (
unsigned clk = 0; clk < n_clocks; clk++) {
897 if (h_i_vec[clk * n_inbit + bn] > 0)
905 TRGGDLDQMModule::getinbitnum(
const char* c)
const
907 for (
int i = 0; i < 320; i++) {
908 if (strcmp(c, inbitname[i]) == 0)
return i;
914 TRGGDLDQMModule::getoutbitnum(
const char* c)
const
916 for (
int i = 0; i < 320; i++) {
917 if (strcmp(c, outbitname[i]) == 0)
return i;
924 TRGGDLDQMModule::isFired(std::string bitname)
927 for (
unsigned i = 0; i < bitname.length(); i++) {
928 if (
'A' <= bitname[i] && bitname[i] <=
'Z') {
932 boost::algorithm::to_lower(bitname);
933 int bn = m_dbftdl->getoutbitnum(bitname.c_str());
934 for (
unsigned clk = 0; clk < n_clocks; clk++) {
937 if (h_p_vec[clk * n_outbit + bn] > 0)
940 if (h_f_vec[clk * n_outbit + bn] > 0)
945 bn = m_dbinput->getinbitnum(bitname.c_str());
946 for (
unsigned clk = 0; clk < n_clocks; clk++) {
948 if (h_i_vec[clk * n_inbit + bn] > 0)
956 TRGGDLDQMModule::fillRiseFallTimings(
void)
960 for (
unsigned ifill = 0; ifill <
skim.size(); ifill++) {
962 if (
skim[ifill] != 0)
continue;
964 for (
unsigned i = 0; i < n_inbit; i++) {
965 if (n_clocks == 32) {
966 h_itd_rise[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk32ns");
967 h_itd_fall[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk32ns");
968 h_itd_rise[i][
skim[ifill]]->GetXaxis()->SetRange(1, 32);
969 h_itd_fall[i][
skim[ifill]]->GetXaxis()->SetRange(1, 32);
971 h_itd_rise[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk8ns");
972 h_itd_fall[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk8ns");
974 bool rising_done =
false;
975 bool falling_done =
false;
976 for (
unsigned clk = 0; clk < n_clocks; clk++) {
977 if (h_i_vec[clk * n_inbit + i] > 0) {
979 h_itd_rise[i][
skim[ifill]]->Fill(clk + 0.5);
981 }
else if (rising_done && !falling_done && clk == n_clocks - 1) {
982 h_itd_fall[i][
skim[ifill]]->Fill(clk + 0.5);
984 }
else if (h_i_vec[clk * n_inbit + i] == 0) {
985 if (rising_done && ! falling_done) {
986 h_itd_fall[i][
skim[ifill]]->Fill(clk + 0.5);
992 for (
unsigned i = 0; i < n_outbit; i++) {
993 if (n_clocks == 32) {
994 h_ftd_rise[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk32ns");
995 h_psn_rise[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk32ns");
996 h_ftd_fall[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk32ns");
997 h_psn_fall[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk32ns");
998 h_ftd_rise[i][
skim[ifill]]->GetXaxis()->SetRange(1, 32);
999 h_psn_rise[i][
skim[ifill]]->GetXaxis()->SetRange(1, 32);
1000 h_ftd_fall[i][
skim[ifill]]->GetXaxis()->SetRange(1, 32);
1001 h_psn_fall[i][
skim[ifill]]->GetXaxis()->SetRange(1, 32);
1003 h_ftd_rise[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk8ns");
1004 h_psn_rise[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk8ns");
1005 h_ftd_fall[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk8ns");
1006 h_psn_fall[i][
skim[ifill]]->GetXaxis()->SetTitle(
"clk8ns");
1008 bool rising_done =
false;
1009 bool falling_done =
false;
1010 for (
unsigned clk = 0; clk < n_clocks; clk++) {
1011 if (h_f_vec[clk * n_outbit + i] > 0) {
1012 if (! rising_done) {
1013 h_ftd_rise[i][
skim[ifill]]->Fill(clk + 0.5);
1015 }
else if (rising_done && !falling_done && clk == n_clocks - 1) {
1016 h_ftd_fall[i][
skim[ifill]]->Fill(clk + 0.5);
1018 }
else if (h_f_vec[clk * n_outbit + i] == 0) {
1019 if (rising_done && ! falling_done) {
1020 h_ftd_fall[i][
skim[ifill]]->Fill(clk + 0.5);
1021 falling_done =
true;
1025 rising_done =
false;
1026 falling_done =
false;
1027 for (
unsigned clk = 0; clk < n_clocks; clk++) {
1028 if (h_p_vec[clk * n_outbit + i] > 0) {
1029 if (! rising_done) {
1030 h_psn_rise[i][
skim[ifill]]->Fill(clk + 0.5);
1032 }
else if (rising_done && !falling_done && clk == n_clocks - 1) {
1033 h_psn_fall[i][
skim[ifill]]->Fill(clk + 0.5);
1035 }
else if (h_p_vec[clk * n_outbit + i] == 0) {
1036 if (rising_done && ! falling_done) {
1037 h_psn_fall[i][
skim[ifill]]->Fill(clk + 0.5);
1038 falling_done =
true;
1048 TRGGDLDQMModule::fillOutputOverlap(
void)
1050 for (
unsigned ifill = 0; ifill <
skim.size(); ifill++) {
1051 bool ffy_fired = isFired_quick(
"ffy",
true);
1052 bool fyo_fired = isFired_quick(
"fyo",
true) || isFired_quick(
"fyb",
true);
1053 bool c4_fired = isFired_quick(
"c4",
true);
1054 bool hie_fired = isFired_quick(
"hie",
true);
1055 bool klm_fired = isFired_quick(
"mu_b2b",
true) || isFired_quick(
"mu_eb2b",
true) || isFired_quick(
"eklm2",
true)
1056 || isFired_quick(
"beklm",
true);
1057 bool klm_match_fired = isFired_quick(
"cdcklm1",
true) || isFired_quick(
"cdcklm2",
true)
1058 || isFired_quick(
"seklm1",
true) || isFired_quick(
"seklm2",
true)
1059 || isFired_quick(
"fwd_seklm",
true) || isFired_quick(
"bwd_seklm",
true)
1060 || isFired_quick(
"ieklm1",
true) || isFired_quick(
"ecleklm1",
true);
1061 bool stt_fired = isFired_quick(
"stt",
true) || isFired_quick(
"sttecl",
true);
1062 bool short_fired = isFired_quick(
"syo",
true) || isFired_quick(
"syb",
true) || isFired_quick(
"yioiecl1",
true) ;
1063 bool ff30_fired = isFired_quick(
"fy30",
true);
1064 bool inner_fired = isFired_quick(
"ioiecl2",
true);
1065 bool lml_fired = isFired_quick(
"lml0",
true) || isFired_quick(
"lml2",
true) || isFired_quick(
"lml6",
true)
1066 || isFired_quick(
"lml7",
true) || isFired_quick(
"lml8",
true) || isFired_quick(
"lml9",
true)
1067 || isFired_quick(
"lml10",
true)
1068 || isFired_quick(
"lml12",
true) || isFired_quick(
"lml13",
true);
1069 bool gg_fired = isFired_quick(
"ggsel",
true);
1070 bool bhabha_fired = isFired_quick(
"bhapur",
true);
1071 bool pid_fired = isFired_quick(
"ssb",
true) || isFired_quick(
"eed",
true) || isFired_quick(
"fed",
true)
1072 || isFired_quick(
"fp",
true) || isFired_quick(
"shem",
true) || isFired_quick(
"ohem",
true);
1073 bool bhamon_fired = isFired_quick(
"bffo",
true) || isFired_quick(
"bhie",
true);
1074 bool eclmumu_fired = isFired_quick(
"eclmumu",
true);
1075 bool lml1_fired = isFired_quick(
"lml1",
true);
1076 bool lml4_fired = isFired_quick(
"lml4",
true);
1077 bool veto_fired = isFired_quick(
"hiev",
true) || isFired_quick(
"fffv",
true);
1078 bool random_fired = isFired_quick(
"bg",
true) || isFired_quick(
"poissonv",
true);
1079 bool ffz_fired = isFired_quick(
"ffz",
true);
1080 bool fzo_fired = isFired_quick(
"fzo",
true) || isFired_quick(
"fzb",
true);
1081 bool monitor_fired = isFired_quick(
"fff",
true) || isFired_quick(
"ffo",
true) || isFired_quick(
"ffb",
true)
1082 || isFired_quick(
"fffo",
true) || isFired_quick(
"ffs",
true) || isFired_quick(
"fss",
true) || isFired_quick(
"sss",
true)
1083 || isFired_quick(
"ff",
true) || isFired_quick(
"ss",
true) || isFired_quick(
"fso",
true)
1084 || isFired_quick(
"sso",
true) || isFired_quick(
"fsb",
true) || isFired_quick(
"ff30",
true)
1085 || isFired_quick(
"lume",
true) || isFired_quick(
"c2",
true) || isFired_quick(
"c3",
true)
1086 || isFired_quick(
"bha3d",
true) || isFired_quick(
"bhabha",
true)
1087 || isFired_quick(
"lml3",
true) || isFired_quick(
"lml5",
true)
1088 || isFired_quick(
"g_high",
true) || isFired_quick(
"g_c1",
true) || isFired_quick(
"gg",
true)
1089 || isFired_quick(
"eklmhit",
true) || isFired_quick(
"fioiecl1",
true) || isFired_quick(
"ioiecl1",
true)
1090 || isFired_quick(
"cdcecl1",
true) || isFired_quick(
"cdcecl2",
true) || isFired_quick(
"cdcecl3",
true)
1091 || isFired_quick(
"cdcecl4",
true) || isFired_quick(
"c2gev1",
true) || isFired_quick(
"c2gev2",
true)
1092 || isFired_quick(
"c2hie",
true) || isFired_quick(
"f",
true) || isFired_quick(
"s",
true)
1093 || isFired_quick(
"revolution",
true) || isFired_quick(
"random",
true);
1095 bool B_CDC_fired = ffy_fired || fyo_fired;
1096 bool B_ECL_fired = c4_fired || hie_fired;
1097 bool LOW_KLM_fired = klm_fired || klm_match_fired;
1098 bool LOW_CDC_fired = stt_fired || short_fired || ff30_fired || inner_fired;
1099 bool LOW_ECL_fired = lml_fired;
1100 bool CALIB_fired = gg_fired || bhabha_fired || pid_fired || bhamon_fired || eclmumu_fired || lml1_fired || lml4_fired || veto_fired
1102 bool MONITOR_fired = monitor_fired || ffz_fired || fzo_fired;
1106 h_psn_effect_to_l1[
skim[ifill]]->Fill(0.5);
1110 h_psn_effect_to_l1[
skim[ifill]]->Fill(1.5);
1111 }
else if (B_ECL_fired) {
1112 h_psn_effect_to_l1[
skim[ifill]]->Fill(2.5);
1113 }
else if (LOW_KLM_fired) {
1114 h_psn_effect_to_l1[
skim[ifill]]->Fill(3.5);
1115 }
else if (LOW_CDC_fired) {
1116 h_psn_effect_to_l1[
skim[ifill]]->Fill(4.5);
1117 }
else if (LOW_ECL_fired) {
1118 h_psn_effect_to_l1[
skim[ifill]]->Fill(5.5);
1119 }
else if (CALIB_fired) {
1120 h_psn_effect_to_l1[
skim[ifill]]->Fill(6.5);
1121 }
else if (MONITOR_fired) {
1122 h_psn_effect_to_l1[
skim[ifill]]->Fill(7.5);
1124 h_psn_effect_to_l1[
skim[ifill]]->Fill(8.5);
1128 h_psn_effect_to_l1[
skim[ifill]]->Fill(9.5);
1129 }
else if (fyo_fired) {
1130 h_psn_effect_to_l1[
skim[ifill]]->Fill(10.5);
1131 }
else if (c4_fired) {
1132 h_psn_effect_to_l1[
skim[ifill]]->Fill(11.5);
1133 }
else if (hie_fired) {
1134 h_psn_effect_to_l1[
skim[ifill]]->Fill(12.5);
1135 }
else if (klm_fired) {
1136 h_psn_effect_to_l1[
skim[ifill]]->Fill(13.5);
1137 }
else if (klm_match_fired) {
1138 h_psn_effect_to_l1[
skim[ifill]]->Fill(14.5);
1139 }
else if (stt_fired) {
1140 h_psn_effect_to_l1[
skim[ifill]]->Fill(15.5);
1141 }
else if (short_fired) {
1142 h_psn_effect_to_l1[
skim[ifill]]->Fill(16.5);
1143 }
else if (ff30_fired) {
1144 h_psn_effect_to_l1[
skim[ifill]]->Fill(17.5);
1145 }
else if (inner_fired) {
1146 h_psn_effect_to_l1[
skim[ifill]]->Fill(18.5);
1147 }
else if (lml_fired) {
1148 h_psn_effect_to_l1[
skim[ifill]]->Fill(19.5);
1149 }
else if (gg_fired) {
1150 h_psn_effect_to_l1[
skim[ifill]]->Fill(20.5);
1151 }
else if (bhabha_fired) {
1152 h_psn_effect_to_l1[
skim[ifill]]->Fill(21.5);
1153 }
else if (pid_fired) {
1154 h_psn_effect_to_l1[
skim[ifill]]->Fill(22.5);
1155 }
else if (bhamon_fired) {
1156 h_psn_effect_to_l1[
skim[ifill]]->Fill(23.5);
1157 }
else if (eclmumu_fired) {
1158 h_psn_effect_to_l1[
skim[ifill]]->Fill(24.5);
1159 }
else if (lml1_fired) {
1160 h_psn_effect_to_l1[
skim[ifill]]->Fill(25.5);
1161 }
else if (lml4_fired) {
1162 h_psn_effect_to_l1[
skim[ifill]]->Fill(26.5);
1163 }
else if (veto_fired) {
1164 h_psn_effect_to_l1[
skim[ifill]]->Fill(27.5);
1165 }
else if (random_fired) {
1166 h_psn_effect_to_l1[
skim[ifill]]->Fill(28.5);
1167 }
else if (ffz_fired) {
1168 h_psn_effect_to_l1[
skim[ifill]]->Fill(29.5);
1169 }
else if (fzo_fired) {
1170 h_psn_effect_to_l1[
skim[ifill]]->Fill(30.5);
1171 }
else if (monitor_fired) {
1172 h_psn_effect_to_l1[
skim[ifill]]->Fill(31.5);
1174 h_psn_effect_to_l1[
skim[ifill]]->Fill(32.5);
1179 h_psn_raw_rate[
skim[ifill]]->Fill(0.5);
1183 h_psn_raw_rate[
skim[ifill]]->Fill(1.5);
1184 }
if (B_ECL_fired) {
1185 h_psn_raw_rate[
skim[ifill]]->Fill(2.5);
1186 }
if (LOW_KLM_fired) {
1187 h_psn_raw_rate[
skim[ifill]]->Fill(3.5);
1188 }
if (LOW_CDC_fired) {
1189 h_psn_raw_rate[
skim[ifill]]->Fill(4.5);
1190 }
if (LOW_ECL_fired) {
1191 h_psn_raw_rate[
skim[ifill]]->Fill(5.5);
1192 }
if (CALIB_fired) {
1193 h_psn_raw_rate[
skim[ifill]]->Fill(6.5);
1194 }
if (MONITOR_fired) {
1195 h_psn_raw_rate[
skim[ifill]]->Fill(7.5);
1199 h_psn_raw_rate[
skim[ifill]]->Fill(9.5);
1201 h_psn_raw_rate[
skim[ifill]]->Fill(10.5);
1203 h_psn_raw_rate[
skim[ifill]]->Fill(11.5);
1205 h_psn_raw_rate[
skim[ifill]]->Fill(12.5);
1207 h_psn_raw_rate[
skim[ifill]]->Fill(13.5);
1208 }
if (klm_match_fired) {
1209 h_psn_raw_rate[
skim[ifill]]->Fill(14.5);
1211 h_psn_raw_rate[
skim[ifill]]->Fill(15.5);
1212 }
if (short_fired) {
1213 h_psn_raw_rate[
skim[ifill]]->Fill(16.5);
1215 h_psn_raw_rate[
skim[ifill]]->Fill(17.5);
1216 }
if (inner_fired) {
1217 h_psn_raw_rate[
skim[ifill]]->Fill(18.5);
1219 h_psn_raw_rate[
skim[ifill]]->Fill(19.5);
1221 h_psn_raw_rate[
skim[ifill]]->Fill(20.5);
1222 }
if (bhabha_fired) {
1223 h_psn_raw_rate[
skim[ifill]]->Fill(21.5);
1225 h_psn_raw_rate[
skim[ifill]]->Fill(22.5);
1226 }
if (bhamon_fired) {
1227 h_psn_raw_rate[
skim[ifill]]->Fill(23.5);
1228 }
if (eclmumu_fired) {
1229 h_psn_raw_rate[
skim[ifill]]->Fill(24.5);
1231 h_psn_raw_rate[
skim[ifill]]->Fill(25.5);
1233 h_psn_raw_rate[
skim[ifill]]->Fill(26.5);
1235 h_psn_raw_rate[
skim[ifill]]->Fill(27.5);
1236 }
if (random_fired) {
1237 h_psn_raw_rate[
skim[ifill]]->Fill(28.5);
1239 h_psn_raw_rate[
skim[ifill]]->Fill(29.5);
1241 h_psn_raw_rate[
skim[ifill]]->Fill(30.5);
1242 }
if (monitor_fired) {
1243 h_psn_raw_rate[
skim[ifill]]->Fill(31.5);
1250 TRGGDLDQMModule::fillOutputExtra(
void)
1252 for (
unsigned ifill = 0; ifill <
skim.size(); ifill++) {
1253 bool c4_fired = isFired_quick(
"c4");
1254 bool hie_fired = isFired_quick(
"hie");
1255 bool LML_fired = (isFired_quick(
"lml0",
true) || isFired_quick(
"lml1",
true) || isFired_quick(
"lml2",
true)
1256 || isFired_quick(
"lml3",
true) || isFired_quick(
"lml4",
true) || isFired_quick(
"lml5",
true)
1257 || isFired_quick(
"lml6",
true) || isFired_quick(
"lml7",
true) || isFired_quick(
"lml8",
true)
1258 || isFired_quick(
"lml9",
true) || isFired_quick(
"lml10",
true) || isFired_quick(
"eclmumu",
true));
1259 bool CDC_fired = (isFired_quick(
"fff",
true) || isFired_quick(
"ffo",
true) || isFired_quick(
"ffb",
true)
1260 || isFired_quick(
"ffy",
true) || isFired_quick(
"fyo",
true) || isFired_quick(
"fyb",
true));
1261 bool ECL_fired = (isFired_quick(
"c4",
true) || isFired_quick(
"hie",
true));
1262 bool fff_fired = isFired_quick(
"fff");
1263 bool ff_fired = isFired_quick(
"ff");
1264 bool f_fired = isFired_quick(
"f");
1265 bool ffo_fired = isFired_quick(
"ffo");
1266 bool ffb_fired = isFired_quick(
"ffb");
1267 bool ffy_fired = isFired_quick(
"ffy");
1268 bool fyo_fired = isFired_quick(
"fyo");
1269 bool fyb_fired = isFired_quick(
"fyb");
1270 bool bha2D_fired = isFired_quick(
"bhabha");
1271 bool bha3D_fired = isFired_quick(
"bha3d");
1272 bool lml0_fired = isFired_quick(
"lml0");
1273 bool lml1_fired = isFired_quick(
"lml1");
1274 bool lml2_fired = isFired_quick(
"lml2");
1275 bool lml3_fired = isFired_quick(
"lml3");
1276 bool lml4_fired = isFired_quick(
"lml4");
1277 bool lml5_fired = isFired_quick(
"lml5");
1278 bool lml6_fired = isFired_quick(
"lml6");
1279 bool lml7_fired = isFired_quick(
"lml7");
1280 bool lml8_fired = isFired_quick(
"lml8");
1281 bool lml9_fired = isFired_quick(
"lml9");
1282 bool lml10_fired = isFired_quick(
"lml10");
1283 bool lml12_fired = isFired_quick(
"lml12");
1284 bool lml13_fired = isFired_quick(
"lml13");
1285 bool eclmumu_fired = isFired_quick(
"eclmumu");
1286 bool mu_b2b_fired = isFired_quick(
"mu_b2b");
1287 bool mu_eb2b_fired = isFired_quick(
"mu_eb2b");
1288 bool cdcklm1_fired = isFired_quick(
"cdcklm1");
1289 bool cdcklm2_fired = isFired_quick(
"cdcklm2");
1290 bool klm_hit_fired = isFired_quick(
"klm_hit");
1291 bool eklm_hit_fired = isFired_quick(
"eklm_hit");
1292 bool cdcecl1_fired = isFired_quick(
"cdcecl1");
1293 bool cdcecl2_fired = isFired_quick(
"cdcecl2");
1294 bool cdcecl3_fired = isFired_quick(
"cdcecl3");
1295 bool cdcecl4_fired = isFired_quick(
"cdcecl4");
1296 bool fso_fired = isFired_quick(
"fso");
1297 bool fsb_fired = isFired_quick(
"fsb");
1298 bool syo_fired = isFired_quick(
"syo");
1299 bool syb_fired = isFired_quick(
"syb");
1300 bool x_fired = isFired_quick(
"x");
1301 bool fioiecl1_fired = isFired_quick(
"fioiecl1");
1302 bool ecleklm1_fired = isFired_quick(
"ecleklm1");
1303 bool seklm1_fired = isFired_quick(
"seklm1");
1304 bool seklm2_fired = isFired_quick(
"seklm2");
1305 bool ieklm_fired = isFired_quick(
"ieklm");
1306 bool iecl_fired = isFired_quick(
"iecl");
1307 bool yioiecl1_fired = isFired_quick(
"yioiecl1");
1308 bool stt_fired = isFired_quick(
"stt");
1309 bool ffz_fired = isFired_quick(
"ffz");
1310 bool fzo_fired = isFired_quick(
"fzo");
1311 bool fzb_fired = isFired_quick(
"fzb");
1314 h_psn_extra[
skim[ifill]]->Fill(0.5);
1316 if (fff_fired && (ECL_fired)) {
1317 h_psn_extra[
skim[ifill]]->Fill(1.5);
1319 if (ffo_fired && (ECL_fired)) {
1320 h_psn_extra[
skim[ifill]]->Fill(2.5);
1322 if (ffb_fired && (ECL_fired)) {
1323 h_psn_extra[
skim[ifill]]->Fill(3.5);
1326 h_psn_extra[
skim[ifill]]->Fill(4.5);
1329 h_psn_extra[
skim[ifill]]->Fill(5.5);
1332 h_psn_extra[
skim[ifill]]->Fill(6.5);
1334 if ((CDC_fired) && (ECL_fired)) {
1335 h_psn_extra[
skim[ifill]]->Fill(7.5);
1338 h_psn_extra[
skim[ifill]]->Fill(8.5);
1341 h_psn_extra[
skim[ifill]]->Fill(9.5);
1344 h_psn_extra[
skim[ifill]]->Fill(10.5);
1346 if (ff_fired && (LML_fired)) {
1347 h_psn_extra[
skim[ifill]]->Fill(11.5);
1350 h_psn_extra[
skim[ifill]]->Fill(12.5);
1352 if (f_fired && (LML_fired)) {
1353 h_psn_extra[
skim[ifill]]->Fill(13.5);
1356 h_psn_extra[
skim[ifill]]->Fill(14.5);
1358 if (fff_fired && (LML_fired)) {
1359 h_psn_extra[
skim[ifill]]->Fill(15.5);
1361 if (ffo_fired && (LML_fired)) {
1362 h_psn_extra[
skim[ifill]]->Fill(16.5);
1364 if (ffb_fired && (LML_fired)) {
1365 h_psn_extra[
skim[ifill]]->Fill(17.5);
1368 h_psn_extra[
skim[ifill]]->Fill(18.5);
1370 if (ffy_fired && (ECL_fired)) {
1371 h_psn_extra[
skim[ifill]]->Fill(19.5);
1373 if (fyo_fired && (ECL_fired)) {
1374 h_psn_extra[
skim[ifill]]->Fill(20.5);
1376 if (fyb_fired && (ECL_fired)) {
1377 h_psn_extra[
skim[ifill]]->Fill(21.5);
1379 if ((ffy_fired || fyo_fired || fyb_fired) && (ECL_fired)) {
1380 h_psn_extra[
skim[ifill]]->Fill(22.5);
1382 if (ffy_fired && (LML_fired)) {
1383 h_psn_extra[
skim[ifill]]->Fill(23.5);
1385 if (fyo_fired && (LML_fired)) {
1386 h_psn_extra[
skim[ifill]]->Fill(24.5);
1388 if (fyb_fired && (LML_fired)) {
1389 h_psn_extra[
skim[ifill]]->Fill(25.5);
1391 if (c4_fired && (CDC_fired)) {
1392 h_psn_extra[
skim[ifill]]->Fill(26.5);
1394 if (hie_fired && (CDC_fired)) {
1395 h_psn_extra[
skim[ifill]]->Fill(27.5);
1397 if (lml0_fired && (CDC_fired)) {
1398 h_psn_extra[
skim[ifill]]->Fill(28.5);
1400 if (lml1_fired && (CDC_fired)) {
1401 h_psn_extra[
skim[ifill]]->Fill(29.5);
1403 if (lml2_fired && (CDC_fired)) {
1404 h_psn_extra[
skim[ifill]]->Fill(30.5);
1406 if (lml3_fired && (CDC_fired)) {
1407 h_psn_extra[
skim[ifill]]->Fill(31.5);
1409 if (lml4_fired && (CDC_fired)) {
1410 h_psn_extra[
skim[ifill]]->Fill(32.5);
1412 if (lml5_fired && (CDC_fired)) {
1413 h_psn_extra[
skim[ifill]]->Fill(33.5);
1415 if (lml6_fired && (CDC_fired)) {
1416 h_psn_extra[
skim[ifill]]->Fill(34.5);
1418 if (lml7_fired && (CDC_fired)) {
1419 h_psn_extra[
skim[ifill]]->Fill(35.5);
1421 if (lml8_fired && (CDC_fired)) {
1422 h_psn_extra[
skim[ifill]]->Fill(36.5);
1424 if (lml9_fired && (CDC_fired)) {
1425 h_psn_extra[
skim[ifill]]->Fill(37.5);
1427 if (lml10_fired && (CDC_fired)) {
1428 h_psn_extra[
skim[ifill]]->Fill(38.5);
1430 if (lml12_fired && (CDC_fired)) {
1431 h_psn_extra[
skim[ifill]]->Fill(39.5);
1433 if (lml13_fired && (CDC_fired)) {
1434 h_psn_extra[
skim[ifill]]->Fill(40.5);
1436 if (eclmumu_fired && (CDC_fired)) {
1437 h_psn_extra[
skim[ifill]]->Fill(41.5);
1439 if (mu_b2b_fired && (CDC_fired)) {
1440 h_psn_extra[
skim[ifill]]->Fill(42.5);
1442 if (mu_eb2b_fired && (CDC_fired)) {
1443 h_psn_extra[
skim[ifill]]->Fill(43.5);
1445 if (cdcklm1_fired && (CDC_fired)) {
1446 h_psn_extra[
skim[ifill]]->Fill(44.5);
1448 if (cdcklm2_fired && (CDC_fired)) {
1449 h_psn_extra[
skim[ifill]]->Fill(45.5);
1451 if (klm_hit_fired && (CDC_fired)) {
1452 h_psn_extra[
skim[ifill]]->Fill(46.5);
1454 if (eklm_hit_fired && (CDC_fired)) {
1455 h_psn_extra[
skim[ifill]]->Fill(47.5);
1457 if (mu_b2b_fired && LML_fired) {
1458 h_psn_extra[
skim[ifill]]->Fill(48.5);
1460 if (mu_eb2b_fired && LML_fired) {
1461 h_psn_extra[
skim[ifill]]->Fill(49.5);
1463 if (cdcklm1_fired && LML_fired) {
1464 h_psn_extra[
skim[ifill]]->Fill(50.5);
1466 if (cdcklm2_fired && LML_fired) {
1467 h_psn_extra[
skim[ifill]]->Fill(51.5);
1469 if (klm_hit_fired && LML_fired) {
1470 h_psn_extra[
skim[ifill]]->Fill(52.5);
1472 if (eklm_hit_fired && LML_fired) {
1473 h_psn_extra[
skim[ifill]]->Fill(53.5);
1475 if (cdcecl1_fired && (CDC_fired)) {
1476 h_psn_extra[
skim[ifill]]->Fill(54.5);
1478 if (cdcecl2_fired && (CDC_fired)) {
1479 h_psn_extra[
skim[ifill]]->Fill(55.5);
1481 if (cdcecl3_fired && (CDC_fired)) {
1482 h_psn_extra[
skim[ifill]]->Fill(56.5);
1484 if (cdcecl4_fired && (CDC_fired)) {
1485 h_psn_extra[
skim[ifill]]->Fill(57.5);
1487 if (cdcecl1_fired && LML_fired) {
1488 h_psn_extra[
skim[ifill]]->Fill(58.5);
1490 if (cdcecl2_fired && LML_fired) {
1491 h_psn_extra[
skim[ifill]]->Fill(59.5);
1493 if (cdcecl3_fired && LML_fired) {
1494 h_psn_extra[
skim[ifill]]->Fill(60.5);
1496 if (cdcecl4_fired && LML_fired) {
1497 h_psn_extra[
skim[ifill]]->Fill(61.5);
1499 if (fso_fired && LML_fired) {
1500 h_psn_extra[
skim[ifill]]->Fill(62.5);
1502 if (fsb_fired && LML_fired) {
1503 h_psn_extra[
skim[ifill]]->Fill(63.5);
1505 if (syo_fired && LML_fired) {
1506 h_psn_extra[
skim[ifill]]->Fill(64.5);
1508 if (syb_fired && LML_fired) {
1509 h_psn_extra[
skim[ifill]]->Fill(65.5);
1511 if (x_fired && LML_fired) {
1512 h_psn_extra[
skim[ifill]]->Fill(66.5);
1514 if (fioiecl1_fired && LML_fired) {
1515 h_psn_extra[
skim[ifill]]->Fill(67.5);
1517 if (ecleklm1_fired && LML_fired) {
1518 h_psn_extra[
skim[ifill]]->Fill(68.5);
1520 if (seklm1_fired && LML_fired) {
1521 h_psn_extra[
skim[ifill]]->Fill(69.5);
1523 if (seklm2_fired && LML_fired) {
1524 h_psn_extra[
skim[ifill]]->Fill(70.5);
1526 if (ieklm_fired && LML_fired) {
1527 h_psn_extra[
skim[ifill]]->Fill(71.5);
1529 if (iecl_fired && LML_fired) {
1530 h_psn_extra[
skim[ifill]]->Fill(72.5);
1532 if (ecleklm1_fired && CDC_fired) {
1533 h_psn_extra[
skim[ifill]]->Fill(73.5);
1535 if (syo_fired && ECL_fired) {
1536 h_psn_extra[
skim[ifill]]->Fill(74.5);
1538 if (yioiecl1_fired && ECL_fired) {
1539 h_psn_extra[
skim[ifill]]->Fill(75.5);
1541 if (stt_fired && ECL_fired) {
1542 h_psn_extra[
skim[ifill]]->Fill(76.5);
1544 if (ffz_fired && (ECL_fired)) {
1545 h_psn_extra[
skim[ifill]]->Fill(77.5);
1547 if (fzo_fired && (ECL_fired)) {
1548 h_psn_extra[
skim[ifill]]->Fill(78.5);
1550 if (fzb_fired && (ECL_fired)) {
1551 h_psn_extra[
skim[ifill]]->Fill(79.5);
1553 if (ffy_fired && ffz_fired && (ECL_fired)) {
1554 h_psn_extra[
skim[ifill]]->Fill(80.5);
1556 if (fyo_fired && fzo_fired && (ECL_fired)) {
1557 h_psn_extra[
skim[ifill]]->Fill(81.5);
1559 if (fyb_fired && fzb_fired && (ECL_fired)) {
1560 h_psn_extra[
skim[ifill]]->Fill(82.5);
1562 if ((ffy_fired || ffz_fired) && (ECL_fired)) {
1563 h_psn_extra[
skim[ifill]]->Fill(83.5);
1565 if ((fyo_fired || fzo_fired) && (ECL_fired)) {
1566 h_psn_extra[
skim[ifill]]->Fill(84.5);
1568 if ((fyb_fired || fzb_fired) && (ECL_fired)) {
1569 h_psn_extra[
skim[ifill]]->Fill(85.5);
1571 if (ffy_fired && ffz_fired) {
1572 h_psn_extra[
skim[ifill]]->Fill(86.5);
1574 if (fyo_fired && fzo_fired) {
1575 h_psn_extra[
skim[ifill]]->Fill(87.5);
1577 if (fyb_fired && fzb_fired) {
1578 h_psn_extra[
skim[ifill]]->Fill(88.5);
1580 if (ffy_fired || ffz_fired) {
1581 h_psn_extra[
skim[ifill]]->Fill(89.5);
1583 if (fyo_fired || fzo_fired) {
1584 h_psn_extra[
skim[ifill]]->Fill(90.5);
1586 if (fyb_fired || fzb_fired) {
1587 h_psn_extra[
skim[ifill]]->Fill(91.5);
1590 h_psn_extra[
skim[ifill]]->Fill(92.5);
1593 h_psn_extra[
skim[ifill]]->Fill(93.5);
1599 const char* TRGGDLDQMModule::output_extra[n_output_extra] = {
1600 "all",
"fff&(c4|hie)",
"ffo&(c4|hie)",
"ffb&(c4|hie)",
"fff",
"c4|hie",
"fff|ffo|ffb",
"(fff|ffo|ffb)&(c4|hie)",
"bha2D",
"bha3D",
1601 "ff",
"ff&(lml|eclmumu)",
"f",
"f&(lml|eclmumu)",
"lml|eclmumu",
"fff&(lml|eclmumu)",
"ffo&(lml|eclmumu)",
"ffb&(lml|eclmumu)",
"ffy",
"ffy&(c4|hie)",
1602 "fyo&(c4|hie)",
"fyb&(c4|hie)",
"(ffy|ffo|ffb)&(c4|hie)",
"ffy&(lml|eclmumu)",
"fyo&(lml|eclmumu)",
"fyb&(lml|eclmumu)",
"c4&(fff|ffo|ffb)",
"hie&(fff|ffo|ffb)",
"lml0&(fff|ffo|ffb)",
"lml1&(fff|ffo|ffb)",
1603 "lml2&(fff|ffo|ffb)",
"lml3&(fff|ffo|ffb)",
"lml4&(fff|ffo|ffb)",
"lml5&(fff|ffo|ffb)",
"lml6&(fff|ffo|ffb)",
"lml7&(fff|ffo|ffb)",
"lml8&(fff|ffo|ffb)",
"lml9&(fff|ffo|ffb)",
"lml10&(fff|ffo|ffb)",
"lml12&(fff|ffo|ffb)",
1604 "lml13&(fff|ffo|ffb)",
"eclmumu&(fff|ffo|ffb)",
"mu_b2b&(fff|ffo|ffb)",
"mu_eb2b&(fff|ffo|ffb)",
"cdcklm1&(fff|ffo|ffb)",
"cdcklm2&(fff|ffo|ffb)",
"klm_hit&(fff|ffo|ffb)",
"eklm_hit&(fff|ffo|ffb)",
"mu_b2b&(lml|eclmumu)",
"mu_eb2b&(lml|eclmumu)",
1605 "cdcklm1&(lml|eclmumu)",
"cdcklm2&(lml|eclmumu)",
"klm_hit&(lml|eclmumu)",
"eklm_hit&(lml|eclmumu)",
"cdcecl1&(fff|ffo|ffb)",
"cdcecl2&(fff|ffo|ffb)",
"cdcecl3&(fff|ffo|ffb)",
"cdcecl4&(fff|ffo|ffb)",
"cdcecl1&(lml|eclmumu)",
"cdcecl2&(lml|eclmumu)",
1606 "cdcecl3&(lml|eclmumu)",
"cdcecl4&(lml|eclmumu)",
"fso&(lml|eclmumu)",
"fsb&(lml|eclmumu)",
"syo&(lml|eclmumu)",
"syb&(lml|eclmumu)",
"x&(lml|eclmumu)",
"fioiecl1&(lml|eclmumu)",
"ecleklm1&(lml|eclmumu)",
"seklm1&(lml|eclmumu)",
1607 "seklm2&(lml|eclmumu)",
"ieklm&(lml|eclmumu)",
"iecl&(lml|eclmumu)",
"ecleklm1&(fff|ffo|ffb)",
"syo&(c4|hie)",
"yioiecl1&(c4|hie)",
"stt&(c4|hie)",
"ffz&(c4|hie)",
"fzo&(c4|hie)",
"fzb&(c4|hie)",
1608 "ffy&ffz&(c4|hie)",
"fyo&fzo&(c4|hie)",
"fyb&fzb&(c4|hie)",
"(ffy|ffz)&(c4|hie)",
"(fyo|fzo)&(c4|hie)",
"(fyb|fzb)&(c4|hie)",
"ffy&ffz",
"fyo&fzo",
"fyb&fzb",
"(ffy|ffz)",
1609 "(fyo|fzo)",
"(fyb|fzb)",
"ffo",
"ffb"
1612 const char* TRGGDLDQMModule::output_overlap[n_output_overlap] = {
1613 "all",
"B_CDC",
"B_ECL",
"L_KLM",
"L_CDC",
"L_ECL",
"CALIB",
"MONITOR",
"OTHER",
"B_ffy",
1614 "B_fyo",
"B_c4",
"B_hie",
"L_klm",
"L_klm_match",
"L_stt",
"L_short",
"L_fy30",
"L_inner",
"L_lml",
1615 "CALIB_gg",
"CALIB_bhapur",
"CALIB_pid",
"CALIB_wo_bhaveto",
"CALIB_eclmumu",
"CALIB_lml1",
"CALIB_lml4",
"CALIB_noveto",
"CALIB_random",
"MON_ffz",
1616 "MON_fzo",
"MONITOR_all",
"OTHER_all"
1622 TRGGDLDQMModule::fillOutputPureExtra(
void)
1625 int n_fulltrack = 0;
1627 float phi_list[100];
1628 for (
int itrack = 0; itrack < Tracks.getEntries(); itrack++) {
1630 if (tfr ==
nullptr)
continue;
1632 float z0 = tfr->
getZ0();
1633 float d0 = tfr->
getD0();
1634 float phi = tfr->
getPhi();
1639 if (z0 > -1 && z0 < 1 && d0 > -1 && d0 < 1 && flayer < 8 && llayer > 50
1641 phi_list[n_fulltrack] = phi;
1645 for (
int i = 0; i < n_fulltrack; i++) {
1646 for (
int j = 0; j < n_fulltrack; j++) {
1647 float dphi = phi_list[i] - phi_list[j];
1648 if (dphi < 0) dphi = -dphi;
1649 if (dphi > 3.14) dphi = 2 * 3.14 - dphi;
1650 if (dphi > max_dphi) max_dphi = dphi;
1661 int ecl_timing_threshold_low = -200;
1662 int ecl_timing_threshold_high = 200;
1663 double ecl_xtcid_energy_sum[576] = {0};
1664 double total_energy = 0;
1666 for (
const auto& eclcalhit : m_ECLCalDigitData) {
1669 if (!eclcalhit.isCalibrated()) {
continue;}
1670 if (eclcalhit.isFailedFit()) {
continue;}
1671 if (eclcalhit.isTimeResolutionFailed()) {
continue;}
1674 int ecl_cid = (double) eclcalhit.getCellId();
1677 int ecl_quality = -1;
1678 for (
const auto& eclhit : m_ECLDigitData) {
1679 if (ecl_cid == eclhit.getCellId()) {
1680 ecl_quality = (int) eclhit.getQuality();
1683 if (ecl_quality != 0) {
continue;}
1686 double ecl_xtal_energy = eclcalhit.getEnergy();
1690 int ecl_timing = eclcalhit.getTime();
1691 if (ecl_timing < ecl_timing_threshold_low ||
1692 ecl_timing > ecl_timing_threshold_high) {
continue;}
1698 if (ecl_tcid >= 0 && ecl_tcid < 576 && ecl_thetaid >= 2 && ecl_thetaid <= 15) {
1699 ecl_xtcid_energy_sum[ecl_tcid] = ecl_xtcid_energy_sum[ecl_tcid] + ecl_xtal_energy;
1704 for (
int i = 0; i < 576; i++) {
1705 if (ecl_xtcid_energy_sum[i] > 0.1) {
1706 total_energy += ecl_xtcid_energy_sum[i];
1715 if (n_fulltrack > 2) {
1716 bool fff_fired = isFired_quick(
"fff");
1717 bool ffy_fired = isFired_quick(
"ffy");
1718 bool c4_fired = isFired_quick(
"c4");
1719 bool hie_fired = isFired_quick(
"hie");
1720 if (c4_fired || hie_fired) {
1721 h_psn_pure_extra[0]->Fill(0.5);
1723 if (fff_fired && (c4_fired || hie_fired)) {
1724 h_psn_pure_extra[0]->Fill(1.5);
1726 if (ffy_fired && (c4_fired || hie_fired)) {
1727 h_psn_pure_extra[0]->Fill(2.5);
1731 if (n_fulltrack > 1 && max_dphi > 3.14 / 2.) {
1732 bool ffo_fired = isFired_quick(
"ffo");
1733 bool fyo_fired = isFired_quick(
"fyo");
1734 bool c4_fired = isFired_quick(
"c4");
1735 bool hie_fired = isFired_quick(
"hie");
1736 if (c4_fired || hie_fired) {
1737 h_psn_pure_extra[0]->Fill(3.5);
1739 if (ffo_fired && (c4_fired || hie_fired)) {
1740 h_psn_pure_extra[0]->Fill(4.5);
1742 if (fyo_fired && (c4_fired || hie_fired)) {
1743 h_psn_pure_extra[0]->Fill(5.5);
1747 if (n_fulltrack > 1 && max_dphi > 3.14 * 5 / 6.) {
1748 bool ffb_fired = isFired_quick(
"ffb");
1749 bool fyb_fired = isFired_quick(
"fyb");
1750 bool c4_fired = isFired_quick(
"c4");
1751 bool hie_fired = isFired_quick(
"hie");
1752 if (c4_fired || hie_fired) {
1753 h_psn_pure_extra[0]->Fill(6.5);
1755 if (ffb_fired && (c4_fired || hie_fired)) {
1756 h_psn_pure_extra[0]->Fill(7.5);
1758 if (fyb_fired && (c4_fired || hie_fired)) {
1759 h_psn_pure_extra[0]->Fill(8.5);
1764 if (total_energy > 1) {
1765 bool fff_fired = isFired_quick(
"fff");
1766 bool ffo_fired = isFired_quick(
"ffo");
1767 bool ffb_fired = isFired_quick(
"ffb");
1768 bool hie_fired = isFired_quick(
"hie");
1769 if (fff_fired || ffo_fired || ffb_fired) {
1770 h_psn_pure_extra[0]->Fill(9.5);
1772 if (hie_fired && (fff_fired || ffo_fired || ffb_fired)) {
1773 h_psn_pure_extra[0]->Fill(10.5);
1779 bool fff_fired = isFired_quick(
"fff");
1780 bool ffo_fired = isFired_quick(
"ffo");
1781 bool ffb_fired = isFired_quick(
"ffb");
1782 bool c4_fired = isFired_quick(
"c4");
1783 if (fff_fired || ffo_fired || ffb_fired) {
1784 h_psn_pure_extra[0]->Fill(11.5);
1786 if (c4_fired && (fff_fired || ffo_fired || ffb_fired)) {
1787 h_psn_pure_extra[0]->Fill(12.5);
1793 const char* TRGGDLDQMModule::output_pure_extra[n_output_pure_extra] = {
1794 "c4|hie offline_fff",
"fff&(c4|hie) offline_fff",
"ffy&(c4|hie) offline_fff",
1795 "c4|hie offline_ffo",
"ffo&(c4|hie) offline_ffo",
"fyo&(c4|hie) offline_ffo",
1796 "c4|hie offline_ffb",
"ffb&(c4|hie) offline_ffb",
"fyb&(c4|hie) offline_ffb",
1797 "fff|ffb|ffo offline_hie",
"hie&(fff|ffb|ffo) offline_hie",
1798 "fff|ffb|ffo offline_c4",
"c4&(fff|ffb|ffo) offline_c4"