33 def makeAlgs (self, config) :
35 postfix = self.postfix
36 if postfix !=
'' and postfix[0] !=
'_' :
37 postfix =
'_' + postfix
39 if config.isPhyslite() :
40 config.setSourceName (self.containerName,
"AnalysisTauJets")
42 config.setSourceName (self.containerName, self.inputContainer)
45 if self.rerunTruthMatching
and config.dataType()
is not DataType.Data:
46 alg = config.createAlgorithm(
'CP::TauTruthMatchingAlg',
47 'TauTruthMatchingAlg' + postfix )
48 config.addPrivateTool(
'matchingTool',
49 'TauAnalysisTools::TauTruthMatchingTool' )
50 alg.matchingTool.TruthJetContainerName =
'AntiKt4TruthDressedWZJets'
51 alg.taus = config.readName (self.containerName)
52 alg.preselection = config.getPreselection (self.containerName,
'')
55 if self.decorateTruth
and config.dataType()
is not DataType.Data:
56 alg = config.createAlgorithm(
'CP::TauTruthDecorationsAlg',
57 'TauTruthDecorationsAlg' + postfix )
58 alg.taus = config.readName (self.containerName)
59 alg.doubleDecorations = [
'pt_vis',
'eta_vis',
'phi_vis',
'm_vis']
60 alg.floatDecorations = []
61 alg.intDecorations = [
'pdgId']
62 alg.unsignedIntDecorations = [
'classifierParticleOrigin',
'classifierParticleType']
63 alg.charDecorations = [
'IsHadronicTau']
67 for var
in [
'DecayMode',
'ParticleType',
'PartonTruthLabelID'] + alg.doubleDecorations[:] + alg.floatDecorations[:] + alg.intDecorations[:] + alg.unsignedIntDecorations[:] + alg.charDecorations[:]:
68 branchName = alg.prefix + var
69 if 'classifierParticle' in var:
70 branchOutput = alg.prefix + var.replace(
'classifierParticle',
'').lower()
72 branchOutput = branchName
73 config.addOutputVar (self.containerName, branchName, branchOutput, noSys=
True)
76 alg = config.createAlgorithm(
'CP::TauExtraVariablesAlg',
'TauExtraVariables' + self.containerName + self.postfix )
77 alg.taus = config.readName (self.containerName)
80 alg = config.createAlgorithm(
'CP::TauSmearingAlg',
'TauSmearingAlg' + postfix )
81 config.addPrivateTool(
'smearingTool',
'TauAnalysisTools::TauSmearingTool' )
82 alg.smearingTool.useFastSim = config.dataType()
is DataType.FastSim
83 alg.taus = config.readName (self.containerName)
84 alg.tausOut = config.copyName (self.containerName)
85 alg.preselection = config.getPreselection (self.containerName,
'')
88 alg = config.createAlgorithm(
'CP::AsgEnergyDecoratorAlg',
'EnergyDecorator' + self.containerName + self.postfix )
89 alg.particles = config.readName (self.containerName)
91 config.addOutputVar (self.containerName,
'pt',
'pt')
92 config.addOutputVar (self.containerName,
'eta',
'eta', noSys=
True)
93 config.addOutputVar (self.containerName,
'phi',
'phi', noSys=
True)
94 config.addOutputVar (self.containerName,
'e_%SYS%',
'e')
95 config.addOutputVar (self.containerName,
'charge',
'charge', noSys=
True)
96 config.addOutputVar (self.containerName,
'NNDecayMode',
'NNDecayMode', noSys=
True)
97 config.addOutputVar (self.containerName,
'nTracks',
'nTracks', noSys=
True)