CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
getBeamSpotDB Namespace Reference

Classes

class  ParsingError
 

Functions

def exit
 
def nonzero
 
def pack
 
def parse
 
def unpack
 
def unpackLumiid
 

Variables

list atag = outcmd[1]
 
string auth = '/afs/cern.ch/cms/DB/conddb'
 
string cmd = 'cmscond_tagtree_list -c frontier://cmsfrontier.cern.ch:8000/Frontier/CMS_COND_31X_GLOBALTAG -P /afs/cern.ch/cms/DB/conddb -T '
 
string destDB = 'frontier://PromptProd/CMS_COND_31X_BEAMSPOT'
 
string globaltag = ''
 
string iov_since = ''
 
string iov_till = ''
 
string lumi = '1'
 
string optionstring = ""
 
tuple outcmd = commands.getstatusoutput( cmd )
 
list outtext = status_rDB[1]
 
string readdb_out = "readDB_"
 READ. More...
 
tuple rnewfile = open(readdb_out,'w')
 
string run = '1'
 
tuple status_rDB = commands.getstatusoutput('cmsRun '+ readdb_out)
 
string tagname = ''
 
tuple USAGE = re.compile(r'(?s)\s*usage: (.*?)(\n[ \t]*\n|$)')
 

Function Documentation

def getBeamSpotDB.exit (   msg = "")

Definition at line 53 of file getBeamSpotDB.py.

Referenced by unpackLumiid().

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

Definition at line 41 of file getBeamSpotDB.py.

41 
42 def nonzero(self): # will become the nonzero method of optparse.Values
43  "True if options were given"
44  for v in self.__dict__.itervalues():
45  if v is not None: return True
46  return False
47 
48 optparse.Values.__nonzero__ = nonzero # dynamically fix optparse.Values
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 
82 def pack(high,low):
83  """pack high,low 32bit unsigned int to one unsigned 64bit long long
84  Note:the print value of result number may appear signed, if the sign bit is used.
85  """
86  h=high<<32
87  return (h|low)
def getBeamSpotDB.parse (   docstring,
  arglist = None 
)

Definition at line 56 of file getBeamSpotDB.py.

Referenced by unpackLumiid().

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

Referenced by unpackLumiid().

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

Definition at line 95 of file getBeamSpotDB.py.

References exit(), parse(), and unpack().

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

Variable Documentation

list getBeamSpotDB.atag = outcmd[1]

Definition at line 122 of file getBeamSpotDB.py.

Referenced by RunList.fetchGlobalRunsByLocation(), and RunList.fetchRunsByLocation().

getBeamSpotDB.auth = '/afs/cern.ch/cms/DB/conddb'

Definition at line 133 of file getBeamSpotDB.py.

string getBeamSpotDB.cmd = 'cmscond_tagtree_list -c frontier://cmsfrontier.cern.ch:8000/Frontier/CMS_COND_31X_GLOBALTAG -P /afs/cern.ch/cms/DB/conddb -T '

Definition at line 120 of file getBeamSpotDB.py.

getBeamSpotDB.destDB = 'frontier://PromptProd/CMS_COND_31X_BEAMSPOT'

Definition at line 129 of file getBeamSpotDB.py.

getBeamSpotDB.globaltag = ''

Definition at line 111 of file getBeamSpotDB.py.

string getBeamSpotDB.iov_since = ''

Definition at line 127 of file getBeamSpotDB.py.

string getBeamSpotDB.iov_till = ''

Definition at line 128 of file getBeamSpotDB.py.

getBeamSpotDB.lumi = '1'

Definition at line 140 of file getBeamSpotDB.py.

string getBeamSpotDB.optionstring = ""

Definition at line 51 of file getBeamSpotDB.py.

tuple getBeamSpotDB.outcmd = commands.getstatusoutput( cmd )

Definition at line 121 of file getBeamSpotDB.py.

list getBeamSpotDB.outtext = status_rDB[1]

Definition at line 204 of file getBeamSpotDB.py.

string getBeamSpotDB.readdb_out = "readDB_"

READ.

Definition at line 151 of file getBeamSpotDB.py.

tuple getBeamSpotDB.rnewfile = open(readdb_out,'w')

Definition at line 153 of file getBeamSpotDB.py.

getBeamSpotDB.run = '1'

Definition at line 137 of file getBeamSpotDB.py.

tuple getBeamSpotDB.status_rDB = commands.getstatusoutput('cmsRun '+ readdb_out)

Definition at line 202 of file getBeamSpotDB.py.

tuple getBeamSpotDB.tagname = ''

Definition at line 110 of file getBeamSpotDB.py.

tuple getBeamSpotDB.USAGE = re.compile(r'(?s)\s*usage: (.*?)(\n[ \t]*\n|$)')

Definition at line 39 of file getBeamSpotDB.py.