diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py index 8fdcdae93fc93257b211b1c8156df1f60f12376a..630917dadddec164eeb5650617e1b9b25bdd8ef4 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/python/egammaMonitorPrecisionConfig.py @@ -8,38 +8,66 @@ log = logging.getLogger("TrigEgammaMonitoring.egammaMonitorPrecisionConfig") def egammaMonitorPrecisionCfg(name): - from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram - monTool = GenericMonitoringTool("MonTool_"+name) - monTool.Histograms = [ + + if ('Electron' in name): + from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram + monTool_electron = GenericMonitoringTool("MonTool_"+name) + monTool_electron.Histograms = [ #track variables monitoring - defineHistogram('deltaEta0',title='PrecisionElectron#Delta#eta0', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaEta1',title='PrecisionElectron#Delta#eta1', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaEta2',title='PrecisionElectron#Delta#eta2', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaEta3',title='PrecisionElectron#Delta#eta3', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaPhi0',title='PrecisionElectron#Delta#eta0', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaPhi1',title='PrecisionElectron#Delta#phi1', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaPhi2',title='PrecisionElectron#Delta#phi2', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), - defineHistogram('deltaPhi3',title='PrecisionElectron#Delta#phi3', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta0',title='Precision#Delta#eta0', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta1',title='Precision#Delta#eta1', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta2',title='Precision#Delta#eta2', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaEta3',title='Precision#Delta#eta3', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi0',title='Precision#Delta#eta0', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi1',title='Precision#Delta#phi1', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi2',title='Precision#Delta#phi2', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), + defineHistogram('deltaPhi3',title='Precision#Delta#phi3', path='EXPERT',xbins=80, xmin=-0.1,xmax=0.1), #Shower Shapes variables monitoring - defineHistogram('e237',type='TH1F', path='EXPERT',title="Electron Precision Reconstruction uncor energy in 3x7 cells in em sampling 2; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), - defineHistogram('e277', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction uncor energy in 7x7 cells in em sampling 2;E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), - defineHistogram('Rhad', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), - defineHistogram('Rhad1', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), - defineHistogram('ethad', type='TH1F', path='EXPERT',title="Transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated from ehad1 ; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), - defineHistogram('ethad1', type='TH1F', path='EXPERT',title="ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), - defineHistogram('weta1', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction corrected width in 3 strips in the 1st samp. ; Width",xbins=20, xmin=0, xmax=1 ), - defineHistogram('weta2', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction corrected width in 3 strips in the 2st samp. ; Width",xbins=20, xmin=0, xmax=0.05 ), - defineHistogram('wtots1', type='TH1F', path='EXPERT',title="Electron Precision Reconstruction total width in em sampling 1 in 20 strips; Width",xbins=20, xmin=0, xmax=20 ), - defineHistogram('f1', type='TH1F', path='EXPERT',title="Fraction of energy found in 1st em sampling;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), - defineHistogram('f3', type='TH1F', path='EXPERT',title="Fraction of energy reconstructed in 3rd sampling ;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), - defineHistogram('eratio', type='TH1F', path='EXPERT',title="Eratio ;Count",xbins=50, xmin=0, xmax=2 ), - defineHistogram('fracs1', type='TH1F', path='EXPERT', title="Reconstruction energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]",xbins=50, xmin=-5000, xmax=10000 ), + defineHistogram('e237',type='TH1F', path='EXPERT',title="Precision Reconstruction uncor energy in 3x7 cells in em sampling 2; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('e277', type='TH1F', path='EXPERT',title="Precision Reconstruction uncor energy in 7x7 cells in em sampling 2;E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('Rhad', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), + defineHistogram('Rhad1', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), + defineHistogram('ethad', type='TH1F', path='EXPERT',title="Transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated from ehad1 ; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('ethad1', type='TH1F', path='EXPERT',title="ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('weta1', type='TH1F', path='EXPERT',title="Precision Reconstruction corrected width in 3 strips in the 1st samp. ; Width",xbins=20, xmin=0, xmax=1 ), + defineHistogram('weta2', type='TH1F', path='EXPERT',title="Precision Reconstruction corrected width in 3 strips in the 2st samp. ; Width",xbins=20, xmin=0, xmax=0.05 ), + defineHistogram('wtots1', type='TH1F', path='EXPERT',title="Precision Reconstruction total width in em sampling 1 in 20 strips; Width",xbins=20, xmin=0, xmax=20 ), + defineHistogram('f1', type='TH1F', path='EXPERT',title="Fraction of energy found in 1st em sampling;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), + defineHistogram('f3', type='TH1F', path='EXPERT',title="Fraction of energy reconstructed in 3rd sampling ;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), + defineHistogram('eratio', type='TH1F', path='EXPERT',title="Eratio ;Count",xbins=50, xmin=0, xmax=2 ), + defineHistogram('fracs1', type='TH1F', path='EXPERT', title="Reconstruction energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]",xbins=50, xmin=-5000, xmax=10000 ), #Isolation variables monitoring - defineHistogram('ptcone20', type='TH1F', path='EXPERT',title="count;ptcone20",xbins=50, xmin=0, xmax=10 ), - defineHistogram('ptcone30', type='TH1F', path='EXPERT',title="count;ptcone30",xbins=50, xmin=0, xmax=10 ), - 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 )] + defineHistogram('ptcone20', type='TH1F', path='EXPERT',title="count;ptcone20",xbins=50, xmin=0, xmax=10 ), + defineHistogram('ptcone30', type='TH1F', path='EXPERT',title="count;ptcone30",xbins=50, xmin=0, xmax=10 ), + 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 + return monTool_electron + else: + from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram + monTool_photon = GenericMonitoringTool("MonTool_"+name) + monTool_photon.Histograms = [ + + #Shower Shapes variables monitoring + defineHistogram('e237',type='TH1F', path='EXPERT',title="Precision Reconstruction uncor energy in 3x7 cells in em sampling 2; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('e277', type='TH1F', path='EXPERT',title="Precision Reconstruction uncor energy in 7x7 cells in em sampling 2;E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('Rhad', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), + defineHistogram('Rhad1', type='TH1F', path='EXPERT',title="Rhad",xbins=50, xmin=-1, xmax=1 ), + defineHistogram('ethad', type='TH1F', path='EXPERT',title="Transverse energy in the first sampling of the hadronic calorimeters behind the cluster calculated from ehad1 ; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('ethad1', type='TH1F', path='EXPERT',title="ET leakage into hadronic calorimeter with exclusion of energy in CaloSampling; E [MeV]",xbins=50, xmin=-15000, xmax=150000 ), + defineHistogram('weta1', type='TH1F', path='EXPERT',title="Precision Reconstruction corrected width in 3 strips in the 1st samp. ; Width",xbins=20, xmin=0, xmax=1 ), + defineHistogram('weta2', type='TH1F', path='EXPERT',title="Precision Reconstruction corrected width in 3 strips in the 2st samp. ; Width",xbins=20, xmin=0, xmax=0.05 ), + defineHistogram('wtots1', type='TH1F', path='EXPERT',title="Precision Reconstruction total width in em sampling 1 in 20 strips; Width",xbins=20, xmin=0, xmax=20 ), + defineHistogram('f1', type='TH1F', path='EXPERT',title="Fraction of energy found in 1st em sampling;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), + defineHistogram('f3', type='TH1F', path='EXPERT',title="Fraction of energy reconstructed in 3rd sampling ;Fraction",xbins=50, xmin=-0.1, xmax=1.1 ), + defineHistogram('eratio', type='TH1F', path='EXPERT',title="Eratio ;Count",xbins=50, xmin=0, xmax=2 ), + defineHistogram('fracs1', type='TH1F', path='EXPERT', title="Reconstruction energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]",xbins=50, xmin=-5000, xmax=10000 ), + + #Isolation variables monitoring + defineHistogram('ptcone20', type='TH1F', path='EXPERT',title="count;ptcone20",xbins=50, xmin=0, xmax=10 ), + defineHistogram('ptcone30', type='TH1F', path='EXPERT',title="count;ptcone30",xbins=50, xmin=0, xmax=10 ), + 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 diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx index 7dac9b5096cc790a63658da5ba85b9bccaed935c..f58f57546ecf6be1956af11420ec189dd90a887a 100644 --- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/components/TrigEgammaMonitoring_entries.cxx @@ -4,6 +4,7 @@ #include "../TrigEgammaMonitorPhotonAlgorithm.h" #include "../TrigEgammaMonitorTagAndProbeAlgorithm.h" #include "../egammaMonitorElectronAlgorithm.h" +#include "../egammaMonitorPhotonAlgorithm.h" DECLARE_COMPONENT(TrigEgammaMonitorBaseAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorAnalysisAlgorithm) @@ -11,5 +12,5 @@ DECLARE_COMPONENT(TrigEgammaMonitorElectronAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorPhotonAlgorithm) DECLARE_COMPONENT(TrigEgammaMonitorTagAndProbeAlgorithm) DECLARE_COMPONENT(egammaMonitorElectronAlgorithm) - +DECLARE_COMPONENT(egammaMonitorPhotonAlgorithm) diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorPhotonAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorPhotonAlgorithm.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bd40aa9927610f6966105bd2e79ef5c742e3655a --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorPhotonAlgorithm.cxx @@ -0,0 +1,122 @@ +#include "egammaMonitorPhotonAlgorithm.h" +#include "xAODEgamma/EgammaContainer.h" +#include "xAODEgamma/Electron.h" +#include "xAODEgamma/ElectronAuxContainer.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/Photon.h" +#include "xAODEgamma/PhotonAuxContainer.h" +#include "xAODEgamma/PhotonContainer.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 "StoreGate/ReadCondHandleKey.h" + + +egammaMonitorPhotonAlgorithm::egammaMonitorPhotonAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ): + AthAlgorithm( name, pSvcLocator ) + +{} + +StatusCode egammaMonitorPhotonAlgorithm::initialize() +{ + + ATH_CHECK(m_photonsKey.initialize()); + if (!m_monTool.empty()) CHECK(m_monTool.retrieve()); + return StatusCode::SUCCESS; +} + +StatusCode egammaMonitorPhotonAlgorithm::execute_r(const EventContext& ctx) const +{ + + filltopoPhotonShowerShapes(ctx); + filltopoPhotonIsolation(ctx); + return StatusCode::SUCCESS; +} + + +void egammaMonitorPhotonAlgorithm::filltopoPhotonShowerShapes( const EventContext& ctx) const{ + + SG::ReadHandle<xAOD::PhotonContainer> photons(m_photonsKey, ctx); + ATH_MSG_DEBUG("Fill SS Reco Photon distributions: "); + + std::vector<float> e237_vec, e277_vec, ethad_vec, ethad1_vec, Rhad_vec, Rhad1_vec, Reta_vec, Rphi_vec, weta1_vec, weta2_vec, wtots1_vec, + f1_vec, f3_vec,f3core_vec, fracs1_vec, eratio_vec, DeltaE_vec, et_vec, highet_vec , eta_vec, phi_vec; + float val{-99}; + + auto e237_col = Monitored::Collection("e237" , e237_vec ); + auto e277_col = Monitored::Collection("e277" , e277_vec ); + auto ethad_col = Monitored::Collection("ethad" , ethad_vec ); + auto ethad1_col = Monitored::Collection("ethad1" , ethad1_vec ); + auto Rhad_col = Monitored::Collection("Rhad" , Rhad_vec ); + auto Rhad1_col = Monitored::Collection("Rhad1" , Rhad1_vec ); + auto Reta_col = Monitored::Collection("Reta" , Reta_vec ); + auto Rphi_col = Monitored::Collection("Rphi" , Rphi_vec ); + auto weta1_col = Monitored::Collection("weta1" , weta1_vec ); + auto weta2_col = Monitored::Collection("weta2" , weta2_vec ); + auto wtots1_col = Monitored::Collection("wtots1" , wtots1_vec ); + auto f1_col = Monitored::Collection("f1" , f1_vec ); + auto f3_col = Monitored::Collection("f3" , f3_vec ); + auto f3core_col = Monitored::Collection("f3core" , f3core_vec ); + auto fracs1_col = Monitored::Collection("fracs1" , fracs1_vec ); + auto eratio_col = Monitored::Collection("eratio" , eratio_vec ); + auto DeltaE_col = Monitored::Collection("deltaE" , DeltaE_vec ); + + for (const auto& photon : *photons) { + + e237_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::e237)); + e277_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::e237)); + ethad_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::ethad)); + ethad1_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::ethad1)); + Rhad_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::Rhad)); + Rhad1_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::Rhad1)); + Reta_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::Reta)); + Rphi_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::Rphi)); + weta1_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::weta1)); + weta2_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::weta2)); + wtots1_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::wtots1)); + f1_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::f1)); + f3_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::f3)); + f3core_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::f3core)); + fracs1_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::fracs1)); + eratio_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::Eratio)); + DeltaE_vec.push_back(photon->showerShapeValue(val,xAOD::EgammaParameters::DeltaE)); + + + } + auto mon = Monitored::Group(m_monTool, e237_col, e277_col,ethad_col, ethad1_col, Rhad_col, Rhad1_col,Reta_col,Rphi_col,weta1_col,weta2_col,wtots1_col,f1_col,f3_col,f3core_col,fracs1_col,eratio_col,DeltaE_col); + ATH_MSG_DEBUG("Photon - ShowerShapes Online Monitoring in Reconstruction ..."); + + } + +void egammaMonitorPhotonAlgorithm::filltopoPhotonIsolation( const EventContext& ctx) const{ + + + SG::ReadHandle<xAOD::PhotonContainer> photons(m_photonsKey, ctx); + std::vector<float> topoetcone20_vec, topoetcone40_shift_vec, topoetcone20_rel_vec, topoetcone40_shift_rel_vec, ptcone20_vec, ptcone30_vec, ptcone40_vec; + float val{-99}; + + auto topoetcone20_col = Monitored::Collection("topoetcone20", topoetcone20_vec); + auto ptcone20_col = Monitored::Collection("ptcone20", ptcone20_vec); + auto ptcone30_col = Monitored::Collection("ptcone30", ptcone30_vec); + auto ptcone40_col = Monitored::Collection("ptcone40", ptcone40_vec); + + + for (const auto& photon : *photons) { + + topoetcone20_vec.push_back( photon->isolationValue(val,xAOD::Iso::topoetcone20)/Gaudi::Units::GeV); + ptcone20_vec.push_back(photon->isolationValue(val,xAOD::Iso::ptcone20)); + ptcone30_vec.push_back(photon->isolationValue(val,xAOD::Iso::ptcone30)); + ptcone40_vec.push_back(photon->isolationValue(val,xAOD::Iso::ptcone40)); + + + } + + auto mon = Monitored::Group(m_monTool,ptcone20_col, ptcone30_col, ptcone40_col, topoetcone20_col); + + ATH_MSG_DEBUG("Photon - Isolation Online Monitoring in Reconstruction ..."); + + + } diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorPhotonAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorPhotonAlgorithm.h new file mode 100644 index 0000000000000000000000000000000000000000..e6dde41ee06ddb16943916aa82350657a648cc9f --- /dev/null +++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/egammaMonitorPhotonAlgorithm.h @@ -0,0 +1,56 @@ +/* + Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef egammaMonitorPhotonAlgorithm_H +#define egammaMonitorPhotonAlgorithm_H + + +#include "egammaMonitorPhotonAlgorithm.h" +#include "AthenaMonitoringKernel/GenericMonitoringTool.h" +#include "xAODEventInfo/EventInfo.h" +#include "xAODTruth/TruthParticleContainer.h" +#include "xAODEgamma/Egamma.h" +#include "xAODEgamma/EgammaxAODHelpers.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/PhotonContainer.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTrigCalo/TrigEMClusterContainer.h" +#include "xAODMissingET/MissingETContainer.h" +#include "xAODTrigger/EmTauRoIContainer.h" +#include "StoreGate/ReadHandleKey.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "StoreGate/DataHandle.h" +#include "AthenaMonitoringKernel/Monitored.h" + + +class egammaMonitorPhotonAlgorithm: public AthAlgorithm +{ + + public: + + egammaMonitorPhotonAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ); + StatusCode initialize(); + virtual StatusCode execute() override final { + + return execute_r(Algorithm::getContext()); + } + + StatusCode execute_r(const EventContext& ctx) const; + + protected: + + void filltopoPhotonShowerShapes(const EventContext& ctx) const; + void filltopoPhotonIsolation(const EventContext& ctx) const; + + + private: + SG::ReadHandleKey<xAOD::PhotonContainer> m_photonsKey{ this, "PhotonKey", "Photons", ""}; + ToolHandle<GenericMonitoringTool> m_monTool{this,"MonTool","","Monitoring tool"}; +}; + + + +#endif diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py index 826ca991a4dc10d9847351159dd626d62b32145a..46d47aaef4f61b60ec1a3ca234371c1445c5ec6d 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/PhotonRecoSequences.py @@ -67,6 +67,12 @@ def precisionPhotonRecoSequence(RoIs): isoBuilder = TrigPhotonIsoBuilderCfg() thesequence += isoBuilder + #online monitoring for topoEgammaBuilder + from TriggerMenuMT.HLTMenuConfig.Photon.TrigPhotonFactories import PrecisionPhotonTopoMonitorCfg + PrecisionPhotonRecoMonAlgo = PrecisionPhotonTopoMonitorCfg() + PrecisionPhotonRecoMonAlgo.PhotonKey = trigTopoEgammaAlgo.PhotonOutputName + thesequence += PrecisionPhotonRecoMonAlgo + return (thesequence, collectionOut) diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py index 233c4f2d69b06e817539d63f2b40a1b4e381b49a..d31582f67fdfa325bd0844e556c612e112f141ae 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Photon/TrigPhotonFactories.py @@ -70,3 +70,17 @@ TrigTopoEgammaPhotons = AlgFactory( egammaAlgsConf.topoEgammaBuilder, doElectrons = False, ) +def PrecisionPhotonTopoMonitorCfg(name = 'PrecisionPhotonTopoEgammaBuilder'): + + from TrigEgammaMonitoring import TrigEgammaMonitoringConf + from TrigEgammaMonitoring.egammaMonitorPrecisionConfig import egammaMonitorPrecisionCfg + monTool = egammaMonitorPrecisionCfg(name) + + PrecisionPhotonTopoMonitor = AlgFactory( TrigEgammaMonitoringConf.egammaMonitorPhotonAlgorithm, + name = name, + doAdd = False, + PhotonKey = TrigEgammaKeys.outputPhotonKey, + MonTool = monTool + ) + + return PrecisionPhotonTopoMonitor()