Skip to content
Snippets Groups Projects
Commit acfce7ac authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

GeneratorModules: enable flake8 and make code compliant

parent 6764203e
No related branches found
No related tags found
No related merge requests found
...@@ -21,5 +21,5 @@ atlas_add_component( GeneratorModules ...@@ -21,5 +21,5 @@ atlas_add_component( GeneratorModules
LINK_LIBRARIES GeneratorModulesLib ) LINK_LIBRARIES GeneratorModulesLib )
# Install files from the package: # Install files from the package:
atlas_install_python_modules( python/*.py ) atlas_install_python_modules( python/*.py POST_BUILD_CMD ${ATLAS_FLAKE8} )
# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaPython import PyAthena from AthenaPython import PyAthena
from AthenaPython.PyAthena import StatusCode from AthenaPython.PyAthena import StatusCode
...@@ -27,8 +27,8 @@ class EvgenAlg(PyAthena.Alg): ...@@ -27,8 +27,8 @@ class EvgenAlg(PyAthena.Alg):
def initialize(self): def initialize(self):
import McParticleEvent.Pythonizations import McParticleEvent.Pythonizations # noqa: F401
self.msg.debug("Initializing [%s]"% self.getName()) self.msg.debug("Initializing [%s]", self.getName())
return self.genInitialize() return self.genInitialize()
...@@ -36,21 +36,21 @@ class EvgenAlg(PyAthena.Alg): ...@@ -36,21 +36,21 @@ class EvgenAlg(PyAthena.Alg):
def execute(self): def execute(self):
from AthenaPython.PyAthena import McEventCollection, HepMC from AthenaPython.PyAthena import McEventCollection, HepMC
self.msg.debug("Executing [%s]"% self.getName()) self.msg.debug("Executing [%s]", self.getName())
## Retrieve MC event collection or create a new one ## Retrieve MC event collection or create a new one
mcevts = None mcevts = None
if self.evtStore.contains(McEventCollection, self.McEventKey): if self.evtStore.contains(McEventCollection, self.McEventKey):
self.msg.debug(self.McEventKey + " found before alg execution!") self.msg.debug("%s found before alg execution!", self.McEventKey)
mcevts = self.evtStore[self.McEventKey] mcevts = self.evtStore[self.McEventKey]
else: else:
self.msg.debug("Creating " + self.McEventKey + " before alg execution!") self.msg.debug("Creating %s before alg execution!", self.McEventKey)
mcevts = McEventCollection() mcevts = McEventCollection()
self.evtStore.record(mcevts, self.McEventKey, True, False) self.evtStore.record(mcevts, self.McEventKey, True, False)
ROOT.SetOwnership(mcevts, False) ROOT.SetOwnership(mcevts, False)
if self.evtStore.contains(McEventCollection, self.McEventKey): if self.evtStore.contains(McEventCollection, self.McEventKey):
self.msg.debug(self.McEventKey + " found after alg execution!") self.msg.debug("%s found after alg execution!", self.McEventKey)
## Get the first event from the MCEC, or make a new one ## Get the first event from the MCEC, or make a new one
evt = None evt = None
......
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
from AthenaPython import PyAthena from AthenaPython import PyAthena
from AthenaPython.PyAthena import StatusCode, McEventCollection, HepMC, CLHEP import McParticleEvent.Pythonizations # noqa: F401
import McParticleEvent.Pythonizations
class EvgenAnalysisAlg(PyAthena.Alg): class EvgenAnalysisAlg(PyAthena.Alg):
......
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