CMS 3D CMS Logo

PhotonCalibrator.py
Go to the documentation of this file.
1 import ROOT
2 import os.path
3 ROOT.gSystem.Load("libEgammaAnalysisElectronTools")
4 
6  def __init__(self, data, isMC, isSync=False):
7  self.random = ROOT.TRandom3()
8  self.random.SetSeed(0) # make it really random across different jobs
9  self.photonEnergyCalibratorRun2 = ROOT.PhotonEnergyCalibratorRun2(isMC, isSync, data)
10  self.photonEnergyCalibratorRun2.initPrivateRng(self.random)
11 
12  def correct(self,photon,run):
13  photon.uncalibratedP4 = photon.p4(photon.getCandidateP4type())
14  photon.uncalibratedP4Error = photon.getCorrectedEnergyError(photon.getCandidateP4type())
15  self.photonEnergyCalibratorRun2.calibrate(photon.physObj, int(run))
16  return True
PhotonCalibrator.Run2PhotonCalibrator.photonEnergyCalibratorRun2
photonEnergyCalibratorRun2
Definition: PhotonCalibrator.py:9
PhotonCalibrator.Run2PhotonCalibrator.random
random
Definition: PhotonCalibrator.py:7
PhotonCalibrator.Run2PhotonCalibrator.__init__
def __init__(self, data, isMC, isSync=False)
Definition: PhotonCalibrator.py:6
createfilelist.int
int
Definition: createfilelist.py:10
PhotonCalibrator.Run2PhotonCalibrator
Definition: PhotonCalibrator.py:5
PhotonCalibrator.Run2PhotonCalibrator.correct
def correct(self, photon, run)
Definition: PhotonCalibrator.py:12