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 95 of file STDM17.py.

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

◆ STDM17AugmentationToolsForSkimmingCfg()

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

Definition at line 62 of file STDM17.py.

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

◆ STDM17Cfg()

python.STDM17.STDM17Cfg ( flags)

Definition at line 237 of file STDM17.py.

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

◆ STDM17KernelCfg()

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

Definition at line 128 of file STDM17.py.

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

◆ 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 from DerivationFrameworkJetEtMiss import TriggerLists
17 elTriggers = TriggerLists.single_el_Trig(flags)
18 muTriggers = TriggerLists.single_mu_Trig(flags)
19
20 addRun3ElectronTriggers = ["HLT_e17_lhvloose_L1EM15VHI","HLT_e20_lhvloose_L1EM15VH", "HLT_e250_etcut_L1EM22VHI",
21 "HLT_e26_lhtight_ivarloose_L1EM22VHI","HLT_e26_lhtight_ivarloose_L1eEM26M",
22 "HLT_e60_lhmedium_L1EM22VHI","HLT_e60_lhmedium_L1eEM26M",
23 "HLT_e140_lhloose_L1EM22VHI","HLT_e140_lhloose_L1eEM26M",
24 "HLT_e300_etcut_L1EM22VHI","HLT_e300_etcut_L1eEM26M",
25 "HLT_e140_lhloose_noringer_L1EM22VHI","HLT_e140_lhloose_noringer_L1eEM26M"]
26
27 addRund3MuonTriggers = ["HLT_mu24_ivarmedium_L1MU14FCH","HLT_mu50_L1MU14FCH","HLT_mu60_0eta105_msonly_L1MU14FCH","HLT_mu60_L1MU14FCH","HLT_mu80_msonly_3layersEC_L1MU14FCH"]
28
29 elTriggers = elTriggers+addRun3ElectronTriggers
30 muTriggers = muTriggers+addRund3MuonTriggers
31 lepTriggers = elTriggers+muTriggers
32
33 #xAODStringSkimmingTool cannot handle electron trigger names, therefore need to use TriggerSkimmingTool
34 tracks = 'InDetTrackParticles.TrkIsoPt1000_ptcone20 < 0.12*InDetTrackParticles.pt && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm'
35
36 trackRequirements = '(InDetTrackParticles.pt > 9.*GeV && '+tracks+' )'
37 #b-jet requirement FixedCutBEff_85 of GN2v01
38 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)'
39
40 muonsRequirements = '(Muons.pt >= 24.*GeV) && (abs(Muons.eta) < 2.6) && (Muons.DFCommonMuonPassPreselection)'
41 electronsRequirements = '(Electrons.pt > 24.*GeV) && (abs(Electrons.eta) < 2.6) && ((Electrons.Loose) || (Electrons.DFCommonElectronsLHLoose))'
42
43 #String skimming selections
44 expression = '( count('+trackRequirements+') >=2 && count('+jetRequirementsTtbar+') >=1 && ( count('+muonsRequirements+') >=1 || count('+electronsRequirements+') >=1 ) )'
45
46 skimmingTool = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "skimmingTool", expression = expression)
47 acc.addPublicTool(skimmingTool)
48
49 # Trigger skimming tools
50 STDM17TriggerSkimmingTool_lep = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "STDM17TriggerSkimmingTool_lep", TriggerListOR = lepTriggers)
51 acc.addPublicTool(STDM17TriggerSkimmingTool_lep)
52 STDM17SkimmingTool_lep = CompFactory.DerivationFramework.FilterCombinationAND(name="STDM17SkimmingTool_lep", FilterList=[skimmingTool, STDM17TriggerSkimmingTool_lep])
53 acc.addPublicTool(STDM17SkimmingTool_lep)
54
55 finalSkimmingTools = [STDM17SkimmingTool_lep]
56
57 STDM17SkimmingTool = CompFactory.DerivationFramework.FilterCombinationOR(name="STDM17SkimmingTool", FilterList=finalSkimmingTools)
58 acc.addPublicTool(STDM17SkimmingTool, primary = True)
59
60 return(acc)
61