ATLAS Offline Software
Loading...
Searching...
No Matches
python.STDM13 Namespace Reference

Functions

 STDM13KernelCfg (flags, name='STDM13Kernel', **kwargs)
 STDM13Cfg (flags)

Function Documentation

◆ STDM13Cfg()

python.STDM13.STDM13Cfg ( flags)

Definition at line 69 of file STDM13.py.

69def STDM13Cfg(flags):
70 acc = ComponentAccumulator()
71
72 # Get the lists of triggers needed for trigger matching.
73 # This is needed at this scope (for the slimming) and further down in the config chain
74 # for actually configuring the matching, so we create it here and pass it down
75 # TODO: this should ideally be called higher up to avoid it being run multiple times in a train
76 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
77 STDM13TriggerListsHelper = TriggerListsHelper(flags)
78
79 # Common augmentations
80 acc.merge(STDM13KernelCfg(flags, name="STDM13Kernel", StreamName = 'StreamDAOD_STDM13', TriggerListsHelper = STDM13TriggerListsHelper))
81
82 # ============================
83 # Define contents of the format
84 # =============================
85 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
86 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
87 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
88
89 STDM13SlimmingHelper = SlimmingHelper("STDM13SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
90
91 from DerivationFrameworkFlavourTag import FtagBaseContent
92 FtagBaseContent.add_common_augmentation(flags, acc, STDM13SlimmingHelper)
93
94 STDM13SlimmingHelper.SmartCollections += [
95 "Electrons",
96 "Muons",
97 "AntiKt4EMPFlowJets",
98 "MET_Baseline_AntiKt4EMPFlow",
99 "PrimaryVertices",
100 "InDetTrackParticles",
101 "AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets",
102 ]
103
104 STDM13SlimmingHelper.ExtraVariables += [
105 "AntiKt4EMPFlowJets.GhostTrack",
106 "InDetTrackParticles.btagIp_d0.btagIp_d0Uncertainty.btagIp_z0SinTheta.btagIp_z0SinThetaUncertainty.btagIp_trackMomentum.btagIp_trackDisplacement.btagIp_invalidIp",
107 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights",
108 "InDetTrackParticles.truthMatchProbability.truthParticleLink",
109 "AntiKt4EMPFlowJets.GN2v01_TrackOrigin.GN2v01_TrackLinks",
110 ]
111
112 STDM13SlimmingHelper.AllVariables += [
113 "EventInfo",
114 "PrimaryVertices",
115 "InDetTrackParticles",
116 "TruthParticles",
117 "AntiKt4TruthDressedWZJets",
118 "TruthEvents","TruthHFWithDecayParticles","TruthBoson","TruthBottom", "TruthCharm","TruthElectrons","TruthMuons","TruthTop","TruthTaus","MET_Truth",
119 "TruthPrimaryVertices","TruthHFWithDecayVertices",
120 ]
121
122 STDM13SlimmingHelper.IncludeTriggerNavigation = False
123 STDM13SlimmingHelper.IncludeJetTriggerContent = False
124 STDM13SlimmingHelper.IncludeMuonTriggerContent = False
125 STDM13SlimmingHelper.IncludeEGammaTriggerContent = False
126 STDM13SlimmingHelper.IncludeJetTauEtMissTriggerContent = False
127 STDM13SlimmingHelper.IncludeTauTriggerContent = False
128 STDM13SlimmingHelper.IncludeEtMissTriggerContent = False
129 STDM13SlimmingHelper.IncludeBJetTriggerContent = False
130 STDM13SlimmingHelper.IncludeBPhysTriggerContent = False
131 STDM13SlimmingHelper.IncludeMinBiasTriggerContent = False
132
133 # Truth extra content
134 if flags.Input.isMC:
135
136 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
137 addTruth3ContentToSlimmerTool(STDM13SlimmingHelper)
138 STDM13SlimmingHelper.AllVariables += ['TruthLHEParticles', 'TruthHFWithDecayParticles','TruthHFWithDecayVertices','TruthCharm','TruthPileupParticles','InTimeAntiKt4TruthJets','OutOfTimeAntiKt4TruthJets']
139 STDM13SlimmingHelper.ExtraVariables += ["Electrons.TruthLink",
140 "Muons.TruthLink",
141 "Photons.TruthLink",
142 "AntiKt4TruthDressedWZJets.IsoFixedCone5Pt"]
143
144 from DerivationFrameworkMCTruth.MCTruthCommonConfig import AddTauAndDownstreamParticlesCfg
145 acc.merge(AddTauAndDownstreamParticlesCfg(flags))
146 STDM13SlimmingHelper.AllVariables += ['TruthTausWithDecayParticles','TruthTausWithDecayVertices']
147
148 # Extra content
149 STDM13SlimmingHelper.ExtraVariables += ["AntiKt4EMPFlowJets.QGTransformer_ConstScore.DFCommonJets_QGTagger_truthjet_nCharged.DFCommonJets_QGTagger_truthjet_pt.DFCommonJets_QGTagger_truthjet_eta.DFCommonJets_QGTagger_NTracks.DFCommonJets_QGTagger_TracksWidth.DFCommonJets_QGTagger_TracksC1.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.GhostPartons.isJvtHS.isJvtPU.IsoFixedCone5PtPUsub" ]
150
151 # Trigger matching
152 # Run 2
153 if flags.Trigger.EDMVersion == 2:
154 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
155 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = STDM13SlimmingHelper,
156 OutputContainerPrefix = "TrigMatch_",
157 TriggerList = STDM13TriggerListsHelper.Run2TriggerNamesTau)
158 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = STDM13SlimmingHelper,
159 OutputContainerPrefix = "TrigMatch_",
160 TriggerList = STDM13TriggerListsHelper.Run2TriggerNamesNoTau)
161 # Run 3, or Run 2 with navigation conversion
162 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
163 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
164 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(STDM13SlimmingHelper)
165
166 # Output stream
167 STDM13ItemList = STDM13SlimmingHelper.GetItemList()
168 acc.merge(OutputStreamCfg(flags, "DAOD_STDM13", ItemList=STDM13ItemList, AcceptAlgs=["STDM13Kernel"]))
169 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_STDM13", AcceptAlgs=["STDM13Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData, MetadataCategory.TruthMetaData]))
170
171 return acc
172

◆ STDM13KernelCfg()

python.STDM13.STDM13KernelCfg ( flags,
name = 'STDM13Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for STDM13

Definition at line 12 of file STDM13.py.

12def STDM13KernelCfg(flags, name='STDM13Kernel', **kwargs):
13 """Configure the derivation framework driving algorithm (kernel) for STDM13"""
14 acc = ComponentAccumulator()
15
16 # Common augmentations
17 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
18 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
19
20
21
22 from BTagging.FlavorTaggingConfig import FlavorTaggingCfg
23 acc.merge(FlavorTaggingCfg(flags, "AntiKt4EMPFlowJets"))
24
25 #===================================================
26 # HEAVY FLAVOR CLASSIFICATION FOR ttbar+jets EVENTS
27 #===================================================
28 from DerivationFrameworkMCTruth.HFClassificationCommonConfig import HFClassificationCommonCfg
29 acc.merge(HFClassificationCommonCfg(flags))
30
31 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg
32
33 # filter leptons
34 lepton_skimming_expression = 'count( (Muons.pt > 25*GeV) && (0 == Muons.muonType || 1 == Muons.muonType || 4 == Muons.muonType) ) + count(( Electrons.pt > 25*GeV) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))) >= 1'
35
36 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
37 xAODStringSkimmingToolCfg)
38 STDM13StringSkimmingTool = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
39 flags, name = "STDM13StringSkimmingTool", expression = lepton_skimming_expression))
40
41 tp_thinning_expression = "abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 6.0*mm"
42 STDM13TPThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
43 flags,
44 name = "STDM13TPThinningTool",
45 StreamName = kwargs['StreamName'],
46 SelectionString = tp_thinning_expression,
47 InDetTrackParticlesKey = "InDetTrackParticles"))
48
49 # Truth thinning
50 if flags.Input.isMC:
51 truth_stable_expr = "TruthParticles.isGenStable"
52 STDM13TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning(
53 name = "STDM13TruthThin_stable",
54 StreamName = kwargs['StreamName'],
55 ParticleSelectionString = truth_stable_expr,
56 )
57 acc.addPublicTool(STDM13TruthThinningTool)
58
59 thinningTools = [STDM13TPThinningTool]
60 if flags.Input.isMC:
61 thinningTools += [STDM13TruthThinningTool]
62 skimmingTools = [STDM13StringSkimmingTool]
63
64 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
65 acc.addEventAlgo(DerivationKernel(name, SkimmingTools = skimmingTools, ThinningTools = thinningTools))
66 return acc
67
68