test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
lumiParameters.py
Go to the documentation of this file.
1 class ParametersObject (object):
2  '''
3  collection of constants used in lumi related calculation
4  '''
5  def __init__ (self):
6  self.NBX = 3564 # number beam crossings
7  self.numorbit = 2**18 # 262144
8  self.rotationRate = 11245.613 # for 3.5 TeV Beam energy
9  self.rotationTime = 1 / self.rotationRate
11  ##self.minBiasXsec = 71300 # unit: microbarn
12 
13 
14  def setRotationRate(self,rate):
15  '''
16  update the default LHC orbit frequency
17  Single beam energy of 450GeV: 11245.589
18  Single beam energy of 3.5TeV: 11245.613
19  '''
20  self.rotationRate =rate
21 
22  def setNumOrbit(self,numorbit):
23  self.numorbit=numorbit
24 
25  def setNumBx(self,numbx):
26  '''
27  update the default number of BX
28  '''
29  self.NBX = numbx
30 
32  '''Given the rotation rate, calculate lumi section length and
33  rotation time. This should be called if rotationRate is
34  updated.
35  '''
36  self.rotationTime = 1 / self.rotationRate
37  self.lumiSectionLen = self.numorbit * self.rotationTime
38 
39  def lslengthsec(self):
40  '''
41  Calculate lslength in sec from number of orbit and BX
42  '''
43  return self.lumiSectionLen
44 
45 #=======================================================
46 # Unit Test
47 #=======================================================
48 if __name__ == "__main__":
50  print p.lslengthsec()
51  print p.NBX
52  print p.numorbit
53