ATLAS Offline Software
Loading...
Searching...
No Matches
python.PHYS Namespace Reference

Functions

 PHYSKernelCfg (flags, name='PHYSKernel', **kwargs)
 PHYSCoreCfg (flags, name_tag='PHYS', StreamName='StreamDAOD_PHYS', TriggerListsHelper=None, addExtraVariables=None)
 PHYSCfg (flags)

Variables

 logPHYS = logging.getLogger('PHYS')

Function Documentation

◆ PHYSCfg()

python.PHYS.PHYSCfg ( flags)

Definition at line 260 of file PHYS.py.

260def PHYSCfg(flags):
261
262 logPHYS.info('****************** STARTING PHYS *****************')
263
264 stream_name = 'StreamDAOD_PHYS'
265 acc = ComponentAccumulator()
266
267 # Get the lists of triggers needed for trigger matching.
268 # This is needed at this scope (for the slimming) and further down in the config chain
269 # for actually configuring the matching, so we create it here and pass it down
270 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
271 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
272 PHYSTriggerListsHelper = TriggerListsHelper(flags)
273
274 # Common augmentations
275 acc.merge(PHYSKernelCfg(
276 flags,
277 name="PHYSKernel",
278 StreamName = stream_name,
279 TriggerListsHelper = PHYSTriggerListsHelper
280 ))
281 # PHYS content
282 acc.merge(PHYSCoreCfg(
283 flags,
284 "PHYS",
285 StreamName = stream_name,
286 TriggerListsHelper = PHYSTriggerListsHelper
287 ))
288
289 return acc

◆ PHYSCoreCfg()

python.PHYS.PHYSCoreCfg ( flags,
name_tag = 'PHYS',
StreamName = 'StreamDAOD_PHYS',
TriggerListsHelper = None,
addExtraVariables = None )

Definition at line 63 of file PHYS.py.

63def PHYSCoreCfg(flags, name_tag='PHYS', StreamName='StreamDAOD_PHYS', TriggerListsHelper=None, addExtraVariables=None):
64
65 if TriggerListsHelper is None:
66 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
67 TriggerListsHelper = TriggerListsHelper(flags)
68
69 acc = ComponentAccumulator()
70
71
72 from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
73 acc.merge(HiggsAugmentationAlgsCfg(flags))
74
75
77 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
78 acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite = False, stream_name = StreamName))
79
80
81 from LeptonTaggers.LeptonTaggersConfig import DecoratePLITAlgsCfg
82 acc.merge(DecoratePLITAlgsCfg(flags))
83
84 #===================================================
85 # HEAVY FLAVOR CLASSIFICATION FOR ttbar+jets EVENTS
86 #===================================================
87 from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
88 acc.merge(HFClassificationCommonCfg(flags))
89
90 # ============================
91 # Define contents of the format
92 # =============================
93 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
94 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
95 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
96
97 PHYSSlimmingHelper = SlimmingHelper(name_tag+"SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
98 PHYSSlimmingHelper.SmartCollections = ["EventInfo",
99 "Electrons",
100 "Photons",
101 "Muons",
102 "PrimaryVertices",
103 "InDetTrackParticles",
104 "AntiKt4EMTopoJets",
105 "AntiKt4EMPFlowJets",
106 "MET_Baseline_AntiKt4EMTopo",
107 "MET_Baseline_AntiKt4EMPFlow",
108 "TauJets",
109 "TauJets_MuonRM",
110 "DiTauJets",
111 "DiTauJetsLowPt",
112 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
113 "AntiKtVR30Rmax4Rmin02PV0TrackJets",
114 ]
115 if flags.Tau.TauEleRM_isAvailable:
116 PHYSSlimmingHelper.SmartCollections.append("TauJets_EleRM")
117
118 excludedVertexAuxData = "-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV"
119 StaticContent = []
120 StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"]
121 StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData]
122 StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"]
123 StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData]
124 StaticContent += ["xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"]
125 StaticContent += ["xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData]
126 StaticContent += ["xAOD::VertexContainer#NVSI_SecVrt_Tight"]
127 StaticContent += ["xAOD::VertexAuxContainer#NVSI_SecVrt_TightAux."+excludedVertexAuxData]
128
129 PHYSSlimmingHelper.StaticContent = StaticContent
130
131 # Extra content
132 PHYSSlimmingHelper.ExtraVariables += ["AntiKt4EMTopoJets.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.IsoFixedCone5PtPUsub",
133 "AntiKt4EMPFlowJets.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.isJvtHS.isJvtPU.IsoFixedCone5PtPUsub",
134 "TruthPrimaryVertices.t.x.y.z",
135 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
136 "EventInfo.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ.HF_Classification.HF_SimpleClassification.HF_ClassificationC5J20.HF_ClassificationC5J25.HF_ClassificationC15J20.HF_ClassificationC15J25",
137 "TauJets.dRmax.etOverPtLeadTrk",
138 "TauJets_MuonRM.dRmax.etOverPtLeadTrk",
139 "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET.ex.ey",
140 "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht.ex.ey",
141 "HLT_AnomDet_ComboHypo.adScore"]
142
143 if addExtraVariables:
144 PHYSSlimmingHelper.ExtraVariables += addExtraVariables
145
146 if flags.Tau.TauEleRM_isAvailable:
147 PHYSSlimmingHelper.ExtraVariables += ["TauJets_EleRM.dRmax.etOverPtLeadTrk"]
148
149 # IFF extra content
150 from LeptonTaggers.LeptonTaggersConfig import GetExtraPLITVariablesForDxAOD
151 PHYSSlimmingHelper.ExtraVariables += GetExtraPLITVariablesForDxAOD()
152
153 # Truth extra content
154 if flags.Input.isMC:
155
156 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
157 addTruth3ContentToSlimmerTool(PHYSSlimmingHelper)
158 PHYSSlimmingHelper.AllVariables += ['TruthLHEParticles','InTimeAntiKt4TruthJets','OutOfTimeAntiKt4TruthJets']
159 PHYSSlimmingHelper.ExtraVariables += ["Electrons.TruthLink",
160 "Muons.TruthLink",
161 "Photons.TruthLink",
162 "AntiKt4TruthDressedWZJets.IsoFixedCone5Pt.HFHadronOriginID",
163 "TruthHFWithDecayParticles.prodVtxLink.prodVtxLink.prodVtxLink.decayVtxLink.decayVtxLink.decayVtxLink.parentLinks.childLinks.m.px.py.pz.e.pdgId.Classification.uid.classifierParticleOrigin.classifierParticleType.classifierParticleOutCome.status",
164 "TruthHFWithDecayVertices.incomingParticleLinks.outgoingParticleLinks.uid.status.x.y.z.t",
165 "TruthCharm.prodVtxLink.prodVtxLink.prodVtxLink.decayVtxLink.decayVtxLink.decayVtxLink.parentLinks.childLinks.m.px.py.pz.e.pdgId.Classification.uid.classifierParticleOrigin.classifierParticleType.classifierParticleOutCome.status.barcode.polarizationPhi.polarizationTheta",
166 "TruthPileupParticles.prodVtxLink.prodVtxLink.prodVtxLink.decayVtxLink.decayVtxLink.decayVtxLink.m.px.py.pz.e.pdgId.Classification.uid.classifierParticleOrigin.classifierParticleType.classifierParticleOutCome.status.barcode.PVz.pileupEventNumber.parentHadronID"]
167
168 from DerivationFrameworkMCTruth.MCTruthCommonConfig import AddTauAndDownstreamParticlesCfg
169 acc.merge(AddTauAndDownstreamParticlesCfg(flags))
170 PHYSSlimmingHelper.ExtraVariables += ["TruthTausWithDecayParticles.prodVtxLink.prodVtxLink.prodVtxLink.decayVtxLink.decayVtxLink.decayVtxLink.m.px.py.pz.e.pdgId.Classification.uid.classifierParticleOrigin.classifierParticleType.classifierParticleOutCome.status",
171 "TruthTausWithDecayVertices.incomingParticleLinks.outgoingParticleLinks.uid.status.x.y.z.t"]
172
173 #Truth jet matching variables - largeR
174 PHYSSlimmingHelper.ExtraVariables += ["AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthJetMass",
175 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthJetPt",
176 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthJetEta",
177 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthJetPhi",
178 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthJetDR",
179 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthJetGF",
180 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthGroomedJetMass",
181 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10TruthLabel_R22v1_MatchedTruthGroomedJetPt",
182 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_R22v1_MatchedTruthJetMass",
183 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_R22v1_MatchedTruthJetPt",
184 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_R22v1_MatchedTruthJetEta",
185 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_R22v1_MatchedTruthJetPhi",
186 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_MatchedTruthJetDR",
187 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_MatchedTruthJetGF",
188 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_R22v1_MatchedTruthGroomedJetMass",
189 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.R10WZTruthLabel_R22v1_MatchedTruthGroomedJetPt"]
190
191 #Truth jet matching variables - smallR
192 PHYSSlimmingHelper.ExtraVariables += ["AntiKt4EMPFlowJets.R4TruthLabel_MatchedTruthJetMass",
193 "AntiKt4EMPFlowJets.R4TruthLabel_MatchedTruthJetPt",
194 "AntiKt4EMPFlowJets.R4TruthLabel_MatchedTruthJetEta",
195 "AntiKt4EMPFlowJets.R4TruthLabel_MatchedTruthJetPhi",
196 "AntiKt4EMPFlowJets.R4TruthLabel_MatchedTruthJetDR",
197 "AntiKt4EMPFlowJets.R4TruthLabel_MatchedTruthJetGF"]
198
199
200 from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
201 setupHiggsSlimmingVariables(flags, PHYSSlimmingHelper)
202
203
204 PHYSSlimmingHelper.AllVariables += [ 'AFPSiHitContainer', 'AFPToFHitContainer' ]
205
206
207 PHYSSlimmingHelper.AppendToDictionary.update({'MET_Core_AntiKt4EMPFlowHR':'xAOD::MissingETContainer', 'MET_Core_AntiKt4EMPFlowHRAux':'xAOD::MissingETAuxContainer',
208 'METAssoc_AntiKt4EMPFlowHR':'xAOD::MissingETAssociationMap', 'METAssoc_AntiKt4EMPFlowHRAux':'xAOD::MissingETAuxAssociationMap'})
209
210 PHYSSlimmingHelper.AllVariables += ['METAssoc_AntiKt4EMPFlowHR']
211
212 PHYSSlimmingHelper.ExtraVariables += ['Muons.UEcorr_Pt','Electrons.UEcorr_Pt','MET_Core_AntiKt4EMPFlowHR.name.mpx.mpy.sumet.source']
213
214 # Trigger content
215 PHYSSlimmingHelper.IncludeTriggerNavigation = False
216 PHYSSlimmingHelper.IncludeJetTriggerContent = False
217 PHYSSlimmingHelper.IncludeMuonTriggerContent = False
218 PHYSSlimmingHelper.IncludeEGammaTriggerContent = False
219 PHYSSlimmingHelper.IncludeTauTriggerContent = False
220 PHYSSlimmingHelper.IncludeEtMissTriggerContent = False
221 PHYSSlimmingHelper.IncludeBJetTriggerContent = False
222 PHYSSlimmingHelper.IncludeBPhysTriggerContent = False
223 PHYSSlimmingHelper.IncludeMinBiasTriggerContent = False
224 # Compact b-jet trigger matching info
225 PHYSSlimmingHelper.IncludeBJetTriggerByYearContent = True
226
227 # Trigger matching
228 # Run 2
229 if flags.Trigger.EDMVersion == 2:
230 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
231 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSSlimmingHelper,
232 OutputContainerPrefix = "TrigMatch_",
233 TriggerList = TriggerListsHelper.Run2TriggerNamesTau)
234 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSSlimmingHelper,
235 OutputContainerPrefix = "TrigMatch_",
236 TriggerList = TriggerListsHelper.Run2TriggerNamesNoTau)
237 # Run 3, or Run 2 with navigation conversion
238 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
239 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
240 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSSlimmingHelper)
241
242 # L1 trigger objects
243 from Campaigns.Utils import getDataYear
244 if getDataYear(flags) >= 2024:
245 # Run 3 with Phase I jet RoIs.
246 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddjFexRoIsToSlimmingHelper
247 AddjFexRoIsToSlimmingHelper(SlimmingHelper = PHYSSlimmingHelper)
248 elif getDataYear(flags) >= 2015:
249 # Run 2 and early Run 3, legacy L1 RoIs
250 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddLegacyL1JetRoIsToSlimmingHelper
251 AddLegacyL1JetRoIsToSlimmingHelper(SlimmingHelper = PHYSSlimmingHelper)
252
253 # Output stream
254 PHYSItemList = PHYSSlimmingHelper.GetItemList()
255 acc.merge(OutputStreamCfg(flags, "DAOD_"+name_tag, ItemList=PHYSItemList, AcceptAlgs=[name_tag+"Kernel"]))
256 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_"+name_tag, AcceptAlgs=[name_tag+"Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
257
258 return acc
259

◆ PHYSKernelCfg()

python.PHYS.PHYSKernelCfg ( flags,
name = 'PHYSKernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for PHYS

Definition at line 17 of file PHYS.py.

17def PHYSKernelCfg(flags, name='PHYSKernel', **kwargs):
18 """Configure the derivation framework driving algorithm (kernel) for PHYS"""
19 acc = ComponentAccumulator()
20
21 from TrkConfig.VertexFindingFlags import VertexSortingSetup
22 if flags.Tracking.PriVertex.sortingSetup is VertexSortingSetup.GNNSorting:
23 from DerivationFrameworkPhys.GNNVertexConfig import GNNVertexCfg
24 acc.merge(GNNVertexCfg(flags))
25
26 # Common augmentations
27 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
28 acc.merge(PhysCommonAugmentationsCfg(
29 flags,
30 TriggerListsHelper = kwargs['TriggerListsHelper']
31 ))
32
33 # Thinning tools
34 # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
35 nametag = name.replace('Kernel', '') #get the name to label the tools below such that other formats can use this KernelCfg
36 thinningToolsArgs = {
37 'TrackParticleThinningToolName' : nametag+"TrackParticleThinningTool",
38 'MuonTPThinningToolName' : nametag+"MuonTPThinningTool",
39 'TauJetThinningToolName' : nametag+"TauJetThinningTool",
40 'TauJets_MuonRMThinningToolName' : nametag+"TauJets_MuonRMThinningTool",
41 'DiTauThinningToolName' : nametag+"DiTauThinningTool",
42 'DiTauTPThinningToolName' : nametag+"DiTauTPThinningTool",
43 'DiTauLowPtThinningToolName' : nametag+"DiTauLowPtThinningTool",
44 'DiTauLowPtTPThinningToolName' : nametag+"DiTauLowPtTPThinningTool",
45 }
46 # for AOD produced before 24.0.17, the electron removal tau is not available
47 if flags.Tau.TauEleRM_isAvailable:
48 thinningToolsArgs['TauJets_EleRMThinningToolName'] = nametag+"TauJets_EleRMThinningTool"
49 # Configure the thinning tools
50 from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
51 acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
52 # Get them from the CA so they can be added to the kernel
53 thinningTools = []
54 for key in thinningToolsArgs:
55 thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
56
57 # The kernel algorithm itself
58 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
59 acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
60 return acc
61
62

Variable Documentation

◆ logPHYS

python.PHYS.logPHYS = logging.getLogger('PHYS')

Definition at line 14 of file PHYS.py.