Skip to content
Snippets Groups Projects
Commit 2f0b824d authored by Sarah Louise Williams's avatar Sarah Louise Williams
Browse files

ConfigMigration work 161019

parent f9032558
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!35036METReconstruction: First attempt at preparing the MET Reconstruction code for the run III configuration system
......@@ -102,8 +102,6 @@ def getBuilder(config,suffix,doTracks,doCells,doTriggerMET,doOriginCorrClus):
tool.InputComposition = 'PFlow'
pfotool = CfgMgr.CP__RetrievePFOTool('MET_PFOTool_'+suffix)
from AthenaCommon.AppMgr import ToolSvc
if not hasattr(ToolSvc,pfotool.name()):
ToolSvc += pfotool
tool.PFOTool = pfotool
if suffix == 'Truth':
tool = CfgMgr.met__METTruthTool('MET_TruthTool_'+config.objType)
......@@ -136,7 +134,6 @@ def getBuilder(config,suffix,doTracks,doCells,doTriggerMET,doOriginCorrClus):
config.outputKey = tool.MissingETKey
else:
tool.MissingETKey = config.outputKey
from AthenaCommon.AppMgr import ToolSvc
return tool
#################################################################################
......@@ -150,7 +147,6 @@ class RefConfig:
def getRefiner(config,suffix,trkseltool=None,trkvxtool=None,trkisotool=None,caloisotool=None):
tool = None
from AthenaCommon.AppMgr import ToolSvc
if config.type == 'TrackFilter':
tool = CfgMgr.met__METTrackFilterTool('MET_TrackFilterTool_'+suffix)
tool.InputPVKey = defaultInputKey['PrimaryVx']
......@@ -182,7 +178,6 @@ def getRegions(config,suffix):
tool.InputMETMap = 'METMap_'+suffix
tool.InputMETKey = config.outputKey
tool.RegionValues = [ 1.5, 3.2, 10 ]
from AthenaCommon.AppMgr import ToolSvc
return tool
#################################################################################
......@@ -260,7 +255,6 @@ class METConfig:
if doRegions:
self.setupRegions(buildconfigs)
#
from AthenaCommon.AppMgr import ToolSvc
self.trkseltool=CfgMgr.InDet__InDetTrackSelectionTool("IDTrkSel_MET",
CutLevel="TightPrimary",
maxZ0SinTheta=3,
......@@ -338,7 +332,6 @@ def getMETRecoAlg(algName='METReconstruction',configs={},tools=[]):
regiontool = getRegionRecoTool(conf)
recoTools.append(regiontool)
from AthenaCommon.AppMgr import ToolSvc
for tool in recoTools:
print prefix, 'Added METRecoTool \''+tool.name()+'\' to alg '+algName
......
from AthenaCommon import Loggingfrom AthenaConfiguration.ComponentAccumulator import ComponentAccumulator if __name__=="__main__": # Setting needed for the ComponentAccumulator to do its thing from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=True # Set message levels from AthenaCommon import Constants msgLvl = "INFO" from AthenaCommon.Logging import log log.setLevel(msgLvl) # Config flags steer the job at various levels from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.isMC = True ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"] # Flags relating to multithreaded execution nthreads=0 ConfigFlags.Concurrency.NumThreads =nthreads if nthreads>0: ConfigFlags.Concurrency.NumThreads = 1 ConfigFlags.Concurrency.NumConcurrentEvents = 1 ConfigFlags.lock() # Get a ComponentAccumulator setting up the fundamental Athena job from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg cfg=MainServicesThreadedCfg(ConfigFlags) # Add the components for reading in pool files from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg.merge(PoolReadCfg(ConfigFlags)) # Get Jet Inputs from JetRecConfig.StandardJetDefs import EMTopoOrigin, LCTopoOrigin, CHSPFlow from JetRecConfig import JetRecConfig jetcomps=ComponentAccumulator() cfg.merge( JetRecConfig.JetInputCfg( [EMTopoOrigin], ConfigFlags, "EMtopoConstituents")) cfg.merge( JetRecConfig.JetInputCfg( [LCTopoOrigin], ConfigFlags, "LCTopoConstituents")) cfg.merge( JetRecConfig.JetInputCfg( [CHSPFlow], ConfigFlags, "PFlowConstituents")) # Start by just trying to add in MET Reconstruction based on METReconstruction_jobOptions.py from METReconstruction.METRecoFlags import metFlags from AthenaCommon.BeamFlags import jobproperties from RecExConfig.RecFlags import rec if jobproperties.Beam.beamType == 'cosmics' or jobproperties.Beam.beamType == 'singlebeam' or not rec.doInDet(): metFlags.UseTracks.set_Value(False) metFlags.DoPFlow.set_Value(False) print "METReconstruction_jobOptions: detected cosmics/single-beam configuration -- switch off track-based MET reco" """ import METReconstruction.METConfig_Calo import METReconstruction.METConfig_Track if rec.doTruth(): import METReconstruction.METConfig_Truth from METReconstruction.METRecoConfig import getMETRecoAlg print "PICKING UP CHANGES" metAlg = getMETRecoAlg('METReconstruction') components_metAlg = ComponentAccumulator() from AthenaCommon.AlgSequence import AthSequencer components_metAlg.addSequence( AthSequencer('METReconstruction') ) #technically don't need a new sequence name for it components_metAlg.addEventAlgo(metAlg,'METReconstruction') cfg.merge(components_metAlg) # Set up default configurations import METReconstruction.METConfig_Associator from METReconstruction.METAssocConfig import getMETAssocAlg # Get the configuration directly from METRecoFlags # Can also provide a dict of configurations or list of RecoTools or both assocAlg = getMETAssocAlg('METAssociation') components_assocAlg = ComponentAccumulator() components_assocAlg.addSequence(AthSequencer('METAssociation') ) components_assocAlg.addEventAlgo(assocAlg,'METAssociation') cfg.merge(components_assocAlg) from METUtilities.METMakerConfig import getMETMakerAlg for key,conf in metFlags.METAssocConfigs().iteritems(): if not conf.doTruth: makerAlg = getMETMakerAlg(conf.suffix) components_makerAlg=ComponentAccumulator() components_makerAlg.addSequence(AthSequencer(conf.suffix) ) components_makerAlg.addEventAlgo(makerAlg,conf.suffix) cfg.merge(components_makerAlg) """ cfg.run(maxEvents=10) """ from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() from METReconstruction.METRecoFlags import metFlags from AthenaCommon.BeamFlags import jobproperties from RecExConfig.RecFlags import rec if jobproperties.Beam.beamType == 'cosmics' or jobproperties.Beam.beamType == 'singlebeam' or not rec.doInDet(): metFlags.UseTracks.set_Value(False) metFlags.DoPFlow.set_Value(False) print "METReconstruction_jobOptions: detected cosmics/single-beam configuration -- switch off track-based MET reco" import METReconstruction.METConfig_Calo import METReconstruction.METConfig_Track if rec.doTruth(): import METReconstruction.METConfig_Truth from METReconstruction.METRecoConfig import getMETRecoAlg metAlg = getMETRecoAlg('METReconstruction') topSequence += metAlg # Set up default configurations import METReconstruction.METConfig_Associator from METReconstruction.METAssocConfig import getMETAssocAlg # Get the configuration directly from METRecoFlags # Can also provide a dict of configurations or list of RecoTools or both assocAlg = getMETAssocAlg('METAssociation') from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() topSequence += assocAlg from METUtilities.METMakerConfig import getMETMakerAlg for key,conf in metFlags.METAssocConfigs().iteritems(): if not conf.doTruth: makerAlg = getMETMakerAlg(conf.suffix) topSequence += makerAlg """
\ No newline at end of file
from AthenaCommon import Loggingfrom AthenaConfiguration.ComponentAccumulator import ComponentAccumulator if __name__=="__main__": # Setting needed for the ComponentAccumulator to do its thing from AthenaCommon.Configurable import Configurable Configurable.configurableRun3Behavior=True # Set message levels from AthenaCommon import Constants msgLvl = "INFO" from AthenaCommon.Logging import log log.setLevel(msgLvl) # Config flags steer the job at various levels from AthenaConfiguration.AllConfigFlags import ConfigFlags ConfigFlags.Input.isMC = True ConfigFlags.Input.Files = ["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/ASG/mc16_13TeV.410501.PowhegPythia8EvtGen_A14_ttbar_hdamp258p75_nonallhad.merge.AOD.e5458_s3126_r9364_r9315/AOD.11182705._000001.pool.root.1"] # Flags relating to multithreaded execution nthreads=0 ConfigFlags.Concurrency.NumThreads =nthreads if nthreads>0: ConfigFlags.Concurrency.NumThreads = 1 ConfigFlags.Concurrency.NumConcurrentEvents = 1 ConfigFlags.lock() # Get a ComponentAccumulator setting up the fundamental Athena job from AthenaConfiguration.MainServicesConfig import MainServicesThreadedCfg cfg=MainServicesThreadedCfg(ConfigFlags) # Add the components for reading in pool files from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg cfg.merge(PoolReadCfg(ConfigFlags)) # Get Jet Inputs from JetRecConfig.StandardJetDefs import EMTopoOrigin, LCTopoOrigin, CHSPFlow from JetRecConfig import JetRecConfig cfg1 = JetRecConfig.JetInputCfg( [EMTopoOrigin], ConfigFlags) cfg1.printConfig() cfg.merge( cfg1 ) cfg2 = JetRecConfig.JetInputCfg( [LCTopoOrigin], ConfigFlags) cfg2.printConfig() cfg.merge( cfg2 ) cfg3 = JetRecConfig.JetInputCfg( [CHSPFlow], ConfigFlags) cfg3.printConfig() cfg.merge( cfg3 ) # Start by just trying to add in MET Reconstruction based on METReconstruction_jobOptions.py from METReconstruction.METRecoFlags import metFlags # from AthenaCommon.BeamFlags import jobproperties NO LONGER ALLOWED # from RecExConfig.RecFlags import rec NO LONGER ALLOWED #NEED TO CHANGE THIS TO DEPEND ON ConfigFlags.Beam.Type => for now ignore """ if jobproperties.Beam.beamType == 'cosmics' or jobproperties.Beam.beamType == 'singlebeam' or not rec.doInDet(): metFlags.UseTracks.set_Value(False) metFlags.DoPFlow.set_Value(False) print "METReconstruction_jobOptions: detected cosmics/single-beam configuration -- switch off track-based MET reco" """ # TJ: Best to start each of these from scratch as a new CA module, # Can e.g. make files called METCaloConfig.py that just put the # old alg into a CA. # Rather than have N reco tools that get thrown into one alg later, # have each CA generate its own METRecoAlg and add this to the sequence. """ import METReconstruction.METConfig_Calo import METReconstruction.METConfig_Track if rec.doTruth(): import METReconstruction.METConfig_Truth from METReconstruction.METRecoConfig import getMETRecoAlg print "PICKING UP CHANGES" metAlg = getMETRecoAlg('METReconstruction') """ # Probably want to define one CA each for EMTopo, LCTopo and PFlow, # then have a higher level one that merges in all three, # then the top-level (i.e. this) can just pull in the all-associators CA """ components_metAlg = ComponentAccumulator() from AthenaCommon.AlgSequence import AthSequencer components_metAlg.addSequence( AthSequencer('METReconstruction') ) #technically don't need a new sequence name for it components_metAlg.addEventAlgo(metAlg,'METReconstruction') cfg.merge(components_metAlg) # Set up default configurations import METReconstruction.METConfig_Associator from METReconstruction.METAssocConfig import getMETAssocAlg # Get the configuration directly from METRecoFlags # Can also provide a dict of configurations or list of RecoTools or both assocAlg = getMETAssocAlg('METAssociation') components_assocAlg = ComponentAccumulator() components_assocAlg.addSequence(AthSequencer('METAssociation') ) components_assocAlg.addEventAlgo(assocAlg,'METAssociation') cfg.merge(components_assocAlg) from METUtilities.METMakerConfig import getMETMakerAlg for key,conf in metFlags.METAssocConfigs().iteritems(): if not conf.doTruth: makerAlg = getMETMakerAlg(conf.suffix) components_makerAlg=ComponentAccumulator() components_makerAlg.addSequence(AthSequencer(conf.suffix) ) components_makerAlg.addEventAlgo(makerAlg,conf.suffix) cfg.merge(components_makerAlg) """ print "Running final component accumulator" cfg.printConfig() cfg.run(maxEvents=10)
\ No newline at end of file
......
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