50, float(mn1Range['min']), float(mn1Range['max'])) histo2lnth = r.TH2F('mc1mn1_2lep_notauhad_reqids', 'ReqIds for the WH notauhad 2lep grid ;mc_{1};mn_{1}', 50, float(mc1Range['min']), float(mc1Range['max']), 50, float(mn1Range['min']), float(mn1Range['max'])) histo3l = r.TH2F('mc1mn1_3lep_reqids', 'ReqIds for the WH 3lep grid ;mc_{1};mn_{1}', 50, float(mc1Range['min']), float(mc1Range['max']), 50, float(mn1Range['min']), float(mn1Range['max'])) # # looping over reqDb.entries also includes missing entries (i.e. reqids that were not processed) # for sample, reqid in reqDb.entries.iteritems() : # mc1, mn1 = parDb.mc1Mn1ByReqid(reqid) for entry in parDb.entries : reqid, mc1, mn1 = entry.ds, entry.mc1, entry.mn1 mc1, mn1 = float(mc1), float(mn1) sample = reqDb.sampleByReqid(reqid) if not sample : print "missing %s, (%.1f, %.1f)"%(reqid, mc1, mn1) continue h = (histo2lnth if '2Lep' in sample and 'notauhad' in sample else histo2l if '2Lep' in sample else histo3l if '3Lep' in sample else None ) assert h,"%s is not 2l nor 3l"%sample h.Fill(mc1, mn1, float(reqid)) def buildMergedHisto(histo) : merge = ModeAWhDbMergedFake2Lreqid() h = histo.Clone(histo.GetName()+'_merged') h.Reset() xAx, yAx = h.GetXaxis(), h.GetYaxis() for iX in range(1, h.GetNbinsX()+1) :
float(mn1Range['min']), float(mn1Range['max'])) histo2lnth = r.TH2F('mc1mn1_2lep_notauhad_reqids', 'ReqIds for the WH notauhad 2lep grid ;mc_{1};mn_{1}', 50, float(mc1Range['min']), float(mc1Range['max']), 50, float(mn1Range['min']), float(mn1Range['max'])) histo3l = r.TH2F('mc1mn1_3lep_reqids', 'ReqIds for the WH 3lep grid ;mc_{1};mn_{1}', 50, float(mc1Range['min']), float(mc1Range['max']), 50, float(mn1Range['min']), float(mn1Range['max'])) # # looping over reqDb.entries also includes missing entries (i.e. reqids that were not processed) # for sample, reqid in reqDb.entries.iteritems() : # mc1, mn1 = parDb.mc1Mn1ByReqid(reqid) for entry in parDb.entries: reqid, mc1, mn1 = entry.ds, entry.mc1, entry.mn1 mc1, mn1 = float(mc1), float(mn1) sample = reqDb.sampleByReqid(reqid) if not sample: print "missing %s, (%.1f, %.1f)" % (reqid, mc1, mn1) continue h = (histo2lnth if '2Lep' in sample and 'notauhad' in sample else histo2l if '2Lep' in sample else histo3l if '3Lep' in sample else None) assert h, "%s is not 2l nor 3l" % sample h.Fill(mc1, mn1, float(reqid)) def buildMergedHisto(histo): merge = ModeAWhDbMergedFake2Lreqid() h = histo.Clone(histo.GetName() + '_merged') h.Reset() xAx, yAx = h.GetXaxis(), h.GetYaxis() for iX in range(1, h.GetNbinsX() + 1):