CMS 3D CMS Logo

Classes | Functions | Variables
getBeamSpotDB Namespace Reference

Classes

class  ParsingError
 

Functions

def exit (msg="")
 
def nonzero (self)
 
def pack (high, low)
 
def parse (docstring, arglist=None)
 
def unpack (i)
 
def unpackLumiid (i)
 

Variables

 args
 
 atag
 
 auth
 
 cmd
 
 destDB
 
 globaltag
 
 iov_since
 
 iov_till
 
 lumi
 
 option
 
 optionstring
 
 outcmd
 
 outtext
 
 readdb_out
 READ. More...
 
 rnewfile
 
 run
 
 status_rDB
 
 tagname
 
 USAGE
 

Function Documentation

def getBeamSpotDB.exit (   msg = "")

Definition at line 53 of file getBeamSpotDB.py.

53 def exit(msg=""):
54  raise SystemExit(msg or optionstring.replace("%prog",sys.argv[0]))
55 
def exit(msg="")
def getBeamSpotDB.nonzero (   self)

Definition at line 41 of file getBeamSpotDB.py.

41 def nonzero(self): # will become the nonzero method of optparse.Values
42  "True if options were given"
43  for v in self.__dict__.itervalues():
44  if v is not None: return True
45  return False
46 
47 optparse.Values.__nonzero__ = nonzero # dynamically fix optparse.Values
48 
def nonzero(self)
def getBeamSpotDB.pack (   high,
  low 
)
pack high,low 32bit unsigned int to one unsigned 64bit long long
   Note:the print value of result number may appear signed, if the sign bit is used.

Definition at line 81 of file getBeamSpotDB.py.

81 def pack(high,low):
82  """pack high,low 32bit unsigned int to one unsigned 64bit long long
83  Note:the print value of result number may appear signed, if the sign bit is used.
84  """
85  h=high<<32
86  return (h|low)
87 
def pack(high, low)
def getBeamSpotDB.parse (   docstring,
  arglist = None 
)

Definition at line 56 of file getBeamSpotDB.py.

56 def parse(docstring, arglist=None):
57  global optionstring
58  optionstring = docstring
59  match = USAGE.search(optionstring)
60  if not match: raise ParsingError("Cannot find the option string")
61  optlines = match.group(1).splitlines()
62  try:
63  p = optparse.OptionParser(optlines[0])
64  for line in optlines[1:]:
65  opt, help=line.split(':')[:2]
66  short,long=opt.split(',')[:2]
67  if '=' in opt:
68  action='store'
69  long=long.split('=')[0]
70  else:
71  action='store_true'
72  p.add_option(short.strip(),long.strip(),
73  action = action, help = help.strip())
74  except (IndexError,ValueError):
75  raise ParsingError("Cannot parse the option string correctly")
76  return p.parse_args(arglist)
77 
78 
79 
80 # lumi tools CondCore/Utilities/python/timeUnitHelper.py
def parse(docstring, arglist=None)
def getBeamSpotDB.unpack (   i)
unpack 64bit unsigned long long into 2 32bit unsigned int, return tuple (high,low)

Definition at line 88 of file getBeamSpotDB.py.

References reco.return().

Referenced by unpackLumiid().

88 def unpack(i):
89  """unpack 64bit unsigned long long into 2 32bit unsigned int, return tuple (high,low)
90  """
91  high=i>>32
92  low=i&0xFFFFFFFF
93  return(high,low)
94 
return(e1-e2)*(e1-e2)+dp *dp
def getBeamSpotDB.unpackLumiid (   i)
unpack 64bit lumiid to dictionary {'run','lumisection'}

Definition at line 95 of file getBeamSpotDB.py.

References unpack().

95 def unpackLumiid(i):
96  """unpack 64bit lumiid to dictionary {'run','lumisection'}
97  """
98  j=unpack(i)
99  return {'run':j[0],'lumisection':j[1]}
100 
101 
def unpackLumiid(i)

Variable Documentation

getBeamSpotDB.args

Definition at line 107 of file getBeamSpotDB.py.

getBeamSpotDB.atag
getBeamSpotDB.auth

Definition at line 133 of file getBeamSpotDB.py.

getBeamSpotDB.cmd

Definition at line 120 of file getBeamSpotDB.py.

getBeamSpotDB.destDB

Definition at line 129 of file getBeamSpotDB.py.

getBeamSpotDB.globaltag

Definition at line 111 of file getBeamSpotDB.py.

getBeamSpotDB.iov_since

Definition at line 127 of file getBeamSpotDB.py.

getBeamSpotDB.iov_till

Definition at line 128 of file getBeamSpotDB.py.

getBeamSpotDB.lumi

Definition at line 140 of file getBeamSpotDB.py.

getBeamSpotDB.option

Definition at line 107 of file getBeamSpotDB.py.

getBeamSpotDB.optionstring

Definition at line 51 of file getBeamSpotDB.py.

getBeamSpotDB.outcmd

Definition at line 121 of file getBeamSpotDB.py.

getBeamSpotDB.outtext

Definition at line 204 of file getBeamSpotDB.py.

getBeamSpotDB.readdb_out

READ.

Definition at line 151 of file getBeamSpotDB.py.

getBeamSpotDB.rnewfile

Definition at line 153 of file getBeamSpotDB.py.

getBeamSpotDB.run

Definition at line 137 of file getBeamSpotDB.py.

getBeamSpotDB.status_rDB

Definition at line 202 of file getBeamSpotDB.py.

getBeamSpotDB.tagname

Definition at line 110 of file getBeamSpotDB.py.

getBeamSpotDB.USAGE

Definition at line 39 of file getBeamSpotDB.py.