Definition at line 146 of file plotBeamSpotVert.py.
◆ genPlot()
def ROOTUtils.PlotLibrary.genPlot |
( |
|
self, |
|
|
|
what = 'ALL' , |
|
|
|
code = 'plot' , |
|
|
|
labels = [] , |
|
|
* |
args |
|
) |
| |
|
inherited |
Make plots using a general code. genPlot makes either a single plot defined
by argument what, or all plots (if what=''). The plots made in the latter
case are specified by whatList. A canvas that is subdivided if necessary
is created before the plotting code is called.
Definition at line 116 of file roofit/ROOTUtils.py.
116 def genPlot(self,what='ALL',code='plot',labels=[],*args):
117 """Make plots using a general code. genPlot makes either a single plot defined
118 by argument what, or all plots (if what=''). The plots made in the latter
119 case are specified by whatList. A canvas that is subdivided if necessary
120 is created before the plotting code is called."""
121 if what==
'' or what.upper()==
'ALL':
122 c = self.protect( MyCanvas(
'%s-%s-%s' % (self.name,what,code),
123 self.allCanvasSize,self.allCanvasDivs[0],self.allCanvasDivs[1]) )
125 for w
in self.whatList:
129 self.__class__.__dict__[code](self,w,*args)
131 self.__class__.__bases__[0].__dict__[code](self,w,*args)
134 for o
in self.gPadSaveAsList:
136 ROOT.gPad.SaveAs(
'%s-%s-%s%s' % (self.name,code,w,o))
141 if labels!=[]
and self.allCanvasDivs[0]*self.allCanvasDivs[1] > len(self.whatList):
150 print "ERROR: can't add labels unless we have an empty pad to use. Ignoring labels."
152 for o
in self.saveAsList:
154 c.SaveAs(
'%s-%s-%s%s' % (self.name,code,what,o))
159 c = self.protect( MyCanvas(what,self.singleCanvasSize) )
161 self.__class__.__dict__[code](self,what,*args)
163 self.__class__.__bases__[0].__dict__[code](self,what,*args)
165 for o
in self.saveAsList:
167 c.SaveAs(
'%s-%s-%s%s' % (self.name,code,what,o))
◆ hist()
def plotBeamSpotVert.Plots.hist |
( |
|
self | ) |
|
Definition at line 148 of file plotBeamSpotVert.py.
152 ROOT.gStyle.SetOptStat(options.optstat)
154 ROOT.gStyle.SetOptFit(1111)
156 c.SetRightMargin(0.14)
157 h =
ROOTUtils.protect(ROOT.TH1F(hname,
'Primary vertex: %s;Primary vertex %s %s' % (var,var,units),nbins,xmin,xmax))
158 nt.Draw(
'%s >> %s' % (var,hname),cuts)
162 comment = options.comment
if options.comment
is not None else '#geq %i tracks/vertex;%s' % (options.ntracks,options.cuts)
164 ROOT.gPad.SetLogy(options.logy)
◆ histErr()
def plotBeamSpotVert.Plots.histErr |
( |
|
self | ) |
|
Definition at line 168 of file plotBeamSpotVert.py.
172 ROOT.gStyle.SetOptStat(options.optstat)
173 ROOT.gStyle.SetOptFit(0)
175 c.SetRightMargin(0.14)
176 h =
ROOTUtils.protect(ROOT.TH1F(hname,
'Primary vertex error: %s;Primary vertex error #sqrt{V_{%s}} (#mum);Number of vertices' % (hname,vName),
178 nt.Draw(
'1e3*sqrt(%s) >> %s' % (var,hname),cuts)
180 comment = options.comment
if options.comment
is not None else '#geq %i tracks/vertex;%s' % (options.ntracks,options.cuts)
182 ROOT.gPad.SetLogy(options.logy)
◆ histErrComp()
def plotBeamSpotVert.Plots.histErrComp |
( |
|
self | ) |
|
Definition at line 186 of file plotBeamSpotVert.py.
186 def histErrComp(self):
190 ROOT.gStyle.SetOptStat(0)
191 ROOT.gStyle.SetOptFit(0)
193 c.SetRightMargin(0.14)
194 h =
ROOTUtils.protect(ROOT.TH1F(hname,
'Vertex Error: %s;Vertex error #sqrt{V_{%s}} [#mum];Fraction of entries' % (hname,vName),
196 nt.Draw(
'1e3*sqrt(%s) >> %s' % (var,hname),cuts)
199 pname = hname+
'_pileup'
200 p =
ROOTUtils.protect(ROOT.TH1F(pname,
'Vertex Error: %s;Vertex error #sqrt{V_{%s}} [#mum];Fraction of entries' % (hname,vName),
202 pcuts = cuts.replace(
'vType==1',
'vType==3')
204 nt.Draw(
'1e3*sqrt(%s) >> %s' % (var,pname),pcuts,
"SAME")
210 comment = options.comment
if options.comment
is not None else '#geq %i tracks/vertex;%s' % (options.ntracks,options.cuts)
212 legend = ROOT.TLegend(.50,.6,.85,.72)
213 legend.AddEntry(h,
'Primary vertices',
'L')
214 legend.AddEntry(p,
'Pileup vertices',
'L')
215 legend.SetFillColor(0)
216 legend.SetBorderSize(0)
218 ROOT.gPad.SetLogy(options.logy)
◆ plot()
def ROOTUtils.PlotLibrary.plot |
( |
|
self, |
|
|
|
plotName = '' , |
|
|
* |
args |
|
) |
| |
|
inherited |
Make one or all (if plotName=='') plots.
Definition at line 106 of file roofit/ROOTUtils.py.
106 def plot(self, plotName='',*args):
107 """Make one or all (if plotName=='') plots."""
109 self.__class__.__dict__[plotName](self,*args)
111 for i
in self.__class__.__dict__:
112 if i[0]==
'_':
continue
113 if i
in self.otherMethods:
continue
114 self.__class__.__dict__[i](self,*args)
◆ protect()
def ROOTUtils.PlotLibrary.protect |
( |
|
self, |
|
|
|
obj |
|
) |
| |
|
inherited |
Protect ROOT object from garbage collection.
Definition at line 101 of file roofit/ROOTUtils.py.
102 """Protect ROOT object from garbage collection."""
103 self.rootObjects.
append(obj)
◆ xz()
def plotBeamSpotVert.Plots.xz |
( |
|
self | ) |
|
Definition at line 222 of file plotBeamSpotVert.py.
224 ROOT.gStyle.SetOptStat(0)
226 c.SetRightMargin(0.14)
227 h =
ROOTUtils.protect(ROOT.TH2F(
'pvXZ',
'Primary vertex: x vs z;Primary vertex z [mm];Primary vertex x [mm]',nbins,xmin,xmax,nbins,ymin,ymax))
228 nt.Draw(
'x:z >> pvXZ',cuts)
230 h.GetYaxis().SetTitleOffset(1.0)
◆ yx()
def plotBeamSpotVert.Plots.yx |
( |
|
self | ) |
|
Definition at line 250 of file plotBeamSpotVert.py.
251 ROOT.gStyle.SetOptStat(0)
253 c.SetRightMargin(0.14)
254 h =
ROOTUtils.protect(ROOT.TH2F(
'pvYX',
'Primary vertex: y vs x;Primary vertex x [mm];Primary vertex y [mm]',nbins,xmin,xmax,nbins,ymin,ymax))
255 nt.Draw(
'y:x >> pvYX',cuts)
257 h.GetYaxis().SetTitleOffset(1.0)
◆ yz()
def plotBeamSpotVert.Plots.yz |
( |
|
self | ) |
|
Definition at line 237 of file plotBeamSpotVert.py.
238 ROOT.gStyle.SetOptStat(0)
240 c.SetRightMargin(0.14)
241 h =
ROOTUtils.protect(ROOT.TH2F(
'pvYZ',
'Primary vertex: y vs z;Primary vertex z [mm];Primary vertex y [mm]',nbins,xmin,xmax,nbins,ymin,ymax))
242 nt.Draw(
'y:z >> pvYZ',cuts)
244 h.GetYaxis().SetTitleOffset(1.0)
◆ allCanvasDivs
ROOTUtils.PlotLibrary.allCanvasDivs |
|
inherited |
◆ allCanvasSize
ROOTUtils.PlotLibrary.allCanvasSize |
|
inherited |
◆ gPadSaveAsList
ROOTUtils.PlotLibrary.gPadSaveAsList |
|
inherited |
◆ name
ROOTUtils.PlotLibrary.name |
|
inherited |
◆ otherMethods
ROOTUtils.PlotLibrary.otherMethods |
|
inherited |
◆ rootObjects
ROOTUtils.PlotLibrary.rootObjects |
|
inherited |
◆ saveAsList
ROOTUtils.PlotLibrary.saveAsList |
|
inherited |
◆ singleCanvasSize
ROOTUtils.PlotLibrary.singleCanvasSize |
|
inherited |
◆ whatList
ROOTUtils.PlotLibrary.whatList |
|
inherited |
The documentation for this class was generated from the following file:
def drawText(x=0.74, y=0.87, dy=0.06, text='', font=62, color=1, align=11, linesep=';')