3 from AnalysisAlgorithmsConfig.ConfigBlock
import ConfigBlock
7 """ConfigBlock for particle-level overlap removal"""
10 super(ParticleLevelOverlapRemovalBlock, self).
__init__()
11 self.addOption(
'jets',
'', type=str,
12 info =
'the name of the input truth jets container, in the format "container" or "container.selection".')
13 self.addOption(
'electrons',
'', type=str,
14 info=
'the name of the input truth electrons container, in the format "container" or "container.selection".')
15 self.addOption(
'muons',
'', type=str,
16 info=
'the name of the input truth muons container, in the format "container" or "container.selection".')
17 self.addOption(
'photons',
'', type=str,
18 info=
'the name of the input truth photons container, in the format "container" or "container.selection".')
19 self.addOption(
'label',
'passesOR', type=str,
20 info=
'the name of the decoration to apply to all particles passing OR')
21 self.addOption(
'useDressedProperties',
True, type=bool,
22 info=
'whether to use dressed electron and muon kinematics rather than simple P4 kinematics')
23 self.addOption(
'useRapidityForDeltaR',
True, type=bool,
24 info=
'whether to use rapidity instead of pseudo-rapidity for the calculation of DeltaR')
26 self.setOptionValue(
'skipOnData',
True)
29 """Return the instance name for this block"""
33 alg = config.createAlgorithm(
'CP::ParticleLevelOverlapRemovalAlg',
34 'ParticleLevelOverlapRemoval',
36 alg.useDressedProperties = self.useDressedProperties
37 alg.useRapidityForDeltaR = self.useRapidityForDeltaR
38 alg.labelOR = self.label
40 alg.electrons, alg.electronSelection = config.readNameAndSelection (self.electrons)
41 alg.doJetElectronOR =
True
42 selection = self.electrons.
split(
".")[1]
if len(self.electrons.
split(
".")) == 2
else ''
43 config.addSelection (self.electrons.
split(
".")[0], selection, alg.labelOR +
',as_char')
45 alg.muons, alg.muonSelection = config.readNameAndSelection (self.muons)
46 alg.doJetMuonOR =
True
47 selection = self.muons.
split(
".")[1]
if len(self.muons.
split(
".")) == 2
else ''
48 config.addSelection (self.muons.
split(
".")[0], selection, alg.labelOR +
',as_char')
50 alg.photons, alg.photonSelection = config.readNameAndSelection (self.photons)
51 alg.doJetPhotonOR =
True
52 selection = self.photons.
split(
".")[1]
if len(self.photons.
split(
".")) == 2
else ''
53 config.addSelection (self.photons.
split(
".")[0], selection, alg.labelOR +
',as_char')
55 alg.jets, alg.jetSelection = config.readNameAndSelection (self.jets)
56 selection = self.jets.
split(
".")[1]
if len(self.jets.
split(
".")) == 2
else ''
57 config.addSelection (self.jets.
split(
".")[0], selection, alg.labelOR +
',as_char')
59 raise ValueError(
'Particle-level overlap removal needs the jet container to be run!')