diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt index d5baf3893fecf0d158ff3d17b34fffc62052bffb..6dd0a7ca32c154e5d3532176d42af698a8e8eb26 100644 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/CMakeLists.txt @@ -8,6 +8,7 @@ atlas_subdir( SiSpacePointFormation ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps + Control/AthenaMonitoring Control/AthContainers DetectorDescription/GeoPrimitives DetectorDescription/Identifier @@ -31,7 +32,7 @@ atlas_add_library( SiSpacePointFormationLib src/*.cxx PUBLIC_HEADERS SiSpacePointFormation INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData TrkSpacePoint VxVertex SiSpacePointToolLib BeamSpotConditionsData + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData TrkSpacePoint VxVertex SiSpacePointToolLib BeamSpotConditionsData AthenaMonitoringLib PRIVATE_LINK_LIBRARIES AtlasDetDescr xAODEventInfo InDetIdentifier ) atlas_add_component( SiSpacePointFormation @@ -39,3 +40,4 @@ atlas_add_component( SiSpacePointFormation INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthContainers GeoPrimitives Identifier GaudiKernel InDetReadoutGeometry InDetPrepRawData SiSpacePointToolLib TrkSpacePoint VxVertex AtlasDetDescr xAODEventInfo InDetIdentifier SiSpacePointFormationLib BeamSpotConditionsData ) +atlas_install_python_modules( python/*.py ) diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h index 61289b78c3ad7101a97e68fc5774435ad22d402c..deb6fcb76dd4b34186371d7d5eb242095a4d877e 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/SiSpacePointFormation/SiTrackerSpacePointFinder.h @@ -49,7 +49,7 @@ #define SiSpacePointFormation_SI_POINT_FINDER_H #include "AthenaBaseComps/AthReentrantAlgorithm.h" - +#include "AthenaMonitoring/GenericMonitoringTool.h" #include "AthContainers/DataVector.h" #include "GeoPrimitives/GeoPrimitives.h" #include "Identifier/Identifier.h" @@ -172,6 +172,7 @@ namespace InDet { SG::UpdateHandleKey<SpacePointCache> m_SpacePointCache_SCTKey; SG::UpdateHandleKey<SpacePointCache> m_SpacePointCache_PixKey; ToolHandle< SiSpacePointMakerTool > m_SiSpacePointMakerTool; + ToolHandle<GenericMonitoringTool> m_monTool{this, "monTool", "", "Monitoring tool"}; SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"}; SG::ReadCondHandleKey<InDet::SiElementPropertiesTable> m_SCTPropertiesKey{this, "SCTPropertiesKey", "SCT_ElementPropertiesTable", "Key of input SiElementPropertiesTable for SCT"}; diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/python/InDetOnlineMonitor.py b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/python/InDetOnlineMonitor.py new file mode 100644 index 0000000000000000000000000000000000000000..991d5a6454b1dde2b8e8dd13e6934ac0f767e705 --- /dev/null +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/python/InDetOnlineMonitor.py @@ -0,0 +1,13 @@ +from AthenaMonitoring.GenericMonitoringTool import GenericMonitoringTool + +def InDetMonitoringTool(): + newMonTool = GenericMonitoringTool("MonTool") + newMonTool.defineHistogram('numSctClusters', type='TH1F',path='EXPERT',title="Number of SCT Clusters",xbins=250,xmin=0.,xmax=10000) + newMonTool.defineHistogram('numPixClusters', type='TH1F',path='EXPERT',title="Number of PIXEL Clusters", xbins=250, xmin=0., xmax=3000) + newMonTool.defineHistogram('numSctSpacePoints', type='TH1F',path='EXPERT',title="Number of SCT Space Points", xbins=250, xmin=0., xmax=500) + newMonTool.defineHistogram('numPixSpacePoints', type='TH1F',path='EXPERT',title="Number of PIXEL Space Points", xbins=250, xmin=0., xmax=500) + + return newMonTool + + + diff --git a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx index d415cb7c9f7ad19658b5333ceb3119d571be9db8..1e9fb3da1ee87f457f33c2395433a243e9e7e6b0 100755 --- a/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx +++ b/InnerDetector/InDetRecAlgs/SiSpacePointFormation/src/SiTrackerSpacePointFinder.cxx @@ -31,6 +31,7 @@ ATLAS Collaboration #include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadCondHandle.h" +#include "AthenaMonitoring/Monitored.h" namespace InDet { //------------------------------------------------------------------------ @@ -154,6 +155,8 @@ StatusCode SiTrackerSpacePointFinder::initialize() ATH_CHECK(m_SpacePointCache_PixKey.initialize(!m_SpacePointCache_PixKey.key().empty())); m_cachemode = !m_SpacePointCache_SCTKey.key().empty() || !m_SpacePointCache_PixKey.key().empty(); + if (!m_monTool.empty()) CHECK(m_monTool.retrieve()); + ATH_MSG_INFO( "SiTrackerSpacePointFinder::initialized for package version " << PACKAGE_VERSION ); return StatusCode::SUCCESS; } @@ -167,6 +170,12 @@ StatusCode SiTrackerSpacePointFinder::execute (const EventContext& ctx) const ++m_numberOfEvents; const InDetDD::SiDetectorElementCollection* elements = nullptr; const SiElementPropertiesTable* properties = nullptr; + + auto nReceivedClustersSCT = Monitored::Scalar<int>( "numSctClusters" , 0 ); + auto nReceivedClustersPIX = Monitored::Scalar<int>( "numPixClusters" , 0 ); + auto nSCTspacePoints = Monitored::Scalar<int>( "numSctSpacePoints" , 0 ); + auto nPIXspacePoints = Monitored::Scalar<int>( "numPixSpacePoints" , 0 ); + if (m_selectSCTs) { SG::ReadCondHandle<InDetDD::SiDetectorElementCollection> sctDetEle(m_SCTDetEleCollKey, ctx); elements = sctDetEle.retrieve(); @@ -239,6 +248,7 @@ StatusCode SiTrackerSpacePointFinder::execute (const EventContext& ctx) const r_cache.SCTCContainer = sct_clcontainer.cptr(); ATH_MSG_DEBUG( "SCT Cluster container found: " << sct_clcontainer->size() << " collections" ); + nReceivedClustersSCT = sct_clcontainer->size(); // Get hold of all clusters and iterate through them. // Pixel clusters will be converted immediately to pixel space points. // For SCT clusters, posssible pairs will be found and space points computed. @@ -298,6 +308,8 @@ StatusCode SiTrackerSpacePointFinder::execute (const EventContext& ctx) const PixelClusterContainer::const_iterator colNext = pixel_clcontainer->begin(); PixelClusterContainer::const_iterator lastCol = pixel_clcontainer->end(); + nReceivedClustersPIX = pixel_clcontainer->size(); + int numColl=0; for (; colNext != lastCol; ++colNext) { @@ -353,15 +365,20 @@ StatusCode SiTrackerSpacePointFinder::execute (const EventContext& ctx) const } if (m_selectPixels) { m_numberOfPixel += spacePointContainerPixel->numberOfCollections(); + nPIXspacePoints = spacePointContainerPixel->numberOfCollections(); } if (m_selectSCTs) { m_numberOfSCT += spacePointContainer_SCT->numberOfCollections(); + nSCTspacePoints = spacePointContainer_SCT->numberOfCollections(); } if(m_cachemode)//Prevent unnecessary atomic counting { m_sctCacheHits += sctCacheCount; m_pixCacheHits += pixCacheCount; } + + auto mon = Monitored::Group( m_monTool, nReceivedClustersPIX,nReceivedClustersSCT, nPIXspacePoints, nSCTspacePoints ); + return StatusCode::SUCCESS; } diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py index 19437122c56351952cedab59550220277660b2b9..fc6898b57d5ccec08a4e947b2282c19e055edc7e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/CommonSequences/InDetSetup.py @@ -227,6 +227,7 @@ def makeInDetAlgs( whichSignature='', separateTrackParticleCreator='' ): from AthenaCommon.DetFlags import DetFlags from SiSpacePointFormation.SiSpacePointFormationConf import InDet__SiTrackerSpacePointFinder + from SiSpacePointFormation.InDetOnlineMonitor import InDetMonitoringTool InDetSiTrackerSpacePointFinder = InDet__SiTrackerSpacePointFinder(name = "InDetSiTrackerSpacePointFinder" + signature, SiSpacePointMakerTool = InDetSiSpacePointMakerTool, PixelsClustersName = "PixelTrigClusters", @@ -238,7 +239,8 @@ def makeInDetAlgs( whichSignature='', separateTrackParticleCreator='' ): ProcessSCTs = DetFlags.haveRIO.SCT_on(), ProcessOverlaps = DetFlags.haveRIO.SCT_on(), SpacePointCacheSCT = InDetCacheNames.SpacePointCacheSCT, - SpacePointCachePix = InDetCacheNames.SpacePointCachePix,) + SpacePointCachePix = InDetCacheNames.SpacePointCachePix, + monTool = InDetMonitoringTool()) viewAlgs.append(InDetSiTrackerSpacePointFinder)