@@ -616,11 +616,13 @@ Cru::TriggerMonitoringInfo CruBar::monitorTriggers(bool updateable)
616616 uint32_t hbCountPrev = ttc.getHbTriggerLtuCount ();
617617 uint32_t phyCountPrev = ttc.getPhyTriggerLtuCount ();
618618 uint32_t tofCountPrev = ttc.getTofTriggerLtuCount ();
619+ uint32_t calCountPrev = ttc.getCalTriggerLtuCount ();
619620
620621 // base values to report relative counts for updateable monitoring (e.g. for a single run)
621622 static uint32_t hbCountBase = hbCountPrev;
622623 static uint32_t phyCountBase = phyCountPrev;
623624 static uint32_t tofCountBase = tofCountPrev;
625+ static uint32_t calCountBase = calCountPrev;
624626 static std::pair<uint32_t , uint32_t > statEoxSox = ttc.getEoxSoxLtuCount ();
625627 static uint32_t eoxCountBase = statEoxSox.first ;
626628 static uint32_t soxCountBase = statEoxSox.second ;
@@ -629,6 +631,7 @@ Cru::TriggerMonitoringInfo CruBar::monitorTriggers(bool updateable)
629631 uint32_t hbCount = ttc.getHbTriggerLtuCount ();
630632 uint32_t phyCount = ttc.getPhyTriggerLtuCount ();
631633 uint32_t tofCount = ttc.getTofTriggerLtuCount ();
634+ uint32_t calCount = ttc.getCalTriggerLtuCount ();
632635 std::pair<uint32_t , uint32_t > eoxSox = ttc.getEoxSoxLtuCount ();
633636 uint32_t eoxCount = eoxSox.first ;
634637 uint32_t soxCount = eoxSox.second ;
@@ -655,11 +658,19 @@ Cru::TriggerMonitoringInfo CruBar::monitorTriggers(bool updateable)
655658 tofDiff = tofCount - tofCountPrev;
656659 }
657660
661+ uint64_t calDiff;
662+ if (calCountPrev > calCount) {
663+ calDiff = calCount + pow (2 , 16 ) - calCountPrev;
664+ } else {
665+ calDiff = calCount - calCountPrev;
666+ }
667+
658668 // report absolute values + rates(1s)
659669 if (!updateable) {
660670 return { hbCount, hbDiff / pow (10 , 3 ),
661671 phyCount, phyDiff / pow (10 , 3 ),
662672 tofCount, tofDiff / pow (10 , 3 ),
673+ calCount, calDiff / pow (10 , 3 ),
663674 eoxCount, soxCount };
664675 }
665676
@@ -682,6 +693,7 @@ Cru::TriggerMonitoringInfo CruBar::monitorTriggers(bool updateable)
682693 return { hbCount - hbCountBase, hbDiff / pow (10 , 3 ),
683694 phyCount - phyCountBase, phyDiff / pow (10 , 3 ),
684695 tofCount - tofCountBase, tofDiff / pow (10 , 3 ),
696+ calCount - calCountBase, calDiff / pow (10 , 3 ),
685697 eoxDiff, soxDiff };
686698}
687699
0 commit comments