diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index dbdc5793f3dc716b5442beba08444680d64e76ca..b10941d1dbbe229707d03654573a9119ec627b03 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -88,12 +88,24 @@ def TrigMETMonConfig(inputFlags): path='cell',xbins=199,xmin=-298.5,xmax=298.5) shifterGroup.defineHistogram('cell_Et',title='cell Missing E_{T};E_{T} (GeV);Events', path='cell',xbins=205,xmin=-13.5,xmax=401.5) + shifterGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} (GeV);Events', + path='tcpufit',xbins=199,xmin=-298.5,xmax=298.5) + shifterGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} (GeV);Events', + path='tcpufit',xbins=199,xmin=-298.5,xmax=298.5) + shifterGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} (GeV);Events', + path='tcpufit',xbins=205,xmin=-13.5,xmax=401.5) expertGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} (GeV);Events', path='mht',xbins=199,xmin=-298.5,xmax=298.5) expertGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} (GeV);Events', path='mht',xbins=199,xmin=-298.5,xmax=298.5) expertGroup.defineHistogram('mht_Et', title='mht E_{T};E_{T} (GeV);Events', path='mht',xbins=205,xmin=-13.5,xmax=401.5) + expertGroup.defineHistogram('tc_Ex',title='tc Missing E_{x};E_{x} (GeV);Events', + path='tc',xbins=199,xmin=-298.5,xmax=298.5) + expertGroup.defineHistogram('tc_Ey',title='tc Missing E_{y};E_{y} (GeV);Events', + path='tc',xbins=199,xmin=-298.5,xmax=298.5) + expertGroup.defineHistogram('tc_Et', title='tc E_{T};E_{T} (GeV);Events', + path='tc',xbins=205,xmin=-13.5,xmax=401.5) ### STEP 6 ### # Finalize. The return value should be a tuple of the ComponentAccumulator @@ -116,7 +128,8 @@ if __name__=='__main__': from AthenaConfiguration.AllConfigFlags import ConfigFlags nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/' file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1' - ConfigFlags.Input.Files = [nightly+file] + #ConfigFlags.Input.Files = [nightly+file] + ConfigFlags.Input.Files = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD.pool.root'] ConfigFlags.Input.isMC = False ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/share/TrigMETMonitorAlgorithm_jobOptions.py b/Trigger/TrigMonitoring/TrigMETMonitoring/share/TrigMETMonitorAlgorithm_jobOptions.py index ed28e0abffcb7923bd881364624e57e669a7a354..7edeb674fcbaa9dec73c33c164bc8e236859e9dc 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/share/TrigMETMonitorAlgorithm_jobOptions.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/share/TrigMETMonitorAlgorithm_jobOptions.py @@ -11,10 +11,10 @@ # The following class will make a sequence, configure algorithms, and link # them to GenericMonitoringTools -#from AthenaMonitoring import AthMonitorCfgHelperOld -#helper = AthMonitorCfgHelperOld(DQMonFlags, "TrigMETMonitor") -from AthenaMonitoring import AthMonitorCfgHelper -helper = AthMonitorCfgHelper(DQMonFlags, "TrigMETMonitor") +from AthenaMonitoring import AthMonitorCfgHelperOld +helper = AthMonitorCfgHelperOld(DQMonFlags, "TrigMETMonitor") +#from AthenaMonitoring import AthMonitorCfgHelper +#helper = AthMonitorCfgHelper(DQMonFlags, "TrigMETMonitor") ### STEP 2 ### # Adding an algorithm to the helper. Here, we will use the example diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index 29d70753a95d10adb7a8903a5ac81ea0b2301cd3..ebe1a2fa9c01802d6a4db8f8b993c0475e52d723 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -7,12 +7,24 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : AthMonitorAlgorithm(name,pSvcLocator) , m_lvl1_roi_key("LVL1EnergySumRoI") - , m_hlt_cell_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET") - , m_hlt_mht_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht") + , m_hlt_cell_met_key("HLT_MET_cell") + , m_hlt_mht_met_key("HLT_MET_mht") + , m_hlt_tc_met_key("HLT_MET_tc") + , m_hlt_tcpufit_met_key("HLT_MET_tcPufit") + , m_hlt_run2_cell_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET") + , m_hlt_run2_mht_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht") + , m_hlt_run2_tc_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl") + , m_hlt_run2_tcpufit_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC") { declareProperty("l1_roi_key", m_lvl1_roi_key); declareProperty("hlt_cell_key", m_hlt_cell_met_key); declareProperty("hlt_mht_key", m_hlt_mht_met_key); + declareProperty("hlt_tc_key", m_hlt_tc_met_key); + declareProperty("hlt_tcpufit_key", m_hlt_tcpufit_met_key); + declareProperty("hlt_run2_cell_key", m_hlt_run2_cell_met_key); + declareProperty("hlt_run2_mht_key", m_hlt_run2_mht_met_key); + declareProperty("hlt_run2_tc_key", m_hlt_run2_tc_met_key); + declareProperty("hlt_run2_tcpufit_key", m_hlt_run2_tcpufit_met_key); } @@ -23,6 +35,12 @@ StatusCode TrigMETMonitorAlgorithm::initialize() { ATH_CHECK( m_lvl1_roi_key.initialize() ); ATH_CHECK( m_hlt_cell_met_key.initialize() ); ATH_CHECK( m_hlt_mht_met_key.initialize() ); + ATH_CHECK( m_hlt_tc_met_key.initialize() ); + ATH_CHECK( m_hlt_tcpufit_met_key.initialize() ); + ATH_CHECK( m_hlt_run2_cell_met_key.initialize() ); + ATH_CHECK( m_hlt_run2_mht_met_key.initialize() ); + ATH_CHECK( m_hlt_run2_tc_met_key.initialize() ); + ATH_CHECK( m_hlt_run2_tcpufit_met_key.initialize() ); return AthMonitorAlgorithm::initialize(); } @@ -33,22 +51,52 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // access met containers SG::ReadHandle<xAOD::EnergySumRoI> l1_roi_cont(m_lvl1_roi_key, ctx); - if (! l1_roi_cont.isValid() ) { + if (! l1_roi_cont.isValid() ) { ATH_MSG_ERROR("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); return StatusCode::FAILURE; } + SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_cell_met_cont(m_hlt_cell_met_key, ctx); if (! hlt_cell_met_cont.isValid() ) { - ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); - return StatusCode::FAILURE; + hlt_cell_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_cell_met_key, ctx); + if (! hlt_cell_met_cont.isValid() ) { + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_cell_met_key); + return StatusCode::FAILURE; + } } + SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_mht_met_cont(m_hlt_mht_met_key, ctx); if (! hlt_mht_met_cont.isValid() ) { - ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); - return StatusCode::FAILURE; + hlt_mht_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_mht_met_key, ctx); + if (! hlt_mht_met_cont.isValid() ) { + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_mht_met_key); + return StatusCode::FAILURE; + } + } + + SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_tc_met_cont(m_hlt_tc_met_key, ctx); + if (! hlt_tc_met_cont.isValid() ) { + hlt_tc_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_tc_met_key, ctx); + if (! hlt_tc_met_cont.isValid() ) { + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key); + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tc_met_key); + return StatusCode::FAILURE; + } + } + + SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); + if (! hlt_tcpufit_met_cont.isValid() ) { + hlt_tcpufit_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_tcpufit_met_key, ctx); + if (! hlt_tcpufit_met_cont.isValid() ) { + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key); + ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tcpufit_met_key); + return StatusCode::FAILURE; + } } - // define TrigMissingET objet + // define TrigMissingET object const xAOD::TrigMissingET *hlt_met = 0; // define variables @@ -61,6 +109,12 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co auto mht_Ex = Monitored::Scalar<float>("mht_Ex",0.0); auto mht_Ey = Monitored::Scalar<float>("mht_Ey",0.0); auto mht_Et = Monitored::Scalar<float>("mht_Et",0.0); + auto tc_Ex = Monitored::Scalar<float>("tc_Ex",0.0); + auto tc_Ey = Monitored::Scalar<float>("tc_Ey",0.0); + auto tc_Et = Monitored::Scalar<float>("tc_Et",0.0); + auto tcpufit_Ex = Monitored::Scalar<float>("tcpufit_Ex",0.0); + auto tcpufit_Ey = Monitored::Scalar<float>("tcpufit_Ey",0.0); + auto tcpufit_Et = Monitored::Scalar<float>("tcpufit_Et",0.0); // access L1 MET values // The follosing code was commented till we can get a proper input AOD file @@ -75,7 +129,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co */ // access HLT cell MET values - if (! hlt_cell_met_cont.isValid() ) { + if ( hlt_cell_met_cont.isValid() ) { hlt_met = hlt_cell_met_cont->at(0); cell_Ex = (hlt_met->ex())/1000.; cell_Ey = (hlt_met->ey())/1000.; @@ -83,20 +137,39 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co } // access HLT mht MET values - if (! hlt_mht_met_cont.isValid() ) { + if ( hlt_mht_met_cont.isValid() ) { hlt_met = hlt_mht_met_cont->at(0); mht_Ex = (hlt_met->ex())/1000.; mht_Ey = (hlt_met->ey())/1000.; mht_Et = sqrt(mht_Ex*mht_Ex + mht_Ey*mht_Ey); } + // access HLT tclcw MET values + if ( hlt_tc_met_cont.isValid() ) { + hlt_met = hlt_tc_met_cont->at(0); + tc_Ex = (hlt_met->ex())/1000.; + tc_Ey = (hlt_met->ey())/1000.; + tc_Et = sqrt(tc_Ex*tc_Ex + tc_Ey*tc_Ey); + } + + // access HLT tcPufit MET values + if ( hlt_tcpufit_met_cont.isValid() ) { + hlt_met = hlt_tcpufit_met_cont->at(0); + tcpufit_Ex = (hlt_met->ex())/1000.; + tcpufit_Ey = (hlt_met->ey())/1000.; + tcpufit_Et = sqrt(tcpufit_Ex*tcpufit_Ex + tcpufit_Ey*tcpufit_Ey); + } + // Fill. First argument is the tool (GMT) name as defined in the py file, // all others are the variables to be saved. - fill("TrigMETMonitor",L1_Ex,L1_Ey,L1_Et,cell_Ex,cell_Ey,cell_Et); + fill("TrigMETMonitor",L1_Ex,L1_Ey,L1_Et); // Alternative fill method. Get the group yourself, and pass it to the fill function. auto tool = getGroup("TrigMETMonitor"); + fill(tool,cell_Ex,cell_Ey,cell_Et); fill(tool,mht_Ex,mht_Ey,mht_Et); + fill(tool,tc_Ex,tc_Ey,tc_Et); + fill(tool,tcpufit_Ex,tcpufit_Ey,tcpufit_Et); return StatusCode::SUCCESS; } diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h index cd2c1e06d255892b934f4894566ac3b990587d78..3683ad948d870620fcd71d3f68dec9a279657859 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h @@ -23,8 +23,16 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { private: SG::ReadHandleKey<xAOD::EnergySumRoI> m_lvl1_roi_key; + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_cell_met_key; SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_mht_met_key; + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_tc_met_key; + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_tcpufit_met_key; + + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_cell_met_key; + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_mht_met_key; + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_tc_met_key; + SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_tcpufit_met_key;