7 ele = cmgelectron.sourcePtr().
get()
8 if not ele.hasUserFloat(
"p_"+self.
_label):
9 raise RuntimeError(
"Electron does not have an embedded energy scale correction with label '%s'" % self.
_label)
10 kind_in = ele.candidateP4Kind()
11 p4_in = ele.p4(kind_in)
12 pCalib = ele.userFloat(
"p_"+self.
_label)
13 pErrCalib = ele.userFloat(
"pError_"+self.
_label)
14 pKindCalib = ele.userInt(
"pKind_"+self.
_label)
15 ecalCalib = ele.userFloat(
"ecalEnergy_"+self.
_label)
16 eErrCalib = ele.userFloat(
"ecalEnergyError_"+self.
_label)
17 ele.setCorrectedEcalEnergy( ecalCalib )
18 ele.setCorrectedEcalEnergyError( eErrCalib )
19 p4_out = p4_in * (pCalib/p4_in.P())
20 ele.setP4(pKindCalib, p4_out, pErrCalib,
True)
21 cmgelectron.setP4(p4_out)
T get(const Candidate &c)