ATLAS Offline Software
NCBCommonConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2 
3 # NCBCommonConfig
4 # Contains the configuration for the common physics containers/decorations used in analysis DAODs
5 # Actual configuration is subcontracted to other config files since some of them are very long
6 
7 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
8 from AthenaConfiguration.ComponentFactory import CompFactory
9 
10 
12  """Jet reconstruction needed for NCB1"""
13 
14  from JetRecConfig.StandardSmallRJets import AntiKt4EMTopo
15  from JetRecConfig.JetRecConfig import JetRecCfg
16 
17  acc = ComponentAccumulator()
18 
19  AntiKt4EMTopo_deriv = AntiKt4EMTopo.clone(
20  modifiers = AntiKt4EMTopo.modifiers+("JetPtAssociation","QGTagging")
21  )
22 
23  jetList = [AntiKt4EMTopo_deriv]
24 
25 
26  for jd in jetList:
27  acc.merge(JetRecCfg(flags,jd))
28 
29  return acc
30 
31 
32 def NCBCommonAugmentationsCfg(flags,**kwargs):
33  """Configure the common augmentation"""
34  acc = ComponentAccumulator()
35 
36  # MC truth
37  if flags.Input.isMC:
38  from DerivationFrameworkMCTruth.MCTruthCommonConfig import (
39  AddStandardTruthContentsCfg,
40  AddHFAndDownstreamParticlesCfg,
41  AddMiniTruthCollectionLinksCfg,
42  AddPVCollectionCfg,
43  AddTruthCollectionNavigationDecorationsCfg,
44  TruthClassificationAugmentationsCfg)
45  acc.merge(TruthClassificationAugmentationsCfg(flags))
46  from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import DFCommonTruthCharmToolCfg
47  NCBCommonTruthCharmTool = acc.getPrimaryAndMerge(DFCommonTruthCharmToolCfg(
48  flags,
49  name = "NCBCommonTruthCharmTool"))
50  CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
51  acc.addEventAlgo(CommonAugmentation("NCBCommonTruthCharmKernel",AugmentationTools=[NCBCommonTruthCharmTool]))
52  acc.merge(AddHFAndDownstreamParticlesCfg(flags))
53  acc.merge(AddStandardTruthContentsCfg(flags))
55  flags,
56  TruthCollections=["TruthElectrons",
57  "TruthMuons",
58  "TruthPhotons",
59  "TruthTaus",
60  "TruthNeutrinos",
61  "TruthBSM",
62  "TruthBottom",
63  "TruthTop",
64  "TruthBoson",
65  "TruthCharm",
66  "TruthHFWithDecayParticles"],
67  prefix = 'NCB_'))
68  # Re-point links on reco objects
69  acc.merge(AddMiniTruthCollectionLinksCfg(flags))
70  acc.merge(AddPVCollectionCfg(flags))
71 
72  # InDet, Muon, Egamma common augmentations
73  from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
74  acc.merge(MuonsCommonCfg(flags))
75  # TODO: need to find the new flags equivalent for the missing settings below, then we can
76  # drop these kwargs and do everything via the flags
77  from DerivationFrameworkInDet.InDetCommonConfig import InDetCommonCfg
78  acc.merge(InDetCommonCfg(flags,
79  DoVertexFinding = flags.Tracking.doVertexFinding,
80  AddPseudoTracks = flags.Tracking.doPseudoTracking,
81  DecoLRTTTVA = False,
82  DoR3LargeD0 = flags.Tracking.doLargeD0,
83  StoreSeparateLargeD0Container = flags.Tracking.storeSeparateLargeD0Container,
84  MergeLRT = False))
85  # Jets, di-taus, tau decorations, flavour tagging, MET association
86  from DerivationFrameworkJetEtMiss.METCommonConfig import METCommonCfg
87  acc.merge(METCommonCfg(flags))
88  acc.merge(StandardJetsInDerivCfg(flags))
89 
90  # Trigger matching
91  if flags.Reco.EnableTrigger or flags.Trigger.triggerConfig == 'INFILE':
92  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
93  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2ToRun3Cfg
94  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun3Cfg
95  # requires some wrangling due to the difference between run 2 and 3
96  triggerListsHelper = kwargs['TriggerListsHelper']
97  if flags.Trigger.EDMVersion == 2:
98  # NOTE: Once Run-2 -> Run-3 trigger navigation is validated and doEDMVersionConversion is on by default, we will only want to do ONE of
99  # TriggerMatchingCommonRun2Cfg(s) OR TriggerMatchingCommonRun2ToRun3Cfg
100  # Otherwise we are doubling up on the analysis trigger data in both the Run-2 and Run-3 formats.
101 
102  # This sets up the Run-2 style matching during the derivation process
104  flags,
105  name = "PhysCommonTrigMatchNoTau",
106  OutputContainerPrefix = "TrigMatch_",
107  ChainNames = triggerListsHelper.Run2TriggerNamesNoTau))
109  flags,
110  name = "PhysCommonTrigMatchTau",
111  OutputContainerPrefix = "TrigMatch_",
112  ChainNames = triggerListsHelper.Run2TriggerNamesTau,
113  DRThreshold = 0.2))
114  # This sets up a conversion of the Run-2 trigger navigation to the Run-3 style,
115  # followed by Run-3 style navigation slimming for trigger-matching from DAOD.
116  # This function is a noop if doEDMVersionConversion=False
118  flags,
119  TriggerList = triggerListsHelper.Run2TriggerNamesNoTau +
120  triggerListsHelper.Run2TriggerNamesTau))
121  if flags.Trigger.EDMVersion == 3:
122  # This sets up the Run-3 style navigation slimming for trigger-matching from DAOD
124  flags, TriggerList = triggerListsHelper.Run3TriggerNames))
125 
126  return acc
127 
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun2Cfg
def TriggerMatchingCommonRun2Cfg(flags, name, **kwargs)
Definition: TriggerMatchingCommonConfig.py:91
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MCTruthCommonConfig.AddMiniTruthCollectionLinksCfg
def AddMiniTruthCollectionLinksCfg(flags, **kwargs)
Definition: MCTruthCommonConfig.py:445
python.MCTruthCommonConfig.AddPVCollectionCfg
def AddPVCollectionCfg(flags)
Definition: MCTruthCommonConfig.py:332
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun2ToRun3Cfg
def TriggerMatchingCommonRun2ToRun3Cfg(flags, **kwargs)
Definition: TriggerMatchingCommonConfig.py:106
python.NCBCommonConfig.NCBCommonAugmentationsCfg
def NCBCommonAugmentationsCfg(flags, **kwargs)
Definition: NCBCommonConfig.py:32
python.JetRecConfig.JetRecCfg
def JetRecCfg(flags, jetdef, returnConfiguredDef=False)
Top level functions returning ComponentAccumulator out of JetDefinition.
Definition: JetRecConfig.py:36
python.MuonsCommonConfig.MuonsCommonCfg
def MuonsCommonCfg(flags, suff="")
Definition: MuonsCommonConfig.py:13
python.TruthDerivationToolsConfig.DFCommonTruthCharmToolCfg
def DFCommonTruthCharmToolCfg(flags, name)
Definition: TruthDerivationToolsConfig.py:36
python.NCBCommonConfig.StandardJetsInDerivCfg
def StandardJetsInDerivCfg(flags)
Definition: NCBCommonConfig.py:11
python.MCTruthCommonConfig.TruthClassificationAugmentationsCfg
def TruthClassificationAugmentationsCfg(flags, **kwargs)
Definition: MCTruthCommonConfig.py:96
python.MCTruthCommonConfig.AddStandardTruthContentsCfg
def AddStandardTruthContentsCfg(flags, decorationDressing='dressedPhoton', includeTausInDressingPhotonRemoval=False, navInputCollections=["TruthElectrons", "TruthMuons", "TruthPhotons", "TruthTaus", "TruthNeutrinos", "TruthBSM", "TruthBottom", "TruthTop", "TruthBoson"], prefix='')
Definition: MCTruthCommonConfig.py:179
python.MCTruthCommonConfig.AddHFAndDownstreamParticlesCfg
def AddHFAndDownstreamParticlesCfg(flags, **kwargs)
Add electrons, photons, and their downstream particles in a special collection def addEgammaAndDownst...
Definition: MCTruthCommonConfig.py:308
python.MCTruthCommonConfig.AddTruthCollectionNavigationDecorationsCfg
def AddTruthCollectionNavigationDecorationsCfg(flags, TruthCollections=[], prefix='')
Definition: MCTruthCommonConfig.py:348
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun3Cfg
def TriggerMatchingCommonRun3Cfg(flags, **kwargs)
Definition: TriggerMatchingCommonConfig.py:129
python.InDetCommonConfig.InDetCommonCfg
def InDetCommonCfg(flags, **kwargs)
Definition: InDetCommonConfig.py:16
python.METCommonConfig.METCommonCfg
def METCommonCfg(ConfigFlags)
Definition: METCommonConfig.py:11