ATLAS Offline Software
PhysCommonConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2025 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 AthenaCommon.Logging import logging
11 msg = logging.getLogger('PHYSCommonConfig')
12 
13 def PhysCommonAugmentationsCfg(flags,**kwargs):
14  """Configure the common augmentation"""
15  acc = ComponentAccumulator()
16 
17  # MC truth
18  if flags.Input.isMC:
19  from DerivationFrameworkMCTruth.MCTruthCommonConfig import (
20  AddStandardTruthContentsCfg,
21  AddHFAndDownstreamParticlesCfg,
22  AddMiniTruthCollectionLinksCfg,
23  AddPVCollectionCfg,
24  TruthClassificationAugmentationsCfg)
25  acc.merge(TruthClassificationAugmentationsCfg(flags))
26  from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import DFCommonTruthCharmToolCfg
27  PhysCommonTruthCharmTool = acc.getPrimaryAndMerge(DFCommonTruthCharmToolCfg(
28  flags,
29  name = "PhysCommonTruthCharmTool"))
30  CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
31  acc.addEventAlgo(CommonAugmentation("PhysCommonTruthCharmKernel",AugmentationTools=[PhysCommonTruthCharmTool]))
32  acc.merge(AddHFAndDownstreamParticlesCfg(flags))
33  acc.merge(AddStandardTruthContentsCfg
34  (flags,
35  navInputCollections = ["TruthElectrons",
36  "TruthMuons",
37  "TruthPhotons",
38  "TruthTaus",
39  "TruthNeutrinos",
40  "TruthBSM",
41  "TruthBottom",
42  "TruthTop",
43  "TruthBoson",
44  "TruthCharm",
45  "TruthHFWithDecayParticles"]))
46  # Re-point links on reco objects
47  acc.merge(AddMiniTruthCollectionLinksCfg(flags))
48  acc.merge(AddPVCollectionCfg(flags))
49 
50  # InDet, Muon, Egamma common augmentations
51  from DerivationFrameworkInDet.InDetCommonConfig import InDetCommonCfg
52  from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
53  from DerivationFrameworkEGamma.EGammaCommonConfig import EGammaCommonCfg
54  # TODO: need to find the new flags equivalent for the missing settings below, then we can
55  # drop these kwargs and do everything via the flags
56  acc.merge(InDetCommonCfg(flags,
57  DoVertexFinding = flags.Tracking.doVertexFinding,
58  AddPseudoTracks = flags.Tracking.doPseudoTracking,
59  DecoLRTTTVA = False,
60  DoR3LargeD0 = flags.Tracking.doLargeD0,
61  StoreSeparateLargeD0Container = flags.Tracking.storeSeparateLargeD0Container,
62  MergeLRT = False))
63  acc.merge(MuonsCommonCfg(flags))
64  acc.merge(EGammaCommonCfg(flags))
65  # Jets, di-taus, tau decorations, flavour tagging, MET association
66  from DerivationFrameworkJetEtMiss.JetCommonConfig import JetCommonCfg
67  from DerivationFrameworkTau.TauCommonConfig import (AddDiTauLowPtCfg, AddMuonRemovalTauAODReRecoAlgCfg, AddTauIDDecorationCfg, AddDiTauChargeDecoratorCfg, AddDiTauIDDecorationCfg)
68  from DerivationFrameworkJetEtMiss.METCommonConfig import METCommonCfg
69  acc.merge(JetCommonCfg(flags))
70  #We also need to build links between the newly created jet constituents (GlobalFE)
71  #and electrons,photons,muons and taus
72  from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
73  acc.merge(PFGlobalFlowElementLinkingCfg(flags))
74  acc.merge(AddDiTauLowPtCfg(flags))
75  acc.merge(AddMuonRemovalTauAODReRecoAlgCfg(flags))
76  # eVeto WP and DeepSet ID for taus and muon-subtracted taus
77  acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets"))
78  acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets_MuonRM"))
79  # add ID score for ditau
80  acc.merge(AddDiTauIDDecorationCfg(flags, DiTauContainerName="DiTauJets"))
81  # for AOD produced before 24.0.17, the electron removal tau is not available
82  if flags.Tau.TauEleRM_isAvailable:
83  acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets_EleRM"))
84  # ditau Charge
85  acc.merge(AddDiTauChargeDecoratorCfg(flags, DiTauContainerName="DiTauJets"))
86  acc.merge(AddDiTauChargeDecoratorCfg(flags, DiTauContainerName="DiTauJetsLowPt"))
87  if flags.Reco.EnableBTagging:
88  from BTagging.FlavorTaggingConfig import FlavorTaggingCfg
89  acc.merge(FlavorTaggingCfg(flags, "AntiKt4EMPFlowJets"))
90  acc.merge(FlavorTaggingCfg(flags, "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"))
91 
92  acc.merge(METCommonCfg(flags))
93 
94  # Trigger matching
95  if flags.Reco.EnableTrigger or flags.Trigger.triggerConfig == 'INFILE':
96  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
97  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2ToRun3Cfg
98  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun3Cfg
99  # requires some wrangling due to the difference between run 2 and 3
100  triggerListsHelper = kwargs['TriggerListsHelper']
101  if flags.Trigger.EDMVersion == 2:
102  # NOTE: Once Run-2 -> Run-3 trigger navigation is validated and doEDMVersionConversion is on by default, we will only want to do ONE of
103  # TriggerMatchingCommonRun2Cfg(s) OR TriggerMatchingCommonRun2ToRun3Cfg
104  # Otherwise we are doubling up on the analysis trigger data in both the Run-2 and Run-3 formats.
105 
106  # This sets up the Run-2 style matching during the derivation process
108  flags,
109  name = "PhysCommonTrigMatchNoTau",
110  OutputContainerPrefix = "TrigMatch_",
111  ChainNames = triggerListsHelper.Run2TriggerNamesNoTau))
113  flags,
114  name = "PhysCommonTrigMatchTau",
115  OutputContainerPrefix = "TrigMatch_",
116  ChainNames = triggerListsHelper.Run2TriggerNamesTau,
117  DRThreshold = 0.2))
118  # This sets up a conversion of the Run-2 trigger navigation to the Run-3 style,
119  # followed by Run-3 style navigation slimming for trigger-matching from DAOD.
120  # This function is a noop if doEDMVersionConversion=False
122  flags,
123  TriggerList = triggerListsHelper.Run2TriggerNamesNoTau +
124  triggerListsHelper.Run2TriggerNamesTau))
125  if flags.Trigger.EDMVersion == 3:
126  # This sets up the Run-3 style navigation slimming for trigger-matching from DAOD
128  flags, TriggerList = triggerListsHelper.Run3TriggerNames))
129 
130  return acc
131 
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.FlavorTaggingConfig.FlavorTaggingCfg
def FlavorTaggingCfg(cfgFlags, JetCollection, pv_col='PrimaryVertices', trackAugmenterPrefix=None, fast=False, JetTrackAssociator='TracksForBTagging', trackCollection='InDetTrackParticles')
Definition: FlavorTaggingConfig.py:76
python.TauCommonConfig.AddDiTauChargeDecoratorCfg
def AddDiTauChargeDecoratorCfg(flags, **kwargs)
Definition: TauCommonConfig.py:234
python.MCTruthCommonConfig.AddMiniTruthCollectionLinksCfg
def AddMiniTruthCollectionLinksCfg(flags, **kwargs)
Definition: MCTruthCommonConfig.py:445
python.MCTruthCommonConfig.AddPVCollectionCfg
def AddPVCollectionCfg(flags)
Definition: MCTruthCommonConfig.py:332
python.TauCommonConfig.AddMuonRemovalTauAODReRecoAlgCfg
def AddMuonRemovalTauAODReRecoAlgCfg(flags, **kwargs)
Definition: TauCommonConfig.py:255
python.TriggerMatchingCommonConfig.TriggerMatchingCommonRun2ToRun3Cfg
def TriggerMatchingCommonRun2ToRun3Cfg(flags, **kwargs)
Definition: TriggerMatchingCommonConfig.py:106
python.EGammaCommonConfig.EGammaCommonCfg
def EGammaCommonCfg(ConfigFlags)
Definition: EGammaCommonConfig.py:15
python.TauCommonConfig.AddDiTauIDDecorationCfg
def AddDiTauIDDecorationCfg(flags, **kwargs)
Definition: TauCommonConfig.py:159
python.MuonsCommonConfig.MuonsCommonCfg
def MuonsCommonCfg(flags, suff="")
Definition: MuonsCommonConfig.py:13
python.TauCommonConfig.AddTauIDDecorationCfg
def AddTauIDDecorationCfg(flags, **kwargs)
Definition: TauCommonConfig.py:186
python.TruthDerivationToolsConfig.DFCommonTruthCharmToolCfg
def DFCommonTruthCharmToolCfg(flags, name)
Definition: TruthDerivationToolsConfig.py:36
python.MCTruthCommonConfig.TruthClassificationAugmentationsCfg
def TruthClassificationAugmentationsCfg(flags, **kwargs)
Definition: MCTruthCommonConfig.py:96
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.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:145
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:13
PFCfg.PFGlobalFlowElementLinkingCfg
def PFGlobalFlowElementLinkingCfg(inputFlags, **kwargs)
Definition: PFCfg.py:472
python.METCommonConfig.METCommonCfg
def METCommonCfg(ConfigFlags)
Definition: METCommonConfig.py:11