diff --git a/scripts/checkTrackSelection.py b/scripts/checkTrackSelection.py index a7a4301..f7bc1ee 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 11:14:26 +# @Last Modified time: 2017-05-03 13:59:10 import ROOT as r import os @@ -76,6 +76,35 @@ 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]) + c = r.TCanvas() + t_sig.Draw("val%s>>hsig(110,-35, 75)" % val[det], "odinStep==%s" % step, "ap", stat, 0) + h_sig = r.gPad.GetPrimitive('hsig') + h_sig.GetXaxis().SetTitle('Signal height [ADC value]') + h_sig.GetYaxis().SetTitle('Hits / ADC value') + 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) + from checkPulseData import get_vmap + v_bias = get_vmap(det)[int(step) / 11] + label.AddText('V_{bias} = %s V' % v_bias) + c.Modified() + c.Update() + + c.SaveAs('%s/%s_odinStep%s_fill%s.pdf' % (out_location, det, step, fill)) + f.Close() + + def putLine(c, det): line = r.TLine() line.SetLineWidth(4) @@ -111,3 +140,5 @@ for det in dets: for fill in fills: printSelection(det, fill, stat) + for step in [0, 60]: + printADC(det, fill, stat, step)