def draw_module_grid(self, show=True): for i in xrange(2): for j in xrange(8): rows, cols = self.NRows, self.NCols x = array([cols * j - .5, cols * (j + 1) - .5, cols * (j + 1) - .5, cols * j - .5, cols * j - .5], 'd') y = array([rows * i - .5, rows * i - .5, rows * (i + 1) - .5, rows * (i + 1) - .5, rows * i - .5], 'd') cut = TCutG('r{n}'.format(n=j + (j * i)), 5, x, y) cut.SetLineColor(1) cut.SetLineWidth(2) if show: cut.Draw('same') self.Drawer.Drawings.append(cut)
#zcutMassArr.append(0) #zcutZcutArr.append(zcutArr[0]) #zcutMassArr.append(minMassArr[0]) #zcutZcutArr.append(zcutArr[0]) zcutTcut = TCutG("highzcut", len(zcutMassArr), zcutMassArr, zcutZcutArr) zcutTcut.SetVarX(massVar) zcutTcut.SetVarY(vtxVar) c.SetLogx(0) events.Draw( "{1}:{0}>>hnew({2},0,0.17,180,-5,20)".format(massVar, vtxVar, n_massbins), "highzcut", "colz") gDirectory.Get("hnew").SetTitle("Events passing z-cut") gDirectory.Get("hnew").GetXaxis().SetTitle("mass [GeV]") gDirectory.Get("hnew").GetYaxis().SetTitle("z-cut [mm]") zcutTcut.Draw("L") c.Print(remainder[0] + "_output.pdf", "Title:test") events.Draw("{0}>>hnew(100,0,0.17)".format(massVar), "highzcut", "colz") c.Print(remainder[0] + "_output.pdf", "Title:test") gDirectory.Get("hnew").Fit("pol2", "L") c.Print(remainder[0] + "_output.pdf", "Title:test") c.SetLogx(1) candRescaled2DHist.Draw("colz") candRescaled2DHist.SetTitle("Candidate events") candRescaled2DHist.GetXaxis().SetMoreLogLabels() candRescaled2DHist.GetXaxis().SetTitle("mass [GeV]") candRescaled2DHist.GetYaxis().SetTitle("background cdf") c.Print(remainder[0] + "_output.pdf", "Title:test") graph = drawGraph(massArr, candArr, "candidate events", "A*")