diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/CMakeLists.txt b/Trigger/TrigMonitoring/TrigEgammaMonitoring/CMakeLists.txt index 4dceac4efa05d78dd0a87dfd1701925c651ea752..8254c42c5355f5e143a94da731e818b44d44b2af 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/CMakeLists.txt +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/CMakeLists.txt @@ -12,7 +12,7 @@ atlas_add_component( TrigEgammaMonitoring src/*.cxx src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} - LINK_LIBRARIES AthenaMonitoringKernelLib AthenaMonitoringLib EgammaAnalysisInterfacesLib GaudiKernel PATCoreLib StoreGateLib TrigConfxAODLib TrigDecisionToolLib TrigEgammaAnalysisToolsLib TrigEgammaMatchingToolLib xAODEgamma xAODEventInfo xAODJet xAODMissingET xAODTracking xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTruth ) + LINK_LIBRARIES AthenaMonitoringKernelLib AthenaMonitoringLib EgammaAnalysisInterfacesLib GaudiKernel PATCoreLib StoreGateLib TrigConfxAODLib TrigDecisionToolLib TrigEgammaAnalysisToolsLib TrigEgammaMatchingToolLib xAODEgamma xAODEventInfo xAODJet xAODMissingET xAODTracking xAODTrigCalo xAODTrigEgamma xAODTrigger xAODTruth egammaRecEvent) # Install files from the package: atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} ) diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py index 630917dadddec164eeb5650617e1b9b25bdd8ef4..5e485ce253f5b44072092c4d3c1a2f2cd96f81c8 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py @@ -71,3 +71,22 @@ def egammaMonitorPrecisionCfg(name): defineHistogram('ptcone40', type='TH1F', path='EXPERT', title="count;ptcone40",xbins=50, xmin=0, xmax=10 ), defineHistogram('topoetcone20', type='TH1F', path='EXPERT',title="count;topoetcone20[GeV]",xbins=50, xmin=-10, xmax=50 )] return monTool_photon + + +def egammaMonitorSuperClusterCfg(name): + + from math import pi + + from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram + monTool = GenericMonitoringTool("MonTool_"+name) + monTool.Histograms = [ + #calo cluster variables monitoring + defineHistogram('et', type='TH1D', path='EXPERT', title="E_{T}; E_{T} [GeV]; Entries", xbins= 150, xmin= 0.0, xmax= 200.0), + defineHistogram('eta', type='TH1D', path='EXPERT', title="#eta; #eta; Entries", xbins= 50, xmin=-3.0, xmax= 3.0) , + defineHistogram('phi', type='TH1D', path='EXPERT', title="#phi; #phi; Entries", xbins= 64, xmin= -pi, xmax= pi), + defineHistogram('container_size', type='TH1D', path='EXPERT', title="Container Size; Number of Clusters; Entries", xbins=2001, xmin=-0.5, xmax=2000.5), + defineHistogram('clusterSize', type='TH1D', path='EXPERT', title="Cluster Size; Type; Entries", xbins= 13, xmin= 0.5, xmax= 13.5), + defineHistogram('signalState', type='TH1D', path='EXPERT', title="Signal State; Signal State; Entries", xbins= 4, xmin=-1.5, xmax= 2.5)] + + return monTool + diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx index f58f57546ecf6be1956af11420ec189dd90a887a..9da4ec18fb505412b82aaf134ebe9a024e857abe 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx @@ -5,6 +5,7 @@ #include "../TrigEgammaMonitorTagAndProbeAlgorithm.h" #include "../egammaMonitorElectronAlgorithm.h" #include "../egammaMonitorPhotonAlgorithm.h" +#include "../egammaMonitorSuperClusterAlgorithm.h" DECLARE_COMPONENT(TrigEgammaMonitorBaseAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorAnalysisAlgorithm) @@ -13,4 +14,5 @@ DECLARE_COMPONENT(TrigEgammaMonitorPhotonAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorTagAndProbeAlgorithm) DECLARE_COMPONENT(egammaMonitorElectronAlgorithm) DECLARE_COMPONENT(egammaMonitorPhotonAlgorithm) +DECLARE_COMPONENT(egammaMonitorSuperClusterAlgorithm) diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorSuperClusterAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorSuperClusterAlgorithm.cxx new file mode 100644 index 0000000000000000000000000000000000000000..80fff81ecfd459e24c1b0048f005af65fed5f888 --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorSuperClusterAlgorithm.cxx @@ -0,0 +1,77 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + */ + +#include "egammaMonitorSuperClusterAlgorithm.h" +#include "xAODEgamma/EgammaContainer.h" +#include "xAODEgamma/Electron.h" +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/ElectronAuxContainer.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODCaloEvent/CaloCluster.h" +#include "xAODCaloEvent/CaloClusterContainer.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTracking/VertexContainer.h" + +#include "StoreGate/ReadHandle.h" +#include "StoreGate/WriteHandle.h" +#include "xAODPrimitives/IsolationType.h" +#include "GaudiKernel/EventContext.h" +#include "StoreGate/ReadCondHandleKey.h" + +#include "egammaRecEvent/egammaRec.h" +#include "egammaRecEvent/egammaRecContainer.h" + +#include "AthenaMonitoringKernel/Monitored.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" +#include "GaudiKernel/SystemOfUnits.h" +#include "GaudiKernel/PhysicalConstants.h" + +egammaMonitorSuperClusterAlgorithm::egammaMonitorSuperClusterAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ): + AthReentrantAlgorithm( name, pSvcLocator ) + +{} + +StatusCode egammaMonitorSuperClusterAlgorithm::initialize() +{ + + ATH_CHECK(m_inputEgammaRecContainerKey.initialize()); + if (!m_monTool.empty()) CHECK(m_monTool.retrieve()); + return StatusCode::SUCCESS; +} + +StatusCode egammaMonitorSuperClusterAlgorithm::execute(const EventContext& ctx) const +{ + + fillSuperClusterQuantities(ctx); + + return StatusCode::SUCCESS; +} + + +void egammaMonitorSuperClusterAlgorithm::fillSuperClusterQuantities( const EventContext& ctx) const{ + + SG::ReadHandle<EgammaRecContainer> egammaRec(m_inputEgammaRecContainerKey, ctx); + ATH_MSG_DEBUG("Fill cluster quantities: "); + + std::vector<float> et_vec, eta_vec, phi_vec, clusterSize_vec, signalState_vec; + + auto et_col = Monitored::Collection("et" , et_vec); + auto eta_col = Monitored::Collection("eta" , eta_vec); + auto phi_col = Monitored::Collection("phi", phi_vec); + auto clusterSize_col = Monitored::Collection("clusterSize" ,clusterSize_vec); + auto signalState_col = Monitored::Collection("signalState" ,signalState_vec); + + for (const auto& eg : *egammaRec) { + + et_vec.push_back(eg->caloCluster()->et()/Gaudi::Units::GeV); + eta_vec.push_back(eg->caloCluster()->eta()); + phi_vec.push_back(eg->caloCluster()->phi()); + clusterSize_vec.push_back(eg->caloCluster()->clusterSize()); + signalState_vec.push_back(eg->caloCluster()->signalState()); + + } + auto mon = Monitored::Group(m_monTool, et_col,eta_col,phi_col, clusterSize_col,signalState_col); + ATH_MSG_DEBUG("SuperCluster - Online Monitoring in Reconstruction ..."); + +} diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorSuperClusterAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorSuperClusterAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..56bd54278df554fb86a9b05b4d016a3b5de6b3d0 --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorSuperClusterAlgorithm.h @@ -0,0 +1,60 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef egammaMonitorSuperClusterAlgorithm_H +#define egammaMonitorSuperClusterAlgorithm_H + +#include "AthenaBaseComps/AthReentrantAlgorithm.h" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "egammaMonitorSuperClusterAlgorithm.h" +#include "xAODEventInfo/EventInfo.h" +#include "xAODTruth/TruthParticleContainer.h" +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/EgammaContainer.h" +#include "xAODEgamma/EgammaxAODHelpers.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/PhotonContainer.h" +#include "GaudiKernel/EventContext.h" +#include "egammaRecEvent/egammaRec.h" +#include "egammaRecEvent/egammaRecContainer.h" + +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "StoreGate/DataHandle.h" +#include "AthenaMonitoringKernel/Monitored.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" + +class egammaRec; + +class egammaMonitorSuperClusterAlgorithm: public AthReentrantAlgorithm +{ + + public: + + egammaMonitorSuperClusterAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ); + + virtual StatusCode initialize() override; + virtual StatusCode execute (const EventContext& ctx) const override; + + protected: + + + void fillSuperClusterQuantities(const EventContext& ctx) const; + + + + private: + SG::ReadHandleKey<EgammaRecContainer> m_inputEgammaRecContainerKey{ + this, + "InputEgammaRecContainerName", + "egammaRecCollection", + "input egammaRec container" + }; + + ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; +}; + + + +#endif diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py index 015721b35fa0da5faac87a8fefcddf5bdc9614ab..d5d7844d53e338bed1d3fad8367a79ecd2594192 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/PrecisionElectronRecoSequences.py @@ -74,4 +74,10 @@ def precisionElectronRecoSequence(RoIs): PrecisionElectronRecoMonAlgo.ElectronKey = trigTopoEgammaAlgo.ElectronOutputName thesequence += PrecisionElectronRecoMonAlgo + #online monitoring for TrigElectronSuperClusterBuilder + from TriggerMenuMT.HLTMenuConfig.Electron.TrigElectronFactories import PrecisionElectronSuperClusterMonitorCfg + PrecisionElectronSuperClusterMonAlgo = PrecisionElectronSuperClusterMonitorCfg() + PrecisionElectronSuperClusterMonAlgo.InputEgammaRecContainerName = trigElectronAlgo.SuperElectronRecCollectionName + thesequence += PrecisionElectronSuperClusterMonAlgo + return (thesequence, collectionOut) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py index 9e30a0ab3c534a5ab5ff93a4e50a3e4361730720..495e90915de4713b0a28166b4ffe01adf004f4a5 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Electron/TrigElectronFactories.py @@ -85,4 +85,19 @@ def PrecisionElectronTopoMonitorCfg(name = 'PrecisionElectronTopoEgammaBuilder') MonTool = monTool ) - return PrecisionElectronTopoMonitor() \ No newline at end of file + return PrecisionElectronTopoMonitor() + +def PrecisionElectronSuperClusterMonitorCfg(name = 'PrecisionElectronSuperClusterBuilder'): + + from TrigEgammaMonitoring import TrigEgammaMonitoringConf + from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorSuperClusterCfg + monTool = egammaMonitorSuperClusterCfg(name) + + PrecisionElectronSuperClusterMonitor = AlgFactory( TrigEgammaMonitoringConf.egammaMonitorSuperClusterAlgorithm, + name = name, + doAdd = False, + InputEgammaRecContainerName = TrigEgammaKeys.EgammaRecKey, + MonTool = monTool + ) + + return PrecisionElectronSuperClusterMonitor() diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py index 46d47aaef4f61b60ec1a3ca234371c1445c5ec6d..3f3e7a41da2baa18baaab20bf3f27e4119da5b4e 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py @@ -73,6 +73,12 @@ def precisionPhotonRecoSequence(RoIs): PrecisionPhotonRecoMonAlgo.PhotonKey = trigTopoEgammaAlgo.PhotonOutputName thesequence += PrecisionPhotonRecoMonAlgo + #online monitoring for TrigPhotonSuperClusterBuilder + from TriggerMenuMT.HLTMenuConfig.Photon.TrigPhotonFactories import PrecisionPhotonSuperClusterMonitorCfg + PrecisionPhotonSuperClusterMonAlgo = PrecisionPhotonSuperClusterMonitorCfg() + PrecisionPhotonSuperClusterMonAlgo.InputEgammaRecContainerName = trigPhotonAlgo.SuperPhotonRecCollectionName + thesequence += PrecisionPhotonSuperClusterMonAlgo + return (thesequence, collectionOut) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py index d31582f67fdfa325bd0844e556c612e112f141ae..8d43dfd53cdd574d1f66ae51735db31459617919 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py @@ -84,3 +84,18 @@ def PrecisionPhotonTopoMonitorCfg(name = 'PrecisionPhotonTopoEgammaBuilder'): ) return PrecisionPhotonTopoMonitor() + +def PrecisionPhotonSuperClusterMonitorCfg(name = 'PrecisionPhotonSuperClusterBuilder'): + + from TrigEgammaMonitoring import TrigEgammaMonitoringConf + from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorSuperClusterCfg + monTool = egammaMonitorSuperClusterCfg(name) + + PrecisionPhotonSuperClusterMonitor = AlgFactory( TrigEgammaMonitoringConf.egammaMonitorSuperClusterAlgorithm, + name = name, + doAdd = False, + InputEgammaRecContainerName = TrigEgammaKeys.EgammaRecKey, + MonTool = monTool + ) + + return PrecisionPhotonSuperClusterMonitor()