3 from AnalysisAlgorithmsConfig.ConfigBlock
import ConfigBlock
7 """ConfigBlock for particle-level truth taus"""
10 super(ParticleLevelTausBlock, self).
__init__()
11 self.addOption(
'containerName',
'TruthTaus', type=str,
12 info=
'the name of the input truth taus container')
13 self.addOption(
'selectionName',
'', type=str,
14 info=
'the name of the selection to create. The default is "",'
15 ' which applies the selection to all truth taus.')
16 self.addOption(
'isolated',
True, type=bool,
17 info=
'select only truth taus that are isolated.')
18 self.addOption(
'saveUID',
False, type=bool,
19 info=
'save unique ID in output')
21 self.setOptionValue(
'skipOnData',
True)
24 """Return the instance name for this block"""
25 name = self.containerName
26 if self.selectionName: name = name +
'_' + self.selectionName
30 config.setSourceName (self.containerName, self.containerName)
33 alg = config.createAlgorithm(
'CP::ParticleLevelPtEtaPhiDecoratorAlg',
34 'ParticleLevelPtEtaPhiDecoratorTaus',
36 alg.particles = self.containerName
39 alg = config.createAlgorithm(
'CP::ParticleLevelChargeDecoratorAlg',
40 'ParticleLevelChargeDecoratorTaus',
42 alg.particles = self.containerName
45 alg = config.createAlgorithm(
'CP::ParticleLevelIsolationAlg',
46 'ParticleLevelIsolationTaus',
48 alg.particles = self.containerName
49 alg.isolation =
'isIsolated' + self.selectionName
if self.isolated
else 'isIsolatedButNotRequired' + self.selectionName
50 alg.notTauOrigin =
'notFromTauButNotRequired' + self.selectionName
51 alg.checkType =
'IsoTau'
54 config.addSelection (self.containerName, self.selectionName, alg.isolation+
',as_char')
57 if ParticleLevelTausBlock.get_instance_count() == 1
or 'pt' not in config.getOutputVars(self.containerName):
66 outputVars += [[
'uid',
'uid']]
67 for decoration, branch
in outputVars:
68 config.addOutputVar (self.containerName, decoration, branch, noSys=
True)