161def JETM12KernelCfg(flags, name='JETM12Kernel', **kwargs):
162 """Configure the derivation framework driving algorithm (kernel) for JETM12"""
163 acc = ComponentAccumulator()
164
165
166 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
167 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
168
169
170 from AthenaCommon.CFElements import seqAND
171 acc.addSequence( seqAND("JETM12Sequence") )
172 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
173 skimmingTool = acc.getPrimaryAndMerge(JETM12SkimmingToolCfg(flags))
174 augmentationToolSkim = acc.getPrimaryAndMerge(JETM12AugmentationToolsForSkimmingCfg(flags))
175 skimmingKernel = DerivationKernel(kwargs["PreselectionName"], SkimmingTools = [skimmingTool], AugmentationTools = [augmentationToolSkim])
176 acc.addEventAlgo( skimmingKernel, sequenceName="JETM12Sequence" )
177
178
179 from DerivationFrameworkInDet.InDetToolsConfig import TrackParticleThinningCfg, MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, TauTrackParticleThinningCfg
180
181
182 JETM12_thinning_expression = "( InDetTrackParticles.pt > 6*GeV && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
183 JETM12TrackParticleThinningTool = acc.getPrimaryAndMerge(TrackParticleThinningCfg(
184 flags,
185 name = "JETM12TrackParticleThinningTool",
186 StreamName = kwargs['StreamName'],
187 SelectionString = JETM12_thinning_expression,
188 InDetTrackParticlesKey = "InDetTrackParticles"))
189
190
191 JETM12MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
192 flags,
193 name = "JETM12MuonTPThinningTool",
194 StreamName = kwargs['StreamName'],
195 MuonKey = "Muons",
196 InDetTrackParticlesKey = "InDetTrackParticles"))
197
198
199 JETM12ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
200 flags,
201 name = "JETM12ElectronTPThinningTool",
202 StreamName = kwargs['StreamName'],
203 SGKey = "Electrons",
204 InDetTrackParticlesKey = "InDetTrackParticles"))
205
206
207 JETM12PhotonTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
208 flags,
209 name = "JETM12PhotonTPThinningTool",
210 StreamName = kwargs['StreamName'],
211 SGKey = "Photons",
212 InDetTrackParticlesKey = "InDetTrackParticles",
213 GSFConversionVerticesKey = "GSFConversionVertices"))
214
215
216 JETM12TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
217 flags,
218 name = "JETM12TauTPThinningTool",
219 StreamName = kwargs['StreamName'],
220 TauKey = "TauJets",
221 InDetTrackParticlesKey = "InDetTrackParticles",
222 DoTauTracksThinning = True,
223 TauTracksKey = "TauTracks"))
224
225 thinningTools = [JETM12TrackParticleThinningTool,
226 JETM12MuonTPThinningTool,
227 JETM12ElectronTPThinningTool,
228 JETM12PhotonTPThinningTool,
229 JETM12TauTPThinningTool]
230
231
232 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import CaloClusterThinningCfg
233 selectionString = "( InDetTrackParticles.pt > 6*GeV && InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV*sin(InDetTrackParticles.theta)) < 5.0*mm )"
234 JETM12CaloThinningTool = acc.getPrimaryAndMerge(CaloClusterThinningCfg(flags,
235 name = "JETM12CaloClusterThinning",
236 StreamName = kwargs['StreamName'],
237 SGKey = "InDetTrackParticles",
238 TopoClCollectionSGKey = "CaloCalTopoClusters",
239 SelectionString = selectionString,
240 ConeSize = 0.6))
241 acc.addPublicTool(JETM12CaloThinningTool)
242 thinningTools.append(JETM12CaloThinningTool)
243
244 if flags.Input.isMC:
245 truth_cond_status = "( (TruthParticles.isGenStable) && (TruthParticles.pt > 8*GeV) )"
246 truth_cond_Lepton = "((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16) && !(TruthParticles.isSimulationParticle))"
247 truth_expression = '('+truth_cond_status+' || '+truth_cond_Lepton +')'
248
249 JETM12TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "JETM12TruthThinningTool",
250 StreamName = kwargs['StreamName'],
251 ParticleSelectionString = truth_expression,
252 PreserveDescendants = False,
253 PreserveGeneratorDescendants = True,
254 PreserveAncestors = False)
255
256 acc.addPublicTool(JETM12TruthThinningTool)
257 thinningTools.append(JETM12TruthThinningTool)
258
259
260 augmentationTool = acc.getPrimaryAndMerge(JETM12AugmentationToolsCfg(flags))
261
262
263 acc.addEventAlgo(DerivationKernel(name,
264 ThinningTools = thinningTools,
265 AugmentationTools = [augmentationTool]),
266 sequenceName="JETM12Sequence")
267
268 return acc
269