22#include <trg/top/modules/trgtopDQM/TRGTOPDQMModule.h>
23#include <mdst/dataobjects/SoftwareTriggerResult.h>
25#include <framework/datastore/StoreObjPtr.h>
26#include <framework/datastore/StoreArray.h>
28#include "trg/top/dataobjects/TRGTOPUnpackerStore.h"
30#include <TDirectory.h>
31#include <TPostScript.h>
35#include <framework/logging/Logger.h>
36#include <boost/algorithm/string.hpp>
51 addParam(
"doECLCorrelations", m_doECLCorrelations,
52 "Do ECL-TOP correlations (true)",
55 addParam(
"requireECLBarrel", m_requireEclBarrel,
56 "Require the most energetic ECL TC in the barrel if doing correlations with ECL (false)",
59 addParam(
"requireECLBarrelB2B", m_requireEclBarrelB2B,
60 "Require ECL barrel back-to-back if doing correlations with ECL (false)",
63 addParam(
"doGDLCorrelations", m_doGDLCorrelations,
64 "Do GDL-TOP correlations (true)",
67 addParam(
"doGRLCorrelations", m_doGRLCorrelations,
68 "Do GRL-TOP correlations (true)",
71 addParam(
"requireCDC2DTrack", m_requireCDC2DTrack,
72 "Require at least one CDC 2D track at TRG level",
75 addParam(
"generatePostscriptFile", m_generatePostscriptFile,
76 "Generate postscript file (false)",
79 addParam(
"postScriptFileName", m_postScriptFileName,
80 "postscript file name",
81 string(
"topl1dqm.ps"));
84 "use skim information (-1)",
87 addParam(
"nHistClasses", m_nHistClassesActual,
88 "The number of histogram classes: 1, 2, 3 (1); use 2 and 3 for detailed studies only",
92 "Histogramming level: 1, 2, 3 (1); 3 most detailed",
104 if (m_nHistClassesActual > nHistClasses) m_nHistClassesActual = nHistClasses;
105 if (m_nHistClassesActual < 1) m_nHistClassesActual = 1;
109 for (
int iskim = start_skim_topdqm; iskim < end_skim_topdqm; iskim++) {
115 h_topCombinedTimingTopAll[iskim] =
new TH1I(Form(
"h_t0_comb_%s", skim_smap[iskim].c_str()),
"ALL TOP combined t0 decisions", 100,
118 h_topCombinedTimingTopAll[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decision time (us)");
120 h_topNSlotsCombinedTimingTopAll[iskim] =
new TH1I(Form(
"h_n_slots_comb_%s", skim_smap[iskim].c_str()),
121 "ALL TOP combined t0 decisions: N slots", 17, 0, 17);
122 h_topNSlotsCombinedTimingTopAll[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N slots");
124 h_topNHitSumAll[iskim] =
new TH1I(Form(
"h_nhit_per_slot_comb_%s", skim_smap[iskim].c_str()),
125 "ALL TOP combined t0 decisions: N hits per slot", 200, 0, 200);
126 h_topNHitSumAll[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N hits per slot");
128 h_topLogLSumAll[iskim] =
new TH1I(Form(
"h_logl_per_slot_comb_%s", skim_smap[iskim].c_str()),
129 "ALL TOP combined t0 decisions: log L per slot", 100, 0, 60000);
130 h_topLogLSumAll[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: log L per slot");
132 h_topNSlotsCombinedTimingVsNHitsTopAll[iskim] =
new TH2I(Form(
"h_n_slots_vs_nhit_total_comb_%s", skim_smap[iskim].c_str()),
133 "ALL TOP combined t0 decisions: N slots vs N hits (total)", 300, 0, 300, 17, 0, 17);
134 h_topNSlotsCombinedTimingVsNHitsTopAll[iskim]->GetXaxis()->SetTitle(
"N hits (total)");
135 h_topNSlotsCombinedTimingVsNHitsTopAll[iskim]->GetYaxis()->SetTitle(
"N slots");
137 h_topTrigType[iskim] =
new TH1I(Form(
"h_trig_type_%s", skim_smap[iskim].c_str()),
138 "ALL TOP combined decisions: trig type", 10, 0, 10);
139 h_topTrigType[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: trig type");
141 h_topTimingResiduals[iskim] =
new TH1I(Form(
"h_timing_residuals_%s", skim_smap[iskim].c_str()),
142 "ALL TOP combined decisions: timing residual", 100, 0, 100);
143 h_topTimingResiduals[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: timing residuals");
145 h_topTimingVariance[iskim] =
new TH1I(Form(
"h_timing_variance_%s", skim_smap[iskim].c_str()),
146 "ALL TOP combined decisions: timing variance", 100, 0, 100);
147 h_topTimingVariance[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: timing variance");
154 h_topSlotAll[iskim] =
new TH1I(Form(
"h_slot_number_%s", skim_smap[iskim].c_str()),
"slot", 16, 1, 17);
155 h_topSlotAll[iskim]->GetXaxis()->SetTitle(
"slot number in combined decisions (over 1us)");
157 h_topSegmentAll[iskim] =
new TH1I(Form(
"h_segment_slot_%s", skim_smap[iskim].c_str()),
"segment", 10, 1, 11);
158 h_topSegmentAll[iskim]->GetXaxis()->SetTitle(
"segment for each slot in combined decisions (over 1us)");
160 h_topNHitsAll[iskim] =
new TH1I(Form(
"h_nhit_slot_%s", skim_smap[iskim].c_str()),
"nhit", 200, 0, 200);
161 h_topNHitsAll[iskim]->GetXaxis()->SetTitle(
"N hits (for slots in combined decisions (over 1us))");
163 h_topLogLAll[iskim] =
new TH1I(Form(
"h_logl_slot_%s", skim_smap[iskim].c_str()),
"log L", 100, 0, 60000);
164 h_topLogLAll[iskim]->GetXaxis()->SetTitle(
"log L (for slots in combined decisions (over 1us))");
166 h_topT0All[iskim] =
new TH1I(Form(
"h_t0_slot_%s", skim_smap[iskim].c_str()),
"t0", 100, 0, 100000);
167 h_topT0All[iskim]->GetXaxis()->SetTitle(
"t0 for slots in combined decisions (over 1us)");
174 h_topSlotVsSegment[iskim] =
new TH2I(Form(
"h_slot_vs_segment_%s", skim_smap[iskim].c_str()),
"slot # vs slot segment", 10, 1, 11,
176 h_topSlotVsSegment[iskim]->GetXaxis()->SetTitle(
"segment");
177 h_topSlotVsSegment[iskim]->GetYaxis()->SetTitle(
"slot");
179 h_topSlotVsNHits[iskim] =
new TH2I(Form(
"h_slot_vs_nhit_%s", skim_smap[iskim].c_str()),
"slot # vs slot nhit", 200, 0, 200, 16, 1,
181 h_topSlotVsNHits[iskim]->GetXaxis()->SetTitle(
"N hits");
182 h_topSlotVsNHits[iskim]->GetYaxis()->SetTitle(
"slot");
184 h_topSlotVsLogL[iskim] =
new TH2I(Form(
"h_slot_vs_logl_%s", skim_smap[iskim].c_str()),
"slot # vs slot log L", 100, 0, 60000, 16,
186 h_topSlotVsLogL[iskim]->GetXaxis()->SetTitle(
"logL");
187 h_topSlotVsLogL[iskim]->GetYaxis()->SetTitle(
"slot");
189 h_topSlotVsT0[iskim] =
new TH2I(Form(
"h_slot_vs_t0_%s", skim_smap[iskim].c_str()),
"slot # vs slot t0", 100, 0, 100000, 16, 1, 17);
190 h_topSlotVsT0[iskim]->GetXaxis()->SetTitle(
"t0");
191 h_topSlotVsT0[iskim]->GetYaxis()->SetTitle(
"slot");
193 h_topSegmentVsNHits[iskim] =
new TH2I(Form(
"h_segment_vs_nhit_%s", skim_smap[iskim].c_str()),
"slot segment vs slot nhit", 200, 0,
195 h_topSegmentVsNHits[iskim]->GetXaxis()->SetTitle(
"N hits");
196 h_topSegmentVsNHits[iskim]->GetYaxis()->SetTitle(
"segment");
198 h_topSegmentVsLogL[iskim] =
new TH2I(Form(
"h_segment_vs_logl_%s", skim_smap[iskim].c_str()),
"slot segment vs slot log L", 100, 0,
200 h_topSegmentVsLogL[iskim]->GetXaxis()->SetTitle(
"logL");
201 h_topSegmentVsLogL[iskim]->GetYaxis()->SetTitle(
"segment");
203 h_topSegmentVsT0[iskim] =
new TH2I(Form(
"h_segment_vs_t0_%s", skim_smap[iskim].c_str()),
"slot segment vs slot t0", 100, 0, 100000,
205 h_topSegmentVsT0[iskim]->GetXaxis()->SetTitle(
"t0");
206 h_topSegmentVsT0[iskim]->GetYaxis()->SetTitle(
"segment");
208 h_topNHitsVsLogL[iskim] =
new TH2I(Form(
"h_nhit_vs_logl_%s", skim_smap[iskim].c_str()),
"slot nhit vs slot log L", 100, 0, 100000,
210 h_topNHitsVsLogL[iskim]->GetXaxis()->SetTitle(
"logL");
211 h_topNHitsVsLogL[iskim]->GetYaxis()->SetTitle(
"N hits");
213 h_topNHitsVsT0[iskim] =
new TH2I(Form(
"h_nhit_vs_t0_%s", skim_smap[iskim].c_str()),
"slot nhit vs slot t0", 100, 0, 100000, 200, 0,
215 h_topNHitsVsT0[iskim]->GetXaxis()->SetTitle(
"t0");
216 h_topNHitsVsT0[iskim]->GetYaxis()->SetTitle(
"N hits");
218 h_topLogLVsT0[iskim] =
new TH2I(Form(
"h_logl_vs_t0_%s", skim_smap[iskim].c_str()),
"slot log L vs slot t0", 100, 0, 100000, 100, 0,
220 h_topLogLVsT0[iskim]->GetXaxis()->SetTitle(
"t0");
221 h_topLogLVsT0[iskim]->GetYaxis()->SetTitle(
"logL");
228 for (
int slot = 0; slot <= 15; slot++) {
230 h_topSlotSegment[iskim][slot] =
new TH1I(Form(
"h_segment_slot_%s_%s", (to_string(slot + 1)).c_str(), skim_smap[iskim].c_str()),
231 "segment", 10, 1, 11);
234 h_topSlotNHits[iskim][slot] =
new TH1I(Form(
"h_nhit_slot_%s_%s", (to_string(slot + 1)).c_str(), skim_smap[iskim].c_str()),
"nhit",
236 h_topSlotNHits[iskim][slot]->GetXaxis()->SetTitle(
"N hits");
238 h_topSlotLogL[iskim][slot] =
new TH1I(Form(
"h_logl_slot_%s_%s", (to_string(slot + 1)).c_str(), skim_smap[iskim].c_str()),
"log L",
240 h_topSlotLogL[iskim][slot]->GetXaxis()->SetTitle(
"log L");
242 h_topSlotT0[iskim][slot] =
new TH1I(Form(
"h_t0_slot_%s_%s", (to_string(slot + 1)).c_str(), skim_smap[iskim].c_str()),
"t0", 100, 0,
244 h_topSlotT0[iskim][slot]->GetXaxis()->SetTitle(
"t0");
253 h_gdl_ecltop_timing_diff_vs_slot[iskim] =
new TH2I(Form(
"h_gdl_slot_vs_ecltop_timing_diff_%s", skim_smap[iskim].c_str()),
254 "slot vs GDL ECL-TOP slot t0 difference", 400, 1400,
256 h_gdl_ecltop_timing_diff_vs_slot[iskim]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
257 h_gdl_ecltop_timing_diff_vs_slot[iskim]->GetYaxis()->SetTitle(
"slot");
259 h_gdl_ecltop_timing_diff_vs_segment[iskim] =
new TH2I(Form(
"h_gdl_segment_vs_ecltop_timing_diff_%s", skim_smap[iskim].c_str()),
260 "segment vs GDL ECL-TOP slot t0 difference",
261 400, 1400, 2200, 10, 1, 11);
262 h_gdl_ecltop_timing_diff_vs_segment[iskim]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
263 h_gdl_ecltop_timing_diff_vs_segment[iskim]->GetYaxis()->SetTitle(
"segment");
265 h_gdl_ecltop_timing_diff_vs_nhits[iskim] =
new TH2I(Form(
"h_gdl_nhits_vs_ecltop_timing_diff_%s", skim_smap[iskim].c_str()),
266 "N hits (for slots) vs GDL ECL-TOP slot t0 difference", 400, 1400, 2200, 200, 0, 200);
267 h_gdl_ecltop_timing_diff_vs_nhits[iskim]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
268 h_gdl_ecltop_timing_diff_vs_nhits[iskim]->GetYaxis()->SetTitle(
"N hits");
270 h_gdl_ecltop_timing_diff_vs_logl[iskim] =
new TH2I(Form(
"h_gdl_logl_vs_ecltop_timing_diff_%s", skim_smap[iskim].c_str()),
271 "log L (for slots) vs GDL ECL-TOP slot t0 difference", 400, 1400, 2200, 100, 0, 60000);
272 h_gdl_ecltop_timing_diff_vs_logl[iskim]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
273 h_gdl_ecltop_timing_diff_vs_logl[iskim]->GetYaxis()->SetTitle(
"log L");
277 h_ecl_gdl_top_timing_diff_both[iskim] =
new TH1I(Form(
"h_ecl_gdl_top_timing_diff_both_%s", skim_smap[iskim].c_str()),
"", 400,
279 h_ecl_gdl_top_timing_diff_both[iskim]->GetXaxis()->SetTitle(
"Both ECL - GDL_TOP timing difference (2ns)");
281 h_ecl_top_top_timing_diff_both[iskim] =
new TH1I(Form(
"h_ecl_top_top_timing_diff_both_%s", skim_smap[iskim].c_str()),
"", 400,
283 h_ecl_top_top_timing_diff_both[iskim]->GetXaxis()->SetTitle(
"Both ECL - TOP_TOP timing difference (2ns)");
287 if (m_histLevel > 2) {
293 h_gdl_top_rvc_vs_top_timing[iskim] =
new TH2I(Form(
"h_gdl_top_rvc_vs_top_timing_%s", skim_smap[iskim].c_str()),
294 "ALL GDL TOP rvc vs GDL TOP timing (7.8ns)",
295 128, 0, 1280, 128, 0, 1280);
296 h_gdl_top_rvc_vs_top_timing[iskim]->GetXaxis()->SetTitle(
"TOP timing according to GDL (7.8ns)");
297 h_gdl_top_rvc_vs_top_timing[iskim]->GetYaxis()->SetTitle(
"GDL rvc((TOP decision (received))");
299 h_gdl_ecltop_rvc_diff[iskim] =
new TH1I(Form(
"h_gdl_ecltop_rvc_diff_%s", skim_smap[iskim].c_str()),
300 "ALL GDL ECL-TOP rvc difference",
302 h_gdl_ecltop_rvc_diff[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP rvc difference (clks)");
304 h_gdl_cdctop_rvc_diff[iskim] =
new TH1I(Form(
"h_gdl_cdctop_rvc_diff_%s", skim_smap[iskim].c_str()),
305 "ALL GDL CDC-TOP rvc difference",
307 h_gdl_cdctop_rvc_diff[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL CDC-TOP rvc difference (clks)");
311 h_gdl_gdltop_rvc_diff_all[iskim] =
new TH1I(Form(
"h_gdl_gdltop_rvc_diff_%s", skim_smap[iskim].c_str()),
312 "ALL GDL GDL-TOP rvc difference",
314 h_gdl_gdltop_rvc_diff_all[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL GDL-TOP rvc difference (clks)");
316 h_gdl_comtop_rvc_diff_all[iskim] =
new TH1I(Form(
"h_gdl_comtop_rvc_diff_%s", skim_smap[iskim].c_str()),
317 "ALL GDL COM-TOP rvc difference",
319 h_gdl_comtop_rvc_diff_all[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL COM-TOP rvc difference (clks)");
323 h_topRvcDiff1All[iskim] =
new TH1I(Form(
"h_top_rvc_diff_1_%s", skim_smap[iskim].c_str()),
"ALL rvc(posted to GDL)-rvc(TOP(this))",
325 h_topRvcDiff1All[iskim]->GetXaxis()->SetTitle(
"rvc(posted to GDL)-rvc(TOP(this))");
327 h_topRvcDiff2All[iskim] =
new TH1I(Form(
"h_top_rvc_diff_2_%s", skim_smap[iskim].c_str()),
"ALL rvc(TOP(this))-rvc(TOP(prev))",
329 h_topRvcDiff2All[iskim]->GetXaxis()->SetTitle(
"rvc(TOP(this))-rvc(TOP(prev))");
331 h_topRvcDiff3All[iskim] =
new TH1I(Form(
"h_top_rvc_diff_3_%s", skim_smap[iskim].c_str()),
"ALL rvc(CB(window))-rvc(TOP(this))",
333 h_topRvcDiff3All[iskim]->GetXaxis()->SetTitle(
"rvc(CB(window))-rvc(TOP(this))");
335 h_topRvcDiff4All[iskim] =
new TH1I(Form(
"h_top_rvc_diff_4_%s", skim_smap[iskim].c_str()),
336 "ALL rvc(received L1 from GDL)-rvc(TOP(this))",
338 h_topRvcDiff4All[iskim]->GetXaxis()->SetTitle(
"rvc(L1)-rvc(TOP(this))");
342 h_topGdlRvcDiff1All[iskim] =
new TH1I(Form(
"h_gdl_top_l1_rvc_diff_%s", skim_smap[iskim].c_str()),
343 "ALL rvc(L1(GDL))-rvc(L1(as reported to TOP))",
345 h_topGdlRvcDiff1All[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(L1(as reported to TOP))");
347 h_topGdlRvcDiff2All[iskim] =
new TH1I(Form(
"h_gdl_l1_top_t0_this_rvc_diff_%s", skim_smap[iskim].c_str()),
348 "ALL rvc(TOP(received by GDL))-rvc(TOP(this))",
350 h_topGdlRvcDiff2All[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(TOP(this))");
352 h_topGdlRvcDiff3All[iskim] =
new TH1I(Form(
"h_gdl_l1_top_t0_prev_rvc_diff_%s", skim_smap[iskim].c_str()),
353 "ALL rvc(TOP(received by GDL))-rvc(TOP(prev))",
355 h_topGdlRvcDiff3All[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(TOP(prev))");
359 h_decisionNumberVsNumberDecisionsGood[iskim] =
new TH2I(Form(
"h_decision_vs_n_decisions_good_%s", skim_smap[iskim].c_str()),
360 "Good decision number vs N of decisions", 5, 0,
362 h_decisionNumberVsNumberDecisionsGood[iskim]->GetXaxis()->SetTitle(
"N decisions");
363 h_decisionNumberVsNumberDecisionsGood[iskim]->GetYaxis()->SetTitle(
"Decision number");
367 h_ecl_gdl_top_timing_diff_good[iskim] =
new TH1I(Form(
"h_ecl_gdl_top_timing_diff_good_%s", skim_smap[iskim].c_str()),
"", 400,
369 h_ecl_gdl_top_timing_diff_good[iskim]->GetXaxis()->SetTitle(
"Good ECL - GDL_TOP timing difference (2ns)");
371 h_ecl_top_top_timing_diff_good[iskim] =
new TH1I(Form(
"h_ecl_top_top_timing_diff_good_%s", skim_smap[iskim].c_str()),
"", 400,
373 h_ecl_top_top_timing_diff_good[iskim]->GetXaxis()->SetTitle(
"Good ECL - TOP_TOP timing difference (2ns)");
377 h_gdl_ecltop_timing_diff_vs_toptop_good[iskim] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_toptop_good_%s",
378 skim_smap[iskim].c_str()),
379 "GOOD TOP-TOP vs (GDL ECL)-(GDL TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
380 h_gdl_ecltop_timing_diff_vs_toptop_good[iskim]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP) t0 difference (ns, 100ns bins)");
381 h_gdl_ecltop_timing_diff_vs_toptop_good[iskim]->GetYaxis()->SetTitle(
"TOP timing (TOP) - TOP timing (GDL) (ns, 100ns bins)");
383 h_top_ecltop_timing_diff_vs_toptop_good[iskim] =
new TH2I(Form(
"h_top_ecltop_timing_diff_vs_toptop_good_%s",
384 skim_smap[iskim].c_str()),
385 "GOOD TOP-TOP vs (GDL ECL)-(TOP TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
386 h_top_ecltop_timing_diff_vs_toptop_good[iskim]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
387 h_top_ecltop_timing_diff_vs_toptop_good[iskim]->GetYaxis()->SetTitle(
"TOP timing (TOP) - TOP timing (GDL) (ns, 100ns bins)");
389 h_gdl_ecltop_timing_diff_vs_ecltop_good[iskim] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_ecltop_good_%s",
390 skim_smap[iskim].c_str()),
391 "GOOD (GDL ECL)-(TOP TOP) vs (GDL ECL)-(GDL TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
392 h_gdl_ecltop_timing_diff_vs_ecltop_good[iskim]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP) t0 difference (ns, 100ns bins)");
393 h_gdl_ecltop_timing_diff_vs_ecltop_good[iskim]->GetYaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
397 h_gdl_gdltop_rvc_diff_good[iskim] =
new TH1I(Form(
"h_gdl_gdltop_rvc_diff_good_%s", skim_smap[iskim].c_str()),
398 "GOOD GDL GDL-TOP rvc difference",
400 h_gdl_gdltop_rvc_diff_good[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL GDL-TOP rvc difference (clks)");
402 h_gdl_comtop_rvc_diff_good[iskim] =
new TH1I(Form(
"h_gdl_comtop_rvc_diff_good_%s", skim_smap[iskim].c_str()),
403 "GOOD GDL COM-TOP rvc difference",
405 h_gdl_comtop_rvc_diff_good[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL COM-TOP rvc difference (clks)");
409 h_topCombinedTimingTopGood[iskim] =
new TH1I(Form(
"h_t0_good_%s", skim_smap[iskim].c_str()),
"GOOD TOP combined t0 decision", 100,
412 h_topCombinedTimingTopGood[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions");
414 h_topNSlotsCombinedTimingTopGood[iskim] =
new TH1I(Form(
"h_n_slots_good_%s", skim_smap[iskim].c_str()),
415 "GOOD TOP combined t0 decision: N slots", 17, 0, 17);
416 h_topNSlotsCombinedTimingTopGood[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N slots");
418 h_topNHitSumGood[iskim] =
new TH1I(Form(
"h_n_hit_per_slot_good_%s", skim_smap[iskim].c_str()),
419 "GOOD TOP combined t0 decision: N hit per slot", 200, 0, 200);
420 h_topNHitSumGood[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N hits per slot");
422 h_topLogLSumGood[iskim] =
new TH1I(Form(
"h_logl_per_slot_good_%s", skim_smap[iskim].c_str()),
423 "GOOD TOP combined t0 decision: log L per slot", 100, 0, 60000);
424 h_topLogLSumGood[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: log L per slot");
428 h_topRvcDiff1Good[iskim] =
new TH1I(Form(
"h_rvc_diff_1_good_%s", skim_smap[iskim].c_str()),
429 "GOOD rvc(posted to GDL)-rvc(TOP(this))",
431 h_topRvcDiff1Good[iskim]->GetXaxis()->SetTitle(
"rvc(posted to GDL)-rvc(TOP(this))");
433 h_topRvcDiff2Good[iskim] =
new TH1I(Form(
"h_rvc_diff_2_good_%s", skim_smap[iskim].c_str()),
"GOOD rvc(TOP(this))-rvc(TOP(prev))",
435 h_topRvcDiff2Good[iskim]->GetXaxis()->SetTitle(
"rvc(TOP(this))-rvc(TOP(prev))");
437 h_topRvcDiff3Good[iskim] =
new TH1I(Form(
"h_rvc_diff_3_good_%s", skim_smap[iskim].c_str()),
"GOOD rvc(CB(window))-rvc(TOP(this))",
439 h_topRvcDiff3Good[iskim]->GetXaxis()->SetTitle(
"rvc(CB(window))-rvc(TOP(this))");
441 h_topRvcDiff4Good[iskim] =
new TH1I(Form(
"h_rvc_diff_4_good_%s", skim_smap[iskim].c_str()),
442 "GOOD rvc(received L1 from GDL)-rvc(TOP(this))",
444 h_topRvcDiff4Good[iskim]->GetXaxis()->SetTitle(
"rvc(L1)-rvc(TOP(this))");
448 h_topGdlRvcDiff1Good[iskim] =
new TH1I(Form(
"h_gdl_top_l1_rvc_diff_good_%s", skim_smap[iskim].c_str()),
449 "GOOD rvc(L1(GDL))-rvc(L1(as reported to TOP))",
451 h_topGdlRvcDiff1Good[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(L1(as reported to TOP))");
453 h_topGdlRvcDiff2Good[iskim] =
new TH1I(Form(
"h_gdl_l1_top_t0_this_rvc_diff_good_%s", skim_smap[iskim].c_str()),
454 "GOOD rvc(TOP(received by GDL))-rvc(TOP(this))",
456 h_topGdlRvcDiff2Good[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(TOP(this))");
458 h_topGdlRvcDiff3Good[iskim] =
new TH1I(Form(
"h_gdl_l1_top_t0_prev_rvc_diff_good_%s", skim_smap[iskim].c_str()),
459 "GOOD rvc(TOP(received by GDL))-rvc(TOP(prev))",
461 h_topGdlRvcDiff3Good[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(TOP(prev))");
465 h_decisionNumberVsNumberDecisionsBad[iskim] =
new TH2I(Form(
"h_decision_vs_n_decisions_bad_%s", skim_smap[iskim].c_str()),
466 "Bad decision number vs N of decisions", 5, 0, 5,
468 h_decisionNumberVsNumberDecisionsBad[iskim]->GetXaxis()->SetTitle(
"N decisions");
469 h_decisionNumberVsNumberDecisionsBad[iskim]->GetYaxis()->SetTitle(
"Decision number");
473 h_ecl_gdl_top_timing_diff_bad[iskim] =
new TH1I(Form(
"h_ecl_gdl_top_timing_diff_bad_%s", skim_smap[iskim].c_str()),
"", 400, 1400,
475 h_ecl_gdl_top_timing_diff_bad[iskim]->GetXaxis()->SetTitle(
"Bad ECL - GDL_TOP timing difference (2ns)");
477 h_ecl_top_top_timing_diff_bad[iskim] =
new TH1I(Form(
"h_ecl_top_top_timing_diff_bad_%s", skim_smap[iskim].c_str()),
"", 400, 1400,
479 h_ecl_top_top_timing_diff_bad[iskim]->GetXaxis()->SetTitle(
"Bad ECL - TOP_TOP timing difference (2ns)");
483 h_gdl_ecltop_timing_diff_vs_toptop_bad[iskim] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_toptop_bad_%s",
484 skim_smap[iskim].c_str()),
485 "BAD TOP-TOP vs (GDL ECL)-(GDL TOP) t0 differences", 110, -760, 10240, 110, -760, 10240);
486 h_gdl_ecltop_timing_diff_vs_toptop_bad[iskim]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP) (combined) t0 difference (ns, 100ns bins)");
487 h_gdl_ecltop_timing_diff_vs_toptop_bad[iskim]->GetYaxis()->SetTitle(
"TOP timing (TOP) - TOP timing (GDL) (ns, 100ns bins)");
489 h_top_ecltop_timing_diff_vs_toptop_bad[iskim] =
new TH2I(Form(
"h_top_ecltop_timing_diff_vs_toptop_bad_%s",
490 skim_smap[iskim].c_str()),
491 "BAD TOP-TOP vs (GDL ECL)-(TOP TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
492 h_top_ecltop_timing_diff_vs_toptop_bad[iskim]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
493 h_top_ecltop_timing_diff_vs_toptop_bad[iskim]->GetYaxis()->SetTitle(
"TOP timing (TOP) - TOP timing (GDL) (ns, 100ns bins)");
495 h_gdl_ecltop_timing_diff_vs_ecltop_bad[iskim] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_ecltop_bad_%s",
496 skim_smap[iskim].c_str()),
497 "BAD (GDL ECL)-(TOP TOP) vs (GDL ECL)-(GDL TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
498 h_gdl_ecltop_timing_diff_vs_ecltop_bad[iskim]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP) t0 difference (ns, 100ns bins)");
499 h_gdl_ecltop_timing_diff_vs_ecltop_bad[iskim]->GetYaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
503 h_gdl_gdltop_rvc_diff_bad[iskim] =
new TH1I(Form(
"h_gdl_gdltop_rvc_diff_bad_%s", skim_smap[iskim].c_str()),
504 "BAD GDL GDL-TOP rvc difference",
506 h_gdl_gdltop_rvc_diff_bad[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL GDL-TOP rvc difference (clks)");
508 h_gdl_comtop_rvc_diff_bad[iskim] =
new TH1I(Form(
"h_gdl_comtop_rvc_diff_bad_%s", skim_smap[iskim].c_str()),
509 "BAD GDL COM-TOP rvc difference",
511 h_gdl_comtop_rvc_diff_bad[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL COM-TOP rvc difference (clks)");
515 h_topCombinedTimingTopBad[iskim] =
new TH1I(Form(
"h_t0_bad_%s", skim_smap[iskim].c_str()),
"BAD TOP combined t0 decision", 100, 0,
517 h_topCombinedTimingTopBad[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions");
519 h_topNSlotsCombinedTimingTopBad[iskim] =
new TH1I(Form(
"h_N_slots_bad_%s", skim_smap[iskim].c_str()),
520 "BAD TOP combined t0 decision: N slots", 17, 0, 17);
521 h_topNSlotsCombinedTimingTopBad[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N slots");
523 h_topNHitSumBad[iskim] =
new TH1I(Form(
"h_n_hit_per_slot_bad_%s", skim_smap[iskim].c_str()),
524 "BAD TOP combined t0 decision: N hit per slot", 200, 0, 200);
525 h_topNHitSumBad[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N hits per slot");
527 h_topLogLSumBad[iskim] =
new TH1I(Form(
"h_logl_per_slot_bad_%s", skim_smap[iskim].c_str()),
528 "BAD TOP combined t0 decision: log L per slot", 100, 0, 60000);
529 h_topLogLSumBad[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: log L per slot");
533 h_topRvcDiff1Bad[iskim] =
new TH1I(Form(
"h_rvc_diff_1_bad_%s", skim_smap[iskim].c_str()),
"BAD rvc(posted to GDL)-rvc(TOP(this))",
536 h_topRvcDiff1Bad[iskim]->GetXaxis()->SetTitle(
"rvc(posted to GDL)-rvc(TOP(this))");
538 h_topRvcDiff2Bad[iskim] =
new TH1I(Form(
"h_rvc_diff_2_bad_%s", skim_smap[iskim].c_str()),
"BAD rvc(TOP(this))-rvc(TOP(prev))",
540 h_topRvcDiff2Bad[iskim]->GetXaxis()->SetTitle(
"rvc(TOP(this))-rvc(TOP(prev))");
542 h_topRvcDiff3Bad[iskim] =
new TH1I(Form(
"h_rvc_diff_3_bad_%s", skim_smap[iskim].c_str()),
"BAD rvc(CB(window))-rvc(TOP(this))",
544 h_topRvcDiff3Bad[iskim]->GetXaxis()->SetTitle(
"rvc(CB(window))-rvc(TOP(this))");
546 h_topRvcDiff4Bad[iskim] =
new TH1I(Form(
"h_rvc_diff_4_bad_%s", skim_smap[iskim].c_str()),
547 "BAD rvc(received L1 from GDL)-rvc(TOP(this))",
549 h_topRvcDiff4Bad[iskim]->GetXaxis()->SetTitle(
"rvc(L1)-rvc(TOP(this))");
553 h_topGdlRvcDiff1Bad[iskim] =
new TH1I(Form(
"h_gdl_top_l1_rvc_diff_bad_%s", skim_smap[iskim].c_str()),
554 "BAD rvc(L1(GDL))-rvc(L1(as reported to TOP))",
556 h_topGdlRvcDiff1Bad[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(L1(as reported to TOP))");
558 h_topGdlRvcDiff2Bad[iskim] =
new TH1I(Form(
"h_gdl_l1_top_t0_this_rvc_diff_bad_%s", skim_smap[iskim].c_str()),
559 "BAD rvc(TOP(received by GDL))-rvc(TOP(this))",
561 h_topGdlRvcDiff2Bad[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(TOP(this))");
563 h_topGdlRvcDiff3Bad[iskim] =
new TH1I(Form(
"h_gdl_l1_top_t0_prev_rvc_diff_bad_%s", skim_smap[iskim].c_str()),
564 "BAD rvc(TOP(received by GDL))-rvc(TOP(prev))",
566 h_topGdlRvcDiff3Bad[iskim]->GetXaxis()->SetTitle(
"rvc(L1(GDL))-rvc(TOP(prev))");
571 h_top_nt0decisions_vs_hist_class[iskim] =
new TH2I(Form(
"h_top_nt0decisions_vs_hist_class_%s", skim_smap[iskim].c_str()),
572 "N t0 decisions vs event class according to TOP info matching between GDL and TOP",
574 h_top_nt0decisions_vs_hist_class[iskim]->GetXaxis()->SetTitle(
"TOP info match (GDL vs TOP): 0/1/2 : first decision match/no match/match in some other decision");
575 h_top_nt0decisions_vs_hist_class[iskim]->GetYaxis()->SetTitle(
"Number of t0 decisions");
577 h_top_gdl_match_decision_number[iskim] =
new TH1I(Form(
"h_top_gdl_match_decision_number_%s", skim_smap[iskim].c_str()),
578 "Decision number where TOP info is the same at TOP and GDL",
580 h_top_gdl_match_decision_number[iskim]->GetXaxis()->SetTitle(
"TOPTRG combined decision # where TOP info is the same at TOP and GDL");
582 h_gdl_ecltop_timing_diff_5ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_5ns_%s", skim_smap[iskim].c_str()),
583 "GDL ECL-TOP t0 difference", 248, 0, 10240);
584 h_gdl_ecltop_timing_diff_5ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference (5ns)");
586 h_gdl_cdctop_timing_diff_5ns[iskim] =
new TH1I(Form(
"h_gdl_cdctop_timing_diff_5ns_%s", skim_smap[iskim].c_str()),
587 "GDL CDC-TOP t0 difference", 248, 0, 10240);
588 h_gdl_cdctop_timing_diff_5ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL CDC-TOP t0 difference (5ns)");
592 h_gdl_ecltop_timing_diff_2ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_2ns_%s", skim_smap[iskim].c_str()),
593 "GDL ECL-TOP t0 difference", 400, 1400, 2200);
594 h_gdl_ecltop_timing_diff_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference (2ns)");
596 h_gdl_ecltop_timing_diff_grl_matched_2ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_grl_matched_2ns_%s",
597 skim_smap[iskim].c_str()),
598 "GDL ECL-TOP t0 difference", 400, 1400, 2200);
599 h_gdl_ecltop_timing_diff_grl_matched_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference when TOP and GRL match (2ns)");
601 h_gdl_ecltop_timing_diff_no_grl_matched_2ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_no_grl_matched_2ns_%s",
602 skim_smap[iskim].c_str()),
603 "GDL ECL-TOP t0 difference", 400, 1400, 2200);
604 h_gdl_ecltop_timing_diff_no_grl_matched_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference when TOP and GRL do not match (2ns)");
606 h_gdl_ecltop_timing_diff_no_grl_at_all_2ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_no_grl_at_all_2ns_%s",
607 skim_smap[iskim].c_str()),
608 "GDL ECL-TOP t0 difference", 400, 1400, 2200);
609 h_gdl_ecltop_timing_diff_no_grl_at_all_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference when GRL has no 2D tracks (2ns)");
611 h_gdl_ecltop_timing_diff_vs_nslots_2ns[iskim] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_nslots_2ns_%s",
612 skim_smap[iskim].c_str()),
613 "GDL N slots vs ECL-TOP t0 difference", 400, 1400, 2200, 16, 1, 17);
614 h_gdl_ecltop_timing_diff_vs_nslots_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference (2ns)");
615 h_gdl_ecltop_timing_diff_vs_nslots_2ns[iskim]->GetYaxis()->SetTitle(
"N slots in combined decision");
617 h_top_ecltop_timing_diff_combined_2ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_combined_2ns_%s", skim_smap[iskim].c_str()),
618 "GDL ECL-TOP TOP t0 difference", 400, 1400, 2200);
619 h_top_ecltop_timing_diff_combined_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference (2ns)");
621 h_top_ecltop_timing_diff_best_slot_2ns[iskim] =
new TH1I(Form(
"h_gdl_ecltop_timing_diff_best_slot_2ns_%s",
622 skim_smap[iskim].c_str()),
623 "GDL ECL-TOP TOP t0 difference using slot with max N hits", 400, 1400, 2200);
624 h_top_ecltop_timing_diff_best_slot_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL ECL-TOP t0 difference (2ns)");
626 h_gdl_cdctop_timing_diff_2ns[iskim] =
new TH1I(Form(
"h_gdl_cdctop_timing_diff_2ns_%s", skim_smap[iskim].c_str()),
627 "GDL CDC-TOP t0 difference", 250, 0, 500);
628 h_gdl_cdctop_timing_diff_2ns[iskim]->GetXaxis()->SetTitle(
"TOPTRG GDL CDC-TOP t0 difference (2ns)");
632 for (
int histClass = 0; histClass < m_nHistClassesActual; histClass++) {
635 h_N_decision[iskim][histClass] =
new TH1I(Form(
"h_N_decisions_%d_%s", histClass, skim_smap[iskim].c_str()),
636 "N t0 decisions in 1 us before GDL L1", 5, 1,
638 h_N_decision[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG N combined t0 decisions");
642 h_topNHitVsNhit[iskim][histClass] =
new TH2I(Form(
"h_nhit_vs_nhit_first_decision_%d_%s", histClass, skim_smap[iskim].c_str()),
643 "First decision: N hits vs N hits", 20, 0, 100, 20, 0, 100);
644 h_topNHitVsNhit[iskim][histClass]->GetXaxis()->SetTitle(
"N hits for slot with largest N hits");
645 h_topNHitVsNhit[iskim][histClass]->GetYaxis()->SetTitle(
"N hits for slot with next to the largest N hits");
647 h_topSlotVsSlot[iskim][histClass] =
new TH2I(Form(
"h_slot_vs_slot_first_decision_%d_%s", histClass, skim_smap[iskim].c_str()),
648 "First decision: slot # vs slot #", 16, 1, 17, 16, 1, 17);
649 h_topSlotVsSlot[iskim][histClass]->GetXaxis()->SetTitle(
"Slot # for slot with largest N hits");
650 h_topSlotVsSlot[iskim][histClass]->GetYaxis()->SetTitle(
"Slot # for slot with next to the largest N hits");
652 h_topT0VsT0[iskim][histClass] =
new TH2I(Form(
"h_t0_vs_t0_first_decision_%d_%s", histClass, skim_smap[iskim].c_str()),
653 "First decision: T0 vs T0", 100, 0, 100000, 100, 0, 100000);
654 h_topT0VsT0[iskim][histClass]->GetXaxis()->SetTitle(
"T0 for slot with largest N hits");
655 h_topT0VsT0[iskim][histClass]->GetYaxis()->SetTitle(
"T0 for slot with next to the largest N hits");
657 h_topSegmentVsSegment[iskim][histClass] =
new TH2I(Form(
"h_segment_vs_segment_first_decision_%d_%s", histClass,
658 skim_smap[iskim].c_str()),
659 "First decision: segment # vs segment #", 10, 1, 11, 10, 1, 11);
660 h_topSegmentVsSegment[iskim][histClass]->GetXaxis()->SetTitle(
"Segment # for slot with largest N hits");
661 h_topSegmentVsSegment[iskim][histClass]->GetYaxis()->SetTitle(
"Segment # for slot with next to the largest N hits");
663 h_topLogLVsLogL[iskim][histClass] =
new TH2I(Form(
"h_logl_vs_logl_first_decision_%d_%s", histClass, skim_smap[iskim].c_str()),
664 "First decision: log L vs log L", 100, 0, 60000, 100, 0, 60000);
665 h_topLogLVsLogL[iskim][histClass]->GetXaxis()->SetTitle(
"log L for slot with largest N hits");
666 h_topLogLVsLogL[iskim][histClass]->GetYaxis()->SetTitle(
"log L for slot with next to the largest N hits");
672 if (m_histLevel > 1) {
676 for (
int histClass = 0; histClass < m_nHistClassesActual; histClass++) {
678 h_topCombinedTimingTop[iskim][histClass] =
new TH1I(Form(
"h_t0_%d_%s", histClass, skim_smap[iskim].c_str()),
679 "TOP combined t0 decision", 100, 0,
681 h_topCombinedTimingTop[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions");
683 h_topNSlotsCombinedTimingTop[iskim][histClass] =
new TH1I(Form(
"h_n_slots_%d_%s", histClass, skim_smap[iskim].c_str()),
684 "TOP combined t0 decision: N slots", 17, 0, 17);
685 h_topNSlotsCombinedTimingTop[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N slots");
687 h_topNHitSum[iskim][histClass] =
new TH1I(Form(
"h_n_hit_per_slot_%d_%s", histClass, skim_smap[iskim].c_str()),
688 "TOP combined t0 decision: N hits per slot", 200, 0, 200);
689 h_topNHitSum[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N hits per slot");
691 h_topNHitBestSlot[iskim][histClass] =
new TH1I(Form(
"h_n_hit_best_slot_%d_%s", histClass, skim_smap[iskim].c_str()),
692 "TOP combined t0 decision: N hits best slot", 200, 0, 200);
693 h_topNHitBestSlot[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: N hits best slot");
700 h_topLogLSum[iskim][histClass] =
new TH1I(Form(
"h_logl_per_slot_%d_%s", histClass, skim_smap[iskim].c_str()),
701 "TOP combined t0 decision: log L per slot", 100, 0, 60000);
702 h_topLogLSum[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG combined t0 decisions: log L per slot");
706 h_gdl_ecltop_timing_diff_vs_slot_2ns[iskim][histClass] =
new TH2I(Form(
"h_gdl_slot_vs_ecltop_timing_diff_%d_%s", histClass,
707 skim_smap[iskim].c_str()),
"slot vs GDL ECL-TOP slot t0 difference", 400, 1400, 2200, 16, 1, 17);
708 h_gdl_ecltop_timing_diff_vs_slot_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
709 h_gdl_ecltop_timing_diff_vs_slot_2ns[iskim][histClass]->GetYaxis()->SetTitle(
"slot");
711 h_gdl_ecltop_timing_diff_vs_segment_2ns[iskim][histClass] =
new TH2I(Form(
"h_gdl_segment_vs_ecltop_timing_diff_%d_%s", histClass,
712 skim_smap[iskim].c_str()),
"segment vs GDL ECL-TOP slot t0 difference", 400, 1400, 2200, 10, 1, 11);
713 h_gdl_ecltop_timing_diff_vs_segment_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
714 h_gdl_ecltop_timing_diff_vs_segment_2ns[iskim][histClass]->GetYaxis()->SetTitle(
"segment");
716 h_gdl_ecltop_timing_diff_vs_nhits_2ns[iskim][histClass] =
new TH2I(Form(
"h_gdl_nhits_vs_ecltop_timing_diff_%d_%s", histClass,
717 skim_smap[iskim].c_str()),
"N hits (for slots) vs GDL ECL-TOP slot t0 difference", 400, 1400, 2200, 200, 0, 200);
718 h_gdl_ecltop_timing_diff_vs_nhits_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
719 h_gdl_ecltop_timing_diff_vs_nhits_2ns[iskim][histClass]->GetYaxis()->SetTitle(
"N hits");
721 h_gdl_ecltop_timing_diff_vs_logl_2ns[iskim][histClass] =
new TH2I(Form(
"h_gdl_logl_vs_ecltop_timing_diff_%d_%s", histClass,
722 skim_smap[iskim].c_str()),
"log L (for slots) vs GDL ECL-TOP slot t0 difference", 400, 1400, 2200, 100, 0, 60000);
723 h_gdl_ecltop_timing_diff_vs_logl_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"GDL ECL - TOP slot t0 time difference (2ns)");
724 h_gdl_ecltop_timing_diff_vs_logl_2ns[iskim][histClass]->GetYaxis()->SetTitle(
"log L");
728 h_top_ecltop_timing_combined_diff_2ns[iskim][histClass] =
new TH1I(Form(
"h_top_ecltop_timing_combined_diff_2ns_%d_%s", histClass,
729 skim_smap[iskim].c_str()),
730 "(GDL ECL)-(TOP TOP) t0 difference (combined decision)", 400, 1400, 2200);
731 h_top_ecltop_timing_combined_diff_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (2ns)");
733 h_top_ecltop_timing_best_slot_diff_2ns[iskim][histClass] =
new TH1I(Form(
"h_top_ecltop_timing_best_slot_diff_2ns_%d_%s", histClass,
734 skim_smap[iskim].c_str()),
735 "(GDL ECL)-(TOP TOP) t0 difference (best slot decision)", 400, 1400, 2200);
736 h_top_ecltop_timing_best_slot_diff_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (2ns)");
738 h_gdl_ecltop_timing_diff_vs_toptop[iskim][histClass] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_toptop_%d_%s", histClass,
739 skim_smap[iskim].c_str()),
740 "TOP-TOP vs (GDL ECL)-(GDL TOP) t0 differences", 110, -760, 10240, 110, -760, 10240);
741 h_gdl_ecltop_timing_diff_vs_toptop[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP) (combined) t0 difference (ns, 100ns bins)");
742 h_gdl_ecltop_timing_diff_vs_toptop[iskim][histClass]->GetYaxis()->SetTitle(
"TOP timing (TOP) - TOP timing (GDL) (ns, 100ns bins)");
744 h_top_ecltop_timing_diff_vs_toptop[iskim][histClass] =
new TH2I(Form(
"h_top_ecltop_timing_diff_vs_toptop_%d_%s", histClass,
745 skim_smap[iskim].c_str()),
746 "TOP-TOP vs (GDL ECL)-(TOP TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
747 h_top_ecltop_timing_diff_vs_toptop[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
748 h_top_ecltop_timing_diff_vs_toptop[iskim][histClass]->GetYaxis()->SetTitle(
"TOP timing (TOP) - TOP timing (GDL) (ns, 100ns bins)");
750 h_gdl_ecltop_timing_diff_vs_ecltop[iskim][histClass] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_ecltop_%d_%s", histClass,
751 skim_smap[iskim].c_str()),
752 "(GDL ECL)-(TOP TOP) vs (GDL ECL)-(GDL TOP) (combined) t0 differences", 110, -760, 10240, 110, -760, 10240);
753 h_gdl_ecltop_timing_diff_vs_ecltop[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP) t0 difference (ns, 100ns bins)");
754 h_gdl_ecltop_timing_diff_vs_ecltop[iskim][histClass]->GetYaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
756 h_gdl_ecltop_timing_diff_vs_ecltop_best_slot[iskim][histClass] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_ecltop_best_slot_%d_%s",
757 histClass, skim_smap[iskim].c_str()),
758 "(GDL ECL)-(TOP TOP) vs (GDL ECL)-(GDL TOP) (best slot) t0 differences", 110, -760, 10240, 110, -760, 10240);
759 h_gdl_ecltop_timing_diff_vs_ecltop_best_slot[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(GDL TOP() best slot) t0 difference (ns, 100ns bins)");
760 h_gdl_ecltop_timing_diff_vs_ecltop_best_slot[iskim][histClass]->GetYaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (ns, 100ns bins)");
762 h_top_ecltop_timing_diff_2ns[iskim][histClass] =
new TH1I(Form(
"h_top_ecltop_timing_diff_2ns_%d_%s", histClass,
763 skim_smap[iskim].c_str()),
764 "(GDL ECL)-(TOP TOP) t0 difference (all decisions)", 400, 1400, 2200);
765 h_top_ecltop_timing_diff_2ns[iskim][histClass]->GetXaxis()->SetTitle(
"TOPTRG (GDL ECL)-(TOP TOP) t0 difference (2ns)");
772 h_topTC2IdVsTC1IdAll[iskim] =
new TH2I(Form(
"h_top_tc2id_vs_tc1id_%s", skim_smap[iskim].c_str()),
773 "Sorted (by energy) TC2 Id vs TC1 Id", 100, 0, 600, 100, 0, 600);
774 h_topTC2IdVsTC1IdAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC id");
775 h_topTC2IdVsTC1IdAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC id");
777 h_topTC2EnergyVsTC1EnergyAll[iskim] =
new TH2I(Form(
"h_top_tc2en_vs_tc1en_%s", skim_smap[iskim].c_str()),
778 "Sorted TC2 energy vs TC1 energy", 100, 0, 1000, 100, 0, 1000);
779 h_topTC2EnergyVsTC1EnergyAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC energy");
780 h_topTC2EnergyVsTC1EnergyAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC energy");
782 h_topTC2ThetaIdVsTC1ThetaIdAll[iskim] =
new TH2I(Form(
"h_top_tc2thetaid_vs_tc1thetaid_%s", skim_smap[iskim].c_str()),
783 "Sorted by energy TC2 vs TC1 theta ids", 20, 0, 20,
785 h_topTC2ThetaIdVsTC1ThetaIdAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC theta id");
786 h_topTC2ThetaIdVsTC1ThetaIdAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC theta id");
788 h_topTC2PhiIdVsTC1PhiIdAll[iskim] =
new TH2I(Form(
"h_top_tc2phiid_vs_tc1phiid_%s", skim_smap[iskim].c_str()),
789 "Sorted by energy TC2 vs TC1 phi ids", 36, 1, 37, 36, 1,
791 h_topTC2PhiIdVsTC1PhiIdAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC phi id");
792 h_topTC2PhiIdVsTC1PhiIdAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC phi id");
794 h_topTCPhiIdVsTCThetaIdAll[iskim] =
new TH3I(Form(
"h_top_tcphiid_vs_tcthetaid_%s", skim_smap[iskim].c_str()),
795 "Sorted by energy TC2 vs TC1 theta vs phi ids", 20, 0, 20,
797 h_topTCPhiIdVsTCThetaIdAll[iskim]->GetXaxis()->SetTitle(
"Most and next to most energetic TCs theta ids");
798 h_topTCPhiIdVsTCThetaIdAll[iskim]->GetYaxis()->SetTitle(
"Most and next to most energetic TCs phi ids");
799 h_topTCPhiIdVsTCThetaIdAll[iskim]->GetZaxis()->SetTitle(
"Most and next to most energetic TCs");
803 h_topTC2IdVsTC1IdGRLAll[iskim] =
new TH2I(Form(
"h_top_tc2id_vs_tc1id_grl_%s", skim_smap[iskim].c_str()),
804 "Sorted (by energy) TC2 Id vs TC1 Id", 100, 0, 600, 100, 0, 600);
805 h_topTC2IdVsTC1IdGRLAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC id");
806 h_topTC2IdVsTC1IdGRLAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC id");
808 h_topTC2EnergyVsTC1EnergyGRLAll[iskim] =
new TH2I(Form(
"h_top_tc2en_vs_tc1en_grl_%s", skim_smap[iskim].c_str()),
809 "Sorted TC2 energy vs TC1 energy", 100, 0, 1000, 100, 0,
811 h_topTC2EnergyVsTC1EnergyGRLAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC energy");
812 h_topTC2EnergyVsTC1EnergyGRLAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC energy");
814 h_topTC2ThetaIdVsTC1ThetaIdGRLAll[iskim] =
new TH2I(Form(
"h_top_tc2thetaid_vs_tc1thetaid_grl_%s", skim_smap[iskim].c_str()),
815 "Sorted by energy TC2 vs TC1 theta ids", 20,
817 h_topTC2ThetaIdVsTC1ThetaIdGRLAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC theta id");
818 h_topTC2ThetaIdVsTC1ThetaIdGRLAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC theta id");
820 h_topTC2PhiIdVsTC1PhiIdGRLAll[iskim] =
new TH2I(Form(
"h_top_tc2phiid_vs_tc1phiid_grl_%s", skim_smap[iskim].c_str()),
821 "Sorted by energy TC2 vs TC1 phi ids", 36, 1, 37, 36,
823 h_topTC2PhiIdVsTC1PhiIdGRLAll[iskim]->GetXaxis()->SetTitle(
"Most energetic TC phi id");
824 h_topTC2PhiIdVsTC1PhiIdGRLAll[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC phi id");
826 h_topTCPhiIdVsTCThetaIdGRLAll[iskim] =
new TH3I(Form(
"h_top_tcphiid_vs_tcthetaid_grl_%s", skim_smap[iskim].c_str()),
827 "Sorted by energy TC2 vs TC1 theta vs phi ids", 20,
828 0, 20, 36, 1, 37, 2, 0, 2);
829 h_topTCPhiIdVsTCThetaIdGRLAll[iskim]->GetXaxis()->SetTitle(
"Most and next to most energetic TCs theta ids");
830 h_topTCPhiIdVsTCThetaIdGRLAll[iskim]->GetYaxis()->SetTitle(
"Most and next to most energetic TCs phi ids");
831 h_topTCPhiIdVsTCThetaIdGRLAll[iskim]->GetZaxis()->SetTitle(
"Most and next to most energetic TCs");
835 h_topTC2IdVsTC1Id[iskim] =
new TH2I(Form(
"h_top_tc2id_vs_tc1id_b2b_%s", skim_smap[iskim].c_str()),
836 "Sorted (by energy) TC2 Id vs TC1 Id", 100, 0, 600, 100, 0, 600);
837 h_topTC2IdVsTC1Id[iskim]->GetXaxis()->SetTitle(
"Most energetic TC id");
838 h_topTC2IdVsTC1Id[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC id");
840 h_topTC2EnergyVsTC1Energy[iskim] =
new TH2I(Form(
"h_top_tc2en_vs_tc1en_b2b_%s", skim_smap[iskim].c_str()),
841 "Sorted TC2 energy vs TC1 energy", 100, 0, 1000, 100, 0, 1000);
842 h_topTC2EnergyVsTC1Energy[iskim]->GetXaxis()->SetTitle(
"Most energetic TC energy");
843 h_topTC2EnergyVsTC1Energy[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC energy");
845 h_topTC2ThetaIdVsTC1ThetaId[iskim] =
new TH2I(Form(
"h_top_tc2thetaid_vs_tc1thetaid_b2b_%s", skim_smap[iskim].c_str()),
846 "Sorted by energy TC2 vs TC1 theta ids", 20, 0, 20, 20, 0,
848 h_topTC2ThetaIdVsTC1ThetaId[iskim]->GetXaxis()->SetTitle(
"Most energetic TC theta id");
849 h_topTC2ThetaIdVsTC1ThetaId[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC theta id");
851 h_topTC2PhiIdVsTC1PhiId[iskim] =
new TH2I(Form(
"h_top_tc2phiid_vs_tc1phiid_b2b_%s", skim_smap[iskim].c_str()),
852 "Sorted by energy TC2 vs TC1 phi ids", 36, 1, 37, 36, 1, 37);
853 h_topTC2PhiIdVsTC1PhiId[iskim]->GetXaxis()->SetTitle(
"Most energetic TC phi id");
854 h_topTC2PhiIdVsTC1PhiId[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC phi id");
856 h_topTCPhiIdVsTCThetaId[iskim] =
new TH3I(Form(
"h_top_tcphiid_vs_tcthetaid_b2b_%s", skim_smap[iskim].c_str()),
857 "Sorted by energy TC2 vs TC1 theta vs phi ids", 20, 0, 20, 36, 1,
859 h_topTCPhiIdVsTCThetaId[iskim]->GetXaxis()->SetTitle(
"Most and next to most energetic TCs theta ids");
860 h_topTCPhiIdVsTCThetaId[iskim]->GetYaxis()->SetTitle(
"Most and next to most energetic TCs phi ids");
861 h_topTCPhiIdVsTCThetaId[iskim]->GetZaxis()->SetTitle(
"Most and next to most energetic TCs");
865 h_topTC2IdVsTC1IdGRL[iskim] =
new TH2I(Form(
"h_top_tc2id_vs_tc1id_grl_b2b_%s", skim_smap[iskim].c_str()),
866 "Sorted (by energy) TC2 Id vs TC1 Id", 100, 0, 600, 100, 0, 600);
867 h_topTC2IdVsTC1IdGRL[iskim]->GetXaxis()->SetTitle(
"Most energetic TC id");
868 h_topTC2IdVsTC1IdGRL[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC id");
870 h_topTC2EnergyVsTC1EnergyGRL[iskim] =
new TH2I(Form(
"h_top_tc2en_vs_tc1en_grl_b2b_%s", skim_smap[iskim].c_str()),
871 "Sorted TC2 energy vs TC1 energy", 100, 0, 1000, 100, 0, 1000);
872 h_topTC2EnergyVsTC1EnergyGRL[iskim]->GetXaxis()->SetTitle(
"Most energetic TC energy");
873 h_topTC2EnergyVsTC1EnergyGRL[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC energy");
875 h_topTC2ThetaIdVsTC1ThetaIdGRL[iskim] =
new TH2I(Form(
"h_top_tc2thetaid_vs_tc1thetaid_grl_b2b_%s", skim_smap[iskim].c_str()),
876 "Sorted by energy TC2 vs TC1 theta ids", 20, 0, 20,
878 h_topTC2ThetaIdVsTC1ThetaIdGRL[iskim]->GetXaxis()->SetTitle(
"Most energetic TC theta id");
879 h_topTC2ThetaIdVsTC1ThetaIdGRL[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC theta id");
881 h_topTC2PhiIdVsTC1PhiIdGRL[iskim] =
new TH2I(Form(
"h_top_tc2phiid_vs_tc1phiid_grl_b2b_%s", skim_smap[iskim].c_str()),
882 "Sorted by energy TC2 vs TC1 phi ids", 36, 1, 37, 36, 1,
884 h_topTC2PhiIdVsTC1PhiIdGRL[iskim]->GetXaxis()->SetTitle(
"Most energetic TC phi id");
885 h_topTC2PhiIdVsTC1PhiIdGRL[iskim]->GetYaxis()->SetTitle(
"Next to most energetic TC phi id");
887 h_topTCPhiIdVsTCThetaIdGRL[iskim] =
new TH3I(Form(
"h_top_tcphiid_vs_tcthetaid_grl_b2b_%s", skim_smap[iskim].c_str()),
888 "Sorted by energy TC2 vs TC1 theta vs phi ids", 20, 0, 20,
890 h_topTCPhiIdVsTCThetaIdGRL[iskim]->GetXaxis()->SetTitle(
"Most and next to most energetic TCs theta ids");
891 h_topTCPhiIdVsTCThetaIdGRL[iskim]->GetYaxis()->SetTitle(
"Most and next to most energetic TCs phi ids");
892 h_topTCPhiIdVsTCThetaIdGRL[iskim]->GetZaxis()->SetTitle(
"Most and next to most energetic TCs");
896 h_gdl_ecltop_timing_diff_vs_grl_top_l1[iskim] =
new TH2I(Form(
"h_gdl_ecltop_timing_diff_vs_grl_top_l1_%s",
897 skim_smap[iskim].c_str()),
898 "(GDL ECL)-(GDL TOP) vs GRL TOP rvc (relative to GDL L1)", 100, -2000, 0, 110, -760, 10240);
899 h_gdl_ecltop_timing_diff_vs_grl_top_l1[iskim]->GetXaxis()->SetTitle(
"GRL TOP rvc relative to GDL L1 (rvc)");
900 h_gdl_ecltop_timing_diff_vs_grl_top_l1[iskim]->GetYaxis()->SetTitle(
"(GDL ECL)-(GDL TOP) t0 difference (ns, 100ns bins)");
902 h_gdl_top_l1_vs_grl_top_l1[iskim] =
new TH2I(Form(
"h_gdl_top_l1_vs_grl_top_l1_%s", skim_smap[iskim].c_str()),
903 "GDL TOP rvc vs GRL TOP rvc (relative to GDL L1)", 100, -2000,
905 h_gdl_top_l1_vs_grl_top_l1[iskim]->GetXaxis()->SetTitle(
"GRL TOP rvc relative to GDL L1 (rvc)");
906 h_gdl_top_l1_vs_grl_top_l1[iskim]->GetYaxis()->SetTitle(
"GDL TOP rvc relative to GDL L1 (rvc)");
908 h_grl_ntopslots_vs_ncdcslots[iskim] =
new TH2I(Form(
"h_grl_ntopslots_vs_ncdcslots_%s", skim_smap[iskim].c_str()),
909 "GRL TOP slots vs CDC slots", 10, 0, 10, 10, 0, 10);
910 h_grl_ntopslots_vs_ncdcslots[iskim]->GetXaxis()->SetTitle(
"GRL CDC slots");
911 h_grl_ntopslots_vs_ncdcslots[iskim]->GetYaxis()->SetTitle(
"GRL TOP slots");
913 h_grl_ncdctopslots_matched[iskim] =
new TH1I(Form(
"h_grl_ncdctopslots_matched_%s", skim_smap[iskim].c_str()),
914 "GRL Number of matched TOP and CDC slots", 17, 0, 17);
915 h_grl_ncdctopslots_matched[iskim]->GetXaxis()->SetTitle(
"Number of matched TOP and CDC slots");
917 h_grl_topslots_vs_cdcslots_match[iskim] =
new TH2I(Form(
"h_grl_topslots_vs_cdcslots_match_%s", skim_smap[iskim].c_str()),
918 "GRL TOP slots vs CDC slots matches", 17, 0, 17, 17,
920 h_grl_topslots_vs_cdcslots_match[iskim]->GetXaxis()->SetTitle(
"GRL CDC slot");
921 h_grl_topslots_vs_cdcslots_match[iskim]->GetYaxis()->SetTitle(
"GRL TOP slot");
935 for (
int iskim = start_skim_topdqm; iskim < end_skim_topdqm; iskim++) {
937 h_topSlotAll[iskim]->Reset();
938 h_topSegmentAll[iskim]->Reset();
939 h_topNHitsAll[iskim]->Reset();
940 h_topLogLAll[iskim]->Reset();
941 h_topT0All[iskim]->Reset();
943 for (
int slot = 0; slot <= 15; slot++) {
945 h_topSlotNHits[iskim][slot]->Reset();
946 h_topSlotLogL[iskim][slot]->Reset();
947 h_topSlotT0[iskim][slot]->Reset();
950 h_topSlotVsSegment[iskim]->Reset();
952 h_topSlotVsNHits[iskim]->Reset();
953 h_topSlotVsLogL[iskim]->Reset();
954 h_topSlotVsT0[iskim]->Reset();
956 h_topSegmentVsNHits[iskim]->Reset();
957 h_topSegmentVsLogL[iskim]->Reset();
958 h_topSegmentVsT0[iskim]->Reset();
960 h_topNHitsVsLogL[iskim]->Reset();
961 h_topNHitsVsT0[iskim]->Reset();
962 h_topLogLVsT0[iskim]->Reset();
964 h_ecl_gdl_top_timing_diff_both[iskim]->Reset();
965 h_ecl_top_top_timing_diff_both[iskim]->Reset();
967 if (m_histLevel > 2) {
969 h_gdl_top_rvc_vs_top_timing[iskim]->Reset();
971 h_gdl_ecltop_rvc_diff[iskim]->Reset();
972 h_gdl_cdctop_rvc_diff[iskim]->Reset();
974 h_gdl_gdltop_rvc_diff_all[iskim]->Reset();
975 h_gdl_comtop_rvc_diff_all[iskim]->Reset();
977 h_topRvcDiff1All[iskim]->Reset();
978 h_topRvcDiff2All[iskim]->Reset();
979 h_topRvcDiff3All[iskim]->Reset();
980 h_topRvcDiff4All[iskim]->Reset();
982 h_topGdlRvcDiff1All[iskim]->Reset();
983 h_topGdlRvcDiff2All[iskim]->Reset();
984 h_topGdlRvcDiff3All[iskim]->Reset();
986 h_decisionNumberVsNumberDecisionsGood[iskim]->Reset();
988 h_ecl_gdl_top_timing_diff_good[iskim]->Reset();
989 h_ecl_top_top_timing_diff_good[iskim]->Reset();
991 h_gdl_ecltop_timing_diff_vs_toptop_good[iskim]->Reset();
992 h_top_ecltop_timing_diff_vs_toptop_good[iskim]->Reset();
993 h_gdl_ecltop_timing_diff_vs_ecltop_good[iskim]->Reset();
995 h_gdl_gdltop_rvc_diff_good[iskim]->Reset();
996 h_gdl_comtop_rvc_diff_good[iskim]->Reset();
998 h_topCombinedTimingTopGood[iskim]->Reset();
999 h_topNSlotsCombinedTimingTopGood[iskim]->Reset();
1000 h_topNHitSumGood[iskim]->Reset();
1001 h_topLogLSumGood[iskim]->Reset();
1003 h_topRvcDiff1Good[iskim]->Reset();
1004 h_topRvcDiff2Good[iskim]->Reset();
1005 h_topRvcDiff3Good[iskim]->Reset();
1006 h_topRvcDiff4Good[iskim]->Reset();
1008 h_topGdlRvcDiff1Good[iskim]->Reset();
1009 h_topGdlRvcDiff2Good[iskim]->Reset();
1010 h_topGdlRvcDiff3Good[iskim]->Reset();
1012 h_decisionNumberVsNumberDecisionsBad[iskim]->Reset();
1014 h_ecl_gdl_top_timing_diff_bad[iskim]->Reset();
1015 h_ecl_top_top_timing_diff_bad[iskim]->Reset();
1017 h_gdl_ecltop_timing_diff_vs_toptop_bad[iskim]->Reset();
1018 h_top_ecltop_timing_diff_vs_toptop_bad[iskim]->Reset();
1019 h_gdl_ecltop_timing_diff_vs_ecltop_bad[iskim]->Reset();
1021 h_gdl_gdltop_rvc_diff_bad[iskim]->Reset();
1022 h_gdl_comtop_rvc_diff_bad[iskim]->Reset();
1024 h_topCombinedTimingTopBad[iskim]->Reset();
1025 h_topNSlotsCombinedTimingTopBad[iskim]->Reset();
1026 h_topNHitSumBad[iskim]->Reset();
1027 h_topLogLSumBad[iskim]->Reset();
1029 h_topRvcDiff1Bad[iskim]->Reset();
1030 h_topRvcDiff2Bad[iskim]->Reset();
1031 h_topRvcDiff3Bad[iskim]->Reset();
1032 h_topRvcDiff4Bad[iskim]->Reset();
1034 h_topGdlRvcDiff1Bad[iskim]->Reset();
1035 h_topGdlRvcDiff2Bad[iskim]->Reset();
1036 h_topGdlRvcDiff3Bad[iskim]->Reset();
1040 h_topCombinedTimingTopAll[iskim]->Reset();
1041 h_topNSlotsCombinedTimingTopAll[iskim]->Reset();
1042 h_topNHitSumAll[iskim]->Reset();
1043 h_topLogLSumAll[iskim]->Reset();
1045 h_topNSlotsCombinedTimingVsNHitsTopAll[iskim]->Reset();
1047 h_topTrigType[iskim]->Reset();
1048 h_topTimingResiduals[iskim]->Reset();
1049 h_topTimingVariance[iskim]->Reset();
1051 h_top_nt0decisions_vs_hist_class[iskim]->Reset();
1053 h_top_gdl_match_decision_number[iskim]->Reset();
1055 h_gdl_ecltop_timing_diff_5ns[iskim]->Reset();
1056 h_gdl_cdctop_timing_diff_5ns[iskim]->Reset();
1058 h_gdl_ecltop_timing_diff_2ns[iskim]->Reset();
1059 h_gdl_ecltop_timing_diff_grl_matched_2ns[iskim]->Reset();
1060 h_gdl_ecltop_timing_diff_no_grl_matched_2ns[iskim]->Reset();
1061 h_gdl_ecltop_timing_diff_no_grl_at_all_2ns[iskim]->Reset();
1062 h_gdl_ecltop_timing_diff_vs_nslots_2ns[iskim]->Reset();
1063 h_top_ecltop_timing_diff_combined_2ns[iskim]->Reset();
1064 h_top_ecltop_timing_diff_best_slot_2ns[iskim]->Reset();
1065 h_gdl_cdctop_timing_diff_2ns[iskim]->Reset();
1067 for (
int histClass = 0; histClass < m_nHistClassesActual; histClass++) {
1070 h_topNHitVsNhit[iskim][histClass]->Reset();
1071 h_topSlotVsSlot[iskim][histClass]->Reset();
1072 h_topT0VsT0[iskim][histClass]->Reset();
1073 h_topSegmentVsSegment[iskim][histClass]->Reset();
1074 h_topLogLVsLogL[iskim][histClass]->Reset();
1077 if (m_histLevel > 1) {
1078 for (
int histClass = 0; histClass < m_nHistClassesActual; histClass++) {
1079 h_topCombinedTimingTop[iskim][histClass]->Reset();
1080 h_topNSlotsCombinedTimingTop[iskim][histClass]->Reset();
1081 h_topNHitSum[iskim][histClass]->Reset();
1082 h_topNHitBestSlot[iskim][histClass]->Reset();
1084 h_topLogLSum[iskim][histClass]->Reset();
1086 h_gdl_ecltop_timing_diff_vs_slot_2ns[iskim][histClass]->Reset();
1087 h_gdl_ecltop_timing_diff_vs_segment_2ns[iskim][histClass]->Reset();
1088 h_gdl_ecltop_timing_diff_vs_nhits_2ns[iskim][histClass]->Reset();
1089 h_gdl_ecltop_timing_diff_vs_logl_2ns[iskim][histClass]->Reset();
1091 h_top_ecltop_timing_diff_2ns[iskim][histClass]->Reset();
1092 h_top_ecltop_timing_combined_diff_2ns[iskim][histClass]->Reset();
1093 h_top_ecltop_timing_best_slot_diff_2ns[iskim][histClass]->Reset();
1095 h_gdl_ecltop_timing_diff_vs_toptop[iskim][histClass]->Reset();
1096 h_top_ecltop_timing_diff_vs_toptop[iskim][histClass]->Reset();
1098 h_gdl_ecltop_timing_diff_vs_ecltop[iskim][histClass]->Reset();
1099 h_gdl_ecltop_timing_diff_vs_ecltop_best_slot[iskim][histClass]->Reset();
1103 h_gdl_ecltop_timing_diff_vs_slot[iskim]->Reset();
1104 h_gdl_ecltop_timing_diff_vs_segment[iskim]->Reset();
1105 h_gdl_ecltop_timing_diff_vs_nhits[iskim]->Reset();
1106 h_gdl_ecltop_timing_diff_vs_logl[iskim]->Reset();
1108 h_topTC2IdVsTC1IdAll[iskim]->Reset();
1109 h_topTC2EnergyVsTC1EnergyAll[iskim]->Reset();
1110 h_topTC2ThetaIdVsTC1ThetaIdAll[iskim]->Reset();
1111 h_topTC2PhiIdVsTC1PhiIdAll[iskim]->Reset();
1112 h_topTCPhiIdVsTCThetaIdAll[iskim]->Reset();
1114 h_topTC2IdVsTC1IdGRLAll[iskim]->Reset();
1115 h_topTC2EnergyVsTC1EnergyGRLAll[iskim]->Reset();
1116 h_topTC2ThetaIdVsTC1ThetaIdGRLAll[iskim]->Reset();
1117 h_topTC2PhiIdVsTC1PhiIdGRLAll[iskim]->Reset();
1118 h_topTCPhiIdVsTCThetaIdGRLAll[iskim]->Reset();
1120 h_topTC2IdVsTC1Id[iskim]->Reset();
1121 h_topTC2EnergyVsTC1Energy[iskim]->Reset();
1122 h_topTC2ThetaIdVsTC1ThetaId[iskim]->Reset();
1123 h_topTC2PhiIdVsTC1PhiId[iskim]->Reset();
1124 h_topTCPhiIdVsTCThetaId[iskim]->Reset();
1126 h_topTC2IdVsTC1IdGRL[iskim]->Reset();
1127 h_topTC2EnergyVsTC1EnergyGRL[iskim]->Reset();
1128 h_topTC2ThetaIdVsTC1ThetaIdGRL[iskim]->Reset();
1129 h_topTC2PhiIdVsTC1PhiIdGRL[iskim]->Reset();
1130 h_topTCPhiIdVsTCThetaIdGRL[iskim]->Reset();
1132 h_gdl_ecltop_timing_diff_vs_grl_top_l1[iskim]->Reset();
1133 h_gdl_top_l1_vs_grl_top_l1[iskim]->Reset();
1135 h_grl_ntopslots_vs_ncdcslots[iskim]->Reset();
1136 h_grl_ncdctopslots_matched[iskim]->Reset();
1137 h_grl_topslots_vs_cdcslots_match[iskim]->Reset();
1148 start_skim_topdqm = 0;
1149 end_skim_topdqm = 1;
1150 }
else if (m_skim == 1) {
1151 start_skim_topdqm = 1;
1152 end_skim_topdqm = nskim_topdqm;
1154 start_skim_topdqm = 0;
1155 end_skim_topdqm = nskim_topdqm;
1164 m_exp = bevt->getExperiment();
1165 m_run = bevt->getRun();
1178 if (m_doGDLCorrelations) {
1180 for (
int i = 0; i < 320; i++) {
1181 gdlLeafBitMap[i] = m_gdlUnpacker->getLeafMap(i);
1183 for (
int i = 0; i < 320; i++) {
1184 strcpy(gdlLeafNames[i], m_gdlUnpacker->getLeafnames(i));
1190 gdl_e_toptiming = 0;
1191 gdl_e_ecltiming = 0;
1192 gdl_e_cdctiming = 0;
1197 for (
int i = 0; i < 320; i++) {
1198 if (strcmp(gdlLeafNames[i],
"timtype") == 0) gdl_e_timtype = gdlLeafBitMap[i];
1199 if (strcmp(gdlLeafNames[i],
"gdll1rvc") == 0) gdl_e_gdll1rvc = gdlLeafBitMap[i];
1200 if (strcmp(gdlLeafNames[i],
"coml1rvc") == 0) gdl_e_coml1rvc = gdlLeafBitMap[i];
1201 if (strcmp(gdlLeafNames[i],
"toptiming") == 0) gdl_e_toptiming = gdlLeafBitMap[i];
1202 if (strcmp(gdlLeafNames[i],
"ecltiming") == 0) gdl_e_ecltiming = gdlLeafBitMap[i];
1203 if (strcmp(gdlLeafNames[i],
"cdctiming") == 0) gdl_e_cdctiming = gdlLeafBitMap[i];
1204 if (strcmp(gdlLeafNames[i],
"toprvc") == 0) gdl_e_toprvc = gdlLeafBitMap[i];
1205 if (strcmp(gdlLeafNames[i],
"eclrvc") == 0) gdl_e_eclrvc = gdlLeafBitMap[i];
1206 if (strcmp(gdlLeafNames[i],
"cdcrvc") == 0) gdl_e_cdcrvc = gdlLeafBitMap[i];
1225 if (!trgtopCombinedTimingArray)
return;
1226 if (!trgtopCombinedTimingArray.
getEntries())
return;
1232 for (
int iskim = start_skim_topdqm; iskim < end_skim_topdqm; iskim++) {
1233 if (iskim == 0) skim.push_back(iskim);
1238 const std::map<std::string, int>& skim_map = result_soft->getResults();
1239 for (
int iskim = start_skim_topdqm; iskim < end_skim_topdqm; iskim++) {
1241 else if (skim_map.find(skim_menu[iskim]) != skim_map.end()) {
1243 if (accepted) skim.push_back(iskim);
1248 bool gdlInfoAvailable =
false;
1249 bool grlInfoAvailable =
false;
1255 bool grlCDCSlots[16];
1256 bool grlTOPSlots[16];
1258 bool grlCDCTOPSlotsMatch[16];
1260 if (m_doGRLCorrelations) {
1267 grlInfoAvailable =
true;
1269 int grlTimeL1 = grlEventInfo->get_coml1() - grlEventInfo->get_revoclk();
1271 grlTOPL1 = (grlEventInfo->get_TOPL1_count() + grlTimeL1 - 0.5) * (-clk127To1ns);
1275 for (
int i = 0; i < 16; i++) {
1276 grlCDCSlots[i] =
false;
1277 if (grlEventInfo->get_slot_CDC(i)) {
1278 grlCDCSlots[i] =
true;
1280 grlTOPSlots[i] =
false;
1281 if (grlEventInfo->get_slot_TOP(i)) {
1282 grlTOPSlots[i] =
true;
1289 int nCDCSlotsGRL = 0;
1290 int nTOPSlotsGRL = 0;
1291 int nCDCTOPSlotsMatchedGRL = 0;
1293 if (grlInfoAvailable) {
1294 for (
int i = 0; i < 16; i++) {
1295 if (grlCDCSlots[i]) nCDCSlotsGRL++;
1296 if (grlTOPSlots[i]) nTOPSlotsGRL++;
1297 grlCDCTOPSlotsMatch[i] =
false;
1298 if (grlCDCSlots[i] && grlTOPSlots[i]) {
1299 nCDCTOPSlotsMatchedGRL++;
1300 grlCDCTOPSlotsMatch[i] =
true;
1309 if (m_doECLCorrelations) {
1311 bool barrelEcl =
false;
1312 bool barrelEclB2B =
false;
1322 int TCID = (aTRGECLUnpackerStore->
getTCId());
1324 int hit_win = aTRGECLUnpackerStore -> getHitWin();
1325 double HitEnergy = aTRGECLUnpackerStore -> getTCEnergy();
1326 double HitTiming = aTRGECLUnpackerStore ->
getTCTime();
1328 if (TCID < 1 || TCID > 576 || HitEnergy == 0) {
continue;}
1329 if (!(hit_win == 3 || hit_win == 4)) {
continue;}
1332 tcEclThis.tcId = TCID;
1333 tcEclThis.tcEnergy = HitEnergy;
1334 tcEclThis.tcTiming = HitTiming;
1337 tcEclList.push_back(tcEclThis);
1345 if (tcEclList.size() >= 2) {
1346 vector<tcEcl>::const_iterator it = tcEclList.begin();
1347 const tcEcl& tc1 = *it;
1349 const tcEcl& tc2 = *it;
1350 int tcId1 = tc1.tcId;
1351 int tcId2 = tc2.tcId;
1353 int tcThetaId1 = tc1.tcThetaId;
1354 int tcPhiId1 = tc1.tcPhiId;
1356 int tcThetaId2 = tc2.tcThetaId;
1357 int tcPhiId2 = tc2.tcPhiId;
1364 if (tcThetaId1 >= 4 && tcThetaId1 <= 15) {
1366 if (tcThetaId2 >= 4 && tcThetaId2 <= 15) {
1367 if (abs(tcPhiId1 - tcPhiId2) >= 12 && abs(tcPhiId1 - tcPhiId2) <= 24) {
1368 barrelEclB2B =
true;
1373 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1375 h_topTC2IdVsTC1IdAll[skim[ifill]]->Fill(tcId1, tcId2);
1376 h_topTC2EnergyVsTC1EnergyAll[skim[ifill]]->Fill(tc1.tcEnergy, tc2.tcEnergy);
1377 h_topTC2ThetaIdVsTC1ThetaIdAll[skim[ifill]]->Fill(tcThetaId1, tcThetaId2);
1378 h_topTC2PhiIdVsTC1PhiIdAll[skim[ifill]]->Fill(tcPhiId1, tcPhiId2);
1379 h_topTCPhiIdVsTCThetaIdAll[skim[ifill]]->Fill(tcThetaId1, tcPhiId1, 0);
1380 h_topTCPhiIdVsTCThetaIdAll[skim[ifill]]->Fill(tcThetaId2, tcPhiId2, 1);
1382 if (nCDCSlotsGRL > 0) {
1383 h_topTC2IdVsTC1IdGRLAll[skim[ifill]]->Fill(tcId1, tcId2);
1384 h_topTC2EnergyVsTC1EnergyGRLAll[skim[ifill]]->Fill(tc1.tcEnergy, tc2.tcEnergy);
1385 h_topTC2ThetaIdVsTC1ThetaIdGRLAll[skim[ifill]]->Fill(tcThetaId1, tcThetaId2);
1386 h_topTC2PhiIdVsTC1PhiIdGRLAll[skim[ifill]]->Fill(tcPhiId1, tcPhiId2);
1387 h_topTCPhiIdVsTCThetaIdGRLAll[skim[ifill]]->Fill(tcThetaId1, tcPhiId1, 0);
1388 h_topTCPhiIdVsTCThetaIdGRLAll[skim[ifill]]->Fill(tcThetaId2, tcPhiId2, 1);
1393 h_topTC2IdVsTC1Id[skim[ifill]]->Fill(tcId1, tcId2);
1394 h_topTC2EnergyVsTC1Energy[skim[ifill]]->Fill(tc1.tcEnergy, tc2.tcEnergy);
1395 h_topTC2ThetaIdVsTC1ThetaId[skim[ifill]]->Fill(tcThetaId1, tcThetaId2);
1396 h_topTC2PhiIdVsTC1PhiId[skim[ifill]]->Fill(tcPhiId1, tcPhiId2);
1397 h_topTCPhiIdVsTCThetaId[skim[ifill]]->Fill(tcThetaId1, tcPhiId1, 0);
1398 h_topTCPhiIdVsTCThetaId[skim[ifill]]->Fill(tcThetaId2, tcPhiId2, 1);
1399 if (nCDCSlotsGRL > 0) {
1400 h_topTC2IdVsTC1IdGRL[skim[ifill]]->Fill(tcId1, tcId2);
1401 h_topTC2EnergyVsTC1EnergyGRL[skim[ifill]]->Fill(tc1.tcEnergy, tc2.tcEnergy);
1402 h_topTC2ThetaIdVsTC1ThetaIdGRL[skim[ifill]]->Fill(tcThetaId1, tcThetaId2);
1403 h_topTC2PhiIdVsTC1PhiIdGRL[skim[ifill]]->Fill(tcPhiId1, tcPhiId2);
1404 h_topTCPhiIdVsTCThetaIdGRL[skim[ifill]]->Fill(tcThetaId1, tcPhiId1, 0);
1405 h_topTCPhiIdVsTCThetaIdGRL[skim[ifill]]->Fill(tcThetaId2, tcPhiId2, 1);
1411 if (m_requireEclBarrel) {
1412 if (!barrelEcl)
return;
1414 if (m_requireEclBarrelB2B) {
1415 if (!barrelEclB2B)
return;
1421 if (m_doGRLCorrelations && grlInfoAvailable) {
1422 if (m_requireCDC2DTrack) {
1423 if (nCDCSlotsGRL <= 0)
return;
1427 if (grlInfoAvailable) {
1429 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1431 h_grl_ntopslots_vs_ncdcslots[skim[ifill]]->Fill(nCDCSlotsGRL, nTOPSlotsGRL);
1433 h_grl_ncdctopslots_matched[skim[ifill]]->Fill(nCDCTOPSlotsMatchedGRL);
1435 for (
int i = 0; i < 16; i++) {
1436 if (grlCDCTOPSlotsMatch[i]) {
1437 h_grl_topslots_vs_cdcslots_match[skim[ifill]]->Fill(i + 1, i + 1);
1438 }
else if (grlCDCSlots[i]) {
1439 h_grl_topslots_vs_cdcslots_match[skim[ifill]]->Fill(i + 1, 0.);
1440 }
else if (grlTOPSlots[i]) {
1441 h_grl_topslots_vs_cdcslots_match[skim[ifill]]->Fill(0., i + 1);
1448 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1449 if (nCDCSlotsGRL == 0 && nTOPSlotsGRL == 0) h_grl_topslots_vs_cdcslots_match[skim[ifill]]->Fill(0., 0.);
1467 int gdl_gdll1rvc = -1;
1468 int gdl_coml1rvc = -1;
1469 int gdl_toprvc = -1;
1470 int gdl_eclrvc = -1;
1471 int gdl_cdcrvc = -1;
1473 int gdl_top_timing = -1;
1474 int gdl_ecl_timing = -1;
1475 int gdl_cdc_timing = -1;
1478 if (m_doGDLCorrelations) {
1481 if (m_gdlUnpacker) {
1489 int n_leafs = m_gdlUnpacker->getnLeafs();
1490 int n_leafsExtra = m_gdlUnpacker->getnLeafsExtra();
1491 int n_clocks = m_gdlUnpacker->getnClks();
1504 for (
int i = 0; i < 320; i++) {
1505 if (strcmp(entAry[0]->m_unpackername[i],
"evt") == 0) m_evtno = entAry[0]->m_unpacker[i];
1506 if (strcmp(entAry[0]->m_unpackername[i],
"clk") == 0) clk_map = i;
1511 std::vector<std::vector<int> > _data(n_leafs + n_leafsExtra);
1512 for (
int leaf = 0; leaf < n_leafs + n_leafsExtra; leaf++) {
1513 std::vector<int> _v(n_clocks);
1518 for (
int ii = 0; ii < entAry.
getEntries(); ii++) {
1519 std::vector<int*> Bits(n_leafs + n_leafsExtra);
1521 for (
int i = 0; i < 320; i++) {
1522 if (gdlLeafBitMap[i] != -1) {
1523 Bits[gdlLeafBitMap[i]] = &(entAry[ii]->m_unpacker[i]);
1526 for (
int leaf = 0; leaf < n_leafs + n_leafsExtra; leaf++) {
1527 _data[leaf][entAry[ii]->m_unpacker[clk_map]] = *Bits[leaf];
1532 gdl_gdll1rvc = _data[gdl_e_gdll1rvc][n_clocks - 1];
1533 gdl_coml1rvc = _data[gdl_e_coml1rvc][n_clocks - 1];
1534 gdl_toprvc = _data[gdl_e_toprvc][n_clocks - 1];
1535 gdl_eclrvc = _data[gdl_e_eclrvc][n_clocks - 1];
1536 gdl_cdcrvc = _data[gdl_e_cdcrvc][n_clocks - 1];
1537 gdl_top_timing = _data[gdl_e_toptiming][n_clocks - 1];
1538 gdl_ecl_timing = _data[gdl_e_ecltiming][n_clocks - 1];
1539 gdl_cdc_timing = _data[gdl_e_cdctiming][n_clocks - 1];
1541 gdlInfoAvailable =
true;
1587 int ecl_top_timing_diff = -1;
1588 int cdc_top_timing_diff = -1;
1590 int gdl_top_rvc_diff = -1;
1591 int com_top_rvc_diff = -1;
1592 int ecl_top_rvc_diff = -1;
1593 int cdc_top_rvc_diff = -1;
1595 if (gdlInfoAvailable) {
1597 ecl_top_timing_diff = gdl_ecl_timing >= gdl_top_timing ? gdl_ecl_timing - gdl_top_timing : gdl_ecl_timing - gdl_top_timing +
1599 cdc_top_timing_diff = gdl_cdc_timing >= gdl_top_timing ? gdl_cdc_timing - gdl_top_timing : gdl_cdc_timing - gdl_top_timing +
1602 gdl_top_rvc_diff = gdl_gdll1rvc >= gdl_toprvc ? gdl_gdll1rvc - gdl_toprvc : gdl_gdll1rvc - gdl_toprvc + 1280;
1603 com_top_rvc_diff = gdl_coml1rvc >= gdl_toprvc ? gdl_coml1rvc - gdl_toprvc : gdl_coml1rvc - gdl_toprvc + 1280;
1604 ecl_top_rvc_diff = gdl_eclrvc >= gdl_toprvc ? gdl_eclrvc - gdl_toprvc : gdl_eclrvc - gdl_toprvc + 1280;
1605 cdc_top_rvc_diff = gdl_cdcrvc >= gdl_toprvc ? gdl_cdcrvc - gdl_toprvc : gdl_cdcrvc - gdl_toprvc + 1280;
1613 int nT0Decisions = trgtopCombinedTimingArray.
getEntries();
1615 int t0DecisionNumber = 0;
1617 if (gdlInfoAvailable) {
1621 for (
const auto& t0Decision : trgtopCombinedTimingArray) {
1622 int topCombinedTimingTop = t0Decision.getCombinedTimingTop();
1623 int top_top_timing = (topCombinedTimingTop % 10240);
1625 if (gdl_top_timing == top_top_timing) {
1627 if (t0DecisionNumber == 0) {
1629 }
else if (histClass != 0) {
1632 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1633 h_top_gdl_match_decision_number[skim[ifill]]->Fill(t0DecisionNumber + 1);
1640 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1641 h_top_nt0decisions_vs_hist_class[skim[ifill]]->Fill(histClass, nT0Decisions);
1646 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1647 h_top_gdl_match_decision_number[skim[ifill]]->Fill(0);
1653 if (m_nHistClassesActual == 1) histClass = 0;
1656 if (m_nHistClassesActual == 2 && histClass == 2) histClass = 1;
1659 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1660 h_N_decision[skim[ifill]][histClass]->Fill(nT0Decisions);
1665 if (gdlInfoAvailable) {
1670 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1672 if (m_histLevel > 2) {
1674 int gdl_top_timing_1280 = gdl_top_timing >> 3;
1675 h_gdl_top_rvc_vs_top_timing[skim[ifill]]->Fill(gdl_top_timing_1280, gdl_toprvc);
1677 h_gdl_ecltop_rvc_diff[skim[ifill]]->Fill(ecl_top_rvc_diff);
1678 h_gdl_cdctop_rvc_diff[skim[ifill]]->Fill(cdc_top_rvc_diff);
1680 h_gdl_gdltop_rvc_diff_all[skim[ifill]]->Fill(gdl_top_rvc_diff);
1681 h_gdl_comtop_rvc_diff_all[skim[ifill]]->Fill(com_top_rvc_diff);
1684 if (grlInfoAvailable) {
1685 h_gdl_ecltop_timing_diff_vs_grl_top_l1[skim[ifill]]->Fill(grlTOPL1, ecl_top_timing_diff);
1688 h_gdl_ecltop_timing_diff_5ns[skim[ifill]]->Fill(ecl_top_timing_diff);
1689 h_gdl_cdctop_timing_diff_5ns[skim[ifill]]->Fill(cdc_top_timing_diff);
1691 h_gdl_ecltop_timing_diff_2ns[skim[ifill]]->Fill(ecl_top_timing_diff);
1693 if (nCDCTOPSlotsMatchedGRL > 0) {
1694 h_gdl_ecltop_timing_diff_grl_matched_2ns[skim[ifill]]->Fill(ecl_top_timing_diff);
1695 }
else if (nCDCSlotsGRL > 0) {
1696 h_gdl_ecltop_timing_diff_no_grl_matched_2ns[skim[ifill]]->Fill(ecl_top_timing_diff);
1698 h_gdl_ecltop_timing_diff_no_grl_at_all_2ns[skim[ifill]]->Fill(ecl_top_timing_diff);
1700 h_gdl_cdctop_timing_diff_2ns[skim[ifill]]->Fill(cdc_top_timing_diff);
1707 t0DecisionNumber = 0;
1709 for (
const auto& t0Decision : trgtopCombinedTimingArray) {
1711 bool top_timing_same =
false;
1712 if (gdlInfoAvailable) {
1713 int topCombinedTimingTop = t0Decision.getCombinedTimingTop();
1714 int top_top_timing = (topCombinedTimingTop % 10240);
1715 if (top_top_timing == gdl_top_timing) {
1716 top_timing_same =
true;
1721 const vector<Belle2::TRGTOPSlotTiming> t0DecisionSlots = trgtopCombinedTimingArray[t0DecisionNumber]->getSlotTimingDecisions();
1723 slotDecisionList.clear();
1725 if (t0DecisionNumber == 0) {
1727 for (
const auto& t0DecisionSlot : t0DecisionSlots) {
1729 int slot = t0DecisionSlot.getSlotId();
1730 int segment = t0DecisionSlot.getSlotSegment();
1731 int nHits = t0DecisionSlot.getSlotNHits();
1732 int logL = t0DecisionSlot.getSlotLogL();
1733 int t0 = t0DecisionSlot.getSlotTiming();
1737 slotDecisionThis.slot = slot;
1738 slotDecisionThis.segment = segment;
1739 slotDecisionThis.nHits = nHits;
1740 slotDecisionThis.logL = logL;
1741 slotDecisionThis.t0 = t0;
1742 slotDecisionList.push_back(slotDecisionThis);
1744 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1746 h_topSlotAll[skim[ifill]]->Fill(slot);
1747 h_topSegmentAll[skim[ifill]]->Fill(segment);
1748 h_topNHitsAll[skim[ifill]]->Fill(nHits);
1749 h_topLogLAll[skim[ifill]]->Fill(logL);
1750 h_topT0All[skim[ifill]]->Fill(t0);
1753 if (gdlInfoAvailable) {
1754 int top_top_timing_slot = (t0 % 10240);
1755 int top_gdl_timing_diff_slot = gdl_ecl_timing >= top_top_timing_slot ? gdl_ecl_timing - top_top_timing_slot : gdl_ecl_timing -
1756 top_top_timing_slot + 10240;
1758 h_gdl_ecltop_timing_diff_vs_slot[skim[ifill]]->Fill(top_gdl_timing_diff_slot, slot);
1759 h_gdl_ecltop_timing_diff_vs_segment[skim[ifill]]->Fill(top_gdl_timing_diff_slot, segment);
1760 h_gdl_ecltop_timing_diff_vs_nhits[skim[ifill]]->Fill(top_gdl_timing_diff_slot, nHits);
1761 h_gdl_ecltop_timing_diff_vs_logl[skim[ifill]]->Fill(top_gdl_timing_diff_slot, logL);
1763 if (m_histLevel > 1) {
1764 h_gdl_ecltop_timing_diff_vs_slot_2ns[skim[ifill]][histClass]->Fill(top_gdl_timing_diff_slot, slot);
1765 h_gdl_ecltop_timing_diff_vs_segment_2ns[skim[ifill]][histClass]->Fill(top_gdl_timing_diff_slot, segment);
1766 h_gdl_ecltop_timing_diff_vs_nhits_2ns[skim[ifill]][histClass]->Fill(top_gdl_timing_diff_slot, nHits);
1767 h_gdl_ecltop_timing_diff_vs_logl_2ns[skim[ifill]][histClass]->Fill(top_gdl_timing_diff_slot, logL);
1771 if (slot >= 1 && slot <= 16) {
1772 if (segment >= 1 && segment <= 10) {
1774 h_topSlotNHits[skim[ifill]][slot - 1]->Fill(nHits);
1775 h_topSlotLogL[skim[ifill]][slot - 1]->Fill(logL);
1776 h_topSlotT0[skim[ifill]][slot - 1]->Fill(t0);
1778 h_topSlotVsSegment[skim[ifill]]->Fill(segment, slot);
1780 h_topSlotVsNHits[skim[ifill]]->Fill(nHits, slot);
1781 h_topSlotVsLogL[skim[ifill]]->Fill(logL, slot);
1782 h_topSlotVsT0[skim[ifill]]->Fill(t0, slot);
1784 h_topSegmentVsNHits[skim[ifill]]->Fill(nHits, segment);
1785 h_topSegmentVsLogL[skim[ifill]]->Fill(logL, segment);
1786 h_topSegmentVsT0[skim[ifill]]->Fill(t0, segment);
1788 h_topNHitsVsLogL[skim[ifill]]->Fill(logL, nHits);
1789 h_topNHitsVsT0[skim[ifill]]->Fill(t0, nHits);
1790 h_topLogLVsT0[skim[ifill]]->Fill(t0, logL);
1804 int nHitsSlotBest = 0;
1805 int t0SlotBest = -1;
1808 if (slotDecisionList.size() > 0) {
1810 int slotSlotBest = 0;
1811 int segmentSlotBest = 0;
1812 int logLSlotBest = 0;
1815 sort(slotDecisionList.begin(), slotDecisionList.end(),
largestNHits());
1817 vector<slotDecision>::const_iterator it = slotDecisionList.begin();
1820 slotSlotBest = slotDecisionBest.slot;
1821 segmentSlotBest = slotDecisionBest.segment;
1822 logLSlotBest = slotDecisionBest.logL;
1823 nHitsSlotBest = slotDecisionBest.nHits;
1824 t0SlotBest = slotDecisionBest.t0;
1826 if (slotDecisionList.size() > 1) {
1830 int slotSlotBest2 = slotDecisionBest2.slot;
1831 int segmentSlotBest2 = slotDecisionBest2.segment;
1832 int logLSlotBest2 = slotDecisionBest2.logL;
1833 int nHitsSlotBest2 = slotDecisionBest2.nHits;
1834 int t0SlotBest2 = slotDecisionBest2.t0;
1836 if (t0DecisionNumber == 0) {
1837 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1838 h_topNHitVsNhit[skim[ifill]][histClass]->Fill(nHitsSlotBest, nHitsSlotBest2);
1839 h_topSlotVsSlot[skim[ifill]][histClass]->Fill(slotSlotBest, slotSlotBest2);
1840 h_topT0VsT0[skim[ifill]][histClass]->Fill(t0SlotBest, t0SlotBest2);
1841 h_topSegmentVsSegment[skim[ifill]][histClass]->Fill(segmentSlotBest, segmentSlotBest2);
1842 h_topLogLVsLogL[skim[ifill]][histClass]->Fill(logLSlotBest, logLSlotBest2);
1867 int topRvcL1 = t0Decision.getRvcB2L();
1869 int topRvcWindow = t0Decision.getRvcWindow();
1871 int topRvcTopTimingDecisionPrev = t0Decision.getRvcTopTimingDecisionPrev();
1873 int topRvcTopTimingDecisionNow = t0Decision.getRvcTopTimingDecisionNow();
1875 int topRvcTopTimingDecisionNowGdl = t0Decision.getRvcTopTimingDecisionNowGdl();
1880 int topCombinedTimingTop = t0Decision.getCombinedTimingTop();
1882 int topNSlotsCombinedTimingTop = t0Decision.getNSlotsCombinedTimingTop();
1883 int topCombinedTimingTopResidual = t0Decision.getCombinedTimingTopResidual();
1886 int topTrigType = t0Decision.getTrigType();
1887 int topNHitSum = t0Decision.getNHitSum();
1888 int topLogLSum = t0Decision.getLogLSum();
1890 int topTimingVar = t0Decision.getTimingVar();
1892 float hitsPerSlot = topNHitSum / max(1, topNSlotsCombinedTimingTop);
1893 float logLPerSlot = topLogLSum / max(1, topNSlotsCombinedTimingTop);
1895 int topRvcDiff1 = topRvcTopTimingDecisionNowGdl - topRvcTopTimingDecisionNow;
1896 int topRvcDiff2 = topRvcTopTimingDecisionNow >= topRvcTopTimingDecisionPrev ? topRvcTopTimingDecisionNow -
1897 topRvcTopTimingDecisionPrev : topRvcTopTimingDecisionNow - topRvcTopTimingDecisionPrev + 1280;
1898 int topRvcDiff3 = topRvcWindow >= topRvcTopTimingDecisionNow ? topRvcWindow - topRvcTopTimingDecisionNow : topRvcWindow -
1899 topRvcTopTimingDecisionNow + 1280;
1900 int topRvcDiff4 = topRvcL1 >= topRvcTopTimingDecisionNow ? topRvcL1 - topRvcTopTimingDecisionNow : topRvcL1 -
1901 topRvcTopTimingDecisionNow + 1280;
1903 if (t0DecisionNumber == 0) {
1905 if (grlInfoAvailable) {
1906 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1907 h_gdl_top_l1_vs_grl_top_l1[skim[ifill]]->Fill(grlTOPL1, topRvcDiff4);
1911 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1913 h_topCombinedTimingTopAll[skim[ifill]]->Fill(topCombinedTimingTop);
1914 h_topNSlotsCombinedTimingTopAll[skim[ifill]]->Fill(topNSlotsCombinedTimingTop);
1915 h_topNHitSumAll[skim[ifill]]->Fill((
int) hitsPerSlot);
1916 h_topLogLSumAll[skim[ifill]]->Fill((
int) logLPerSlot);
1918 h_topNSlotsCombinedTimingVsNHitsTopAll[skim[ifill]]->Fill(topNHitSum, topNSlotsCombinedTimingTop);
1920 h_topTrigType[skim[ifill]]->Fill(topTrigType);
1921 h_topTimingResiduals[skim[ifill]]->Fill(topCombinedTimingTopResidual);
1922 h_topTimingVariance[skim[ifill]]->Fill(topTimingVar);
1924 if (m_histLevel > 2) {
1925 h_topRvcDiff1All[skim[ifill]]->Fill(topRvcDiff1);
1926 h_topRvcDiff2All[skim[ifill]]->Fill(topRvcDiff2);
1927 h_topRvcDiff3All[skim[ifill]]->Fill(topRvcDiff3);
1928 h_topRvcDiff4All[skim[ifill]]->Fill(topRvcDiff4);
1933 int topGdlRvcDiff1 = gdl_gdll1rvc >= topRvcL1 ? gdl_gdll1rvc - topRvcL1 : gdl_gdll1rvc - topRvcL1 + 1280;
1934 int topGdlRvcDiff2 = gdl_toprvc >= topRvcTopTimingDecisionNow ? gdl_toprvc - topRvcTopTimingDecisionNow : gdl_toprvc -
1935 topRvcTopTimingDecisionNow + 1280;
1936 int topGdlRvcDiff3 = gdl_toprvc >= topRvcTopTimingDecisionPrev ? gdl_toprvc - topRvcTopTimingDecisionPrev : gdl_toprvc -
1937 topRvcTopTimingDecisionPrev + 1280;
1939 int ecl_gdl_top_timing_combined_diff = -1;
1941 int top_top_timing_combined_diff = -1;
1943 int ecl_top_top_timing_combined_diff = -1;
1944 int ecl_top_top_timing_best_slot_diff = -1;
1946 if (gdlInfoAvailable) {
1948 int top_top_timing_combined = -1;
1949 int top_top_timing_best_slot = -1;
1951 ecl_gdl_top_timing_combined_diff = gdl_ecl_timing >= gdl_top_timing ? gdl_ecl_timing - gdl_top_timing : gdl_ecl_timing -
1952 gdl_top_timing + 10240;
1954 top_top_timing_combined = (topCombinedTimingTop % 10240);
1955 top_top_timing_best_slot = (t0SlotBest % 10240);
1957 top_top_timing_combined_diff = top_top_timing_combined >= gdl_top_timing ? top_top_timing_combined - gdl_top_timing :
1958 top_top_timing_combined - gdl_top_timing + 10240;
1960 ecl_top_top_timing_combined_diff = gdl_ecl_timing >= top_top_timing_combined ? gdl_ecl_timing - top_top_timing_combined :
1961 gdl_ecl_timing - top_top_timing_combined + 10240;
1962 ecl_top_top_timing_best_slot_diff = gdl_ecl_timing >= top_top_timing_best_slot ? gdl_ecl_timing - top_top_timing_best_slot :
1963 gdl_ecl_timing - top_top_timing_best_slot + 10240;
1965 if (t0DecisionNumber == 0) {
1966 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1967 if (m_histLevel > 2) {
1968 h_topGdlRvcDiff1All[skim[ifill]]->Fill(topGdlRvcDiff1);
1969 h_topGdlRvcDiff2All[skim[ifill]]->Fill(topGdlRvcDiff2);
1970 h_topGdlRvcDiff3All[skim[ifill]]->Fill(topGdlRvcDiff3);
1973 h_ecl_gdl_top_timing_diff_both[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff);
1974 h_ecl_top_top_timing_diff_both[skim[ifill]]->Fill(ecl_top_top_timing_combined_diff);
1978 if (m_histLevel > 2) {
1981 if (top_top_timing_combined_diff == 0) {
1983 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
1985 h_decisionNumberVsNumberDecisionsGood[skim[ifill]]->Fill(nT0Decisions, t0DecisionNumber + 1);
1987 if (t0DecisionNumber == 0) {
1989 h_ecl_gdl_top_timing_diff_good[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff);
1990 h_ecl_top_top_timing_diff_good[skim[ifill]]->Fill(ecl_top_top_timing_combined_diff);
1992 h_gdl_ecltop_timing_diff_vs_toptop_good[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff, top_top_timing_combined_diff);
1993 h_top_ecltop_timing_diff_vs_toptop_good[skim[ifill]]->Fill(ecl_top_top_timing_combined_diff, top_top_timing_combined_diff);
1994 h_gdl_ecltop_timing_diff_vs_ecltop_good[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff, ecl_top_top_timing_combined_diff);
1996 h_topCombinedTimingTopGood[skim[ifill]]->Fill(topCombinedTimingTop);
1997 h_topNSlotsCombinedTimingTopGood[skim[ifill]]->Fill(topNSlotsCombinedTimingTop);
1998 h_topNHitSumGood[skim[ifill]]->Fill((
int) hitsPerSlot);
1999 h_topLogLSumGood[skim[ifill]]->Fill((
int) logLPerSlot);
2001 h_topRvcDiff1Good[skim[ifill]]->Fill(topRvcDiff1);
2002 h_topRvcDiff2Good[skim[ifill]]->Fill(topRvcDiff2);
2003 h_topRvcDiff3Good[skim[ifill]]->Fill(topRvcDiff3);
2004 h_topRvcDiff4Good[skim[ifill]]->Fill(topRvcDiff4);
2006 h_topGdlRvcDiff1Good[skim[ifill]]->Fill(topGdlRvcDiff1);
2007 h_topGdlRvcDiff2Good[skim[ifill]]->Fill(topGdlRvcDiff2);
2008 h_topGdlRvcDiff3Good[skim[ifill]]->Fill(topGdlRvcDiff3);
2010 h_gdl_gdltop_rvc_diff_good[skim[ifill]]->Fill(gdl_top_rvc_diff);
2011 h_gdl_comtop_rvc_diff_good[skim[ifill]]->Fill(com_top_rvc_diff);
2016 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
2018 h_decisionNumberVsNumberDecisionsBad[skim[ifill]]->Fill(nT0Decisions, t0DecisionNumber + 1);
2020 if (t0DecisionNumber == 0) {
2021 h_ecl_gdl_top_timing_diff_bad[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff);
2022 h_ecl_top_top_timing_diff_bad[skim[ifill]]->Fill(ecl_top_top_timing_combined_diff);
2024 h_gdl_ecltop_timing_diff_vs_toptop_bad[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff, top_top_timing_combined_diff);
2025 h_top_ecltop_timing_diff_vs_toptop_bad[skim[ifill]]->Fill(ecl_top_top_timing_combined_diff, top_top_timing_combined_diff);
2026 h_gdl_ecltop_timing_diff_vs_ecltop_bad[skim[ifill]]->Fill(ecl_gdl_top_timing_combined_diff, ecl_top_top_timing_combined_diff);
2028 h_topCombinedTimingTopBad[skim[ifill]]->Fill(topCombinedTimingTop);
2029 h_topNSlotsCombinedTimingTopBad[skim[ifill]]->Fill(topNSlotsCombinedTimingTop);
2030 h_topNHitSumBad[skim[ifill]]->Fill((
int) hitsPerSlot);
2031 h_topLogLSumBad[skim[ifill]]->Fill((
int) logLPerSlot);
2033 h_topRvcDiff1Bad[skim[ifill]]->Fill(topRvcDiff1);
2034 h_topRvcDiff2Bad[skim[ifill]]->Fill(topRvcDiff2);
2035 h_topRvcDiff3Bad[skim[ifill]]->Fill(topRvcDiff3);
2036 h_topRvcDiff4Bad[skim[ifill]]->Fill(topRvcDiff4);
2038 h_topGdlRvcDiff1Bad[skim[ifill]]->Fill(topGdlRvcDiff1);
2039 h_topGdlRvcDiff2Bad[skim[ifill]]->Fill(topGdlRvcDiff2);
2040 h_topGdlRvcDiff3Bad[skim[ifill]]->Fill(topGdlRvcDiff3);
2042 h_gdl_gdltop_rvc_diff_bad[skim[ifill]]->Fill(gdl_top_rvc_diff);
2043 h_gdl_comtop_rvc_diff_bad[skim[ifill]]->Fill(com_top_rvc_diff);
2050 if (t0DecisionNumber == 0) {
2051 for (
unsigned ifill = 0; ifill < skim.size(); ifill++) {
2053 if (m_histLevel > 1) {
2054 if (gdlInfoAvailable) {
2055 h_gdl_ecltop_timing_diff_vs_toptop[skim[ifill]][histClass]->Fill(ecl_gdl_top_timing_combined_diff, top_top_timing_combined_diff);
2056 h_top_ecltop_timing_diff_vs_toptop[skim[ifill]][histClass]->Fill(ecl_top_top_timing_combined_diff, top_top_timing_combined_diff);
2057 h_gdl_ecltop_timing_diff_vs_ecltop[skim[ifill]][histClass]->Fill(ecl_gdl_top_timing_combined_diff,
2058 ecl_top_top_timing_combined_diff);
2059 h_gdl_ecltop_timing_diff_vs_ecltop_best_slot[skim[ifill]][histClass]->Fill(ecl_gdl_top_timing_combined_diff,
2060 ecl_top_top_timing_best_slot_diff);
2062 h_top_ecltop_timing_diff_2ns[skim[ifill]][histClass]->Fill(ecl_top_top_timing_combined_diff);
2065 if (top_timing_same) {
2066 h_top_ecltop_timing_combined_diff_2ns[skim[ifill]][histClass]->Fill(ecl_top_top_timing_combined_diff);
2067 h_top_ecltop_timing_best_slot_diff_2ns[skim[ifill]][histClass]->Fill(ecl_top_top_timing_best_slot_diff);
2068 h_topNHitBestSlot[skim[ifill]][histClass]->Fill(nHitsSlotBest);
2073 h_topCombinedTimingTop[skim[ifill]][histClass]->Fill(topCombinedTimingTop);
2074 h_topNSlotsCombinedTimingTop[skim[ifill]][histClass]->Fill(topNSlotsCombinedTimingTop);
2075 h_topNHitSum[skim[ifill]][histClass]->Fill((
int) hitsPerSlot);
2076 h_topLogLSum[skim[ifill]][histClass]->Fill((
int) logLPerSlot);
2079 h_gdl_ecltop_timing_diff_vs_nslots_2ns[skim[ifill]]->Fill(ecl_top_timing_diff, topNSlotsCombinedTimingTop);
2080 h_top_ecltop_timing_diff_combined_2ns[skim[ifill]]->Fill(ecl_top_top_timing_combined_diff);
2081 h_top_ecltop_timing_diff_best_slot_2ns[skim[ifill]]->Fill(ecl_top_top_timing_best_slot_diff);
HistoModule.h is supposed to be used instead of Module.h for the modules with histogram definitions t...
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
Type-safe access to single objects in the data store.
bool isValid() const
Check whether the object was created.
int getTCId() const
The method to get cell id.
int getTCTime() const
The method to get hit average time.
virtual void initialize() override
initialize
StoreArray< TRGECLUnpackerStore > trgeclHitArray
Trg ECL Unpacker TC output.
TDirectory * oldDir
TDirectory.
virtual void event() override
Event.
virtual void endRun() override
End Run.
TH1I * h_topSlotSegment[nskim_topdqm][16]
Combined t0 decisions: all, the earliest and second best.
TH1I * h_N_decision[nskim_topdqm][nHistClasses]
Number of TOP L1 decisions.
virtual void beginRun() override
begin Run
TRGTOPDQMModule()
Costructor.
TDirectory * dirDQM
TDirectory.
virtual void defineHisto() override
Define Histogram.
int getTCThetaIdFromTCId(int)
get [TC Theta ID] from [TC ID]
int getTCPhiIdFromTCId(int)
get [TC Phi ID] from [TC ID]
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
@ c_accept
Accept this event.
Abstract base class for different kinds of events.