37def HIONHPODKernelCfg(flags, name='HIONHPODKernel', **kwargs):
38 """Configure the derivation framework driving algorithm (kernel)"""
39 acc = ComponentAccumulator()
40 GeV=1e3
41
42 from DerivationFrameworkInDet.InDetToolsConfig import (
43 MuonTrackParticleThinningCfg,
44 EgammaTrackParticleThinningCfg
45 )
46 from InDetTrackSelectionTool.InDetTrackSelectionToolConfig import (
47 InDetTrackSelectionTool_HITight_Cfg
48 )
49
50
51 thinningTool = []
52 augmentationTool = []
53
54 HITightTrackSelector = acc.popToolsAndMerge(InDetTrackSelectionTool_HITight_Cfg(
55 flags,
56 name = "HIONHPODTrackSelectionToolTight",
57 minPt = 10*GeV
58 ))
59 acc.addPublicTool(HITightTrackSelector)
60
61 HIONHPODTrackThinningTool = CompFactory.DerivationFramework.HITrackParticleThinningTool(
62 name = "HIONHPODTrackThinningTool",
63 PrimaryVertexKey = "PrimaryVertices",
64 PrimaryVertexSelection = "sumPt2",
65 TrackSelectionTool = HITightTrackSelector,
66 StreamName = kwargs["StreamName"]
67 )
68
69 acc.addPublicTool(HIONHPODTrackThinningTool)
70 thinningTool += [HIONHPODTrackThinningTool]
71
72 for jetKey in ("AntiKt2HIJets","AntiKt4HIJets"):
73 HIONHPODJetTrackThinningTool = CompFactory.DerivationFramework.HIJetTrackParticleThinningTool(
74 name = f"HIONHPOD{jetKey}TrackThinningTool",
75 PrimaryVertexKey = "PrimaryVertices",
76 PrimaryVertexSelection = "sumPt2",
77 JetKey = jetKey,
78 TrackSelectionTool = HITightTrackSelector,
79 StreamName = kwargs["StreamName"]
80 )
81
82 acc.addPublicTool(HIONHPODJetTrackThinningTool)
83 thinningTool += [HIONHPODJetTrackThinningTool]
84
85
86 muonThinningTool = acc.getPrimaryAndMerge(MuonTrackParticleThinningCfg(
87 flags,
88 name = "HIONHPODMuonThinningTool",
89 StreamName = kwargs['StreamName'],
90 MuonKey = "Muons",
91 InDetTrackParticlesKey = "InDetTrackParticles"
92 ))
93
94 acc.addPublicTool(muonThinningTool)
95 thinningTool += [muonThinningTool]
96
97
98 egamma_thinning_config = {
99 "Electrons": {
100 },
101 "Photons": {
102 "GSFConversionVerticesKey": "GSFConversionVertices"
103 }
104 }
105 for egammaKey in egamma_thinning_config:
106 egammaThinningTool = acc.getPrimaryAndMerge(EgammaTrackParticleThinningCfg(
107 flags,
108 name = f"HIONHPOD{egammaKey}ThinningTool",
109 StreamName = kwargs["StreamName"],
110 SGKey = egammaKey,
111 **egamma_thinning_config[egammaKey]
112 ))
113 acc.addPublicTool(egammaThinningTool)
114 thinningTool += [egammaThinningTool]
115
116
117 globalAugmentationTool = acc.getPrimaryAndMerge(HIONHPODGlobalAugmentationToolCfg(flags))
118 augmentationTool += [globalAugmentationTool]
119
120 centralityAugmentationTool = acc.getPrimaryAndMerge(HIONHPODCentralityAugmentationToolCfg(flags))
121 augmentationTool += [centralityAugmentationTool]
122
123 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
124 acc.addEventAlgo(DerivationKernel(
125 name,
126 ThinningTools=thinningTool,
127 AugmentationTools=augmentationTool
128 ))
129
130 return acc
131