8 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.Enums
import MetadataCategory
15 """Configure the derivation framework driving algorithm (kernel) for SUSY20"""
22 augmentationTools = []
26 from DerivationFrameworkBPhys.V0ToolConfig
import BPHY_Reco_V0FinderCfg
as Reco_V0Finder
27 SUSY20_RecoV0_Finder = acc.popToolsAndMerge(Reco_V0Finder(
29 derivation =
"SUSY20",
31 V0ContainerName =
"SUSY20RecoV0Candidates",
32 KshortContainerName =
"SUSY20RecoKshortCandidates",
33 LambdaContainerName =
"SUSY20RecoLambdaCandidates",
34 LambdabarContainerName =
"SUSY20RecoLambdabarCandidates",
35 CheckVertexContainers = [
"PrimaryVertices"]
37 acc.addPublicTool(SUSY20_RecoV0_Finder)
38 augmentationTools.append(SUSY20_RecoV0_Finder)
41 from VrtSecInclusive.VrtSecInclusiveConfig
import VrtSecInclusiveCfg
44 name =
"SUSY20_VrtSecInclusiveTool",
50 SelTrkMaxCutoff = 2000,
51 a0TrkPVDstMinCut = 0.0,
56 DoTruth = flags.Input.isMC,
57 doAugmentDVimpactParametersToMuons =
True,
58 doAugmentDVimpactParametersToElectrons =
True
62 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
63 deco_ptcones = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20, isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20]
64 deco_ptcones_suffix = [
"ptcone40",
"ptcone30",
"ptcone20",
"topoetcone40",
"topoetcone30",
"topoetcone20"]
65 deco_prefix =
'SUSY20_'
67 from IsolationAlgs.IsoToolsConfig
import TrackIsolationToolCfg
70 name =
"SUSY20TrackIsoTool",
72 SUSY20TrackIsoTool.TrackSelectionTool.maxZ0SinTheta = 1.5
73 SUSY20TrackIsoTool.TrackSelectionTool.maxD0 = 1.5
74 SUSY20TrackIsoTool.TrackSelectionTool.minPt = 1000
75 SUSY20TrackIsoTool.TrackSelectionTool.CutLevel =
"TightPrimary"
76 acc.addPublicTool(SUSY20TrackIsoTool)
78 from IsolationAlgs.IsoToolsConfig
import CaloIsolationToolCfg
79 from CaloIdentifier
import SUBCALO
82 name =
"SUSY20CaloIsoTool",
83 EMCaloNums = [SUBCALO.LAREM],
84 HadCaloNums = [SUBCALO.LARHEC, SUBCALO.TILE],
86 UseCaloExtensionCaching =
False,
87 saveOnlyRequestedCorrections =
True
89 acc.addPublicTool(SUSY20CaloIsoTool)
91 from DerivationFrameworkInDet.InDetToolsConfig
import IsolationTrackDecoratorCfg
94 name =
"SUSY20IDTrackDecoratorTool",
95 TrackIsolationTool = SUSY20TrackIsoTool,
96 CaloIsolationTool = SUSY20CaloIsoTool,
97 TargetContainer =
"InDetTrackParticles",
98 SelectionString =
"InDetTrackParticles.pt > 0.5*GeV",
100 isoSuffix = deco_ptcones_suffix,
101 Prefix = deco_prefix,
103 acc.addPublicTool(SUSY20IDTrackDecoratorTool)
104 augmentationTools.append(SUSY20IDTrackDecoratorTool)
107 '''# Electron TrackParticles isolation
108 SUSY20ElectronDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(
110 name = "SUSY20ElectronDecoratorTool",
111 TrackIsolationTool = SUSY20TrackIsoTool,
112 CaloIsolationTool = SUSY20CaloIsoTool,
113 TargetContainer = "Electrons",
114 iso = [isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
115 isoSuffix = ["topoetcone40", "topoetcone30", "topoetcone20"],
116 Prefix = deco_prefix,
118 acc.addPublicTool(SUSY20ElectronDecorator)
119 augmentationTools.append(SUSY20ElectronDecorator)
121 # Muon TrackParticles isolation
122 SUSY20MuonDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(
124 name = "SUSY20MuonDecoratorTool",
125 TrackIsolationTool = SUSY20TrackIsoTool,
126 CaloIsolationTool = SUSY20CaloIsoTool,
127 TargetContainer = "Muons",
128 iso = [isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
129 isoSuffix = ["topoetcone40", "topoetcone30", "topoetcone20"],
130 Prefix = deco_prefix,
132 acc.addPublicTool(SUSY20MuonDecorator)
133 augmentationTools.append(SUSY20MuonDecorator)
135 # Photon TrackParticles isolation
136 SUSY20PhotonDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(
138 name = "SUSY20PhotonDecoratorTool",
139 TrackIsolationTool = SUSY20TrackIsoTool,
140 CaloIsolationTool = SUSY20CaloIsoTool,
141 TargetContainer = "Photons",
142 iso = [isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
143 isoSuffix = ["topoetcone40", "topoetcone30", "topoetcone20"],
144 Prefix = deco_prefix,
146 acc.addPublicTool(SUSY20PhotonDecorator)
147 augmentationTools.append(SUSY20PhotonDecorator)'''
150 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
155 from DerivationFrameworkSUSY.SUSYToolsConfig
import SUSY20EventCleaningToolCfg
159 from IsolationSelection.IsolationSelectionConfig
import IsoCloseByAlgsCfg
160 contNames = [
"Muons",
"Electrons",
"Photons"]
164 containerNames = contNames,
166 stream_name = kwargs[
'StreamName']
170 from DerivationFrameworkFlavourTag.FtagDerivationConfig
import FtagJetCollectionsCfg
174 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
177 name =
"SUSY20TrackSelection",
178 ContainerName =
"InDetTrackParticles",
179 DecorationName =
"DFLoose"
181 SUSY20TrackSelection.TrackSelectionTool.CutLevel =
"Loose"
182 acc.addPublicTool(SUSY20TrackSelection)
183 augmentationTools.append(SUSY20TrackSelection)
189 thinningExpression =
"InDetTrackParticles.DFLoose && (InDetTrackParticles.pt > 0.5*GeV) && (abs( DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta) ) < 3.0*mm)"
192 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg
195 name =
"SUSY20TrackParticleThinningTool",
196 StreamName = kwargs[
'StreamName'],
197 SelectionString = thinningExpression,
198 InDetTrackParticlesKey =
"InDetTrackParticles"
200 acc.addPublicTool(SUSY20TrackParticleThinningTool)
201 thinningTools.append(SUSY20TrackParticleThinningTool)
204 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg
207 name =
"SUSY20MuonTPThinningTool",
208 StreamName = kwargs[
'StreamName'],
210 InDetTrackParticlesKey =
"InDetTrackParticles"
212 acc.addPublicTool(SUSY20MuonTPThinningTool)
213 thinningTools.append(SUSY20MuonTPThinningTool)
216 from DerivationFrameworkInDet.InDetToolsConfig
import EgammaTrackParticleThinningCfg
219 name =
"SUSY20ElectronTPThinningTool",
220 StreamName = kwargs[
'StreamName'],
222 InDetTrackParticlesKey =
"InDetTrackParticles"
224 acc.addPublicTool(SUSY20ElectronTPThinningTool)
225 thinningTools.append(SUSY20ElectronTPThinningTool)
228 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import GenericObjectThinningCfg
231 name =
"SUSY20PhotonThinningTool",
232 StreamName = kwargs[
'StreamName'],
233 ContainerName =
"Photons",
234 SelectionString =
"Photons.pt > 10*GeV"
236 acc.addPublicTool(SUSY20PhotonThinningTool)
237 thinningTools.append(SUSY20PhotonThinningTool)
242 name =
"SUSY20PhotonTPThinningTool",
243 StreamName = kwargs[
'StreamName'],
245 InDetTrackParticlesKey =
"InDetTrackParticles",
246 GSFConversionVerticesKey =
"GSFConversionVertices"
248 acc.addPublicTool(SUSY20PhotonTPThinningTool)
249 thinningTools.append(SUSY20PhotonTPThinningTool)
253 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig
import MenuTruthThinningCfg
256 name =
"SUSY20TruthThinningTool",
257 WritePartons =
False,
259 WriteBHadrons =
True,
261 GeantPhotonPtThresh = 20000,
263 PartonPtThresh = -1.0,
266 WriteBosonProducts =
False,
267 WriteBSMProducts =
True,
268 WriteTopAndDecays =
True,
269 WriteEverything =
False,
270 WriteAllLeptons =
True,
271 WriteLeptonsNotFromHadrons =
False,
272 WriteNotPhysical =
False,
274 PreserveAncestors =
True,
275 PreserveGeneratorDescendants =
True
277 acc.addPublicTool(SUSY20TruthThinningTool)
278 thinningTools.append(SUSY20TruthThinningTool)
286 from DerivationFrameworkSUSY.SUSYToolsConfig
import SUSY20DTTriggerSkimmingToolCfg
289 name =
"SUSY20TriggerSkimmingTool"
291 acc.addPublicTool(SUSY20TriggerSkimmingTool_DT)
294 jetRequirements_DT =
"AntiKt4EMPFlowJets.pt > 200*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.8"
295 jetSelection_DT =
"(count(" + jetRequirements_DT +
") >= 1)"
297 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import xAODStringSkimmingToolCfg
300 name =
"SUSY20JetSkimmingTool_DT",
301 expression = jetSelection_DT
303 acc.addPublicTool(SUSY20JetSkimmingTool_DT)
306 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import FilterCombinationANDCfg
309 name =
"SUSY20SkimmingTool_DT",
310 FilterList = [SUSY20JetSkimmingTool_DT, SUSY20TriggerSkimmingTool_DT]
312 acc.addPublicTool(SUSY20xAODSkimmingTool_DT)
313 skimmingTools.append(SUSY20xAODSkimmingTool_DT)
318 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
321 SkimmingTools = skimmingTools,
322 ThinningTools = thinningTools,
323 AugmentationTools = augmentationTools,
324 RunSkimmingFirst =
True
331 stream_name =
'StreamDAOD_SUSY20'
337 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
338 SUSY20TriggerListsHelper = TriggerListsHelper(flags)
341 acc.merge(
SUSY20KernelCfg(flags, name =
"SUSY20Kernel", StreamName = stream_name, TriggerListsHelper = SUSY20TriggerListsHelper))
345 from IsolationSelection.IsolationSelectionConfig
import IsoCloseByAlgsCfg
346 acc.merge(
IsoCloseByAlgsCfg(flags, suff =
"_SUSY20", isPhysLite =
False, stream_name = stream_name))
351 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
352 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
353 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
355 SUSY20SlimmingHelper =
SlimmingHelper(
"SUSY20SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
358 SUSY20SlimmingHelper.SmartCollections = [
363 "InDetTrackParticles",
367 "AntiKt4EMPFlowJets",
368 "BTagging_AntiKt4EMPFlow",
369 "MET_Baseline_AntiKt4EMPFlow",
374 SUSY20SlimmingHelper.ExtraVariables += [
375 "EventInfo.DFCommonJets_eventClean_TightBad.DFCommonJets_jetClean_TightBad",
376 "AntiKt4EMPFlowJets.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad",
377 "Electrons.DFCommonElectronsLHVeryLoose.DFCommonElectronsLHLoose.DFCommonElectronsLHLooseBL.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsLHVeryLooseIsEMValue.DFCommonElectronsLHLooseIsEMValue.DFCommonElectronsLHLooseBLIsEMValue.DFCommonElectronsLHMediumIsEMValue.DFCommonElectronsLHTightIsEMValue",
379 "Muons.ptcone40.ptcone30.ptcone20.charge.quality.InnerDetectorPt.MuonSpectrometerPt.CaloLRLikelihood.CaloMuonIDTag.eta_sampl.phi_sampl",
381 "Photons.DFCommonPhotonsIsEMLoose.DFCommonPhotonsIsEMTight",
383 "InDetTrackParticles.TRTdEdx.TRTdEdxUsedHits.hitPattern.numberOfContribPixelLayers.numberOfGangedFlaggedFakes.numberOfIBLOverflowsdEdx.numberOfPixelOutliers.numberOfPixelSplitHits.numberOfPixelSpoiltHits.numberOfSCTOutliers.numberOfSCTSpoiltHits.numberOfTRTDeadStraws.numberOfTRTHits.numberOfTRTHoles.numberOfTRTOutliers.numberOfTRTSharedHits.numberOfUsedHitsdEdx.pixeldEdx",
384 "InDetTrackParticles.chiSquared.d0.definingParametersCovMatrix.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberDoF.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfPixelSharedHits.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfSCTSharedHits.phi.qOverP.theta.z0",
385 "InDetTrackParticles.numberOfInnermostPixelLayerOutliers.numberOfInnermostPixelLayerSharedHits.numberOfInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerOutliers.numberOfNextToInnermostPixelLayerSharedHits.numberOfNextToInnermostPixelLayerSplitHits.numberOfGangedPixels.numberOfSCTDoubleHoles.numberOfTRTHighThresholdHits.numberOfTRTHighThresholdHitsTotal.numberOfTRTHighThresholdOutliers.numberOfTRTTubeHits.numberOfTRTXenonHits.numberOfOutliersOnTrack.standardDeviationOfChi2OS.eProbabilityHT.eProbabilityComb.TRTTrackOccupancy",
386 "InDetTrackParticles.SUSY20_ptcone20.SUSY20_ptcone30.SUSY20_ptcone40",
388 "InDetTrackParticles.SUSY20_topoetcone20.SUSY20_topoetcone30.SUSY20_topoetcone40.SUSY20_topoetcone20NonCoreCone.SUSY20_topoetcone30NonCoreCone.SUSY20_topoetcone40NonCoreCone",
389 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights",
390 "InDetTrackParticles.vertexLink.vz",
398 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTauAndDownstreamParticlesCfg
401 SUSY20SlimmingHelper.AllVariables += [
412 'TruthBosonsWithDecayParticles',
413 'TruthBosonsWithDecayVertices',
414 'TruthBSMWithDecayParticles',
415 'TruthBSMWithDecayVertices',
416 'TruthTausWithDecayParticles',
417 'TruthTausWithDecayVertices',
420 SUSY20SlimmingHelper.ExtraVariables += [
421 "Electrons.TruthLink",
424 "TruthEvents.Q.XF1.XF2.PDGID1.PDGID2.PDFID1.PDFID2.X1.X2.crossSection",
425 "InDetTrackParticles.TruthLink.truthMatchProbability.truthOrigin.truthType.truthParticleLink"
431 for containerName
in [
"SUSY20RecoV0Candidates",
"SUSY20RecoKshortCandidates",
"SUSY20RecoLambdaCandidates",
"SUSY20RecoLambdabarCandidates"]:
433 "xAOD::VertexContainer#%s"%containerName,
434 "xAOD::VertexAuxContainer#%sAux"%containerName
435 +
".-vxTrackAtVertex"
437 +
".-neutralParticleLinks"
444 +
".-gamma_massError"
445 +
".-gamma_probability",
449 VSITrackVars = [
"is_selected",
"is_associated",
"is_svtrk_final",
"pt_wrtSV",
"eta_wrtSV",
"phi_wrtSV",
"d0_wrtSV",
"z0_wrtSV",
"errP_wrtSV",
"errd0_wrtSV",
"errz0_wrtSV",
"chi2_toSV"]
450 SUSY20SlimmingHelper.ExtraVariables += [
"InDetTrackParticles." +
".".
join( VSITrackVars )]
453 'xAOD::VertexContainer#VrtSecInclusive_SecondaryVertices',
454 'xAOD::VertexAuxContainer#VrtSecInclusive_SecondaryVerticesAux'
455 +
'.-vxTrackAtVertex'
457 +
'.-neutralParticleLinks'
458 +
'.-trackParticleLinks'
462 SUSY20SlimmingHelper.StaticContent = StaticContent
465 from IsolationSelection.IsolationSelectionConfig
import setupIsoCloseBySlimmingVariables
469 SUSY20SlimmingHelper.IncludeTriggerNavigation =
False
470 SUSY20SlimmingHelper.IncludeMuonTriggerContent =
False
471 SUSY20SlimmingHelper.IncludeEGammaTriggerContent =
False
472 SUSY20SlimmingHelper.IncludeEtMissTriggerContent =
False
473 SUSY20SlimmingHelper.IncludeJetTriggerContent =
False
474 SUSY20SlimmingHelper.IncludeBJetTriggerContent =
False
475 SUSY20SlimmingHelper.IncludeBPhysTriggerContent =
False
476 SUSY20SlimmingHelper.IncludeTauTriggerContent =
False
477 SUSY20SlimmingHelper.IncludeMinBiasTriggerContent =
False
481 if flags.Trigger.EDMVersion == 2:
482 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
484 SlimmingHelper = SUSY20SlimmingHelper,
485 OutputContainerPrefix =
"TrigMatch_",
486 TriggerList = SUSY20TriggerListsHelper.Run2TriggerNamesTau
489 SlimmingHelper = SUSY20SlimmingHelper,
490 OutputContainerPrefix =
"TrigMatch_",
491 TriggerList = SUSY20TriggerListsHelper.Run2TriggerNamesNoTau
494 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
495 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
499 SUSY20ItemList = SUSY20SlimmingHelper.GetItemList()
500 acc.merge(
OutputStreamCfg(flags,
"DAOD_SUSY20", ItemList = SUSY20ItemList, AcceptAlgs = [
"SUSY20Kernel"]))
501 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_SUSY20", AcceptAlgs = [
"SUSY20Kernel"], createMetadata = [MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))