6 A library with miscellaneous beam spot related utilities and plots.
8 __author__ =
'Juerg Beringer'
13 from time
import mktime, strptime
14 from numpy
import array
17 from InDetBeamSpotExample
import ROOTUtils
30 lhcTime =
array([ mktime(strptime(s,
'%b %d %H:%M:%S %Y'))
for s
in lhcTimeString])
34 lhcEps1 = lhcEmit1 * 1.0e-6 / betaGamma
35 lhcEps2 = lhcEmit2 * 1.0e-6 / betaGamma
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)
44 lhcSigma = 1. / sqrt(1./lhcSigmaBeam1**2 + 1./lhcSigmaBeam2**2)
45 print (
'Beam spot size (mm): ',lhcSigma)
56 return [(gr,
'Expected from #sqrt{#epsilon #beta*}',
'P')]
68 lhcTime =
array([ mktime(strptime(s,
'%b %d %H:%M:%S %Y'))
for s
in lhcTimeString])
70 ROOT.gPad.SetRightMargin(0.1)
72 hmin = ROOT.gPad.GetUymin()
73 hmax = ROOT.gPad.GetUymax()
75 lhcEmit1Data = (lhcEmit1-minEmittance)/(maxEmittance-minEmittance)*(hmax-hmin)+hmin
79 gr1.SetMarkerStyle(25)
83 lhcEmit2Data = (lhcEmit2-minEmittance)/(maxEmittance-minEmittance)*(hmax-hmin)+hmin
87 gr2.SetMarkerStyle(26)
91 raxis =
ROOTUtils.protect( ROOT.TGaxis(ROOT.gPad.GetUxmax(),hmin,ROOT.gPad.GetUxmax(),hmax,minEmittance,maxEmittance,510,
'+L') )
93 raxis.SetTitle(
'Invariant Emittance (#mum rad)')
94 raxis.SetTitleColor(4)
95 raxis.SetTitleSize(0.05)
97 raxis.SetLabelFont(42)
98 raxis.SetLabelSize(0.05)
99 raxis.SetLabelColor(4)
101 return [(gr1,
'Emittance beam 1',
'P'),(gr2,
'Emittance beam 2',
'P')]
107 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' ]
108 fill1022Emit1X =
array([ 1.45, 1.8, 1.92, 2.0 ])
109 fill1022Emit1Y =
array([ 1.6, 2.1, 2.45, 2.55 ])
110 fill1022Emit2X =
array([ 1.8, 2.27, 2.27, 2.5 ])
111 fill1022Emit2Y =
array([ 2.6, 4.6, 5.4, 5.8 ])
112 fill1022Beta1X = 11.54
113 fill1022Beta1Y = 12.74
114 fill1022Beta2X = 9.89
115 fill1022Beta2Y = 12.70
130 return LHCBeamSpotSize(fill1022TimeString,fill1022Beta1X,fill1022Emit1X,fill1022Beta2X,fill1022Emit2X)
132 return LHCBeamSpotSize(fill1022TimeString,fill1022Beta1Y,fill1022Emit1Y,fill1022Beta2Y,fill1022Emit2Y)
136 return LHCEmittance(fill1022TimeString,fill1022Emit1X,fill1022Emit2X,0.1,8.5)
138 return LHCEmittance(fill1022TimeString,fill1022Emit1Y,fill1022Emit2Y,0.1,8.5)
145 fill1058TimeString = [
'Apr 25 6:03:00 2010',
'Apr 24 6:57:00 2010']
146 fill1058Emit1X =
array([ 5.05, 2.6])
147 fill1058Emit1Y =
array([ 5.04, 2.6])
148 fill1058Emit2X =
array([ 3.88, 2.5])
149 fill1058Emit2Y =
array([10.64, 4.9])
150 fill1058Beta1X = 2.28
151 fill1058Beta1Y = 2.02
152 fill1058Beta2X = 1.92
153 fill1058Beta2Y = 2.10
157 return LHCBeamSpotSize(fill1058TimeString,fill1058Beta1X,fill1058Emit1X,fill1058Beta2X,fill1058Emit2X)
159 return LHCBeamSpotSize(fill1058TimeString,fill1058Beta1Y,fill1058Emit1Y,fill1058Beta2Y,fill1058Emit2Y)
164 if __name__ ==
'__main__':