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",
45 AugmentingVersionString =
"_SUSY20",
51 SelTrkMaxCutoff = 2000,
52 a0TrkPVDstMinCut = 0.0,
57 DoTruth = flags.Input.isMC,
61 from xAODPrimitives.xAODIso
import xAODIso
as isoPar
62 deco_ptcones = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20, isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20]
63 deco_ptcones_suffix = [
"ptcone40",
"ptcone30",
"ptcone20",
"topoetcone40",
"topoetcone30",
"topoetcone20"]
64 deco_prefix =
'SUSY20_'
66 from IsolationAlgs.IsoToolsConfig
import TrackIsolationToolCfg
69 name =
"SUSY20TrackIsoTool",
71 SUSY20TrackIsoTool.TrackSelectionTool.maxZ0SinTheta = 1.5
72 SUSY20TrackIsoTool.TrackSelectionTool.maxD0 = 1.5
73 SUSY20TrackIsoTool.TrackSelectionTool.minPt = 1000
74 SUSY20TrackIsoTool.TrackSelectionTool.CutLevel =
"TightPrimary"
75 acc.addPublicTool(SUSY20TrackIsoTool)
77 from IsolationAlgs.IsoToolsConfig
import CaloIsolationToolCfg
78 from CaloIdentifier
import SUBCALO
81 name =
"SUSY20CaloIsoTool",
82 EMCaloNums = [SUBCALO.LAREM],
83 HadCaloNums = [SUBCALO.LARHEC, SUBCALO.TILE],
85 UseCaloExtensionCaching =
False,
86 saveOnlyRequestedCorrections =
True
88 acc.addPublicTool(SUSY20CaloIsoTool)
90 from DerivationFrameworkInDet.InDetToolsConfig
import IsolationTrackDecoratorCfg
93 name =
"SUSY20IDTrackDecoratorTool",
94 TrackIsolationTool = SUSY20TrackIsoTool,
95 CaloIsolationTool = SUSY20CaloIsoTool,
96 TargetContainer =
"InDetTrackParticles",
97 SelectionString =
"InDetTrackParticles.pt > 0.5*GeV",
99 isoSuffix = deco_ptcones_suffix,
100 Prefix = deco_prefix,
102 acc.addPublicTool(SUSY20IDTrackDecoratorTool)
103 augmentationTools.append(SUSY20IDTrackDecoratorTool)
106 '''# Electron TrackParticles isolation
107 SUSY20ElectronDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(
109 name = "SUSY20ElectronDecoratorTool",
110 TrackIsolationTool = SUSY20TrackIsoTool,
111 CaloIsolationTool = SUSY20CaloIsoTool,
112 TargetContainer = "Electrons",
113 iso = [isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
114 isoSuffix = ["topoetcone40", "topoetcone30", "topoetcone20"],
115 Prefix = deco_prefix,
117 acc.addPublicTool(SUSY20ElectronDecorator)
118 augmentationTools.append(SUSY20ElectronDecorator)
120 # Muon TrackParticles isolation
121 SUSY20MuonDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(
123 name = "SUSY20MuonDecoratorTool",
124 TrackIsolationTool = SUSY20TrackIsoTool,
125 CaloIsolationTool = SUSY20CaloIsoTool,
126 TargetContainer = "Muons",
127 iso = [isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
128 isoSuffix = ["topoetcone40", "topoetcone30", "topoetcone20"],
129 Prefix = deco_prefix,
131 acc.addPublicTool(SUSY20MuonDecorator)
132 augmentationTools.append(SUSY20MuonDecorator)
134 # Photon TrackParticles isolation
135 SUSY20PhotonDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(
137 name = "SUSY20PhotonDecoratorTool",
138 TrackIsolationTool = SUSY20TrackIsoTool,
139 CaloIsolationTool = SUSY20CaloIsoTool,
140 TargetContainer = "Photons",
141 iso = [isoPar.topoetcone40, isoPar.topoetcone30, isoPar.topoetcone20],
142 isoSuffix = ["topoetcone40", "topoetcone30", "topoetcone20"],
143 Prefix = deco_prefix,
145 acc.addPublicTool(SUSY20PhotonDecorator)
146 augmentationTools.append(SUSY20PhotonDecorator)'''
149 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
153 from DerivationFrameworkInDet.InDetToolsConfig
import InDetTrackSelectionToolWrapperCfg
156 name =
"SUSY20TrackSelection",
157 ContainerName =
"InDetTrackParticles",
158 DecorationName =
"DFLoose"
160 SUSY20TrackSelection.TrackSelectionTool.CutLevel =
"Loose"
161 acc.addPublicTool(SUSY20TrackSelection)
162 augmentationTools.append(SUSY20TrackSelection)
168 thinningExpression =
"InDetTrackParticles.DFLoose && (InDetTrackParticles.pt > 0.5*GeV) && (abs( DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta) ) < 3.0*mm)"
171 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg
174 name =
"SUSY20TrackParticleThinningTool",
175 StreamName = kwargs[
'StreamName'],
176 SelectionString = thinningExpression,
177 InDetTrackParticlesKey =
"InDetTrackParticles"
179 acc.addPublicTool(SUSY20TrackParticleThinningTool)
180 thinningTools.append(SUSY20TrackParticleThinningTool)
183 from DerivationFrameworkInDet.InDetToolsConfig
import MuonTrackParticleThinningCfg
186 name =
"SUSY20MuonTPThinningTool",
187 StreamName = kwargs[
'StreamName'],
189 InDetTrackParticlesKey =
"InDetTrackParticles"
191 acc.addPublicTool(SUSY20MuonTPThinningTool)
192 thinningTools.append(SUSY20MuonTPThinningTool)
195 from DerivationFrameworkInDet.InDetToolsConfig
import EgammaTrackParticleThinningCfg
198 name =
"SUSY20ElectronTPThinningTool",
199 StreamName = kwargs[
'StreamName'],
201 InDetTrackParticlesKey =
"InDetTrackParticles"
203 acc.addPublicTool(SUSY20ElectronTPThinningTool)
204 thinningTools.append(SUSY20ElectronTPThinningTool)
207 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import GenericObjectThinningCfg
210 name =
"SUSY20PhotonThinningTool",
211 StreamName = kwargs[
'StreamName'],
212 ContainerName =
"Photons",
213 SelectionString =
"Photons.pt > 10*GeV"
215 acc.addPublicTool(SUSY20PhotonThinningTool)
216 thinningTools.append(SUSY20PhotonThinningTool)
221 name =
"SUSY20PhotonTPThinningTool",
222 StreamName = kwargs[
'StreamName'],
224 InDetTrackParticlesKey =
"InDetTrackParticles",
225 GSFConversionVerticesKey =
"GSFConversionVertices"
227 acc.addPublicTool(SUSY20PhotonTPThinningTool)
228 thinningTools.append(SUSY20PhotonTPThinningTool)
232 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig
import MenuTruthThinningCfg
235 name =
"SUSY20TruthThinningTool",
236 WritePartons =
False,
238 WriteBHadrons =
True,
240 GeantPhotonPtThresh = 20000,
242 PartonPtThresh = -1.0,
245 WriteBosonProducts =
False,
246 WriteBSMProducts =
True,
247 WriteTopAndDecays =
True,
248 WriteEverything =
False,
249 WriteAllLeptons =
True,
250 WriteLeptonsNotFromHadrons =
False,
251 WriteNotPhysical =
False,
253 PreserveAncestors =
True,
254 PreserveGeneratorDescendants =
True
256 acc.addPublicTool(SUSY20TruthThinningTool)
257 thinningTools.append(SUSY20TruthThinningTool)
265 from DerivationFrameworkSUSY.SUSYToolsConfig
import SUSY20DTTriggerSkimmingToolCfg
268 name =
"SUSY20TriggerSkimmingTool"
270 acc.addPublicTool(SUSY20TriggerSkimmingTool_DT)
273 jetRequirements_DT =
"AntiKt4EMPFlowJets.pt > 200*GeV && abs(AntiKt4EMPFlowJets.eta) < 2.8"
274 jetSelection_DT =
"(count(" + jetRequirements_DT +
") >= 1)"
276 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import xAODStringSkimmingToolCfg
279 name =
"SUSY20JetSkimmingTool_DT",
280 expression = jetSelection_DT
282 acc.addPublicTool(SUSY20JetSkimmingTool_DT)
285 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import FilterCombinationANDCfg
288 name =
"SUSY20SkimmingTool_DT",
289 FilterList = [SUSY20JetSkimmingTool_DT, SUSY20TriggerSkimmingTool_DT]
291 acc.addPublicTool(SUSY20xAODSkimmingTool_DT)
292 skimmingTools.append(SUSY20xAODSkimmingTool_DT)
297 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
300 SkimmingTools = skimmingTools,
301 ThinningTools = thinningTools,
302 AugmentationTools = augmentationTools,
303 RunSkimmingFirst =
True
310 stream_name =
'StreamDAOD_SUSY20'
316 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
317 SUSY20TriggerListsHelper = TriggerListsHelper(flags)
320 acc.merge(
SUSY20KernelCfg(flags, name =
"SUSY20Kernel", StreamName = stream_name, TriggerListsHelper = SUSY20TriggerListsHelper))
324 from IsolationSelection.IsolationSelectionConfig
import IsoCloseByAlgsCfg
325 acc.merge(
IsoCloseByAlgsCfg(flags, suff =
"_SUSY20", isPhysLite =
False, containerNames = [
"Muons",
"Electrons",
"Photons"], useSelTools =
True, stream_name = stream_name))
330 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
331 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
332 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
334 SUSY20SlimmingHelper =
SlimmingHelper(
"SUSY20SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
337 SUSY20SlimmingHelper.SmartCollections = [
342 "InDetTrackParticles",
345 "AntiKt4EMPFlowJets",
346 "BTagging_AntiKt4EMPFlow",
347 "MET_Baseline_AntiKt4EMPFlow",
352 SUSY20SlimmingHelper.ExtraVariables += [
353 "EventInfo.DFCommonJets_eventClean_TightBad.DFCommonJets_jetClean_TightBad",
354 "AntiKt4EMPFlowJets.DFCommonJets_jetClean_LooseBad.DFCommonJets_jetClean_TightBad",
355 "Electrons.DFCommonElectronsLHVeryLoose.DFCommonElectronsLHLoose.DFCommonElectronsLHLooseBL.DFCommonElectronsLHMedium.DFCommonElectronsLHTight.DFCommonElectronsLHVeryLooseIsEMValue.DFCommonElectronsLHLooseIsEMValue.DFCommonElectronsLHLooseBLIsEMValue.DFCommonElectronsLHMediumIsEMValue.DFCommonElectronsLHTightIsEMValue",
357 "Muons.ptcone40.ptcone30.ptcone20.charge.quality.InnerDetectorPt.MuonSpectrometerPt.CaloLRLikelihood.CaloMuonIDTag.eta_sampl.phi_sampl",
359 "Photons.DFCommonPhotonsIsEMLoose.DFCommonPhotonsIsEMTight",
361 "InDetTrackParticles.TRTdEdx.TRTdEdxUsedHits.hitPattern.numberOfContribPixelLayers.numberOfGangedFlaggedFakes.numberOfIBLOverflowsdEdx.numberOfPixelOutliers.numberOfPixelSplitHits.numberOfPixelSpoiltHits.numberOfSCTOutliers.numberOfSCTSpoiltHits.numberOfTRTDeadStraws.numberOfTRTHits.numberOfTRTHoles.numberOfTRTOutliers.numberOfTRTSharedHits.numberOfUsedHitsdEdx.pixeldEdx",
362 "InDetTrackParticles.chiSquared.d0.definingParametersCovMatrix.expectInnermostPixelLayerHit.expectNextToInnermostPixelLayerHit.numberDoF.numberOfInnermostPixelLayerHits.numberOfNextToInnermostPixelLayerHits.numberOfPixelDeadSensors.numberOfPixelHits.numberOfPixelHoles.numberOfPixelSharedHits.numberOfSCTDeadSensors.numberOfSCTHits.numberOfSCTHoles.numberOfSCTSharedHits.phi.qOverP.theta.z0",
363 "InDetTrackParticles.numberOfInnermostPixelLayerOutliers.numberOfInnermostPixelLayerSharedHits.numberOfInnermostPixelLayerSplitHits.numberOfNextToInnermostPixelLayerOutliers.numberOfNextToInnermostPixelLayerSharedHits.numberOfNextToInnermostPixelLayerSplitHits.numberOfGangedPixels.numberOfSCTDoubleHoles.numberOfTRTHighThresholdHits.numberOfTRTHighThresholdHitsTotal.numberOfTRTHighThresholdOutliers.numberOfTRTTubeHits.numberOfTRTXenonHits.numberOfOutliersOnTrack.standardDeviationOfChi2OS.eProbabilityHT.eProbabilityComb.TRTTrackOccupancy",
364 "InDetTrackParticles.SUSY20_ptcone20.SUSY20_ptcone30.SUSY20_ptcone40",
366 "InDetTrackParticles.SUSY20_topoetcone20.SUSY20_topoetcone30.SUSY20_topoetcone40.SUSY20_topoetcone20NonCoreCone.SUSY20_topoetcone30NonCoreCone.SUSY20_topoetcone40NonCoreCone",
367 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights",
368 "InDetTrackParticles.vertexLink.vz",
376 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTauAndDownstreamParticlesCfg
379 SUSY20SlimmingHelper.AllVariables += [
390 'TruthBosonsWithDecayParticles',
391 'TruthBosonsWithDecayVertices',
392 'TruthBSMWithDecayParticles',
393 'TruthBSMWithDecayVertices',
394 'TruthTausWithDecayParticles',
395 'TruthTausWithDecayVertices',
397 'AntiKt4TruthDressedWZJets'
399 SUSY20SlimmingHelper.ExtraVariables += [
400 "Electrons.TruthLink",
403 "TruthEvents.Q.XF1.XF2.PDGID1.PDGID2.PDFID1.PDFID2.X1.X2.crossSection",
404 "InDetTrackParticles.TruthLink.truthMatchProbability.truthOrigin.truthType.truthParticleLink"
410 for containerName
in [
"SUSY20RecoV0Candidates",
"SUSY20RecoKshortCandidates",
"SUSY20RecoLambdaCandidates",
"SUSY20RecoLambdabarCandidates"]:
412 "xAOD::VertexContainer#%s"%containerName,
413 "xAOD::VertexAuxContainer#%sAux"%containerName
414 +
".-vxTrackAtVertex"
416 +
".-neutralParticleLinks"
423 +
".-gamma_massError"
424 +
".-gamma_probability",
428 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"]
429 SUSY20SlimmingHelper.ExtraVariables += [
"InDetTrackParticles." +
".".
join( var +
"_SUSY20" for var
in VSITrackVars )]
432 'xAOD::VertexContainer#VrtSecInclusive_SecondaryVertices_SUSY20',
433 'xAOD::VertexAuxContainer#VrtSecInclusive_SecondaryVertices_SUSY20Aux'
434 +
'.-vxTrackAtVertex'
436 +
'.-neutralParticleLinks'
437 +
'.-trackParticleLinks'
441 SUSY20SlimmingHelper.StaticContent = StaticContent
444 from IsolationSelection.IsolationSelectionConfig
import setupIsoCloseBySlimmingVariables
448 SUSY20SlimmingHelper.IncludeTriggerNavigation =
False
449 SUSY20SlimmingHelper.IncludeMuonTriggerContent =
False
450 SUSY20SlimmingHelper.IncludeEGammaTriggerContent =
False
451 SUSY20SlimmingHelper.IncludeEtMissTriggerContent =
False
452 SUSY20SlimmingHelper.IncludeJetTriggerContent =
False
453 SUSY20SlimmingHelper.IncludeBJetTriggerContent =
False
454 SUSY20SlimmingHelper.IncludeBPhysTriggerContent =
False
455 SUSY20SlimmingHelper.IncludeTauTriggerContent =
False
456 SUSY20SlimmingHelper.IncludeMinBiasTriggerContent =
False
460 if flags.Trigger.EDMVersion == 2:
461 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
463 SlimmingHelper = SUSY20SlimmingHelper,
464 OutputContainerPrefix =
"TrigMatch_",
465 TriggerList = SUSY20TriggerListsHelper.Run2TriggerNamesTau
468 SlimmingHelper = SUSY20SlimmingHelper,
469 OutputContainerPrefix =
"TrigMatch_",
470 TriggerList = SUSY20TriggerListsHelper.Run2TriggerNamesNoTau
473 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
474 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
478 SUSY20ItemList = SUSY20SlimmingHelper.GetItemList()
479 acc.merge(
OutputStreamCfg(flags,
"DAOD_SUSY20", ItemList = SUSY20ItemList, AcceptAlgs = [
"SUSY20Kernel"]))
480 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_SUSY20", AcceptAlgs = [
"SUSY20Kernel"], createMetadata = [MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))