18 """Configure DRAW_EGZ kerne"""
20 mlog = logging.getLogger(name)
21 mlog.info(
'Start configuration')
23 acc = ComponentAccumulator()
24 acc.addSequence(seqAND(
'DRAW_EGZSequence'))
29 'Electrons.pt > 20*GeV && Electrons.LHMedium',
31 '(count(eeMass1 > 55*GeV) >= 1)']
32 DRAWEGZSel[
'Zeey'] = [
33 'Electrons.pt > 15*GeV && Electrons.LHMedium',
35 '(count(eeMass2 > 20*GeV && eeMass2 < 90*GeV) >= 1 && count(Photons.pt > 7*GeV && Photons.Tight) >= 1)']
36 DRAWEGZSel[
'Zmmy'] = [
39 '(count(mmMass > 20*GeV && mmMass < 90*GeV) >= 1 && count(Photons.pt > 7*GeV && Photons.Tight) >= 1)']
40 DRAWEGZSel[
'Zefe'] = [
41 'Electrons.pt > 20*GeV && Electrons.LHMedium',
43 '(count(eeMass3 > 55*GeV) >=1'
44 ' && count(Electrons.pt > 20*GeV && Electrons.LHMedium)'
45 ' && count(ForwardElectrons.pt > 20*GeV && ForwardElectrons.Loose))',
46 'ForwardElectrons.pt > 20*GeV && ForwardElectrons.Loose']
49 augmentationTools = []
50 for key, sel
in DRAWEGZSel.items():
52 tool = CompFactory.DerivationFramework.EGInvariantMassTool(
53 name=f
'llmassToolFor{key}',
54 Container1Name=
'Electrons',
55 Container2Name=
'ForwardElectrons',
56 Object1Requirements=sel[0],
57 Object2Requirements=sel[3],
58 Mass1Hypothesis=0.511,
59 Mass2Hypothesis=0.511,
61 StoreGateEntryName=sel[1])
63 tool = CompFactory.DerivationFramework.InvariantMassTool(
64 name=f
'llmassToolFor{key}',
65 ContainerName=
'Electrons' if key.find(
'Zee') >= 0
else 'Muons',
66 ObjectRequirements=sel[0],
67 MassHypothesis=0.511
if key.find(
'Zee') >= 0
else 105.66,
68 StoreGateEntryName=sel[1])
70 augmentationTools.append(tool)
71 acc.addPublicTool(tool)
72 EventSels.append(sel[2])
73 draw_egz =
" || ".join(EventSels)
74 mlog.info(
'DRAW_EGZ selection '+draw_egz)
77 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
78 xAODStringSkimmingToolCfg)
79 skimmingTool = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
80 flags, name=
'DRAW_EGZSkimmingTool', expression=draw_egz))
83 DRAW_EGZKernel = CompFactory.DerivationFramework.DerivationKernel(
84 name=
'DRAW_EGZKernel',
85 doChronoStat=(flags.Concurrency.NumThreads <= 1),
86 AugmentationTools=augmentationTools,
87 SkimmingTools=[skimmingTool])
89 acc.addEventAlgo(DRAW_EGZKernel, sequenceName=
'DRAW_EGZSequence')