CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 = subprocess.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 = subprocess.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 54 of file getBeamSpotDB.py.

Referenced by unpackLumiid().

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

Definition at line 42 of file getBeamSpotDB.py.

42 
43 def nonzero(self): # will become the nonzero method of optparse.Values
44  "True if options were given"
45  for v in self.__dict__.values():
46  if v is not None: return True
47  return False
48 
49 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 82 of file getBeamSpotDB.py.

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

Definition at line 57 of file getBeamSpotDB.py.

Referenced by unpackLumiid().

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

References gpuVertexFinder.return.

Referenced by unpackLumiid().

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

Definition at line 96 of file getBeamSpotDB.py.

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

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

Variable Documentation

list getBeamSpotDB.atag = outcmd[1]

Definition at line 123 of file getBeamSpotDB.py.

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

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

Definition at line 134 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 121 of file getBeamSpotDB.py.

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

Definition at line 130 of file getBeamSpotDB.py.

getBeamSpotDB.globaltag = ''

Definition at line 112 of file getBeamSpotDB.py.

string getBeamSpotDB.iov_since = ''

Definition at line 128 of file getBeamSpotDB.py.

string getBeamSpotDB.iov_till = ''

Definition at line 129 of file getBeamSpotDB.py.

getBeamSpotDB.lumi = '1'

Definition at line 141 of file getBeamSpotDB.py.

string getBeamSpotDB.optionstring = ""

Definition at line 52 of file getBeamSpotDB.py.

tuple getBeamSpotDB.outcmd = subprocess.getstatusoutput( cmd )

Definition at line 122 of file getBeamSpotDB.py.

list getBeamSpotDB.outtext = status_rDB[1]

Definition at line 205 of file getBeamSpotDB.py.

string getBeamSpotDB.readdb_out = "readDB_"

READ.

Definition at line 152 of file getBeamSpotDB.py.

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

Definition at line 154 of file getBeamSpotDB.py.

getBeamSpotDB.run = '1'

Definition at line 138 of file getBeamSpotDB.py.

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

Definition at line 203 of file getBeamSpotDB.py.

tuple getBeamSpotDB.tagname = ''

Definition at line 111 of file getBeamSpotDB.py.

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

Definition at line 40 of file getBeamSpotDB.py.