ATLAS Offline Software
Functions
python.AthenaMonitoringAODRecoCfg Namespace Reference

Functions

def AthenaMonitoringAODRecoCfg (flags)
 

Function Documentation

◆ AthenaMonitoringAODRecoCfg()

def python.AthenaMonitoringAODRecoCfg.AthenaMonitoringAODRecoCfg (   flags)

Definition at line 5 of file AthenaMonitoringAODRecoCfg.py.

6  import logging
7  local_logger = logging.getLogger('AthenaMonitoringAODRecoCfg')
8  info = local_logger.info
9  result = ComponentAccumulator()
10 
11  if flags.DQ.Environment == 'AOD':
12  info('Running on AOD: Scheduling rebuild of standard jet collections if necessary')
13  from JetRecConfig.StandardSmallRJets import AntiKt4EMTopo, AntiKt4EMPFlow, AntiKt4LCTopo
14  from JetRecConfig.StandardLargeRJets import AntiKt10LCTopo_noVR, AntiKt10LCTopoTrimmed_trigger, AntiKt10UFOCSSKSoftDrop_trigger
15  from AthenaConfiguration.Enums import BeamType
16 
17  # first, check small R jets, skip PFlow when running over cosmics
18  jets_to_schedule = [_ for _ in ((AntiKt4EMTopo, AntiKt4EMPFlow, AntiKt4LCTopo) if flags.Beam.Type is not BeamType.Cosmics else (AntiKt4EMTopo, AntiKt4LCTopo))
19  if _.fullname() not in flags.Input.Collections]
20  # if we reschedule small R jets, check if we need to reschedule large R as well
21  if jets_to_schedule:
22  jets_to_schedule += [_ for _ in ((AntiKt10LCTopo_noVR, AntiKt10LCTopoTrimmed_trigger, AntiKt10UFOCSSKSoftDrop_trigger) if flags.Beam.Type is not BeamType.Cosmics else (AntiKt10LCTopo_noVR, AntiKt10LCTopoTrimmed_trigger))
23  if _.fullname() not in flags.Input.Collections]
24 
25  if jets_to_schedule:
26  info(f'Ensuring presence of jet collections for monitoring: {jets_to_schedule}')
27  from JetRecConfig.JetRecConfig import JetRecCfg
28  from JetRecConfig.JetConfigFlags import jetInternalFlags
29  # We're in Reco-like job : this flag implies the jet config will automatically switch off component incompatible with conditions (cosmics, truth,...)
30  jetInternalFlags.isRecoJob = True
31 
32  for container in jets_to_schedule:
33  result.merge(JetRecCfg(flags, container))
34 
35  jet_collections = set([_.fullname().replace('Jets','') for _ in jets_to_schedule])
36  btag_jet_collections = set(['AntiKt4EMTopo', 'AntiKt4EMPFlow'])
37  met_jet_collections = set(['AntiKt4EMTopo', 'AntiKt4EMPFlow', 'AntiKt4LCTopo'])
38 
39  if jet_collections & btag_jet_collections:
40  info('Scheduling b-tagging of rebuilt jets')
41  from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
42  result.merge(BeamSpotCondAlgCfg(flags))
43  from BTagging.BTagConfig import BTagRecoSplitCfg
44  # would rather use removesuffix below but need to wait for Python 3.9
45  for container in jet_collections & btag_jet_collections:
46  result.merge(BTagRecoSplitCfg(flags, [container]))
47 
48  # MET can't be rebuilt when running over cosmics or HI AOD as taus are missing
49  from .DQConfigFlags import DQDataType
50  if jet_collections & met_jet_collections and flags.DQ.DataType not in (DQDataType.HeavyIon, DQDataType.Cosmics):
51  info('Scheduling rebuild of standard MET')
52  from METReconstruction.METAssociatorCfg import METAssociatorCfg
53  from METUtilities.METMakerConfig import getMETMakerAlg
54  for container in jet_collections & met_jet_collections:
55  if container == 'AntiKt4EMPFlow':
56  # build links between FlowElements and electrons, photons, muons and taus
57  info('Scheduling FlowElement linking')
58  from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
59  result.merge(PFGlobalFlowElementLinkingCfg(flags))
60  result.merge(METAssociatorCfg(flags, container))
61  result.addEventAlgo(getMETMakerAlg(container))
62  from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
63  result.merge(CaloNoiseCondAlgCfg(flags)) # Prereq for Calo MET
64  from METReconstruction.METCalo_Cfg import METCalo_Cfg
65  result.merge(METCalo_Cfg(flags))
66 
67  return result
grepfile.info
info
Definition: grepfile.py:38
replace
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition: hcg.cxx:307
METCalo_Cfg
Definition: METCalo_Cfg.py:1
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.BeamSpotConditionsConfig.BeamSpotCondAlgCfg
def BeamSpotCondAlgCfg(flags, name="BeamSpotCondAlg", **kwargs)
Definition: BeamSpotConditionsConfig.py:7
METMakerConfig.getMETMakerAlg
def getMETMakerAlg(suffix, jetSelection="Tier0", jetColl="")
Definition: METMakerConfig.py:41
METAssociatorCfg
Definition: METAssociatorCfg.py:1
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:37
python.CaloNoiseCondAlgConfig.CaloNoiseCondAlgCfg
def CaloNoiseCondAlgCfg(flags, noisetype="totalNoise")
Definition: CaloNoiseCondAlgConfig.py:11
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
python.BTagConfig.BTagRecoSplitCfg
def BTagRecoSplitCfg(inputFlags, JetCollection=['AntiKt4EMTopo', 'AntiKt4EMPFlow'])
Definition: BTagConfig.py:133
python.AthenaMonitoringAODRecoCfg.AthenaMonitoringAODRecoCfg
def AthenaMonitoringAODRecoCfg(flags)
Definition: AthenaMonitoringAODRecoCfg.py:5
PFCfg.PFGlobalFlowElementLinkingCfg
def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
Definition: PFCfg.py:455