6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
7 from AthenaConfiguration.ComponentFactory
import CompFactory
8 from AthenaConfiguration.Enums
import MetadataCategory, LHCPeriod
12 """Configure the derivation framework driving algorithm (kernel) for JETM2"""
16 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
21 truthThinningTool = CompFactory.DerivationFramework.MenuTruthThinning(name =
"JETM2TruthThinning",
22 StreamName = kwargs[
'StreamName'],
23 WriteAllStable =
True,
27 WriteCHadrons =
False,
31 acc.addPublicTool(truthThinningTool)
33 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
34 acc.addEventAlgo(
DerivationKernel(name, ThinningTools = [truthThinningTool]
if flags.Input.isMC
else []))
46 from JetRecConfig.JetRecConfig
import JetRecCfg, getInputAlgs, getConstitPJGAlg
47 from JetRecConfig.JetInputConfig
import buildEventShapeAlg
48 from JetRecConfig.StandardJetConstits
import stdConstitDic
as cst
49 from JetRecConfig.StandardSmallRJets
import AntiKt4UFOCSSKNoPtCut, AntiKt4EMPFlowNoPtCut, AntiKt4EMTopoNoPtCut
50 from JetRecConfig.StandardLargeRJets
import AntiKt10TruthDressedWZSoftDrop
58 if isinstance(alg, ComponentAccumulator):
66 jetList = [AntiKt4UFOCSSKNoPtCut,AntiKt4EMPFlowNoPtCut,AntiKt4EMTopoNoPtCut]
72 jetList += [AntiKt10TruthDressedWZSoftDrop]
91 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import AddTopQuarkAndDownstreamParticlesCfg, AddTruthCollectionNavigationDecorationsCfg
107 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
108 JETM2TriggerListsHelper = TriggerListsHelper(flags)
111 acc.merge(
JETM2KernelCfg(flags, name=
"JETM2Kernel", StreamName =
'StreamDAOD_JETM2', TriggerListsHelper = JETM2TriggerListsHelper))
116 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
117 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
118 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
120 JETM2SlimmingHelper =
SlimmingHelper(
"JETM2SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
122 JETM2SlimmingHelper.SmartCollections = [
"EventInfo",
"InDetTrackParticles",
"PrimaryVertices",
123 "Electrons",
"Photons",
"Muons",
"TauJets",
124 "MET_Baseline_AntiKt4EMPFlow",
125 "AntiKt4EMTopoNoPtCutJets",
"AntiKt4EMPFlowJets",
126 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
127 "BTagging_AntiKt4EMPFlow",
128 "BTagging_AntiKtVR30Rmax4Rmin02Track"]
130 JETM2SlimmingHelper.AllVariables = [
"CaloCalFwdTopoTowers",
131 "CHSGChargedParticleFlowObjects",
"CHSGNeutralParticleFlowObjects",
132 "CSSKGChargedParticleFlowObjects",
"CSSKGNeutralParticleFlowObjects",
133 "Kt4EMTopoOriginEventShape",
"Kt4EMPFlowEventShape",
"Kt4EMPFlowPUSBEventShape",
134 "Kt4EMPFlowNeutEventShape",
"Kt4UFOCSSKEventShape",
"Kt4UFOCSSKNeutEventShape"]
137 from DerivationFrameworkJetEtMiss.CommonJETMXContent
import ClusterVariables, FlowElementVariables, UFOVariables, TrackingVariables, TrackingVariablesHGTD, FELinks
138 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"CaloCalTopoClusters"] + ClusterVariables)]
139 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"GlobalChargedParticleFlowObjects"] + FlowElementVariables)]
140 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"GlobalNeutralParticleFlowObjects"] + FlowElementVariables)]
141 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"UFO"] + UFOVariables)]
142 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"UFOCSSK"] + UFOVariables)]
143 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"InDetTrackParticles"] + TrackingVariables)]
144 if flags.GeoModel.Run >= LHCPeriod.Run4:
145 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"InDetTrackParticles"] + TrackingVariablesHGTD)]
148 JETM2SlimmingHelper.ExtraVariables += FELinks
151 from DerivationFrameworkJetEtMiss.CommonJETMXContent
import ExtraJSSVariables
152 JETM2SlimmingHelper.ExtraVariables += [
".".
join([
"AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets"] + ExtraJSSVariables)]
155 from DerivationFrameworkJetEtMiss.CommonJETMXContent
import JSSTaggersVariables
156 JETM2SlimmingHelper.ExtraVariables += JSSTaggersVariables
158 JETM2SlimmingHelper.ExtraVariables += [
"AntiKt4EMPFlowJets.GhostTower.IsoFixedCone5Pt.IsoFixedCone5PtPUsub",
159 "AntiKt4EMTopoNoPtCutJets.IsoFixedCone5Pt.IsoFixedCone5PtPUsub",
160 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.SizeParameter",
161 "GSFTrackParticles.particleHypothesis.vx.vy.vz",
162 "PrimaryVertices.x.y.z.covariance.trackWeights",
163 "TauJets.clusterLinks",
164 "Muons.energyLossType.EnergyLoss.ParamEnergyLoss.MeasEnergyLoss.EnergyLossSigma.MeasEnergyLossSigma.ParamEnergyLossSigmaPlus.ParamEnergyLossSigmaMinus.clusterLinks.FSR_CandidateEnergy",
165 "MuonSegments.x.y.z.px.py.pz",
166 "BTagging_AntiKt4EMPFlow.jetLink",
167 "BTagging_AntiKtVR30Rmax4Rmin02Track.jetLink"]
169 JETM2SlimmingHelper.AppendToDictionary.update({
'CSSKGNeutralParticleFlowObjects':
'xAOD::FlowElementContainer',
170 'CSSKGNeutralParticleFlowObjectsAux':
'xAOD::ShallowAuxContainer',
171 'CSSKGChargedParticleFlowObjects':
'xAOD::FlowElementContainer',
172 'CSSKGChargedParticleFlowObjectsAux':
'xAOD::ShallowAuxContainer',
173 'UFO':
'xAOD::FlowElementContainer',
174 'UFOAux':
'xAOD::FlowElementAuxContainer',
175 'Kt4UFOCSSKEventShape':
'xAOD::EventShape',
176 'Kt4UFOCSSKEventShapeAux':
'xAOD::EventShapeAuxInfo',
177 'Kt4UFOCSSKNeutEventShape':
'xAOD::EventShape',
178 'Kt4UFOCSSKNeutEventShapeAux':
'xAOD::EventShapeAuxInfo',
179 'AntiKt4EMTopoNoPtCutJets':
'xAOD::JetContainer',
180 'AntiKt4EMTopoNoPtCutJetsAux':
'xAOD::JetAuxContainer'})
182 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addOriginCorrectedClustersToSlimmingTool
188 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
191 JETM2SlimmingHelper.AppendToDictionary.update({
'TruthParticles':
'xAOD::TruthParticleContainer',
192 'TruthParticlesAux':
'xAOD::TruthParticleAuxContainer'})
194 JETM2SlimmingHelper.AllVariables += [
"TruthTopQuarkWithDecayParticles",
"TruthTopQuarkWithDecayVertices",
"TruthHFWithDecayParticles",
195 "AntiKt4TruthJets",
"InTimeAntiKt4TruthJets",
"OutOfTimeAntiKt4TruthJets",
196 "TruthParticles",
"TruthVertices",
"TruthEvents"]
197 JETM2SlimmingHelper.ExtraVariables += [
"AntiKt10TruthSoftDropBeta100Zcut10Jets.SizeParameter"]
198 JETM2SlimmingHelper.SmartCollections += [
"AntiKt4TruthJets",
"AntiKt10TruthJets",
"AntiKt4TruthWZJets",
"AntiKt10TruthDressedWZSoftDropBeta100Zcut10Jets"]
200 JETM2SlimmingHelper.ExtraVariables += [
"AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.GhostTQuarksFinalCount.GhostHBosonsCount.GhostZBosonsCount.GhostWBosonsCount",
201 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.GhostTQuarksFinalPt.GhostHBosonsPt.GhostZBosonsPt.GhostWBosonsPt",
202 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets.GhostBHadronsFinalPt.GhostCHadronsFinalPt",
203 "AntiKt4TruthWZJets.IsoFixedCone5Pt",
204 "AntiKt4TruthDressedWZJets.IsoFixedCone5Pt"]
207 JETM2SlimmingHelper.IncludeTriggerNavigation =
False
208 JETM2SlimmingHelper.IncludeJetTriggerContent =
False
209 JETM2SlimmingHelper.IncludeMuonTriggerContent =
False
210 JETM2SlimmingHelper.IncludeEGammaTriggerContent =
False
211 JETM2SlimmingHelper.IncludeTauTriggerContent =
False
212 JETM2SlimmingHelper.IncludeEtMissTriggerContent =
False
213 JETM2SlimmingHelper.IncludeBJetTriggerContent =
False
214 JETM2SlimmingHelper.IncludeBPhysTriggerContent =
False
215 JETM2SlimmingHelper.IncludeMinBiasTriggerContent =
False
217 jetOutputList = [
"AntiKt4UFOCSSKNoPtCutJets",
"AntiKt4EMPFlowNoPtCutJets"]
218 from DerivationFrameworkJetEtMiss.JetCommonConfig
import addJetsToSlimmingTool
222 JETM2ItemList = JETM2SlimmingHelper.GetItemList()
223 acc.merge(
OutputStreamCfg(flags,
"DAOD_JETM2", ItemList=JETM2ItemList, AcceptAlgs=[
"JETM2Kernel"]))
224 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_JETM2", AcceptAlgs=[
"JETM2Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))