5def AthenaMonitoringAODRecoCfg(flags):
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
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
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
29
30 for container in jets_to_schedule:
31 result.merge(JetRecCfg(flags, container))
32
33
34 if flags.Beam.Type is not BeamType.Cosmics:
35 from JetRecConfig.JetRecConfig import getConstitPJGAlg
36 from JetRecConfig.StandardJetConstits import stdConstitDic as cst
37 from JetRecConfig.JetInputConfig import buildEventShapeAlg
38 result.addEventAlgo(getConstitPJGAlg(cst.GPFlow, suffix='Neut'))
39 result.addEventAlgo(buildEventShapeAlg(cst.GPFlow, '', suffix = 'Neut' ))
40
41 jet_collections =
set([_.fullname().
replace(
'Jets',
'')
for _
in jets_to_schedule])
42 btag_jet_collections =
set([
'AntiKt4EMTopo',
'AntiKt4EMPFlow'])
43 met_jet_collections =
set([
'AntiKt4EMTopo',
'AntiKt4EMPFlow',
'AntiKt4LCTopo'])
44
45 if jet_collections & btag_jet_collections:
46 info('Scheduling b-tagging of rebuilt jets')
47 from BeamSpotConditions.BeamSpotConditionsConfig import BeamSpotCondAlgCfg
48 result.merge(BeamSpotCondAlgCfg(flags))
49 from BTagging.BTagConfig import BTagRecoSplitCfg
50
51 for container in jet_collections & btag_jet_collections:
52 result.merge(BTagRecoSplitCfg(flags, [container+"Jets"]))
53
54
55 from .DQConfigFlags import DQDataType
56 if jet_collections & met_jet_collections and flags.DQ.DataType not in (DQDataType.HeavyIon, DQDataType.Cosmics):
57 info('Scheduling rebuild of standard MET')
58 from METReconstruction.METAssociatorCfg import METAssociatorCfg
59 from METUtilities.METMakerConfig import getMETMakerAlg
60 for container in jet_collections & met_jet_collections:
61 if container == 'AntiKt4EMPFlow':
62
63 info('Scheduling FlowElement linking')
64 from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
65 result.merge(PFGlobalFlowElementLinkingCfg(flags))
67 result.addEventAlgo(getMETMakerAlg(container))
68 from CaloTools.CaloNoiseCondAlgConfig import CaloNoiseCondAlgCfg
69 result.merge(CaloNoiseCondAlgCfg(flags))
70 from METReconstruction.METCalo_Cfg import METCalo_Cfg
72
73 return result
std::string replace(std::string s, const std::string &s2, const std::string &s3)