126 """Configure the derivation framework driving algorithm (kernel)
131 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
135 flags, TriggerListsHelper=kwargs[
"TriggerListsHelper"]
140 augmentationTools = []
145 EGAM5enuTransverseMassTool = acc.popToolsAndMerge(
148 acc.addPublicTool(EGAM5enuTransverseMassTool)
149 augmentationTools.append(EGAM5enuTransverseMassTool)
154 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import (
155 CaloDecoratorKernelCfg)
160 streamName = kwargs[
"StreamName"]
163 if flags.Derivation.Egamma.doTrackThinning:
164 from DerivationFrameworkInDet.InDetToolsConfig
import (
165 TrackParticleThinningCfg,
166 MuonTrackParticleThinningCfg,
167 TauTrackParticleThinningCfg,
170 TrackThinningKeepElectronTracks =
True
171 TrackThinningKeepPhotonTracks =
True
172 TrackThinningKeepAllElectronTracks =
False
173 TrackThinningKeepJetTracks =
False
174 TrackThinningKeepMuonTracks =
False
175 TrackThinningKeepTauTracks =
False
176 TrackThinningKeepPVTracks =
True
179 if TrackThinningKeepElectronTracks:
180 EGAM5ElectronTPThinningTool = (
181 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
182 name=
"EGAM5ElectronTPThinningTool",
183 StreamName=streamName,
185 GSFTrackParticlesKey=
"GSFTrackParticles",
186 InDetTrackParticlesKey=
"InDetTrackParticles",
187 SelectionString=
"Electrons.pt > 0*GeV",
192 acc.addPublicTool(EGAM5ElectronTPThinningTool)
193 thinningTools.append(EGAM5ElectronTPThinningTool)
197 if TrackThinningKeepAllElectronTracks:
198 EGAM5ElectronTPThinningTool2 = (
199 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
200 name=
"EGAM5ElectronTPThinningTool2",
201 StreamName=streamName,
203 GSFTrackParticlesKey=
"GSFTrackParticles",
204 InDetTrackParticlesKey=
"InDetTrackParticles",
205 SelectionString=
"Electrons.pt > 4*GeV",
210 acc.addPublicTool(EGAM5ElectronTPThinningTool2)
211 thinningTools.append(EGAM5ElectronTPThinningTool2)
214 if TrackThinningKeepPhotonTracks:
215 EGAM5PhotonTPThinningTool = (
216 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
217 name=
"EGAM5PhotonTPThinningTool",
218 StreamName=streamName,
220 GSFTrackParticlesKey=
"GSFTrackParticles",
221 InDetTrackParticlesKey=
"InDetTrackParticles",
222 GSFConversionVerticesKey=
"GSFConversionVertices",
223 SelectionString=
"Photons.pt > 0*GeV",
228 acc.addPublicTool(EGAM5PhotonTPThinningTool)
229 thinningTools.append(EGAM5PhotonTPThinningTool)
232 if TrackThinningKeepJetTracks:
233 EGAM5JetTPThinningTool = (
234 CompFactory.DerivationFramework.JetTrackParticleThinning(
235 name=
"EGAM5JetTPThinningTool",
236 StreamName=streamName,
237 JetKey=
"AntiKt4EMPFlowJets",
238 InDetTrackParticlesKey=
"InDetTrackParticles",
241 acc.addPublicTool(EGAM5JetTPThinningTool)
242 thinningTools.append(EGAM5JetTPThinningTool)
245 if TrackThinningKeepMuonTracks:
246 EGAM5MuonTPThinningTool = acc.getPrimaryAndMerge(
249 name=
"EGAM5MuonTPThinningTool",
250 StreamName=streamName,
252 InDetTrackParticlesKey=
"InDetTrackParticles",
255 thinningTools.append(EGAM5MuonTPThinningTool)
258 if TrackThinningKeepTauTracks:
259 EGAM5TauTPThinningTool = acc.getPrimaryAndMerge(
262 name=
"EGAM5TauTPThinningTool",
263 StreamName=streamName,
266 InDetTrackParticlesKey=
"InDetTrackParticles",
267 DoTauTracksThinning=
True,
268 TauTracksKey=
"TauTracks",
271 thinningTools.append(EGAM5TauTPThinningTool)
274 thinning_expression =
" && ".
join(
276 "(InDetTrackParticles.DFCommonTightPrimary)",
277 "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3*mm)",
278 "(InDetTrackParticles.pt>10*GeV)",
281 if TrackThinningKeepPVTracks:
282 EGAM5TPThinningTool = acc.getPrimaryAndMerge(
285 name=
"EGAM5TPThinningTool",
286 StreamName=streamName,
287 SelectionString=thinning_expression,
288 InDetTrackParticlesKey=
"InDetTrackParticles",
291 thinningTools.append(EGAM5TPThinningTool)
298 CompFactory.DerivationFramework.DerivationKernel(
300 SkimmingTools=[skimmingTool],
301 AugmentationTools=augmentationTools,
302 ThinningTools=thinningTools,