ATLAS Offline Software
Classes | Functions | Variables
plotBeamSpotVert Namespace Reference

Classes

class  Plots
 

Functions

def getPlotDef (what, property, default='')
 
def drawLabels ()
 
def drawInfo (c, h, more, x=0.6, size=0.04)
 

Variables

string __author__ = 'Juerg Beringer'
 
string __version__ = '$Id:$'
 
string __usage__ = '%prog [options] nt.root'
 
 parser = OptionParser(usage=__usage__, version=__version__)
 
 dest
 
 default
 
 help
 
 None
 
 type
 
 action
 
 False
 
 options
 
 args
 
 ntFile = args[0]
 
 ntName = ntFile.split('/')[-1][:-5] if not options.name else options.name
 
dictionary plotDef
 
def xmin = options.xmin if options.xmin else getPlotDef(options.plot,'xmin',-500)
 
def xmax = options.xmax if options.xmax else getPlotDef(options.plot,'xmax',+500)
 
def ymin = options.ymin if options.ymin else getPlotDef(options.plot,'ymin',-500)
 
def ymax = options.ymax if options.ymax else getPlotDef(options.plot,'ymax',+500)
 
def nbins = getPlotDef(options.plot,'nbins',options.nbins)
 
 atlasx
 
 atlasy
 
 atlasdx
 
string cuts = 'vType==1 && lb>=%i && lb<%i' % (options.lbmin,options.lbmax)
 
 run = getRunFromName(ntFile)
 
string runFillInfo = 'Fill %s' % (lhcFillData.get(run,'') if lhcFillData.get(run,'') else '')
 
string lhcEnergyInfo = '#sqrt{s} = %s;' % lhcEnergyData.get(run,'') if lhcEnergyData.get(run,'') else ''
 
 f = ROOT.TFile(ntFile)
 
 nt = f.Get('Vertices')
 
 saveAsList
 
 autoName
 
 plots = Plots('Primary Vertex Plots',['hist','histErr'])
 

Function Documentation

◆ drawInfo()

def plotBeamSpotVert.drawInfo (   c,
  h,
  more,
  x = 0.6,
  size = 0.04 
)

Definition at line 136 of file plotBeamSpotVert.py.

136 def drawInfo(c,h,more,x=0.6,size=0.04):
137  what = c.GetName()
138  info = 'Entries %5i' % h.GetEntries()
139  info += ';RMS %s %6.3g mm' % (what[0],h.GetRMS(2))
140  info += ';RMS %s %6.3g mm' % (what[1],h.GetRMS(1))
141  ROOTUtils.drawText(x,0.88,size,info,font=102)
142  if more:
143  ROOTUtils.drawText(x,0.73,size,more,font=102)
144 
145 

◆ drawLabels()

def plotBeamSpotVert.drawLabels ( )

Definition at line 123 of file plotBeamSpotVert.py.

123 def drawLabels():
124  if options.prelim:
125  ROOTUtils.atlasLabel(options.atlasx,options.atlasy,True,offset=options.atlasdx,energy=None)
126  if options.approval:
127  ROOTUtils.atlasLabel(options.atlasx,options.atlasy,False,offset=options.atlasdx,isForApproval=True,energy=None)
128  if options.published:
129  ROOTUtils.atlasLabel(options.atlasx,options.atlasy,False,offset=options.atlasdx,energy=None)
130 
131  ROOTUtils.drawText(options.atlasx,0.77,0.06,runFillInfo,font=42)
132  comment = options.comment if options.comment is not None else '#geq %i tracks/vertex' % (options.ntracks)
133  ROOTUtils.drawText(options.atlasx,0.71,0.06,lhcEnergyInfo+comment,font=42)
134 
135 

◆ getPlotDef()

def plotBeamSpotVert.getPlotDef (   what,
  property,
  default = '' 
)

Definition at line 68 of file plotBeamSpotVert.py.

68 def getPlotDef(what,property,default=''):
69  try:
70  return plotDef[what][property]
71  except:
72  return default
73 
74 # Plot defaults

Variable Documentation

◆ __author__

string plotBeamSpotVert.__author__ = 'Juerg Beringer'
private

Definition at line 10 of file plotBeamSpotVert.py.

◆ __usage__

string plotBeamSpotVert.__usage__ = '%prog [options] nt.root'
private

Definition at line 12 of file plotBeamSpotVert.py.

◆ __version__

string plotBeamSpotVert.__version__ = '$Id:$'
private

Definition at line 11 of file plotBeamSpotVert.py.

◆ action

plotBeamSpotVert.action

Definition at line 30 of file plotBeamSpotVert.py.

◆ args

plotBeamSpotVert.args

Definition at line 47 of file plotBeamSpotVert.py.

◆ atlasdx

plotBeamSpotVert.atlasdx

Definition at line 90 of file plotBeamSpotVert.py.

◆ atlasx

plotBeamSpotVert.atlasx

Definition at line 84 of file plotBeamSpotVert.py.

◆ atlasy

plotBeamSpotVert.atlasy

Definition at line 88 of file plotBeamSpotVert.py.

◆ autoName

plotBeamSpotVert.autoName

Definition at line 284 of file plotBeamSpotVert.py.

◆ cuts

string plotBeamSpotVert.cuts = 'vType==1 && lb>=%i && lb<%i' % (options.lbmin,options.lbmax)

Definition at line 93 of file plotBeamSpotVert.py.

◆ default

plotBeamSpotVert.default

Definition at line 18 of file plotBeamSpotVert.py.

◆ dest

plotBeamSpotVert.dest

Definition at line 18 of file plotBeamSpotVert.py.

◆ f

plotBeamSpotVert.f = ROOT.TFile(ntFile)

Definition at line 276 of file plotBeamSpotVert.py.

◆ False

plotBeamSpotVert.False

Definition at line 30 of file plotBeamSpotVert.py.

◆ help

plotBeamSpotVert.help

Definition at line 18 of file plotBeamSpotVert.py.

◆ lhcEnergyInfo

string plotBeamSpotVert.lhcEnergyInfo = '#sqrt{s} = %s;' % lhcEnergyData.get(run,'') if lhcEnergyData.get(run,'') else ''

Definition at line 272 of file plotBeamSpotVert.py.

◆ nbins

def plotBeamSpotVert.nbins = getPlotDef(options.plot,'nbins',options.nbins)

Definition at line 79 of file plotBeamSpotVert.py.

◆ None

plotBeamSpotVert.None

Definition at line 19 of file plotBeamSpotVert.py.

◆ nt

plotBeamSpotVert.nt = f.Get('Vertices')

Definition at line 278 of file plotBeamSpotVert.py.

◆ ntFile

plotBeamSpotVert.ntFile = args[0]

Definition at line 50 of file plotBeamSpotVert.py.

◆ ntName

plotBeamSpotVert.ntName = ntFile.split('/')[-1][:-5] if not options.name else options.name

Definition at line 51 of file plotBeamSpotVert.py.

◆ options

plotBeamSpotVert.options

Definition at line 47 of file plotBeamSpotVert.py.

◆ parser

plotBeamSpotVert.parser = OptionParser(usage=__usage__, version=__version__)

Definition at line 17 of file plotBeamSpotVert.py.

◆ plotDef

dictionary plotBeamSpotVert.plotDef
Initial value:
1 = {
2  'x': {'code': 'hist', 'var': 'x', 'hname': 'pvX', 'xmin': -2, 'xmax': 2, 'units': '[mm]'},
3  'y': {'code': 'hist', 'var': 'y', 'hname': 'pvY', 'xmin': -2, 'xmax': 2, 'units': '[mm]'},
4  'z': {'code': 'hist', 'var': 'z', 'hname': 'pvZ', 'xmin': -500, 'xmax': 500, 'units': '[mm]'},
5  'errX': {'code': 'histErr', 'var': 'vxx', 'hname': 'errX', 'xmin': 0, 'xmax': 500, 'units': '[mm]'},
6  'errXComp': {'code': 'histErrComp', 'var': 'vxx', 'hname': 'errX', 'xmin': 0, 'xmax': 100, 'units': '[mm]'},
7  'errY': {'code': 'histErr', 'var': 'vyy', 'hname': 'errY', 'xmin': 0, 'xmax': 500, 'units': '[mm]'},
8  'errZ': {'code': 'histErr', 'var': 'vzz', 'hname': 'errZ', 'xmin': 0, 'xmax': 500, 'units': '[mm]'},
9  'ntracks': {'code': 'hist', 'var': 'nTracks', 'hname': 'pvNTracks', 'xmin': 0, 'xmax': 200, 'nbins': 200},
10  'xz': {'xmin': -250, 'xmax': 250, 'ymin': -1.5, 'ymax': 2.5},
11  'yz': {'xmin': -250, 'xmax': 250, 'ymin': -0.5, 'ymax': 3.5},
12  'yx': {'xmin': -1.4, 'xmax': 0.6, 'ymin': 0, 'ymax': 2}
13 }

Definition at line 55 of file plotBeamSpotVert.py.

◆ plots

plotBeamSpotVert.plots = Plots('Primary Vertex Plots',['hist','histErr'])

Definition at line 286 of file plotBeamSpotVert.py.

◆ run

plotBeamSpotVert.run = getRunFromName(ntFile)

Definition at line 265 of file plotBeamSpotVert.py.

◆ runFillInfo

string plotBeamSpotVert.runFillInfo = 'Fill %s' % (lhcFillData.get(run,'') if lhcFillData.get(run,'') else '')

Definition at line 267 of file plotBeamSpotVert.py.

◆ saveAsList

plotBeamSpotVert.saveAsList

Definition at line 283 of file plotBeamSpotVert.py.

◆ type

plotBeamSpotVert.type

Definition at line 23 of file plotBeamSpotVert.py.

◆ xmax

def plotBeamSpotVert.xmax = options.xmax if options.xmax else getPlotDef(options.plot,'xmax',+500)

Definition at line 76 of file plotBeamSpotVert.py.

◆ xmin

def plotBeamSpotVert.xmin = options.xmin if options.xmin else getPlotDef(options.plot,'xmin',-500)

Definition at line 75 of file plotBeamSpotVert.py.

◆ ymax

def plotBeamSpotVert.ymax = options.ymax if options.ymax else getPlotDef(options.plot,'ymax',+500)

Definition at line 78 of file plotBeamSpotVert.py.

◆ ymin

def plotBeamSpotVert.ymin = options.ymin if options.ymin else getPlotDef(options.plot,'ymin',-500)

Definition at line 77 of file plotBeamSpotVert.py.

ROOTUtils.drawText
def drawText(x=0.74, y=0.87, dy=0.06, text='', font=62, color=1, align=11, linesep=';')
Definition: roofit/ROOTUtils.py:243
plotBeamSpotVert.drawInfo
def drawInfo(c, h, more, x=0.6, size=0.04)
Definition: plotBeamSpotVert.py:136
ROOTUtils.atlasLabel
def atlasLabel(x, y, isPreliminary=False, color=1, offset=0.115, isForApproval=False, energy=8, customstring="", size=0.05)
Definition: roofit/ROOTUtils.py:303
plotBeamSpotVert.getPlotDef
def getPlotDef(what, property, default='')
Definition: plotBeamSpotVert.py:68
plotBeamSpotVert.drawLabels
def drawLabels()
Definition: plotBeamSpotVert.py:123