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()

PHYSCfg ( flags)

Definition at line 247 of file PHYS.py.

247def PHYSCfg(flags):
248
249 logPHYS.info('****************** STARTING PHYS *****************')
250
251 stream_name = 'StreamDAOD_PHYS'
252 acc = ComponentAccumulator()
253
254 # Get the lists of triggers needed for trigger matching.
255 # This is needed at this scope (for the slimming) and further down in the config chain
256 # for actually configuring the matching, so we create it here and pass it down
257 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
258 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
259 PHYSTriggerListsHelper = TriggerListsHelper(flags)
260
261 # Common augmentations
262 acc.merge(PHYSKernelCfg(
263 flags,
264 name="PHYSKernel",
265 StreamName = stream_name,
266 TriggerListsHelper = PHYSTriggerListsHelper
267 ))
268 # PHYS content
269 acc.merge(PHYSCoreCfg(
270 flags,
271 "PHYS",
272 StreamName = stream_name,
273 TriggerListsHelper = PHYSTriggerListsHelper
274 ))
275
276 return acc

◆ PHYSCoreCfg()

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

Definition at line 58 of file PHYS.py.

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

◆ PHYSKernelCfg()

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

Variable Documentation

◆ logPHYS

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

Definition at line 14 of file PHYS.py.