36 def makeAlgs(self, config):
37 if not self.jets:
38 raise ValueError('Particle-level overlap removal needs the jet container to be run!')
39
40 alg = config.createAlgorithm('CP::ParticleLevelOverlapRemovalAlg',
41 'ParticleLevelOverlapRemoval',
42 reentrant=True)
43 alg.useDressedProperties = self.useDressedProperties
44 alg.useRapidityForDeltaR = self.useRapidityForDeltaR
45 alg.labelOR = self.label
46 if self.electrons:
47 electronsName, alg.electronSelection = config.readNameAndSelection (self.electrons)
48 alg.electrons = electronsName
49 alg.doJetElectronOR = True
50 alg.decORelectron = f'{electronsName}.{self.label}'
51 if self.useDressedProperties:
52 alg.ptDressedElectron = f'{electronsName}.pt_dressed'
53 alg.etaDressedElectron = f'{electronsName}.eta_dressed'
54 alg.phiDressedElectron = f'{electronsName}.phi_dressed'
55 alg.eDressedElectron = f'{electronsName}.e_dressed'
56 container, _, selection = self.electrons.partition(".")
57 config.addSelection (container, selection, alg.labelOR + ',as_char')
58 if self.muons:
59 muonsName, alg.muonSelection = config.readNameAndSelection (self.muons)
60 alg.muons = muonsName
61 alg.doJetMuonOR = True
62 alg.decORmuon = f'{muonsName}.{self.label}'
63 if self.useDressedProperties:
64 alg.ptDressedMuon = f'{muonsName}.pt_dressed'
65 alg.etaDressedMuon = f'{muonsName}.eta_dressed'
66 alg.phiDressedMuon = f'{muonsName}.phi_dressed'
67 alg.eDressedMuon = f'{muonsName}.e_dressed'
68 container, _, selection = self.muons.partition(".")
69 config.addSelection (container, selection, alg.labelOR + ',as_char')
70 if self.photons:
71 photonsName, alg.photonSelection = config.readNameAndSelection (self.photons)
72 alg.photons = photonsName
73 alg.doJetPhotonOR = True
74 alg.decORphoton = f'{photonsName}.{self.label}'
75 container, _, selection = self.photons.partition(".")
76 config.addSelection (container, selection, alg.labelOR + ',as_char')
77 jetsName, alg.jetSelection = config.readNameAndSelection (self.jets)
78 alg.jets = jetsName
79 alg.decORjet = f'{jetsName}.{self.label}'
80 container, _, selection = self.jets.partition(".")
81 config.addSelection (container, selection, alg.labelOR + ',as_char')
82