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

First proper 2020 progress

parent 386c0cdf
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
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#from METReconstruction.METRecoFlags import metFlags
from METReconstruction.METRecoCfg import BuildConfig, RefConfig, METConfig,clusterSigStates,getMETRecoTool,getMETRecoAlg
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaCommon import CfgMgr
def METCalo_Cfg(configFlags):
sequencename = "METReconstruction_Calo_New"
components = ComponentAccumulator()
from AthenaCommon.AlgSequence import AthSequencer
components.addSequence( AthSequencer(sequencename) )
recotools=[]
############################################################################
# EMTopo
cfg_emt = METConfig('EMTopo_New',[BuildConfig('SoftClus','EMTopo')],
doRegions=True,
doOriginCorrClus=False
)
cfg_emt.builders['SoftClus'].SignalState = clusterSigStates['EMScale']
#metFlags.METConfigs()[cfg_emt.suffix] = cfg_emt
#metFlags.METOutputList().append(cfg_emt.suffix)
#metFlags.METOutputList().append(cfg_emt.suffix+"Regions")
recotool_emt = getMETRecoTool(cfg_emt)
recotools.append(recotool_emt)
############################################################################
# LocHadTopo
cfg_lht = METConfig('LocHadTopo_New',[BuildConfig('SoftClus','LocHadTopo')],
doRegions=True,
doOriginCorrClus=False
)
cfg_lht.builders['SoftClus'].SignalState = clusterSigStates['LocHad']
#metFlags.METConfigs()[cfg_lht.suffix] = cfg_lht
#metFlags.METOutputList().append(cfg_lht.suffix)
#metFlags.METOutputList().append(cfg_lht.suffix+"Regions")
recotool_lht = getMETRecoTool(cfg_lht)
recotools.append(recotool_lht)
############################################################################
# Calo regions
"""
cfg_calo = METConfig('Calo_New',
[BuildConfig('CaloReg')],
doCells=True
)
#metFlags.METConfigs()[cfg_calo.suffix] = cfg_calo
#metFlags.METOutputList().append(cfg_calo.suffix)
recotool_caloreg= getMETRecoTool(cfg_calo)
recotools.append(recotool_caloreg)
#SO FAR THIS WON'T RUN, AND GIVES A KEY ERROR:
#File "/usera/sarahw/testareas/PostPHD/METDec2019/build/x86_64-centos7-gcc8-opt/python/METReconstruction/METRecoCfg.py", line 126, in getBuilder
#tool.InputCollection = defaultInputKey[config.objType]
#KeyError: 'CaloReg'
"""
recoAlg_calo = getMETRecoAlg(algName='METRecoAlg_Calo',tools=recotools)
components.addEventAlgo(recoAlg_calo,sequencename)
return components
......@@ -6,13 +6,13 @@ from AthenaCommon import CfgMgr
def METTrack_Cfg(configFlags):
sequencename = "METReconstruction_Track"
sequencename = "METReconstruction_Track_New"
components = ComponentAccumulator()
from AthenaCommon.AlgSequence import AthSequencer
components.addSequence( AthSequencer(sequencename) )
cfg_trk = METConfig('Track',[BuildConfig('SoftTrk','Track')],
cfg_trk = METConfig('Track_new',[BuildConfig('SoftTrk','Track')],
[RefConfig('TrackFilter','PVTrack')],
doTracks=configFlags.MET.UseTracks)
......@@ -21,13 +21,7 @@ def METTrack_Cfg(configFlags):
cfg_trk.refiners['TrackFilter'].DoEoverPSel=True
recotool = getMETRecoTool(cfg_trk)
#recotool = CfgMgr.met__METRecoTool('MET_RecoTool_empty')
print "Printing recotool"
print recotool
print "MET track helper object defined!!!"
print cfg_trk
recoAlg=getMETRecoAlg(algName='METRecoAlg_Track',tools=[recotool])
print "ALG defined"
print recoAlg
components.addEventAlgo(recoAlg, sequencename)
return components
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.AthConfigFlags import AthConfigFlags def createMETConfigFlags(): metConfigFlags=AthConfigFlags() metConfigFlags.addFlag("MET.UseTracks",True) metConfigFlags.addFlag("MET.DoPFlow",True) return metConfigFlags
# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.AthConfigFlags import AthConfigFlags def createMETConfigFlags(): metConfigFlags=AthConfigFlags() metConfigFlags.addFlag("MET.UseTracks",True) metConfigFlags.addFlag("MET.DoPFlow",True) return metConfigFlags
\ No newline at end of file
......
......@@ -260,7 +260,7 @@ class METConfig:
maxD0=2,
minPt=500)
#
self.trkvxtool=CfgMgr.CP__LooseTrackVertexAssociationTool("LooseTrackVertexAssociationTool_MET")
self.trkvxtool=CfgMgr.CP__TrackVertexAssociationTool("TrackVertexAssociationTool_MET", WorkingPoint="Nominal")
#self.trkvxtool=CfgMgr.CP__TightTrackVertexAssociationTool("TightTrackVertexAssociationTool_MET", dzSinTheta_cut=3, doPV=False)
#
self.trkisotool = CfgMgr.xAOD__TrackIsolationTool("TrackIsolationTool_MET")
......
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 = "VERBOSE" 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 if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Beam.Type == 'singlebeam':# used to have " or not rec.doInDet()" on the end ConfigFlags.MET.UseTracks=False ConfigFlags.MET.DoPFlow=False print "METReconstruction_jobOptions: detected cosmics/single-beam configuration -- switch off track-based MET reco" 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)) print "CHECKPOINT 1" from StoreGate.StoreGateConf import StoreGateSvc cfg.addService(StoreGateSvc("DetectorStore")) #Setup up general geometry modelConfig=ComponentAccumulator() from AtlasGeoModel.GeoModelConfig import GeoModelCfg modelConfig=GeoModelCfg(ConfigFlags) print modelConfig print "CHECKPOINT 1.9" cfg.merge(modelConfig) print "CHECKPOINT 2" from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg cfg.merge(MagneticFieldSvcCfg(ConfigFlags)) from TrkDetDescrSvc.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg cfg.merge(TrackingGeometrySvcCfg(ConfigFlags)) print "CHECKPOINT 3" # 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 ) print "CHECKPOINT 3" from METReconstruction.METCfg_Track import METTrack_Cfg cfg4=METTrack_Cfg(ConfigFlags) cfg4.printConfig() cfg.merge(cfg4) # 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 # 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
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 = "VERBOSE" 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.MET.UseTracks = True ConfigFlags.MET.DoPFlow = True if ConfigFlags.Beam.Type == 'cosmics' or ConfigFlags.Beam.Type == 'singlebeam':# used to have " or not rec.doInDet()" on the end ConfigFlags.MET.UseTracks = False ConfigFlags.MET.DoPFlow = False print "METReconstruction_jobOptions: detected cosmics/single-beam configuration -- switch off track-based MET reco" 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)) print "CHECKPOINT 1" from StoreGate.StoreGateConf import StoreGateSvc cfg.addService(StoreGateSvc("DetectorStore")) #Setup up general geometry modelConfig=ComponentAccumulator() from AtlasGeoModel.GeoModelConfig import GeoModelCfg modelConfig=GeoModelCfg(ConfigFlags) cfg.merge(modelConfig) from MagFieldServices.MagFieldServicesConfig import MagneticFieldSvcCfg cfg.merge(MagneticFieldSvcCfg(ConfigFlags)) from TrkConfig.AtlasTrackingGeometrySvcConfig import TrackingGeometrySvcCfg cfg.merge(TrackingGeometrySvcCfg(ConfigFlags)) from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg cfg.merge(MuonGeoModelCfg(ConfigFlags)) # Get Jet Inputs from JetRecConfig.StandardJetDefs import EMTopoOrigin, LCTopoOrigin, CHSPFlow from JetRecConfig import JetRecConfig cfg1 = JetRecConfig.JetInputCfg( [EMTopoOrigin], ConfigFlags) cfg.merge( cfg1 ) cfg2 = JetRecConfig.JetInputCfg( [LCTopoOrigin], ConfigFlags) cfg.merge( cfg2 ) cfg3 = JetRecConfig.JetInputCfg( [CHSPFlow], ConfigFlags) cfg.merge( cfg3 ) from METReconstruction.METCfg_Track import METTrack_Cfg cfg4=METTrack_Cfg(ConfigFlags) cfg.merge(cfg4) from METReconstruction.METCfg_Calo import METCalo_Cfg cfg5=METCalo_Cfg(ConfigFlags) cfg.merge(cfg5) # 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 # 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) """ outputlist = ["EventInfo#*"] """ originaljets = ["AntiKt4EMPFlowJets","AntiKt4EMTopoJets"] for jetcoll in originaljets: outputlist += ["xAOD::JetContainer#"+jetcoll,"xAOD::JetAuxContainer#"+jetcoll+"Aux."] """ outputlist+=["xAOD::MissingETContainer#"+"MET_Track_new","xAOD::MissingETAuxContainer#"+"MET_Track_new"+"Aux."] outputlist+=["xAOD::MissingETContainer#"+"MET_Track","xAOD::MissingETAuxContainer#"+"MET_Track"+"Aux."] outputlist+=["xAOD::MissingETContainer#"+"MET_EMTopo_New","xAOD::MissingETAuxContainer#"+"MET_EMTopo_New"+"Aux."] outputlist+=["xAOD::MissingETContainer#"+"MET_EMTopo","xAOD::MissingETAuxContainer#"+"MET_EMTopo"+"Aux."] from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg cfg.merge(OutputStreamCfg(ConfigFlags,"xAOD",ItemList=outputlist)) # Optionally, print the contents of the store every event cfg.getService("StoreGateSvc").Dump = True print "Running final component accumulator" cfg.printConfig() cfg.run(maxEvents=20)
\ 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