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