diff --git a/scripts/checkTrackSelection.py b/scripts/checkTrackSelection.py index 781a0bc..b86271f 100644 --- a/scripts/checkTrackSelection.py +++ b/scripts/checkTrackSelection.py @@ -3,7 +3,7 @@ # @Author: Elena Graverini # @Date: 2015-10-27 18:26:49 # @Last Modified by: Elena Graverini -# @Last Modified time: 2017-05-03 14:11:20 +# @Last Modified time: 2017-05-03 14:44:53 import ROOT as r import os @@ -34,15 +34,15 @@ r.gStyle.SetPadTopMargin(0.05) -def printSelection(det, fill, stat): - f = r.TFile(location[det] + '%s.root' % fill, 'read') - t_sig = f.Get('STADCTrackMonitor/HitInfo/%s' % layer[det]) +def printSelection(f, t_sig, det, fill, stat): + # f = r.TFile(location[det] + '%s.root' % fill, 'read') + # t_sig = f.Get('STADCTrackMonitor/HitInfo/%s' % layer[det]) # t_bg = f.Get('STADCTrackMonitor/NoiseInfo/TTaU') # t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnew(100,0., 5,100, 0.,1.)", "", "colz", 10000, 0) - t_sig.Draw("GhostP : TrChi2/TrNDoF>>hsig(100,0., 5,100, 0.,1.)", "val%s>12" % val[det], "colz", stat, 0) + t_sig.Draw("GhostP : TrChi2/TrNDoF>>hsig(100,0., 5,100, 0.,1.)", "val%s>12" % val[det], "goff", stat, 0) h_sig = r.gPad.GetPrimitive('hsig') - t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnoise(100,0., 5,100, 0.,1.)", "val%s<12" % val[det], "colz", stat, 0) + t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnoise(100,0., 5,100, 0.,1.)", "val%s<12" % val[det], "goff", stat, 0) h_noise = r.gPad.GetPrimitive('hnoise') c = r.TCanvas() @@ -73,13 +73,13 @@ c.Update() c.SaveAs('%s/%s_fill%s.pdf' % (out_location, det, fill)) - f.Close() + # f.Close() -def printADC(det, fill, stat, step): - f = r.TFile(location[det] + '%s.root' % fill, 'read') - t_sig = f.Get('STADCTrackMonitor/HitInfo/%s' % layer[det]) - t_sig.Draw("val%s>>hsig(110,-35, 75)" % val[det], "odinStep==%s" % step, "ap", stat, 0) +def printADC(f, t_sig, det, fill, stat, step): + # f = r.TFile(location[det] + '%s.root' % fill, 'read') + # t_sig = f.Get('STADCTrackMonitor/HitInfo/%s' % layer[det]) + t_sig.Draw("val%s>>hsig(110,-35, 75)" % val[det], "odinStep==%s" % step, "goff", stat, 0) h_sig = r.gPad.GetPrimitive('hsig') r.gROOT.ProcessLine('.X %s/../include/lhcbstyle.C' % os.getcwd()) @@ -106,7 +106,7 @@ c.Update() c.SaveAs('%s/%s_odinStep%s_fill%s.pdf' % (out_location, det, step, fill)) - f.Close() + # f.Close() def putLine(c, det): @@ -143,6 +143,11 @@ if __name__ == '__main__': for det in dets: for fill in fills: - printSelection(det, fill, stat) + f = r.TFile(location[det] + '%s.root' % fill, 'read') + t_sig = f.Get('STADCTrackMonitor/HitInfo/%s' % layer[det]) + + printSelection(f, t_sig, det, fill, stat) for step in [0, 60]: - printADC(det, fill, stat, step) + printADC(f, t_sig, det, fill, stat, step) + + f.Close()