3 from AnalysisAlgorithmsConfig.ConfigBlock
import ConfigBlock
7 """ConfigBlock for the jet reclustering algorithm:
8 run FastJet with small-R jets as input. The output
9 is a new container containing the reclustered jets.
10 The default output variables are the RC jet kinematics
11 as well as a vector of indices pointing to the
12 small-R jets that formed the RC jets.
13 ---- to be updated with substructure variables!"""
16 super(JetReclusteringBlock, self).
__init__()
17 self.addOption (
'containerName',
None, type=str,
18 info=
'name of the output reclustered jets container.')
19 self.addOption (
'jets',
None, type=str,
20 info=
'the input jet collection to recluster, with a possible selection, in the format `container` or `container.selection`.')
21 self.addOption (
'clusteringAlgorithm',
'AntiKt', type=str,
22 info=
'algorithm to use to recluster the jets: `AntiKt`, `Kt`, `CamKt`.')
23 self.addOption (
'reclusteredJetsRadius', 1.0, type=float,
24 info=
'radius parameter of the reclustering algorithm. The default is 1.0.')
25 self.addOption (
'minPt', 200*GeV, type=float,
26 info=
'minimum pT requirement (in MeV) on the reclustered jets, creating the selection `passed_sel`. The default is 200 GeV.')
27 self.addOption (
'maxEta', 0., type=float,
28 info=
'maximum eta requirement on the reclustered jets, creating the selection `passed_sel`. The default is 0.')
29 self.addOption (
'maxRapidity', 2.5, type=float,
30 info=
'maximum rapidity requirement on the reclustered jets, creating the selection `passed_sel`. The default is 2.5')
32 """Return the instance name for this block"""
33 return self.containerName
37 alg = config.createAlgorithm(
'CP::JetReclusteringAlg',
'JetReclusteringAlg')
39 alg.jets, alg.jetSelection = config.readNameAndSelection(self.jets)
40 alg.reclusteredJets = config.writeName(self.containerName)
41 alg.smallRjetIndices =
'smallRjetIndices_%SYS%'
42 alg.rcJetEnergy =
'e_%SYS%'
43 alg.clusteringAlgorithm = self.clusteringAlgorithm
44 alg.reclusteredJetsRadius = self.reclusteredJetsRadius
47 if self.minPt > 0
or self.maxEta > 0
or self.maxRapidity > 0 :
48 selAlg = config.createAlgorithm(
'CP::AsgSelectionAlg',
'RCJetsMinPtAlg')
49 selAlg.selectionDecoration =
'passed_sel,as_bits'
50 config.addPrivateTool(
'selectionTool',
'CP::AsgPtEtaSelectionTool')
51 selAlg.selectionTool.minPt = self.minPt
52 selAlg.selectionTool.maxEta = self.maxEta
53 selAlg.selectionTool.maxRapidity = self.maxRapidity
54 selAlg.particles = config.readName(self.containerName)
55 selAlg.preselection = config.getPreselection(self.containerName,
'')
56 config.addSelection(self.containerName,
'passed_sel', selAlg.selectionDecoration)
58 config.addOutputVar(self.containerName,
'pt',
'pt')
59 config.addOutputVar(self.containerName,
'eta',
'eta')
60 config.addOutputVar(self.containerName,
'phi',
'phi')
61 config.addOutputVar(self.containerName,
'm',
'm')
62 config.addOutputVar(self.containerName, alg.rcJetEnergy,
'e')
63 config.addOutputVar(self.containerName, alg.smallRjetIndices,
'small_r_jet_indices')