Belle II Software  release-05-02-19
TRGGDLDQMModule.cc
1 //---------------------------------------------------------------
2 // $Id$
3 //---------------------------------------------------------------
4 // Filename : TRGGDLModule.cc
5 // Section : TRG GDL
6 // Owner :
7 // Email :
8 //---------------------------------------------------------------
9 // Description : A trigger module for TRG GDL
10 //---------------------------------------------------------------
11 // 1.00 : 2017/05/08 : First version
12 //---------------------------------------------------------------
13 #include <trg/gdl/modules/trggdlDQM/TRGGDLDQMModule.h>
14 #include <trg/gdl/modules/trggdlUnpacker/trggdlUnpackerModule.h>
15 
16 #include <framework/datastore/StoreObjPtr.h>
17 #include <framework/datastore/StoreArray.h>
18 
19 #include <TDirectory.h>
20 #include <TPostScript.h>
21 #include <TCanvas.h>
22 #include <TStyle.h>
23 #include <iostream>
24 #include <fstream>
25 #include <framework/logging/Logger.h>
26 #include <boost/algorithm/string.hpp>
27 
28 using namespace std;
29 using namespace Belle2;
30 using namespace GDL;
31 
32 REG_MODULE(TRGGDLDQM);
33 
34 /*
35  Fired data in TrgBit not available because
36  of absence of TRGSummary class.
37  TrgBit class only for bit configuration.
38 */
39 
40 
41 TRGGDLDQMModule::TRGGDLDQMModule() : HistoModule()
42 {
43 
44  setDescription("DQM for GDL Trigger system");
46 
47  addParam("eventByEventTimingHistRecord", m_eventByEventTimingHistRecord,
48  "Recording event by event timing distribution histogram or not",
49  false);
50  addParam("dumpVcdFile", m_dumpVcdFile,
51  "Dumping vcd file or not",
52  false);
53  addParam("bitConditionToDumpVcd", m_bitConditionToDumpVcd,
54  "Condition for vcd. alg format with '!' and '+'.",
55  string(""));
56  addParam("vcdEventStart", m_vcdEventStart,
57  "Start equential event number",
58  unsigned(0));
59  addParam("vcdNumberOfEvents", m_vcdNumberOfEvents,
60  "Number of events to dump vcd file",
61  unsigned(10));
62  addParam("bitNameOnBinLabel", m_bitNameOnBinLabel,
63  "Put bitname on BinLabel",
64  true);
65  addParam("generatePostscript", m_generatePostscript,
66  "Genarete postscript file or not",
67  false);
68  addParam("postScriptName", m_postScriptName,
69  "postscript file name",
70  string("gdldqm.ps"));
71  addParam("skim", m_skim,
72  "use skim information or not",
73  int(-1));
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);
79 
80 
81 }
82 
84 {
85  oldDir = gDirectory;
86  dirDQM = gDirectory;
87  if (!oldDir->Get("TRGGDL"))oldDir->mkdir("TRGGDL");
88  dirDQM->cd("TRGGDL");
89 
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,
92  100);
93  h_c8_gdlL1TocomL1[iskim]->GetXaxis()->SetTitle("clk8ns");
94 
95  h_c8_topTogdlL1[iskim] = new TH1I(Form("hGDL_topTogdlL1_%s", skim_smap[iskim].c_str()), "gdlL1 - top_timing [clk8ns]", 700, 0,
96  700);
97  h_c8_topTogdlL1[iskim]->GetXaxis()->SetTitle("clk8ns");
98  h_c8_eclTogdlL1[iskim] = new TH1I(Form("hGDL_eclTogdlL1_%s", skim_smap[iskim].c_str()), "gdlL1 - ecl_timing [clk8ns]", 500, 0,
99  500);
100  h_c8_eclTogdlL1[iskim]->GetXaxis()->SetTitle("clk8ns");
101  h_c8_cdcTogdlL1[iskim] = new TH1I(Form("hGDL_cdcTogdlL1_%s", skim_smap[iskim].c_str()), "gdlL1 - cdc_timing [clk8ns]", 700, 0,
102  700);
103  h_c8_cdcTogdlL1[iskim]->GetXaxis()->SetTitle("clk8ns");
104 
105  h_c8_ecl8mToGDL[iskim] = new TH1I(Form("hGDL_ecl8mToGDL_%s", skim_smap[iskim].c_str()), "gdlIn^{8MHz} - ecl_timing [clk8ns]",
106  500, 0, 500);
107  h_c8_ecl8mToGDL[iskim]->GetXaxis()->SetTitle("clk8ns");
108  h_c8_topToGDL[iskim] = new TH1I(Form("hGDL_topToGDL_%s", skim_smap[iskim].c_str()), "gdlIn - top_timing [clk8ns]", 700, 0,
109  700);
110  h_c8_topToGDL[iskim]->GetXaxis()->SetTitle("clk8ns");
111  h_c8_eclToGDL[iskim] = new TH1I(Form("hGDL_eclToGDL_%s", skim_smap[iskim].c_str()), "gdlIn - ecl_timing [clk8ns]", 500, 0,
112  500);
113  h_c8_eclToGDL[iskim]->GetXaxis()->SetTitle("clk8ns");
114  h_c8_cdcToGDL[iskim] = new TH1I(Form("hGDL_cdcToGDL_%s", skim_smap[iskim].c_str()), "gdlIn - cdc_timing [clk8ns]", 700, 0,
115  700);
116  h_c8_cdcToGDL[iskim]->GetXaxis()->SetTitle("clk8ns");
117 
118  h_c2_cdcTocomL1[iskim] = new TH1I(Form("hGDL_cdcTocomL1_%s", skim_smap[iskim].c_str()), "comL1 - cdc_timing [clk2ns]", 520, 0,
119  5200);
120  h_c2_cdcTocomL1[iskim]->GetXaxis()->SetTitle("clk2ns");
121  h_ns_cdcTocomL1[iskim] = new TH1D(Form("hGDL_ns_cdcTocomL1_%s", skim_smap[iskim].c_str()), "comL1 - cdc_timing [ns]", 2600, 0,
122  10400);
123  h_ns_cdcTocomL1[iskim]->GetXaxis()->SetTitle("ns");
124  h_ns_cdcTocomL1[iskim]->GetYaxis()->SetTitle("evt / 4ns");
125  h_ns_cdcTogdlL1[iskim] = new TH1D(Form("hGDL_ns_cdcTogdlL1_%s", skim_smap[iskim].c_str()), "gdlL1 - cdc_timing [ns]", 2600, 0,
126  10400);
127  h_ns_cdcTogdlL1[iskim]->GetXaxis()->SetTitle("ns");
128  h_ns_cdcTogdlL1[iskim]->GetYaxis()->SetTitle("evt / 4ns");
129 
130  h_ns_topToecl[iskim] = new TH1D(Form("hGDL_ns_topToecl_%s", skim_smap[iskim].c_str()), "ecl_timing - top_timing [ns]", 800, 0,
131  4000);
132  h_ns_topToecl[iskim]->GetXaxis()->SetTitle("ns");
133  h_ns_topToecl[iskim]->GetYaxis()->SetTitle("evt / 5ns");
134  h_ns_topTocdc[iskim] = new TH1D(Form("hGDL_ns_topTocdc_%s", skim_smap[iskim].c_str()), "cdc_timing - top_timing [ns]", 800, 0,
135  4000);
136  h_ns_topTocdc[iskim]->GetXaxis()->SetTitle("ns");
137  h_ns_topTocdc[iskim]->GetYaxis()->SetTitle("evt / 5ns");
138  h_ns_cdcToecl[iskim] = new TH1D(Form("hGDL_ns_cdcToecl_%s", skim_smap[iskim].c_str()), "ecl_timing - cdc_timing [ns]", 2000, 0,
139  4000);
140  h_ns_cdcToecl[iskim]->GetXaxis()->SetTitle("ns");
141  h_ns_cdcToecl[iskim]->GetYaxis()->SetTitle("evt / 2ns");
142 
143  h_c2_cdcToecl[iskim] = new TH1I(Form("hGDL_cdcToecl_%s", skim_smap[iskim].c_str()), "ecl_timing - cdc_timing [clk2ns]", 1000, 0,
144  2000);
145  h_c2_cdcToecl[iskim]->GetXaxis()->SetTitle("clk2ns");
146 
147  h_timtype[iskim] = new TH1I(Form("hGDL_timtype_%s", skim_smap[iskim].c_str()), "timtype", 7, 0, 7);
148 
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);
152  // output extra
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]);
156  }
157  // output overlap
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",
159  n_output_overlap, 0,
160  n_output_overlap);
161  for (int i = 0; i < n_output_overlap; i++) {
162  h_psn_effect_to_l1[iskim]->GetXaxis()->SetBinLabel(i + 1, output_overlap[i]);
163  }
164  // output no overlap
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,
166  n_output_overlap);
167  for (int i = 0; i < n_output_overlap; i++) {
168  h_psn_raw_rate[iskim]->GetXaxis()->SetBinLabel(i + 1, output_overlap[i]);
169  }
170  // output pure extra
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]);
175  }
176 
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]);
183  }
184  }
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]);
189  }
190  }
191 
192  //reduce #plot
193  if (iskim != 0)continue;
194 
195  // rise/fall
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);
203  }
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);
217  }
218  }
219 
220  oldDir->cd();
221 }
222 
224 {
225 
226  dirDQM->cd();
227 
228  for (int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
229  h_c8_gdlL1TocomL1[iskim]->Reset();
230  h_c8_topTogdlL1[iskim]->Reset();
231  h_c8_eclTogdlL1[iskim]->Reset();
232  h_c8_cdcTogdlL1[iskim]->Reset();
233  h_c8_ecl8mToGDL[iskim]->Reset();
234  h_c8_topToGDL[iskim]->Reset();
235  h_c8_eclToGDL[iskim]->Reset();
236  h_c8_cdcToGDL[iskim]->Reset();
237  h_c2_cdcTocomL1[iskim]->Reset();
238  h_ns_cdcTocomL1[iskim]->Reset();
239  h_ns_cdcTogdlL1[iskim]->Reset();
240  h_ns_topToecl[iskim]->Reset();
241  h_ns_topTocdc[iskim]->Reset();
242  h_c2_cdcToecl[iskim]->Reset();
243  h_ns_cdcToecl[iskim]->Reset();
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();
249  h_timtype[iskim]->Reset();
250  h_psn_raw_rate[iskim]->Reset();
251  h_psn_effect_to_l1[iskim]->Reset();
252  }
253 
254  oldDir->cd();
255 }
256 
258 {
259 
260  if (m_skim == 0) { //no skim
261  start_skim_gdldqm = 0;
262  end_skim_gdldqm = 1;
263  } else if (m_skim == 1) { //skim
264  start_skim_gdldqm = 1;
265  end_skim_gdldqm = nskim_gdldqm;
266  } else { //no skim + skim
267  start_skim_gdldqm = 0;
268  end_skim_gdldqm = nskim_gdldqm;
269  }
270 
271  _exp = bevt->getExperiment();
272  _run = bevt->getRun();
273 
274  trgeclmap = new TrgEclMapping();
275 
276  // calls back the defineHisto() function, but the HistoManager module has to be in the path
277  REG_HISTOGRAM
278 
279  for (int i = 0; i < 320; i++) {
280  LeafBitMap[i] = m_unpacker->getLeafMap(i);
281  }
282  for (int i = 0; i < 320; i++) {
283  strcpy(LeafNames[i], m_unpacker->getLeafnames(i));
284  }
285  _e_timtype = 0;
286  _e_gdll1rvc = 0;
287  _e_coml1rvc = 0;
288  _e_toptiming = 0;
289  _e_ecltiming = 0;
290  _e_cdctiming = 0;
291  _e_toprvc = 0;
292  _e_eclrvc = 0;
293  _e_cdcrvc = 0;
294  for (int i = 0; i < 10; i++) {
295  ee_psn[i] = {0};
296  ee_ftd[i] = {0};
297  ee_itd[i] = {0};
298  }
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];
339  }
340 
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));
345  }
346  for (int i = 0; i < 320; i++) {
347  strcpy(outbitname[i], m_dbftdl->getoutbitname(i));
348  }
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();
355 
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);
361  }
362 
363 }
364 
366 {
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);
371  c1.cd();
372 
373  for (int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
374 
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();
378  c1.Update();
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();
382  c1.Update();
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();
386  c1.Update();
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");
395 
396  c1.Update();
397  h_timtype[iskim]->Draw();
398  c1.Update();
399  h_c8_gdlL1TocomL1[iskim]->Draw();
400  c1.Update();
401  h_c8_topTogdlL1[iskim]->Draw();
402  c1.Update();
403  h_c8_eclTogdlL1[iskim]->Draw();
404  c1.Update();
405  h_c8_cdcTogdlL1[iskim]->Draw();
406  c1.Update();
407  h_c8_ecl8mToGDL[iskim]->Draw();
408  c1.Update();
409  h_c8_topToGDL[iskim]->Draw();
410  c1.Update();
411  h_c8_eclToGDL[iskim]->Draw();
412  c1.Update();
413  h_c8_cdcToGDL[iskim]->Draw();
414  c1.Update();
415  h_c2_cdcTocomL1[iskim]->Draw();
416  c1.Update();
417  h_ns_cdcTocomL1[iskim]->Draw();
418  c1.Update();
419  h_ns_cdcTogdlL1[iskim]->Draw();
420  c1.Update();
421  h_ns_topToecl[iskim]->Draw();
422  c1.Update();
423  h_ns_topTocdc[iskim]->Draw();
424  c1.Update();
425  h_c2_cdcToecl[iskim]->Draw();
426  c1.Update();
427  h_ns_cdcToecl[iskim]->Draw();
428  c1.Update();
429 
430  //reduce #plot
431  if (iskim != 0)continue;
432  for (unsigned i = 0; i < n_inbit; i++) {
433 
434  h_itd_rise[i][iskim]->SetTitle(Form("itd%d(%s) rising(red), falling(green)",
435  i, inbitname[i]));
436  h_itd_rise[i][iskim]->Draw();
437  h_itd_fall[i][iskim]->Draw("same");
438  c1.Update();
439  }
440 
441  }
442 
443  ps->Close();
444  }
445 }
446 
448 {
449  /* cppcheck-suppress variableScope */
450  static unsigned nvcd = 0;
451  static bool begin_run = true;
452 
453  skim.clear();
454 
455  if (!entAry || !entAry.getEntries()) {
456  return;
457  }
458 
459  //Get skim type from SoftwareTriggerResult
460  for (int iskim = start_skim_gdldqm; iskim < end_skim_gdldqm; iskim++) {
461  if (iskim == 0) skim.push_back(iskim);
462  }
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++) {
466  if (iskim == 0);
467  else if (skim_map.find(skim_menu[iskim]) != skim_map.end()) {
468  const bool accepted = (result_soft->getResult(skim_menu[iskim]) == SoftwareTriggerCutResult::c_accept);
469  if (accepted) skim.push_back(iskim);
470  }
471  }
472  }
473 
474 
475  //prepare entAry adress
476  int clk_map = 0;
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;
480  }
481 
482  const double clkTo2ns = 1. / .508877;
483  const double clkTo1ns = 0.5 / .508877;
484 
485  dirDQM->cd();
486 
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;
490  }
491  for (unsigned j = 0; j < n_outbit; j++) {
492  h_p_vec[i * n_outbit + j] = 0;
493  }
494  for (unsigned j = 0; j < n_outbit; j++) {
495  h_f_vec[i * n_outbit + j] = 0;
496  }
497  for (unsigned j = 0; j < n_inbit; j++) {
498  h_i_vec[i * n_inbit + j] = 0;
499  }
500  }
501 
502  oldDir->cd();
503 
504  // fill "bit vs clk" for the event
505  for (int ii = 0; ii < entAry.getEntries(); ii++) {
506  std::vector<int*> Bits(n_leafs + n_leafsExtra);
507  //set pointer
508  for (int i = 0; i < 320; i++) {
509  if (LeafBitMap[i] != -1) {
510  Bits[LeafBitMap[i]] = &(entAry[ii]->m_unpacker[i]);
511  }
512  }
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];
515  }
516  }
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;
530 
531  if (begin_run) {
532  B2DEBUG(20, "nconf(" << nconf
533  << "), n_clocks(" << n_clocks
534  << "), n_leafs(" << n_leafs
535  << "), n_leafsExtra(" << n_leafsExtra
536  << ")");
537  begin_run = false;
538  }
539 
540  int psn[10] = {0};
541  int ftd[10] = {0};
542  int itd[10] = {0};
543  int timtype = 0;
544 
545 
546  int gdll1_rvc = h_0_vec[(n_clocks - 1) * (n_leafs + n_leafsExtra) + _e_gdll1rvc];
547 
548  // fill event by event timing histogram and get time integrated bit info
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;
559  }
560  }
561  if (nconf == 0) {
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;
570  }
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;
579  }
580  } else {
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;
590  }
591  }
592  }
593  int timtype_tmp = h_0_vec[(clk - 1) * (n_leafs + n_leafsExtra) + _e_timtype];
594  timtype = (timtype_tmp == 0) ? timtype : timtype_tmp;
595 
596  } // clk
597 
598 
599  // fill rising and falling edges
600  fillRiseFallTimings();
601  // fill Output_extra for efficiency study
602  fillOutputExtra();
603  // fill Output_overlap for trigger rate study
604  fillOutputOverlap();
605 
606  // fill summary histograms
607  for (unsigned ifill = 0; ifill < skim.size(); ifill++) {
608  h_timtype[skim[ifill]]->Fill(timtype);
609  h_itd[skim[ifill]]->Fill(-0.5);
610  h_ftd[skim[ifill]]->Fill(-0.5);
611  h_psn[skim[ifill]]->Fill(-0.5);
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);
615  }
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);
619  }
620  }
621 
622  // fill timestamp values stored in header
623  int gdlL1TocomL1 = gdll1_rvc < coml1rvc ? coml1rvc - gdll1_rvc : (coml1rvc + 1280) - gdll1_rvc;
624  h_c8_gdlL1TocomL1[skim[ifill]]->Fill(gdlL1TocomL1);
625 
626  int topTogdlL1 = gdll1_rvc < c8_top_timing ? (gdll1_rvc + 1280) - c8_top_timing : gdll1_rvc - c8_top_timing;
627  h_c8_topTogdlL1[skim[ifill]]->Fill(topTogdlL1);
628 
629  int eclTogdlL1 = gdll1_rvc < c8_ecl_timing ? (gdll1_rvc + 1280) - c8_ecl_timing : gdll1_rvc - c8_ecl_timing;
630  h_c8_eclTogdlL1[skim[ifill]]->Fill(eclTogdlL1);
631 
632  int cdcTogdlL1 = gdll1_rvc < c8_cdc_timing ? (gdll1_rvc + 1280) - c8_cdc_timing : gdll1_rvc - c8_cdc_timing;
633  h_c8_cdcTogdlL1[skim[ifill]]->Fill(cdcTogdlL1);
634 
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;
637  h_c8_ecl8mToGDL[skim[ifill]]->Fill(fit8mToGDL);
638 
639  int topToGDL = c8_top_timing < toprvc ? toprvc - c8_top_timing : (toprvc + 1280) - c8_top_timing;
640  h_c8_topToGDL[skim[ifill]]->Fill(topToGDL);
641  int eclToGDL = c8_ecl_timing < eclrvc ? eclrvc - c8_ecl_timing : (eclrvc + 1280) - c8_ecl_timing;
642  h_c8_eclToGDL[skim[ifill]]->Fill(eclToGDL);
643  int cdcToGDL = c8_cdc_timing < cdcrvc ? cdcrvc - c8_cdc_timing : (cdcrvc + 1280) - c8_cdc_timing;
644  h_c8_cdcToGDL[skim[ifill]]->Fill(cdcToGDL);
645 
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) ;
651  h_ns_cdcTogdlL1[skim[ifill]]->Fill(c2_diff_cdcTogdlL1 * clkTo2ns);
652 
653  int c2_diff_cdcTocomL1 = c2_comL1 > c2_cdc_timing ?
654  c2_comL1 - c2_cdc_timing :
655  c2_comL1 - c2_cdc_timing + (1280 << 2) ;
656  h_c2_cdcTocomL1[skim[ifill]]->Fill(c2_diff_cdcTocomL1);
657  h_ns_cdcTocomL1[skim[ifill]]->Fill(c2_diff_cdcTocomL1 * clkTo2ns);
658 
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);
662  h_c2_cdcToecl[skim[ifill]]->Fill(c2_diff_cdcToecl);
663  h_ns_cdcToecl[skim[ifill]]->Fill(c2_diff_cdcToecl * clkTo2ns);
664 
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);
668  h_ns_topToecl[skim[ifill]]->Fill(c1_diff_topToecl * clkTo1ns);
669 
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);
673  h_ns_topTocdc[skim[ifill]]->Fill(c2_diff_topTocdc * clkTo2ns);
674  }
675 
676 
677  // vcd dump
678  if (m_dumpVcdFile) {
679  if (anaBitCondition()) {
680  nvcd++;
681  B2DEBUG(20, "anaBitCondition fired, evt(" << evtno << ")");
682  if (m_vcdEventStart <= nvcd && nvcd < m_vcdEventStart + m_vcdNumberOfEvents) {
683  genVcd();
684  }
685  }
686  }
687 
688 }
689 
690 bool TRGGDLDQMModule::anaBitCondition(void)
691 {
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; // init value must be true
696  bool not_flag = false;
697  unsigned begin_word = 0;
698  unsigned word_length = 0;
699  // notation steeing side must follow
700  // no blank between '!' and word
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')) {
706  if (reading_word) { // must not be '!'
707  word_length++;
708  if (i == m_bitConditionToDumpVcd.length() - 1) {
709  bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
710  B2DEBUG(20,
711  m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
712  << "(" << fired << ")");
713  if (((!not_flag && fired) || (not_flag && !fired)) && result_the_term) {
714  return true;
715  }
716  }
717  } else {
718  // start of new word
719  reading_word = true;
720  if ('!' == cst[i]) {
721  begin_word = i + 1;
722  not_flag = true;
723  word_length = 0;
724  } else {
725  begin_word = i;
726  not_flag = false;
727  word_length = 1;
728  if (i == m_bitConditionToDumpVcd.length() - 1) {
729  // one char bit ('f',...) comes end of conditions, 'xxx+f'
730  bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
731  B2DEBUG(20,
732  m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
733  << "(" << fired << ")");
734  if (((!not_flag && fired) || (not_flag && !fired)) && result_the_term) {
735  return true;
736  }
737  }
738  }
739  }
740  } else if ('+' == cst[i] || i == m_bitConditionToDumpVcd.length() - 1) {
741  // End of the term.
742  if (reading_word) { // 'xxx+'
743  if (result_the_term) {
744  bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
745  B2DEBUG(20,
746  m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
747  << "(" << fired << ")");
748  if ((!not_flag && fired) || (not_flag && !fired)) {
749  return true;
750  } else {
751  // this term is denied by the latest bit
752  }
753  } else {
754  // already false.
755  }
756  reading_word = false;
757  } else {
758  // prior char is blank, 'xxx +'
759  if (result_the_term) {
760  return true;
761  } else {
762  // already false
763  }
764  }
765  result_the_term = true; // go to next term
766  } else {
767  // can be blank (white space) or any delimiter.
768  if (reading_word) {
769  // end of a word, 'xxxx '
770  reading_word = false;
771  if (result_the_term) {
772  // worth to try
773  bool fired = isFired(m_bitConditionToDumpVcd.substr(begin_word, word_length));
774  B2DEBUG(20,
775  m_bitConditionToDumpVcd.substr(begin_word, word_length).c_str()
776  << "(" << fired << ")");
777  if ((!not_flag && fired) || (not_flag && !fired)) {
778  // go to next word
779  } else {
780  result_the_term = false;
781  }
782  } else {
783  // already false
784  }
785  reading_word = false;
786  } else {
787  // 2nd blank 'xx ' or leading blanck '^ '
788  }
789  }
790  }
791  return false;
792 }
793 
794 void TRGGDLDQMModule::genVcd(void)
795 {
796  int prev_i[400] = {0};
797  int prev_f[400] = {0};
798  int prev_p[400] = {0};
799  //int prev_g[400]={0}; // Future Plan
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;
812  } else {
813  outf << " 1ns" << endl;
814  }
815  outf << "$end" << endl;
816  outf << "" << endl;
817  outf << "$scope module gdl0067d_icn $end" << endl;
818  int seqnum = 0;
819  for (unsigned j = 0; j < n_inbit; j++) {
820  outf << "$var wire 1 n" << seqnum++ << " " << inbitname[j] << " $end" << endl;
821  }
822  for (unsigned j = 0; j < n_outbit; j++) {
823  outf << "$var wire 1 n" << seqnum++ << " ftd." << outbitname[j] << " $end" << endl;
824  }
825  for (unsigned j = 0; j < n_outbit; j++) {
826  outf << "$var wire 1 n" << seqnum++ << " psn." << outbitname[j] << " $end" << endl;
827  }
828 
829  outf << "$upscope $end" << endl;
830  outf << "$enddefinitions $end" << endl << endl;
831 
832  for (unsigned clk = 1; clk <= n_clocks; clk++) {
833  seqnum = 0;
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;
839  }
840  seqnum++;
841  }
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;
846  }
847  seqnum++;
848  }
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;
853  }
854  seqnum++;
855  }
856  /* Future Plan
857  for(unsigned k=1; k<=n_gdlbits; k++){
858  if(clk == 1 || prev_g[k-1] != hg->GetBinContent(clk, k)){
859  prev_g[k-1] = hg->GetBinContent(clk, k);
860  if(EBitWidth[k-1] != 1){
861  char ans[33];
862  if(k-1 == e_rvc){
863  dec2binstring(hg->GetBinContent(clk, k), ans, true);
864  }else{
865  dec2binstring(hg->GetBinContent(clk, k), ans);
866  }
867  outf << "b" << ans << " n" << seqnum << endl;
868  }else{
869  outf << hg->GetBinContent(clk, k) << "n" << seqnum << endl;
870  }
871  }
872  seqnum++;
873  }
874  */
875  }
876  outf.close();
877 }
878 
879 bool
880 TRGGDLDQMModule::isFired_quick(const std::string& bitname, const bool& isPsnm = 0)
881 {
882  int bn = getoutbitnum(bitname.c_str());
883  for (unsigned clk = 0; clk < n_clocks; clk++) {
884  if (bn > -1) {
885  if (isPsnm) {
886  if (h_p_vec[clk * n_outbit + bn] > 0)
887  return true;
888  } else {
889  if (h_f_vec[clk * n_outbit + bn] > 0)
890  return true;
891  }
892  }
893  }
894  bn = getinbitnum(bitname.c_str());
895  for (unsigned clk = 0; clk < n_clocks; clk++) {
896  if (bn > -1) {
897  if (h_i_vec[clk * n_inbit + bn] > 0)
898  return true;
899  }
900  }
901  return false;
902 }
903 
904 int
905 TRGGDLDQMModule::getinbitnum(const char* c) const
906 {
907  for (int i = 0; i < 320; i++) {
908  if (strcmp(c, inbitname[i]) == 0)return i;
909  }
910  return -1;
911 }
912 
913 int
914 TRGGDLDQMModule::getoutbitnum(const char* c) const
915 {
916  for (int i = 0; i < 320; i++) {
917  if (strcmp(c, outbitname[i]) == 0)return i;
918  }
919  return -1;
920 }
921 
922 
923 bool
924 TRGGDLDQMModule::isFired(std::string bitname)
925 {
926  bool isPsnm = false;
927  for (unsigned i = 0; i < bitname.length(); i++) {
928  if ('A' <= bitname[i] && bitname[i] <= 'Z') {
929  isPsnm = true;
930  }
931  }
932  boost::algorithm::to_lower(bitname);
933  int bn = m_dbftdl->getoutbitnum(bitname.c_str());
934  for (unsigned clk = 0; clk < n_clocks; clk++) {
935  if (bn > -1) {
936  if (isPsnm) {
937  if (h_p_vec[clk * n_outbit + bn] > 0)
938  return true;
939  } else {
940  if (h_f_vec[clk * n_outbit + bn] > 0)
941  return true;
942  }
943  }
944  }
945  bn = m_dbinput->getinbitnum(bitname.c_str());
946  for (unsigned clk = 0; clk < n_clocks; clk++) {
947  if (bn > -1) {
948  if (h_i_vec[clk * n_inbit + bn] > 0)
949  return true;
950  }
951  }
952  return false;
953 }
954 
955 void
956 TRGGDLDQMModule::fillRiseFallTimings(void)
957 {
958 
959 
960  for (unsigned ifill = 0; ifill < skim.size(); ifill++) {
961  //reduce #plot
962  if (skim[ifill] != 0)continue;
963 
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);
970  } else {
971  h_itd_rise[i][skim[ifill]]->GetXaxis()->SetTitle("clk8ns");
972  h_itd_fall[i][skim[ifill]]->GetXaxis()->SetTitle("clk8ns");
973  }
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) {
978  if (! rising_done) {
979  h_itd_rise[i][skim[ifill]]->Fill(clk + 0.5);
980  rising_done = true;
981  } else if (rising_done && !falling_done && clk == n_clocks - 1) {
982  h_itd_fall[i][skim[ifill]]->Fill(clk + 0.5);
983  }
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);
987  falling_done = true;
988  }
989  }
990  }
991  }
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);
1002  } else {
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");
1007  }
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);
1014  rising_done = true;
1015  } else if (rising_done && !falling_done && clk == n_clocks - 1) {
1016  h_ftd_fall[i][skim[ifill]]->Fill(clk + 0.5);
1017  }
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;
1022  }
1023  }
1024  }
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);
1031  rising_done = true;
1032  } else if (rising_done && !falling_done && clk == n_clocks - 1) {
1033  h_psn_fall[i][skim[ifill]]->Fill(clk + 0.5);
1034  }
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;
1039  }
1040  }
1041  }
1042  }
1043  }
1044 }
1045 
1046 
1047 void
1048 TRGGDLDQMModule::fillOutputOverlap(void)
1049 {
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);
1094 
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
1101  || random_fired;
1102  bool MONITOR_fired = monitor_fired || ffz_fired || fzo_fired;
1103 
1104  //all event
1105  if (1) {
1106  h_psn_effect_to_l1[skim[ifill]]->Fill(0.5);
1107  }
1108  //main category
1109  if (B_CDC_fired) {
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);
1123  } else {
1124  h_psn_effect_to_l1[skim[ifill]]->Fill(8.5);
1125  }
1126  //detail category
1127  if (ffy_fired) {
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);
1173  } else {
1174  h_psn_effect_to_l1[skim[ifill]]->Fill(32.5);
1175  }
1176 
1177  //all event
1178  if (1) {
1179  h_psn_raw_rate[skim[ifill]]->Fill(0.5);
1180  }
1181  //main category
1182  if (B_CDC_fired) {
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);
1196  }
1197  //detail category
1198  if (ffy_fired) {
1199  h_psn_raw_rate[skim[ifill]]->Fill(9.5);
1200  } if (fyo_fired) {
1201  h_psn_raw_rate[skim[ifill]]->Fill(10.5);
1202  } if (c4_fired) {
1203  h_psn_raw_rate[skim[ifill]]->Fill(11.5);
1204  } if (hie_fired) {
1205  h_psn_raw_rate[skim[ifill]]->Fill(12.5);
1206  } if (klm_fired) {
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);
1210  } if (stt_fired) {
1211  h_psn_raw_rate[skim[ifill]]->Fill(15.5);
1212  } if (short_fired) {
1213  h_psn_raw_rate[skim[ifill]]->Fill(16.5);
1214  } if (ff30_fired) {
1215  h_psn_raw_rate[skim[ifill]]->Fill(17.5);
1216  } if (inner_fired) {
1217  h_psn_raw_rate[skim[ifill]]->Fill(18.5);
1218  } if (lml_fired) {
1219  h_psn_raw_rate[skim[ifill]]->Fill(19.5);
1220  } if (gg_fired) {
1221  h_psn_raw_rate[skim[ifill]]->Fill(20.5);
1222  } if (bhabha_fired) {
1223  h_psn_raw_rate[skim[ifill]]->Fill(21.5);
1224  } if (pid_fired) {
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);
1230  } if (lml1_fired) {
1231  h_psn_raw_rate[skim[ifill]]->Fill(25.5);
1232  } if (lml4_fired) {
1233  h_psn_raw_rate[skim[ifill]]->Fill(26.5);
1234  } if (veto_fired) {
1235  h_psn_raw_rate[skim[ifill]]->Fill(27.5);
1236  } if (random_fired) {
1237  h_psn_raw_rate[skim[ifill]]->Fill(28.5);
1238  } if (ffz_fired) {
1239  h_psn_raw_rate[skim[ifill]]->Fill(29.5);
1240  } if (fzo_fired) {
1241  h_psn_raw_rate[skim[ifill]]->Fill(30.5);
1242  } if (monitor_fired) {
1243  h_psn_raw_rate[skim[ifill]]->Fill(31.5);
1244  }
1245  }
1246 }
1247 
1248 
1249 void
1250 TRGGDLDQMModule::fillOutputExtra(void)
1251 {
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");
1312 
1313  if (1) {
1314  h_psn_extra[skim[ifill]]->Fill(0.5);
1315  }
1316  if (fff_fired && (ECL_fired)) {
1317  h_psn_extra[skim[ifill]]->Fill(1.5);
1318  }
1319  if (ffo_fired && (ECL_fired)) {
1320  h_psn_extra[skim[ifill]]->Fill(2.5);
1321  }
1322  if (ffb_fired && (ECL_fired)) {
1323  h_psn_extra[skim[ifill]]->Fill(3.5);
1324  }
1325  if (fff_fired) {
1326  h_psn_extra[skim[ifill]]->Fill(4.5);
1327  }
1328  if (ECL_fired) {
1329  h_psn_extra[skim[ifill]]->Fill(5.5);
1330  }
1331  if (CDC_fired) {
1332  h_psn_extra[skim[ifill]]->Fill(6.5);
1333  }
1334  if ((CDC_fired) && (ECL_fired)) {
1335  h_psn_extra[skim[ifill]]->Fill(7.5);
1336  }
1337  if (bha2D_fired) {
1338  h_psn_extra[skim[ifill]]->Fill(8.5);
1339  }
1340  if (bha3D_fired) {
1341  h_psn_extra[skim[ifill]]->Fill(9.5);
1342  }
1343  if (ff_fired) {
1344  h_psn_extra[skim[ifill]]->Fill(10.5);
1345  }
1346  if (ff_fired && (LML_fired)) {
1347  h_psn_extra[skim[ifill]]->Fill(11.5);
1348  }
1349  if (f_fired) {
1350  h_psn_extra[skim[ifill]]->Fill(12.5);
1351  }
1352  if (f_fired && (LML_fired)) {
1353  h_psn_extra[skim[ifill]]->Fill(13.5);
1354  }
1355  if (LML_fired) {
1356  h_psn_extra[skim[ifill]]->Fill(14.5);
1357  }
1358  if (fff_fired && (LML_fired)) {
1359  h_psn_extra[skim[ifill]]->Fill(15.5);
1360  }
1361  if (ffo_fired && (LML_fired)) {
1362  h_psn_extra[skim[ifill]]->Fill(16.5);
1363  }
1364  if (ffb_fired && (LML_fired)) {
1365  h_psn_extra[skim[ifill]]->Fill(17.5);
1366  }
1367  if (ffy_fired) {
1368  h_psn_extra[skim[ifill]]->Fill(18.5);
1369  }
1370  if (ffy_fired && (ECL_fired)) {
1371  h_psn_extra[skim[ifill]]->Fill(19.5);
1372  }
1373  if (fyo_fired && (ECL_fired)) {
1374  h_psn_extra[skim[ifill]]->Fill(20.5);
1375  }
1376  if (fyb_fired && (ECL_fired)) {
1377  h_psn_extra[skim[ifill]]->Fill(21.5);
1378  }
1379  if ((ffy_fired || fyo_fired || fyb_fired) && (ECL_fired)) {
1380  h_psn_extra[skim[ifill]]->Fill(22.5);
1381  }
1382  if (ffy_fired && (LML_fired)) {
1383  h_psn_extra[skim[ifill]]->Fill(23.5);
1384  }
1385  if (fyo_fired && (LML_fired)) {
1386  h_psn_extra[skim[ifill]]->Fill(24.5);
1387  }
1388  if (fyb_fired && (LML_fired)) {
1389  h_psn_extra[skim[ifill]]->Fill(25.5);
1390  }
1391  if (c4_fired && (CDC_fired)) {
1392  h_psn_extra[skim[ifill]]->Fill(26.5);
1393  }
1394  if (hie_fired && (CDC_fired)) {
1395  h_psn_extra[skim[ifill]]->Fill(27.5);
1396  }
1397  if (lml0_fired && (CDC_fired)) {
1398  h_psn_extra[skim[ifill]]->Fill(28.5);
1399  }
1400  if (lml1_fired && (CDC_fired)) {
1401  h_psn_extra[skim[ifill]]->Fill(29.5);
1402  }
1403  if (lml2_fired && (CDC_fired)) {
1404  h_psn_extra[skim[ifill]]->Fill(30.5);
1405  }
1406  if (lml3_fired && (CDC_fired)) {
1407  h_psn_extra[skim[ifill]]->Fill(31.5);
1408  }
1409  if (lml4_fired && (CDC_fired)) {
1410  h_psn_extra[skim[ifill]]->Fill(32.5);
1411  }
1412  if (lml5_fired && (CDC_fired)) {
1413  h_psn_extra[skim[ifill]]->Fill(33.5);
1414  }
1415  if (lml6_fired && (CDC_fired)) {
1416  h_psn_extra[skim[ifill]]->Fill(34.5);
1417  }
1418  if (lml7_fired && (CDC_fired)) {
1419  h_psn_extra[skim[ifill]]->Fill(35.5);
1420  }
1421  if (lml8_fired && (CDC_fired)) {
1422  h_psn_extra[skim[ifill]]->Fill(36.5);
1423  }
1424  if (lml9_fired && (CDC_fired)) {
1425  h_psn_extra[skim[ifill]]->Fill(37.5);
1426  }
1427  if (lml10_fired && (CDC_fired)) {
1428  h_psn_extra[skim[ifill]]->Fill(38.5);
1429  }
1430  if (lml12_fired && (CDC_fired)) {
1431  h_psn_extra[skim[ifill]]->Fill(39.5);
1432  }
1433  if (lml13_fired && (CDC_fired)) {
1434  h_psn_extra[skim[ifill]]->Fill(40.5);
1435  }
1436  if (eclmumu_fired && (CDC_fired)) {
1437  h_psn_extra[skim[ifill]]->Fill(41.5);
1438  }
1439  if (mu_b2b_fired && (CDC_fired)) {
1440  h_psn_extra[skim[ifill]]->Fill(42.5);
1441  }
1442  if (mu_eb2b_fired && (CDC_fired)) {
1443  h_psn_extra[skim[ifill]]->Fill(43.5);
1444  }
1445  if (cdcklm1_fired && (CDC_fired)) {
1446  h_psn_extra[skim[ifill]]->Fill(44.5);
1447  }
1448  if (cdcklm2_fired && (CDC_fired)) {
1449  h_psn_extra[skim[ifill]]->Fill(45.5);
1450  }
1451  if (klm_hit_fired && (CDC_fired)) {
1452  h_psn_extra[skim[ifill]]->Fill(46.5);
1453  }
1454  if (eklm_hit_fired && (CDC_fired)) {
1455  h_psn_extra[skim[ifill]]->Fill(47.5);
1456  }
1457  if (mu_b2b_fired && LML_fired) {
1458  h_psn_extra[skim[ifill]]->Fill(48.5);
1459  }
1460  if (mu_eb2b_fired && LML_fired) {
1461  h_psn_extra[skim[ifill]]->Fill(49.5);
1462  }
1463  if (cdcklm1_fired && LML_fired) {
1464  h_psn_extra[skim[ifill]]->Fill(50.5);
1465  }
1466  if (cdcklm2_fired && LML_fired) {
1467  h_psn_extra[skim[ifill]]->Fill(51.5);
1468  }
1469  if (klm_hit_fired && LML_fired) {
1470  h_psn_extra[skim[ifill]]->Fill(52.5);
1471  }
1472  if (eklm_hit_fired && LML_fired) {
1473  h_psn_extra[skim[ifill]]->Fill(53.5);
1474  }
1475  if (cdcecl1_fired && (CDC_fired)) {
1476  h_psn_extra[skim[ifill]]->Fill(54.5);
1477  }
1478  if (cdcecl2_fired && (CDC_fired)) {
1479  h_psn_extra[skim[ifill]]->Fill(55.5);
1480  }
1481  if (cdcecl3_fired && (CDC_fired)) {
1482  h_psn_extra[skim[ifill]]->Fill(56.5);
1483  }
1484  if (cdcecl4_fired && (CDC_fired)) {
1485  h_psn_extra[skim[ifill]]->Fill(57.5);
1486  }
1487  if (cdcecl1_fired && LML_fired) {
1488  h_psn_extra[skim[ifill]]->Fill(58.5);
1489  }
1490  if (cdcecl2_fired && LML_fired) {
1491  h_psn_extra[skim[ifill]]->Fill(59.5);
1492  }
1493  if (cdcecl3_fired && LML_fired) {
1494  h_psn_extra[skim[ifill]]->Fill(60.5);
1495  }
1496  if (cdcecl4_fired && LML_fired) {
1497  h_psn_extra[skim[ifill]]->Fill(61.5);
1498  }
1499  if (fso_fired && LML_fired) {
1500  h_psn_extra[skim[ifill]]->Fill(62.5);
1501  }
1502  if (fsb_fired && LML_fired) {
1503  h_psn_extra[skim[ifill]]->Fill(63.5);
1504  }
1505  if (syo_fired && LML_fired) {
1506  h_psn_extra[skim[ifill]]->Fill(64.5);
1507  }
1508  if (syb_fired && LML_fired) {
1509  h_psn_extra[skim[ifill]]->Fill(65.5);
1510  }
1511  if (x_fired && LML_fired) {
1512  h_psn_extra[skim[ifill]]->Fill(66.5);
1513  }
1514  if (fioiecl1_fired && LML_fired) {
1515  h_psn_extra[skim[ifill]]->Fill(67.5);
1516  }
1517  if (ecleklm1_fired && LML_fired) {
1518  h_psn_extra[skim[ifill]]->Fill(68.5);
1519  }
1520  if (seklm1_fired && LML_fired) {
1521  h_psn_extra[skim[ifill]]->Fill(69.5);
1522  }
1523  if (seklm2_fired && LML_fired) {
1524  h_psn_extra[skim[ifill]]->Fill(70.5);
1525  }
1526  if (ieklm_fired && LML_fired) {
1527  h_psn_extra[skim[ifill]]->Fill(71.5);
1528  }
1529  if (iecl_fired && LML_fired) {
1530  h_psn_extra[skim[ifill]]->Fill(72.5);
1531  }
1532  if (ecleklm1_fired && CDC_fired) {
1533  h_psn_extra[skim[ifill]]->Fill(73.5);
1534  }
1535  if (syo_fired && ECL_fired) {
1536  h_psn_extra[skim[ifill]]->Fill(74.5);
1537  }
1538  if (yioiecl1_fired && ECL_fired) {
1539  h_psn_extra[skim[ifill]]->Fill(75.5);
1540  }
1541  if (stt_fired && ECL_fired) {
1542  h_psn_extra[skim[ifill]]->Fill(76.5);
1543  }
1544  if (ffz_fired && (ECL_fired)) {
1545  h_psn_extra[skim[ifill]]->Fill(77.5);
1546  }
1547  if (fzo_fired && (ECL_fired)) {
1548  h_psn_extra[skim[ifill]]->Fill(78.5);
1549  }
1550  if (fzb_fired && (ECL_fired)) {
1551  h_psn_extra[skim[ifill]]->Fill(79.5);
1552  }
1553  if (ffy_fired && ffz_fired && (ECL_fired)) {
1554  h_psn_extra[skim[ifill]]->Fill(80.5);
1555  }
1556  if (fyo_fired && fzo_fired && (ECL_fired)) {
1557  h_psn_extra[skim[ifill]]->Fill(81.5);
1558  }
1559  if (fyb_fired && fzb_fired && (ECL_fired)) {
1560  h_psn_extra[skim[ifill]]->Fill(82.5);
1561  }
1562  if ((ffy_fired || ffz_fired) && (ECL_fired)) {
1563  h_psn_extra[skim[ifill]]->Fill(83.5);
1564  }
1565  if ((fyo_fired || fzo_fired) && (ECL_fired)) {
1566  h_psn_extra[skim[ifill]]->Fill(84.5);
1567  }
1568  if ((fyb_fired || fzb_fired) && (ECL_fired)) {
1569  h_psn_extra[skim[ifill]]->Fill(85.5);
1570  }
1571  if (ffy_fired && ffz_fired) {
1572  h_psn_extra[skim[ifill]]->Fill(86.5);
1573  }
1574  if (fyo_fired && fzo_fired) {
1575  h_psn_extra[skim[ifill]]->Fill(87.5);
1576  }
1577  if (fyb_fired && fzb_fired) {
1578  h_psn_extra[skim[ifill]]->Fill(88.5);
1579  }
1580  if (ffy_fired || ffz_fired) {
1581  h_psn_extra[skim[ifill]]->Fill(89.5);
1582  }
1583  if (fyo_fired || fzo_fired) {
1584  h_psn_extra[skim[ifill]]->Fill(90.5);
1585  }
1586  if (fyb_fired || fzb_fired) {
1587  h_psn_extra[skim[ifill]]->Fill(91.5);
1588  }
1589  if (ffo_fired) {
1590  h_psn_extra[skim[ifill]]->Fill(92.5);
1591  }
1592  if (ffb_fired) {
1593  h_psn_extra[skim[ifill]]->Fill(93.5);
1594  }
1595  }
1596 
1597 }
1598 
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"
1610 };
1611 
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"
1617 };
1618 
1619 
1620 
1621 void
1622 TRGGDLDQMModule::fillOutputPureExtra(void)
1623 {
1624  //get offline CDC track information
1625  int n_fulltrack = 0;
1626  float max_dphi = 0;
1627  float phi_list[100];
1628  for (int itrack = 0; itrack < Tracks.getEntries(); itrack++) {
1629  const TrackFitResult* tfr = Tracks[itrack]->getTrackFitResult(Const::pion);
1630  if (tfr == nullptr) continue;
1631 
1632  float z0 = tfr->getZ0();
1633  float d0 = tfr->getD0();
1634  float phi = tfr->getPhi();
1635  //float omega = tfr->getOmega();
1636  int flayer = tfr->getHitPatternCDC().getFirstLayer();
1637  int llayer = tfr->getHitPatternCDC().getLastLayer();
1638  float pt = tfr->getTransverseMomentum();
1639  if (z0 > -1 && z0 < 1 && d0 > -1 && d0 < 1 && flayer < 8 && llayer > 50
1640  && pt > 0.3) { //select track from IP, hit SL0 and SL8, pt>0.3GeV
1641  phi_list[n_fulltrack] = phi;
1642  n_fulltrack += 1;
1643  }
1644  }
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;
1651  }
1652  }
1653 
1654  //get offline ECL cluster information
1655  //double total_energy = 0;
1656  //for (int iclst = 0; iclst < ECLClusters.getEntries(); iclst++) {
1657  // total_energy += ECLClusters[iclst]->getEnergyRaw();
1658  //}
1659  //
1660  //
1661  int ecl_timing_threshold_low = -200; // (ns) xtal timing selection
1662  int ecl_timing_threshold_high = 200; // (ns) xtal timing selection
1663  double ecl_xtcid_energy_sum[576] = {0};
1664  double total_energy = 0;
1665  int ncluster = 0;
1666  for (const auto& eclcalhit : m_ECLCalDigitData) {
1667 
1668  // (ecl) calibation status check and cut
1669  if (!eclcalhit.isCalibrated()) {continue;}
1670  if (eclcalhit.isFailedFit()) {continue;}
1671  if (eclcalhit.isTimeResolutionFailed()) {continue;}
1672 
1673  // (ecl) xtal-id
1674  int ecl_cid = (double) eclcalhit.getCellId();
1675 
1676  // (ecl) fitter quality check and cut
1677  int ecl_quality = -1;
1678  for (const auto& eclhit : m_ECLDigitData) {
1679  if (ecl_cid == eclhit.getCellId()) {
1680  ecl_quality = (int) eclhit.getQuality();
1681  }
1682  }
1683  if (ecl_quality != 0) {continue;}
1684 
1685  // (ecl) xtal energy
1686  double ecl_xtal_energy = eclcalhit.getEnergy(); // ECLCalDigit
1687 
1688 
1689  // (ecl) timing cut
1690  int ecl_timing = eclcalhit.getTime();
1691  if (ecl_timing < ecl_timing_threshold_low ||
1692  ecl_timing > ecl_timing_threshold_high) {continue;}
1693 
1694  // (ecl) tc-id for xtal-id
1695  int ecl_tcid = trgeclmap->getTCIdFromXtalId(ecl_cid);
1696  int ecl_thetaid = trgeclmap->getTCThetaIdFromTCId(ecl_tcid);
1697 
1698  if (ecl_tcid >= 0 && ecl_tcid < 576 && ecl_thetaid >= 2 && ecl_thetaid <= 15) { //pick up only 2=<thetaid=<15
1699  ecl_xtcid_energy_sum[ecl_tcid] = ecl_xtcid_energy_sum[ecl_tcid] + ecl_xtal_energy;
1700  //ecltimingsum[i] = ecl_timing;
1701  }
1702  }
1703 
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];
1707  ncluster += 1;
1708  }
1709  }
1710 
1711  //get offline KLM cluster information
1712 
1713 
1714  //fff: require the number of CDC full tracks is more than or equal to 3
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);
1722  }
1723  if (fff_fired && (c4_fired || hie_fired)) {
1724  h_psn_pure_extra[0]->Fill(1.5);
1725  }
1726  if (ffy_fired && (c4_fired || hie_fired)) {
1727  h_psn_pure_extra[0]->Fill(2.5);
1728  }
1729  }
1730  //ffo: require the number of CDC full tracks is more than or equal to 2, opening angle > 90deg
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);
1738  }
1739  if (ffo_fired && (c4_fired || hie_fired)) {
1740  h_psn_pure_extra[0]->Fill(4.5);
1741  }
1742  if (fyo_fired && (c4_fired || hie_fired)) {
1743  h_psn_pure_extra[0]->Fill(5.5);
1744  }
1745  }
1746  //ffo: require the number of CDC full tracks is more than or equal to 2, opening angle >150deg
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);
1754  }
1755  if (ffb_fired && (c4_fired || hie_fired)) {
1756  h_psn_pure_extra[0]->Fill(7.5);
1757  }
1758  if (fyb_fired && (c4_fired || hie_fired)) {
1759  h_psn_pure_extra[0]->Fill(8.5);
1760  }
1761  }
1762 
1763  //hie: require the total energy of ECL cluster is more than 1GeV
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);
1771  }
1772  if (hie_fired && (fff_fired || ffo_fired || ffb_fired)) {
1773  h_psn_pure_extra[0]->Fill(10.5);
1774  }
1775  }
1776 
1777  //c4: require the total number of cluster is more than 3
1778  if (ncluster > 3) {
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);
1785  }
1786  if (c4_fired && (fff_fired || ffo_fired || ffb_fired)) {
1787  h_psn_pure_extra[0]->Fill(12.5);
1788  }
1789  }
1790 
1791 }
1792 
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"
1799 };
1800 
1801 
Belle2::HitPatternCDC::getFirstLayer
short getFirstLayer() const
Returns the index of the first layer with a hit.
Definition: HitPatternCDC.cc:98
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
Belle2::TRGGDLDQMModule::h_c8_cdcTogdlL1
TH1I * h_c8_cdcTogdlL1[nskim_gdldqm]
timestamp diff from t0(cdc) to gdlL1 in LSB8nsec
Definition: TRGGDLDQMModule.h:69
Belle2::TRGGDLDQMModule::h_ns_cdcToecl
TH1D * h_ns_cdcToecl[nskim_gdldqm]
timestamp diff from cdc_timing to ecl_timing in nsec
Definition: TRGGDLDQMModule.h:91
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module::c_ParallelProcessingCertified
@ 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:82
Belle2::TRGGDLDQMModule::h_psn
TH1I * h_psn[nskim_gdldqm]
psn bits
Definition: TRGGDLDQMModule.h:106
skim
Definition: __init__.py:1
Belle2::TRGGDLDQMModule::h_c8_eclToGDL
TH1I * h_c8_eclToGDL[nskim_gdldqm]
timestamp diff from t0(ecl) to GDL in LSB8nsec
Definition: TRGGDLDQMModule.h:75
Belle2::TRGGDLDQMModule::h_timtype
TH1I * h_timtype[nskim_gdldqm]
timtype
Definition: TRGGDLDQMModule.h:114
Belle2::TRGGDLDQMModule::defineHisto
virtual void defineHisto() override
Define Histogram.
Definition: TRGGDLDQMModule.cc:83
Belle2::TrgEclMapping
A class of TC Mapping.
Definition: TrgEclMapping.h:31
Belle2::TRGGDLDQMModule::h_c8_topToGDL
TH1I * h_c8_topToGDL[nskim_gdldqm]
timestamp diff from t0(top) to GDL in LSB8nsec
Definition: TRGGDLDQMModule.h:73
Belle2::TrackFitResult
Values of the result of a track fit with a given particle hypothesis.
Definition: TrackFitResult.h:59
Belle2::SoftwareTriggerCutResult::c_accept
@ c_accept
Accept this event.
Belle2::TrackFitResult::getHitPatternCDC
HitPatternCDC getHitPatternCDC() const
Getter for the hit pattern in the CDC;.
Definition: TrackFitResult.cc:120
Belle2::TrackFitResult::getZ0
double getZ0() const
Getter for z0.
Definition: TrackFitResult.h:200
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::Const::pion
static const ChargedStable pion
charged pion particle
Definition: Const.h:535
Belle2::TRGGDLDQMModule::beginRun
virtual void beginRun() override
begin Run
Definition: TRGGDLDQMModule.cc:223
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TRGGDLDQMModule::h_ns_cdcTocomL1
TH1D * h_ns_cdcTocomL1[nskim_gdldqm]
timestamp diff from cdc_timing to comL1 in nsec
Definition: TRGGDLDQMModule.h:81
Belle2::TrackFitResult::getTransverseMomentum
double getTransverseMomentum() const
Getter for the absolute value of the transverse momentum at the perigee.
Definition: TrackFitResult.h:140
Belle2::TRGGDLDQMModule::h_c8_gdlL1TocomL1
TH1I * h_c8_gdlL1TocomL1[nskim_gdldqm]
timestamp diff from gdlL1 to comL1 in LSB8nsec
Definition: TRGGDLDQMModule.h:63
Belle2::TRGGDLDQMModule::h_c8_ecl8mToGDL
TH1I * h_c8_ecl8mToGDL[nskim_gdldqm]
timestamp diff from fit on fam to GDL in LSB8nsec
Definition: TRGGDLDQMModule.h:71
Belle2::TRGGDLDQMModule::h_ns_topTocdc
TH1D * h_ns_topTocdc[nskim_gdldqm]
timestamp diff from top_timing to cdc_timing in nsec
Definition: TRGGDLDQMModule.h:87
Belle2::TRGGDLDQMModule::h_c8_eclTogdlL1
TH1I * h_c8_eclTogdlL1[nskim_gdldqm]
timestamp diff from t0(ecl) to gdlL1 in LSB8nsec
Definition: TRGGDLDQMModule.h:67
Belle2::TRGGDLDQMModule::h_c2_cdcToecl
TH1I * h_c2_cdcToecl[nskim_gdldqm]
timestamp from cdc_timing to ecl_timing to L1 in LSB2nsec
Definition: TRGGDLDQMModule.h:89
Belle2::TRGGDLDQMModule::initialize
virtual void initialize() override
initialize
Definition: TRGGDLDQMModule.cc:257
Belle2::TRGGDLDQMModule::h_ns_topToecl
TH1D * h_ns_topToecl[nskim_gdldqm]
timestamp diff from top_timing to ecl_timing in nsec
Definition: TRGGDLDQMModule.h:85
Belle2::Module::addParam
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:562
Belle2::TRGGDLDQMModule::endRun
virtual void endRun() override
End Run.
Definition: TRGGDLDQMModule.cc:365
Belle2::TRGGDLDQMModule::h_c8_cdcToGDL
TH1I * h_c8_cdcToGDL[nskim_gdldqm]
timestamp diff from t0(cdc) to GDL in LSB8nsec
Definition: TRGGDLDQMModule.h:77
Belle2::HitPatternCDC::getLastLayer
short getLastLayer() const
Returns the index of the last layer with a hit.
Definition: HitPatternCDC.cc:106
Belle2::TRGGDLDQMModule::h_c8_topTogdlL1
TH1I * h_c8_topTogdlL1[nskim_gdldqm]
timestamp diff from t0(top) to gdlL1 in LSB8nsec
Definition: TRGGDLDQMModule.h:65
Belle2::TrgEclMapping::getTCThetaIdFromTCId
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
Definition: TrgEclMapping.cc:200
Belle2::TRGGDLDQMModule::h_ns_cdcTogdlL1
TH1D * h_ns_cdcTogdlL1[nskim_gdldqm]
timestamp diff from cdc_timing to gdlL1 in nsec
Definition: TRGGDLDQMModule.h:83
Belle2::TRGGDLDQMModule::h_c2_cdcTocomL1
TH1I * h_c2_cdcTocomL1[nskim_gdldqm]
timestamp diff from cdc_timing to comL1 in LSB2nsec
Definition: TRGGDLDQMModule.h:79
Belle2::TRGGDLDQMModule::event
virtual void event() override
Event.
Definition: TRGGDLDQMModule.cc:447
Belle2::TrgEclMapping::getTCIdFromXtalId
int getTCIdFromXtalId(int)
get [TC ID] from [Xtal ID]
Definition: TrgEclMapping.cc:36
Belle2::TRGGDLDQMModule::h_ftd
TH1I * h_ftd[nskim_gdldqm]
ftd bits
Definition: TRGGDLDQMModule.h:102
Belle2::TRGGDLDQMModule::h_itd
TH1I * h_itd[nskim_gdldqm]
input bits
Definition: TRGGDLDQMModule.h:98
Belle2::HistoModule
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
Definition: HistoModule.h:29
Belle2::TrackFitResult::getPhi
double getPhi() const
Getter for phi0 with CDF naming convention.
Definition: TrackFitResult.h:187
Belle2::TrackFitResult::getD0
double getD0() const
Getter for d0.
Definition: TrackFitResult.h:178