ATLAS Offline Software
Loading...
Searching...
No Matches
PhysCommonConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 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
8from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
9from AthenaConfiguration.Enums import LHCPeriod
10from AthenaCommon.Logging import logging
11msg = logging.getLogger('PHYSCommonConfig')
12
13def PhysCommonAugmentationsCfg(flags,**kwargs):
14 """Configure the common augmentation"""
15 acc = ComponentAccumulator()
16
17 from TrkConfig.VertexFindingFlags import VertexSortingSetup
18 if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.PVNNSorting:
19 from DerivationFrameworkPhys.DerivationPrimaryVertexConfig import PVNNVertexCfg
20 acc.merge(PVNNVertexCfg(flags))
21 elif flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.HGamNNSorting:
22 from DerivationFrameworkPhys.DerivationPrimaryVertexConfig import HGamNNVertexCfg
23 acc.merge(HGamNNVertexCfg(flags))
24
25 from DerivationFrameworkTau.TauCommonConfig import AddTauMassDecoratorCfg
26 # overwrite the tau mass from 0 to the reconstructed visible mass. Needs to be done before "AddStandardTruthContentsCfg"
27 acc.merge(AddTauMassDecoratorCfg(flags, TauContainerName="TauJets"))
28 if flags.Tau.TauEleRM_isAvailable:
29 acc.merge(AddTauMassDecoratorCfg(flags, TauContainerName="TauJets_EleRM"))
30
31 # MC truth
32 if flags.Input.isMC:
33 from DerivationFrameworkMCTruth.MCTruthCommonConfig import (
34 AddPhysTruthContentsCfg,
35 AddMiniTruthCollectionLinksCfg)
36 acc.merge(AddPhysTruthContentsCfg(flags))
37 # Re-point links on reco objects
38 acc.merge(AddMiniTruthCollectionLinksCfg(flags))
39
40 # InDet, Muon, Egamma common augmentations
41 from DerivationFrameworkInDet.InDetCommonConfig import InDetCommonCfg
42 from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
43 from DerivationFrameworkEGamma.EGammaCommonConfig import EGammaCommonCfg
44 # TODO: need to find the new flags equivalent for the missing settings below, then we can
45 # drop these kwargs and do everything via the flags
46 acc.merge(InDetCommonCfg(flags,
47 DoVertexFinding = flags.Tracking.doVertexFinding,
48 AddPseudoTracks = flags.Tracking.doPseudoTracking,
49 DecoLRTTTVA = False,
50 DoR3LargeD0 = flags.Tracking.doLargeD0,
51 StoreSeparateLargeD0Container = flags.Tracking.storeSeparateLargeD0Container,
52 MergeLRT = False))
53 acc.merge(MuonsCommonCfg(flags))
54 acc.merge(EGammaCommonCfg(flags))
55 # Jets, di-taus, tau decorations, flavour tagging, MET association
56 from DerivationFrameworkJetEtMiss.JetCommonConfig import JetCommonCfg
57 from DerivationFrameworkTau.TauCommonConfig import (AddMuonRemovalTauAODReRecoAlgCfg, AddTauIDDecorationCfg, AddTauTESCompatibilityDecorationCfg)
58 from DerivationFrameworkTau.DiTauCommonConfig import (AddDiTauLowPtCfg, AddDiTauChargeDecoratorCfg, AddDiTauIDDecorationCfg)
59 from DerivationFrameworkJetEtMiss.METCommonConfig import METCommonCfg
60 from DerivationFrameworkJetEtMiss.METCommonConfig import HadRecoilMETCfg
61 acc.merge(JetCommonCfg(flags))
62 #We also need to build links between the newly created jet constituents (GlobalFE)
63 #and electrons,photons,muons and taus
64 from eflowRec.PFCfg import PFGlobalFlowElementLinkingCfg
65 acc.merge(PFGlobalFlowElementLinkingCfg(flags))
66 acc.merge(AddDiTauLowPtCfg(flags))
67 acc.merge(AddMuonRemovalTauAODReRecoAlgCfg(flags))
68 # eVeto WP and DeepSet ID for taus and muon-subtracted taus
69 acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets"))
70 acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets_MuonRM"))
71 # add TES compatibility check for taus
72 acc.merge(AddTauTESCompatibilityDecorationCfg(flags, TauContainerName="TauJets"))
73 acc.merge(AddTauTESCompatibilityDecorationCfg(flags, TauContainerName="TauJets_MuonRM"))
74 # add ID score for ditau
75 acc.merge(AddDiTauIDDecorationCfg(flags, DiTauContainerName="DiTauJets"))
76 # for AOD produced before 24.0.17, the electron removal tau is not available
77 if flags.Tau.TauEleRM_isAvailable:
78 acc.merge(AddTauIDDecorationCfg(flags, TauContainerName="TauJets_EleRM"))
79 acc.merge(AddTauTESCompatibilityDecorationCfg(flags, TauContainerName="TauJets_EleRM"))
80 # ditau Charge
81 acc.merge(AddDiTauChargeDecoratorCfg(flags, DiTauContainerName="DiTauJets"))
82 acc.merge(AddDiTauChargeDecoratorCfg(flags, DiTauContainerName="DiTauJetsLowPt"))
83 if flags.Reco.EnableBTagging:
84 from BTagging.FlavorTaggingConfig import FlavorTaggingCfg
85 acc.merge(FlavorTaggingCfg(flags, "AntiKt4EMPFlowJets"))
86 acc.merge(FlavorTaggingCfg(flags, "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"))
87 if flags.BTagging.RunNewVrtSecInclusive:
88 from NewVrtSecInclusiveTool.NewVrtSecInclusiveAlgConfig import (
89 NewVrtSecInclusiveAlgTightCfg
90 )
91 acc.merge(NewVrtSecInclusiveAlgTightCfg(flags))
92 if flags.GeoModel.Run >= LHCPeriod.Run4:
93 acc.merge(FlavorTaggingCfg(flags, "AntiKt4EMTopoJets"))
94
95 acc.merge(METCommonCfg(flags))
96 acc.merge(HadRecoilMETCfg(flags))
97
98 from AssociationUtils.AssociationUtilsConfig import FEAssociationCfg
99 acc.merge(FEAssociationCfg(flags,
100 SmallRJetChargedFELinksDecorKey="",
101 SmallRJetNeutralFELinksDecorKey="",
102 LargeRJetChargedFELinksDecorKey="",
103 LargeRJetNeutralFELinksDecorKey=""))
104
105 # Trigger matching and postprocessing
106 if flags.Reco.EnableTrigger or flags.Trigger.triggerConfig == 'INFILE':
107 from JetTagDerivationUtils.TrigBTagCopierConfig import TrigBTagCopierAlgCfg
108 acc.merge(TrigBTagCopierAlgCfg(flags))
109
110 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
111 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2ToRun3Cfg
112 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun3Cfg
113 # requires some wrangling due to the difference between run 2 and 3
114 triggerListsHelper = kwargs['TriggerListsHelper']
115 if flags.Trigger.EDMVersion == 2:
116 # NOTE: Once Run-2 -> Run-3 trigger navigation is validated and doEDMVersionConversion is on by default, we will only want to do ONE of
117 # TriggerMatchingCommonRun2Cfg(s) OR TriggerMatchingCommonRun2ToRun3Cfg
118 # Otherwise we are doubling up on the analysis trigger data in both the Run-2 and Run-3 formats.
119
120 # This sets up the Run-2 style matching during the derivation process
121 acc.merge(TriggerMatchingCommonRun2Cfg(
122 flags,
123 name = "PhysCommonTrigMatchNoTau",
124 OutputContainerPrefix = "TrigMatch_",
125 ChainNames = triggerListsHelper.Run2TriggerNamesNoTau))
126 acc.merge(TriggerMatchingCommonRun2Cfg(
127 flags,
128 name = "PhysCommonTrigMatchTau",
129 OutputContainerPrefix = "TrigMatch_",
130 ChainNames = triggerListsHelper.Run2TriggerNamesTau,
131 DRThreshold = 0.2))
132 # This sets up a conversion of the Run-2 trigger navigation to the Run-3 style,
133 # followed by Run-3 style navigation slimming for trigger-matching from DAOD.
134 # This function is a noop if doEDMVersionConversion=False
135 acc.merge(TriggerMatchingCommonRun2ToRun3Cfg(
136 flags,
137 TriggerList = triggerListsHelper.Run2TriggerNamesNoTau +
138 triggerListsHelper.Run2TriggerNamesTau))
139 if flags.Trigger.EDMVersion == 3:
140 # This sets up the Run-3 style navigation slimming for trigger-matching from DAOD
141 acc.merge(TriggerMatchingCommonRun3Cfg(
142 flags, TriggerList = triggerListsHelper.Run3TriggerNames))
143
144 return acc
145
PhysCommonAugmentationsCfg(flags, **kwargs)