22#include <trg/top/modules/trgtopWaveformPlotter/TRGTOPWaveformPlotterModule.h>
25#include <framework/datastore/StoreObjPtr.h>
26#include <framework/datastore/StoreArray.h>
28#include "trg/top/dataobjects/TRGTOPTimeStampsSlot.h"
29#include "trg/top/dataobjects/TRGTOPTimeStamp.h"
31#include "trg/top/dataobjects/TRGTOPWaveFormTimeStampsSlot.h"
32#include "trg/top/dataobjects/TRGTOPWaveFormTimeStamp.h"
34#include "trg/top/dataobjects/TRGTOPSlotTiming.h"
36#include "trg/top/dataobjects/TRGTOPTimingISimSlot.h"
38#include <framework/datastore/RelationVector.h>
40#include <framework/logging/Logger.h>
41#include <boost/algorithm/string.hpp>
59 addParam(
"plottingMode", m_plottingMode,
60 "Plotting mode: 0 (forced ranges for x and y), 1 (slot-level zoom-in), 2 (global zoom-in; default), 3 (global zoom-in for y and xmax, forced left-side edge for x), 4 (global zoom-in for y, forced range for x), anything else (full ranges)",
63 addParam(
"firstAssumedClockCycle", m_firstAssumedClockCycle,
64 "First assumed clock cycle for main readout hits",
67 addParam(
"cutPlotMinNumberTriggerReadoutHits", m_cutPlotMinNumberTriggerReadoutHits,
68 "Minimum number of trigger timestamps cut for drawing the waveform",
71 addParam(
"cutPlotMinNumberMainReadoutHits", m_cutPlotMinNumberMainReadoutHits,
72 "Minimum number of main readout hits cut for drawing the hits",
75 addParam(
"markerSizeHits", m_markerSizeHits,
76 "Marker size (default: 0.85) used to plot main readout hits",
79 addParam(
"markerSizeTimestamps", m_markerSizeTimestamps,
80 "Marker size (default: 0.65) used to plot trigger readout timestamps",
83 addParam(
"markerTypeHits", m_markerTypeHits,
84 "Marker type (default: 21) used to plot main readout hits",
87 addParam(
"markerTypeTimestamps", m_markerTypeTimestamps,
88 "Marker type (default: 20) used to plot trigger readout timestamps",
92 "xMin for plotting (default: 100)",
96 "xMax for plotting (default: 200)",
100 "yMin for plotting (default: 0)",
104 "yMax for plotting (default: 47000)",
108 "Show grid x (default: 0 (no))",
112 "Show grid y (default: 1 (yes))",
115 addParam(
"canvasXMin", m_canvasXMin,
116 "TCanvas x min (default: 0))",
119 addParam(
"canvasYMin", m_canvasYMin,
120 "TCanvas y min (default: 0))",
123 addParam(
"canvasXSize", m_canvasXSize,
124 "TCanvas x size (default: 900))",
127 addParam(
"canvasYSize", m_canvasYSize,
128 "TCanvas y size (default: 600))",
131 addParam(
"shiftCanvas", m_shiftCanvas,
132 "Shift canvases (default: 1 (yes)))",
135 addParam(
"xShiftCanvas", m_xShiftCanvas,
136 "x shift canvases (default: 900))",
139 addParam(
"yShiftCanvas", m_yShiftCanvas,
140 "y shift canvases (default: 600))",
163 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
164 m_timeStampsGraphMainReadout[slot - 1] = 0;
165 m_timeStampsGraphTriggerReadout[slot - 1] = 0;
166 m_myMultiGraph[slot - 1] = 0;
167 m_myPaveText[slot - 1] = 0;
186 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
192 if (m_timeStampsGraphMainReadout[slot - 1]) {
193 delete m_timeStampsGraphMainReadout[slot - 1];
194 m_timeStampsGraphMainReadout[slot - 1] = NULL;
197 if (m_timeStampsGraphTriggerReadout[slot - 1]) {
198 delete m_timeStampsGraphTriggerReadout[slot - 1];
199 m_timeStampsGraphTriggerReadout[slot - 1] = NULL;
202 if (m_myMultiGraph[slot - 1]) {
203 delete m_myMultiGraph[slot - 1];
204 m_myMultiGraph[slot - 1] = NULL;
207 if (m_myPaveText[slot - 1]) {
208 delete m_myPaveText[slot - 1];
209 m_myPaveText[slot - 1] = NULL;
242 bool topTRGISimMRODecisionPresent[NUMBER_OF_TOP_SLOTS] = {
false};
243 int topTRGISimMRODecisionTiming[NUMBER_OF_TOP_SLOTS] = {0};
244 int topTRGISimMRODecisionNTS[NUMBER_OF_TOP_SLOTS] = {0};
245 int topTRGISimMRODecisionNumber[NUMBER_OF_TOP_SLOTS] = {0};
247 std::string topTRGIsimMRODecisionText[NUMBER_OF_TOP_SLOTS];
248 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) topTRGIsimMRODecisionText[slot - 1] =
"All iSim TOP decisions: ";
250 for (
const auto& slotDecision : trgtopTimingISimMainReadoutAll) {
252 int slot = slotDecision.getSlotId();
254 topTRGISimMRODecisionPresent[slot - 1] =
true;
255 topTRGISimMRODecisionTiming[slot - 1] = slotDecision.getSlotTiming();
256 topTRGISimMRODecisionNTS[slot - 1] = topTRGISimMRODecisionNTS[slot - 1] + slotDecision.getSlotNHits();
257 topTRGISimMRODecisionNumber[slot - 1] = topTRGISimMRODecisionNumber[slot - 1] + 1;
259 std::stringstream ss1;
260 ss1 << slotDecision.getSlotNHits();
261 std::stringstream ss2;
262 ss2 << slotDecision.getSlotTiming();
263 std::stringstream ss3;
264 ss3 << slotDecision.getSlotDecisionClockCycle();
265 topTRGIsimMRODecisionText[slot - 1] = topTRGIsimMRODecisionText[slot - 1] +
" " + ss2.str() +
" ( " + ss1.str() +
" [" + ss3.str() +
272 bool topTRGISimWFRODecisionPresent[NUMBER_OF_TOP_SLOTS] = {
false};
273 int topTRGISimWFRODecisionTiming[NUMBER_OF_TOP_SLOTS] = {0};
274 int topTRGISimWFRODecisionNTS[NUMBER_OF_TOP_SLOTS] = {0};
275 int topTRGISimWFRODecisionNumber[NUMBER_OF_TOP_SLOTS] = {0};
277 std::string topTRGIsimWFRODecisionText[NUMBER_OF_TOP_SLOTS];
278 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) topTRGIsimWFRODecisionText[slot - 1] =
"All iSim TRG decisions: ";
280 for (
const auto& slotDecision : trgtopTimingISimTriggerReadoutAll) {
282 int slot = slotDecision.getSlotId();
284 topTRGISimWFRODecisionPresent[slot - 1] =
true;
285 topTRGISimWFRODecisionTiming[slot - 1] = slotDecision.getSlotTiming();
286 topTRGISimWFRODecisionNTS[slot - 1] = topTRGISimWFRODecisionNTS[slot - 1] + slotDecision.getSlotNHits();
287 topTRGISimWFRODecisionNumber[slot - 1] = topTRGISimWFRODecisionNumber[slot - 1] + 1;
289 std::stringstream ss1;
290 ss1 << slotDecision.getSlotNHits();
291 std::stringstream ss2;
292 ss2 << slotDecision.getSlotTiming();
293 std::stringstream ss3;
294 ss3 << slotDecision.getSlotDecisionClockCycle();
295 topTRGIsimWFRODecisionText[slot - 1] = topTRGIsimWFRODecisionText[slot - 1] +
" " + ss2.str() +
" ( " + ss1.str() +
" [" + ss3.str()
302 bool topTRGDecisionPresent[NUMBER_OF_TOP_SLOTS] = {
false};
303 int topTRGDecisionTiming[NUMBER_OF_TOP_SLOTS] = {0};
304 int topTRGDecisionNTS[NUMBER_OF_TOP_SLOTS] = {0};
305 int topTRGDecisionNumber[NUMBER_OF_TOP_SLOTS] = {0};
308 std::string topTRGDecisionText[NUMBER_OF_TOP_SLOTS];
309 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) topTRGDecisionText[slot - 1] =
"All online TRG decisions: ";
311 for (
const auto& slotDecision : trgtopSlotTimingAll) {
314 if (slotDecision.isThisBoard()) {
316 int slot = slotDecision.getSlotId();
318 topTRGDecisionPresent[slot - 1] =
true;
319 topTRGDecisionTiming[slot - 1] = slotDecision.getSlotTiming();
320 topTRGDecisionNTS[slot - 1] = topTRGDecisionNTS[slot - 1] + slotDecision.getSlotNHits();
322 topTRGDecisionNumber[slot - 1] = topTRGDecisionNumber[slot - 1] + 1;
324 std::stringstream ss1;
325 ss1 << slotDecision.getSlotNHits();
326 std::stringstream ss2;
327 ss2 << slotDecision.getSlotTiming() / 2;
328 std::stringstream ss3;
329 ss3 << slotDecision.getSlotDecisionClockCycle();
330 topTRGDecisionText[slot - 1] = topTRGDecisionText[slot - 1] +
" " + ss2.str() +
" ( " + ss1.str() +
" [" + ss3.str() +
"]" +
" ); ";
337 bool topTRGMROPresent[NUMBER_OF_TOP_SLOTS] = {
false};
338 int topTRGMRONTS[NUMBER_OF_TOP_SLOTS] = {0};
340 int clockCycleMainReadout[NUMBER_OF_TOP_SLOTS] = {0};
341 int indexClockCycleMainReadout[NUMBER_OF_TOP_SLOTS] = {0};
343 int xMinMRO[NUMBER_OF_TOP_SLOTS] = {0};
344 int xMaxMRO[NUMBER_OF_TOP_SLOTS] = {0};
346 int yMinMRO[NUMBER_OF_TOP_SLOTS] = {0};
347 int yMaxMRO[NUMBER_OF_TOP_SLOTS] = {0};
349 for (
const auto& slotTSS : trgtopTimeStampsSlots) {
351 int slot = slotTSS.getSlotId();
353 clockCycleMainReadout[slot - 1] = m_firstAssumedClockCycle;
355 xMinMRO[slot - 1] = -1;
356 xMaxMRO[slot - 1] = -1;
358 yMinMRO[slot - 1] = -1;
359 yMaxMRO[slot - 1] = -1;
361 int nHits = slotTSS.getNumberOfTimeStamps();
365 topTRGMROPresent[slot - 1] =
true;
366 topTRGMRONTS[slot - 1] = nHits;
368 if (topTRGMRONTS[slot - 1] > MAX_NUMBER_OF_CLOCK_CYCLES) topTRGMRONTS[slot - 1] = MAX_NUMBER_OF_CLOCK_CYCLES;
370 for (
const auto& timeStamp : slotTSS.getRelationsTo<
TRGTOPTimeStamp>()) {
371 int value = timeStamp.getTimeStamp();
373 m_clockCyclesMainReadout[slot - 1][indexClockCycleMainReadout[slot - 1]] = clockCycleMainReadout[slot - 1];
374 m_timeStampsMainReadout[slot - 1][indexClockCycleMainReadout[slot - 1]] = value;
376 if (xMinMRO[slot - 1] == -1
377 || clockCycleMainReadout[slot - 1] < xMinMRO[slot - 1]) xMinMRO[slot - 1] = clockCycleMainReadout[slot - 1];
378 if (xMaxMRO[slot - 1] == -1
379 || clockCycleMainReadout[slot - 1] > xMaxMRO[slot - 1]) xMaxMRO[slot - 1] = clockCycleMainReadout[slot - 1];
381 if (yMinMRO[slot - 1] == -1 || value < yMinMRO[slot - 1]) yMinMRO[slot - 1] = value;
382 if (yMaxMRO[slot - 1] == -1 || value > yMaxMRO[slot - 1]) yMaxMRO[slot - 1] = value;
384 if (indexClockCycleMainReadout[slot - 1] < MAX_NUMBER_OF_CLOCK_CYCLES) {
385 indexClockCycleMainReadout[slot - 1]++;
386 clockCycleMainReadout[slot - 1]++;
394 bool topTRGWFROPresent[NUMBER_OF_TOP_SLOTS] = {
false};
395 int topTRGWFRONTS[NUMBER_OF_TOP_SLOTS] = {0};
397 int clockCycleTriggerReadout[NUMBER_OF_TOP_SLOTS] = {0};
398 int indexClockCycleTriggerReadout[NUMBER_OF_TOP_SLOTS] = {0};
400 int xMinWFRO[NUMBER_OF_TOP_SLOTS] = {0};
401 int xMaxWFRO[NUMBER_OF_TOP_SLOTS] = {0};
403 int yMinWFRO[NUMBER_OF_TOP_SLOTS] = {0};
404 int yMaxWFRO[NUMBER_OF_TOP_SLOTS] = {0};
406 for (
auto& slotWaveFormTSS : trgtopWaveFormTimeStampsSlots) {
408 int slot = slotWaveFormTSS.getSlotId();
410 xMinWFRO[slot - 1] = -1;
411 xMaxWFRO[slot - 1] = -1;
413 yMinWFRO[slot - 1] = -1;
414 yMaxWFRO[slot - 1] = -1;
416 int nHits = slotWaveFormTSS.getNumberOfActualTimeStamps();
420 topTRGWFROPresent[slot - 1] =
true;
421 topTRGWFRONTS[slot - 1] = nHits;
423 if (topTRGWFRONTS[slot - 1] > MAX_NUMBER_OF_CLOCK_CYCLES) topTRGWFRONTS[slot - 1] = MAX_NUMBER_OF_CLOCK_CYCLES;
427 if (!timeStamp.isEmptyClockCycle()) {
429 int value = timeStamp.getTimeStamp();
431 m_clockCyclesTriggerReadout[slot - 1][indexClockCycleTriggerReadout[slot - 1]] = clockCycleTriggerReadout[slot - 1];
432 m_timeStampsTriggerReadout[slot - 1][indexClockCycleTriggerReadout[slot - 1]] = value;
434 if (xMinWFRO[slot - 1] == -1
435 || clockCycleTriggerReadout[slot - 1] < xMinWFRO[slot - 1]) xMinWFRO[slot - 1] = clockCycleTriggerReadout[slot - 1];
436 if (xMaxWFRO[slot - 1] == -1
437 || clockCycleTriggerReadout[slot - 1] > xMaxWFRO[slot - 1]) xMaxWFRO[slot - 1] = clockCycleTriggerReadout[slot - 1];
439 if (yMinWFRO[slot - 1] == -1 || value < yMinWFRO[slot - 1]) yMinWFRO[slot - 1] = value;
440 if (yMaxWFRO[slot - 1] == -1 || value > yMaxWFRO[slot - 1]) yMaxWFRO[slot - 1] = value;
442 if (indexClockCycleTriggerReadout[slot - 1] < MAX_NUMBER_OF_CLOCK_CYCLES) {
443 indexClockCycleTriggerReadout[slot - 1]++;
446 clockCycleTriggerReadout[slot - 1]++;
459 bool plotMyCanvas[NUMBER_OF_TOP_SLOTS] = {
false};
466 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
467 if (topTRGMRONTS[slot - 1] > 0 || topTRGWFRONTS[slot - 1] > 0) {
468 if (topTRGMRONTS[slot - 1] >= m_cutPlotMinNumberMainReadoutHits) {
469 if (topTRGWFRONTS[slot - 1] >= m_cutPlotMinNumberTriggerReadoutHits) {
470 plotMyCanvas[slot - 1] =
true;
471 if (xMinMRO[slot - 1] != -1 && (xMin == -1 || xMinMRO[slot - 1] < xMin)) xMin = xMinMRO[slot - 1];
472 if (xMaxMRO[slot - 1] != -1 && (xMax == -1 || xMaxMRO[slot - 1] > xMax)) xMax = xMaxMRO[slot - 1];
473 if (yMinMRO[slot - 1] != -1 && (yMin == -1 || yMinMRO[slot - 1] < yMin)) yMin = yMinMRO[slot - 1];
474 if (yMaxMRO[slot - 1] != -1 && (yMax == -1 || yMaxMRO[slot - 1] > yMax)) yMax = yMaxMRO[slot - 1];
476 if (xMinWFRO[slot - 1] != -1 && (xMin == -1 || xMinWFRO[slot - 1] < xMin)) xMin = xMinWFRO[slot - 1];
477 if (xMaxWFRO[slot - 1] != -1 && (xMax == -1 || xMaxWFRO[slot - 1] > xMax)) xMax = xMaxWFRO[slot - 1];
478 if (yMinWFRO[slot - 1] != -1 && (yMin == -1 || yMinWFRO[slot - 1] < yMin)) yMin = yMinWFRO[slot - 1];
479 if (yMaxWFRO[slot - 1] != -1 && (yMax == -1 || yMaxWFRO[slot - 1] > yMax)) yMax = yMaxWFRO[slot - 1];
485 xMin = std::max(xMin - 10, 0);
487 yMin = std::max(yMin - 10, 0);
490 std::string myMultiGraphTitle[NUMBER_OF_TOP_SLOTS];
492 std::string myPaveTextInfo[NUMBER_OF_TOP_SLOTS][8];
494 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
496 if (plotMyCanvas[slot - 1]) {
498 m_myMultiGraph[slot - 1] =
new TMultiGraph();
502 std::stringstream slotInfo;
504 myMultiGraphTitle[slot - 1] =
"Slot " + slotInfo.str() +
" : ";
506 m_myPaveText[slot - 1] =
new TPaveText(0.40, 0.10, 0.90, 0.30,
"bl NDC");
509 if (topTRGMROPresent[slot - 1]) {
511 m_timeStampsGraphMainReadout[slot - 1] =
new TGraph(topTRGMRONTS[slot - 1], &m_clockCyclesMainReadout[slot - 1][0],
512 &m_timeStampsMainReadout[slot - 1][0]);
517 m_timeStampsGraphMainReadout[slot - 1]->SetMarkerStyle(m_markerTypeHits);
518 m_timeStampsGraphMainReadout[slot - 1]->SetMarkerSize(m_markerSizeHits);
519 m_timeStampsGraphMainReadout[slot - 1]->SetMarkerColor(kRed);
521 m_myMultiGraph[slot - 1]->Add(m_timeStampsGraphMainReadout[slot - 1],
"AP");
525 if (topTRGWFROPresent[slot - 1]) {
527 m_timeStampsGraphTriggerReadout[slot - 1] =
new TGraph(topTRGWFRONTS[slot - 1], &m_clockCyclesTriggerReadout[slot - 1][0],
528 &m_timeStampsTriggerReadout[slot - 1][0]);
533 m_timeStampsGraphTriggerReadout[slot - 1]->SetMarkerStyle(m_markerTypeTimestamps);
534 m_timeStampsGraphTriggerReadout[slot - 1]->SetMarkerSize(m_markerSizeTimestamps);
535 m_timeStampsGraphTriggerReadout[slot - 1]->SetLineWidth(3);
538 if (!topTRGDecisionPresent[slot - 1]) color = kBlack;
540 m_timeStampsGraphTriggerReadout[slot - 1]->SetMarkerColor(color);
542 m_myMultiGraph[slot - 1]->Add(m_timeStampsGraphTriggerReadout[slot - 1],
"AP");
547 int canvasXMin = m_canvasXMin;
548 int canvasYMin = m_canvasYMin;
549 int canvasXSize = m_canvasXSize;
550 int canvasYSize = m_canvasYSize;
552 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
554 if (plotMyCanvas[slot - 1]) {
556 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" TOP / TRG / L1 / iSim TOP / iSim TRG hits:";
558 std::stringstream nHitInfoMainReadout;
559 nHitInfoMainReadout << topTRGMRONTS[slot - 1];
560 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" " + nHitInfoMainReadout.str();
562 myPaveTextInfo[slot - 1][0] =
"N hits (TOP readout): " + nHitInfoMainReadout.str();
564 std::stringstream nHitInfoTriggerReadout;
565 nHitInfoTriggerReadout << topTRGWFRONTS[slot - 1];
566 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoTriggerReadout.str();
568 myPaveTextInfo[slot - 1][1] =
"N timestamps (TRG readout): " + nHitInfoTriggerReadout.str();
570 std::stringstream nHitInfoTriggerDecision;
571 nHitInfoTriggerDecision << topTRGDecisionNTS[slot - 1];
572 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoTriggerDecision.str();
574 myPaveTextInfo[slot - 1][2] =
"N timestamps TRG online: " + nHitInfoTriggerDecision.str();
576 std::stringstream nHitInfoISimTriggerDecisionMainReadout;
577 nHitInfoISimTriggerDecisionMainReadout << topTRGISimMRODecisionNTS[slot - 1];
578 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoISimTriggerDecisionMainReadout.str();
580 myPaveTextInfo[slot - 1][3] =
"N timestamps TRG ISim (all, TOP readout): " + nHitInfoISimTriggerDecisionMainReadout.str();
582 std::stringstream nHitInfoISimTriggerDecisionTriggerReadout;
583 nHitInfoISimTriggerDecisionTriggerReadout << topTRGISimWFRODecisionNTS[slot - 1];
584 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoISimTriggerDecisionTriggerReadout.str();
586 myPaveTextInfo[slot - 1][4] =
"N timestamps TRG ISim (all, TRG readout): " + nHitInfoISimTriggerDecisionTriggerReadout.str();
590 if (topTRGDecisionPresent[slot - 1]) {
591 std::stringstream nTimingInfoTriggerDecision;
592 nTimingInfoTriggerDecision << topTRGDecisionTiming[slot - 1] / 2;
593 std::stringstream nNumberInfoTriggerDecision;
594 nNumberInfoTriggerDecision << topTRGDecisionNumber[slot - 1];
595 myPaveTextInfo[slot - 1][5] =
"Number of online TRG decisions: " + nNumberInfoTriggerDecision.str() +
", most recent t0: " +
596 nTimingInfoTriggerDecision.str();
600 myPaveTextInfo[slot - 1][5] =
"No online TRG decisions";
604 if (topTRGISimMRODecisionPresent[slot - 1]) {
605 std::stringstream nTimingInfoTriggerDecision;
606 nTimingInfoTriggerDecision << topTRGISimMRODecisionTiming[slot - 1];
607 std::stringstream nNumberInfoTriggerDecision;
608 nNumberInfoTriggerDecision << topTRGISimMRODecisionNumber[slot - 1];
609 myPaveTextInfo[slot - 1][6] =
"Number of ISim TOP readout TRG decisions: " + nNumberInfoTriggerDecision.str() +
", most recent t0: "
610 + nTimingInfoTriggerDecision.str();
614 myPaveTextInfo[slot - 1][6] =
"No iSim TOP readout TRG decisions";
618 if (topTRGISimWFRODecisionPresent[slot - 1]) {
619 std::stringstream nTimingInfoTriggerDecision;
620 nTimingInfoTriggerDecision << topTRGISimWFRODecisionTiming[slot - 1];
621 std::stringstream nNumberInfoTriggerDecision;
622 nNumberInfoTriggerDecision << topTRGISimWFRODecisionNumber[slot - 1];
623 myPaveTextInfo[slot - 1][7] =
"Number of ISim TRG readout TRG decisions: " + nNumberInfoTriggerDecision.str() +
", most recent t0: "
624 + nTimingInfoTriggerDecision.str();
628 myPaveTextInfo[slot - 1][7] =
"No iSim TRG readout TRG decisions";
632 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
"; Clock cycle (8ns units); Hit time (2ns units)";
633 m_myMultiGraph[slot - 1]->SetTitle(myMultiGraphTitle[slot - 1].c_str());
635 std::stringstream slotInfo;
637 std::string name =
"c_" + slotInfo.str();
638 std::string title =
"Main readout hits (red) and trigger readout timestamps (blue/black) for slot " + slotInfo.str();
639 m_myCanvas[slot - 1] =
new TCanvas(name.c_str(), title.c_str(), canvasXMin, canvasYMin, canvasXSize, canvasYSize);
641 canvasXMin = canvasXMin + m_xShiftCanvas;
642 if (canvasXMin >= 1000) {
643 canvasXMin = m_canvasXMin;
644 canvasYMin = canvasYMin + m_yShiftCanvas;
645 if (canvasYMin >= 700) {
646 canvasYMin = m_canvasYMin;
651 m_myMultiGraph[slot - 1]->Draw(
"AP");
653 TAxis* xAxis = m_myMultiGraph[slot - 1]->GetXaxis();
655 if (m_plottingMode == 0) {
656 m_myMultiGraph[slot - 1]->SetMinimum(m_yMin);
657 m_myMultiGraph[slot - 1]->SetMaximum(m_yMax);
658 xAxis->SetLimits(m_xMin, m_xMax);
659 }
else if (m_plottingMode == 1) {
660 m_myMultiGraph[slot - 1]->SetMinimum(std::min(yMinMRO[slot - 1], yMinWFRO[slot - 1]));
661 m_myMultiGraph[slot - 1]->SetMaximum(std::max(yMaxMRO[slot - 1], yMaxWFRO[slot - 1]));
662 xAxis->SetLimits(std::min(xMinMRO[slot - 1], xMinWFRO[slot - 1]), std::max(xMaxMRO[slot - 1], xMaxWFRO[slot - 1]));
663 }
else if (m_plottingMode == 2) {
664 m_myMultiGraph[slot - 1]->SetMinimum(yMin);
665 m_myMultiGraph[slot - 1]->SetMaximum(yMax);
666 xAxis->SetLimits(xMin, xMax);
667 }
else if (m_plottingMode == 3) {
668 m_myMultiGraph[slot - 1]->SetMinimum(yMin);
669 m_myMultiGraph[slot - 1]->SetMaximum(yMax);
670 xAxis->SetLimits(m_xMin, xMax);
671 }
else if (m_plottingMode == 4) {
672 m_myMultiGraph[slot - 1]->SetMinimum(yMin);
673 m_myMultiGraph[slot - 1]->SetMaximum(yMax);
674 xAxis->SetLimits(m_xMin, m_xMax);
676 m_myMultiGraph[slot - 1]->SetMinimum(0);
677 m_myMultiGraph[slot - 1]->SetMaximum(MAX_TIMESTAMP_RANGE);
678 xAxis->SetLimits(0, MAX_NUMBER_OF_CLOCK_CYCLES);
681 m_myMultiGraph[slot - 1]->Draw(
"AP");
690 m_myPaveText[slot - 1]->AddText(myPaveTextInfo[slot - 1][5].c_str());
691 m_myPaveText[slot - 1]->AddText(myPaveTextInfo[slot - 1][6].c_str());
692 m_myPaveText[slot - 1]->AddText(myPaveTextInfo[slot - 1][7].c_str());
694 m_myPaveText[slot - 1]->AddText(topTRGDecisionText[slot - 1].c_str());
695 m_myPaveText[slot - 1]->AddText(topTRGIsimMRODecisionText[slot - 1].c_str());
696 m_myPaveText[slot - 1]->AddText(topTRGIsimWFRODecisionText[slot - 1].c_str());
698 m_myPaveText[slot - 1]->SetBorderSize(1);
700 m_myPaveText[slot - 1]->SetFillStyle(0);
701 m_myPaveText[slot - 1]->SetTextFont(40);
702 m_myPaveText[slot - 1]->SetTextAlign(12);
703 m_myPaveText[slot - 1]->Draw();
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.
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.
Abstract base class for different kinds of events.