Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:32:28

0001 import ROOT
0002 import os.path
0003 ROOT.gSystem.Load("libEgammaAnalysisElectronTools")
0004 
0005 class Run2PhotonCalibrator:
0006     def __init__(self, data, isMC, isSync=False):
0007         self.random = ROOT.TRandom3()
0008         self.random.SetSeed(0) # make it really random across different jobs
0009         self.photonEnergyCalibratorRun2 = ROOT.PhotonEnergyCalibratorRun2(isMC, isSync, data)
0010         self.photonEnergyCalibratorRun2.initPrivateRng(self.random)
0011 
0012     def correct(self,photon,run):
0013         photon.uncalibratedP4 = photon.p4(photon.getCandidateP4type())
0014         photon.uncalibratedP4Error = photon.getCorrectedEnergyError(photon.getCandidateP4type())
0015         self.photonEnergyCalibratorRun2.calibrate(photon.physObj, int(run))
0016         return True