205 """Configure the derivation framework driving algorithm (kernel)
210 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
214 flags, TriggerListsHelper=kwargs[
"TriggerListsHelper"]
219 augmentationTools = []
225 acc.addPublicTool(EGAM3eeMassTool1)
226 augmentationTools.append(EGAM3eeMassTool1)
229 acc.addPublicTool(EGAM3eeMassTool2)
230 augmentationTools.append(EGAM3eeMassTool2)
233 acc.addPublicTool(EGAM3eeMassTool3)
234 augmentationTools.append(EGAM3eeMassTool3)
239 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import (
240 CaloDecoratorKernelCfg)
245 streamName = kwargs[
"StreamName"]
248 if flags.Derivation.Egamma.doTrackThinning:
249 from DerivationFrameworkInDet.InDetToolsConfig
import (
250 TrackParticleThinningCfg,
251 MuonTrackParticleThinningCfg,
252 TauTrackParticleThinningCfg,
255 TrackThinningKeepElectronTracks =
True
256 TrackThinningKeepAllElectronTracks =
False
257 TrackThinningKeepPhotonTracks =
True
258 TrackThinningKeepAllPhotonTracks =
True
259 TrackThinningKeepJetTracks =
False
260 TrackThinningKeepMuonTracks =
False
261 TrackThinningKeepTauTracks =
False
262 TrackThinningKeepPVTracks =
True
265 if TrackThinningKeepElectronTracks:
266 EGAM3ElectronTPThinningTool = (
267 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
268 name=
"EGAM3ElectronTPThinningTool",
269 StreamName=streamName,
271 GSFTrackParticlesKey=
"GSFTrackParticles",
272 InDetTrackParticlesKey=
"InDetTrackParticles",
273 SelectionString=
"Electrons.pt > 0*GeV",
278 acc.addPublicTool(EGAM3ElectronTPThinningTool)
279 thinningTools.append(EGAM3ElectronTPThinningTool)
283 if TrackThinningKeepAllElectronTracks:
284 EGAM3ElectronTPThinningTool2 = (
285 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
286 name=
"EGAM3ElectronTPThinningTool2",
287 StreamName=streamName,
289 GSFTrackParticlesKey=
"GSFTrackParticles",
290 InDetTrackParticlesKey=
"InDetTrackParticles",
291 SelectionString=
"Electrons.pt > 4*GeV",
296 acc.addPublicTool(EGAM3ElectronTPThinningTool2)
297 thinningTools.append(EGAM3ElectronTPThinningTool2)
300 if TrackThinningKeepPhotonTracks:
301 EGAM3PhotonTPThinningTool = (
302 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
303 name=
"EGAM3PhotonTPThinningTool",
304 StreamName=streamName,
306 GSFTrackParticlesKey=
"GSFTrackParticles",
307 InDetTrackParticlesKey=
"InDetTrackParticles",
308 GSFConversionVerticesKey=
"GSFConversionVertices",
309 SelectionString=
"Photons.pt > 0*GeV",
314 acc.addPublicTool(EGAM3PhotonTPThinningTool)
315 thinningTools.append(EGAM3PhotonTPThinningTool)
319 if TrackThinningKeepAllPhotonTracks:
320 EGAM3PhotonTPThinningTool2 = (
321 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
322 name=
"EGAM3PhotonTPThinningTool2",
323 StreamName=streamName,
325 GSFTrackParticlesKey=
"GSFTrackParticles",
326 InDetTrackParticlesKey=
"InDetTrackParticles",
327 GSFConversionVerticesKey=
"GSFConversionVertices",
328 SelectionString=
"Photons.pt > 9.5*GeV",
333 acc.addPublicTool(EGAM3PhotonTPThinningTool2)
334 thinningTools.append(EGAM3PhotonTPThinningTool2)
337 if TrackThinningKeepJetTracks:
338 EGAM3JetTPThinningTool = (
339 CompFactory.DerivationFramework.JetTrackParticleThinning(
340 name=
"EGAM3JetTPThinningTool",
341 StreamName=streamName,
342 JetKey=
"AntiKt4EMPFlowJets",
343 InDetTrackParticlesKey=
"InDetTrackParticles",
346 acc.addPublicTool(EGAM3JetTPThinningTool)
347 thinningTools.append(EGAM3JetTPThinningTool)
350 if TrackThinningKeepMuonTracks:
351 EGAM3MuonTPThinningTool = acc.getPrimaryAndMerge(
354 name=
"EGAM3MuonTPThinningTool",
355 StreamName=streamName,
357 InDetTrackParticlesKey=
"InDetTrackParticles",
360 thinningTools.append(EGAM3MuonTPThinningTool)
363 if TrackThinningKeepTauTracks:
364 EGAM3TauTPThinningTool = acc.getPrimaryAndMerge(
367 name=
"EGAM3TauTPThinningTool",
368 StreamName=streamName,
371 InDetTrackParticlesKey=
"InDetTrackParticles",
372 DoTauTracksThinning=
True,
373 TauTracksKey=
"TauTracks",
376 thinningTools.append(EGAM3TauTPThinningTool)
379 thinning_expression =
" && ".
join(
381 "(InDetTrackParticles.DFCommonTightPrimary)",
382 "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3*mm)",
383 "(InDetTrackParticles.pt>10*GeV)",
386 if TrackThinningKeepPVTracks:
387 EGAM3TPThinningTool = acc.getPrimaryAndMerge(
390 name=
"EGAM3TPThinningTool",
391 StreamName=streamName,
392 SelectionString=thinning_expression,
393 InDetTrackParticlesKey=
"InDetTrackParticles",
396 thinningTools.append(EGAM3TPThinningTool)
400 acc.addPublicTool(skimmingTool)
404 CompFactory.DerivationFramework.DerivationKernel(
406 SkimmingTools=[skimmingTool],
407 AugmentationTools=augmentationTools,
408 ThinningTools=thinningTools,