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

Functions

 CPAlgorithmsCfg (flags)
 PHYSLITEKernelCfg (flags, name='PHYSLITEKernel', **kwargs)
 PHYSLITECfg (flags)

Function Documentation

◆ CPAlgorithmsCfg()

CPAlgorithmsCfg ( flags)
do the CP algorithm configuration for PHYSLITE

Definition at line 17 of file PHYSLITE.py.

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 forceEGammaFullSimConfig = False
25 if not flags.Sim.ISF.Simulator.isFullSim():
26 logPLCPAlgCfg.warning("Forcing full simulation configuration for EGamma algorithms. This is not recommended for fast simulation but no recommendations available yet.")
27 forceEGammaFullSimConfig = True
28
29 FixedElDict = {}
30 FixedPhDict = {}
31 from egammaAlgs.egammaAODFixesConfig import runAODFix
32 doneFix, fixes = runAODFix(flags)
33 logPLCPAlgCfg.info(f'Existing egamma AOD fixes for timing cut issue : {fixes}')
34 if 'egammatopoIsoFix' in fixes:
35 FixedElDict.update({"ElectronIsolationCorrectionAlg.isolationCorrectionTool.FixTimingIssueInCore": False})
36 FixedPhDict.update({"PhotonIsolationCorrectionAlg.isolationCorrectionTool.FixTimingIssueInCore": False})
37 if 'egClusterL2_3Fix' in fixes:
38 FixedElDict.update({"ElectronCalibrationAndSmearingAlg.calibrationAndSmearingTool.FixForMissingCells": False})
39 FixedPhDict.update({"PhotonCalibrationAndSmearingAlg.calibrationAndSmearingTool.FixForMissingCells": False})
40
41 from AnalysisAlgorithmsConfig.ConfigFactory import ConfigFactory
42 from AnalysisAlgorithmsConfig.ConfigSequence import ConfigSequence
43 configSeq = ConfigSequence ()
44
45 # create factory object to build block configurations
46 factory = ConfigFactory()
47
48 # Set up the systematics loader/handler algorithm:
49 subConfig = factory.makeConfig ('CommonServices')
50 subConfig.setOptionValue ('.runSystematics', False)
51 subConfig.setOptionValue ('.fixDAODTruthRecord', False)
52 configSeq += subConfig
53
54 # Disable expert-mode warnings
55 import warnings
56 from AnalysisAlgorithmsConfig.ConfigAccumulator import ExpertModeWarning
57 warnings.simplefilter('ignore', ExpertModeWarning)
58
59 # Create a pile-up analysis config
60 if flags.Input.isMC:
61 # setup config and lumicalc files for pile-up tool
62 configSeq += factory.makeConfig ('PileupReweighting')
63
64 # Set up the GRL decoration analysis config
65 configSeq += factory.makeConfig ('EventCleaning')
66 configSeq.setOptionValue ('.noFilter', True)
67 configSeq.setOptionValue ('.GRLDict', getGoodRunsLists())
68
69 # set up the muon analysis algorithm config (must come before electrons and photons to allow FSR collection):
70
71 logPLCPAlgCfg.info('Do Muons')
72
73 subConfig = factory.makeConfig ('Muons')
74 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
75 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
76 configSeq += subConfig
77 subConfig = factory.makeConfig ('Muons.WorkingPoint')
78 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
79 subConfig.setOptionValue ('.selectionName', 'loose')
80 subConfig.setOptionValue ('.trackSelection', False)
81 subConfig.setOptionValue ('.quality', 'Loose')
82 subConfig.setOptionValue ('.isolation', 'NonIso')
83 configSeq += subConfig
84 subConfig = factory.makeConfig ('Thinning')
85 subConfig.setOptionValue ('.containerName', 'AnalysisMuons')
86 subConfig.setOptionValue ('.selectionName', 'loose')
87 subConfig.setOptionValue ('.deepCopy', True)
88 subConfig.setOptionValue ('.sortPt', True)
89 subConfig.setOptionValue ('.noUniformSelection', True)
90 subConfig.setOptionValue ('.containerType', 'xAOD::MuonContainer')
91 configSeq += subConfig
92
93 # set up the electron analysis config (For SiHits electrons, use: LooseLHElectronSiHits.NonIso):
94
95 logPLCPAlgCfg.info('Do Electrons')
96
97 subConfig = factory.makeConfig ('Electrons')
98 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
99 subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
100 subConfig.setOptionValue ('.isolationCorrection', True)
101 subConfig.setOptionValue ('.minPt', 0.)
102 subConfig.setOptionValue ('.decorateSamplingPattern', True)
103 subConfig.setOptionValue ('.decorateEmva', True)
104 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
105 if len(FixedElDict) > 0:
106 subConfig.setOptionValue ('.propertyOverrides', FixedElDict)
107 configSeq += subConfig
108 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
109 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
110 subConfig.setOptionValue ('.selectionName', 'looseLH')
111 subConfig.setOptionValue ('.trackSelection', False)
112 subConfig.setOptionValue ('.identificationWP', 'LooseLH')
113 subConfig.setOptionValue ('.addSelectionToPreselection', False)
114 subConfig.setOptionValue ('.isolationWP', 'NonIso')
115 subConfig.setOptionValue ('.doFSRSelection', True)
116 subConfig.setOptionValue ('.noEffSF', True)
117 configSeq += subConfig
118 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
119 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
120 subConfig.setOptionValue ('.selectionName', 'looseDNN')
121 subConfig.setOptionValue ('.trackSelection', False)
122 subConfig.setOptionValue ('.identificationWP', 'LooseDNN')
123 subConfig.setOptionValue ('.addSelectionToPreselection', False)
124 subConfig.setOptionValue ('.isolationWP', 'NonIso')
125 subConfig.setOptionValue ('.doFSRSelection', True)
126 subConfig.setOptionValue ('.noEffSF', True)
127 configSeq += subConfig
128 subConfig = factory.makeConfig ('Thinning')
129 subConfig.setOptionValue ('.containerName', 'AnalysisElectrons')
130 subConfig.setOptionValue ('.selectionName', 'looseLH||looseDNN')
131 subConfig.setOptionValue ('.deepCopy', True)
132 subConfig.setOptionValue ('.sortPt', True)
133 subConfig.setOptionValue ('.noUniformSelection', True)
134 subConfig.setOptionValue ('.containerType', 'xAOD::ElectronContainer')
135 configSeq += subConfig
136
137 # So SiHit electrons - should come after the standard selection in order to avoid keeping the same electrons twice
138 subConfig = factory.makeConfig ('Electrons')
139 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
140 subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
141 subConfig.setOptionValue ('.isolationCorrection', True)
142 subConfig.setOptionValue ('.minPt', 0.)
143 subConfig.setOptionValue ('.postfix', 'SiHit')
144 subConfig.setOptionValue ('.decorateEmva', True)
145 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
146 if len(FixedElDict) > 0:
147 subConfig.setOptionValue ('.propertyOverrides', FixedElDict)
148 configSeq += subConfig
149 subConfig = factory.makeConfig ('Electrons.WorkingPoint')
150 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
151 subConfig.setOptionValue ('.selectionName', 'SiHits')
152 subConfig.setOptionValue ('.trackSelection', False)
153 subConfig.setOptionValue ('.identificationWP', 'SiHitElectron')
154 subConfig.setOptionValue ('.isolationWP', 'NonIso')
155 subConfig.setOptionValue ('.doFSRSelection', True) # needed to veto FSR electrons
156 subConfig.setOptionValue ('.noEffSF', True)
157 subConfig.setOptionValue ('.postfix', 'SiHit')
158 configSeq += subConfig
159 subConfig = factory.makeConfig ('Thinning')
160 subConfig.setOptionValue ('.containerName', 'AnalysisSiHitElectrons')
161 subConfig.setOptionValue ('.selectionName', 'SiHits')
162 subConfig.setOptionValue ('.deepCopy', True)
163 subConfig.setOptionValue ('.sortPt', True)
164 subConfig.setOptionValue ('.noUniformSelection', True)
165 subConfig.setOptionValue ('.containerType', 'xAOD::ElectronContainer')
166 configSeq += subConfig
167
168 # set up the photon analysis config:
169
170 logPLCPAlgCfg.info('Do Photons')
171
172 subConfig = factory.makeConfig ('Photons')
173 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
174 subConfig.setOptionValue ('.forceFullSimConfigForIso', forceEGammaFullSimConfig)
175 subConfig.setOptionValue ('.recomputeIsEM', False)
176 subConfig.setOptionValue ('.minPt', 0.)
177 subConfig.setOptionValue ('.decorateEmva', True)
178 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
179 if len(FixedPhDict) > 0:
180 subConfig.setOptionValue ('.propertyOverrides', FixedPhDict)
181 configSeq += subConfig
182 subConfig = factory.makeConfig ('Photons.WorkingPoint')
183 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
184 subConfig.setOptionValue ('.selectionName', 'loose')
185 subConfig.setOptionValue ('.qualityWP', 'Loose')
186 subConfig.setOptionValue ('.isolationWP', 'NonIso')
187 subConfig.setOptionValue ('.doFSRSelection', True)
188 subConfig.setOptionValue ('.recomputeIsEM', False)
189 subConfig.setOptionValue ('.noEffSFForID', True)
190 subConfig.setOptionValue ('.noEffSFForIso', True)
191 configSeq += subConfig
192 subConfig = factory.makeConfig ('Thinning')
193 subConfig.setOptionValue ('.containerName', 'AnalysisPhotons')
194 subConfig.setOptionValue ('.selectionName', 'loose')
195 subConfig.setOptionValue ('.deepCopy', True)
196 subConfig.setOptionValue ('.sortPt', True)
197 subConfig.setOptionValue ('.noUniformSelection', True)
198 subConfig.setOptionValue ('.containerType', 'xAOD::PhotonContainer')
199 configSeq += subConfig
200
201
202
203 # set up the tau analysis algorithm config:
204 # Commented for now due to use of public tools
205 subConfig = factory.makeConfig ('TauJets')
206 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
207 subConfig.setOptionValue ('.addGlobalFELinksDep', True)
208 subConfig.setOptionValue ('.rerunTruthMatching', False)
209 configSeq += subConfig
210 subConfig = factory.makeConfig ('TauJets.WorkingPoint')
211 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
212 subConfig.setOptionValue ('.selectionName', 'baseline')
213 subConfig.setOptionValue ('.quality', 'Baseline')
214 configSeq += subConfig
215 subConfig = factory.makeConfig ('Thinning')
216 subConfig.setOptionValue ('.containerName', 'AnalysisTauJets')
217 subConfig.setOptionValue ('.selectionName', 'baseline')
218 subConfig.setOptionValue ('.deepCopy', True)
219 subConfig.setOptionValue ('.sortPt', True)
220 subConfig.setOptionValue ('.noUniformSelection', True)
221 subConfig.setOptionValue ('.containerType', 'xAOD::TauJetContainer')
222 configSeq += subConfig
223
224 # set up the jet analysis algorithm config:
225 jetContainer = 'AntiKt4EMPFlowJets'
226 subConfig = factory.makeConfig ('Jets')
227 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
228 subConfig.setOptionValue ('.jetCollection', jetContainer)
229 subConfig.setOptionValue ('.runFJvtSelection', False)
230 subConfig.setOptionValue ('.runJvtSelection', False)
231 subConfig.setOptionValue ('.runUncertainties', False)
232 subConfig.setOptionValue ('.outputTruthLabelIDs', True)
233 configSeq += subConfig
234 subConfig = factory.makeConfig ('Thinning')
235 subConfig.setOptionValue ('.containerName', 'AnalysisJets')
236 subConfig.setOptionValue ('.deepCopy', True)
237 subConfig.setOptionValue ('.sortPt', True)
238 subConfig.setOptionValue ('.noUniformSelection', True)
239 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
240 configSeq += subConfig
241
242 largeRjetContainer='AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets'
243 subConfig = factory.makeConfig ('Jets')
244 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
245 subConfig.setOptionValue ('.jetCollection', largeRjetContainer)
246 subConfig.setOptionValue ('.runGhostMuonAssociation', False)
247 # Disable kinematic selections on large-R jets
248 subConfig.setOptionValue ('.minPt', 0.)
249 subConfig.setOptionValue ('.maxPt', 0.)
250 subConfig.setOptionValue ('.maxRapidity', 0.)
251 subConfig.setOptionValue ('.minMass', 0.)
252 subConfig.setOptionValue ('.maxMass', 0.)
253 subConfig.setOptionValue ('.runUncertainties', False)
254 subConfig.setOptionValue ('.outputTruthLabelIDs', True)
255 configSeq += subConfig
256 subConfig = factory.makeConfig ('Thinning')
257 subConfig.setOptionValue ('.containerName', 'AnalysisLargeRJets')
258 subConfig.setOptionValue ('.deepCopy', True)
259 subConfig.setOptionValue ('.sortPt', True)
260 subConfig.setOptionValue ('.noUniformSelection', True)
261 subConfig.setOptionValue ('.containerType', 'xAOD::JetContainer')
262 configSeq += subConfig
263
264 from AnalysisAlgorithmsConfig.ConfigAccumulator import ConfigAccumulator
265 configAccumulator = ConfigAccumulator (dataType=None, algSeq=None,
266 autoconfigFromFlags=flags, noSysSuffix=True, noSystematics=True)
267 configSeq.fullConfigure (configAccumulator)
268 return configAccumulator.CA
269
270
271
272# Main algorithm config

◆ PHYSLITECfg()

PHYSLITECfg ( flags)

Definition at line 371 of file PHYSLITE.py.

371def PHYSLITECfg(flags):
372
373 acc = ComponentAccumulator()
374
375 # Get the lists of triggers needed for trigger matching.
376 # This is needed at this scope (for the slimming) and further down in the config chain
377 # for actually configuring the matching, so we create it here and pass it down
378 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
379 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
380 PHYSLITETriggerListsHelper = TriggerListsHelper(flags)
381
382 # Set the stream name - varies depending on whether the input is AOD or DAOD_PHYS
383 streamName = 'StreamDAOD_PHYSLITE' if 'StreamAOD' in flags.Input.ProcessingTags else 'StreamD2AOD_PHYSLITE'
384
385 # Common augmentations
386 acc.merge(PHYSLITEKernelCfg(flags, name="PHYSLITEKernel", StreamName = streamName, TriggerListsHelper = PHYSLITETriggerListsHelper))
387
388 # ============================
389 # Define contents of the format
390 # =============================
391 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
392 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
393 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
394
395 PHYSLITESlimmingHelper = SlimmingHelper("PHYSLITESlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
396 PHYSLITESlimmingHelper.ExtraVariables = []
397 # Trigger content
398 PHYSLITESlimmingHelper.IncludeTriggerNavigation = False
399 PHYSLITESlimmingHelper.IncludeJetTriggerContent = False
400 PHYSLITESlimmingHelper.IncludeMuonTriggerContent = False
401 PHYSLITESlimmingHelper.IncludeEGammaTriggerContent = False
402 PHYSLITESlimmingHelper.IncludeTauTriggerContent = False
403 PHYSLITESlimmingHelper.IncludeEtMissTriggerContent = False
404 PHYSLITESlimmingHelper.IncludeBJetTriggerContent = False
405 PHYSLITESlimmingHelper.IncludeBPhysTriggerContent = False
406 PHYSLITESlimmingHelper.IncludeMinBiasTriggerContent = False
407
408 # Trigger matching
409 # Run 2
410 if flags.Trigger.EDMVersion == 2:
411 # Need to re-run matching so that new Analysis<X> containers are matched to triggers
412 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import TriggerMatchingCommonRun2Cfg
413 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
414 name = "PHYSLITETrigMatchNoTau",
415 OutputContainerPrefix = "AnalysisTrigMatch_",
416 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau,
417 InputElectrons = "AnalysisElectrons",
418 InputPhotons = "AnalysisPhotons",
419 InputMuons = "AnalysisMuons",
420 InputTaus = "AnalysisTauJets"))
421 acc.merge(TriggerMatchingCommonRun2Cfg(flags,
422 name = "PHYSLITETrigMatchTau",
423 OutputContainerPrefix = "AnalysisTrigMatch_",
424 ChainNames = PHYSLITETriggerListsHelper.Run2TriggerNamesTau,
425 DRThreshold = 0.2,
426 InputElectrons = "AnalysisElectrons",
427 InputPhotons = "AnalysisPhotons",
428 InputMuons = "AnalysisMuons",
429 InputTaus = "AnalysisTauJets"))
430 # Now add the resulting decorations to the output
431 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
432 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
433 OutputContainerPrefix = "AnalysisTrigMatch_",
434 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesTau)
435 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = PHYSLITESlimmingHelper,
436 OutputContainerPrefix = "AnalysisTrigMatch_",
437 TriggerList = PHYSLITETriggerListsHelper.Run2TriggerNamesNoTau)
438
439 # Run 3, or Run 2 with navigation conversion
440 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
441 # No need to run matching: just keep navigation so matching can be done by analysts
442 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
443 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(PHYSLITESlimmingHelper)
444
445 # Event content
446 PHYSLITESlimmingHelper.AppendToDictionary.update({
447 'TruthEvents':'xAOD::TruthEventContainer','TruthEventsAux':'xAOD::TruthEventAuxContainer',
448 'MET_Truth':'xAOD::MissingETContainer','MET_TruthAux':'xAOD::MissingETAuxContainer',
449 'TruthElectrons':'xAOD::TruthParticleContainer','TruthElectronsAux':'xAOD::TruthParticleAuxContainer',
450 'TruthMuons':'xAOD::TruthParticleContainer','TruthMuonsAux':'xAOD::TruthParticleAuxContainer',
451 'TruthPhotons':'xAOD::TruthParticleContainer','TruthPhotonsAux':'xAOD::TruthParticleAuxContainer',
452 'TruthTaus':'xAOD::TruthParticleContainer','TruthTausAux':'xAOD::TruthParticleAuxContainer',
453 'TruthNeutrinos':'xAOD::TruthParticleContainer','TruthNeutrinosAux':'xAOD::TruthParticleAuxContainer',
454 'TruthBSM':'xAOD::TruthParticleContainer','TruthBSMAux':'xAOD::TruthParticleAuxContainer',
455 'TruthBoson':'xAOD::TruthParticleContainer','TruthBosonAux':'xAOD::TruthParticleAuxContainer',
456 'TruthTop':'xAOD::TruthParticleContainer','TruthTopAux':'xAOD::TruthParticleAuxContainer',
457 'TruthForwardProtons':'xAOD::TruthParticleContainer','TruthForwardProtonsAux':'xAOD::TruthParticleAuxContainer',
458 'BornLeptons':'xAOD::TruthParticleContainer','BornLeptonsAux':'xAOD::TruthParticleAuxContainer',
459 'TruthBosonsWithDecayParticles':'xAOD::TruthParticleContainer','TruthBosonsWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
460 'TruthBosonsWithDecayVertices':'xAOD::TruthVertexContainer','TruthBosonsWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
461 'TruthBSMWithDecayParticles':'xAOD::TruthParticleContainer','TruthBSMWithDecayParticlesAux':'xAOD::TruthParticleAuxContainer',
462 'TruthBSMWithDecayVertices':'xAOD::TruthVertexContainer','TruthBSMWithDecayVerticesAux':'xAOD::TruthVertexAuxContainer',
463 'TruthPrimaryVertices':'xAOD::TruthVertexContainer','TruthPrimaryVerticesAux':'xAOD::TruthVertexAuxContainer',
464 'AnalysisElectrons':'xAOD::ElectronContainer', 'AnalysisElectronsAux':'xAOD::ElectronAuxContainer',
465 'AnalysisSiHitElectrons':'xAOD::ElectronContainer', 'AnalysisSiHitElectronsAux':'xAOD::ElectronAuxContainer',
466 'AnalysisMuons':'xAOD::MuonContainer', 'AnalysisMuonsAux':'xAOD::MuonAuxContainer',
467 'AnalysisJets':'xAOD::JetContainer','AnalysisJetsAux':'xAOD::AuxContainerBase',
468 'AnalysisPhotons':'xAOD::PhotonContainer', 'AnalysisPhotonsAux':'xAOD::PhotonAuxContainer',
469 'AnalysisTauJets':'xAOD::TauJetContainer', 'AnalysisTauJetsAux':'xAOD::TauJetAuxContainer',
470 'MET_Core_AnalysisMET':'xAOD::MissingETContainer', 'MET_Core_AnalysisMETAux':'xAOD::MissingETAuxContainer',
471 'METAssoc_AnalysisMET':'xAOD::MissingETAssociationMap', 'METAssoc_AnalysisMETAux':'xAOD::MissingETAuxAssociationMap',
472 'AnalysisLargeRJets':'xAOD::JetContainer','AnalysisLargeRJetsAux':'xAOD::AuxContainerBase'
473 })
474
475 PHYSLITESlimmingHelper.SmartCollections = [
476 'EventInfo',
477 'InDetTrackParticles',
478 'PrimaryVertices',
479 ]
480
481 from DerivationFrameworkMuons.MuonsCommonConfig import MuonVariablesCfg
482
483 # add in extra values for Higgs
484 from DerivationFrameworkHiggs.HiggsPhysContent import setupHiggsSlimmingVariables
485 setupHiggsSlimmingVariables(flags, PHYSLITESlimmingHelper)
486
487 if flags.Input.isMC:
488 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
489 addTruth3ContentToSlimmerTool(PHYSLITESlimmingHelper, reduced=True)
490 # This block is only needed if input is AOD, as it is already done for PHYS->PHYSLITE
491 if 'StreamAOD' in flags.Input.ProcessingTags:
492 from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
493 acc.merge(HFClassificationCommonCfg(flags))
494
495 # Save the extra variables which aren't included by other means
496 btag_variables = [f'{flags.BTagging.AK4TaggerName}_p{x}' for x in ['b', 'c', 'u', 'tau']]
497 PHYSLITESlimmingHelper.ExtraVariables += [
498 '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',
499 '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',
500 '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',
501 'GSFTrackParticles.chiSquared.phi.d0.theta.qOverP.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.z0.vz.charge.vertexLink.numberOfPixelHits.numberOfSCTHits.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.originalTrackParticle',
502 'GSFConversionVertices.trackParticleLinks.x.y.z.px.py.pz.pt1.pt2.neutralParticleLinks.minRfirstHit',
503 'egammaClusters.calE.calEta.calPhi.calM.e_sampl.eta_sampl.ETACALOFRAME.PHICALOFRAME.ETA2CALOFRAME.PHI2CALOFRAME.constituentClusterLinks.samplingPattern',
504 "AnalysisMuons.{var_string}".format(var_string = ".".join(MuonVariablesCfg(flags))),
505 'CombinedMuonTrackParticles.qOverP.d0.z0.vz.phi.theta.truthOrigin.truthType.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfTRTHits.numberOfTRTOutliers.chiSquared.numberDoF',
506 'ExtrapolatedMuonTrackParticles.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.truthOrigin.truthType.qOverP.theta.phi',
507 'MuonSpectrometerTrackParticles.phi.d0.z0.vz.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag.vertexLink.theta.qOverP',
508 'InDetForwardTrackParticles.vz.truthType.truthOrigin.numberDoF.numberOfTRTHits.numberOfSCTHoles.theta.numberOfTRTOutliers.numberOfPrecisionLayers.numberOfSCTDeadSensors.numberOfPixelHoles.numberOfSCTHits.numberOfPrecisionHoleLayers.numberOfPixelDeadSensors.phi.numberOfPixelHits.z0.d0.qOverP.chiSquared.definingParametersCovMatrixDiag.definingParametersCovMatrixOffDiag',
509 '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',
510 'AnalysisJets.pt.eta.phi.m.numConstit.JetConstitScaleMomentum_pt.JetConstitScaleMomentum_eta.JetConstitScaleMomentum_phi.JetConstitScaleMomentum_m.NumTrkPt500.SumPtTrkPt500.DetectorEta.DetectorY.JVFCorr.NNJvtPass.NumTrkPt1000.TrackWidthPt1000.GhostMuonSegmentCount.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)),
511 'TruthPrimaryVertices.t.x.y.z',
512 'MET_Core_AnalysisMET.name.mpx.mpy.sumet.source',
513 'METAssoc_AnalysisMET.',
514 'InDetTrackParticles.numberOfTRTHits.numberOfTRTOutliers',
515 'EventInfo.RandomRunNumber.PileupWeight_NOSYS.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ.HF_Classification.HF_SimpleClassification.{GRL_Deco_names}'.format(GRL_Deco_names='.'.join(str(key) for key in (getGoodRunsLists()).keys())),
516 'Kt4EMPFlowEventShape.Density',
517 'Kt4EMPFlowNeutEventShape.Density',
518 'TauTracks.flagSet.trackLinks',
519 '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',
520 ]
521
522 # Output stream
523 PHYSLITEItemList = PHYSLITESlimmingHelper.GetItemList()
524
525 formatString = 'D2AOD_PHYSLITE' if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags else 'DAOD_PHYSLITE'
526 acc.merge(OutputStreamCfg(flags, formatString, ItemList=PHYSLITEItemList, AcceptAlgs=["PHYSLITEKernel"]))
527 acc.merge(SetupMetaDataForStreamCfg(flags, formatString, AcceptAlgs=["PHYSLITEKernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
528
529 return acc
530

◆ PHYSLITEKernelCfg()

PHYSLITEKernelCfg ( flags,
name = 'PHYSLITEKernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for PHYSLITE

Definition at line 273 of file PHYSLITE.py.

273def PHYSLITEKernelCfg(flags, name='PHYSLITEKernel', **kwargs):
274 """Configure the derivation framework driving algorithm (kernel) for PHYSLITE"""
275 acc = ComponentAccumulator()
276
277 # This block does the common physics augmentation which isn't needed (or possible) for PHYS->PHYSLITE
278 # Ensure block only runs for AOD input
279 if 'StreamAOD' in flags.Input.ProcessingTags:
280 # Common augmentations
281 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
282 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
283
284 # Thinning tools
285 # These are set up in PhysCommonThinningConfig. Only thing needed here the list of tools to schedule
286 # This differs depending on whether the input is AOD or PHYS
287 # These are needed whatever the input since they are not applied in PHYS
288 thinningToolsArgs = {
289 'ElectronCaloClusterThinningToolName' : "PHYSLITEElectronCaloClusterThinningTool",
290 'PhotonCaloClusterThinningToolName' : "PHYSLITEPhotonCaloClusterThinningTool",
291 'ElectronGSFTPThinningToolName' : "PHYSLITEElectronGSFTPThinningTool",
292 'PhotonGSFTPThinningToolName' : "PHYSLITEPhotonGSFTPThinningTool"
293 }
294 # whereas these are only needed if the input is AOD since they are applied already in PHYS
295 if 'StreamAOD' in flags.Input.ProcessingTags:
296 thinningToolsArgs.update({
297 'TrackParticleThinningToolName' : "PHYSLITETrackParticleThinningTool",
298 'MuonTPThinningToolName' : "PHYSLITEMuonTPThinningTool",
299 'TauJetThinningToolName' : "PHYSLITETauJetThinningTool",
300 'TauJets_MuonRMThinningToolName' : "PHYSLITETauJets_MuonRMThinningTool",
301 'DiTauTPThinningToolName' : "PHYSLITEDiTauTPThinningTool",
302 'DiTauLowPtThinningToolName' : "PHYSLITEDiTauLowPtThinningTool",
303 'DiTauLowPtTPThinningToolName' : "PHYSLITEDiTauLowPtTPThinningTool",
304 })
305 # Configure the thinning tools
306 from DerivationFrameworkPhys.PhysCommonThinningConfig import PhysCommonThinningCfg
307 acc.merge(PhysCommonThinningCfg(flags, StreamName = kwargs['StreamName'], **thinningToolsArgs))
308 # Get them from the CA so they can be added to the kernel
309 thinningTools = []
310 for key in thinningToolsArgs:
311 thinningTools.append(acc.getPublicTool(thinningToolsArgs[key]))
312
313
314 # Higgs augmentations - 4l vertex, Higgs STXS truth variables, CloseBy isolation correction (for all analyses)
315 # For PhysLite, must run CloseBy BEFORE running analysis sequences to be able to 'pass through' to the shallow copy the added isolation values
316 # Here we only run the augmentation algs
317 # These do not need to be run if PhysLite is run from Phys (i.e. not from 'StreamAOD')
318 if 'StreamAOD' in flags.Input.ProcessingTags:
319 # running from AOD
320
321 from DerivationFrameworkHiggs.HiggsPhysContent import HiggsAugmentationAlgsCfg
322 acc.merge(HiggsAugmentationAlgsCfg(flags))
323
324
325 from IsolationSelection.IsolationSelectionConfig import IsoCloseByAlgsCfg
326 acc.merge(IsoCloseByAlgsCfg(flags, isPhysLite = True))
327
328 #==============================================================================
329 # Analysis-level variables
330 #==============================================================================
331
332 # Needed in principle to support MET association when running PHYS->PHYSLITE,
333 # but since this doesn't work for PHYS->PHYSLITE anyway, commenting for now
334 #if 'StreamDAOD_PHYS' in flags.Input.ProcessingTags
335 # from AtlasGeoModel.GeoModelConfig import GeoModelCfg
336 # acc.merge(GeoModelCfg(flags))
337
338 # add CP algorithms to job
339 acc.merge(CPAlgorithmsCfg(flags))
340
341 # Build MET from our analysis objects
342 if 'StreamAOD' in flags.Input.ProcessingTags:
343 from METReconstruction.METAssocCfg import AssocConfig, METAssocConfig
344 from METReconstruction.METAssociatorCfg import getAssocCA
345 associators = [AssocConfig('PFlowJet', 'AnalysisJets'),
346 AssocConfig('Muon', 'AnalysisMuons'),
347 AssocConfig('Ele', 'AnalysisElectrons'),
348 AssocConfig('Gamma', 'AnalysisPhotons'),
349 AssocConfig('Tau', 'AnalysisTauJets'),
350 AssocConfig('Soft', '')]
351 PHYSLITE_cfg = METAssocConfig('AnalysisMET',
352 flags,
353 associators,
354 doPFlow=True,
355 usePFOLinks=True)
356 components_PHYSLITE_cfg = getAssocCA(PHYSLITE_cfg,METName='AnalysisMET')
357 acc.merge(components_PHYSLITE_cfg)
358 elif 'StreamDAOD_PHYS' in flags.Input.ProcessingTags:
359 from DerivationFrameworkJetEtMiss.METCommonConfig import METRemappingCfg
360
361 METRemap_cfg = METRemappingCfg(flags)
362 acc.merge(METRemap_cfg)
363
364 # The derivation kernel itself
365 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
366 acc.addEventAlgo(DerivationKernel(name, ThinningTools = thinningTools))
367
368 return acc
369
370