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>
58 addParam(
"plottingMode", m_plottingMode,
59 "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)",
62 addParam(
"firstAssumedClockCycle", m_firstAssumedClockCycle,
63 "First assumed clock cycle for main readout hits",
66 addParam(
"cutPlotMinNumberTriggerReadoutHits", m_cutPlotMinNumberTriggerReadoutHits,
67 "Minimum number of trigger timestamps cut for drawing the waveform",
70 addParam(
"cutPlotMinNumberMainReadoutHits", m_cutPlotMinNumberMainReadoutHits,
71 "Minimum number of main readout hits cut for drawing the hits",
74 addParam(
"markerSizeHits", m_markerSizeHits,
75 "Marker size (default: 0.85) used to plot main readout hits",
78 addParam(
"markerSizeTimestamps", m_markerSizeTimestamps,
79 "Marker size (default: 0.65) used to plot trigger readout timestamps",
82 addParam(
"markerTypeHits", m_markerTypeHits,
83 "Marker type (default: 21) used to plot main readout hits",
86 addParam(
"markerTypeTimestamps", m_markerTypeTimestamps,
87 "Marker type (default: 20) used to plot trigger readout timestamps",
91 "xMin for plotting (default: 100)",
95 "xMax for plotting (default: 200)",
99 "yMin for plotting (default: 0)",
103 "yMax for plotting (default: 47000)",
107 "Show grid x (default: 0 (no))",
111 "Show grid y (default: 1 (yes))",
114 addParam(
"canvasXMin", m_canvasXMin,
115 "TCanvas x min (default: 0))",
118 addParam(
"canvasYMin", m_canvasYMin,
119 "TCanvas y min (default: 0))",
122 addParam(
"canvasXSize", m_canvasXSize,
123 "TCanvas x size (default: 900))",
126 addParam(
"canvasYSize", m_canvasYSize,
127 "TCanvas y size (default: 600))",
130 addParam(
"shiftCanvas", m_shiftCanvas,
131 "Shift canvases (default: 1 (yes)))",
134 addParam(
"xShiftCanvas", m_xShiftCanvas,
135 "x shift canvases (default: 900))",
138 addParam(
"yShiftCanvas", m_yShiftCanvas,
139 "y shift canvases (default: 600))",
162 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
163 m_timeStampsGraphMainReadout[slot - 1] = 0;
164 m_timeStampsGraphTriggerReadout[slot - 1] = 0;
165 m_myMultiGraph[slot - 1] = 0;
166 m_myPaveText[slot - 1] = 0;
185 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
191 if (m_timeStampsGraphMainReadout[slot - 1]) {
192 delete m_timeStampsGraphMainReadout[slot - 1];
193 m_timeStampsGraphMainReadout[slot - 1] = NULL;
196 if (m_timeStampsGraphTriggerReadout[slot - 1]) {
197 delete m_timeStampsGraphTriggerReadout[slot - 1];
198 m_timeStampsGraphTriggerReadout[slot - 1] = NULL;
201 if (m_myMultiGraph[slot - 1]) {
202 delete m_myMultiGraph[slot - 1];
203 m_myMultiGraph[slot - 1] = NULL;
206 if (m_myPaveText[slot - 1]) {
207 delete m_myPaveText[slot - 1];
208 m_myPaveText[slot - 1] = NULL;
241 bool topTRGISimMRODecisionPresent[NUMBER_OF_TOP_SLOTS] = {
false};
242 int topTRGISimMRODecisionTiming[NUMBER_OF_TOP_SLOTS] = {0};
243 int topTRGISimMRODecisionNTS[NUMBER_OF_TOP_SLOTS] = {0};
244 int topTRGISimMRODecisionNumber[NUMBER_OF_TOP_SLOTS] = {0};
246 std::string topTRGIsimMRODecisionText[NUMBER_OF_TOP_SLOTS];
247 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) topTRGIsimMRODecisionText[slot - 1] =
"All iSim TOP decisions: ";
249 for (
const auto& slotDecision : trgtopTimingISimMainReadoutAll) {
251 int slot = slotDecision.getSlotId();
253 topTRGISimMRODecisionPresent[slot - 1] =
true;
254 topTRGISimMRODecisionTiming[slot - 1] = slotDecision.getSlotTiming();
255 topTRGISimMRODecisionNTS[slot - 1] = topTRGISimMRODecisionNTS[slot - 1] + slotDecision.getSlotNHits();
256 topTRGISimMRODecisionNumber[slot - 1] = topTRGISimMRODecisionNumber[slot - 1] + 1;
258 std::stringstream ss1;
259 ss1 << slotDecision.getSlotNHits();
260 std::stringstream ss2;
261 ss2 << slotDecision.getSlotTiming();
262 std::stringstream ss3;
263 ss3 << slotDecision.getSlotDecisionClockCycle();
264 topTRGIsimMRODecisionText[slot - 1] = topTRGIsimMRODecisionText[slot - 1] +
" " + ss2.str() +
" ( " + ss1.str() +
" [" + ss3.str() +
271 bool topTRGISimWFRODecisionPresent[NUMBER_OF_TOP_SLOTS] = {
false};
272 int topTRGISimWFRODecisionTiming[NUMBER_OF_TOP_SLOTS] = {0};
273 int topTRGISimWFRODecisionNTS[NUMBER_OF_TOP_SLOTS] = {0};
274 int topTRGISimWFRODecisionNumber[NUMBER_OF_TOP_SLOTS] = {0};
276 std::string topTRGIsimWFRODecisionText[NUMBER_OF_TOP_SLOTS];
277 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) topTRGIsimWFRODecisionText[slot - 1] =
"All iSim TRG decisions: ";
279 for (
const auto& slotDecision : trgtopTimingISimTriggerReadoutAll) {
281 int slot = slotDecision.getSlotId();
283 topTRGISimWFRODecisionPresent[slot - 1] =
true;
284 topTRGISimWFRODecisionTiming[slot - 1] = slotDecision.getSlotTiming();
285 topTRGISimWFRODecisionNTS[slot - 1] = topTRGISimWFRODecisionNTS[slot - 1] + slotDecision.getSlotNHits();
286 topTRGISimWFRODecisionNumber[slot - 1] = topTRGISimWFRODecisionNumber[slot - 1] + 1;
288 std::stringstream ss1;
289 ss1 << slotDecision.getSlotNHits();
290 std::stringstream ss2;
291 ss2 << slotDecision.getSlotTiming();
292 std::stringstream ss3;
293 ss3 << slotDecision.getSlotDecisionClockCycle();
294 topTRGIsimWFRODecisionText[slot - 1] = topTRGIsimWFRODecisionText[slot - 1] +
" " + ss2.str() +
" ( " + ss1.str() +
" [" + ss3.str()
301 bool topTRGDecisionPresent[NUMBER_OF_TOP_SLOTS] = {
false};
302 int topTRGDecisionTiming[NUMBER_OF_TOP_SLOTS] = {0};
303 int topTRGDecisionNTS[NUMBER_OF_TOP_SLOTS] = {0};
304 int topTRGDecisionNumber[NUMBER_OF_TOP_SLOTS] = {0};
307 std::string topTRGDecisionText[NUMBER_OF_TOP_SLOTS];
308 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) topTRGDecisionText[slot - 1] =
"All online TRG decisions: ";
310 for (
const auto& slotDecision : trgtopSlotTimingAll) {
313 if (slotDecision.isThisBoard()) {
315 int slot = slotDecision.getSlotId();
317 topTRGDecisionPresent[slot - 1] =
true;
318 topTRGDecisionTiming[slot - 1] = slotDecision.getSlotTiming();
319 topTRGDecisionNTS[slot - 1] = topTRGDecisionNTS[slot - 1] + slotDecision.getSlotNHits();
321 topTRGDecisionNumber[slot - 1] = topTRGDecisionNumber[slot - 1] + 1;
323 std::stringstream ss1;
324 ss1 << slotDecision.getSlotNHits();
325 std::stringstream ss2;
326 ss2 << slotDecision.getSlotTiming() / 2;
327 std::stringstream ss3;
328 ss3 << slotDecision.getSlotDecisionClockCycle();
329 topTRGDecisionText[slot - 1] = topTRGDecisionText[slot - 1] +
" " + ss2.str() +
" ( " + ss1.str() +
" [" + ss3.str() +
"]" +
" ); ";
336 bool topTRGMROPresent[NUMBER_OF_TOP_SLOTS] = {
false};
337 int topTRGMRONTS[NUMBER_OF_TOP_SLOTS] = {0};
339 int clockCycleMainReadout[NUMBER_OF_TOP_SLOTS] = {0};
340 int indexClockCycleMainReadout[NUMBER_OF_TOP_SLOTS] = {0};
342 int xMinMRO[NUMBER_OF_TOP_SLOTS] = {0};
343 int xMaxMRO[NUMBER_OF_TOP_SLOTS] = {0};
345 int yMinMRO[NUMBER_OF_TOP_SLOTS] = {0};
346 int yMaxMRO[NUMBER_OF_TOP_SLOTS] = {0};
348 for (
const auto& slotTSS : trgtopTimeStampsSlots) {
350 int slot = slotTSS.getSlotId();
352 clockCycleMainReadout[slot - 1] = m_firstAssumedClockCycle;
354 xMinMRO[slot - 1] = -1;
355 xMaxMRO[slot - 1] = -1;
357 yMinMRO[slot - 1] = -1;
358 yMaxMRO[slot - 1] = -1;
360 int nHits = slotTSS.getNumberOfTimeStamps();
364 topTRGMROPresent[slot - 1] =
true;
365 topTRGMRONTS[slot - 1] = nHits;
367 if (topTRGMRONTS[slot - 1] > MAX_NUMBER_OF_CLOCK_CYCLES) topTRGMRONTS[slot - 1] = MAX_NUMBER_OF_CLOCK_CYCLES;
369 for (
const auto& timeStamp : slotTSS.getRelationsTo<
TRGTOPTimeStamp>()) {
370 int value = timeStamp.getTimeStamp();
372 m_clockCyclesMainReadout[slot - 1][indexClockCycleMainReadout[slot - 1]] = clockCycleMainReadout[slot - 1];
373 m_timeStampsMainReadout[slot - 1][indexClockCycleMainReadout[slot - 1]] = value;
375 if (xMinMRO[slot - 1] == -1
376 || clockCycleMainReadout[slot - 1] < xMinMRO[slot - 1]) xMinMRO[slot - 1] = clockCycleMainReadout[slot - 1];
377 if (xMaxMRO[slot - 1] == -1
378 || clockCycleMainReadout[slot - 1] > xMaxMRO[slot - 1]) xMaxMRO[slot - 1] = clockCycleMainReadout[slot - 1];
380 if (yMinMRO[slot - 1] == -1 || value < yMinMRO[slot - 1]) yMinMRO[slot - 1] = value;
381 if (yMaxMRO[slot - 1] == -1 || value > yMaxMRO[slot - 1]) yMaxMRO[slot - 1] = value;
383 if (indexClockCycleMainReadout[slot - 1] < MAX_NUMBER_OF_CLOCK_CYCLES) {
384 indexClockCycleMainReadout[slot - 1]++;
385 clockCycleMainReadout[slot - 1]++;
393 bool topTRGWFROPresent[NUMBER_OF_TOP_SLOTS] = {
false};
394 int topTRGWFRONTS[NUMBER_OF_TOP_SLOTS] = {0};
396 int clockCycleTriggerReadout[NUMBER_OF_TOP_SLOTS] = {0};
397 int indexClockCycleTriggerReadout[NUMBER_OF_TOP_SLOTS] = {0};
399 int xMinWFRO[NUMBER_OF_TOP_SLOTS] = {0};
400 int xMaxWFRO[NUMBER_OF_TOP_SLOTS] = {0};
402 int yMinWFRO[NUMBER_OF_TOP_SLOTS] = {0};
403 int yMaxWFRO[NUMBER_OF_TOP_SLOTS] = {0};
405 for (
auto& slotWaveFormTSS : trgtopWaveFormTimeStampsSlots) {
407 int slot = slotWaveFormTSS.getSlotId();
409 xMinWFRO[slot - 1] = -1;
410 xMaxWFRO[slot - 1] = -1;
412 yMinWFRO[slot - 1] = -1;
413 yMaxWFRO[slot - 1] = -1;
415 int nHits = slotWaveFormTSS.getNumberOfActualTimeStamps();
419 topTRGWFROPresent[slot - 1] =
true;
420 topTRGWFRONTS[slot - 1] = nHits;
422 if (topTRGWFRONTS[slot - 1] > MAX_NUMBER_OF_CLOCK_CYCLES) topTRGWFRONTS[slot - 1] = MAX_NUMBER_OF_CLOCK_CYCLES;
426 if (!timeStamp.isEmptyClockCycle()) {
428 int value = timeStamp.getTimeStamp();
430 m_clockCyclesTriggerReadout[slot - 1][indexClockCycleTriggerReadout[slot - 1]] = clockCycleTriggerReadout[slot - 1];
431 m_timeStampsTriggerReadout[slot - 1][indexClockCycleTriggerReadout[slot - 1]] = value;
433 if (xMinWFRO[slot - 1] == -1
434 || clockCycleTriggerReadout[slot - 1] < xMinWFRO[slot - 1]) xMinWFRO[slot - 1] = clockCycleTriggerReadout[slot - 1];
435 if (xMaxWFRO[slot - 1] == -1
436 || clockCycleTriggerReadout[slot - 1] > xMaxWFRO[slot - 1]) xMaxWFRO[slot - 1] = clockCycleTriggerReadout[slot - 1];
438 if (yMinWFRO[slot - 1] == -1 || value < yMinWFRO[slot - 1]) yMinWFRO[slot - 1] = value;
439 if (yMaxWFRO[slot - 1] == -1 || value > yMaxWFRO[slot - 1]) yMaxWFRO[slot - 1] = value;
441 if (indexClockCycleTriggerReadout[slot - 1] < MAX_NUMBER_OF_CLOCK_CYCLES) {
442 indexClockCycleTriggerReadout[slot - 1]++;
445 clockCycleTriggerReadout[slot - 1]++;
458 bool plotMyCanvas[NUMBER_OF_TOP_SLOTS] = {
false};
465 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
466 if (topTRGMRONTS[slot - 1] > 0 || topTRGWFRONTS[slot - 1] > 0) {
467 if (topTRGMRONTS[slot - 1] >= m_cutPlotMinNumberMainReadoutHits) {
468 if (topTRGWFRONTS[slot - 1] >= m_cutPlotMinNumberTriggerReadoutHits) {
469 plotMyCanvas[slot - 1] =
true;
470 if (xMinMRO[slot - 1] != -1 && (xMin == -1 || xMinMRO[slot - 1] < xMin)) xMin = xMinMRO[slot - 1];
471 if (xMaxMRO[slot - 1] != -1 && (xMax == -1 || xMaxMRO[slot - 1] > xMax)) xMax = xMaxMRO[slot - 1];
472 if (yMinMRO[slot - 1] != -1 && (yMin == -1 || yMinMRO[slot - 1] < yMin)) yMin = yMinMRO[slot - 1];
473 if (yMaxMRO[slot - 1] != -1 && (yMax == -1 || yMaxMRO[slot - 1] > yMax)) yMax = yMaxMRO[slot - 1];
475 if (xMinWFRO[slot - 1] != -1 && (xMin == -1 || xMinWFRO[slot - 1] < xMin)) xMin = xMinWFRO[slot - 1];
476 if (xMaxWFRO[slot - 1] != -1 && (xMax == -1 || xMaxWFRO[slot - 1] > xMax)) xMax = xMaxWFRO[slot - 1];
477 if (yMinWFRO[slot - 1] != -1 && (yMin == -1 || yMinWFRO[slot - 1] < yMin)) yMin = yMinWFRO[slot - 1];
478 if (yMaxWFRO[slot - 1] != -1 && (yMax == -1 || yMaxWFRO[slot - 1] > yMax)) yMax = yMaxWFRO[slot - 1];
484 xMin = std::max(xMin - 10, 0);
486 yMin = std::max(yMin - 10, 0);
489 std::string myMultiGraphTitle[NUMBER_OF_TOP_SLOTS];
491 std::string myPaveTextInfo[NUMBER_OF_TOP_SLOTS][8];
493 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
495 if (plotMyCanvas[slot - 1]) {
497 m_myMultiGraph[slot - 1] =
new TMultiGraph();
501 std::stringstream slotInfo;
503 myMultiGraphTitle[slot - 1] =
"Slot " + slotInfo.str() +
" : ";
505 m_myPaveText[slot - 1] =
new TPaveText(0.40, 0.10, 0.90, 0.30,
"bl NDC");
508 if (topTRGMROPresent[slot - 1]) {
510 m_timeStampsGraphMainReadout[slot - 1] =
new TGraph(topTRGMRONTS[slot - 1], &m_clockCyclesMainReadout[slot - 1][0],
511 &m_timeStampsMainReadout[slot - 1][0]);
516 m_timeStampsGraphMainReadout[slot - 1]->SetMarkerStyle(m_markerTypeHits);
517 m_timeStampsGraphMainReadout[slot - 1]->SetMarkerSize(m_markerSizeHits);
518 m_timeStampsGraphMainReadout[slot - 1]->SetMarkerColor(kRed);
520 m_myMultiGraph[slot - 1]->Add(m_timeStampsGraphMainReadout[slot - 1],
"AP");
524 if (topTRGWFROPresent[slot - 1]) {
526 m_timeStampsGraphTriggerReadout[slot - 1] =
new TGraph(topTRGWFRONTS[slot - 1], &m_clockCyclesTriggerReadout[slot - 1][0],
527 &m_timeStampsTriggerReadout[slot - 1][0]);
532 m_timeStampsGraphTriggerReadout[slot - 1]->SetMarkerStyle(m_markerTypeTimestamps);
533 m_timeStampsGraphTriggerReadout[slot - 1]->SetMarkerSize(m_markerSizeTimestamps);
534 m_timeStampsGraphTriggerReadout[slot - 1]->SetLineWidth(3);
537 if (!topTRGDecisionPresent[slot - 1]) color = kBlack;
539 m_timeStampsGraphTriggerReadout[slot - 1]->SetMarkerColor(color);
541 m_myMultiGraph[slot - 1]->Add(m_timeStampsGraphTriggerReadout[slot - 1],
"AP");
546 int canvasXMin = m_canvasXMin;
547 int canvasYMin = m_canvasYMin;
548 int canvasXSize = m_canvasXSize;
549 int canvasYSize = m_canvasYSize;
551 for (
int slot = 1; slot <= NUMBER_OF_TOP_SLOTS; slot++) {
553 if (plotMyCanvas[slot - 1]) {
555 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" TOP / TRG / L1 / iSim TOP / iSim TRG hits:";
557 std::stringstream nHitInfoMainReadout;
558 nHitInfoMainReadout << topTRGMRONTS[slot - 1];
559 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" " + nHitInfoMainReadout.str();
561 myPaveTextInfo[slot - 1][0] =
"N hits (TOP readout): " + nHitInfoMainReadout.str();
563 std::stringstream nHitInfoTriggerReadout;
564 nHitInfoTriggerReadout << topTRGWFRONTS[slot - 1];
565 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoTriggerReadout.str();
567 myPaveTextInfo[slot - 1][1] =
"N timestamps (TRG readout): " + nHitInfoTriggerReadout.str();
569 std::stringstream nHitInfoTriggerDecision;
570 nHitInfoTriggerDecision << topTRGDecisionNTS[slot - 1];
571 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoTriggerDecision.str();
573 myPaveTextInfo[slot - 1][2] =
"N timestamps TRG online: " + nHitInfoTriggerDecision.str();
575 std::stringstream nHitInfoISimTriggerDecisionMainReadout;
576 nHitInfoISimTriggerDecisionMainReadout << topTRGISimMRODecisionNTS[slot - 1];
577 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoISimTriggerDecisionMainReadout.str();
579 myPaveTextInfo[slot - 1][3] =
"N timestamps TRG ISim (all, TOP readout): " + nHitInfoISimTriggerDecisionMainReadout.str();
581 std::stringstream nHitInfoISimTriggerDecisionTriggerReadout;
582 nHitInfoISimTriggerDecisionTriggerReadout << topTRGISimWFRODecisionNTS[slot - 1];
583 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
" / " + nHitInfoISimTriggerDecisionTriggerReadout.str();
585 myPaveTextInfo[slot - 1][4] =
"N timestamps TRG ISim (all, TRG readout): " + nHitInfoISimTriggerDecisionTriggerReadout.str();
589 if (topTRGDecisionPresent[slot - 1]) {
590 std::stringstream nTimingInfoTriggerDecision;
591 nTimingInfoTriggerDecision << topTRGDecisionTiming[slot - 1] / 2;
592 std::stringstream nNumberInfoTriggerDecision;
593 nNumberInfoTriggerDecision << topTRGDecisionNumber[slot - 1];
594 myPaveTextInfo[slot - 1][5] =
"Number of online TRG decisions: " + nNumberInfoTriggerDecision.str() +
", most recent t0: " +
595 nTimingInfoTriggerDecision.str();
599 myPaveTextInfo[slot - 1][5] =
"No online TRG decisions";
603 if (topTRGISimMRODecisionPresent[slot - 1]) {
604 std::stringstream nTimingInfoTriggerDecision;
605 nTimingInfoTriggerDecision << topTRGISimMRODecisionTiming[slot - 1];
606 std::stringstream nNumberInfoTriggerDecision;
607 nNumberInfoTriggerDecision << topTRGISimMRODecisionNumber[slot - 1];
608 myPaveTextInfo[slot - 1][6] =
"Number of ISim TOP readout TRG decisions: " + nNumberInfoTriggerDecision.str() +
", most recent t0: "
609 + nTimingInfoTriggerDecision.str();
613 myPaveTextInfo[slot - 1][6] =
"No iSim TOP readout TRG decisions";
617 if (topTRGISimWFRODecisionPresent[slot - 1]) {
618 std::stringstream nTimingInfoTriggerDecision;
619 nTimingInfoTriggerDecision << topTRGISimWFRODecisionTiming[slot - 1];
620 std::stringstream nNumberInfoTriggerDecision;
621 nNumberInfoTriggerDecision << topTRGISimWFRODecisionNumber[slot - 1];
622 myPaveTextInfo[slot - 1][7] =
"Number of ISim TRG readout TRG decisions: " + nNumberInfoTriggerDecision.str() +
", most recent t0: "
623 + nTimingInfoTriggerDecision.str();
627 myPaveTextInfo[slot - 1][7] =
"No iSim TRG readout TRG decisions";
631 myMultiGraphTitle[slot - 1] = myMultiGraphTitle[slot - 1] +
"; Clock cycle (8ns units); Hit time (2ns units)";
632 m_myMultiGraph[slot - 1]->SetTitle(myMultiGraphTitle[slot - 1].c_str());
634 std::stringstream slotInfo;
636 std::string name =
"c_" + slotInfo.str();
637 std::string title =
"Main readout hits (red) and trigger readout timestamps (blue/black) for slot " + slotInfo.str();
638 m_myCanvas[slot - 1] =
new TCanvas(name.c_str(), title.c_str(), canvasXMin, canvasYMin, canvasXSize, canvasYSize);
640 canvasXMin = canvasXMin + m_xShiftCanvas;
641 if (canvasXMin >= 1000) {
642 canvasXMin = m_canvasXMin;
643 canvasYMin = canvasYMin + m_yShiftCanvas;
644 if (canvasYMin >= 700) {
645 canvasYMin = m_canvasYMin;
650 m_myMultiGraph[slot - 1]->Draw(
"AP");
652 TAxis* xAxis = m_myMultiGraph[slot - 1]->GetXaxis();
654 if (m_plottingMode == 0) {
655 m_myMultiGraph[slot - 1]->SetMinimum(m_yMin);
656 m_myMultiGraph[slot - 1]->SetMaximum(m_yMax);
657 xAxis->SetLimits(m_xMin, m_xMax);
658 }
else if (m_plottingMode == 1) {
659 m_myMultiGraph[slot - 1]->SetMinimum(std::min(yMinMRO[slot - 1], yMinWFRO[slot - 1]));
660 m_myMultiGraph[slot - 1]->SetMaximum(std::max(yMaxMRO[slot - 1], yMaxWFRO[slot - 1]));
661 xAxis->SetLimits(std::min(xMinMRO[slot - 1], xMinWFRO[slot - 1]), std::max(xMaxMRO[slot - 1], xMaxWFRO[slot - 1]));
662 }
else if (m_plottingMode == 2) {
663 m_myMultiGraph[slot - 1]->SetMinimum(yMin);
664 m_myMultiGraph[slot - 1]->SetMaximum(yMax);
665 xAxis->SetLimits(xMin, xMax);
666 }
else if (m_plottingMode == 3) {
667 m_myMultiGraph[slot - 1]->SetMinimum(yMin);
668 m_myMultiGraph[slot - 1]->SetMaximum(yMax);
669 xAxis->SetLimits(m_xMin, xMax);
670 }
else if (m_plottingMode == 4) {
671 m_myMultiGraph[slot - 1]->SetMinimum(yMin);
672 m_myMultiGraph[slot - 1]->SetMaximum(yMax);
673 xAxis->SetLimits(m_xMin, m_xMax);
675 m_myMultiGraph[slot - 1]->SetMinimum(0);
676 m_myMultiGraph[slot - 1]->SetMaximum(MAX_TIMESTAMP_RANGE);
677 xAxis->SetLimits(0, MAX_NUMBER_OF_CLOCK_CYCLES);
680 m_myMultiGraph[slot - 1]->Draw(
"AP");
689 m_myPaveText[slot - 1]->AddText(myPaveTextInfo[slot - 1][5].c_str());
690 m_myPaveText[slot - 1]->AddText(myPaveTextInfo[slot - 1][6].c_str());
691 m_myPaveText[slot - 1]->AddText(myPaveTextInfo[slot - 1][7].c_str());
693 m_myPaveText[slot - 1]->AddText(topTRGDecisionText[slot - 1].c_str());
694 m_myPaveText[slot - 1]->AddText(topTRGIsimMRODecisionText[slot - 1].c_str());
695 m_myPaveText[slot - 1]->AddText(topTRGIsimWFRODecisionText[slot - 1].c_str());
697 m_myPaveText[slot - 1]->SetBorderSize(1);
699 m_myPaveText[slot - 1]->SetFillStyle(0);
700 m_myPaveText[slot - 1]->SetTextFont(40);
701 m_myPaveText[slot - 1]->SetTextAlign(12);
702 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.