Skip to content
Snippets Groups Projects
Commit a5f5c0d2 authored by Kenji Hamano's avatar Kenji Hamano
Browse files

first attempt for Run3 containers

parent c33ebba7
No related branches found
No related tags found
No related merge requests found
...@@ -88,12 +88,24 @@ def TrigMETMonConfig(inputFlags): ...@@ -88,12 +88,24 @@ def TrigMETMonConfig(inputFlags):
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', 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)
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', 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', 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', 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)
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 ### ### STEP 6 ###
# Finalize. The return value should be a tuple of the ComponentAccumulator # Finalize. The return value should be a tuple of the ComponentAccumulator
...@@ -116,7 +128,8 @@ if __name__=='__main__': ...@@ -116,7 +128,8 @@ if __name__=='__main__':
from AthenaConfiguration.AllConfigFlags import ConfigFlags from AthenaConfiguration.AllConfigFlags import ConfigFlags
nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/' 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' 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.Input.isMC = False
ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root' ConfigFlags.Output.HISTFileName = 'TrigMETMonitorOutput.root'
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
# The following class will make a sequence, configure algorithms, and link # The following class will make a sequence, configure algorithms, and link
# them to GenericMonitoringTools # them to GenericMonitoringTools
#from AthenaMonitoring import AthMonitorCfgHelperOld from AthenaMonitoring import AthMonitorCfgHelperOld
#helper = AthMonitorCfgHelperOld(DQMonFlags, "TrigMETMonitor") helper = AthMonitorCfgHelperOld(DQMonFlags, "TrigMETMonitor")
from AthenaMonitoring import AthMonitorCfgHelper #from AthenaMonitoring import AthMonitorCfgHelper
helper = AthMonitorCfgHelper(DQMonFlags, "TrigMETMonitor") #helper = AthMonitorCfgHelper(DQMonFlags, "TrigMETMonitor")
### STEP 2 ### ### STEP 2 ###
# Adding an algorithm to the helper. Here, we will use the example # Adding an algorithm to the helper. Here, we will use the example
......
...@@ -7,12 +7,24 @@ ...@@ -7,12 +7,24 @@
TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator ) TrigMETMonitorAlgorithm::TrigMETMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
: AthMonitorAlgorithm(name,pSvcLocator) : AthMonitorAlgorithm(name,pSvcLocator)
, m_lvl1_roi_key("LVL1EnergySumRoI") , m_lvl1_roi_key("LVL1EnergySumRoI")
, m_hlt_cell_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET") , m_hlt_cell_met_key("HLT_MET_cell")
, m_hlt_mht_met_key("HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht") , 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("l1_roi_key", m_lvl1_roi_key);
declareProperty("hlt_cell_key", m_hlt_cell_met_key); declareProperty("hlt_cell_key", m_hlt_cell_met_key);
declareProperty("hlt_mht_key", m_hlt_mht_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() { ...@@ -23,6 +35,12 @@ StatusCode TrigMETMonitorAlgorithm::initialize() {
ATH_CHECK( m_lvl1_roi_key.initialize() ); ATH_CHECK( m_lvl1_roi_key.initialize() );
ATH_CHECK( m_hlt_cell_met_key.initialize() ); ATH_CHECK( m_hlt_cell_met_key.initialize() );
ATH_CHECK( m_hlt_mht_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(); return AthMonitorAlgorithm::initialize();
} }
...@@ -33,22 +51,52 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co ...@@ -33,22 +51,52 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
// access met containers // access met containers
SG::ReadHandle<xAOD::EnergySumRoI> l1_roi_cont(m_lvl1_roi_key, ctx); SG::ReadHandle<xAOD::EnergySumRoI> l1_roi_cont(m_lvl1_roi_key, ctx);
if (! l1_roi_cont.isValid() ) { if (! l1_roi_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key); ATH_MSG_ERROR("evtStore() does not contain L1 MET Collection with name "<< m_lvl1_roi_key);
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_cell_met_cont(m_hlt_cell_met_key, ctx); SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_cell_met_cont(m_hlt_cell_met_key, ctx);
if (! hlt_cell_met_cont.isValid() ) { if (! hlt_cell_met_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key); hlt_cell_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_cell_met_key, ctx);
return StatusCode::FAILURE; if (! hlt_cell_met_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_cell_met_key);
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_cell_met_key);
return StatusCode::FAILURE;
}
} }
SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_mht_met_cont(m_hlt_mht_met_key, ctx); SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_mht_met_cont(m_hlt_mht_met_key, ctx);
if (! hlt_mht_met_cont.isValid() ) { if (! hlt_mht_met_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key); hlt_mht_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_mht_met_key, ctx);
return StatusCode::FAILURE; if (! hlt_mht_met_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_mht_met_key);
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_mht_met_key);
return StatusCode::FAILURE;
}
}
SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_tc_met_cont(m_hlt_tc_met_key, ctx);
if (! hlt_tc_met_cont.isValid() ) {
hlt_tc_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_tc_met_key, ctx);
if (! hlt_tc_met_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tc_met_key);
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tc_met_key);
return StatusCode::FAILURE;
}
}
SG::ReadHandle<xAOD::TrigMissingETContainer> hlt_tcpufit_met_cont(m_hlt_tcpufit_met_key, ctx);
if (! hlt_tcpufit_met_cont.isValid() ) {
hlt_tcpufit_met_cont = SG::ReadHandle<xAOD::TrigMissingETContainer>(m_hlt_run2_tcpufit_met_key, ctx);
if (! hlt_tcpufit_met_cont.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_tcpufit_met_key);
ATH_MSG_ERROR("evtStore() does not contain HLT MET Collection with name "<< m_hlt_run2_tcpufit_met_key);
return StatusCode::FAILURE;
}
} }
// define TrigMissingET objet // define TrigMissingET object
const xAOD::TrigMissingET *hlt_met = 0; const xAOD::TrigMissingET *hlt_met = 0;
// define variables // define variables
...@@ -61,6 +109,12 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co ...@@ -61,6 +109,12 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
auto mht_Ex = Monitored::Scalar<float>("mht_Ex",0.0); auto mht_Ex = Monitored::Scalar<float>("mht_Ex",0.0);
auto mht_Ey = Monitored::Scalar<float>("mht_Ey",0.0); auto mht_Ey = Monitored::Scalar<float>("mht_Ey",0.0);
auto mht_Et = Monitored::Scalar<float>("mht_Et",0.0); auto mht_Et = Monitored::Scalar<float>("mht_Et",0.0);
auto tc_Ex = Monitored::Scalar<float>("tc_Ex",0.0);
auto tc_Ey = Monitored::Scalar<float>("tc_Ey",0.0);
auto tc_Et = Monitored::Scalar<float>("tc_Et",0.0);
auto tcpufit_Ex = Monitored::Scalar<float>("tcpufit_Ex",0.0);
auto tcpufit_Ey = Monitored::Scalar<float>("tcpufit_Ey",0.0);
auto tcpufit_Et = Monitored::Scalar<float>("tcpufit_Et",0.0);
// access L1 MET values // access L1 MET values
// The follosing code was commented till we can get a proper input AOD file // 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 ...@@ -75,7 +129,7 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
*/ */
// access HLT cell MET values // 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); hlt_met = hlt_cell_met_cont->at(0);
cell_Ex = (hlt_met->ex())/1000.; cell_Ex = (hlt_met->ex())/1000.;
cell_Ey = (hlt_met->ey())/1000.; cell_Ey = (hlt_met->ey())/1000.;
...@@ -83,20 +137,39 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co ...@@ -83,20 +137,39 @@ StatusCode TrigMETMonitorAlgorithm::fillHistograms( const EventContext& ctx ) co
} }
// access HLT mht MET values // 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); hlt_met = hlt_mht_met_cont->at(0);
mht_Ex = (hlt_met->ex())/1000.; mht_Ex = (hlt_met->ex())/1000.;
mht_Ey = (hlt_met->ey())/1000.; mht_Ey = (hlt_met->ey())/1000.;
mht_Et = sqrt(mht_Ex*mht_Ex + mht_Ey*mht_Ey); 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, // Fill. First argument is the tool (GMT) name as defined in the py file,
// all others are the variables to be saved. // 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. // Alternative fill method. Get the group yourself, and pass it to the fill function.
auto tool = getGroup("TrigMETMonitor"); auto tool = getGroup("TrigMETMonitor");
fill(tool,cell_Ex,cell_Ey,cell_Et);
fill(tool,mht_Ex,mht_Ey,mht_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; return StatusCode::SUCCESS;
} }
...@@ -23,8 +23,16 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm { ...@@ -23,8 +23,16 @@ class TrigMETMonitorAlgorithm : public AthMonitorAlgorithm {
private: private:
SG::ReadHandleKey<xAOD::EnergySumRoI> m_lvl1_roi_key; SG::ReadHandleKey<xAOD::EnergySumRoI> m_lvl1_roi_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_cell_met_key; SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_cell_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_mht_met_key; SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_mht_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_tc_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_tcpufit_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_cell_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_mht_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_tc_met_key;
SG::ReadHandleKey<xAOD::TrigMissingETContainer> m_hlt_run2_tcpufit_met_key;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment