diff --git a/scripts/checkTrackSelection.py b/scripts/checkTrackSelection.py index da79096..1f68334 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:55:44 +# @Last Modified time: 2017-05-03 15:00:01 import ROOT as r import os @@ -35,16 +35,14 @@ 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], "goff", stat, 0) + r.gStyle.SetPadLeftMargin(0.20) + r.gStyle.SetPadRightMargin(0.25) + r.gStyle.SetPadBottomMargin(0.15) + r.gStyle.SetPadTopMargin(0.05) + print t_sig.Draw("GhostP : TrChi2/TrNDoF>>hsig(100,0., 5,100, 0.,1.)", "val%s>12" % val[det], "goff", stat, 0) h_sig = r.gDirectory.Get('hsig') - t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnoise(100,0., 5,100, 0.,1.)", "val%s<12" % val[det], "goff", stat, 0) + print t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnoise(100,0., 5,100, 0.,1.)", "val%s<12" % val[det], "goff", stat, 0) h_noise = r.gDirectory.Get('hnoise') - c = r.TCanvas() h_sig.Divide(h_noise) h_sig.Draw("colz") @@ -54,37 +52,28 @@ h_sig.GetYaxis().SetTitle(r'Ghost Prob.') h_sig.GetZaxis().SetTitle(r'S/B ratio') h_sig.Draw("colz") - c, line = putLine(c, det) - label = r.TPaveText( 0.74 - r.gStyle.GetPadRightMargin(), 0.87 - r.gStyle.GetPadTopMargin(), 0.95 - r.gStyle.GetPadRightMargin(), 0.95 - r.gStyle.GetPadTopMargin(), "BRNDC") label.SetFillColor(0) label.SetTextAlign(12) label.SetBorderSize(0) label.SetTextFont(132) - # label.SetTextFont(22) label.SetTextSize(0.06) label.SetTextAlign(22) - # label.SetTextColor(r.kWhite) label.AddText('Fill %s' % fill) label.Draw('same') c.Modified() c.Update() - c.SaveAs('%s/%s_fill%s.pdf' % (out_location, det, fill)) h_sig.Delete() h_noise.Delete() - # f.Close() 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%s(210,-35, 175)" % (val[det], step), "odinStep==%s" % step, "goff", stat, 0) + print t_sig.Draw("val%s>>hsig%s(210,-35, 175)" % (val[det], step), "odinStep==%s" % step, "goff", stat, 0) h_sig = r.gDirectory.Get('hsig%s' % step) r.gROOT.ProcessLine('.X %s/../include/lhcbstyle.C' % os.getcwd()) - c = r.TCanvas() h_sig.Draw() h_sig.GetXaxis().SetTitle('Signal height [ADC value]') @@ -95,10 +84,8 @@ label.SetTextAlign(12) label.SetBorderSize(0) label.SetTextFont(132) - # label.SetTextFont(22) label.SetTextSize(0.06) label.SetTextAlign(22) - # label.SetTextColor(r.kWhite) label.AddText('Fill %s\n' % fill) from checkPulseData import get_vmap v_bias = get_vmap(det)[int(step) / 6] @@ -106,10 +93,8 @@ label.Draw('same') c.Modified() c.Update() - c.SaveAs('%s/%s_odinStep%s_fill%s.pdf' % (out_location, det, step, fill)) h_sig.Delete() - # f.Close() def putLine(c, det): @@ -150,7 +135,7 @@ t_sig = f.Get('STADCTrackMonitor/HitInfo/%s' % layer[det]) printSelection(f, t_sig, det, fill, stat) - for step in [0, 54]: + for step in [0., 54.]: printADC(f, t_sig, det, fill, stat, step) - f.Close() + f.Close()