10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory
import CompFactory
12 from AthenaConfiguration.Enums
import MetadataCategory
13 from AthenaCommon.CFElements
import seqAND
16 IDTRKVALID_AOD_EXCLUDED_AUXDATA = [
'IDTRKVALID_'+var
for var
in [
24 'biased_PVz0SigmaSinTheta',
26 'unbiased_PVz0SigmaSinTheta',
28 'biased_z0SigmaSinTheta',
31 'unbiased_z0SigmaSinTheta',
34 'unbiased_z0SinTheta' ] ]
41 sel_muon1 =
'Muons.pt > 25*GeV && Muons.ptcone40/Muons.pt < 0.3 && Muons.passesIDCuts'
42 sel_muon2 =
'Muons.pt > 20*GeV && Muons.ptcone40/Muons.pt < 0.3 && Muons.passesIDCuts'
43 draw_zmumu =
'( count ( DRZmumuMass > 70*GeV && DRZmumuMass < 110*GeV ) >= 1 )'
44 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
45 InvariantMassToolCfg, xAODStringSkimmingToolCfg,
46 FilterCombinationANDCfg)
48 flags, name=
"IDTRKVALID_ZmumuMass",
49 ContainerName =
"Muon",
50 ObjectRequirements = sel_muon1,
51 SecondObjectRequirements = sel_muon2,
52 MassHypothesis = 105.66,
53 SecondMassHypothesis = 105.66,
54 StoreGateEntryName =
"DRZmumuMass"))
56 IDTRKVALID_SkimmingTool = acc.getPrimaryAndMerge(
58 expression=draw_zmumu))
60 IDTRKVALID_ANDTool = acc.getPrimaryAndMerge(
62 FilterList=[IDTRKVALID_ZmumuMass,
63 IDTRKVALID_SkimmingTool]))
65 acc.addPublicTool(IDTRKVALID_ANDTool, primary=
True)
75 augmentationTools = []
78 from DerivationFrameworkInDet.InDetToolsConfig
import (
79 TrackToVertexWrapperCfg)
80 IDTRKVALIDTrackToVertexWrapper = acc.getPrimaryAndMerge(
82 flags, name=
"IDTRKVALIDTrackToVertexWrapper",
83 DecorationPrefix=
"IDTRKVALID"))
84 augmentationTools.append(IDTRKVALIDTrackToVertexWrapper)
86 from DerivationFrameworkInDet.InDetToolsConfig
import (
87 UsedInVertexFitTrackDecoratorCfg)
88 IDTRKVALIDUsedInFitDecorator = acc.getPrimaryAndMerge(
90 augmentationTools.append(IDTRKVALIDUsedInFitDecorator)
93 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParametersAtPVCfg
95 flags, name=
"IDTRKVALID_DFCommonZ0AtPV",
96 Z0SGEntryName=
"IDTRKVALIDInDetTrackZ0AtPV"))
97 augmentationTools.append(DFCommonZ0AtPV)
103 if flags.InDet.DRAWZSelection:
105 skimmingTools.append(IDTRKVALID_ANDTool)
111 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
113 AugmentationTools = augmentationTools,
114 SkimmingTools = skimmingTools,
116 RunSkimmingFirst =
True))
121 flags, name='IDTRKVALID_PixelModuleStatus_Kernel'):
125 augmentationTools = []
126 from DerivationFrameworkInDet.PixelNtupleMakerConfig
import (
127 EventInfoPixelModuleStatusMonitoringCfg)
129 augmentationTools.append(DFEI)
134 flags, name='IDTRKVALID_ITkPixelModuleStatus_Kernel'):
138 augmentationTools = []
139 from DerivationFrameworkInDet.PixelNtupleMakerConfig
import (
140 ITkEventInfoPixelModuleStatusMonitoringCfg)
141 DFEI = acc.getPrimaryAndMerge(
143 augmentationTools.append(DFEI)
148 flags, name="IDTRKVALIDThinningKernel", StreamName=""):
158 from DerivationFrameworkInDet.InDetToolsConfig
import (
159 IDTRKVALIDTruthThinningToolCfg)
160 thinningTools.append(acc.getPrimaryAndMerge(
163 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
165 AugmentationTools=[],
166 ThinningTools=thinningTools,
172 """Configure the derivation framework driving algorithm (kernel) for IDTRKVALID"""
175 IDTRKVALIDSequenceName=
'IDTRKVALIDSequence'
176 acc.addSequence(
seqAND(IDTRKVALIDSequenceName))
179 sequenceName=IDTRKVALIDSequenceName)
182 sequenceName=IDTRKVALIDSequenceName)
184 from InDetConfig.InDetPrepRawDataToxAODConfig
import InDetPrepDataToxAODCfg
186 sequenceName=IDTRKVALIDSequenceName)
188 from DerivationFrameworkInDet.InDetToolsConfig
import DFInDetTSOSKernelCfg
190 sequenceName=IDTRKVALIDSequenceName)
193 sequenceName=IDTRKVALIDSequenceName)
198 """Configure the derivation framework driving algorithm (kernel) for IDTRKVALID"""
201 IDTRKVALIDSequenceName=
'IDTRKVALIDSequence'
202 acc.addSequence(
seqAND(IDTRKVALIDSequenceName))
205 sequenceName=IDTRKVALIDSequenceName)
208 sequenceName=IDTRKVALIDSequenceName)
210 from InDetConfig.InDetPrepRawDataToxAODConfig
import ITkPrepDataToxAODCfg
212 sequenceName=IDTRKVALIDSequenceName)
217 if not flags.Tracking.writeExtendedSi_PRDInfo:
218 from DerivationFrameworkInDet.InDetToolsConfig
import DFITkTSOSKernelCfg
220 sequenceName=IDTRKVALIDSequenceName)
223 sequenceName=IDTRKVALIDSequenceName)
229 """Main config fragment for IDTRKVALID"""
233 if flags.Detector.GeometryID:
235 if flags.Detector.GeometryITk:
241 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
242 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
243 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
245 "IDTRKVALIDSlimmingHelper",
246 NamesAndTypes = flags.Input.TypedCollections,
251 SmartCollections = []
254 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
255 "EventInfo":
"xAOD::EventInfo",
"EventInfoAux":
"xAOD::EventAuxInfo",
256 "Muons":
"xAOD::MuonContainer",
"MuonsAux":
"xAOD::MuonAuxContainer",
257 "Electrons":
"xAOD::ElectronContainer",
258 "ElectronsAux":
"xAOD::ElectronAuxContainer",
259 "Photons":
"xAOD::PhotonContainer",
260 "PhotonsAux":
"xAOD::PhotonAuxContainer",
261 "JetETMissNeutralParticleFlowObjects":
"xAOD::FlowElementContainer",
262 "JetETMissNeutralParticleFlowObjectsAux":
"xAOD::FlowElementAuxContainer",
263 "JetETMissChargedParticleFlowObjects":
"xAOD::FlowElementContainer",
264 "JetETMissChargedParticleFlowObjectsAux":
"xAOD::FlowElementAuxContainer",
265 "TauJets":
"xAOD::TauJetContainer",
266 "TauJetsAux":
"xAOD::TauJetAuxContainer",
267 "InDetTrackParticles":
"xAOD::TrackParticleContainer",
268 "InDetTrackParticlesAux":
"xAOD::TrackParticleAuxContainer",
269 "InDetLargeD0TrackParticles":
"xAOD::TrackParticleContainer",
270 "InDetLargeD0TrackParticlesAux":
"xAOD::TrackParticleAuxContainer",
271 "Kt4EMTopoOriginEventShape":
"xAOD::EventShape",
272 "Kt4EMTopoOriginEventShapeAux":
"xAOD::EventShapeAuxInfo",
273 "Kt4LCTopoOriginEventShape":
"xAOD::EventShape",
274 "Kt4LCTopoOriginEventShapeAux":
"xAOD::EventShapeAuxInfo",
275 "NeutralParticleFlowIsoCentralEventShape":
"xAOD::EventShape",
276 "NeutralParticleFlowIsoCentralEventShapeAux":
"xAOD::EventShapeAuxInfo",
277 "NeutralParticleFlowIsoForwardEventShape":
"xAOD::EventShape",
278 "NeutralParticleFlowIsoForwardEventShapeAux":
"xAOD::EventShapeAuxInfo",
279 "TopoClusterIsoCentralEventShape":
"xAOD::EventShape",
280 "TopoClusterIsoCentralEventShapeAux":
"xAOD::EventShapeAuxInfo",
281 "TopoClusterIsoForwardEventShape":
"xAOD::EventShape",
282 "TopoClusterIsoForwardEventShapeAux":
"xAOD::EventShapeAuxInfo",
283 "MET_Calo":
"xAOD::MissingETContainer",
284 "MET_CaloAux":
"xAOD::MissingETAuxContainer",
285 "MET_Track":
"xAOD::MissingETContainer",
286 "MET_TrackAux":
"xAOD::MissingETAuxContainer",
287 "MET_LocHadTopo":
"xAOD::MissingETContainer",
288 "MET_LocHadTopoRegions":
"xAOD::MissingETContainer",
289 "MET_LocHadTopoAux":
"xAOD::MissingETAuxContainer",
290 "MET_LocHadTopoRegionsAux":
"xAOD::MissingETAuxContainer",
291 "MET_Core_AntiKt4LCTopo":
"xAOD::MissingETContainer",
292 "MET_Reference_AntiKt4LCTopo":
"xAOD::MissingETContainer",
293 "MET_Core_AntiKt4LCTopoAux":
"xAOD::MissingETAuxContainer",
294 "MET_Reference_AntiKt4LCTopoAux":
"xAOD::MissingETAuxContainer"})
296 if flags.Detector.GeometryID:
297 if flags.InDet.DAODStorePixel:
298 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
299 "PixelClusters":
"xAOD::TrackMeasurementValidationContainer",
300 "PixelClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer",
301 "PixelMSOSs":
"xAOD::TrackStateValidationContainer",
302 "PixelMSOSsAux":
"xAOD::TrackStateValidationAuxContainer"
304 if flags.InDet.DAODStoreSCT:
305 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
306 "SCT_Clusters":
"xAOD::TrackMeasurementValidationContainer",
307 "SCT_ClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer",
308 "SCT_MSOSs":
"xAOD::TrackStateValidationContainer",
309 "SCT_MSOSsAux":
"xAOD::TrackStateValidationAuxContainer"
312 if flags.Detector.GeometryITk:
313 if flags.ITk.DAODStorePixel:
314 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
315 "ITkPixelClusters":
"xAOD::TrackMeasurementValidationContainer",
316 "ITkPixelClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer",
317 "ITkPixelMSOSs":
"xAOD::TrackStateValidationContainer",
318 "ITkPixelMSOSsAux":
"xAOD::TrackStateValidationAuxContainer"
320 if flags.ITk.DAODStoreStrip:
321 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
322 "ITkStripClusters":
"xAOD::TrackMeasurementValidationContainer",
323 "ITkStripClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer",
324 "ITkStripMSOSs":
"xAOD::TrackStateValidationContainer",
325 "ITkStripMSOSsAux":
"xAOD::TrackStateValidationAuxContainer"
328 SmartCollections += [
"Muons",
"Electrons",
"Photons"]
330 AllVariables += [
"EventInfo",
331 "JetETMissNeutralParticleFlowObjects",
332 "JetETMissChargedParticleFlowObjects",
333 "InDetTrackParticles",
334 "InDetLargeD0TrackParticles",
335 "Kt4EMTopoOriginEventShape",
336 "Kt4LCTopoOriginEventShape",
337 "NeutralParticleFlowIsoCentralEventShape",
338 "NeutralParticleFlowIsoForwardEventShape",
339 "TopoClusterIsoCentralEventShape",
340 "TopoClusterIsoForwardEventShape"]
342 if flags.Detector.GeometryID:
343 if flags.InDet.DAODStorePixel:
344 AllVariables += [
"PixelClusters",
"PixelMSOSs"]
345 if flags.InDet.DAODStoreSCT:
346 AllVariables += [
"SCT_Clusters",
"SCT_MSOSs"]
347 if flags.Detector.GeometryITk:
348 if flags.ITk.DAODStorePixel:
349 AllVariables += [
"ITkPixelClusters",
"ITkPixelMSOSs"]
350 if flags.ITk.DAODStoreStrip:
351 AllVariables += [
"ITkStripClusters",
"ITkStripMSOSs"]
353 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
354 "TauJets":
"xAOD::TauJetContainer",
355 "TauJetsAux":
"xAOD::TauJetAuxContainer",
356 "Kt4EMPFlowEventShape":
"xAOD::EventShape",
357 "Kt4EMPFlowEventShapeAux":
"xAOD::EventShapeAuxInfo",
358 "PrimaryVertices":
"xAOD::VertexContainer",
359 "PrimaryVerticesAux":
"xAOD::VertexAuxContainer",
360 "AntiKt4EMTopoJets":
"xAOD::JetContainer",
361 "AntiKt4EMTopoJetsAux":
"xAOD::JetAuxContainer",
362 "AntiKt4EMPFlowJets":
"xAOD::JetContainer",
363 "AntiKt4EMPFlowJetsAux":
"xAOD::JetAuxContainer",
364 "BTagging_AntiKt4EMTopo":
"xAOD::BTaggingContainer",
365 "BTagging_AntiKt4EMTopoAux":
"xAOD::BTaggingAuxContainer",
366 "BTagging_AntiKt4EMPFlow":
"xAOD::BTaggingContainer",
367 "BTagging_AntiKt4EMPFlowAux":
"xAOD::BTaggingAuxContainer"})
369 ExtraVariables += [
"TauJets.ABS_ETA_LEAD_TRACK.ClusterTotalEnergy.ClustersMeanCenterLambda.ClustersMeanEMProbability.ClustersMeanFirstEngDens.ClustersMeanPresamplerFrac.ClustersMeanSecondLambda.EMFRACTIONATEMSCALE_MOVEE3.EMFracFixed.GhostMuonSegmentCount.LeadClusterFrac.NNDecayMode.NNDecayModeProb_1p0n.NNDecayModeProb_1p1n.NNDecayModeProb_1pXn.NNDecayModeProb_3p0n.NNDecayModeProb_3pXn.PFOEngRelDiff.PanTau_DecayModeExtended.TAU_ABSDELTAETA.TAU_ABSDELTAPHI.TAU_SEEDTRK_SECMAXSTRIPETOVERPT.UpsilonCluster.absipSigLeadTrk.chargedFELinks.etHotShotDR1.etHotShotDR1OverPtLeadTrk.etHotShotWin.etHotShotWinOverPtLeadTrk.etaCombined.hadLeakFracFixed.leadTrackProbHT.mCombined.mu.nConversionTracks.nFakeTracks.nModifiedIsolationTracks.nVtxPU.neutralFELinks.passThinning.phiCombined.ptCombined.ptIntermediateAxisEM.rho"]
370 ExtraVariables += [
"PrimaryVertices.sumPt2.x.y.z"]
372 AllVariables += [
"Kt4EMPFlowEventShape",
373 "AntiKt4EMTopoJets",
"AntiKt4EMPFlowJets",
374 "BTagging_AntiKt4EMTopo",
"BTagging_AntiKt4EMPFlow"]
377 IDTRKVALIDSlimmingHelper.AppendToDictionary.update({
378 "AntiKt4TruthJets":
"xAOD::JetContainer",
379 "AntiKt4TruthJetsAux":
"xAOD::JetAuxContainer",
380 "JetInputTruthParticles":
"xAOD::TruthParticleContainer",
381 "JetInputTruthParticlesNoWZ":
"xAOD::TruthParticleContainer",
382 "TruthEvents":
"xAOD::TruthEventContainer",
383 "TruthEventsAux":
"xAOD::TruthEventAuxContainer",
384 "TruthParticles":
"xAOD::TruthParticleContainer",
385 "TruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
386 "egammaTruthParticles":
"xAOD::TruthParticleContainer",
387 "egammaTruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
388 "MuonTruthParticles":
"xAOD::TruthParticleContainer",
389 "MuonTruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
390 "LRTegammaTruthParticles":
"xAOD::TruthParticleContainer",
391 "LRTegammaTruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
392 "TruthVertices":
"xAOD::TruthVertexContainer",
393 "TruthVerticesAux":
"xAOD::TruthVertexAuxContainer",
394 "MET_Truth":
"xAOD::MissingETContainer",
395 "MET_TruthRegions":
"xAOD::MissingETContainer",
396 "MET_TruthAux":
"xAOD::MissingETAuxContainer",
397 "MET_TruthRegionsAux":
"xAOD::MissingETAuxContainer"})
399 AllVariables += [
"AntiKt4TruthJets",
400 "JetInputTruthParticles",
401 "JetInputTruthParticlesNoWZ",
404 "egammaTruthParticles",
405 "MuonTruthParticles",
406 "LRTegammaTruthParticles",
409 list_aux = [
"BHadronsFinal",
"BHadronsInitial",
"BQuarksFinal",
410 "CHadronsFinal",
"CHadronsInitial",
"CQuarksFinal",
411 "HBosons",
"Partons",
"TQuarksFinal",
"TausFinal",
412 "WBosons",
"ZBosons"]
413 for item
in list_aux:
414 label =
"TruthLabel"+item
415 labelAux = label+
"Aux"
416 IDTRKVALIDSlimmingHelper.AppendToDictionary.update(
417 {label:
"xAOD::TruthParticleContainer",
418 labelAux:
"xAOD::TruthParticleAuxContainer"})
419 AllVariables += [label]
423 IDTRKVALIDSlimmingHelper.IncludeTriggerNavigation =
True
424 IDTRKVALIDSlimmingHelper.IncludeAdditionalTriggerContent =
True
426 IDTRKVALIDSlimmingHelper.AllVariables = AllVariables
427 IDTRKVALIDSlimmingHelper.StaticContent = StaticContent
428 IDTRKVALIDSlimmingHelper.SmartCollections = SmartCollections
429 IDTRKVALIDSlimmingHelper.ExtraVariables = ExtraVariables
432 IDTRKVALIDItemList = IDTRKVALIDSlimmingHelper.GetItemList()
434 ItemList=IDTRKVALIDItemList, AcceptAlgs=[
"IDTRKVALIDKernel"]))
437 flags,
"DAOD_IDTRKVALID", AcceptAlgs=[
"IDTRKVALIDKernel"],
438 createMetadata=[MetadataCategory.CutFlowMetaData]))