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

Functions

 STDM17SkimmingToolCfg (flags)
 STDM17AugmentationToolsForSkimmingCfg (flags)
 STDM17AugmentationToolsCfg (flags)
 STDM17KernelCfg (flags, name='STDM17Kernel', **kwargs)
 STDM17Cfg (flags)

Function Documentation

◆ STDM17AugmentationToolsCfg()

python.STDM17.STDM17AugmentationToolsCfg ( flags)
Configure the augmentation tool

Definition at line 103 of file STDM17.py.

103def STDM17AugmentationToolsCfg(flags):
104 """Configure the augmentation tool"""
105 acc = ComponentAccumulator()
106
107 toolkwargs = {}
108 # Loose tracks with pT > 500 MeV
109 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
110 InDetTrackSelectionTool_Loose_Cfg)
111 toolkwargs["TrackSelectionTool"] = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
112 name = "TrackSelectionTool500_STDM17",
113 minPt = 500.))
114 #Nonprompt_All_MaxWeight TTVA
115 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import isoTTVAToolCfg
116 toolkwargs['TTVATool'] = acc.popToolsAndMerge(isoTTVAToolCfg(flags))
117
118 toolkwargs["name"] = "TrackIsolationToolPt500"
119 TrackIsoTool = CompFactory.xAOD.TrackIsolationTool(**toolkwargs)
120 acc.addPublicTool(TrackIsoTool)
121
122
123 from xAODPrimitives.xAODIso import xAODIso as isoPar
124 from DerivationFrameworkInDet.InDetToolsConfig import IsolationTrackDecoratorCfg
125 Pt500IsoTrackDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(flags,
126 name = "Pt500IsoTrackDecorator",
127 TrackIsolationTool = TrackIsoTool,
128 TargetContainer = "InDetTrackParticles",
129 iso = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20],
130 isoSuffix = ["ptcone40", "ptcone30", "ptcone20"],
131 Prefix = "TrkIsoPt500_"))
132 acc.addPublicTool(Pt500IsoTrackDecorator, primary=True)
133
134 return(acc)
135
136# Main algorithm config

◆ STDM17AugmentationToolsForSkimmingCfg()

python.STDM17.STDM17AugmentationToolsForSkimmingCfg ( flags)
Configure the augmentation tool for skimming

Definition at line 69 of file STDM17.py.

69def STDM17AugmentationToolsForSkimmingCfg(flags):
70 """Configure the augmentation tool for skimming"""
71 acc = ComponentAccumulator()
72
73 # Loose tracks with pT > 1000 MeV and Nonprompt_All_MaxWeight TTVA
74 toolkwargs = {}
75 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
76 InDetTrackSelectionTool_Loose_Cfg)
77 toolkwargs["TrackSelectionTool"] = acc.popToolsAndMerge(InDetTrackSelectionTool_Loose_Cfg(flags,
78 name = "TrackSelectionTool1000_STDM17",
79 minPt = 1000.))
80
81 #Nonprompt_All_MaxWeight TTVA
82 from TrackVertexAssociationTool.TrackVertexAssociationToolConfig import isoTTVAToolCfg
83 toolkwargs['TTVATool'] = acc.popToolsAndMerge(isoTTVAToolCfg(flags))
84
85 toolkwargs["name"] = "TrackIsolationToolPt1000"
86 TrackIsoTool = CompFactory.xAOD.TrackIsolationTool(**toolkwargs)
87 acc.addPublicTool(TrackIsoTool)
88
89
90 from xAODPrimitives.xAODIso import xAODIso as isoPar
91 from DerivationFrameworkInDet.InDetToolsConfig import IsolationTrackDecoratorCfg
92 Pt1000IsoTrackDecorator = acc.getPrimaryAndMerge(IsolationTrackDecoratorCfg(flags,
93 name = "Pt1000IsoTrackDecorator",
94 TrackIsolationTool = TrackIsoTool,
95 TargetContainer = "InDetTrackParticles",
96 iso = [isoPar.ptcone40, isoPar.ptcone30, isoPar.ptcone20],
97 isoSuffix = ["ptcone40", "ptcone30", "ptcone20"],
98 Prefix = "TrkIsoPt1000_"))
99 acc.addPublicTool(Pt1000IsoTrackDecorator, primary=True)
100
101 return(acc)
102

◆ STDM17Cfg()

python.STDM17.STDM17Cfg ( flags)

Definition at line 246 of file STDM17.py.

246def STDM17Cfg(flags):
247
248 acc = ComponentAccumulator()
249
250 # Get the lists of triggers needed for trigger matching.
251 # This is needed at this scope (for the slimming) and further down in the config chain
252 # for actually configuring the matching, so we create it here and pass it down
253 # Note this should ideally be called higher up to avoid it being run multiple times in a train
254 from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
255 STDM17TriggerListsHelper = TriggerListsHelper(flags)
256
257 # Skimming, thinning, augmentation, extra content
258 acc.merge(STDM17KernelCfg(flags, name="STDM17Kernel", PreselectionName="STDM17PreselectionKernel", StreamName = 'StreamDAOD_STDM17', TriggerListsHelper = STDM17TriggerListsHelper))
259
260 # ============================
261 # Define contents of the format
262 # =============================
263 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
264 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
265 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
266
267 STDM17SlimmingHelper = SlimmingHelper("STDM17SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
268
269 STDM17SlimmingHelper.SmartCollections = ["EventInfo",
270 "Electrons", "Photons", "Muons", "TauJets", "TauJets_MuonRM",
271 "InDetTrackParticles", "PrimaryVertices",
272 "MET_Baseline_AntiKt4EMPFlow",
273 "AntiKt4EMPFlowJets"]
274
275
276 STDM17SlimmingHelper.AllVariables = ["MuonSegments","InDetTrackParticles",
277 "Kt4EMTopoOriginEventShape","Kt4EMPFlowEventShape","CaloCalTopoClusters"]
278
279 STDM17SlimmingHelper.ExtraVariables = ["InDetTrackParticles.TrkIsoPt1000_ptcone40.TrkIsoPt1000_ptcone30.TrkIsoPt1000_ptcone20.TrkIsoPt500_ptcone40.TrkIsoPt500_ptcone30.TrkIsoPt500_ptcone20"]
280
281 if flags.Input.isMC:
282 from DerivationFrameworkMCTruth.MCTruthCommonConfig import addTruth3ContentToSlimmerTool
283 addTruth3ContentToSlimmerTool(STDM17SlimmingHelper)
284
285 STDM17SlimmingHelper.AppendToDictionary.update({'TruthParticles': 'xAOD::TruthParticleContainer',
286 'TruthParticlesAux': 'xAOD::TruthParticleAuxContainer'})
287
288 STDM17SlimmingHelper.SmartCollections += ["AntiKt4TruthJets"]
289 STDM17SlimmingHelper.AllVariables += ["MuonTruthParticles", "TruthParticles", "TruthVertices"]
290
291 # Trigger content
292 STDM17SlimmingHelper.IncludeTriggerNavigation = False
293 STDM17SlimmingHelper.IncludeJetTriggerContent = False
294 STDM17SlimmingHelper.IncludeMuonTriggerContent = False
295 STDM17SlimmingHelper.IncludeEGammaTriggerContent = False
296 STDM17SlimmingHelper.IncludeTauTriggerContent = False
297 STDM17SlimmingHelper.IncludeEtMissTriggerContent = False
298 STDM17SlimmingHelper.IncludeBJetTriggerContent = False
299 STDM17SlimmingHelper.IncludeBPhysTriggerContent = False
300 STDM17SlimmingHelper.IncludeMinBiasTriggerContent = False
301
302
303 # Trigger matching
304 # Run 2
305 if flags.Trigger.EDMVersion == 2:
306 from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
307 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = STDM17SlimmingHelper,
308 OutputContainerPrefix = "TrigMatch_",
309 TriggerList = STDM17TriggerListsHelper.Run2TriggerNamesTau)
310 AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = STDM17SlimmingHelper,
311 OutputContainerPrefix = "TrigMatch_",
312 TriggerList = STDM17TriggerListsHelper.Run2TriggerNamesNoTau)
313 # Run 3, or Run 2 with navigation conversion
314 if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
315 from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
316 AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(STDM17SlimmingHelper)
317
318
319
320 # Output stream
321 STDM17ItemList = STDM17SlimmingHelper.GetItemList()
322 acc.merge(OutputStreamCfg(flags, "DAOD_STDM17", ItemList=STDM17ItemList, AcceptAlgs=["STDM17Kernel"]))
323 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_STDM17", AcceptAlgs=["STDM17Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
324
325 return acc
326

◆ STDM17KernelCfg()

python.STDM17.STDM17KernelCfg ( flags,
name = 'STDM17Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for STDM17

Definition at line 137 of file STDM17.py.

137def STDM17KernelCfg(flags, name='STDM17Kernel', **kwargs):
138 """Configure the derivation framework driving algorithm (kernel) for STDM17"""
139 acc = ComponentAccumulator()
140
141 # Common augmentations
142 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
143 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
144
145 #Pre-selection kernel
146 from AthenaCommon.CFElements import seqAND
147 acc.addSequence( seqAND("STDM17Sequence") )
148 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
149 skimmingTool = acc.getPrimaryAndMerge(STDM17SkimmingToolCfg(flags))
150 augmentationToolSkim = acc.getPrimaryAndMerge(STDM17AugmentationToolsForSkimmingCfg(flags))
151 skimmingKernel = DerivationKernel(kwargs["PreselectionName"], SkimmingTools = [skimmingTool], AugmentationTools = [augmentationToolSkim])
152 acc.addEventAlgo( skimmingKernel, sequenceName="STDM17Sequence" )
153
154 # Thinning tools...
155 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, TauTrackParticleThinningCfg
156
157 # Increased cut (w.r.t. R21) on abs(z0) for new TTVA working points
158 STDM17_thinning_expression = "( InDetTrackParticles.pt > 6*GeV && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
159 STDM17TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
160 flags,
161 name = "STDM17TrackParticleThinningTool",
162 StreamName = kwargs['StreamName'],
163 SelectionString = STDM17_thinning_expression,
164 InDetTrackParticlesKey = "InDetTrackParticles"))
165
166 # Include inner detector tracks associated with muons
167 STDM17MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
168 flags,
169 name = "STDM17MuonTPThinningTool",
170 StreamName = kwargs['StreamName'],
171 MuonKey = "Muons",
172 InDetTrackParticlesKey = "InDetTrackParticles"))
173
174 # Include inner detector tracks associated with electonrs
175 STDM17ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
176 flags,
177 name = "STDM17ElectronTPThinningTool",
178 StreamName = kwargs['StreamName'],
179 SGKey = "Electrons",
180 InDetTrackParticlesKey = "InDetTrackParticles"))
181
182 # Include inner detector tracks associated with photons
183 STDM17PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
184 flags,
185 name = "STDM17PhotonTPThinningTool",
186 StreamName = kwargs['StreamName'],
187 SGKey = "Photons",
188 InDetTrackParticlesKey = "InDetTrackParticles",
189 GSFConversionVerticesKey = "GSFConversionVertices"))
190
191 # Include inner detector tracks associated with taus
192 STDM17TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
193 flags,
194 name = "STDM17TauTPThinningTool",
195 StreamName = kwargs['StreamName'],
196 TauKey = "TauJets",
197 InDetTrackParticlesKey = "InDetTrackParticles",
198 DoTauTracksThinning = True,
199 TauTracksKey = "TauTracks"))
200
201 thinningTools = [STDM17TrackParticleThinningTool,
202 STDM17MuonTPThinningTool,
203 STDM17ElectronTPThinningTool,
204 STDM17PhotonTPThinningTool,
205 STDM17TauTPThinningTool]
206
207 #CaloClusterThinning
208 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import CaloClusterThinningCfg
209 selectionString = "( InDetTrackParticles.pt > 6*GeV && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
210 STDM17CaloThinningTool = acc.getPrimaryAndMerge(CaloClusterThinningCfg(flags,
211 name = "STDM17CaloClusterThinning",
212 StreamName = kwargs['StreamName'],
213 SGKey = "InDetTrackParticles",
214 TopoClCollectionSGKey = "CaloCalTopoClusters",
215 SelectionString = selectionString,
216 ConeSize = 0.6))
217 acc.addPublicTool(STDM17CaloThinningTool)
218 thinningTools.append(STDM17CaloThinningTool)
219
220 if flags.Input.isMC:
221 truth_cond_status = "( (TruthParticles.pdgId == 24) || (TruthParticles.pdgId == -24) )" # decay products of W so we know which are signal
222 truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && (TruthParticles.barcode < 200000))" # Leptons
223 truth_expression = '('+truth_cond_status+' || '+truth_cond_Lepton +')'
224
225 STDM17TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "STDM17TruthThinningTool",
226 StreamName = kwargs['StreamName'],
227 ParticleSelectionString = truth_expression,
228 PreserveDescendants = False,
229 PreserveGeneratorDescendants = True,
230 PreserveAncestors = False)
231
232 acc.addPublicTool(STDM17TruthThinningTool)
233 thinningTools.append(STDM17TruthThinningTool)
234
235 # augmentation tool
236 augmentationTool = acc.getPrimaryAndMerge(STDM17AugmentationToolsCfg(flags))
237
238 # Main kernel
239 acc.addEventAlgo(DerivationKernel(name,
240 ThinningTools = thinningTools,
241 AugmentationTools = [augmentationTool]),
242 sequenceName="STDM17Sequence")
243
244 return acc
245

◆ STDM17SkimmingToolCfg()

python.STDM17.STDM17SkimmingToolCfg ( flags)
Configure the skimming tool

Definition at line 12 of file STDM17.py.

12def STDM17SkimmingToolCfg(flags):
13 """Configure the skimming tool"""
14 acc = ComponentAccumulator()
15
16 filterList = []
17
18 from DerivationFrameworkJetEtMiss import TriggerLists
19 elTriggers = TriggerLists.single_el_Trig(flags)
20 muTriggers = TriggerLists.single_mu_Trig(flags)
21
22 addRun3ElectronTriggers = ["HLT_e17_lhvloose_L1EM15VHI","HLT_e20_lhvloose_L1EM15VH", "HLT_e250_etcut_L1EM22VHI",
23 "HLT_e26_lhtight_ivarloose_L1EM22VHI","HLT_e26_lhtight_ivarloose_L1eEM26M",
24 "HLT_e60_lhmedium_L1EM22VHI","HLT_e60_lhmedium_L1eEM26M",
25 "HLT_e140_lhloose_L1EM22VHI","HLT_e140_lhloose_L1eEM26M",
26 "HLT_e300_etcut_L1EM22VHI","HLT_e300_etcut_L1eEM26M",
27 "HLT_e140_lhloose_noringer_L1EM22VHI","HLT_e140_lhloose_noringer_L1eEM26M"]
28
29 addRund3MuonTriggers = ["HLT_mu24_ivarmedium_L1MU14FCH","HLT_mu50_L1MU14FCH","HLT_mu60_0eta105_msonly_L1MU14FCH","HLT_mu60_L1MU14FCH","HLT_mu80_msonly_3layersEC_L1MU14FCH"]
30
31 elTriggers = elTriggers+addRun3ElectronTriggers
32 muTriggers = muTriggers+addRund3MuonTriggers
33 lepTriggers = elTriggers+muTriggers
34
35 #xAODStringSkimmingTool cannot handle electron trigger names, therefore need to use TriggerSkimmingTool
36 tracks = 'InDetTrackParticles.TrkIsoPt1000_ptcone20 < 0.12*InDetTrackParticles.pt && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm'
37
38 trackRequirements = '(InDetTrackParticles.pt > 9.*GeV && '+tracks+' )'
39 #b-jet requirement FixedCutBEff_85 of GN2v01
40 jetRequirementsTtbar = '(AntiKt4EMPFlowJets.pt > 18*GeV && log(AntiKt4EMPFlowJets.GN2v01_pb/(0.2*AntiKt4EMPFlowJets.GN2v01_pc+0.01*AntiKt4EMPFlowJets.GN2v01_ptau+(1.0-0.2-0.01)*AntiKt4EMPFlowJets.GN2v01_pu)) > -0.378)'
41
42 muonsRequirements = '(Muons.pt >= 24.*GeV) && (abs(Muons.eta) < 2.6) && (Muons.DFCommonMuonPassPreselection)'
43 electronsRequirements = '(Electrons.pt > 24.*GeV) && (abs(Electrons.eta) < 2.6) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))'
44
45 #String skimming selections
46 expression = '( count('+trackRequirements+') >=2 && count('+jetRequirementsTtbar+') >=1 && ( count('+muonsRequirements+') >=1 || count('+electronsRequirements+') >=1 ) )'
47
48 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
49 xAODStringSkimmingToolCfg)
50 skimmingTool = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
51 flags, name = "skimmingTool", expression = expression))
52 acc.addPublicTool(skimmingTool)
53 filterList += [skimmingTool]
54
55 # Trigger skimming tools
56 if flags.Trigger.EDMVersion >= 0:
57 STDM17TriggerSkimmingTool_lep = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "STDM17TriggerSkimmingTool_lep", TriggerListOR = lepTriggers)
58 acc.addPublicTool(STDM17TriggerSkimmingTool_lep)
59 filterList += [STDM17TriggerSkimmingTool_lep]
60
61 STDM17SkimmingTool_lep = CompFactory.DerivationFramework.FilterCombinationAND(name="STDM17SkimmingTool_lep", FilterList=filterList)
62 acc.addPublicTool(STDM17SkimmingTool_lep)
63
64 STDM17SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name="STDM17SkimmingTool", FilterList=[STDM17SkimmingTool_lep])
65 acc.addPublicTool(STDM17SkimmingTool, primary = True)
66
67 return(acc)
68