56 def makeAlgs (self, config) :
58 postfix = self.postfix
60 if config.isPhyslite() :
61 metSuffix =
'AnalysisMET'
63 jetContainer = config.originalName (self.jets)
64 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' + postfix)
76 config.addPrivateTool(
'makerTool',
'met::METMaker' )
77 config.addPrivateTool(
'makerTool.JvtSelTool',
'CP::NNJvtSelectionTool' )
78 alg.makerTool.skipSystematicJetSelection = self.skipSystematicJetSelection
79 alg.makerTool.JvtSelTool.JetContainer = config.readName (self.jets)
80 alg.makerTool.JetSelection = self.metWP
81 alg.makerTool.DoPFlow =
'PFlow' in metSuffix
or metSuffix==
"AnalysisMET"
82 alg.makerTool.DoSetMuonJetEMScale = self.setMuonJetEMScale
84 alg.makerTool.JetRejectionDec =
'passFJVT_internal'
86 if config.dataType()
is not DataType.Data :
87 config.addPrivateTool(
'systematicsTool',
'met::METSystematicsTool' )
89 alg.metCore =
'MET_Core_' + metSuffix
90 alg.metAssociation =
'METAssoc_' + metSuffix
91 alg.jets = config.readName (self.jets)
93 alg.muons, alg.muonsSelection = config.readNameAndSelection (self.muons, excludeFrom={
'or'})
94 if self.electrons !=
"" :
95 alg.electrons, alg.electronsSelection = config.readNameAndSelection (self.electrons, excludeFrom={
'or'})
96 if self.photons !=
"" :
97 alg.photons, alg.photonsSelection = config.readNameAndSelection (self.photons, excludeFrom={
'or'})
99 alg.taus, alg.tausSelection = config.readNameAndSelection (self.taus, excludeFrom={
'or'})
100 if self.invisible !=
"" :
101 alg.invisible = config.readName (self.invisible)
102 alg.met = config.writeName (self.containerName, isMet =
True)
106 alg = config.createAlgorithm(
'CP::MetBuilderAlg',
'MetBuilderAlg' + postfix )
107 alg.met = config.readName (self.containerName)
111 if self.saveSignificance:
112 alg = config.createAlgorithm(
'CP::MetSignificanceAlg',
'MetSignificanceAlg' + postfix )
113 config.addPrivateTool(
'significanceTool',
'met::METSignificance' )
114 if self.muons !=
"" :
115 config.addPrivateTool(
'significanceTool.MuonCalibTool',
'CP::MuonCalibTool' )
116 alg.significanceTool.MuonCalibTool.calibMode = config._muonCalibMode
118 alg.significanceTool.SoftTermParam = 0
119 alg.significanceTool.TreatPUJets = self.treatPUJets
120 alg.significanceTool.IsAFII = config.dataType()
is DataType.FastSim
121 alg.met = config.readName (self.containerName)
122 config.addOutputVar (self.containerName,
'significance',
'significance')
124 config.addOutputVar (self.containerName,
'met',
'met')
125 config.addOutputVar (self.containerName,
'phi',
'phi')
126 config.addOutputVar (self.containerName,
'sumet',
'sumet')