151 """Configure the derivation framework driving algorithm (kernel)
156 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
160 flags, TriggerListsHelper=kwargs[
"TriggerListsHelper"]
165 augmentationTools = []
171 acc.addPublicTool(EGAM2JpsieeMassTool1)
172 augmentationTools.append(EGAM2JpsieeMassTool1)
175 acc.addPublicTool(EGAM2JpsieeMassTool2)
176 augmentationTools.append(EGAM2JpsieeMassTool2)
181 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import (
182 CaloDecoratorKernelCfg,
189 streamName = kwargs[
"StreamName"]
192 if flags.Derivation.Egamma.doTrackThinning:
193 from DerivationFrameworkInDet.InDetToolsConfig
import (
194 TrackParticleThinningCfg,
195 MuonTrackParticleThinningCfg,
196 TauTrackParticleThinningCfg,
199 TrackThinningKeepElectronTracks =
True
200 TrackThinningKeepPhotonTracks =
True
201 TrackThinningKeepAllElectronTracks =
False
202 TrackThinningKeepJetTracks =
False
203 TrackThinningKeepMuonTracks =
False
204 TrackThinningKeepTauTracks =
False
205 TrackThinningKeepPVTracks =
False
208 if TrackThinningKeepElectronTracks:
209 EGAM2ElectronTPThinningTool = (
210 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
211 name=
"EGAM2ElectronTPThinningTool",
212 StreamName=streamName,
214 GSFTrackParticlesKey=
"GSFTrackParticles",
215 InDetTrackParticlesKey=
"InDetTrackParticles",
216 SelectionString=
"Electrons.pt > 0*GeV",
221 acc.addPublicTool(EGAM2ElectronTPThinningTool)
222 thinningTools.append(EGAM2ElectronTPThinningTool)
226 if TrackThinningKeepAllElectronTracks:
227 EGAM2ElectronTPThinningTool2 = (
228 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
229 name=
"EGAM2ElectronTPThinningTool2",
230 StreamName=streamName,
232 GSFTrackParticlesKey=
"GSFTrackParticles",
233 InDetTrackParticlesKey=
"InDetTrackParticles",
234 SelectionString=
"Electrons.pt > 4*GeV",
239 acc.addPublicTool(EGAM2ElectronTPThinningTool2)
240 thinningTools.append(EGAM2ElectronTPThinningTool2)
243 if TrackThinningKeepPhotonTracks:
244 EGAM2PhotonTPThinningTool = (
245 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
246 name=
"EGAM2PhotonTPThinningTool",
247 StreamName=streamName,
249 GSFTrackParticlesKey=
"GSFTrackParticles",
250 InDetTrackParticlesKey=
"InDetTrackParticles",
251 GSFConversionVerticesKey=
"GSFConversionVertices",
252 SelectionString=
"Photons.pt > 0*GeV",
257 acc.addPublicTool(EGAM2PhotonTPThinningTool)
258 thinningTools.append(EGAM2PhotonTPThinningTool)
261 if TrackThinningKeepJetTracks:
262 EGAM2JetTPThinningTool = (
263 CompFactory.DerivationFramework.JetTrackParticleThinning(
264 name=
"EGAM2JetTPThinningTool",
265 StreamName=streamName,
266 JetKey=
"AntiKt4EMPFlowJets",
267 InDetTrackParticlesKey=
"InDetTrackParticles",
270 acc.addPublicTool(EGAM2JetTPThinningTool)
271 thinningTools.append(EGAM2JetTPThinningTool)
274 if TrackThinningKeepMuonTracks:
275 EGAM2MuonTPThinningTool = acc.getPrimaryAndMerge(
278 name=
"EGAM2MuonTPThinningTool",
279 StreamName=streamName,
281 InDetTrackParticlesKey=
"InDetTrackParticles",
284 thinningTools.append(EGAM2MuonTPThinningTool)
287 if TrackThinningKeepTauTracks:
288 EGAM2TauTPThinningTool = acc.getPrimaryAndMerge(
291 name=
"EGAM2TauTPThinningTool",
292 StreamName=streamName,
295 InDetTrackParticlesKey=
"InDetTrackParticles",
296 DoTauTracksThinning=
True,
297 TauTracksKey=
"TauTracks",
300 thinningTools.append(EGAM2TauTPThinningTool)
303 thinning_expression =
" && ".
join(
305 "(InDetTrackParticles.DFCommonTightPrimary)",
306 "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3*mm)",
307 "(InDetTrackParticles.pt > 10*GeV)",
310 if TrackThinningKeepPVTracks:
311 EGAM2TPThinningTool = acc.getPrimaryAndMerge(
314 name=
"EGAM2TPThinningTool",
315 StreamName=streamName,
316 SelectionString=thinning_expression,
317 InDetTrackParticlesKey=
"InDetTrackParticles",
320 thinningTools.append(EGAM2TPThinningTool)
327 CompFactory.DerivationFramework.DerivationKernel(
329 SkimmingTools=[skimmingTool],
330 AugmentationTools=augmentationTools,
331 ThinningTools=thinningTools,