diff --git a/scripts/checkTrackSelection.py b/scripts/checkTrackSelection.py index 00d2613..ab8ee9c 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: 2015-12-07 11:46:05 +# @Last Modified time: 2017-05-03 10:57:13 import ROOT as r import os @@ -14,12 +14,18 @@ os.system('mkdir -p %s' % out_location) fills = [2797, 3108, 3478, 3960, 4518] -#fills = [4643] dets = ['TT', 'IT'] +val = {'TT': 5, 'IT': 7} stat = 10000000 r.gROOT.ProcessLine('.X %s/../include/lhcbstyle.C' % os.getcwd()) -r.gStyle.SetPadRightMargin(0.12) +#r.gStyle.SetPadRightMargin(0.16) +#r.gStyle.SetPadLeftMargin(r.gStyle.GetPadLeftMargin() * 0.7) +r.gStyle.SetPadLeftMargin(0.20) +r.gStyle.SetPadRightMargin(0.25) +r.gStyle.SetPadBottomMargin(0.15) +r.gStyle.SetPadTopMargin(0.05) + def printSelection(det, fill, stat): f = r.TFile(location[det] + '%s.root' % fill, 'read') @@ -27,9 +33,9 @@ # 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.)", "val5>12", "colz", stat, 0) + t_sig.Draw("GhostP : TrChi2/TrNDoF>>hsig(100,0., 5,100, 0.,1.)", "val%s>12" % val[det], "colz", stat, 0) h_sig = r.gPad.GetPrimitive('hsig') - t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnoise(100,0., 5,100, 0.,1.)", "val5<12", "colz", stat, 0) + t_sig.Draw("GhostP : TrChi2/TrNDoF>>hnoise(100,0., 5,100, 0.,1.)", "val%s<12" % val[det], "colz", stat, 0) h_noise = r.gPad.GetPrimitive('hnoise') c = r.TCanvas() @@ -42,6 +48,8 @@ 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) @@ -61,6 +69,21 @@ f.Close() +def putLine(c, det): + line = r.TLine() + line.SetLineWidth(4) + line.SetLineColor(kWhite) + c.cd() + if 'TT' in det: + line.DrawLine(0.0, 0.01, 1.6, 0.16) + line.DrawLine(3.0, 0.07, 1.6, 0.16) + line.DrawLine(3.0, 0.07, 3.0, 0.0) + else: + line.DrawLine(0.0, 0.0, 3.5, 0.35) + line.DrawLine(3.5, 0.35, 5.0, 0.20) + return c, line + + def printByStep(fill, stat): f = r.TFile(location_tt + '%s.root' % fill, 'read') t_sig = f.Get('STADCTrackMonitor/HitInfo/TTaU')