91 """Configure the derivation framework driving algorithm (kernel)
96 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
100 flags, TriggerListsHelper=kwargs[
"TriggerListsHelper"]
105 augmentationTools = []
111 acc.addPublicTool(EGAM4mumuMassTool)
112 augmentationTools.append(EGAM4mumuMassTool)
117 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import (
118 CaloDecoratorKernelCfg)
123 streamName = kwargs[
"StreamName"]
126 if flags.Derivation.Egamma.doTrackThinning:
127 from DerivationFrameworkInDet.InDetToolsConfig
import (
128 TrackParticleThinningCfg,
129 MuonTrackParticleThinningCfg,
130 TauTrackParticleThinningCfg,
133 TrackThinningKeepElectronTracks =
True
134 TrackThinningKeepAllElectronTracks =
False
135 TrackThinningKeepPhotonTracks =
True
136 TrackThinningKeepAllPhotonTracks =
True
137 TrackThinningKeepJetTracks =
False
138 TrackThinningKeepMuonTracks =
False
139 TrackThinningKeepTauTracks =
False
140 TrackThinningKeepPVTracks =
True
143 if TrackThinningKeepElectronTracks:
144 EGAM4ElectronTPThinningTool = (
145 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
146 name=
"EGAM4ElectronTPThinningTool",
147 StreamName=streamName,
149 GSFTrackParticlesKey=
"GSFTrackParticles",
150 InDetTrackParticlesKey=
"InDetTrackParticles",
151 SelectionString=
"Electrons.pt > 0*GeV",
156 acc.addPublicTool(EGAM4ElectronTPThinningTool)
157 thinningTools.append(EGAM4ElectronTPThinningTool)
161 if TrackThinningKeepAllElectronTracks:
162 EGAM4ElectronTPThinningTool2 = (
163 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
164 name=
"EGAM4ElectronTPThinningTool2",
165 StreamName=streamName,
167 GSFTrackParticlesKey=
"GSFTrackParticles",
168 InDetTrackParticlesKey=
"InDetTrackParticles",
169 SelectionString=
"Electrons.pt > 4*GeV",
174 acc.addPublicTool(EGAM4ElectronTPThinningTool2)
175 thinningTools.append(EGAM4ElectronTPThinningTool2)
178 if TrackThinningKeepPhotonTracks:
179 EGAM4PhotonTPThinningTool = (
180 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
181 name=
"EGAM4PhotonTPThinningTool",
182 StreamName=streamName,
184 GSFTrackParticlesKey=
"GSFTrackParticles",
185 InDetTrackParticlesKey=
"InDetTrackParticles",
186 GSFConversionVerticesKey=
"GSFConversionVertices",
187 SelectionString=
"Photons.pt > 0*GeV",
192 acc.addPublicTool(EGAM4PhotonTPThinningTool)
193 thinningTools.append(EGAM4PhotonTPThinningTool)
197 if TrackThinningKeepAllPhotonTracks:
198 EGAM4PhotonTPThinningTool2 = (
199 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
200 name=
"EGAM4PhotonTPThinningTool2",
201 StreamName=streamName,
203 GSFTrackParticlesKey=
"GSFTrackParticles",
204 InDetTrackParticlesKey=
"InDetTrackParticles",
205 GSFConversionVerticesKey=
"GSFConversionVertices",
206 SelectionString=
"Photons.pt > 9.5*GeV",
211 acc.addPublicTool(EGAM4PhotonTPThinningTool2)
212 thinningTools.append(EGAM4PhotonTPThinningTool2)
215 if TrackThinningKeepJetTracks:
216 EGAM4JetTPThinningTool = (
217 CompFactory.DerivationFramework.JetTrackParticleThinning(
218 name=
"EGAM4JetTPThinningTool",
219 StreamName=streamName,
220 JetKey=
"AntiKt4EMPFlowJets",
221 InDetTrackParticlesKey=
"InDetTrackParticles",
224 acc.addPublicTool(EGAM4JetTPThinningTool)
225 thinningTools.append(EGAM4JetTPThinningTool)
228 if TrackThinningKeepMuonTracks:
229 EGAM4MuonTPThinningTool = acc.getPrimaryAndMerge(
232 name=
"EGAM4MuonTPThinningTool",
233 StreamName=streamName,
235 InDetTrackParticlesKey=
"InDetTrackParticles",
238 thinningTools.append(EGAM4MuonTPThinningTool)
241 if TrackThinningKeepTauTracks:
242 EGAM4TauTPThinningTool = acc.getPrimaryAndMerge(
245 name=
"EGAM4TauTPThinningTool",
246 StreamName=streamName,
249 InDetTrackParticlesKey=
"InDetTrackParticles",
250 DoTauTracksThinning=
True,
251 TauTracksKey=
"TauTracks",
254 thinningTools.append(EGAM4TauTPThinningTool)
257 thinning_expression =
" && ".
join(
259 "(InDetTrackParticles.DFCommonTightPrimary)",
260 "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3*mm)",
261 "(InDetTrackParticles.pt>10*GeV)",
264 if TrackThinningKeepPVTracks:
265 EGAM4TPThinningTool = acc.getPrimaryAndMerge(
268 name=
"EGAM4TPThinningTool",
269 StreamName=streamName,
270 SelectionString=thinning_expression,
271 InDetTrackParticlesKey=
"InDetTrackParticles",
274 thinningTools.append(EGAM4TPThinningTool)
278 acc.addPublicTool(skimmingTool)
282 CompFactory.DerivationFramework.DerivationKernel(
284 SkimmingTools=[skimmingTool],
285 AugmentationTools=augmentationTools,
286 ThinningTools=thinningTools,