diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py index df977cd24ee999043326ba85f748984faa7beff6..b3a9dc620c1e48d07270b7963af985ebf5abfed6 100644 --- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py +++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/python/TrigTRTHTHhypoTool.py @@ -1,9 +1,16 @@ # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from TrigTRTHighTHitCounter.TrigTRTHighTHitCounterConf import TrigTRTHTHhypoTool +from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram def _IncTool(name): + monTool = GenericMonitoringTool("MonTool_"+name) + monTool.Histograms = [ defineHistogram('HTRatioRoad', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo HTRatioRoad", xbins=10, xmin=0.0, xmax=0.9), + defineHistogram('HTRatioWedge', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo HTRatioWedge", xbins=10, xmin=0.0, xmax=0.9), + defineHistogram('TRTHTHitsRoad', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo TRTHTHitsRoad", xbins=100, xmin=0, xmax=100), + defineHistogram('TRTHTHitsWedge', type='TH1F', path='EXPERT', title="TrigTRTHTH Hypo TRTHTHitsWedge", xbins=100, xmin=0, xmax=100),] + tool = TrigTRTHTHhypoTool( name ) tool.AcceptAll = False tool.MinTRTHTHitsRoad = 20 @@ -11,7 +18,9 @@ def _IncTool(name): tool.MinTRTHTHitsWedge = 30 tool.MinHTRatioWedge = 0.4 tool.DoWedge = True - tool.DoRoad = False + tool.DoRoad = False + monTool.HistPath = 'TrigTRTHTHhypo/'+tool.getName() + tool.MonTool = monTool return tool def TrigTRTHTHhypoToolFromDict( d ): diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.cxx b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.cxx index 0ea79792c7cc77072655d6d2f02bb16f71b08722..4750788417e7ab1eb15663c57d7cd52cb44522f7 100644 --- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.cxx +++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.cxx @@ -3,7 +3,7 @@ */ #include "TrigTRTHTHhypoTool.h" - +#include "AthenaMonitoringKernel/Monitored.h" #include "TrigCompositeUtils/TrigCompositeUtils.h" namespace TCU = TrigCompositeUtils; @@ -25,6 +25,12 @@ StatusCode TrigTRTHTHhypoTool::initialize() { bool TrigTRTHTHhypoTool::decide( const ITrigTRTHTHhypoTool::RNNOutputInfo& input ) const { bool pass = false; + + auto fHT_road = Monitored::Scalar( "HTRatioRoad", -1. ); + auto fHT_wedge = Monitored::Scalar( "HTRatioWedge", -1. ); + auto trththits_road = Monitored::Scalar( "TRTHTHitsRoad" , -1.0 ); + auto trththits_wedge = Monitored::Scalar( "TRTHTHitsWedge", -1.0 ); + auto monitorIt = Monitored::Group( m_monTool, fHT_road, fHT_wedge, trththits_road, trththits_wedge); if( m_acceptAll ){ pass=true; @@ -42,10 +48,10 @@ bool TrigTRTHTHhypoTool::decide( const ITrigTRTHTHhypoTool::RNNOutputInfo& input //Parse the vector to assign fHT and nHT appropriately - float fHT_road = vec.at(1); - float fHT_wedge = vec.at(3); - float trththits_road = vec.at(0); - float trththits_wedge = vec.at(2); + fHT_road = vec.at(1); + fHT_wedge = vec.at(3); + trththits_road = vec.at(0); + trththits_wedge = vec.at(2); ATH_MSG_DEBUG ( "trththits_road: " << trththits_road); ATH_MSG_DEBUG ("m_minTRTHTHitsRoad in hypotool: "<<m_minTRTHTHitsRoad); diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.h b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.h index 74e665cd303d326a4f5a3d2e4d0795bb2a99ea80..1d488ea6e929bfece03b729882e41796f2705b08 100644 --- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.h +++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHhypoTool.h @@ -6,6 +6,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "TrigCompositeUtils/HLTIdentifier.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" #include "ITrigTRTHTHhypoTool.h" @@ -38,6 +39,8 @@ class TrigTRTHTHhypoTool : public extends<AthAlgTool, ITrigTRTHTHhypoTool> { Gaudi::Property< bool > m_doWedge { this, "DoWedge", true , "Bins of eta" }; Gaudi::Property< bool > m_doRoad { this, "DoRoad", false , "Bins of eta" }; + ToolHandle< GenericMonitoringTool > m_monTool{ this, "MonTool", "", "Monitoring tool" }; + }; #endif