10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory
import CompFactory
12 from DerivationFrameworkEGamma.ElectronsCPDetailedContent
import GSFTracksCPDetailedContent
13 from AthenaConfiguration.Enums
import LHCPeriod, MetadataCategory
17 """Configure the derivation framework driving algorithm (kernel) for PHYSVAL"""
21 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
25 if flags.Tracking.doLargeD0:
26 from DerivationFrameworkLLP.PhysValLLPConfig
import PhysValLLPCfg
30 from DerivationFrameworkEGamma.EGammaLRTConfig
import EGammaLRTCfg
33 from DerivationFrameworkLLP.LLPToolsConfig
import LRTElectronLHSelectorsCfg
37 from DerivationFrameworkMuons.MuonsCommonConfig
import MuonsCommonCfg
42 from JetRecConfig.StandardSmallRJets
import AntiKt4LCTopo
43 from JetRecConfig.JetRecConfig
import JetRecCfg
48 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
61 from DerivationFrameworkPhys.TriggerListsHelper
import TriggerListsHelper
62 PHYSVALTriggerListsHelper = TriggerListsHelper(flags)
65 acc.merge(
PHYSVALKernelCfg(flags, name=
"PHYSVALKernel", StreamName =
'StreamDAOD_PHYSVAL', TriggerListsHelper = PHYSVALTriggerListsHelper))
70 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
71 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
72 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
74 PHYSVALSlimmingHelper =
SlimmingHelper(
"PHYSVALSlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
75 PHYSVALSlimmingHelper.SmartCollections = [
"EventInfo",
82 "InDetTrackParticles",
83 "InDetLargeD0TrackParticles",
87 "BTagging_AntiKt4EMPFlow",
88 "BTagging_AntiKtVR30Rmax4Rmin02Track",
89 "MET_Baseline_AntiKt4EMTopo",
90 "MET_Baseline_AntiKt4EMPFlow",
94 "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
95 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
96 "AntiKtVR30Rmax4Rmin02PV0TrackJets"]
98 PHYSVALSlimmingHelper.AllVariables = [
"EventInfo",
99 "Electrons",
"ForwardElectrons",
"LRTElectrons",
101 "Muons",
"CombinedMuonTrackParticles",
"ExtrapolatedMuonTrackParticles",
103 "MuonSpectrometerTrackParticles",
"MSOnlyExtrapolatedMuonTrackParticles",
"MuonSegments",
105 "InDetTrackParticles",
"InDetForwardTrackParticles",
106 "InDetLargeD0TrackParticles",
108 "AntiKt4EMPFlowJets",
110 "BTagging_AntiKt4EMPFlow",
111 "BTagging_AntiKt4EMTopo",
112 "BTagging_AntiKtVR30Rmax4Rmin02Track",
113 "BTagging_AntiKt4EMPFlowJFVtx",
114 "BTagging_AntiKt4EMPFlowJFVtxFlip",
115 "BTagging_AntiKt4EMPFlowSecVtx",
116 "BTagging_AntiKt4EMPFlowSecVtxFlip",
121 "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets",
"AntiKt10LCTopoJets",
"AntiKt4LCTopoJets",
"AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
122 "TruthParticles",
"TruthEvents",
"TruthVertices",
"MuonTruthParticles",
"egammaTruthParticles",
124 "MET_Truth",
"MET_TruthRegions",
125 "TruthElectrons",
"TruthMuons",
"TruthPhotons",
"TruthTaus",
"TruthNeutrinos",
"TruthBSM",
"TruthTop",
"TruthBoson",
126 "CaloCalTopoClusters",
"EMOriginTopoClusters",
"LCOriginTopoClusters",
127 "JetETMissChargedParticleFlowObjects",
"JetETMissNeutralParticleFlowObjects"]
129 if flags.GeoModel.Run >= LHCPeriod.Run4:
130 PHYSVALSlimmingHelper.AllVariables += [
"BTagging_AntiKt4EMTopoJFVtx",
131 "BTagging_AntiKt4EMTopoJFVtxFlip",
132 "BTagging_AntiKt4EMTopoSecVtx",
133 "BTagging_AntiKt4EMTopoSecVtxFlip"]
136 AddPseudoTracks =
False
138 PseudoTrackContainers = [
139 "InDetPseudoTrackParticles",
140 "InDetReplacedWithPseudoTrackParticles",
141 "InDetReplacedWithPseudoFromBTrackParticles",
142 "InDetReplacedWithPseudoNotFromBTrackParticles",
143 "InDetPlusPseudoTrackParticles",
144 "InDetPlusPseudoFromBTrackParticles",
145 "InDetPlusPseudoNotFromBTrackParticles",
146 "InDetNoFakesTrackParticles",
147 "InDetNoFakesFromBTrackParticles",
148 "InDetNoFakesNotFromBTrackParticles",
149 "InDetSiSPSeededTracksParticles"]
150 PHYSVALSlimmingHelper.SmartCollections += PseudoTrackContainers
151 PHYSVALSlimmingHelper.AllVariables += PseudoTrackContainers
153 excludedVertexAuxData =
"-vxTrackAtVertex.-MvfFitInfo.-isInitialized.-VTAV"
155 StaticContent += [
"xAOD::VertexContainer#SoftBVrtClusterTool_Tight_Vertices"]
156 StaticContent += [
"xAOD::VertexAuxContainer#SoftBVrtClusterTool_Tight_VerticesAux." + excludedVertexAuxData]
157 StaticContent += [
"xAOD::VertexContainer#SoftBVrtClusterTool_Medium_Vertices"]
158 StaticContent += [
"xAOD::VertexAuxContainer#SoftBVrtClusterTool_Medium_VerticesAux." + excludedVertexAuxData]
159 StaticContent += [
"xAOD::VertexContainer#SoftBVrtClusterTool_Loose_Vertices"]
160 StaticContent += [
"xAOD::VertexAuxContainer#SoftBVrtClusterTool_Loose_VerticesAux." + excludedVertexAuxData]
161 StaticContent += [
"xAOD::VertexAuxContainer#BTagging_AntiKt4EMPFlowSecVtxAux.-vxTrackAtVertex"]
162 for wp
in [
"",
"_LeptonsMod_LRTR3_1p0"]:
163 StaticContent += [
"xAOD::VertexContainer#VrtSecInclusive_SecondaryVertices" + wp]
164 StaticContent += [
"xAOD::VertexAuxContainer#VrtSecInclusive_SecondaryVertices" + wp +
"Aux."]
166 if flags.BTagging.RunFlipTaggers
is True:
167 StaticContent += [
"xAOD::VertexAuxContainer#BTagging_AntiKt4EMPFlowSecVtxFlipAux.-vxTrackAtVertex"]
169 if flags.GeoModel.Run >= LHCPeriod.Run4:
170 StaticContent += [
"xAOD::VertexAuxContainer#BTagging_AntiKt4EMTopoSecVtxAux.-vxTrackAtVertex"]
171 if flags.BTagging.RunFlipTaggers
is True:
172 StaticContent += [
"xAOD::VertexAuxContainer#BTagging_AntiKt4EMTopoSecVtxFlipAux.-vxTrackAtVertex"]
175 PHYSVALSlimmingHelper.StaticContent = StaticContent
179 PHYSVALSlimmingHelper.AppendToDictionary = {
'TruthEvents':
'xAOD::TruthEventContainer',
'TruthEventsAux':
'xAOD::TruthEventAuxContainer',
180 'MET_Truth':
'xAOD::MissingETContainer',
'MET_TruthAux':
'xAOD::MissingETAuxContainer',
181 'TruthElectrons':
'xAOD::TruthParticleContainer',
'TruthElectronsAux':
'xAOD::TruthParticleAuxContainer',
182 'TruthMuons':
'xAOD::TruthParticleContainer',
'TruthMuonsAux':
'xAOD::TruthParticleAuxContainer',
183 'TruthPhotons':
'xAOD::TruthParticleContainer',
'TruthPhotonsAux':
'xAOD::TruthParticleAuxContainer',
184 'TruthTaus':
'xAOD::TruthParticleContainer',
'TruthTausAux':
'xAOD::TruthParticleAuxContainer',
185 'TruthNeutrinos':
'xAOD::TruthParticleContainer',
'TruthNeutrinosAux':
'xAOD::TruthParticleAuxContainer',
186 'TruthBSM':
'xAOD::TruthParticleContainer',
'TruthBSMAux':
'xAOD::TruthParticleAuxContainer',
187 'TruthBoson':
'xAOD::TruthParticleContainer',
'TruthBosonAux':
'xAOD::TruthParticleAuxContainer',
188 'TruthTop':
'xAOD::TruthParticleContainer',
'TruthTopAux':
'xAOD::TruthParticleAuxContainer',
189 'TruthForwardProtons':
'xAOD::TruthParticleContainer',
'TruthForwardProtonsAux':
'xAOD::TruthParticleAuxContainer',
190 'BornLeptons':
'xAOD::TruthParticleContainer',
'BornLeptonsAux':
'xAOD::TruthParticleAuxContainer',
191 'TruthBosonsWithDecayParticles':
'xAOD::TruthParticleContainer',
'TruthBosonsWithDecayParticlesAux':
'xAOD::TruthParticleAuxContainer',
192 'TruthBosonsWithDecayVertices':
'xAOD::TruthVertexContainer',
'TruthBosonsWithDecayVerticesAux':
'xAOD::TruthVertexAuxContainer',
193 'TruthBSMWithDecayParticles':
'xAOD::TruthParticleContainer',
'TruthBSMWithDecayParticlesAux':
'xAOD::TruthParticleAuxContainer',
194 'TruthBSMWithDecayVertices':
'xAOD::TruthVertexContainer',
'TruthBSMWithDecayVerticesAux':
'xAOD::TruthVertexAuxContainer',
195 'TruthHFWithDecayParticles':
'xAOD::TruthParticleContainer',
'TruthHFWithDecayParticlesAux':
'xAOD::TruthParticleAuxContainer',
196 'TruthHFWithDecayVertices':
'xAOD::TruthVertexContainer',
'TruthHFWithDecayVerticesAux':
'xAOD::TruthVertexAuxContainer',
197 'TruthCharm':
'xAOD::TruthParticleContainer',
'TruthCharmAux':
'xAOD::TruthParticleAuxContainer',
198 'TruthPrimaryVertices':
'xAOD::TruthVertexContainer',
'TruthPrimaryVerticesAux':
'xAOD::TruthVertexAuxContainer',
199 'AntiKt10TruthTrimmedPtFrac5SmallR20Jets':
'xAOD::JetContainer',
'AntiKt10TruthTrimmedPtFrac5SmallR20JetsAux':
'xAOD::JetAuxContainer',
200 'AntiKt10LCTopoJets':
'xAOD::JetContainer',
'AntiKt10LCTopoJetsAux':
'xAOD::JetAuxContainer',
201 'BTagging_AntiKtVR30Rmax4Rmin02Track':
'xAOD::BTaggingContainer',
'BTagging_AntiKtVR30Rmax4Rmin02TrackAux':
'xAOD::BTaggingAuxContainer',
202 'EMOriginTopoClusters':
'xAOD::CaloClusterContainer',
'EMOriginTopoClustersAux':
'xAOD::ShallowAuxContainer',
203 'LCOriginTopoClusters':
'xAOD::CaloClusterContainer',
'LCOriginTopoClustersAux':
'xAOD::ShallowAuxContainer',
204 'BTagging_AntiKt4EMPFlowJFVtx':
'xAOD::BTagVertexContainer',
'BTagging_AntiKt4EMPFlowJFVtxAux':
'xAOD::BTagVertexAuxContainer',
205 'BTagging_AntiKt4EMPFlowSecVtx':
'xAOD::VertexContainer',
'BTagging_AntiKt4EMPFlowSecVtxAux':
'xAOD::VertexAuxContainer',
206 'GlobalChargedParticleFlowObjects':
'xAOD::FlowElementContainer',
'GlobalChargedParticleFlowObjectsAux':
'xAOD::FlowElementAuxContainer',
207 'GlobalNeutralParticleFlowObjects':
'xAOD::FlowElementContainer',
'GlobalNeutralParticleFlowObjectsAux':
'xAOD::FlowElementAuxContainer',
208 'CHSGChargedParticleFlowObjects':
'xAOD::FlowElementContainer',
'CHSGChargedParticleFlowObjectsAux':
'xAOD::ShallowAuxContainer',
209 'CHSGNeutralParticleFlowObjects':
'xAOD::FlowElementContainer',
'CHSGNeutralParticleFlowObjectsAux':
'xAOD::ShallowAuxContainer',
210 'BTagging_AntiKt4EMPFlowJFVtxFlip':
'xAOD::BTagVertexContainer',
'BTagging_AntiKt4EMPFlowJFVtxFlipAux':
'xAOD::BTagVertexAuxContainer',
211 'BTagging_AntiKt4EMPFlowSecVtxFlip':
'xAOD::VertexContainer',
'BTagging_AntiKt4EMPFlowSecVtxFlipAux':
'xAOD::VertexAuxContainer'}
213 if flags.GeoModel.Run >= LHCPeriod.Run4:
214 PHYSVALSlimmingHelper.AppendToDictionary.update({
'BTagging_AntiKt4EMTopoJFVtx':
'xAOD::BTagVertexContainer',
'BTagging_AntiKt4EMTopoJFVtxAux':
'xAOD::BTagVertexAuxContainer',
215 'BTagging_AntiKt4EMTopoSecVtx':
'xAOD::VertexContainer',
'BTagging_AntiKt4EMTopoSecVtxAux':
'xAOD::VertexAuxContainer',
216 'BTagging_AntiKt4EMTopoJFVtxFlip':
'xAOD::BTagVertexContainer',
'BTagging_AntiKt4EMTopoJFVtxFlipAux':
'xAOD::BTagVertexAuxContainer',
217 'BTagging_AntiKt4EMTopoSecVtxFlip':
'xAOD::VertexContainer',
'BTagging_AntiKt4EMTopoSecVtxFlipAux':
'xAOD::VertexAuxContainer'})
219 from DerivationFrameworkMCTruth.MCTruthCommonConfig
import addTruth3ContentToSlimmerTool
221 PHYSVALSlimmingHelper.AllVariables += [
'TruthHFWithDecayParticles',
'TruthHFWithDecayVertices',
'TruthCharm',
'TruthPileupEvents',
'TruthPileupParticles',
'InTimeAntiKt4TruthJets',
'OutOfTimeAntiKt4TruthJets']
222 PHYSVALSlimmingHelper.SmartCollections += [
'AntiKt4TruthJets']
224 if flags.Trigger.EDMVersion == 3:
226 from DerivationFrameworkFlavourTag.FtagDerivationConfig
import HLTJetFTagDecorationCfg
231 PHYSVALSlimmingHelper.ExtraVariables += [
"AntiKt10TruthTrimmedPtFrac5SmallR20Jets.Tau1_wta.Tau2_wta.Tau3_wta.D2.GhostBHadronsFinalCount",
232 "Electrons.TruthLink",
"LRTElectrons.TruthLink",
233 "Muons.TruthLink",
"MuonsLRT.TruthLink",
235 "AntiKt2PV0TrackJets.pt.eta.phi.m",
236 "AntiKt4EMTopoJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID",
237 "AntiKt4EMPFlowJets.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.PartonTruthLabelID.DFCommonJets_fJvt",
238 "TruthPrimaryVertices.t.x.y.z",
239 "TauNeutralParticleFlowObjects.pt.eta.phi.m.bdtPi0Score.nPi0Proto",
240 "TauChargedParticleFlowObjects.pt.eta.phi.m.bdtPi0Score",
242 PHYSVALSlimmingHelper.ExtraVariables += GSFTracksCPDetailedContent
245 "is_selected",
"is_associated",
"is_svtrk_final",
"pt_wrtSV",
"eta_wrtSV",
246 "phi_wrtSV",
"d0_wrtSV",
"z0_wrtSV",
"errP_wrtSV",
"errd0_wrtSV",
247 "errz0_wrtSV",
"chi2_toSV"
250 for suffix
in [
"",
"_LeptonsMod_LRTR3_1p0"]:
251 PHYSVALSlimmingHelper.ExtraVariables += [
"InDetTrackParticles." +
'.'.
join( [ var + suffix
for var
in VSITrackAuxVars] ) ]
252 PHYSVALSlimmingHelper.ExtraVariables += [
"InDetLargeD0TrackParticles." +
'.'.
join( [ var + suffix
for var
in VSITrackAuxVars] ) ]
253 PHYSVALSlimmingHelper.ExtraVariables += [
"GSFTrackParticles." +
'.'.
join( [ var + suffix
for var
in VSITrackAuxVars] ) ]
254 PHYSVALSlimmingHelper.ExtraVariables += [
"LRTGSFTrackParticles." +
'.'.
join( [ var + suffix
for var
in VSITrackAuxVars] ) ]
258 PHYSVALSlimmingHelper.IncludeTriggerNavigation =
True
259 PHYSVALSlimmingHelper.IncludeJetTriggerContent =
True
260 PHYSVALSlimmingHelper.IncludeMuonTriggerContent =
True
261 PHYSVALSlimmingHelper.IncludeEGammaTriggerContent =
True
262 PHYSVALSlimmingHelper.IncludeTauTriggerContent =
True
263 PHYSVALSlimmingHelper.IncludeEtMissTriggerContent =
True
264 PHYSVALSlimmingHelper.IncludeBJetTriggerContent =
True
265 PHYSVALSlimmingHelper.IncludeBPhysTriggerContent =
True
266 PHYSVALSlimmingHelper.IncludeMinBiasTriggerContent =
True
270 if flags.Trigger.EDMVersion == 2:
271 from DerivationFrameworkPhys.TriggerMatchingCommonConfig
import AddRun2TriggerMatchingToSlimmingHelper
273 OutputContainerPrefix =
"TrigMatch_",
274 TriggerList = PHYSVALTriggerListsHelper.Run2TriggerNamesTau)
276 OutputContainerPrefix =
"TrigMatch_",
277 TriggerList = PHYSVALTriggerListsHelper.Run2TriggerNamesNoTau)
279 if flags.Trigger.EDMVersion == 3
or (flags.Trigger.EDMVersion == 2
and flags.Trigger.doEDMVersionConversion):
280 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig
import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
284 PHYSVALSlimmingHelper.IncludeFullTriggerEDMLevel =
"ESD"
287 PHYSVALItemList = PHYSVALSlimmingHelper.GetItemList()
288 acc.merge(
OutputStreamCfg(flags,
"DAOD_PHYSVAL", ItemList=PHYSVALItemList, AcceptAlgs=[
"PHYSVALKernel"]))
289 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_PHYSVAL", AcceptAlgs=[
"PHYSVALKernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))