56 def makeAlgs (self, config) :
58 if config.isPhyslite() :
59 metSuffix =
'AnalysisMET'
61 jetContainer = config.originalName (self.jets)
62 metSuffix = jetContainer[:-4]
66 if not self.useFJVT
and self.treatPUJets:
67 raise ValueError (
"MET significance pile-up treatment requires fJVT")
70 btIndex = metSuffix.find(
'_BTagging')
72 metSuffix = metSuffix[:btIndex]
75 alg = config.createAlgorithm(
'CP::MetMakerAlg',
'MetMakerAlg' + self.containerName )
76 config.addPrivateTool(
'makerTool',
'met::METMaker' )
77 alg.makerTool.skipSystematicJetSelection = self.skipSystematicJetSelection
79 alg.doJetJVT = self.useJVT
81 config.addPrivateTool(
'makerTool.JvtSelTool',
'CP::NNJvtSelectionTool' )
82 alg.makerTool.JvtSelTool.JetContainer = config.readName (self.jets)
84 alg.makerTool.JetRejectionDec =
'passFJVT_internal'
86 alg.makerTool.JetSelection = self.metWP
87 alg.makerTool.DoPFlow =
'PFlow' in metSuffix
or metSuffix==
"AnalysisMET"
88 alg.makerTool.DoSetMuonJetEMScale = self.setMuonJetEMScale
90 if config.dataType()
is not DataType.Data :
91 config.addPrivateTool(
'systematicsTool',
'met::METSystematicsTool' )
93 alg.metCore =
'MET_Core_' + metSuffix
94 alg.metAssociation =
'METAssoc_' + metSuffix
95 alg.jets = config.readName (self.jets)
97 alg.muons, alg.muonsSelection = config.readNameAndSelection (self.muons, excludeFrom={
'or'})
98 if self.electrons !=
"" :
99 alg.electrons, alg.electronsSelection = config.readNameAndSelection (self.electrons, excludeFrom={
'or'})
100 if self.photons !=
"" :
101 alg.photons, alg.photonsSelection = config.readNameAndSelection (self.photons, excludeFrom={
'or'})
103 alg.taus, alg.tausSelection = config.readNameAndSelection (self.taus, excludeFrom={
'or'})
104 if self.invisible !=
"" :
105 alg.invisible = config.readName (self.invisible)
106 alg.met = config.writeName (self.containerName, isMet =
True)
110 alg = config.createAlgorithm(
'CP::MetBuilderAlg',
'MetBuilderAlg' + self.containerName )
111 alg.met = config.readName (self.containerName)
115 if self.saveSignificance:
116 alg = config.createAlgorithm(
'CP::MetSignificanceAlg',
'MetSignificanceAlg' + self.containerName )
117 config.addPrivateTool(
'significanceTool',
'met::METSignificance' )
118 if self.muons !=
"" :
119 config.addPrivateTool(
'significanceTool.MuonCalibTool',
'CP::MuonCalibTool' )
121 alg.significanceTool.MuonCalibTool.calibMode = (
122 config.calibMode(self.muons.
split(
".")[0]))
124 alg.significanceTool.SoftTermParam = 0
125 alg.significanceTool.TreatPUJets = self.treatPUJets
126 alg.significanceTool.IsAFII = config.dataType()
is DataType.FastSim
127 alg.met = config.readName (self.containerName)
128 config.addOutputVar (self.containerName,
'significance',
'significance')
130 config.addOutputVar (self.containerName,
'met',
'met')
131 config.addOutputVar (self.containerName,
'phi',
'phi')
132 config.addOutputVar (self.containerName,
'sumet',
'sumet')