21def JETM7KernelCfg(flags, name='JETM7Kernel', **kwargs):
22 """Configure the derivation framework driving algorithm (kernel) for JETM7"""
23 acc = ComponentAccumulator()
24
25
26 if not flags.Input.isMC:
27 skimmingTool = acc.getPrimaryAndMerge(JETM7SkimmingToolCfg(flags))
28
29
30 from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
31 acc.merge(PhysCommonAugmentationsCfg(flags, TriggerListsHelper = kwargs['TriggerListsHelper']))
32
33 from DerivationFrameworkInDet.InDetToolsConfig import InDetTrackSelectionToolWrapperCfg
34 DFCommonTrackSelection = acc.getPrimaryAndMerge(InDetTrackSelectionToolWrapperCfg(
35 flags,
36 name = "DFJETM7CommonTrackSelectionLoose",
37 CutLevel = "Loose",
38 DecorationName = "DFJETM7Loose"))
39
40 acc.addEventAlgo(CompFactory.DerivationFramework.CommonAugmentation("JETM7CommonKernel", AugmentationTools = [DFCommonTrackSelection]))
41
42
43 from DerivationFrameworkInDet.InDetToolsConfig import MuonTrackParticleThinningCfg, EgammaTrackParticleThinningCfg, JetTrackParticleThinningCfg, TauTrackParticleThinningCfg
44
45 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
46
47 muonSelectionString = "(Muons.pt > 5*GeV)"
48 electronSelectionString = "(Electrons.pt > 5*GeV)"
49 photonSelectionString = "(Photons.pt > 5*GeV)"
50 jetSelectionString = "(AntiKt4EMPFlowByVertexJets.pt > 7.*GeV && AntiKt4EMPFlowByVertexJets.Jvt > 0.4)"
51 tauJetSelectionString = "(TauJets.pt > 20.*GeV && TauJets.nTracks > 0)"
52
53
54 JETM7MuonTPThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(flags,
55 name = "JETM7MuonTPThinningTool",
56 StreamName = kwargs['StreamName'],
57 MuonKey = "Muons",
58 SelectionString = muonSelectionString,
59 InDetTrackParticlesKey = "InDetTrackParticles"))
60
61
62 JETM7ElectronTPThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(flags,
63 name = "JETM7ElectronTPThinningTool",
64 StreamName = kwargs['StreamName'],
65 SGKey = "Electrons",
66 SelectionString = electronSelectionString,
67 InDetTrackParticlesKey = "InDetTrackParticles"))
68
69
70 JETM7TauTPThinningTool = acc.getPrimaryAndMerge(TauTrackParticleThinningCfg(
71 flags,
72 name = "JETM7TauTPThinningTool",
73 StreamName = kwargs['StreamName'],
74 TauKey = "TauJets",
75 SelectionString = tauJetSelectionString,
76 InDetTrackParticlesKey = "InDetTrackParticles",
77 DoTauTracksThinning = True,
78 ConeSize = 0.6,
79 TauTracksKey = "TauTracks"))
80
81
82 JETM7Akt4JetTPThinningTool = acc.getPrimaryAndMerge(JetTrackParticleThinningCfg(flags,
83 name = "JETM7Akt4JetTPThinningTool",
84 StreamName = kwargs['StreamName'],
85 JetKey = "AntiKt4EMPFlowByVertexJets",
86 SelectionString = jetSelectionString,
87 InDetTrackParticlesKey = "InDetTrackParticles"))
88
89
90
91
92 JETM7Akt4PFlowByVertexJetThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
93 name = "JETM7Akt4PFlowByVertexJetThinningTool",
94 ContainerName = "AntiKt4EMPFlowByVertexJets",
95 StreamName = kwargs['StreamName'],
96 SelectionString = jetSelectionString))
97
98
99 JETM7Akt4PFlowJetThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
100 name = "JETM7Akt4PFlowJetThinningTool",
101 ContainerName = "AntiKt4EMPFlowJets",
102 StreamName = kwargs['StreamName'],
103 SelectionString = "(abs(AntiKt4EMPFlowJets.eta) > 2.4)"))
104
105
106 JETM7MuonThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
107 name = "JETM7MuonThinningTool",
108 ContainerName = "Muons",
109 StreamName = kwargs['StreamName'],
110 SelectionString = muonSelectionString))
111
112
113 JETM7ElectronThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
114 name = "JETM7ElectronThinningTool",
115 ContainerName = "Electrons",
116 StreamName = kwargs['StreamName'],
117 SelectionString = electronSelectionString))
118
119 JETM7TauJetThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
120 name = "JETM7TauJetThinningTool",
121 ContainerName = "TauJets",
122 StreamName = kwargs['StreamName'],
123 SelectionString = tauJetSelectionString))
124
125 JETM7PhotonThinningTool = acc.getPrimaryAndMerge(GenericObjectThinningCfg(flags,
126 name = "JETM7PhotonThinningTool",
127 ContainerName = "Photons",
128 StreamName = kwargs['StreamName'],
129 SelectionString = photonSelectionString))
130
131
132
133 acc.merge(JETM7ExtraContentCfg(flags))
134
135
136 thinningTools = [JETM7MuonTPThinningTool,
137 JETM7ElectronTPThinningTool,
138 JETM7TauTPThinningTool,
139 JETM7Akt4JetTPThinningTool,
140 JETM7Akt4PFlowByVertexJetThinningTool,
141 JETM7Akt4PFlowJetThinningTool,
142 JETM7MuonThinningTool,
143 JETM7ElectronThinningTool,
144 JETM7TauJetThinningTool,
145 JETM7PhotonThinningTool,
146 ]
147
148 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
149 acc.addEventAlgo(DerivationKernel(name,
150 ThinningTools = thinningTools,
151 SkimmingTools = [skimmingTool] if not flags.Input.isMC else []))
152
153
154 return acc
155