ATLAS Offline Software
Loading...
Searching...
No Matches
PHYSLITE.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2#====================================================================
3# DAOD_PHYSLITE.py
4# This defines DAOD_PHYSLITE, an unskimmed DAOD format for Run 3.
5# It contains the variables and objects needed for the large majority
6# of physics analyses in ATLAS.
7# It requires the flag PHYSLITE in Derivation_tf.py
8#====================================================================
9
10from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11from AthenaConfiguration.ComponentFactory import CompFactory
12from AthenaConfiguration.Enums import MetadataCategory
13from GoodRunsLists.GoodRunsListsDictionary import getGoodRunsLists
14
15
16
17def CPAlgorithmsCfg(flags):
18 """do the CP algorithm configuration for PHYSLITE"""
19
20 from AthenaCommon.Logging import logging
21 logPLCPAlgCfg = logging.getLogger('PLCPAlgCfg')
22 logPLCPAlgCfg.info('****************** STARTING PHYSLITE CPAlgorithmsCfg *****************')
23
24 FixedElDict = {}
25 FixedPhDict = {}
26 from egammaAlgs.egammaAODFixesConfig import runAODFix
27 doneFix, fixes = runAODFix(flags)
28 logPLCPAlgCfg.info(f'Existing egamma AOD fixes for timing cut issue : {fixes}')
29 if 'egammatopoIsoFix' in fixes:
30 FixedElDict.update({"ElectronIsolationCorrectionAlg.isolationCorrectionTool.FixTimingIssueInCore": False})
31 FixedPhDict.update({"PhotonIsolationCorrectionAlg.isolationCorrectionTool.FixTimingIssueInCore": False})
32 if 'egClusterL2_3Fix' in fixes:
33 FixedElDict.update({"ElectronCalibrationAndSmearingAlg.calibrationAndSmearingTool.FixForMissingCells": False})
34 FixedPhDict.update({"PhotonCalibrationAndSmearingAlg.calibrationAndSmearingTool.FixForMissingCells": False})
35
36 from AnalysisAlgorithmsConfig.ConfigFactory import ConfigFactory
37 from AnalysisAlgorithmsConfig.ConfigSequence import ConfigSequence
38 configSeq = ConfigSequence ()
39
40 # create factory object to build block configurations
41 factory = ConfigFactory()
42
43 # Set up the systematics loader/handler algorithm:
44 subConfig = factory.makeConfig ('CommonServices')
45 subConfig.setOptionValue ('.runSystematics', False)
46 subConfig.setOptionValue ('.fixDAODTruthRecord', False)
47 configSeq += subConfig
48
49 # Disable expert-mode warnings
50 import warnings
51 from AnalysisAlgorithmsConfig.ConfigAccumulator import ExpertModeWarning
52 warnings.simplefilter('ignore', ExpertModeWarning)
53
54 # setup config and lumicalc files for pile-up tool
55 configSeq += factory.makeConfig ('PileupReweighting')
56
57 # Set up the GRL decoration analysis config
58 configSeq += factory.makeConfig ('EventCleaning')
59 configSeq.setOptionValue ('.noFilter', True)
60 configSeq.setOptionValue ('.GRLDict', getGoodRunsLists())
61
62 # set up the muon analysis algorithm config (must come before electrons and photons to allow FSR collection):
63
64 logPLCPAlgCfg.info('Do Muons')
65
66 subConfig = factory.makeConfig ('Muons')
67 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
68 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
69 configSeq += subConfig
70 subConfig = factory.makeConfig ('Muons.WorkingPoint')
71 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
72 subConfig.setOptionValue ('.selectionName', 'loose')
73 subConfig.setOptionValue ('.trackSelection', False)
74 subConfig.setOptionValue ('.quality', 'Loose')
75 subConfig.setOptionValue ('.isolation', 'NonIso')
76 configSeq += subConfig
77 subConfig = factory.makeConfig ('Thinning')
78 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
79 subConfig.setOptionValue ('.selectionName', 'loose')
80 subConfig.setOptionValue ('.deepCopy', True)
81 subConfig.setOptionValue ('.sortPt', True)
82 subConfig.setOptionValue ('.noUniformSelection', True)
83 subConfig.setOptionValue ('.containerType', 'xAOD::MuonContainer')
84 configSeq += subConfig
85
86 # set up the electron analysis config (For SiHits electrons, use: LooseLHElectronSiHits.NonIso):
87
88 logPLCPAlgCfg.info('Do Electrons')
89
90 subConfig = factory.makeConfig ('Electrons')
91 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
92 subConfig.setOptionValue ('.isolationCorrection', True)
93 subConfig.setOptionValue ('.minPt', 0.)
94 subConfig.setOptionValue ('.decorateSamplingPattern', True)
95 subConfig.setOptionValue ('.decorateEmva', True)
96 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
97 if len(FixedElDict) > 0:
98 subConfig.setOptionValue ('.propertyOverrides', FixedElDict)
99 configSeq += subConfig
100 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
101 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
102 subConfig.setOptionValue ('.selectionName', 'looseLH')
103 subConfig.setOptionValue ('.trackSelection', False)
104 subConfig.setOptionValue ('.identificationWP', 'LooseLH')
105 subConfig.setOptionValue ('.addSelectionToPreselection', False)
106 subConfig.setOptionValue ('.isolationWP', 'NonIso')
107 subConfig.setOptionValue ('.doFSRSelection', True)
108 subConfig.setOptionValue ('.noEffSF', True)
109 configSeq += subConfig
110 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
111 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
112 subConfig.setOptionValue ('.selectionName', 'looseDNN')
113 subConfig.setOptionValue ('.trackSelection', False)
114 subConfig.setOptionValue ('.identificationWP', 'LooseDNN')
115 subConfig.setOptionValue ('.addSelectionToPreselection', False)
116 subConfig.setOptionValue ('.isolationWP', 'NonIso')
117 subConfig.setOptionValue ('.doFSRSelection', True)
118 subConfig.setOptionValue ('.noEffSF', True)
119 configSeq += subConfig
120 subConfig = factory.makeConfig ('Thinning')
121 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
122 subConfig.setOptionValue ('.selectionName', 'looseLH||looseDNN')
123 subConfig.setOptionValue ('.deepCopy', True)
124 subConfig.setOptionValue ('.sortPt', True)
125 subConfig.setOptionValue ('.noUniformSelection', True)
126 subConfig.setOptionValue ('.containerType', 'xAOD::ElectronContainer')
127 configSeq += subConfig
128
129 # So SiHit electrons - should come after the standard selection in order to avoid keeping the same electrons twice
130 subConfig = factory.makeConfig ('Electrons')
131 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
132 subConfig.setOptionValue ('.isolationCorrection', True)
133 subConfig.setOptionValue ('.minPt', 0.)
134 subConfig.setOptionValue ('.postfix', 'SiHit')
135 subConfig.setOptionValue ('.decorateEmva', True)
136 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
137 if len(FixedElDict) > 0:
138 subConfig.setOptionValue ('.propertyOverrides', FixedElDict)
139 configSeq += subConfig
140 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
141 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
142 subConfig.setOptionValue ('.selectionName', 'SiHits')
143 subConfig.setOptionValue ('.trackSelection', False)
144 subConfig.setOptionValue ('.identificationWP', 'SiHitElectron')
145 subConfig.setOptionValue ('.isolationWP', 'NonIso')
146 subConfig.setOptionValue ('.doFSRSelection', True) # needed to veto FSR electrons
147 subConfig.setOptionValue ('.noEffSF', True)
148 subConfig.setOptionValue ('.postfix', 'SiHit')
149 configSeq += subConfig
150 subConfig = factory.makeConfig ('Thinning')
151 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
152 subConfig.setOptionValue ('.selectionName', 'SiHits')
153 subConfig.setOptionValue ('.deepCopy', True)
154 subConfig.setOptionValue ('.sortPt', True)
155 subConfig.setOptionValue ('.noUniformSelection', True)
156 subConfig.setOptionValue ('.containerType', 'xAOD::ElectronContainer')
157 configSeq += subConfig
158
159 # set up the photon analysis config:
160
161 logPLCPAlgCfg.info('Do Photons')
162
163 subConfig = factory.makeConfig ('Photons')
164 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
165 subConfig.setOptionValue ('.recomputeIsEM', False)
166 subConfig.setOptionValue ('.minPt', 0.)
167 subConfig.setOptionValue ('.decorateEmva', True)
168 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
169 if len(FixedPhDict) > 0:
170 subConfig.setOptionValue ('.propertyOverrides', FixedPhDict)
171 configSeq += subConfig
172 subConfig = factory.makeConfig ('Photons.WorkingPoint')
173 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
174 subConfig.setOptionValue ('.selectionName', 'loose')
175 subConfig.setOptionValue ('.qualityWP', 'Loose')
176 subConfig.setOptionValue ('.isolationWP', 'NonIso')
177 subConfig.setOptionValue ('.doFSRSelection', True)
178 subConfig.setOptionValue ('.recomputeIsEM', False)
179 subConfig.setOptionValue ('.noEffSFForID', True)
180 subConfig.setOptionValue ('.noEffSFForIso', True)
181 configSeq += subConfig
182 subConfig = factory.makeConfig ('Thinning')
183 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
184 subConfig.setOptionValue ('.selectionName', 'loose')
185 subConfig.setOptionValue ('.deepCopy', True)
186 subConfig.setOptionValue ('.sortPt', True)
187 subConfig.setOptionValue ('.noUniformSelection', True)
188 subConfig.setOptionValue ('.containerType', 'xAOD::PhotonContainer')
189 configSeq += subConfig
190
191
192
193 # set up the tau analysis algorithm config:
194 # Commented for now due to use of public tools
195 subConfig = factory.makeConfig ('TauJets')
196 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
197 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
198 subConfig.setOptionValue ('.rerunTruthMatching', False)
199 configSeq += subConfig
200 subConfig = factory.makeConfig ('TauJets.WorkingPoint')
201 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
202 subConfig.setOptionValue ('.selectionName', 'baseline')
203 subConfig.setOptionValue ('.quality', 'Baseline')
204 configSeq += subConfig
205 subConfig = factory.makeConfig ('Thinning')
206 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
207 subConfig.setOptionValue ('.selectionName', 'baseline')
208 subConfig.setOptionValue ('.deepCopy', True)
209 subConfig.setOptionValue ('.sortPt', True)
210 subConfig.setOptionValue ('.noUniformSelection', True)
211 subConfig.setOptionValue ('.containerType', 'xAOD::TauJetContainer')
212 configSeq += subConfig
213
214 # set up the jet analysis algorithm config:
215 jetContainer = 'AntiKt4EMPFlowJets'
216 subConfig = factory.makeConfig ('Jets')
217 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
218 subConfig.setOptionValue ('.jetCollection', jetContainer)
219 subConfig.setOptionValue ('.runFJvtSelection', False)
220 subConfig.setOptionValue ('.runJvtSelection', False)
221 subConfig.setOptionValue ('.runNNJvtUpdate', False)
222 subConfig.setOptionValue ('.runUncertainties', False)
223 subConfig.setOptionValue ('.outputTruthLabelIDs', True)
224 configSeq += subConfig
225 subConfig = factory.makeConfig ('Thinning')
226 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
227 subConfig.setOptionValue ('.deepCopy', True)
228 subConfig.setOptionValue ('.sortPt', True)
229 subConfig.setOptionValue ('.noUniformSelection', True)
230 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
231 configSeq += subConfig
232
233 largeRjetContainer='AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets'
234 subConfig = factory.makeConfig ('Jets')
235 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
236 subConfig.setOptionValue ('.jetCollection', largeRjetContainer)
237 subConfig.setOptionValue ('.runGhostMuonAssociation', False)
238 # Disable kinematic selections on large-R jets
239 subConfig.setOptionValue ('.minPt', 0.)
240 subConfig.setOptionValue ('.maxPt', 0.)
241 subConfig.setOptionValue ('.maxRapidity', 0.)
242 subConfig.setOptionValue ('.minMass', 0.)
243 subConfig.setOptionValue ('.maxMass', 0.)
244 subConfig.setOptionValue ('.runUncertainties', False)
245 subConfig.setOptionValue ('.outputTruthLabelIDs', True)
246 configSeq += subConfig
247 subConfig = factory.makeConfig ('Thinning')
248 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
249 subConfig.setOptionValue ('.deepCopy', True)
250 subConfig.setOptionValue ('.sortPt', True)
251 subConfig.setOptionValue ('.noUniformSelection', True)
252 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
253 configSeq += subConfig
254
255 from AnalysisAlgorithmsConfig.ConfigAccumulator import ConfigAccumulator
256 configAccumulator = ConfigAccumulator (dataType=None, algSeq=None,
257 autoconfigFromFlags=flags, noSysSuffix=True, noSystematics=True)
258 configSeq.fullConfigure (configAccumulator)
259 return configAccumulator.CA
260
261
262
263# Main algorithm config
264def PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs):
265 """Configure the derivation framework driving algorithm (kernel) for PHYSLITE"""
266 acc = ComponentAccumulator()
267
268 # This block does the common physics augmentation which isn't needed (or possible) for PHYS->PHYSLITE
269 # Ensure block only runs for AOD input
270 if 'StreamAOD' in flags.Input.ProcessingTags:
271 # Common augmentations
272 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
273 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
274
275 # Thinning tools
276 # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
277 # This differs depending on whether the input is AOD or PHYS
278 # These are needed whatever the input since they are not applied in PHYS
279 thinningToolsArgs = {
280 'ElectronCaloClusterThinningToolName' : "PHYSLITEElectronCaloClusterThinningTool",
281 'PhotonCaloClusterThinningToolName' : "PHYSLITEPhotonCaloClusterThinningTool",
282 'ElectronGSFTPThinningToolName' : "PHYSLITEElectronGSFTPThinningTool",
283 'PhotonGSFTPThinningToolName' : "PHYSLITEPhotonGSFTPThinningTool"
284 }
285 # whereas these are only needed if the input is AOD since they are applied already in PHYS
286 if 'StreamAOD' in flags.Input.ProcessingTags:
287 thinningToolsArgs.update({
288 'TrackParticleThinningToolName' : "PHYSLITETrackParticleThinningTool",
289 'MuonTPThinningToolName' : "PHYSLITEMuonTPThinningTool",
290 'TauJetThinningToolName' : "PHYSLITETauJetThinningTool",
291 'TauJets_MuonRMThinningToolName' : "PHYSLITETauJets_MuonRMThinningTool",
292 'DiTauTPThinningToolName' : "PHYSLITEDiTauTPThinningTool",
293 'DiTauLowPtThinningToolName' : "PHYSLITEDiTauLowPtThinningTool",
294 'DiTauLowPtTPThinningToolName' : "PHYSLITEDiTauLowPtTPThinningTool",
295 })
296 # Configure the thinning tools
297 from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
298 acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
299 # Get them from the CA so they can be added to the kernel
300 thinningTools = []
301 for key in thinningToolsArgs:
302 thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
303
304
305 # Higgs augmentations - 4l vertex, Higgs STXS truth variables, CloseBy isolation correction (for all analyses)
306 # For PhysLite, must run CloseBy BEFORE running analysis sequences to be able to 'pass through' to the shallow copy the added isolation values
307 # Here we only run the augmentation algs
308 # These do not need to be run if PhysLite is run from Phys (i.e. not from 'StreamAOD')
309 if 'StreamAOD' in flags.Input.ProcessingTags:
310 # running from AOD
311
312 from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
313 acc.merge(HiggsAugmentationAlgsCfg(flags))
314
315
316 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
317 acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite = True))
318
319
320 from LeptonTaggers.LeptonTaggersConfig import DecoratePLITAlgsCfg
321 acc.merge(DecoratePLITAlgsCfg(flags))
322
323
324 #==============================================================================
325 # Analysis-level variables
326 #==============================================================================
327
328 # Needed in principle to support MET association when running PHYS->PHYSLITE,
329 # but since this doesn't work for PHYS->PHYSLITE anyway, commenting for now
330 #if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags
331 # from AtlasGeoModel.GeoModelConfig import GeoModelCfg
332 # acc.merge(GeoModelCfg(flags))
333
334 # add CP algorithms to job
335 acc.merge(CPAlgorithmsCfg(flags))
336
337 # Build MET from our analysis objects
338 if 'StreamAOD' in flags.Input.ProcessingTags:
339 from METReconstruction.METAssocCfg import AssocConfig, METAssocConfig
340 from METReconstruction.METAssociatorCfg import getAssocCA
341 associators = [AssocConfig('PFlowJet', 'AnalysisJets'),
342 AssocConfig('Muon', 'AnalysisMuons'),
343 AssocConfig('Ele', 'AnalysisElectrons'),
344 AssocConfig('Gamma', 'AnalysisPhotons'),
345 AssocConfig('Tau', 'AnalysisTauJets'),
346 AssocConfig('Soft', '')]
347 PHYSLITE_cfg = METAssocConfig('AnalysisMET',
348 flags,
349 associators,
350 doPFlow=True,
351 usePFOLinks=True)
352 components_PHYSLITE_cfg = getAssocCA(PHYSLITE_cfg,METName='AnalysisMET')
353 acc.merge(components_PHYSLITE_cfg)
354 elif 'StreamDAOD_PHYS' in flags.Input.ProcessingTags:
355 from DerivationFrameworkJetEtMiss.METCommonConfig import METRemappingCfg
356
357 METRemap_cfg = METRemappingCfg(flags)
358 acc.merge(METRemap_cfg)
359
360 # The derivation kernel itself
361 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
362 acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
363
364 return acc
365
366
367def PHYSLITECfg(flags):
368
369 acc = ComponentAccumulator()
370
371 # Get the lists of triggers needed for trigger matching.
372 # This is needed at this scope (for the slimming) and further down in the config chain
373 # for actually configuring the matching, so we create it here and pass it down
374 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
375 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
376 PHYSLITETriggerListsHelper = TriggerListsHelper(flags)
377
378 # Set the stream name - varies depending on whether the input is AOD or DAOD_PHYS
379 streamName = 'StreamDAOD_PHYSLITE' if 'StreamAOD' in flags.Input.ProcessingTags else 'StreamD2AOD_PHYSLITE'
380
381 # Common augmentations
382 acc.merge(PHYSLITEKernelCfg(flags, name="PHYSLITEKernel", StreamName = streamName, TriggerListsHelper = PHYSLITETriggerListsHelper))
383
384 # ============================
385 # Define contents of the format
386 # =============================
387 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
388 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
389 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
390
391 PHYSLITESlimmingHelper = SlimmingHelper("PHYSLITESlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
392 PHYSLITESlimmingHelper.ExtraVariables = []
393 # Trigger content
394 PHYSLITESlimmingHelper.IncludeTriggerNavigation = False
395 PHYSLITESlimmingHelper.IncludeJetTriggerContent = False
396 PHYSLITESlimmingHelper.IncludeMuonTriggerContent = False
397 PHYSLITESlimmingHelper.IncludeEGammaTriggerContent = False
398 PHYSLITESlimmingHelper.IncludeTauTriggerContent = False
399 PHYSLITESlimmingHelper.IncludeEtMissTriggerContent = False
400 PHYSLITESlimmingHelper.IncludeBJetTriggerContent = False
401 PHYSLITESlimmingHelper.IncludeBPhysTriggerContent = False
402 PHYSLITESlimmingHelper.IncludeMinBiasTriggerContent = False
403
404 # Trigger matching
405 # Run 2
406 if flags.Trigger.EDMVersion == 2:
407 # Need to re-run matching so that new Analysis<X> containers are matched to triggers
408 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
409 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
410 name = "PHYSLITETrigMatchNoTau",
411 OutputContainerPrefix = "AnalysisTrigMatch_",
412 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau,
413 InputElectrons = "AnalysisElectrons",
414 InputPhotons = "AnalysisPhotons",
415 InputMuons = "AnalysisMuons",
416 InputTaus = "AnalysisTauJets"))
417 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
418 name = "PHYSLITETrigMatchTau",
419 OutputContainerPrefix = "AnalysisTrigMatch_",
420 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesTau,
421 DRThreshold = 0.2,
422 InputElectrons = "AnalysisElectrons",
423 InputPhotons = "AnalysisPhotons",
424 InputMuons = "AnalysisMuons",
425 InputTaus = "AnalysisTauJets"))
426 # Now add the resulting decorations to the output
427 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
428 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
429 OutputContainerPrefix = "AnalysisTrigMatch_",
430 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesTau)
431 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
432 OutputContainerPrefix = "AnalysisTrigMatch_",
433 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau)
434
435 # Run 3, or Run 2 with navigation conversion
436 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
437 # No need to run matching: just keep navigation so matching can be done by analysts
438 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
439 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSLITESlimmingHelper)
440
441 # Event content
442 PHYSLITESlimmingHelper.AppendToDictionary.update({
443 'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
444 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
445 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
446 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
447 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
448 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
449 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
450 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
451 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
452 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
453 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
454 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
455 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
456 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
457 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
458 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
459 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer',
460 'AnalysisElectrons':'xAOD::ElectronContainer', 'AnalysisElectronsAux':'xAOD::ElectronAuxContainer',
461 'AnalysisSiHitElectrons':'xAOD::ElectronContainer', 'AnalysisSiHitElectronsAux':'xAOD::ElectronAuxContainer',
462 'AnalysisMuons':'xAOD::MuonContainer', 'AnalysisMuonsAux':'xAOD::MuonAuxContainer',
463 'AnalysisJets':'xAOD::JetContainer','AnalysisJetsAux':'xAOD::AuxContainerBase',
464 'AnalysisPhotons':'xAOD::PhotonContainer', 'AnalysisPhotonsAux':'xAOD::PhotonAuxContainer',
465 'AnalysisTauJets':'xAOD::TauJetContainer', 'AnalysisTauJetsAux':'xAOD::TauJetAuxContainer',
466 'MET_Core_AnalysisMET':'xAOD::MissingETContainer', 'MET_Core_AnalysisMETAux':'xAOD::MissingETAuxContainer',
467 'METAssoc_AnalysisMET':'xAOD::MissingETAssociationMap', 'METAssoc_AnalysisMETAux':'xAOD::MissingETAuxAssociationMap',
468 'AnalysisLargeRJets':'xAOD::JetContainer','AnalysisLargeRJetsAux':'xAOD::AuxContainerBase'
469 })
470
471 PHYSLITESlimmingHelper.SmartCollections = [
472 'EventInfo',
473 'InDetTrackParticles',
474 'PrimaryVertices',
475 ]
476
477 from DerivationFrameworkMuons.MuonsCommonConfig import MuonVariablesCfg
478
479 # add in extra values for Higgs
480 from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
481 setupHiggsSlimmingVariables(flags, PHYSLITESlimmingHelper)
482
483 if flags.Input.isMC:
484 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
485 addTruth3ContentToSlimmerTool(PHYSLITESlimmingHelper, reduced=True)
486 # This block is only needed if input is AOD, as it is already done for PHYS->PHYSLITE
487 if 'StreamAOD' in flags.Input.ProcessingTags:
488 from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
489 acc.merge(HFClassificationCommonCfg(flags))
490
491 # Save the extra variables which aren't included by other means
492 btag_variables = [f'{flags.BTagging.AK4TaggerName}_p{x}' for x in ['b', 'c', 'u', 'tau']]
493 PHYSLITESlimmingHelper.ExtraVariables += [
494 'AnalysisElectrons.trackParticleLinks.f1.pt.eta.phi.charge.author.DFCommonElectronsLHVeryLoose.DFCommonElectronsLHLoose.DFCommonElectronsLHLooseBL.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsLHVeryLooseIsEMValue.DFCommonElectronsLHLooseIsEMValue.DFCommonElectronsLHLooseBLIsEMValue.DFCommonElectronsLHMediumIsEMValue.DFCommonElectronsLHTightIsEMValue.DFCommonElectronsDNNLoose.DFCommonElectronsDNNMedium.DFCommonElectronsDNNTight.DFCommonElectronsDNNVeryLooseNoCF97.DFCommonElectronsDNNMediumNoCF.DFCommonElectronsDNNTightNoCF.DFCommonElectronsECIDS.DFCommonElectronsECIDSResult.topoetcone20.topoetcone20ptCorrection.neflowisol20.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt500.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt500.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000.topoetcone20_CloseByCorr.ptcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.caloClusterLinks.ambiguityLink.TruthLink.truthOrigin.truthType.truthPdgId.firstEgMotherTruthType.firstEgMotherTruthOrigin.firstEgMotherTruthParticleLink.firstEgMotherPdgId.ambiguityType.OQ.Eadded_Lr2.Eadded_Lr3.E_mva_only.DFCommonAddAmbiguity.PLIT_PLITel_pelxpromp.PLIT_PLITel_pnpxall',
495 'AnalysisSiHitElectrons.pt.eta.phi.charge.author.topoetcone20_CloseByCorr.DFCommonElectronsLHVeryLoose.ptvarcone30_Nonprompt_All_MaxWeightTTVALooseCone_pt1000_CloseByCorr.OQ.truthOrigin.truthType.firstEgMotherTruthType.firstEgMotherTruthOrigin.z0stheta.d0Normalized.nInnerExpPix.clEta.clPhi.E_mva_only',
496 'AnalysisPhotons.f1.pt.eta.phi.author.OQ.DFCommonPhotonsIsEMLoose.DFCommonPhotonsIsEMMedium.DFCommonPhotonsIsEMTight.DFCommonPhotonsIsEMTightIsEMValue.DFCommonPhotonsCleaning.DFCommonPhotonsCleaningNoTime.ptcone20.topoetcone20.topoetcone40.topoetcone20ptCorrection.topoetcone40ptCorrection.topoetcone20_CloseByCorr.topoetcone40_CloseByCorr.ptcone20_CloseByCorr.caloClusterLinks.vertexLinks.ambiguityLink.TruthLink.truthOrigin.truthType.Eadded_Lr2.Eadded_Lr3.E_mva_only.DFCommonPhotonsIsEMTightNF.DFCommonPhotonsIsEMTightNFIsEMValue.DFCommonPhotonsNFBDTTight.DFCommonPhotonsNFBDTTightIsEMValue.DFCommonPhotonsNFBDTScore',
497 'GSFTrackParticles.chiSquared.phi.d0.theta.qOverP.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.z0.vz.charge.vertexLink.numberOfPixelHits.numberOfSCTHits.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.originalTrackParticle',
498 'GSFConversionVertices.trackParticleLinks.x.y.z.px.py.pz.pt1.pt2.neutralParticleLinks.minRfirstHit',
499 'egammaClusters.calE.calEta.calPhi.calM.e_sampl.eta_sampl.ETACALOFRAME.PHICALOFRAME.ETA2CALOFRAME.PHI2CALOFRAME.constituentClusterLinks.samplingPattern',
500 "AnalysisMuons.{var_string}".format(var_string = ".".join(MuonVariablesCfg(flags))),
501 'CombinedMuonTrackParticles.qOverP.d0.z0.vz.phi.theta.truthOrigin.truthType.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfTRTHits.numberOfTRTOutliers.chiSquared.numberDoF',
502 'ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.truthOrigin.truthType.qOverP.theta.phi',
503 'MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.vertexLink.theta.qOverP',
504 'InDetForwardTrackParticles.vz.truthType.truthOrigin.numberDoF.numberOfTRTHits.numberOfSCTHoles.theta.numberOfTRTOutliers.numberOfPrecisionLayers.numberOfSCTDeadSensors.numberOfPixelHoles.numberOfSCTHits.numberOfPrecisionHoleLayers.numberOfPixelDeadSensors.phi.numberOfPixelHits.z0.d0.qOverP.chiSquared.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag',
505 'AnalysisTauJets.pt.eta.phi.m.ptFinalCalib.etaFinalCalib.ptTauEnergyScale.etaTauEnergyScale.charge.nChargedTracks.isTauFlags.PanTau_DecayMode.NNDecayMode.RNNJetScoreSigTrans.GNTauScoreSigTrans_v0prune.GNTauVL_v0prune.GNTauL_v0prune.GNTauM_v0prune.GNTauT_v0prune.RNNEleScoreSigTrans_v1.EleRNNLoose_v1.EleRNNMedium_v1.EleRNNTight_v1.trackWidth.passTATTauMuonOLR.tauTrackLinks.vertexLink.truthParticleLink.truthJetLink.IsTruthMatched.truthOrigin.truthType.TESCompatibility',
506 'AnalysisJets.pt.eta.phi.m.numConstit.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.DetectorY.JVFCorr.NNJvtPass.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.GhostUnAssocMuonSegmentCount.PartonTruthLabelID.HadronConeExclExtendedTruthLabelID.HadronConeExclTruthLabelID.TrueFlavor.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad.Timing.btagging.btaggingLink.GhostTrack.DFCommonJets_fJvt.PSFrac.JetAccessorMap.EMFrac.Width.ActiveArea4vec_pt.ActiveArea4vec_eta.ActiveArea4vec_m.ActiveArea4vec_phi.EnergyPerSampling.SumPtChargedPFOPt500.isJvtHS.QGTransformer_ConstScore.{btag_var_string}'.format(btag_var_string = ".".join(btag_variables)),
507 'TruthPrimaryVertices.t.x.y.z',
508 'MET_Core_AnalysisMET.name.mpx.mpy.sumet.source',
509 'METAssoc_AnalysisMET.',
510 'InDetTrackParticles.numberOfTRTHits.numberOfTRTOutliers',
511 'EventInfo.RandomRunNumber.PileupWeight_NOSYS.correctedScaledInteractionsPerCrossing.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ.HF_Classification.HF_SimpleClassification.{GRL_Deco_names}'.format(GRL_Deco_names='.'.join(str(key) for key in (getGoodRunsLists()).keys())),
512 'Kt4EMPFlowEventShape.Density',
513 'Kt4EMPFlowNeutEventShape.Density',
514 'TauTracks.flagSet.trackLinks',
515 'AnalysisLargeRJets.pt.eta.phi.m.numConstit.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.DetectorEta.DetectorY.ECF1.ECF2.ECF3.Tau1_wta.Tau2_wta.Tau3_wta.Split12.Split23.Qw.D2.C2.R10TruthLabel_R22v1.R10TruthLabel_R21Precision_2022v1.GhostBHadronsFinalCount.GhostCHadronsFinalCount.GN2Xv01_phbb.GN2Xv01_phcc.GN2Xv01_ptop.GN2Xv01_pqcd',
516 ]
517
518 # Output stream
519 PHYSLITEItemList = PHYSLITESlimmingHelper.GetItemList()
520
521 formatString = 'D2AOD_PHYSLITE' if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags else 'DAOD_PHYSLITE'
522 acc.merge(OutputStreamCfg(flags, formatString, ItemList=PHYSLITEItemList, AcceptAlgs=["PHYSLITEKernel"]))
523 acc.merge(SetupMetaDataForStreamCfg(flags, formatString, AcceptAlgs=["PHYSLITEKernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
524
525 return acc
526
CPAlgorithmsCfg(flags)
Definition PHYSLITE.py:17
PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs)
Definition PHYSLITE.py:264
PHYSLITECfg(flags)
Definition PHYSLITE.py:367