diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt b/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt index fecd03555bc0c203b47c5a117ad6dfe9335da5c9..ef0ca696dff9218bb8421dbb3465f5ae11ca9f88 100644 --- a/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt +++ b/Trigger/TrigHypothesis/TrigMissingETHypo/CMakeLists.txt @@ -25,11 +25,16 @@ atlas_add_component( TrigMissingETHypo INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS} LINK_LIBRARIES ${CLHEP_LIBRARIES} TrigInterfacesLib TrigTimeAlgsLib xAODTrigMissingET GaudiKernel TrigMissingEtEvent DecisionHandling ) -atlas_add_test( TrigMissingETHypoConfigMT SCRIPT python -m TrigMissingETHypo.TrigMissingETHypoConfigMT - PROPERTIES TIMEOUT 300 - POST_EXEC_SCRIPT nopost.sh ) - # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/TriggerConfig_*.py ) +# Unit tests: +atlas_add_test( TrigMissingETHypoConfigMT SCRIPT python -m TrigMissingETHypo.TrigMissingETHypoConfigMT + PROPERTIES TIMEOUT 300 + POST_EXEC_SCRIPT nopost.sh ) + +# Check Python syntax: +atlas_add_test( flake8 + SCRIPT flake8 --select=ATL,F,E7,E9,W6 --enable-extension=ATL900,ATL901 ${CMAKE_CURRENT_SOURCE_DIR}/python + POST_EXEC_SCRIPT nopost.sh ) diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py index 177684667bea059b1cd19f5dc83958acb7e9d6d5..98e80d88b1d24791c36beb97e63cc6b123227c45 100755 --- a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from TrigMissingETHypo.TrigMissingETHypoConf import TrigEFMissingETHypo @@ -21,11 +21,11 @@ class EFMissingETHypoBase (TrigEFMissingETHypo): def onlineMonitoring(self, full=False): if "TrigEFMissingETHypoOnlineMonitoring" not in [t.name() for t in self.AthenaMonTools]: - from TrigMissingETHypo.TrigMissingETHypoMonitoring import TrigEFMissingETHypoOnlineMonitoring, TrigEFMissingETHypoFullOnlineMonitoring + from TrigMissingETHypo.TrigMissingETHypoMonitoring import TrigEFMissingETHypoOnlineMonitoring online = TrigEFMissingETHypoOnlineMonitoring() self.AthenaMonTools += [ online ] - if full == True and "TrigEFMissingETHypoFullOnlineMonitoring" not in [t.name() for t in self.AthenaMonTools]: + if full is True and "TrigEFMissingETHypoFullOnlineMonitoring" not in [t.name() for t in self.AthenaMonTools]: from TrigMissingETHypo.TrigMissingETHypoMonitoring import TrigEFMissingETHypoFullOnlineMonitoring onlineFull = TrigEFMissingETHypoFullOnlineMonitoring() self.AthenaMonTools += [ onlineFull ] diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py index 8b96f8aad23f929e941394a4192c8b7e734a6e15..17ed2e25801f9cf313a4909411529e3783408b00 100644 --- a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py +++ b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoConfigMT.py @@ -2,9 +2,6 @@ from TrigMissingETHypo.TrigMissingETHypoConf import TrigMissingETHypoAlgMT, TrigMissingETHypoToolMT -from AthenaCommon.SystemOfUnits import GeV - - class MissingETHypoAlgMT(TrigMissingETHypoAlgMT): __slots__ = [] def __init__(self, name, hTools=[], metKey=""): @@ -77,9 +74,6 @@ def TrigMETPufitHypoToolFromName(name, conf): return MissingETHypoToolMT(name, alg='pufit') -def TrigMETPufitHypoToolFromName(name, conf): - return MissingETHypoToolMT(name, alg='pufit') - def TrigMETJetHypoToolFromName(name, conf): return MissingETHypoToolMT(name, alg='mht') diff --git a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoringTool.py b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoringTool.py index e9bdc9f099ef4c90921d333b15f291ecf3ae862a..089bc43d20e9f2335c29273133744c9d98556967 100644 --- a/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoringTool.py +++ b/Trigger/TrigHypothesis/TrigMissingETHypo/python/TrigMissingETHypoMonitoringTool.py @@ -9,29 +9,26 @@ class TrigMissingETHypoMonitoringToolBase(GenericMonitoringTool): self.Histograms = [] - hEx_log = defineHistogram('Hypo_MEx_log', type='TH1F', path='EXPERT', title="Missing E_{x};sgn(ME_{x}) log_{10}(ME_{x}/GeV)", xbins=41, xmin=-5.075, xmax=5.075) - hEy_log = defineHistogram('Hypo_MEy_log', type='TH1F', path='EXPERT', title="Missing E_{y};sgn(ME_{y}) log_{10}(ME_{y}/GeV)", xbins=41, xmin=-5.075, xmax=5.075) - hEz_log = defineHistogram('Hypo_MEz_log', type='TH1F', path='EXPERT', title="Missing E_{z};sgn(ME_{z}) log_{10}(ME_{z}/GeV)", xbins=41, xmin=-5.075, xmax=5.075) - hMET_log = defineHistogram('Hypo_MET_log', type='TH1F', path='EXPERT', title="|Missing E_{T}|;log_{10}(ME_{T}/GeV)", xbins=35, xmin=-1.875, xmax=5.375) - hSumEt_log = defineHistogram('Hypo_SumEt_log', type='TH1F', path='EXPERT', title="Sum |E_{T}|;log_{10}(SumE_{T}/GeV)", xbins=35, xmin=-1.875, xmax=5.125) + self.hEx_log = defineHistogram('Hypo_MEx_log', type='TH1F', path='EXPERT', title="Missing E_{x};sgn(ME_{x}) log_{10}(ME_{x}/GeV)", xbins=41, xmin=-5.075, xmax=5.075) + self.hEy_log = defineHistogram('Hypo_MEy_log', type='TH1F', path='EXPERT', title="Missing E_{y};sgn(ME_{y}) log_{10}(ME_{y}/GeV)", xbins=41, xmin=-5.075, xmax=5.075) + self.hEz_log = defineHistogram('Hypo_MEz_log', type='TH1F', path='EXPERT', title="Missing E_{z};sgn(ME_{z}) log_{10}(ME_{z}/GeV)", xbins=41, xmin=-5.075, xmax=5.075) + self.hMET_log = defineHistogram('Hypo_MET_log', type='TH1F', path='EXPERT', title="|Missing E_{T}|;log_{10}(ME_{T}/GeV)", xbins=35, xmin=-1.875, xmax=5.375) + self.hSumEt_log = defineHistogram('Hypo_SumEt_log', type='TH1F', path='EXPERT', title="Sum |E_{T}|;log_{10}(SumE_{T}/GeV)", xbins=35, xmin=-1.875, xmax=5.125) - hEx_lin = defineHistogram('Hypo_MEx_lin', type='TH1F', path='EXPERT', title="Missing E_{x};ME_{x} (GeV)", xbins=199, xmin=-298.5, xmax=298.5) - hEy_lin = defineHistogram('Hypo_MEy_lin', type='TH1F', path='EXPERT', title="Missing E_{y};ME_{y} (GeV)", xbins=199, xmin=-298.5, xmax=298.5) - hEz_lin = defineHistogram('Hypo_MEz_lin', type='TH1F', path='EXPERT', title="Missing E_{z};ME_{z} (GeV)", xbins=199, xmin=-298.5, xmax=298.5) - hMET_lin = defineHistogram('Hypo_MET_lin', type='TH1F', path='EXPERT', title="|Missing E_{T}|;ME_{T} (GeV)", xbins=105, xmin=-13.5, xmax=301.5) - hSumEt_lin = defineHistogram('Hypo_SumEt_lin', type='TH1F', path='EXPERT', title="Sum |E_{T}|;SumE_{T} (GeV)", xbins=155, xmin=-27., xmax=2000.) + self.hEx_lin = defineHistogram('Hypo_MEx_lin', type='TH1F', path='EXPERT', title="Missing E_{x};ME_{x} (GeV)", xbins=199, xmin=-298.5, xmax=298.5) + self.hEy_lin = defineHistogram('Hypo_MEy_lin', type='TH1F', path='EXPERT', title="Missing E_{y};ME_{y} (GeV)", xbins=199, xmin=-298.5, xmax=298.5) + self.hEz_lin = defineHistogram('Hypo_MEz_lin', type='TH1F', path='EXPERT', title="Missing E_{z};ME_{z} (GeV)", xbins=199, xmin=-298.5, xmax=298.5) + self.hMET_lin = defineHistogram('Hypo_MET_lin', type='TH1F', path='EXPERT', title="|Missing E_{T}|;ME_{T} (GeV)", xbins=105, xmin=-13.5, xmax=301.5) + self.hSumEt_lin = defineHistogram('Hypo_SumEt_lin', type='TH1F', path='EXPERT', title="Sum |E_{T}|;SumE_{T} (GeV)", xbins=155, xmin=-27., xmax=2000.) - hMETPhi = defineHistogram('Hypo_MET_phi', type='TH1F', path='EXPERT', title="MET #phi;#phi (rad)", xbins=32, xmin=-3.1416, xmax=3.1416) - hXS = defineHistogram('Hypo_XS', type='TH1F', path='EXPERT', title="EF Significance; (XS/GeV^{1/2})", xbins=40, xmin=-0.025, xmax=20.025) - hXS2 = defineHistogram('Hypo_XS2', type='TH1F', path='EXPERT', title="EF Significance 2; (XS2/GeV^{1/2})", xbins=40, xmin=-0.025, xmax=20.025) + self.hMETPhi = defineHistogram('Hypo_MET_phi', type='TH1F', path='EXPERT', title="MET #phi;#phi (rad)", xbins=32, xmin=-3.1416, xmax=3.1416) + self.hXS = defineHistogram('Hypo_XS', type='TH1F', path='EXPERT', title="EF Significance; (XS/GeV^{1/2})", xbins=40, xmin=-0.025, xmax=20.025) + self.hXS2 = defineHistogram('Hypo_XS2', type='TH1F', path='EXPERT', title="EF Significance 2; (XS2/GeV^{1/2})", xbins=40, xmin=-0.025, xmax=20.025) class TrigMissingETHypoMonitoringTool(TrigMissingETHypoMonitoringToolBase): def __init__ (self, name="TrigMissingETHypoMonitoringTool"): super(TrigMissingETHypoMonitoringTool, self).__init__(name) - self.defineTarget("Validation") - - # self.Histograms = [ hCuts ] - self.Histograms += [ hEx_log, hEy_log, hEz_log, hMET_log, hSumEt_log ] - self.Histograms += [ hEx_lin, hEy_lin, hEz_lin, hMET_lin, hSumEt_lin, hMETPhi, hXS, hXS2 ] + self.Histograms += [ self.hEx_log, self.hEy_log, self.hEz_log, self.hMET_log, self.hSumEt_log ] + self.Histograms += [ self.hEx_lin, self.hEy_lin, self.hEz_lin, self.hMET_lin, self.hSumEt_lin, self.hMETPhi, self.hXS, self.hXS2 ]