55 def makeAlgs (self, config) :
57 if config.isPhyslite() :
58 metSuffix =
'AnalysisMET'
60 jetContainer = config.originalName (self.jets)
61 metSuffix = jetContainer[:-4]
63 if not self.useFJVT
and self.treatPUJets:
64 raise ValueError (
"MET significance pile-up treatment requires fJVT")
67 btIndex = metSuffix.find(
'_BTagging')
69 metSuffix = metSuffix[:btIndex]
72 alg = config.createAlgorithm(
'CP::MetMakerAlg',
'MetMakerAlg' + self.containerName )
73 config.addPrivateTool(
'makerTool',
'met::METMaker' )
74 alg.makerTool.skipSystematicJetSelection = self.skipSystematicJetSelection
76 alg.doJetJVT = self.useJVT
78 config.addPrivateTool(
'makerTool.JvtSelTool',
'CP::NNJvtSelectionTool' )
79 alg.makerTool.JvtSelTool.JetContainer = config.readName (self.jets)
81 alg.makerTool.JetRejectionDec =
'passFJVT_internal'
83 alg.makerTool.JetSelection = self.metWP
84 alg.makerTool.DoPFlow =
'PFlow' in metSuffix
or metSuffix==
"AnalysisMET"
85 alg.makerTool.DoSetMuonJetEMScale = self.setMuonJetEMScale
87 if config.dataType()
is not DataType.Data :
88 config.addPrivateTool(
'systematicsTool',
'met::METSystematicsTool' )
90 alg.metCore =
'MET_Core_' + metSuffix
91 alg.metAssociation =
'METAssoc_' + metSuffix
92 alg.jets = config.readName (self.jets)
94 alg.muons, alg.muonsSelection = config.readNameAndSelection (self.muons, excludeFrom={
'or'})
95 if self.electrons !=
"" :
96 alg.electrons, alg.electronsSelection = config.readNameAndSelection (self.electrons, excludeFrom={
'or'})
97 if self.photons !=
"" :
98 alg.photons, alg.photonsSelection = config.readNameAndSelection (self.photons, excludeFrom={
'or'})
100 alg.taus, alg.tausSelection = config.readNameAndSelection (self.taus, excludeFrom={
'or'})
101 if self.invisible !=
"" :
102 alg.invisible = config.readName (self.invisible)
103 alg.met = config.writeName (self.containerName, isMet =
True)
107 alg = config.createAlgorithm(
'CP::MetBuilderAlg',
'MetBuilderAlg' + self.containerName )
108 alg.met = config.readName (self.containerName)
112 if self.saveSignificance:
113 alg = config.createAlgorithm(
'CP::MetSignificanceAlg',
'MetSignificanceAlg' + self.containerName )
114 config.addPrivateTool(
'significanceTool',
'met::METSignificance' )
115 if self.muons !=
"" :
116 config.addPrivateTool(
'significanceTool.MuonCalibTool',
'CP::MuonCalibTool' )
117 alg.significanceTool.MuonCalibTool.calibMode = config._muonCalibMode
119 alg.significanceTool.SoftTermParam = 0
120 alg.significanceTool.TreatPUJets = self.treatPUJets
121 alg.significanceTool.IsAFII = config.dataType()
is DataType.FastSim
122 alg.met = config.readName (self.containerName)
123 config.addOutputVar (self.containerName,
'significance',
'significance')
125 config.addOutputVar (self.containerName,
'met',
'met')
126 config.addOutputVar (self.containerName,
'phi',
'phi')
127 config.addOutputVar (self.containerName,
'sumet',
'sumet')