ATLAS Offline Software
Loading...
Searching...
No Matches
python.PlotLibrary Namespace Reference

Functions

 LHCBeamSpotSize (lhcTimeString, lhcBeta1, lhcEmit1, lhcBeta2, lhcEmit2, betaGamma=3730. # Default value of betaGamma for 7 TeV)
 LHCEmittance (lhcTimeString, lhcEmit1, lhcEmit2, minEmittance=0., maxEmittance=8.)
 LHCBeamSpotSizeFill1022 (plot='sigx')
 LHCEmittanceFill1022 (plot='sigx')
 LHCBeamSpotSizeFill1058 (plot='sigx')

Variables

str __author__ = 'Juerg Beringer'
str __version__ = '$Id $'
list fill1022TimeString = ['Apr 4 14:27:30 2010', 'Apr 4 22:27:30 2010', 'Apr 5 3:57:30 2010','Apr 5 7:57:30 2010' ]
 fill1022Emit1X = array([ 1.45, 1.8, 1.92, 2.0 ])
 fill1022Emit1Y = array([ 1.6, 2.1, 2.45, 2.55 ])
 fill1022Emit2X = array([ 1.8, 2.27, 2.27, 2.5 ])
 fill1022Emit2Y = array([ 2.6, 4.6, 5.4, 5.8 ])
float fill1022Beta1X = 11.54
float fill1022Beta1Y = 12.74
float fill1022Beta2X = 9.89
float fill1022Beta2Y = 12.70
list fill1058TimeString = ['Apr 25 6:03:00 2010', 'Apr 24 6:57:00 2010']
 fill1058Emit1X = array([ 5.05, 2.6])
 fill1058Emit1Y = array([ 5.04, 2.6])
 fill1058Emit2X = array([ 3.88, 2.5])
 fill1058Emit2Y = array([10.64, 4.9])
float fill1058Beta1X = 2.28
float fill1058Beta1Y = 2.02
float fill1058Beta2X = 1.92
float fill1058Beta2Y = 2.10
 gr = LHCBeamSpotSizeFill1022()

Detailed Description

A library with miscellaneous beam spot related utilities and plots.

Function Documentation

◆ LHCBeamSpotSize()

python.PlotLibrary.LHCBeamSpotSize ( lhcTimeString,
lhcBeta1,
lhcEmit1,
lhcBeta2,
lhcEmit2,
betaGamma = 3730.  # Default value of betaGamma for 7 TeV )

Definition at line 23 of file PlotLibrary.py.

29 ):
30 lhcTime = array([ mktime(strptime(s,'%b %d %H:%M:%S %Y')) for s in lhcTimeString])
31 print (lhcTime)
32
33 # Normalized emittance quoted in um rad; lhcEps arrays are emittance in m rad
34 lhcEps1 = lhcEmit1 * 1.0e-6 / betaGamma
35 lhcEps2 = lhcEmit2 * 1.0e-6 / betaGamma
36
37 # Beam sizes in mm
38 lhcSigmaBeam1 = sqrt(lhcBeta1*lhcEps1) * 1.0e3
39 print ('Size of beam 1 (mm): ',lhcSigmaBeam1)
40 lhcSigmaBeam2 = sqrt(lhcBeta2*lhcEps2) * 1.0e3
41 print ('Size of beam 2 (mm): ',lhcSigmaBeam2)
42
43 # Beam spot size in mm
44 lhcSigma = 1. / sqrt(1./lhcSigmaBeam1**2 + 1./lhcSigmaBeam2**2)
45 print ('Beam spot size (mm): ',lhcSigma)
46
47 # Draw on existing plot
48 gr = ROOTUtils.protect( ROOT.TGraph(len(lhcTime),lhcTime,lhcSigma) )
49 gr.SetMarkerColor(2)
50 gr.SetLineColor(2)
51 #gr.SetMarkerSize(1.0)
52 #gr.SetMarkerStyle(25)
53 gr.SetMarkerSize(1.5)
54 gr.SetMarkerStyle(20)
55 gr.Draw('PSAME')
56 return [(gr,'Expected from #sqrt{#epsilon #beta*}','P')]
57
58
59#
60# Plot normalized emittance with new axis on right hand side of plot
61#
STL class.

◆ LHCBeamSpotSizeFill1022()

python.PlotLibrary.LHCBeamSpotSizeFill1022 ( plot = 'sigx')

Definition at line 128 of file PlotLibrary.py.

128def LHCBeamSpotSizeFill1022(plot='sigx'):
129 if plot=='sigx':
130 return LHCBeamSpotSize(fill1022TimeString,fill1022Beta1X,fill1022Emit1X,fill1022Beta2X,fill1022Emit2X)
131 if plot=='sigy':
132 return LHCBeamSpotSize(fill1022TimeString,fill1022Beta1Y,fill1022Emit1Y,fill1022Beta2Y,fill1022Emit2Y)
133

◆ LHCBeamSpotSizeFill1058()

python.PlotLibrary.LHCBeamSpotSizeFill1058 ( plot = 'sigx')

Definition at line 155 of file PlotLibrary.py.

155def LHCBeamSpotSizeFill1058(plot='sigx'):
156 if plot=='sigx':
157 return LHCBeamSpotSize(fill1058TimeString,fill1058Beta1X,fill1058Emit1X,fill1058Beta2X,fill1058Emit2X)
158 if plot=='sigy':
159 return LHCBeamSpotSize(fill1058TimeString,fill1058Beta1Y,fill1058Emit1Y,fill1058Beta2Y,fill1058Emit2Y)
160
161
162
163# Test code for modules

◆ LHCEmittance()

python.PlotLibrary.LHCEmittance ( lhcTimeString,
lhcEmit1,
lhcEmit2,
minEmittance = 0.,
maxEmittance = 8. )

Definition at line 62 of file PlotLibrary.py.

67 ):
68 lhcTime = array([ mktime(strptime(s,'%b %d %H:%M:%S %Y')) for s in lhcTimeString])
69 ROOT.gPad.SetTicky(0) # Remove tick marks on right side y axis
70 ROOT.gPad.SetRightMargin(0.1)
71 #maxEmittance = max(max(lhcEmit1),max(lhcEmit2))*1.7
72 hmin = ROOT.gPad.GetUymin()
73 hmax = ROOT.gPad.GetUymax()
74
75 lhcEmit1Data = (lhcEmit1-minEmittance)/(maxEmittance-minEmittance)*(hmax-hmin)+hmin
76 gr1 = ROOTUtils.protect( ROOT.TGraph(len(lhcTime),lhcTime,lhcEmit1Data) )
77 gr1.SetMarkerColor(4)
78 gr1.SetLineColor(4)
79 gr1.SetMarkerStyle(25)
80 gr1.Draw('PSAME')
81 #gr1.Draw('PLSAME')
82
83 lhcEmit2Data = (lhcEmit2-minEmittance)/(maxEmittance-minEmittance)*(hmax-hmin)+hmin
84 gr2 = ROOTUtils.protect( ROOT.TGraph(len(lhcTime),lhcTime,lhcEmit2Data) )
85 gr2.SetMarkerColor(4)
86 gr2.SetLineColor(4)
87 gr2.SetMarkerStyle(26)
88 gr2.Draw('PSAME')
89 #gr2.Draw('PLSAME')
90
91 raxis = ROOTUtils.protect( ROOT.TGaxis(ROOT.gPad.GetUxmax(),hmin,ROOT.gPad.GetUxmax(),hmax,minEmittance,maxEmittance,510,'+L') )
92 raxis.SetLineColor(4)
93 raxis.SetTitle('Invariant Emittance (#mum rad)')
94 raxis.SetTitleColor(4)
95 raxis.SetTitleSize(0.05)
96 raxis.SetTextFont(42)
97 raxis.SetLabelFont(42)
98 raxis.SetLabelSize(0.05)
99 raxis.SetLabelColor(4)
100 raxis.Draw()
101 return [(gr1,'Emittance beam 1','P'),(gr2,'Emittance beam 2','P')]
102
103
104#
105# Plots and data for fill 1022
106#

◆ LHCEmittanceFill1022()

python.PlotLibrary.LHCEmittanceFill1022 ( plot = 'sigx')

Definition at line 134 of file PlotLibrary.py.

134def LHCEmittanceFill1022(plot='sigx'):
135 if plot=='sigx':
136 return LHCEmittance(fill1022TimeString,fill1022Emit1X,fill1022Emit2X,0.1,8.5)
137 if plot=='sigy':
138 return LHCEmittance(fill1022TimeString,fill1022Emit1Y,fill1022Emit2Y,0.1,8.5)
139
140
141
142#
143# Plots and data for fill 1058
144#

Variable Documentation

◆ __author__

str python.PlotLibrary.__author__ = 'Juerg Beringer'
private

Definition at line 8 of file PlotLibrary.py.

◆ __version__

str python.PlotLibrary.__version__ = '$Id $'
private

Definition at line 9 of file PlotLibrary.py.

◆ fill1022Beta1X

float python.PlotLibrary.fill1022Beta1X = 11.54

Definition at line 112 of file PlotLibrary.py.

◆ fill1022Beta1Y

float python.PlotLibrary.fill1022Beta1Y = 12.74

Definition at line 113 of file PlotLibrary.py.

◆ fill1022Beta2X

float python.PlotLibrary.fill1022Beta2X = 9.89

Definition at line 114 of file PlotLibrary.py.

◆ fill1022Beta2Y

float python.PlotLibrary.fill1022Beta2Y = 12.70

Definition at line 115 of file PlotLibrary.py.

◆ fill1022Emit1X

python.PlotLibrary.fill1022Emit1X = array([ 1.45, 1.8, 1.92, 2.0 ])

Definition at line 108 of file PlotLibrary.py.

◆ fill1022Emit1Y

python.PlotLibrary.fill1022Emit1Y = array([ 1.6, 2.1, 2.45, 2.55 ])

Definition at line 109 of file PlotLibrary.py.

◆ fill1022Emit2X

python.PlotLibrary.fill1022Emit2X = array([ 1.8, 2.27, 2.27, 2.5 ])

Definition at line 110 of file PlotLibrary.py.

◆ fill1022Emit2Y

python.PlotLibrary.fill1022Emit2Y = array([ 2.6, 4.6, 5.4, 5.8 ])

Definition at line 111 of file PlotLibrary.py.

◆ fill1022TimeString

list python.PlotLibrary.fill1022TimeString = ['Apr 4 14:27:30 2010', 'Apr 4 22:27:30 2010', 'Apr 5 3:57:30 2010','Apr 5 7:57:30 2010' ]

Definition at line 107 of file PlotLibrary.py.

◆ fill1058Beta1X

float python.PlotLibrary.fill1058Beta1X = 2.28

Definition at line 150 of file PlotLibrary.py.

◆ fill1058Beta1Y

float python.PlotLibrary.fill1058Beta1Y = 2.02

Definition at line 151 of file PlotLibrary.py.

◆ fill1058Beta2X

float python.PlotLibrary.fill1058Beta2X = 1.92

Definition at line 152 of file PlotLibrary.py.

◆ fill1058Beta2Y

float python.PlotLibrary.fill1058Beta2Y = 2.10

Definition at line 153 of file PlotLibrary.py.

◆ fill1058Emit1X

python.PlotLibrary.fill1058Emit1X = array([ 5.05, 2.6])

Definition at line 146 of file PlotLibrary.py.

◆ fill1058Emit1Y

python.PlotLibrary.fill1058Emit1Y = array([ 5.04, 2.6])

Definition at line 147 of file PlotLibrary.py.

◆ fill1058Emit2X

python.PlotLibrary.fill1058Emit2X = array([ 3.88, 2.5])

Definition at line 148 of file PlotLibrary.py.

◆ fill1058Emit2Y

python.PlotLibrary.fill1058Emit2Y = array([10.64, 4.9])

Definition at line 149 of file PlotLibrary.py.

◆ fill1058TimeString

list python.PlotLibrary.fill1058TimeString = ['Apr 25 6:03:00 2010', 'Apr 24 6:57:00 2010']

Definition at line 145 of file PlotLibrary.py.

◆ gr

python.PlotLibrary.gr = LHCBeamSpotSizeFill1022()

Definition at line 165 of file PlotLibrary.py.