ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
PhysCommonConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 # PhysCommonConfig
4 # Contains the configuration for the common physics containers/decorations used in analysis DAODs
5 # including PHYS(LITE)
6 # Actual configuration is subcontracted to other config files since some of them are very long
7 
8 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory import CompFactory
10 from AthenaConfiguration.Enums import LHCPeriod
11 from AthenaCommon.Logging import logging
12 msg = logging.getLogger('PHYSCommonConfig')
13 
14 def PhysCommonAugmentationsCfg(flags,**kwargs):
15  """Configure the common augmentation"""
16  acc = ComponentAccumulator()
17 
18  # MC truth
19  if flags.Input.isMC:
20  from DerivationFrameworkMCTruth.MCTruthCommonConfig import (
21  AddStandardTruthContentsCfg,
22  AddHFAndDownstreamParticlesCfg,
23  AddMiniTruthCollectionLinksCfg,
24  AddPVCollectionCfg,
25  AddTruthCollectionNavigationDecorationsCfg)
26  from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import TruthCollectionMakerCfg
27  PhysCommonTruthCharmTool = acc.getPrimaryAndMerge(TruthCollectionMakerCfg(
28  flags,
29  name = "PhysCommonTruthCharmTool",
30  NewCollectionName = "TruthCharm",
31  KeepNavigationInfo = False,
32  ParticleSelectionString = "(abs(TruthParticles.pdgId) == 4)",
33  Do_Compress = True))
34  CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
35  acc.addEventAlgo(CommonAugmentation("PhysCommonTruthCharmKernel",AugmentationTools=[PhysCommonTruthCharmTool]))
36  acc.merge(AddHFAndDownstreamParticlesCfg(flags))
37  acc.merge(AddStandardTruthContentsCfg(flags))
39  flags,
40  TruthCollections=["TruthElectrons",
41  "TruthMuons",
42  "TruthPhotons",
43  "TruthTaus",
44  "TruthNeutrinos",
45  "TruthBSM",
46  "TruthBottom",
47  "TruthTop",
48  "TruthBoson",
49  "TruthCharm",
50  "TruthHFWithDecayParticles"],
51  prefix = 'PHYS_'))
52  # Re-point links on reco objects
53  acc.merge(AddMiniTruthCollectionLinksCfg(flags))
54  acc.merge(AddPVCollectionCfg(flags))
55 
56  # InDet, Muon, Egamma common augmentations
57  from DerivationFrameworkInDet.InDetCommonConfig import InDetCommonCfg
58  from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
59  from DerivationFrameworkEGamma.EGammaCommonConfig import EGammaCommonCfg
60  # TODO: need to find the new flags equivalent for the missing settings below, then we can
61  # drop these kwargs and do everything via the flags
62  acc.merge(InDetCommonCfg(flags,
63  DoVertexFinding = flags.Tracking.doVertexFinding,
64  AddPseudoTracks = flags.Tracking.doPseudoTracking,
65  DecoLRTTTVA = False,
66  DoR3LargeD0 = flags.Tracking.doLargeD0,
67  StoreSeparateLargeD0Container = flags.Tracking.storeSeparateLargeD0Container,
68  MergeLRT = False))
69  acc.merge(MuonsCommonCfg(flags))
70  acc.merge(EGammaCommonCfg(flags))
71  # Jets, di-taus, tau decorations, flavour tagging, MET association
72  from DerivationFrameworkJetEtMiss.JetCommonConfig import JetCommonCfg
73  from DerivationFrameworkFlavourTag.FtagDerivationConfig import FtagJetCollectionsCfg
74  from DerivationFrameworkTau.TauCommonConfig import (AddDiTauLowPtCfg, AddMuonRemovalTauAODReRecoAlgCfg, AddTauIDDecorationCfg)
75  from DerivationFrameworkJetEtMiss.METCommonConfig import METCommonCfg
76  acc.merge(JetCommonCfg(flags))
77  #We also need to build links between the newly created jet constituents (GlobalFE)
78  #and electrons,photons,muons and taus
79  from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
80  acc.merge(PFGlobalFlowElementLinkingCfg(flags))
81  acc.merge(AddDiTauLowPtCfg(flags))
82  acc.merge(AddMuonRemovalTauAODReRecoAlgCfg(flags))
83  # eVeto WP and DeepSet ID for taus and muon-subtracted taus
84  acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets"))
85  acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets_MuonRM"))
86  # for AOD produced before 24.0.17, the electron removal tau is not available
87  if flags.Tau.TauEleRM_isAvailable:
88  acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets_EleRM"))
89  FTagJetColl = ['AntiKt4EMPFlowJets', 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets']
90  if flags.GeoModel.Run >= LHCPeriod.Run4:
91  FTagJetColl.append('AntiKt4EMTopoJets')
92  if flags.Reco.EnableBTagging:
93  acc.merge(FtagJetCollectionsCfg(flags,FTagJetColl))
94  acc.merge(METCommonCfg(flags))
95 
96  # Trigger matching
97  if flags.Reco.EnableTrigger or flags.Trigger.triggerConfig == 'INFILE':
98  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
99  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2ToRun3Cfg
100  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun3Cfg
101  # requires some wrangling due to the difference between run 2 and 3
102  triggerListsHelper = kwargs['TriggerListsHelper']
103  if flags.Trigger.EDMVersion == 2:
104  # NOTE: Once Run-2 -> Run-3 trigger navigation is validated and doEDMVersionConversion is on by default, we will only want to do ONE of
105  # TriggerMatchingCommonRun2Cfg(s) OR TriggerMatchingCommonRun2ToRun3Cfg
106  # Otherwise we are doubling up on the analysis trigger data in both the Run-2 and Run-3 formats.
107 
108  # This sets up the Run-2 style matching during the derivation process
110  flags,
111  name = "PhysCommonTrigMatchNoTau",
112  OutputContainerPrefix = "TrigMatch_",
113  ChainNames = triggerListsHelper.Run2TriggerNamesNoTau))
115  flags,
116  name = "PhysCommonTrigMatchTau",
117  OutputContainerPrefix = "TrigMatch_",
118  ChainNames = triggerListsHelper.Run2TriggerNamesTau,
119  DRThreshold = 0.2))
120  # This sets up a conversion of the Run-2 trigger navigation to the Run-3 style,
121  # followed by Run-3 style navigation slimming for trigger-matching from DAOD.
122  # This function is a noop if doEDMVersionConversion=False
124  flags,
125  TriggerList = triggerListsHelper.Run2TriggerNamesNoTau +
126  triggerListsHelper.Run2TriggerNamesTau))
127  if flags.Trigger.EDMVersion == 3:
128  # This sets up the Run-3 style navigation slimming for trigger-matching from DAOD
130  flags, TriggerList = triggerListsHelper.Run3TriggerNames))
131 
132  return acc
133 
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun2Cfg
def TriggerMatchingCommonRun2Cfg(flags, name, **kwargs)
Definition: TriggerMatchingCommonConfig.py:91
python.JetCommonConfig.JetCommonCfg
def JetCommonCfg(ConfigFlags)
Definition: JetCommonConfig.py:11
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.FtagDerivationConfig.FtagJetCollectionsCfg
def FtagJetCollectionsCfg(cfgFlags, jet_cols, pv_cols=None, trackAugmenterPrefix=None)
Definition: FtagDerivationConfig.py:32
python.MCTruthCommonConfig.AddStandardTruthContentsCfg
def AddStandardTruthContentsCfg(flags, decorationDressing='dressedPhoton', includeTausInDressingPhotonRemoval=False, prefix='')
Definition: MCTruthCommonConfig.py:168
python.MCTruthCommonConfig.AddMiniTruthCollectionLinksCfg
def AddMiniTruthCollectionLinksCfg(flags, **kwargs)
Definition: MCTruthCommonConfig.py:431
python.MCTruthCommonConfig.AddPVCollectionCfg
def AddPVCollectionCfg(flags)
Definition: MCTruthCommonConfig.py:319
python.TauCommonConfig.AddMuonRemovalTauAODReRecoAlgCfg
def AddMuonRemovalTauAODReRecoAlgCfg(flags, **kwargs)
Definition: TauCommonConfig.py:144
python.TruthDerivationToolsConfig.TruthCollectionMakerCfg
def TruthCollectionMakerCfg(flags, name, **kwargs)
Definition: TruthDerivationToolsConfig.py:19
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun2ToRun3Cfg
def TriggerMatchingCommonRun2ToRun3Cfg(flags, **kwargs)
Definition: TriggerMatchingCommonConfig.py:106
python.EGammaCommonConfig.EGammaCommonCfg
def EGammaCommonCfg(ConfigFlags)
Definition: EGammaCommonConfig.py:15
python.MuonsCommonConfig.MuonsCommonCfg
def MuonsCommonCfg(flags, suff="")
Definition: MuonsCommonConfig.py:13
python.TauCommonConfig.AddTauIDDecorationCfg
def AddTauIDDecorationCfg(flags, **kwargs)
Definition: TauCommonConfig.py:99
python.MCTruthCommonConfig.AddHFAndDownstreamParticlesCfg
def AddHFAndDownstreamParticlesCfg(flags, **kwargs)
Add electrons, photons, and their downstream particles in a special collection def addEgammaAndDownst...
Definition: MCTruthCommonConfig.py:296
python.MCTruthCommonConfig.AddTruthCollectionNavigationDecorationsCfg
def AddTruthCollectionNavigationDecorationsCfg(flags, TruthCollections=[], prefix='')
Definition: MCTruthCommonConfig.py:335
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun3Cfg
def TriggerMatchingCommonRun3Cfg(flags, **kwargs)
Definition: TriggerMatchingCommonConfig.py:129
python.InDetCommonConfig.InDetCommonCfg
def InDetCommonCfg(flags, **kwargs)
Definition: InDetCommonConfig.py:16
python.TauCommonConfig.AddDiTauLowPtCfg
def AddDiTauLowPtCfg(flags, **kwargs)
Definition: TauCommonConfig.py:84
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:14
PFCfg.PFGlobalFlowElementLinkingCfg
def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
Definition: PFCfg.py:472
python.METCommonConfig.METCommonCfg
def METCommonCfg(ConfigFlags)
Definition: METCommonConfig.py:11