11 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
12 from AthenaConfiguration.ComponentFactory
import CompFactory
13 from AthenaConfiguration.Enums
import MetadataCategory
14 from AthenaCommon.CFElements
import seqAND, parAND
18 IDTIDE_AOD_EXCLUDED_AUXDATA = [
19 'TrkBLX',
'TrkBLY',
'TrkBLZ',
'TrkIBLX',
'TrkIBLY',
'TrkIBLZ',
20 'TrkL1X',
'TrkL1Y',
'TrkL1Z',
'TrkL2X',
'TrkL2Y',
'TrkL2Z',
21 'IDTIDE_biased_PVd0Sigma',
'IDTIDE_biased_PVz0Sigma',
22 'IDTIDE_biased_PVz0SigmaSinTheta',
23 'IDTIDE_biased_d0',
'IDTIDE_biased_d0Sigma',
24 'IDTIDE_biased_z0',
'IDTIDE_biased_z0Sigma',
25 'IDTIDE_biased_z0SigmaSinTheta',
'IDTIDE_biased_z0SinTheta',
26 'IDTIDE_unbiased_PVd0Sigma',
'IDTIDE_unbiased_PVz0Sigma',
27 'IDTIDE_unbiased_PVz0SigmaSinTheta',
28 'IDTIDE_unbiased_d0',
'IDTIDE_unbiased_d0Sigma',
29 'IDTIDE_unbiased_z0',
'IDTIDE_unbiased_z0Sigma',
30 'IDTIDE_unbiased_z0SigmaSinTheta',
'IDTIDE_unbiased_z0SinTheta'
40 augmentationTools = []
43 from DerivationFrameworkInDet.InDetToolsConfig
import (
44 TrackToVertexWrapperCfg)
45 IDTIDETrackToVertexWrapper = acc.getPrimaryAndMerge(
47 flags, name=
"IDTIDETrackToVertexWrapper",
48 DecorationPrefix=
"IDTIDE")
50 augmentationTools.append(IDTIDETrackToVertexWrapper)
52 from DerivationFrameworkInDet.InDetToolsConfig
import (
53 UsedInVertexFitTrackDecoratorCfg)
54 IDTIDEUsedInFitDecorator = acc.getPrimaryAndMerge(
56 augmentationTools.append(IDTIDEUsedInFitDecorator)
59 from DerivationFrameworkInDet.InDetToolsConfig
import (
60 TrackParametersAtPVCfg)
62 flags, name=
"IDTIDE_DFCommonZ0AtPV",
63 Z0SGEntryName=
"IDTIDEInDetTrackZ0AtPV")
65 augmentationTools.append(DFCommonZ0AtPV)
75 if not flags.Input.isMC:
77 sel_jet600 =
'AntiKt4EMPFlowJets.JetConstitScaleMomentum_pt >= 600.*GeV'
78 sel_jet800 =
'AntiKt4EMPFlowJets.JetConstitScaleMomentum_pt >= 800.*GeV'
79 sel_jet1000 =
'AntiKt4EMPFlowJets.JetConstitScaleMomentum_pt >= 1000.*GeV'
82 jetA_ph1 =
'( HLT_j110_pf_ftf_preselj80_L1jJ60 || HLT_j175_pf_ftf_preselj140_L1jJ90 || HLT_j260_pf_ftf_preselj200_L1jJ125 )'
83 jetC_ph1 =
'( HLT_j360_pf_ftf_preselj225_L1jJ160 )'
84 jetD_ph1 =
'( HLT_j400_pf_ftf_preselj225_L1jJ160 && !HLT_j460_pf_ftf_preselj225_L1jJ160 )'
85 jetE_ph1 =
'( HLT_j460_pf_ftf_preselj225_L1jJ160 )'
86 jetF_ph1 =
' HLT_j460_pf_ftf_preselj225_L1jJ160 '
87 jetG_ph1 =
' HLT_j460_pf_ftf_preselj225_L1jJ160 '
88 jetH_ph1 =
' HLT_j460_pf_ftf_preselj225_L1jJ160 '
91 desd_jetA = f
'( HLT_j110_pf_ftf_preselj80_L1J30 || HLT_j175_pf_ftf_preselj140_L1J50 || HLT_j260_pf_ftf_preselj200_L1J75 ) || {jetA_ph1} '
92 desd_jetC = f
'( HLT_j360_pf_ftf_preselj225_L1J100 ) || {jetC_ph1} '
93 desd_jetD = f
'( HLT_j420_pf_ftf_preselj225_L1J100 && !HLT_j460_pf_ftf_preselj225_L1J100 ) || {jetD_ph1} '
94 desd_jetE = f
'( HLT_j460_pf_ftf_preselj225_L1J100 ) || {jetE_ph1} '
96 f
'(( HLT_j460_pf_ftf_preselj225_L1J100 || {jetF_ph1} ) && count({sel_jet600})>0 && count({sel_jet800})==0 )'
98 f
'(( HLT_j460_pf_ftf_preselj225_L1J100 || {jetG_ph1} ) && count({sel_jet800})>0 && count({sel_jet1000})==0 )'
99 desd_jetH = f
'(( HLT_j460_pf_ftf_preselj225_L1J100 || {jetH_ph1} ) && count({sel_jet1000})>0 )'
110 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
111 xAODStringSkimmingToolCfg,
113 FilterCombinationANDCfg,
114 FilterCombinationORCfg)
116 IDTIDE_SkimmingToolA = acc.getPrimaryAndMerge(
118 expression=desd_jetA))
120 flags, name=
"IDTIDE_PrescaleToolA", Prescale=prescaleA))
122 flags, name=
"IDTIDE_ANDToolA",
123 FilterList=[IDTIDE_SkimmingToolA, IDTIDE_PrescaleToolA]))
125 IDTIDE_SkimmingToolC = acc.getPrimaryAndMerge(
127 expression=desd_jetC))
129 flags, name=
"IDTIDE_PrescaleToolC", Prescale=prescaleC))
131 flags, name=
"IDTIDE_ANDToolC",
132 FilterList=[IDTIDE_SkimmingToolC, IDTIDE_PrescaleToolC]))
134 IDTIDE_SkimmingToolD = acc.getPrimaryAndMerge(
136 expression=desd_jetD))
138 flags, name=
"IDTIDE_PrescaleToolD", Prescale=prescaleD))
140 flags, name=
"IDTIDE_ANDToolD",
141 FilterList=[IDTIDE_SkimmingToolD, IDTIDE_PrescaleToolD]))
143 IDTIDE_SkimmingToolE = acc.getPrimaryAndMerge(
145 expression=desd_jetE))
147 flags, name=
"IDTIDE_PrescaleToolE", Prescale=prescaleE))
149 flags, name=
"IDTIDE_ANDToolE",
150 FilterList=[IDTIDE_SkimmingToolE, IDTIDE_PrescaleToolE]))
152 IDTIDE_SkimmingToolF = acc.getPrimaryAndMerge(
154 expression=desd_jetF))
156 flags, name=
"IDTIDE_PrescaleToolF", Prescale=prescaleF))
158 flags, name=
"IDTIDE_ANDToolF",
159 FilterList=[IDTIDE_SkimmingToolF, IDTIDE_PrescaleToolF]))
161 IDTIDE_SkimmingToolG = acc.getPrimaryAndMerge(
163 expression=desd_jetG))
165 flags, name=
"IDTIDE_PrescaleToolG", Prescale=prescaleG))
167 flags, name=
"IDTIDE_ANDToolG",
168 FilterList=[IDTIDE_SkimmingToolG, IDTIDE_PrescaleToolG]))
170 IDTIDE_SkimmingToolH = acc.getPrimaryAndMerge(
172 expression=desd_jetH))
175 flags, name=
"IDTIDELogicalCombination",
176 FilterList=[IDTIDE_ANDToolA, IDTIDE_ANDToolC, IDTIDE_ANDToolD,
177 IDTIDE_ANDToolE, IDTIDE_ANDToolF,
178 IDTIDE_ANDToolG, IDTIDE_SkimmingToolH]))
180 skimmingTools.append(IDTIDE_ORTool)
184 CompFactory.DerivationFramework.DerivationKernel(
185 "IDTIDEKernelPresel", SkimmingTools=skimmingTools))
190 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
192 AugmentationTools=augmentationTools,
193 SkimmingTools=skimmingTools,
195 RunSkimmingFirst=
True,
210 if flags.Detector.GeometryID:
211 from DerivationFrameworkInDet.InDetToolsConfig
import (
212 IDTIDEThinningToolCfg)
213 thinningTools.append(acc.getPrimaryAndMerge(
215 if flags.Detector.GeometryITk:
216 from DerivationFrameworkInDet.InDetToolsConfig
import (
217 ITkTIDEThinningToolCfg)
218 thinningTools.append(acc.getPrimaryAndMerge(
223 from DerivationFrameworkInDet.InDetToolsConfig
import (
224 IDTIDETruthThinningToolCfg)
225 thinningTools.append(acc.getPrimaryAndMerge(
228 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
230 AugmentationTools=[],
231 ThinningTools=thinningTools,
236 """Configure the derivation framework driving algorithm (kernel) for IDTIDE"""
242 IDTIDEPreselSequenceName=
'IDTIDEPreselSequence'
243 acc.addSequence(
seqAND(IDTIDEPreselSequenceName))
264 IDTIDEPreselAlgSequenceName=
'IDTIDEPreselAlgSequence'
265 acc.addSequence(
parAND(IDTIDEPreselAlgSequenceName),
266 parentName=IDTIDEPreselSequenceName)
268 from InDetConfig.InDetPrepRawDataToxAODConfig
import InDetPrepDataToxAODCfg
270 sequenceName=IDTIDEPreselAlgSequenceName)
272 IDTIDEPostProcSequenceName=
'IDTIDEPostProcSequence'
273 acc.addSequence(
parAND(IDTIDEPostProcSequenceName),
274 parentName=IDTIDEPreselSequenceName)
276 from DerivationFrameworkInDet.InDetToolsConfig
import (
277 DFInDetTSOSKernelCfg)
279 sequenceName=IDTIDEPostProcSequenceName)
281 sequenceName=IDTIDEPostProcSequenceName)
285 """Configure the derivation framework driving algorithm (kernel) for IDTIDE"""
288 IDTIDEPreselSequenceName=
'IDTIDEPreselSequence'
289 acc.addSequence(
seqAND(IDTIDEPreselSequenceName))
293 IDTIDEPreselAlgSequenceName=
'IDTIDEPreselAlgSequence'
294 acc.addSequence(
parAND(IDTIDEPreselAlgSequenceName),
295 parentName=IDTIDEPreselSequenceName)
297 from InDetConfig.InDetPrepRawDataToxAODConfig
import ITkPrepDataToxAODCfg
299 sequenceName=IDTIDEPreselAlgSequenceName)
301 IDTIDEPostProcSequenceName=
'IDTIDEPostProcSequence'
302 acc.addSequence(
parAND(IDTIDEPostProcSequenceName),
303 parentName=IDTIDEPreselSequenceName)
308 if not flags.Tracking.writeExtendedSi_PRDInfo:
309 from DerivationFrameworkInDet.InDetToolsConfig
import DFITkTSOSKernelCfg
311 sequenceName=IDTIDEPostProcSequenceName)
313 sequenceName=IDTIDEPostProcSequenceName)
319 """Main config fragment for IDTIDE"""
323 if flags.Detector.GeometryID:
325 if flags.Detector.GeometryITk:
331 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
332 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
333 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
335 "IDTIDESlimmingHelper",
336 NamesAndTypes=flags.Input.TypedCollections,
341 SmartCollections = []
344 IDTIDESlimmingHelper.AppendToDictionary.update({
345 "EventInfo":
"xAOD::EventInfo",
"EventInfoAux":
"xAOD::EventAuxInfo",
346 "CombinedMuonTrackParticles":
"xAOD::TrackParticleContainer",
"CombinedMuonTrackParticlesAux":
"xAOD::TrackParticleAuxContainer",
347 "Muons":
"xAOD::MuonContainer",
"MuonsAux":
"xAOD::MuonAuxContainer",
348 "Electrons":
"xAOD::ElectronContainer",
349 "ElectronsAux":
"xAOD::ElectronAuxContainer",
350 "Photons":
"xAOD::PhotonContainer",
351 "PhotonsAux":
"xAOD::PhotonAuxContainer",
352 "JetETMissNeutralParticleFlowObjects":
"xAOD::FlowElementContainer",
353 "JetETMissNeutralParticleFlowObjectsAux":
"xAOD::FlowElementAuxContainer",
354 "JetETMissChargedParticleFlowObjects":
"xAOD::FlowElementContainer",
355 "JetETMissChargedParticleFlowObjectsAux":
"xAOD::FlowElementAuxContainer",
356 "TauJets":
"xAOD::TauJetContainer",
357 "TauJetsAux":
"xAOD::TauJetAuxContainer",
358 "InDetTrackParticles":
"xAOD::TrackParticleContainer",
359 "InDetTrackParticlesAux":
"xAOD::TrackParticleAuxContainer",
360 "InDetLargeD0TrackParticles":
"xAOD::TrackParticleContainer",
361 "InDetLargeD0TrackParticlesAux":
"xAOD::TrackParticleAuxContainer",
362 "Kt4EMTopoOriginEventShape":
"xAOD::EventShape",
363 "Kt4EMTopoOriginEventShapeAux":
"xAOD::EventShapeAuxInfo",
364 "Kt4LCTopoOriginEventShape":
"xAOD::EventShape",
365 "Kt4LCTopoOriginEventShapeAux":
"xAOD::EventShapeAuxInfo",
366 "NeutralParticleFlowIsoCentralEventShape":
"xAOD::EventShape",
367 "NeutralParticleFlowIsoCentralEventShapeAux":
"xAOD::EventShapeAuxInfo",
368 "NeutralParticleFlowIsoForwardEventShape":
"xAOD::EventShape",
369 "NeutralParticleFlowIsoForwardEventShapeAux":
"xAOD::EventShapeAuxInfo",
370 "TopoClusterIsoCentralEventShape":
"xAOD::EventShape",
371 "TopoClusterIsoCentralEventShapeAux":
"xAOD::EventShapeAuxInfo",
372 "TopoClusterIsoForwardEventShape":
"xAOD::EventShape",
373 "TopoClusterIsoForwardEventShapeAux":
"xAOD::EventShapeAuxInfo"}
375 if flags.Detector.GeometryID:
376 IDTIDESlimmingHelper.AppendToDictionary.update({
377 "PixelClusters":
"xAOD::TrackMeasurementValidationContainer",
378 "PixelClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer",
379 "SCT_Clusters":
"xAOD::TrackMeasurementValidationContainer",
380 "SCT_ClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer"
382 if flags.Detector.GeometryITk:
383 IDTIDESlimmingHelper.AppendToDictionary.update({
384 "ITkPixelClusters":
"xAOD::TrackMeasurementValidationContainer",
385 "ITkPixelClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer",
386 "ITkStripClusters":
"xAOD::TrackMeasurementValidationContainer",
387 "ITkStripClustersAux":
"xAOD::TrackMeasurementValidationAuxContainer"
390 SmartCollections += [
"Muons",
"Electrons",
"Photons"]
392 AllVariables += [
"EventInfo",
393 "JetETMissNeutralParticleFlowObjects",
394 "JetETMissChargedParticleFlowObjects",
395 "InDetTrackParticles",
396 "InDetLargeD0TrackParticles",
399 "Kt4EMTopoOriginEventShape",
400 "Kt4LCTopoOriginEventShape",
401 "NeutralParticleFlowIsoCentralEventShape",
402 "NeutralParticleFlowIsoForwardEventShape",
403 "TopoClusterIsoCentralEventShape",
404 "TopoClusterIsoForwardEventShape",
406 if flags.Detector.GeometryID:
407 AllVariables += [
"PixelClusters",
"SCT_Clusters"]
408 if flags.Detector.GeometryITk:
409 AllVariables += [
"ITkPixelClusters",
"ITkStripClusters"]
411 IDTIDESlimmingHelper.AppendToDictionary.update({
412 "Kt4EMPFlowEventShape":
"xAOD::EventShape",
413 "Kt4EMPFlowEventShapeAux":
"xAOD::EventShapeAuxInfo",
414 "PrimaryVertices":
"xAOD::VertexContainer",
415 "PrimaryVerticesAux":
"xAOD::VertexAuxContainer",
416 "InDetTrackParticlesClusterAssociations":
"xAOD::TrackParticleClusterAssociationContainer",
417 "InDetTrackParticlesClusterAssociationsAux":
"xAOD::TrackParticleClusterAssociationAuxContainer",
418 "AntiKt4EMTopoJets":
"xAOD::JetContainer",
419 "AntiKt4EMTopoJetsAux":
"xAOD::JetAuxContainer",
420 "AntiKt4EMPFlowJets":
"xAOD::JetContainer",
421 "AntiKt4EMPFlowJetsAux":
"xAOD::JetAuxContainer",
422 "BTagging_AntiKt4EMTopo":
"xAOD::BTaggingContainer",
423 "BTagging_AntiKt4EMTopoAux":
"xAOD::BTaggingAuxContainer",
424 "BTagging_AntiKt4EMPFlow":
"xAOD::BTaggingContainer",
425 "BTagging_AntiKt4EMPFlowAux":
"xAOD::BTaggingAuxContainer"})
427 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"]
428 ExtraVariables += [
"PrimaryVertices.sumPt2.x.y.z"]
430 AllVariables += [
"Kt4EMPFlowEventShape",
431 "InDetTrackParticlesClusterAssociations",
432 "AntiKt4EMTopoJets",
"AntiKt4EMPFlowJets",
433 "BTagging_AntiKt4EMTopo",
"BTagging_AntiKt4EMPFlow"]
435 if flags.Detector.EnablePixel:
436 IDTIDESlimmingHelper.AppendToDictionary.update(
437 {
'PixelMSOSs':
'xAOD::TrackStateValidationContainer',
438 'PixelMSOSsAux':
'xAOD::TrackStateValidationAuxContainer'})
439 AllVariables += [
"PixelMSOSs"]
441 if flags.Detector.EnableSCT:
442 IDTIDESlimmingHelper.AppendToDictionary.update(
443 {
'SCT_MSOSs':
'xAOD::TrackStateValidationContainer',
444 'SCT_MSOSsAux':
'xAOD::TrackStateValidationAuxContainer'})
445 AllVariables += [
"SCT_MSOSs"]
447 if flags.Detector.EnableTRT:
448 IDTIDESlimmingHelper.AppendToDictionary.update(
449 {
'TRT_MSOSs':
'xAOD::TrackStateValidationContainer',
450 'TRT_MSOSsAux':
'xAOD::TrackStateValidationAuxContainer'})
451 AllVariables += [
"TRT_MSOSs"]
453 if flags.Detector.EnableITkPixel:
454 IDTIDESlimmingHelper.AppendToDictionary.update(
455 {
'ITkPixelMSOSs':
'xAOD::TrackStateValidationContainer',
456 'ITkPixelMSOSsAux':
'xAOD::TrackStateValidationAuxContainer'})
457 AllVariables += [
"ITkPixelMSOSs"]
459 if flags.Detector.EnableITkStrip:
460 IDTIDESlimmingHelper.AppendToDictionary.update(
461 {
'ITkStripMSOSs':
'xAOD::TrackStateValidationContainer',
462 'ITkStripMSOSsAux':
'xAOD::TrackStateValidationAuxContainer'})
463 AllVariables += [
"ITkStripMSOSs"]
467 IDTIDESlimmingHelper.AppendToDictionary.update({
468 "AntiKt4TruthJets":
"xAOD::JetContainer",
469 "AntiKt4TruthJetsAux":
"xAOD::JetAuxContainer",
470 "JetInputTruthParticles":
"xAOD::TruthParticleContainer",
471 "JetInputTruthParticlesNoWZ":
"xAOD::TruthParticleContainer",
472 "TruthEvents":
"xAOD::TruthEventContainer",
473 "TruthEventsAux":
"xAOD::TruthEventAuxContainer",
474 "TruthParticles":
"xAOD::TruthParticleContainer",
475 "TruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
476 "egammaTruthParticles":
"xAOD::TruthParticleContainer",
477 "egammaTruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
478 "MuonTruthParticles":
"xAOD::TruthParticleContainer",
479 "MuonTruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
480 "LRTegammaTruthParticles":
"xAOD::TruthParticleContainer",
481 "LRTegammaTruthParticlesAux":
"xAOD::TruthParticleAuxContainer",
482 "TruthVertices":
"xAOD::TruthVertexContainer",
483 "TruthVerticesAux":
"xAOD::TruthVertexAuxContainer"})
485 AllVariables += [
"AntiKt4TruthJets",
486 "JetInputTruthParticles",
487 "JetInputTruthParticlesNoWZ",
490 "egammaTruthParticles",
491 "MuonTruthParticles",
492 "LRTegammaTruthParticles",
495 list_aux = [
"BHadronsFinal",
"BHadronsInitial",
"BQuarksFinal",
496 "CHadronsFinal",
"CHadronsInitial",
"CQuarksFinal",
497 "HBosons",
"Partons",
"TQuarksFinal",
"TausFinal",
498 "WBosons",
"ZBosons"]
499 for item
in list_aux:
500 label =
"TruthLabel"+item
501 labelAux = label+
"Aux"
502 IDTIDESlimmingHelper.AppendToDictionary.update(
503 {label:
"xAOD::TruthParticleContainer",
504 labelAux:
"xAOD::TruthParticleAuxContainer"})
505 AllVariables += [label]
509 IDTIDESlimmingHelper.IncludeTriggerNavigation =
True
510 IDTIDESlimmingHelper.IncludeAdditionalTriggerContent =
True
512 IDTIDESlimmingHelper.AllVariables = AllVariables
513 IDTIDESlimmingHelper.StaticContent = StaticContent
514 IDTIDESlimmingHelper.SmartCollections = SmartCollections
515 IDTIDESlimmingHelper.ExtraVariables = ExtraVariables
518 IDTIDEItemList = IDTIDESlimmingHelper.GetItemList()
520 ItemList=IDTIDEItemList, AcceptAlgs=[
"IDTIDEKernel"]))
522 flags,
"DAOD_IDTIDE", AcceptAlgs=[
"IDTIDEKernel"],
523 createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TriggerMenuMetaData]))