diff --git a/scripts/checkTrackSelection.py b/scripts/checkTrackSelection.py index bd9eaea..f885890 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 15:07:55 +# @Last Modified time: 2017-05-03 15:14:35 import ROOT as r import os @@ -22,6 +22,7 @@ dets = ['TT', 'IT'] val = {'TT': 5, 'IT': 7} layer = {'TT': 'TTaU', 'IT': 'T3X2'} +cut = {'TT': 12, 'IT': 20} stat = 10000000 r.gROOT.SetBatch(True) @@ -39,9 +40,9 @@ 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) + print t_sig.Draw("GhostP : TrChi2/TrNDoF>>hsig(100,0., 5,100, 0.,1.)", "val%s>%s" % (val[det], cut[det]), "goff", stat, 0) h_sig = r.gDirectory.Get('hsig') - print 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<%s" % (val[det], cut[det]), "goff", stat, 0) h_noise = r.gDirectory.Get('hnoise') c = r.TCanvas() h_sig.Divide(h_noise) @@ -78,9 +79,9 @@ 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.DrawNormalized() h_sig.GetXaxis().SetTitle('Signal height [ADC value]') - h_sig.GetYaxis().SetTitle('Hits / ADC value') + h_sig.GetYaxis().SetTitle('Fraction of 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) @@ -94,6 +95,10 @@ v_bias = get_vmap(det)[int(step) / 6] label.AddText('V_{bias} = %s V' % v_bias) label.Draw('same') + line = r.TLine() + line.SetLineWidth(4) + line.SetLineColor(r.kRed) + line.DrawLine(float(cut[det]), 0.01, float(cut[det]), 0.99) c.Modified() c.Update() c.SaveAs('%s/%s_odinStep%s_fill%s.pdf' % (out_location, det, step, fill))