From a5f5c0d2aa377918182b73e08066f2408a5a068c Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 5 Sep 2019 13:47:36 -0700 Subject: [PATCH 01/16] first attempt for Run3 containers --- .../python/TrigMETMonitorAlgorithm.py | 15 ++- .../TrigMETMonitorAlgorithm_jobOptions.py | 8 +- .../src/TrigMETMonitorAlgorithm.cxx | 95 ++++++++++++++++--- .../src/TrigMETMonitorAlgorithm.h | 8 ++ 4 files changed, 110 insertions(+), 16 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index dbdc5793f3d..b10941d1dbb 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 ed28e0abffc..7edeb674fcb 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 29d70753a95..ebe1a2fa9c0 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 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 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(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 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(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 hlt_tc_met_cont(m_hlt_tc_met_key, ctx); + if (! hlt_tc_met_cont.isValid() ) { + hlt_tc_met_cont = SG::ReadHandle(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 hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); + if (! hlt_tcpufit_met_cont.isValid() ) { + hlt_tcpufit_met_cont = SG::ReadHandle(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("mht_Ex",0.0); auto mht_Ey = Monitored::Scalar("mht_Ey",0.0); auto mht_Et = Monitored::Scalar("mht_Et",0.0); + auto tc_Ex = Monitored::Scalar("tc_Ex",0.0); + auto tc_Ey = Monitored::Scalar("tc_Ey",0.0); + auto tc_Et = Monitored::Scalar("tc_Et",0.0); + auto tcpufit_Ex = Monitored::Scalar("tcpufit_Ex",0.0); + auto tcpufit_Ey = Monitored::Scalar("tcpufit_Ey",0.0); + auto tcpufit_Et = Monitored::Scalar("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 cd2c1e06d25..3683ad948d8 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 m_lvl1_roi_key; + SG::ReadHandleKey m_hlt_cell_met_key; SG::ReadHandleKey m_hlt_mht_met_key; + SG::ReadHandleKey m_hlt_tc_met_key; + SG::ReadHandleKey m_hlt_tcpufit_met_key; + + SG::ReadHandleKey m_hlt_run2_cell_met_key; + SG::ReadHandleKey m_hlt_run2_mht_met_key; + SG::ReadHandleKey m_hlt_run2_tc_met_key; + SG::ReadHandleKey m_hlt_run2_tcpufit_met_key; -- GitLab From 36c34fa64df704e3b099b16fd8d1122fc7ee0bce Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Tue, 17 Sep 2019 09:42:07 -0700 Subject: [PATCH 02/16] Ru2 containers removed --- .../src/TrigMETMonitorAlgorithm.cxx | 92 +++++++++---------- .../src/TrigMETMonitorAlgorithm.h | 8 +- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index ebe1a2fa9c0..e3a90f5a80f 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -11,20 +11,20 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcL , 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") + //, 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); + //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); } @@ -37,10 +37,10 @@ StatusCode TrigMETMonitorAlgorithm::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() ); + //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(); } @@ -52,48 +52,48 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // access met containers SG::ReadHandle l1_roi_cont(m_lvl1_roi_key, ctx); if (! l1_roi_cont.isValid() ) { - ATH_MSG_ERROR("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); - return StatusCode::FAILURE; + ATH_MSG_INFO("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); + //return StatusCode::FAILURE; } SG::ReadHandle hlt_cell_met_cont(m_hlt_cell_met_key, ctx); - if (! hlt_cell_met_cont.isValid() ) { - hlt_cell_met_cont = SG::ReadHandle(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; - } + if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { + //hlt_cell_met_cont = SG::ReadHandle(m_hlt_run2_cell_met_key, ctx); + //if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { + ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); + //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_cell_met_key); + //return StatusCode::FAILURE; + //} } SG::ReadHandle hlt_mht_met_cont(m_hlt_mht_met_key, ctx); - if (! hlt_mht_met_cont.isValid() ) { - hlt_mht_met_cont = SG::ReadHandle(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; - } + if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { + //hlt_mht_met_cont = SG::ReadHandle(m_hlt_run2_mht_met_key, ctx); + //if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { + ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); + //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_mht_met_key); + //return StatusCode::FAILURE; + //} } SG::ReadHandle hlt_tc_met_cont(m_hlt_tc_met_key, ctx); - if (! hlt_tc_met_cont.isValid() ) { - hlt_tc_met_cont = SG::ReadHandle(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; - } + if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { + //hlt_tc_met_cont = SG::ReadHandle(m_hlt_run2_tc_met_key, ctx); + //if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { + ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key); + //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tc_met_key); + //return StatusCode::FAILURE; + //} } SG::ReadHandle hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); - if (! hlt_tcpufit_met_cont.isValid() ) { - hlt_tcpufit_met_cont = SG::ReadHandle(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; - } + if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { + //hlt_tcpufit_met_cont = SG::ReadHandle(m_hlt_run2_tcpufit_met_key, ctx); + //if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { + ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key); + //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tcpufit_met_key); + //return StatusCode::FAILURE; + //} } // define TrigMissingET object @@ -129,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->size() > 0 && 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.; @@ -137,7 +137,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co } // access HLT mht MET values - if ( hlt_mht_met_cont.isValid() ) { + if ( hlt_mht_met_cont->size() > 0 && 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.; @@ -145,7 +145,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co } // access HLT tclcw MET values - if ( hlt_tc_met_cont.isValid() ) { + if ( hlt_tc_met_cont->size() > 0 && 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.; @@ -153,7 +153,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co } // access HLT tcPufit MET values - if ( hlt_tcpufit_met_cont.isValid() ) { + if ( hlt_tcpufit_met_cont->size() > 0 && 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.; diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h index 3683ad948d8..ce2ba226cae 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h @@ -29,10 +29,10 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey m_hlt_tc_met_key; SG::ReadHandleKey m_hlt_tcpufit_met_key; - SG::ReadHandleKey m_hlt_run2_cell_met_key; - SG::ReadHandleKey m_hlt_run2_mht_met_key; - SG::ReadHandleKey m_hlt_run2_tc_met_key; - SG::ReadHandleKey m_hlt_run2_tcpufit_met_key; + //SG::ReadHandleKey m_hlt_run2_cell_met_key; + //SG::ReadHandleKey m_hlt_run2_mht_met_key; + //SG::ReadHandleKey m_hlt_run2_tc_met_key; + //SG::ReadHandleKey m_hlt_run2_tcpufit_met_key; -- GitLab From cc1a944fa0448bf5445dd0abc919498c0436ddc9 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Wed, 18 Sep 2019 08:56:00 -0700 Subject: [PATCH 03/16] First working code with MT AOD --- .../python/TrigMETMonitorAlgorithm.py | 18 ++++++++-- .../src/TrigMETMonitorAlgorithm.cxx | 34 ++----------------- .../src/TrigMETMonitorAlgorithm.h | 7 ---- 3 files changed, 19 insertions(+), 40 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index b10941d1dbb..efebccdd02e 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -47,7 +47,21 @@ def TrigMETMonConfig(inputFlags): # expertTrigMETMonAlg.RandomHist = True # to enable a trigger filter, for example: #expertTrigMETMonAlg.TriggerChain = 'HLT_mu26_ivarmedium' - expertTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + + from TriggerJobOpts.TriggerFlags import TriggerFlags + if TriggerFlags.EDMDecodingVersion==3: + expertTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + expertTrigMETMonAlg.hlt_cell_key = 'HLT_MET' + shifterTrigMETMonAlg.hlt_cell_key = 'HLT_MET' + TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_MET' + else: + expertTrigMETMonAlg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50' + TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' + TrigMETMonitorAlgorithm.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' + TrigMETMonitorAlgorithm.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' + TrigMETMonitorAlgorithm.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' + + ### STEP 4 ### # Add some tools. N.B. Do not use your own trigger decion tool. Use the @@ -130,7 +144,7 @@ if __name__=='__main__': file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1' #ConfigFlags.Input.Files = [nightly+file] ConfigFlags.Input.Files = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD.pool.root'] - ConfigFlags.Input.isMC = False + ConfigFlags.Input.isMC = True ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' ConfigFlags.lock() diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index e3a90f5a80f..24a0f63883c 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -11,20 +11,12 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcL , 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); } @@ -37,10 +29,6 @@ StatusCode TrigMETMonitorAlgorithm::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(); } @@ -58,42 +46,26 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co SG::ReadHandle hlt_cell_met_cont(m_hlt_cell_met_key, ctx); if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { - //hlt_cell_met_cont = SG::ReadHandle(m_hlt_run2_cell_met_key, ctx); - //if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { - ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); - //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_cell_met_key); - //return StatusCode::FAILURE; - //} + ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); + //return StatusCode::FAILURE; } SG::ReadHandle hlt_mht_met_cont(m_hlt_mht_met_key, ctx); if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { - //hlt_mht_met_cont = SG::ReadHandle(m_hlt_run2_mht_met_key, ctx); - //if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); - //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_mht_met_key); //return StatusCode::FAILURE; - //} } SG::ReadHandle hlt_tc_met_cont(m_hlt_tc_met_key, ctx); if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { - //hlt_tc_met_cont = SG::ReadHandle(m_hlt_run2_tc_met_key, ctx); - //if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key); - //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tc_met_key); //return StatusCode::FAILURE; - //} } SG::ReadHandle hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { - //hlt_tcpufit_met_cont = SG::ReadHandle(m_hlt_run2_tcpufit_met_key, ctx); - //if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key); - //ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tcpufit_met_key); //return StatusCode::FAILURE; - //} } // define TrigMissingET object @@ -117,7 +89,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co auto tcpufit_Et = Monitored::Scalar("tcpufit_Et",0.0); // access L1 MET values - // The follosing code was commented till we can get a proper input AOD file + // The following code was commented till we can get a proper input AOD file /* if ( l1_roi_cont.isValid() ) { if ((l1_roi_cont->energyX())>-9e12 && (l1_roi_cont->energyX())<9e12 && (l1_roi_cont->energyY())>-9e12 && (l1_roi_cont->energyY())<9e12) { diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h index ce2ba226cae..b79251c0445 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h @@ -29,12 +29,5 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey m_hlt_tc_met_key; SG::ReadHandleKey m_hlt_tcpufit_met_key; - //SG::ReadHandleKey m_hlt_run2_cell_met_key; - //SG::ReadHandleKey m_hlt_run2_mht_met_key; - //SG::ReadHandleKey m_hlt_run2_tc_met_key; - //SG::ReadHandleKey m_hlt_run2_tcpufit_met_key; - - - }; #endif -- GitLab From c7a092953fd7db3a2a3cab0c6739ba639dfce1f4 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Wed, 18 Sep 2019 11:59:20 -0700 Subject: [PATCH 04/16] test TDT added --- .../src/TrigMETMonitorAlgorithm.cxx | 28 +++++++++++++++++++ .../src/TrigMETMonitorAlgorithm.h | 6 ++++ 2 files changed, 34 insertions(+) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index 24a0f63883c..d7c3660bb50 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -11,6 +11,7 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcL , 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_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") { declareProperty("l1_roi_key", m_lvl1_roi_key); declareProperty("hlt_cell_key", m_hlt_cell_met_key); @@ -30,6 +31,8 @@ StatusCode TrigMETMonitorAlgorithm::initialize() { ATH_CHECK( m_hlt_tc_met_key.initialize() ); ATH_CHECK( m_hlt_tcpufit_met_key.initialize() ); + ATH_CHECK( m_trigDecTool.retrieve() ); + return AthMonitorAlgorithm::initialize(); } @@ -132,6 +135,31 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co tcpufit_Et = sqrt(tcpufit_Ex*tcpufit_Ex + tcpufit_Ey*tcpufit_Ey); } + + // TDT test + if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) { + ATH_MSG_INFO("passed HLT_xe30_cell_L1XE10"); + } else { + ATH_MSG_INFO("not passed HLT_xe30_cell_L1XE10"); + } + if (m_trigDecTool->isPassed("HLT_xe110_pufit_xe70_L1XE50")) { + ATH_MSG_INFO("passed HLT_xe110_pufit_xe70l_L1XE50"); + } else { + ATH_MSG_INFO("not passed HLT_xe110_pufit_xe70_L1XE50"); + } + + // check active triggers + // This does not work for now + /* + auto chaingroup = m_trigDecTool->getChainGroup("HLT_xe.*"); + for(auto &trig : chainGroup->getListOfTriggers()) { + auto cg = m_trigDecTool->getChainGroup(trig); + std::string thisTrig = trig; + ATH_MSG_INFO (thisTrig << " chain prescale = " << cg->getPrescale()); + } + */ + + // 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); diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h index b79251c0445..1e03660c7cf 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h @@ -13,6 +13,8 @@ #include "xAODTrigMissingET/TrigMissingETContainer.h" #include "xAODTrigMissingET/TrigMissingETAuxContainer.h" +//#include "TrigDecisionTool/TrigDecisionTool.h" +#include "TrigDecisionInterface/ITrigDecisionTool.h" class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { public: @@ -29,5 +31,9 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey m_hlt_tc_met_key; SG::ReadHandleKey m_hlt_tcpufit_met_key; + ToolHandle m_trigDecTool; + //ToolHandle m_trigDecTool{this, "TrigDecisionTool",""}; + + }; #endif -- GitLab From 877d3e7a309bf1b2c6a7198eea43f8603a2b6b08 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 19 Sep 2019 12:15:40 -0700 Subject: [PATCH 05/16] TDT included --- .../python/TrigMETMonitorAlgorithm.py | 43 ++++++++++--------- .../src/TrigMETMonitorAlgorithm.cxx | 32 +++++++++----- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index efebccdd02e..9692e1eb4b7 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -51,9 +51,10 @@ def TrigMETMonConfig(inputFlags): from TriggerJobOpts.TriggerFlags import TriggerFlags if TriggerFlags.EDMDecodingVersion==3: expertTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' - expertTrigMETMonAlg.hlt_cell_key = 'HLT_MET' - shifterTrigMETMonAlg.hlt_cell_key = 'HLT_MET' - TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_MET' + #shifterTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + #expertTrigMETMonAlg.hlt_cell_key = 'HLT_MET' + #shifterTrigMETMonAlg.hlt_cell_key = 'HLT_MET' + #TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_MET' else: expertTrigMETMonAlg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50' TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' @@ -91,35 +92,35 @@ def TrigMETMonConfig(inputFlags): # Configure histograms #NB! The histograms defined here must match the ones in the cxx file exactly shifterGroup.defineHistogram('L1_Ex',title='L1 Missing E_{x};E_{x} (GeV);Events', - path='L1',xbins=199,xmin=-298.5,xmax=298.5) + path='L1',xbins=199,xmin=-298.5,xmax=298.5) shifterGroup.defineHistogram('L1_Ey',title='L1 Missing E_{y};E_{y} (GeV);Events', - path='L1',xbins=199,xmin=-298.5,xmax=298.5) + path='L1',xbins=199,xmin=-298.5,xmax=298.5) shifterGroup.defineHistogram('L1_Et',title='L1 Missing E_{T};E_{T} (GeV);Events', - path='L1',xbins=205,xmin=-13.5,xmax=401.5) + path='L1',xbins=205,xmin=-13.5,xmax=401.5) shifterGroup.defineHistogram('cell_Ex',title='cell Missing E_{x};E_{x} (GeV);Events', - path='cell',xbins=199,xmin=-298.5,xmax=298.5) + path='cell',xbins=199,xmin=-298.5,xmax=298.5) shifterGroup.defineHistogram('cell_Ey',title='cell Missing E_{y};E_{y} (GeV);Events', - path='cell',xbins=199,xmin=-298.5,xmax=298.5) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + path='tc',xbins=205,xmin=-13.5,xmax=401.5) ### STEP 6 ### # Finalize. The return value should be a tuple of the ComponentAccumulator @@ -142,9 +143,9 @@ 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 = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD.pool.root'] - ConfigFlags.Input.isMC = True + ConfigFlags.Input.Files = [nightly+file] + #ConfigFlags.Input.Files = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD_old.pool.root'] + ConfigFlags.Input.isMC = False ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' ConfigFlags.lock() diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index d7c3660bb50..26dabaade00 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -43,31 +43,31 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // access met containers SG::ReadHandle l1_roi_cont(m_lvl1_roi_key, ctx); if (! l1_roi_cont.isValid() ) { - ATH_MSG_INFO("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); + ATH_MSG_WARNING("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); //return StatusCode::FAILURE; } SG::ReadHandle hlt_cell_met_cont(m_hlt_cell_met_key, ctx); if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { - ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); + ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); //return StatusCode::FAILURE; } SG::ReadHandle hlt_mht_met_cont(m_hlt_mht_met_key, ctx); if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { - ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); + ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); //return StatusCode::FAILURE; } SG::ReadHandle hlt_tc_met_cont(m_hlt_tc_met_key, ctx); if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { - ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key); + ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key); //return StatusCode::FAILURE; } SG::ReadHandle hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { - ATH_MSG_INFO("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key); + ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key); //return StatusCode::FAILURE; } @@ -138,14 +138,24 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // TDT test if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) { - ATH_MSG_INFO("passed HLT_xe30_cell_L1XE10"); + ATH_MSG_DEBUG("passed HLT_xe30_cell_L1XE10"); } else { - ATH_MSG_INFO("not passed HLT_xe30_cell_L1XE10"); + ATH_MSG_DEBUG("not passed HLT_xe30_cell_L1XE10"); } - if (m_trigDecTool->isPassed("HLT_xe110_pufit_xe70_L1XE50")) { - ATH_MSG_INFO("passed HLT_xe110_pufit_xe70l_L1XE50"); + if (m_trigDecTool->isPassed("HLT_xe30_cell_xe30_tcpufit_L1XE10")) { + ATH_MSG_DEBUG("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); } else { - ATH_MSG_INFO("not passed HLT_xe110_pufit_xe70_L1XE50"); + ATH_MSG_DEBUG("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + } + if (m_trigDecTool->isPassed("HLT_xe30_tcpufit_L1XE10")) { + ATH_MSG_DEBUG("passed HLT_xe30_tcpufit_L1XE10"); + } else { + ATH_MSG_DEBUG("not passed HLT_xe30_tcpufit_L1XE10"); + } + if (m_trigDecTool->isPassed(m_triggerChainString)) { + ATH_MSG_DEBUG("passed " << m_triggerChainString); + } else { + ATH_MSG_DEBUG("not passed " << m_triggerChainString); } // check active triggers @@ -155,7 +165,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co for(auto &trig : chainGroup->getListOfTriggers()) { auto cg = m_trigDecTool->getChainGroup(trig); std::string thisTrig = trig; - ATH_MSG_INFO (thisTrig << " chain prescale = " << cg->getPrescale()); + ATH_MSG_DEBUG (thisTrig << " chain prescale = " << cg->getPrescale()); } */ -- GitLab From c8092086d62282d7685d7764dd64d7a1ac9aaaf3 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Fri, 20 Sep 2019 05:53:07 -0700 Subject: [PATCH 06/16] TriggerFlags.EDMDecodingVersion removed --- .../python/TrigMETMonitorAlgorithm.py | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 9692e1eb4b7..097e471147a 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -29,7 +29,7 @@ def TrigMETMonConfig(inputFlags): #The added algorithm must exist as a .h file from TrigMETMonitoring.TrigMETMonitoringConf import TrigMETMonitorAlgorithm - expertTrigMETMonAlg = helper.addAlgorithm(TrigMETMonitorAlgorithm,'TrigMETMonAlg') + expertTrigMETMonAlg = helper.addAlgorithm(TrigMETMonitorAlgorithm,'expertTrigMETMonAlg') # You can actually make multiple instances of the same algorithm and give # them different configurations @@ -46,21 +46,20 @@ def TrigMETMonConfig(inputFlags): # some generic property # expertTrigMETMonAlg.RandomHist = True # to enable a trigger filter, for example: - #expertTrigMETMonAlg.TriggerChain = 'HLT_mu26_ivarmedium' - - from TriggerJobOpts.TriggerFlags import TriggerFlags - if TriggerFlags.EDMDecodingVersion==3: - expertTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' - #shifterTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' - #expertTrigMETMonAlg.hlt_cell_key = 'HLT_MET' - #shifterTrigMETMonAlg.hlt_cell_key = 'HLT_MET' - #TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_MET' - else: - expertTrigMETMonAlg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50' - TrigMETMonitorAlgorithm.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' - TrigMETMonitorAlgorithm.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' - TrigMETMonitorAlgorithm.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' - TrigMETMonitorAlgorithm.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' + # expertTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + # shifterTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + # without filters, all events are processed. + + ### use the follwoing if you run on Run2 AOD + #expertTrigMETMonAlg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50' + #expertTrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' + #expertTrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' + #expertTrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' + #expertTrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' + #shifterTrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' + #shifterTrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' + #shifterTrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' + #shifterTrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' @@ -143,9 +142,9 @@ 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 = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD_old.pool.root'] - ConfigFlags.Input.isMC = False + #ConfigFlags.Input.Files = [nightly+file] + ConfigFlags.Input.Files = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD_old.pool.root'] + ConfigFlags.Input.isMC = True ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' ConfigFlags.lock() -- GitLab From c881cd1be56f677fa511d7f97c0f33855434c187 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Tue, 24 Sep 2019 08:24:06 -0700 Subject: [PATCH 07/16] TrigMETMonitorAlgorithm update --- .../python/TrigMETMonitorAlgorithm.py | 103 ++++++++++-------- .../src/TrigMETMonitorAlgorithm.cxx | 19 ++-- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 097e471147a..3b26f490e09 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -29,11 +29,11 @@ def TrigMETMonConfig(inputFlags): #The added algorithm must exist as a .h file from TrigMETMonitoring.TrigMETMonitoringConf import TrigMETMonitorAlgorithm - expertTrigMETMonAlg = helper.addAlgorithm(TrigMETMonitorAlgorithm,'expertTrigMETMonAlg') + TrigMETMonAlg = helper.addAlgorithm(TrigMETMonitorAlgorithm,'TrigMETMonAlg') # You can actually make multiple instances of the same algorithm and give # them different configurations - shifterTrigMETMonAlg = helper.addAlgorithm(TrigMETMonitorAlgorithm,'ShifterTrigMETMonAlg') + TrigMETMonChainAlg = helper.addAlgorithm(TrigMETMonitorAlgorithm,'TrigMETMonChainAlg') # # If for some really obscure reason you need to instantiate an algorithm # # yourself, the AddAlgorithm method will still configure the base @@ -46,21 +46,24 @@ def TrigMETMonConfig(inputFlags): # some generic property # expertTrigMETMonAlg.RandomHist = True # to enable a trigger filter, for example: - # expertTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' - # shifterTrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + # TrigMETMonAlg.TriggerChain = 'HLT_xe30_cell_L1XE10' + # possible chains as of Sep 2019 are + # L1_XE10,L1_XE50, + # HLT_xe30_cell_L1XE10,HLT_xe30_cell_xe30_tcpufit_L1XE10,HLT_xe30_tcpufit_L1XE10,HLT_xe65_cell_L1XE50, + # HLT_xe110_pufit_xe65_L1XE50,HLT_xe110_pufit_xe70_L1XE50, + # HLT_xe110_pufit_xe65_L1gXERHO50,HLT_xe110_pufit_xe65_L1gXEPUFIT50, + # HLT_xe0noL1_l2fsperf_L1gXERHO50,HLT_xe0noL1_l2fsperf_L1gXEPUFIT50, + # HLT_xe0noL1_l2fsperf_pufit_L1gXERHO50,HLT_xe0noL1_l2fsperf_pufit_L1gXEPUFIT50 # without filters, all events are processed. + TrigMETMonChainAlg.TriggerChain = 'HLT_xe30_tcpufit_L1XE10' + ### use the follwoing if you run on Run2 AOD - #expertTrigMETMonAlg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50' - #expertTrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' - #expertTrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' - #expertTrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' - #expertTrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' - #shifterTrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' - #shifterTrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' - #shifterTrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' - #shifterTrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' - + #TrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET' + #TrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' + #TrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' + #TrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' + ### STEP 4 ### @@ -82,44 +85,50 @@ def TrigMETMonConfig(inputFlags): # Add a generic monitoring tool (a "group" in old language). The returned # object here is the standard GenericMonitoringTool. - expertGroup = helper.addGroup(expertTrigMETMonAlg,'TrigMETMonitor','HLT/METMon/Expert/') + metGroup = helper.addGroup(TrigMETMonAlg,'TrigMETMonitor','HLT/METMon/') # Add a GMT for the other example monitor algorithm - shifterGroup = helper.addGroup(shifterTrigMETMonAlg,'TrigMETMonitor','HLT/METMon/Shifter/') + metChainGroup = helper.addGroup(TrigMETMonChainAlg,'TrigMETMonitor','HLT/METMon/Expert/Chain/') ### STEP 5 ### # Configure histograms #NB! The histograms defined here must match the ones in the cxx file exactly - shifterGroup.defineHistogram('L1_Ex',title='L1 Missing E_{x};E_{x} (GeV);Events', - path='L1',xbins=199,xmin=-298.5,xmax=298.5) - shifterGroup.defineHistogram('L1_Ey',title='L1 Missing E_{y};E_{y} (GeV);Events', - path='L1',xbins=199,xmin=-298.5,xmax=298.5) - shifterGroup.defineHistogram('L1_Et',title='L1 Missing E_{T};E_{T} (GeV);Events', - path='L1',xbins=205,xmin=-13.5,xmax=401.5) - shifterGroup.defineHistogram('cell_Ex',title='cell Missing E_{x};E_{x} (GeV);Events', - path='cell',xbins=199,xmin=-298.5,xmax=298.5) - shifterGroup.defineHistogram('cell_Ey',title='cell Missing E_{y};E_{y} (GeV);Events', - 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) + metGroup.defineHistogram('L1_Ex',title='L1 Missing E_{x};E_{x} (GeV);Events', + path='Shifter/L1',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('L1_Ey',title='L1 Missing E_{y};E_{y} (GeV);Events', + path='Shifter/L1',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('L1_Et',title='L1 Missing E_{T};E_{T} (GeV);Events', + path='Shifter/L1',xbins=205,xmin=-13.5,xmax=401.5) + metGroup.defineHistogram('cell_Ex',title='cell Missing E_{x};E_{x} (GeV);Events', + path='Shifter/cell',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('cell_Ey',title='cell Missing E_{y};E_{y} (GeV);Events', + path='Shifter/cell',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('cell_Et',title='cell Missing E_{T};E_{T} (GeV);Events', + path='Shifter/cell',xbins=205,xmin=-13.5,xmax=401.5) + metGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} (GeV);Events', + path='Shifter/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} (GeV);Events', + path='Shifter/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} (GeV);Events', + path='Shifter/tcpufit',xbins=205,xmin=-13.5,xmax=401.5) + metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} (GeV);Events', + path='Expert/mht',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} (GeV);Events', + path='Expert/mht',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('mht_Et', title='mht E_{T};E_{T} (GeV);Events', + path='Expert/mht',xbins=205,xmin=-13.5,xmax=401.5) + metGroup.defineHistogram('tc_Ex',title='tc Missing E_{x};E_{x} (GeV);Events', + path='Expert/tc',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('tc_Ey',title='tc Missing E_{y};E_{y} (GeV);Events', + path='Expert/tc',xbins=199,xmin=-298.5,xmax=298.5) + metGroup.defineHistogram('tc_Et', title='tc E_{T};E_{T} (GeV);Events', + path='Expert/tc',xbins=205,xmin=-13.5,xmax=401.5) + metChainGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} (GeV);Events', + path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) + metChainGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} (GeV);Events', + path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) + metChainGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} (GeV);Events', + path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=205,xmin=-13.5,xmax=401.5) ### STEP 6 ### # Finalize. The return value should be a tuple of the ComponentAccumulator @@ -143,7 +152,7 @@ if __name__=='__main__': 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 = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD_old.pool.root'] + ConfigFlags.Input.Files = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD.pool.root'] ConfigFlags.Input.isMC = True ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index 26dabaade00..15dea79acc7 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -98,7 +98,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co if ((l1_roi_cont->energyX())>-9e12 && (l1_roi_cont->energyX())<9e12 && (l1_roi_cont->energyY())>-9e12 && (l1_roi_cont->energyY())<9e12) { L1_Ex = - (l1_roi_cont->energyX())/1000.; L1_Ey = - (l1_roi_cont->energyY())/1000.; - L1_Et = sqrt(L1_Ex*L1_Ex + L1_Ey*L1_Ey); + L1_Et = - (l1_roi_cont->energyT())/1000.; } } */ @@ -138,24 +138,19 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // TDT test if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) { - ATH_MSG_DEBUG("passed HLT_xe30_cell_L1XE10"); + ATH_MSG_INFO("passed HLT_xe30_cell_L1XE10"); } else { - ATH_MSG_DEBUG("not passed HLT_xe30_cell_L1XE10"); + ATH_MSG_INFO("not passed HLT_xe30_cell_L1XE10"); } if (m_trigDecTool->isPassed("HLT_xe30_cell_xe30_tcpufit_L1XE10")) { - ATH_MSG_DEBUG("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + ATH_MSG_INFO("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); } else { - ATH_MSG_DEBUG("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + ATH_MSG_INFO("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); } if (m_trigDecTool->isPassed("HLT_xe30_tcpufit_L1XE10")) { - ATH_MSG_DEBUG("passed HLT_xe30_tcpufit_L1XE10"); + ATH_MSG_INFO("passed HLT_xe30_tcpufit_L1XE10"); } else { - ATH_MSG_DEBUG("not passed HLT_xe30_tcpufit_L1XE10"); - } - if (m_trigDecTool->isPassed(m_triggerChainString)) { - ATH_MSG_DEBUG("passed " << m_triggerChainString); - } else { - ATH_MSG_DEBUG("not passed " << m_triggerChainString); + ATH_MSG_INFO("not passed HLT_xe30_tcpufit_L1XE10"); } // check active triggers -- GitLab From 592556d16bca25e860d13c6e6137a487bf44ff8c Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 3 Oct 2019 10:15:08 -0700 Subject: [PATCH 08/16] TrigMETMonitorAlgorithm update --- .../python/TrigMETMonitorAlgorithm.py | 3 ++- .../src/TrigMETMonitorAlgorithm.cxx | 16 +++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 3b26f490e09..d308d220068 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -55,6 +55,7 @@ def TrigMETMonConfig(inputFlags): # HLT_xe0noL1_l2fsperf_L1gXERHO50,HLT_xe0noL1_l2fsperf_L1gXEPUFIT50, # HLT_xe0noL1_l2fsperf_pufit_L1gXERHO50,HLT_xe0noL1_l2fsperf_pufit_L1gXEPUFIT50 # without filters, all events are processed. + TrigMETMonAlg.TriggerChain = 'L1_XE10' TrigMETMonChainAlg.TriggerChain = 'HLT_xe30_tcpufit_L1XE10' @@ -88,7 +89,7 @@ def TrigMETMonConfig(inputFlags): metGroup = helper.addGroup(TrigMETMonAlg,'TrigMETMonitor','HLT/METMon/') # Add a GMT for the other example monitor algorithm - metChainGroup = helper.addGroup(TrigMETMonChainAlg,'TrigMETMonitor','HLT/METMon/Expert/Chain/') + metChainGroup = helper.addGroup(TrigMETMonChainAlg,'TrigMETMonitor','HLT/METMon/Chain/') ### STEP 5 ### # Configure histograms diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index 15dea79acc7..ec39c2ae5a6 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -137,21 +137,27 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // TDT test + ATH_MSG_INFO("MetMon: TST test"); + if (m_trigDecTool->isPassed("L1_XE10")) { + ATH_MSG_INFO("passed L1_XE10"); + } else { + ATH_MSG_INFO("not passed L1_XE10"); + } if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) { ATH_MSG_INFO("passed HLT_xe30_cell_L1XE10"); } else { ATH_MSG_INFO("not passed HLT_xe30_cell_L1XE10"); } - if (m_trigDecTool->isPassed("HLT_xe30_cell_xe30_tcpufit_L1XE10")) { - ATH_MSG_INFO("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); - } else { - ATH_MSG_INFO("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); - } if (m_trigDecTool->isPassed("HLT_xe30_tcpufit_L1XE10")) { ATH_MSG_INFO("passed HLT_xe30_tcpufit_L1XE10"); } else { ATH_MSG_INFO("not passed HLT_xe30_tcpufit_L1XE10"); } + if (m_trigDecTool->isPassed("HLT_xe30_cell_xe30_tcpufit_L1XE10")) { + ATH_MSG_INFO("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + } else { + ATH_MSG_INFO("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + } // check active triggers // This does not work for now -- GitLab From 7342f1291d4c24be83f22923e415358e51a23c42 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 3 Oct 2019 13:04:18 -0700 Subject: [PATCH 09/16] TrigMETMonitorAlgorithm WARNING message update --- .../python/TrigMETMonitorAlgorithm.py | 4 ++-- .../TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index d308d220068..eee3f58e1c7 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -55,7 +55,7 @@ def TrigMETMonConfig(inputFlags): # HLT_xe0noL1_l2fsperf_L1gXERHO50,HLT_xe0noL1_l2fsperf_L1gXEPUFIT50, # HLT_xe0noL1_l2fsperf_pufit_L1gXERHO50,HLT_xe0noL1_l2fsperf_pufit_L1gXEPUFIT50 # without filters, all events are processed. - TrigMETMonAlg.TriggerChain = 'L1_XE10' + #TrigMETMonAlg.TriggerChain = 'L1_XE10' TrigMETMonChainAlg.TriggerChain = 'HLT_xe30_tcpufit_L1XE10' @@ -111,7 +111,7 @@ def TrigMETMonConfig(inputFlags): metGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} (GeV);Events', path='Shifter/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) metGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} (GeV);Events', - path='Shifter/tcpufit',xbins=205,xmin=-13.5,xmax=401.5) + path='Shifter/Eff',xbins=205,xmin=-13.5,xmax=401.5) metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} (GeV);Events', path='Expert/mht',xbins=199,xmin=-298.5,xmax=298.5) metGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} (GeV);Events', diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index ec39c2ae5a6..ac3370bfc7e 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -43,31 +43,31 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // access met containers SG::ReadHandle l1_roi_cont(m_lvl1_roi_key, ctx); if (! l1_roi_cont.isValid() ) { - ATH_MSG_WARNING("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); + ATH_MSG_WARNING("Container "<< m_lvl1_roi_key << " does not exist or is empty"); //return StatusCode::FAILURE; } SG::ReadHandle hlt_cell_met_cont(m_hlt_cell_met_key, ctx); if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { - ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); + ATH_MSG_WARNING("Container "<< m_hlt_cell_met_key << " does not exist or is empty"); //return StatusCode::FAILURE; } SG::ReadHandle hlt_mht_met_cont(m_hlt_mht_met_key, ctx); if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { - ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); + ATH_MSG_WARNING("Container "<< m_hlt_mht_met_key << " does not exist or is empty"); //return StatusCode::FAILURE; } SG::ReadHandle hlt_tc_met_cont(m_hlt_tc_met_key, ctx); if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { - ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key); + ATH_MSG_WARNING("Container "<< m_hlt_tc_met_key << " does not exist or is empty"); //return StatusCode::FAILURE; } SG::ReadHandle hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { - ATH_MSG_WARNING("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key); + ATH_MSG_WARNING("Container "<< m_hlt_tcpufit_met_key << " does not exist or is empty"); //return StatusCode::FAILURE; } -- GitLab From 25f2f32fa020d88f012693606fb5c3ddac242b67 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Fri, 4 Oct 2019 12:55:21 -0700 Subject: [PATCH 10/16] 2d histogram added --- .../python/TrigMETMonitorAlgorithm.py | 114 ++++++++++++------ .../src/TrigMETMonitorAlgorithm.cxx | 21 +++- 2 files changed, 96 insertions(+), 39 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index eee3f58e1c7..7e438c69d04 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -94,43 +94,81 @@ def TrigMETMonConfig(inputFlags): ### STEP 5 ### # Configure histograms #NB! The histograms defined here must match the ones in the cxx file exactly - metGroup.defineHistogram('L1_Ex',title='L1 Missing E_{x};E_{x} (GeV);Events', - path='Shifter/L1',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('L1_Ey',title='L1 Missing E_{y};E_{y} (GeV);Events', - path='Shifter/L1',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('L1_Et',title='L1 Missing E_{T};E_{T} (GeV);Events', - path='Shifter/L1',xbins=205,xmin=-13.5,xmax=401.5) - metGroup.defineHistogram('cell_Ex',title='cell Missing E_{x};E_{x} (GeV);Events', - path='Shifter/cell',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('cell_Ey',title='cell Missing E_{y};E_{y} (GeV);Events', - path='Shifter/cell',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('cell_Et',title='cell Missing E_{T};E_{T} (GeV);Events', - path='Shifter/cell',xbins=205,xmin=-13.5,xmax=401.5) - metGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} (GeV);Events', - path='Shifter/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} (GeV);Events', - path='Shifter/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} (GeV);Events', - path='Shifter/Eff',xbins=205,xmin=-13.5,xmax=401.5) - metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} (GeV);Events', - path='Expert/mht',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} (GeV);Events', - path='Expert/mht',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('mht_Et', title='mht E_{T};E_{T} (GeV);Events', - path='Expert/mht',xbins=205,xmin=-13.5,xmax=401.5) - metGroup.defineHistogram('tc_Ex',title='tc Missing E_{x};E_{x} (GeV);Events', - path='Expert/tc',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('tc_Ey',title='tc Missing E_{y};E_{y} (GeV);Events', - path='Expert/tc',xbins=199,xmin=-298.5,xmax=298.5) - metGroup.defineHistogram('tc_Et', title='tc E_{T};E_{T} (GeV);Events', - path='Expert/tc',xbins=205,xmin=-13.5,xmax=401.5) - metChainGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} (GeV);Events', - path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) - metChainGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} (GeV);Events', - path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=199,xmin=-298.5,xmax=298.5) - metChainGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} (GeV);Events', - path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=205,xmin=-13.5,xmax=401.5) - + # + # Binning + et_bins=205 #Et + et_min=-13.5 + et_max=401.5 + ec_bins=199 #Ex, Ey, Ez + ec_min=-298.5 + ec_max=298.5 + sumet_bins=305 #sumEt + sumet_min=-27.0 + sumet_max=4203.0 + sume_bins=153 #sumE + sume_min=-27.0 + sume_max=24003.0 + phi_bins=32 # phi + phi_min=-3.1416 + phi_max=3.1416 + eta_bins=24 # eta + eta_min=-4.8 + eta_max=4.8 + eff_bins=42 # efficiency + eff_min=-13.5 + eff_max=406.5 + # Histograms + metGroup.defineHistogram('L1_Ex',title='L1 Missing E_{x};E_{x} [GeV];Events', + path='Shifter/L1',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('L1_Ey',title='L1 Missing E_{y};E_{y} [GeV];Events', + path='Shifter/L1',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('L1_Et',title='L1 Missing E_{T};E_{T} [GeV];Events', + path='Shifter/L1',xbins=et_bins,xmin=et_min,xmax=et_max) + metGroup.defineHistogram('cell_Ex',title='cell Missing E_{x};E_{x} [GeV];Events', + path='Shifter/cell',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('cell_Ey',title='cell Missing E_{y};E_{y} [GeV];Events', + path='Shifter/cell',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('cell_Et',title='cell Missing E_{T};E_{T} [GeV];Events', + path='Shifter/cell',xbins=et_bins,xmin=et_min,xmax=et_max) + metGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} [GeV];Events', + path='Shifter/tcpufit',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} [GeV];Events', + path='Shifter/tcpufit',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('tcpufit_Ez',title='tcpufit Missing E_{z};E_{z} [GeV];Events', + path='Shifter/tcpufit',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} [GeV];Events', + path='Shifter/tcpufit',xbins=et_bins,xmin=et_min,xmax=et_max) + metGroup.defineHistogram('tcpufit_sumEt',title='tcpufit Missing sumEt;sumEt [GeV];Events', + path='Shifter/tcpufit',xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max) + metGroup.defineHistogram('tcpufit_sumE',title='tcpufit Missing sumE;sumE [GeV];Events', + path='Shifter/tcpufit',xbins=sume_bins,xmin=sume_min,xmax=sume_max) + metGroup.defineHistogram('tcpufit_eta',title='tcpufit #eta;#eta;Events', + path='Shifter/tcpufit',xbins=eta_bins,xmin=eta_min,xmax=eta_max) + metGroup.defineHistogram('tcpufit_phi',title='tcpufit #phi;#phi;Events', + path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) + metGroup.defineHistogram('tcpufit_eta,tcpufit_phi', type='TH2F',title='tcpufit #eta - #phi;#eta;#phi', + path='Shifter/tcpufit',xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) + metGroup.defineHistogram('pass_HLT1, tcpufit_Et', type='TEfficiency',title='HLT efficiency;E_{T} [GeV];Efficiency', + path='Shifter/Eff',xbins=et_bins,xmin=et_min,xmax=et_max) + metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} [GeV];Events', + path='Expert/mht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} [GeV];Events', + path='Expert/mht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('mht_Et', title='mht E_{T};E_{T} [GeV];Events', + path='Expert/mht',xbins=et_bins,xmin=et_min,xmax=et_max) + metGroup.defineHistogram('tc_Ex',title='tc Missing E_{x};E_{x} [GeV];Events', + path='Expert/tc',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('tc_Ey',title='tc Missing E_{y};E_{y} [GeV];Events', + path='Expert/tc',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('tc_Et', title='tc E_{T};E_{T} [GeV];Events', + path='Expert/tc',xbins=et_bins,xmin=et_min,xmax=et_max) + metChainGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} [GeV];Events', + path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metChainGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} [GeV];Events', + path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metChainGroup.defineHistogram('tcpufit_Et',title='tcpufit Missing E_{T};E_{T} [GeV];Events', + path='HLT_xe30_tcpufit_L1XE10/tcpufit',xbins=et_bins,xmin=et_min,xmax=et_max) + ### STEP 6 ### # Finalize. The return value should be a tuple of the ComponentAccumulator # and the sequence containing the created algorithms. If we haven't called @@ -153,7 +191,7 @@ if __name__=='__main__': 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 = ['/hep300/data/khamano/data18_athenaMT/fromElin/AOD.pool.root'] + ConfigFlags.Input.Files = ['/hep300/data/khamano/mc16_athenaMT/fromElin/AOD.pool.root'] ConfigFlags.Input.isMC = True ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index ac3370bfc7e..a655c9f9bca 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -3,6 +3,7 @@ */ #include "TrigMETMonitorAlgorithm.h" +#include TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) : AthMonitorAlgorithm(name,pSvcLocator) @@ -89,7 +90,13 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co auto tc_Et = Monitored::Scalar("tc_Et",0.0); auto tcpufit_Ex = Monitored::Scalar("tcpufit_Ex",0.0); auto tcpufit_Ey = Monitored::Scalar("tcpufit_Ey",0.0); + auto tcpufit_Ez = Monitored::Scalar("tcpufit_Ez",0.0); auto tcpufit_Et = Monitored::Scalar("tcpufit_Et",0.0); + auto tcpufit_sumEt = Monitored::Scalar("tcpufit_sumEt",0.0); + auto tcpufit_sumE = Monitored::Scalar("tcpufit_sumE",0.0); + auto tcpufit_eta = Monitored::Scalar("tcpufit_eta",0.0); + auto tcpufit_phi = Monitored::Scalar("tcpufit_phi",0.0); + auto pass_HLT1 = Monitored::Scalar("pass_HLT1",0.0); // access L1 MET values // The following code was commented till we can get a proper input AOD file @@ -132,7 +139,17 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co hlt_met = hlt_tcpufit_met_cont->at(0); tcpufit_Ex = (hlt_met->ex())/1000.; tcpufit_Ey = (hlt_met->ey())/1000.; + tcpufit_Ez = (hlt_met->ez())/1000.; tcpufit_Et = sqrt(tcpufit_Ex*tcpufit_Ex + tcpufit_Ey*tcpufit_Ey); + tcpufit_sumEt = (hlt_met->sumEt())/1000.; + tcpufit_sumE = (hlt_met->sumE())/1000.; + + TVector3 v(tcpufit_Ex, tcpufit_Ey, tcpufit_Ez); + tcpufit_eta = v.Eta(); + tcpufit_phi = v.Phi(); + + // temporary fake trigger decision + if (tcpufit_Et > 30.) pass_HLT1 = 1.0; } @@ -180,7 +197,9 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co 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); + fill(tool,tcpufit_Ex,tcpufit_Ey,tcpufit_Ez,tcpufit_Et,tcpufit_sumEt,tcpufit_sumE); + fill(tool,tcpufit_eta,tcpufit_phi); + fill(tool,pass_HLT1); return StatusCode::SUCCESS; } -- GitLab From f44f70a799385d1543f6e1f9ccbe18cda8da430b Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Wed, 27 Nov 2019 09:02:55 -0800 Subject: [PATCH 11/16] weighted histogram added --- .../TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py | 9 ++++++--- .../TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 7e438c69d04..81a8dfd003c 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -146,9 +146,12 @@ def TrigMETMonConfig(inputFlags): path='Shifter/tcpufit',xbins=eta_bins,xmin=eta_min,xmax=eta_max) metGroup.defineHistogram('tcpufit_phi',title='tcpufit #phi;#phi;Events', path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) - metGroup.defineHistogram('tcpufit_eta,tcpufit_phi', type='TH2F',title='tcpufit #eta - #phi;#eta;#phi', - path='Shifter/tcpufit',xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) - metGroup.defineHistogram('pass_HLT1, tcpufit_Et', type='TEfficiency',title='HLT efficiency;E_{T} [GeV];Efficiency', + #metGroup.defineHistogram('tcpufit_phi', title='tcpufit #phi (etweighted);#phi;Events', weight='tcpufit_Et', + # path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) + metGroup.defineHistogram('tcpufit_eta,tcpufit_phi', type='TH2F', title='tcpufit #eta - #phi;#eta;#phi', + path='Shifter/tcpufit', + xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) + metGroup.defineHistogram('pass_HLT1, tcpufit_Et', type='TProfile',title='HLT efficiency;E_{T} [GeV];Efficiency', path='Shifter/Eff',xbins=et_bins,xmin=et_min,xmax=et_max) metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} [GeV];Events', path='Expert/mht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index a655c9f9bca..5bb44d0aead 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -149,7 +149,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co tcpufit_phi = v.Phi(); // temporary fake trigger decision - if (tcpufit_Et > 30.) pass_HLT1 = 1.0; + if (tcpufit_Et > 10.) pass_HLT1 = 1.0; } -- GitLab From ec69873425e1ed4ae54460c7d1d2af485314de07 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Wed, 27 Nov 2019 11:05:22 -0800 Subject: [PATCH 12/16] weighted histogram fixed --- .../TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 81a8dfd003c..9f9a8898fbd 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -146,12 +146,12 @@ def TrigMETMonConfig(inputFlags): path='Shifter/tcpufit',xbins=eta_bins,xmin=eta_min,xmax=eta_max) metGroup.defineHistogram('tcpufit_phi',title='tcpufit #phi;#phi;Events', path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) - #metGroup.defineHistogram('tcpufit_phi', title='tcpufit #phi (etweighted);#phi;Events', weight='tcpufit_Et', - # path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) - metGroup.defineHistogram('tcpufit_eta,tcpufit_phi', type='TH2F', title='tcpufit #eta - #phi;#eta;#phi', + metGroup.defineHistogram('tcpufit_phi;tcpufit_phi_etweight', title='tcpufit #phi (etweighted);#phi;Events', weight='tcpufit_Et', + path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) + metGroup.defineHistogram('tcpufit_eta,tcpufit_phi;tcpufit_eta_phi', type='TH2F', title='tcpufit #eta - #phi;#eta;#phi', path='Shifter/tcpufit', xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) - metGroup.defineHistogram('pass_HLT1, tcpufit_Et', type='TProfile',title='HLT efficiency;E_{T} [GeV];Efficiency', + metGroup.defineHistogram('pass_HLT1,tcpufit_Et;tcpufit_eff', type='TProfile',title='HLT efficiency;E_{T} [GeV];Efficiency', path='Shifter/Eff',xbins=et_bins,xmin=et_min,xmax=et_max) metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} [GeV];Events', path='Expert/mht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) -- GitLab From 6ff5639fdd21807a62dee5fb3c0c7dff57b1bba5 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Wed, 27 Nov 2019 11:42:19 -0800 Subject: [PATCH 13/16] compilation waring resolved --- .../TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 9f9a8898fbd..c23df82c454 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -116,7 +116,7 @@ def TrigMETMonConfig(inputFlags): eta_max=4.8 eff_bins=42 # efficiency eff_min=-13.5 - eff_max=406.5 + eff_max=401.5 # Histograms metGroup.defineHistogram('L1_Ex',title='L1 Missing E_{x};E_{x} [GeV];Events', path='Shifter/L1',xbins=ec_bins,xmin=ec_min,xmax=ec_max) @@ -152,7 +152,7 @@ def TrigMETMonConfig(inputFlags): path='Shifter/tcpufit', xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) metGroup.defineHistogram('pass_HLT1,tcpufit_Et;tcpufit_eff', type='TProfile',title='HLT efficiency;E_{T} [GeV];Efficiency', - path='Shifter/Eff',xbins=et_bins,xmin=et_min,xmax=et_max) + path='Shifter/Eff',xbins=eff_bins,xmin=eff_min,xmax=eff_max) metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} [GeV];Events', path='Expert/mht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) metGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} [GeV];Events', -- GitLab From dbfddd94bb26db09d8c7c25fbcaf2a0db8414f35 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 5 Dec 2019 12:58:03 -0800 Subject: [PATCH 14/16] tcpufit container name change --- .../TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py | 3 +++ .../TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx | 2 +- .../TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index c23df82c454..afdece0bc29 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -64,6 +64,9 @@ def TrigMETMonConfig(inputFlags): #TrigMETMonAlg.hlt_mt_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht' #TrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' #TrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' + + ### temporary setting till we get a new AOD + TrigMETMonAlg.hlt_tcpufit_key = 'HLT_MET_tcPufit' diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx index 506aad23277..b431d269415 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/HLTMETMonTool.cxx @@ -60,7 +60,7 @@ HLTMETMonTool::HLTMETMonTool(const std::string & type, const std::string & name, declareProperty("hlt_cell_run3_key", m_hlt_cell_run3_met_key="HLT_MET_cell"); declareProperty("hlt_mht_run3_key", m_hlt_mht_run3_met_key="HLT_MET_mht"); declareProperty("hlt_topocl_run3_key", m_hlt_topocl_run3_met_key="HLT_MET_tc"); - declareProperty("hlt_topocl_PUC_run3_key", m_hlt_topocl_PUC_run3_met_key="HLT_MET_tcPufit"); + declareProperty("hlt_topocl_PUC_run3_key", m_hlt_topocl_PUC_run3_met_key="HLT_MET_tcpufit"); declareProperty("hlt_cell_key", m_hlt_cell_met_key="HLT_xAOD__TrigMissingETContainer_TrigEFMissingET"); declareProperty("hlt_mht_key", m_hlt_mht_met_key="HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht"); declareProperty("hlt_mhtem_key", m_hlt_mhtem_met_key="HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht_em"); diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index 5bb44d0aead..f99f159c864 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -11,7 +11,7 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcL , 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_tcpufit_met_key("HLT_MET_tcpufit") , m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") { declareProperty("l1_roi_key", m_lvl1_roi_key); @@ -134,7 +134,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co tc_Et = sqrt(tc_Ex*tc_Ex + tc_Ey*tc_Ey); } - // access HLT tcPufit MET values + // access HLT tcpufit MET values if ( hlt_tcpufit_met_cont->size() > 0 && hlt_tcpufit_met_cont.isValid() ) { hlt_met = hlt_tcpufit_met_cont->at(0); tcpufit_Ex = (hlt_met->ex())/1000.; -- GitLab From 8ab847099916e39b6719e482156d9fd9bb870322 Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 5 Dec 2019 14:09:16 -0800 Subject: [PATCH 15/16] L1 wroked with new AOD --- .../python/TrigMETMonitorAlgorithm.py | 7 ++++--- .../src/TrigMETMonitorAlgorithm.cxx | 14 +++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index afdece0bc29..98ff01c2cab 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -149,13 +149,14 @@ def TrigMETMonConfig(inputFlags): path='Shifter/tcpufit',xbins=eta_bins,xmin=eta_min,xmax=eta_max) metGroup.defineHistogram('tcpufit_phi',title='tcpufit #phi;#phi;Events', path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) - metGroup.defineHistogram('tcpufit_phi;tcpufit_phi_etweight', title='tcpufit #phi (etweighted);#phi;Events', weight='tcpufit_Et', + metGroup.defineHistogram('tcpufit_phi;tcpufit_phi_etweight', title='tcpufit #phi (etweighted);#phi;E_{T} weighted events', + weight='tcpufit_Et', path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) metGroup.defineHistogram('tcpufit_eta,tcpufit_phi;tcpufit_eta_phi', type='TH2F', title='tcpufit #eta - #phi;#eta;#phi', path='Shifter/tcpufit', xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) - metGroup.defineHistogram('pass_HLT1,tcpufit_Et;tcpufit_eff', type='TProfile',title='HLT efficiency;E_{T} [GeV];Efficiency', - path='Shifter/Eff',xbins=eff_bins,xmin=eff_min,xmax=eff_max) + metGroup.defineHistogram('L1_Et,pass_HLT1;L1_eff', type='TProfile',title='L1 efficiency;E_{T} [GeV];Efficiency', + path='Shifter/eff',xbins=eff_bins,xmin=eff_min,xmax=eff_max) metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} [GeV];Events', path='Expert/mht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) metGroup.defineHistogram('mht_Ey',title='mht Missing E_{y};E_{y} [GeV];Events', diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index f99f159c864..222100a3d3f 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -99,16 +99,13 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co auto pass_HLT1 = Monitored::Scalar("pass_HLT1",0.0); // access L1 MET values - // The following code was commented till we can get a proper input AOD file - /* if ( l1_roi_cont.isValid() ) { if ((l1_roi_cont->energyX())>-9e12 && (l1_roi_cont->energyX())<9e12 && (l1_roi_cont->energyY())>-9e12 && (l1_roi_cont->energyY())<9e12) { L1_Ex = - (l1_roi_cont->energyX())/1000.; L1_Ey = - (l1_roi_cont->energyY())/1000.; - L1_Et = - (l1_roi_cont->energyT())/1000.; + L1_Et = (l1_roi_cont->energyT())/1000.; } } - */ // access HLT cell MET values if ( hlt_cell_met_cont->size() > 0 && hlt_cell_met_cont.isValid() ) { @@ -147,11 +144,14 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co TVector3 v(tcpufit_Ex, tcpufit_Ey, tcpufit_Ez); tcpufit_eta = v.Eta(); tcpufit_phi = v.Phi(); - - // temporary fake trigger decision - if (tcpufit_Et > 10.) pass_HLT1 = 1.0; } + // efficiency plots + // temporary fake trigger decision + if (L1_Et > 150.) pass_HLT1 = 1.0; + ATH_MSG_INFO("pass_HLT1 = " << pass_HLT1); + // will be replaced by below + //if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) pass_HLT1 = 1.0; // TDT test ATH_MSG_INFO("MetMon: TST test"); -- GitLab From 5a2836c9dc10daf410c613687447829bf9b19e3a Mon Sep 17 00:00:00 2001 From: Kenji Hamano Date: Thu, 12 Dec 2019 10:22:35 -0800 Subject: [PATCH 16/16] trkmht added --- .../python/TrigMETMonitorAlgorithm.py | 24 ++++++---- .../src/TrigMETMonitorAlgorithm.cxx | 47 ++++++++++++------- .../src/TrigMETMonitorAlgorithm.h | 3 +- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py index 98ff01c2cab..517ec44fdd9 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/python/TrigMETMonitorAlgorithm.py @@ -65,8 +65,9 @@ def TrigMETMonConfig(inputFlags): #TrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl' #TrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC' - ### temporary setting till we get a new AOD - TrigMETMonAlg.hlt_tcpufit_key = 'HLT_MET_tcPufit' + ### use the follwoing if you run on older Run3 AOD + #TrigMETMonAlg.hlt_tcpufit_key = 'HLT_MET_tcPufit' + #TrigMETMonAlg.hlt_trkmht_key = 'HLT_MET_mht' @@ -111,10 +112,12 @@ def TrigMETMonConfig(inputFlags): sume_bins=153 #sumE sume_min=-27.0 sume_max=24003.0 - phi_bins=32 # phi + phi_bins=100 # phi + phi_bins_2d=24 # phi phi_min=-3.1416 phi_max=3.1416 - eta_bins=24 # eta + eta_bins=100 # eta + eta_bins_2d=24# eta eta_min=-4.8 eta_max=4.8 eff_bins=42 # efficiency @@ -133,6 +136,12 @@ def TrigMETMonConfig(inputFlags): path='Shifter/cell',xbins=ec_bins,xmin=ec_min,xmax=ec_max) metGroup.defineHistogram('cell_Et',title='cell Missing E_{T};E_{T} [GeV];Events', path='Shifter/cell',xbins=et_bins,xmin=et_min,xmax=et_max) + metGroup.defineHistogram('trkmht_Ex',title='trkmht Missing E_{x};E_{x} [GeV];Events', + path='Shifter/trkmht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('trkmht_Ey',title='trkmht Missing E_{y};E_{y} [GeV];Events', + path='Shifter/trkmht',xbins=ec_bins,xmin=ec_min,xmax=ec_max) + metGroup.defineHistogram('trkmht_Et',title='trkmht Missing E_{T};E_{T} [GeV];Events', + path='Shifter/trkmht',xbins=et_bins,xmin=et_min,xmax=et_max) metGroup.defineHistogram('tcpufit_Ex',title='tcpufit Missing E_{x};E_{x} [GeV];Events', path='Shifter/tcpufit',xbins=ec_bins,xmin=ec_min,xmax=ec_max) metGroup.defineHistogram('tcpufit_Ey',title='tcpufit Missing E_{y};E_{y} [GeV];Events', @@ -154,7 +163,7 @@ def TrigMETMonConfig(inputFlags): path='Shifter/tcpufit',xbins=phi_bins,xmin=phi_min,xmax=phi_max) metGroup.defineHistogram('tcpufit_eta,tcpufit_phi;tcpufit_eta_phi', type='TH2F', title='tcpufit #eta - #phi;#eta;#phi', path='Shifter/tcpufit', - xbins=eta_bins,xmin=eta_min,xmax=eta_max,ybins=phi_bins,ymin=phi_min,ymax=phi_max) + xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max) metGroup.defineHistogram('L1_Et,pass_HLT1;L1_eff', type='TProfile',title='L1 efficiency;E_{T} [GeV];Efficiency', path='Shifter/eff',xbins=eff_bins,xmin=eff_min,xmax=eff_max) metGroup.defineHistogram('mht_Ex',title='mht Missing E_{x};E_{x} [GeV];Events', @@ -197,9 +206,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 = ['/hep300/data/khamano/mc16_athenaMT/fromElin/AOD.pool.root'] - ConfigFlags.Input.isMC = True + ConfigFlags.Input.Files = [nightly+file] + ConfigFlags.Input.isMC = False ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' ConfigFlags.lock() diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx index 222100a3d3f..96671028300 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.cxx @@ -12,6 +12,7 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcL , 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_trkmht_met_key("HLT_MET_trkmht") , m_trigDecTool("Trig::TrigDecisionTool/TrigDecisionTool") { declareProperty("l1_roi_key", m_lvl1_roi_key); @@ -19,6 +20,7 @@ TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcL 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_trkmht_key", m_hlt_trkmht_met_key); } @@ -31,6 +33,7 @@ StatusCode TrigMETMonitorAlgorithm::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_trkmht_met_key.initialize() ); ATH_CHECK( m_trigDecTool.retrieve() ); @@ -45,33 +48,33 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co SG::ReadHandle l1_roi_cont(m_lvl1_roi_key, ctx); if (! l1_roi_cont.isValid() ) { ATH_MSG_WARNING("Container "<< m_lvl1_roi_key << " does not exist or is empty"); - //return StatusCode::FAILURE; } SG::ReadHandle hlt_cell_met_cont(m_hlt_cell_met_key, ctx); if (hlt_cell_met_cont->size()==0 || ! hlt_cell_met_cont.isValid() ) { ATH_MSG_WARNING("Container "<< m_hlt_cell_met_key << " does not exist or is empty"); - //return StatusCode::FAILURE; } SG::ReadHandle hlt_mht_met_cont(m_hlt_mht_met_key, ctx); if (hlt_mht_met_cont->size()==0 || ! hlt_mht_met_cont.isValid() ) { ATH_MSG_WARNING("Container "<< m_hlt_mht_met_key << " does not exist or is empty"); - //return StatusCode::FAILURE; } SG::ReadHandle hlt_tc_met_cont(m_hlt_tc_met_key, ctx); if (hlt_tc_met_cont->size()==0 || ! hlt_tc_met_cont.isValid() ) { ATH_MSG_WARNING("Container "<< m_hlt_tc_met_key << " does not exist or is empty"); - //return StatusCode::FAILURE; } SG::ReadHandle hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx); if (hlt_tcpufit_met_cont->size()==0 || ! hlt_tcpufit_met_cont.isValid() ) { ATH_MSG_WARNING("Container "<< m_hlt_tcpufit_met_key << " does not exist or is empty"); - //return StatusCode::FAILURE; } - + + SG::ReadHandle hlt_trkmht_met_cont(m_hlt_trkmht_met_key, ctx); + if (hlt_trkmht_met_cont->size()==0 || ! hlt_trkmht_met_cont.isValid() ) { + ATH_MSG_WARNING("Container "<< m_hlt_trkmht_met_key << " does not exist or is empty"); + } + // define TrigMissingET object const xAOD::TrigMissingET *hlt_met = 0; @@ -88,6 +91,9 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co auto tc_Ex = Monitored::Scalar("tc_Ex",0.0); auto tc_Ey = Monitored::Scalar("tc_Ey",0.0); auto tc_Et = Monitored::Scalar("tc_Et",0.0); + auto trkmht_Ex = Monitored::Scalar("trkmht_Ex",0.0); + auto trkmht_Ey = Monitored::Scalar("trkmht_Ey",0.0); + auto trkmht_Et = Monitored::Scalar("trkmht_Et",0.0); auto tcpufit_Ex = Monitored::Scalar("tcpufit_Ex",0.0); auto tcpufit_Ey = Monitored::Scalar("tcpufit_Ey",0.0); auto tcpufit_Ez = Monitored::Scalar("tcpufit_Ez",0.0); @@ -131,6 +137,14 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co tc_Et = sqrt(tc_Ex*tc_Ex + tc_Ey*tc_Ey); } + // access HLT trkmht MET values + if ( hlt_trkmht_met_cont->size() > 0 && hlt_trkmht_met_cont.isValid() ) { + hlt_met = hlt_trkmht_met_cont->at(0); + trkmht_Ex = (hlt_met->ex())/1000.; + trkmht_Ey = (hlt_met->ey())/1000.; + trkmht_Et = sqrt(trkmht_Ex*trkmht_Ex + trkmht_Ey*trkmht_Ey); + } + // access HLT tcpufit MET values if ( hlt_tcpufit_met_cont->size() > 0 && hlt_tcpufit_met_cont.isValid() ) { hlt_met = hlt_tcpufit_met_cont->at(0); @@ -149,31 +163,31 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co // efficiency plots // temporary fake trigger decision if (L1_Et > 150.) pass_HLT1 = 1.0; - ATH_MSG_INFO("pass_HLT1 = " << pass_HLT1); + ATH_MSG_DEBUG("pass_HLT1 = " << pass_HLT1); // will be replaced by below //if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) pass_HLT1 = 1.0; // TDT test - ATH_MSG_INFO("MetMon: TST test"); + ATH_MSG_DEBUG("MetMon: TST test"); if (m_trigDecTool->isPassed("L1_XE10")) { - ATH_MSG_INFO("passed L1_XE10"); + ATH_MSG_DEBUG("passed L1_XE10"); } else { - ATH_MSG_INFO("not passed L1_XE10"); + ATH_MSG_DEBUG("not passed L1_XE10"); } if (m_trigDecTool->isPassed("HLT_xe30_cell_L1XE10")) { - ATH_MSG_INFO("passed HLT_xe30_cell_L1XE10"); + ATH_MSG_DEBUG("passed HLT_xe30_cell_L1XE10"); } else { - ATH_MSG_INFO("not passed HLT_xe30_cell_L1XE10"); + ATH_MSG_DEBUG("not passed HLT_xe30_cell_L1XE10"); } if (m_trigDecTool->isPassed("HLT_xe30_tcpufit_L1XE10")) { - ATH_MSG_INFO("passed HLT_xe30_tcpufit_L1XE10"); + ATH_MSG_DEBUG("passed HLT_xe30_tcpufit_L1XE10"); } else { - ATH_MSG_INFO("not passed HLT_xe30_tcpufit_L1XE10"); + ATH_MSG_DEBUG("not passed HLT_xe30_tcpufit_L1XE10"); } if (m_trigDecTool->isPassed("HLT_xe30_cell_xe30_tcpufit_L1XE10")) { - ATH_MSG_INFO("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + ATH_MSG_DEBUG("passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); } else { - ATH_MSG_INFO("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); + ATH_MSG_DEBUG("not passed HLT_xe30_cell_xe30_tcpufit_L1XE10"); } // check active triggers @@ -197,6 +211,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co 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,trkmht_Ex,trkmht_Ey,trkmht_Et); fill(tool,tcpufit_Ex,tcpufit_Ey,tcpufit_Ez,tcpufit_Et,tcpufit_sumEt,tcpufit_sumE); fill(tool,tcpufit_eta,tcpufit_phi); fill(tool,pass_HLT1); diff --git a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h index 1e03660c7cf..7e5332a7463 100644 --- a/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h +++ b/Trigger/TrigMonitoring/TrigMETMonitoring/src/TrigMETMonitorAlgorithm.h @@ -13,7 +13,6 @@ #include "xAODTrigMissingET/TrigMissingETContainer.h" #include "xAODTrigMissingET/TrigMissingETAuxContainer.h" -//#include "TrigDecisionTool/TrigDecisionTool.h" #include "TrigDecisionInterface/ITrigDecisionTool.h" class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { @@ -30,9 +29,9 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { SG::ReadHandleKey m_hlt_mht_met_key; SG::ReadHandleKey m_hlt_tc_met_key; SG::ReadHandleKey m_hlt_tcpufit_met_key; + SG::ReadHandleKey m_hlt_trkmht_met_key; ToolHandle m_trigDecTool; - //ToolHandle m_trigDecTool{this, "TrigDecisionTool",""}; }; -- GitLab