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