Exemple #1
0
#                else :
#                    m0_m12_mChi_noweight = r.TH2D("m0_m12_mChi_noweight","Dummy Histo",81,0,2025,81,0,2025)

                for dirname in c.dirNames :
                    outfile.mkdir(dirname)
                    outfile.cd(dirname)
                outfile.Write()
                infile = r.TFile(rtfile,"READ")
                befdir = infile.GetDirectory("master/progressPrinter/label/scanHistogrammer/")
                befkeylist = befdir.GetListOfKeys()        
                for key in befkeylist :
                    if key.ReadObj().GetName() == "nEvents":
                        before = key.ReadObj()
                        m0_m12_mChi_noweight = before.Clone()
                        if "T2cc" in modAndPdf[0] : 
                            m0_m12_mChi_noweight = c.resizeHisto(m0_m12_mChi_noweight, 35, 100, 275, 50, 10, 260)
                            m0_m12_mChi_noweight = c.shift2DHistos(m0_m12_mChi_noweight, -0.5, -0.5, 5, 1)
                        m0_m12_mChi_noweight.SetName("m0_m12_mChi_noweight")
                        outfile.cd("smsScan_before")
                        m0_m12_mChi_noweight.Write("",r.TObject.kOverwrite)
                afdir = infile.GetDirectory(ht[1])
                afkeylist = afdir.GetListOfKeys()
                histList375 = []
                for key in afkeylist :
                    if key.ReadObj().GetName() in c.keyNames :
                        keyName = key.ReadObj().GetName()
                        if (ht[0] == "375" and "ge4j_ge4b" in keyName) :
                            histList375.append(key.ReadObj())
                        after = key.ReadObj()
                        keyName = keyName.replace("nEvents_","")
                        keyName = keyName.split("_")
Exemple #2
0
#                if "T2cc" in modAndPdf[0] :
#                    beforeHist = r.TH2D("nEvents_before","nEvents",35,100,275,50,10,260)
#                    afterHist =  r.TH2D("nEvents_after","nEvents",35,100,275,50,10,260)                
#                else :
#                    beforeHist = r.TH2D("nEvents_before","nEvents",81,0,2025,81,0,2025)
#                    afterHist =  r.TH2D("nEvents_after","nEvents",81,0,2025,81,0,2025)
#                    
                infile = r.TFile(rtfile,"READ")
                befdir = infile.GetDirectory("master/progressPrinter/label/scanHistogrammer/")
                befkeylist = befdir.GetListOfKeys()        

                for key in befkeylist :
                    if key.ReadObj().GetName() == "nEvents":
                        before = key.ReadObj()
                        beforeHist = before.Clone()
                        beforeHist = c.resizeHisto(beforeHist, 35, 100, 275, 50, 10, 260)
                        beforeHist = c.shift2DHistos(beforeHist, -0.5, -0.5, 5, 1)
                        beforeHist.Draw("colz")
                        canvas.Print("test.pdf")
                afdir = infile.GetDirectory(ht[1])
                afkeylist = afdir.GetListOfKeys()
                for key in afkeylist :
                    if key.ReadObj().GetName() == "nEvents":
                        after = key.ReadObj()
                        afterHist = after.Clone()
                        afterHist = c.resizeHisto(afterHist, 35, 100, 275, 50, 10, 260)
                        afterHist = c.shift2DHistos(afterHist, -0.5, -0.5, 5, 1)
                        afterHist.Divide(beforeHist)
                outfile = r.TFile("output/acc_%s_%s.root"%(modAndPdf[0],ht[0]),"RECREATE") 
                afterHist.Write()