def __init__(self, fakeRateVersion): ''' fakeRateVersion is the identifier (date, etc.) for the desired fake rates. Fake rates will be taken from data/leptonFakeRate/fakeRate_2015gold_[fakeRateVersion]_[ID/Iso].py ''' self.version = fakeRateVersion fileBase = os.path.join(os.environ['zza'], 'ZZAnalyzer', 'data', 'leptonFakeRate', 'fakeRate_2015gold_{0}_{{0}}.root' ).format(self.version) self.fileNames = { t : fileBase.format(t) for t in ['ID', 'Iso'] } self.saved = [] # objects we need to persistify somehow self.fakeRates = { t : self.makeFakeRates(f) for t,f in self.fileNames.iteritems() } wts = WeightStringMaker('bkgWeight') self.fakeRateStrs = { t : { lep : wts.makeWeightStringFromHist(fr, '{0}Pt', 'abs({0}Eta)' ) for lep, fr in frs.iteritems() } for t, frs in self.fakeRates.iteritems() } self.compile()
def __init__(self, fakeRateVersion): ''' fakeRateVersion is the identifier (date, etc.) for the desired fake rates. Fake rates will be taken from data/leptonFakeRate/fakeRate_2015gold_[fakeRateVersion].py ''' self.version = fakeRateVersion self.frFileName = os.path.join(os.environ['zza'], 'ZZAnalyzer', 'data', 'leptonFakeRate', 'fakeRate_2015gold_{0}.root' ).format(self.version) self.frFile = root_open(self.frFileName) self.fakeRates = { 'e' : self.frFile.e_FakeRate.clone(), 'm' : self.frFile.m_FakeRate.clone(), } wts = WeightStringMaker('bkgWeight') self.fakeRateStrs = { lep : wts.makeWeightStringFromHist(h, '{0}Pt', 'abs({0}Eta)' ) for lep, h in self.fakeRates.iteritems() } self.compile()