CMS 3D CMS Logo

Functions
timeUnitHelper Namespace Reference

Functions

def pack (high, low)
 
def packToString (high, low)
 
def timeStamptoDate (i)
 
def timeStamptoUTC (i)
 
def unpack (i)
 
def unpackFromString (i)
 
def unpackLumiid (i)
 

Detailed Description

Some helper classes to convert conditions time units back and forth

Function Documentation

◆ pack()

def timeUnitHelper.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 3 of file timeUnitHelper.py.

3 def pack(high,low):
4  """pack high,low 32bit unsigned int to one unsigned 64bit long long
5  Note:the print value of result number may appear signed, if the sign bit is used.
6  """
7  h=high<<32
8  return (h|low)
9 

Referenced by CmsShowMainFrame.getSummaryViewWeight(), BeamSpotWorkflow.main(), reco::TrackResiduals.pack_pull(), reco::TrackResiduals.pack_residual(), packToString(), CmsShowMainFrame.setSummaryViewWeight(), L1MuGMTLFCOUDeltaEtaLUT.TheLookupFunction(), and L1MuGMTLFDeltaEtaLUT.TheLookupFunction().

◆ packToString()

def timeUnitHelper.packToString (   high,
  low 
)
pack high,low 32bit unsigned int to one unsigned 64bit long long in string format
   Note:the print value of result number may appear signed, if the sign bit is used.

Definition at line 10 of file timeUnitHelper.py.

10 def packToString(high,low):
11  """pack high,low 32bit unsigned int to one unsigned 64bit long long in string format
12  Note:the print value of result number may appear signed, if the sign bit is used.
13  """
14  fmt="%u"
15  return fmt%pack(high,low)
16 

References pack().

◆ timeStamptoDate()

def timeUnitHelper.timeStamptoDate (   i)
convert 64bit timestamp to local date in string format

Definition at line 29 of file timeUnitHelper.py.

29 def timeStamptoDate(i):
30  """convert 64bit timestamp to local date in string format
31  """
32  import time
33  return time.ctime(unpack(i)[0])
34 

References unpack().

◆ timeStamptoUTC()

def timeUnitHelper.timeStamptoUTC (   i)
convert 64bit timestamp to Universal Time in string format

Definition at line 35 of file timeUnitHelper.py.

35 def timeStamptoUTC(i):
36  """convert 64bit timestamp to Universal Time in string format
37  """
38  t=unpack(i)[0]
39  import time
40  return time.strftime("%a, %d %b %Y %H:%M:%S +0000",time.gmtime(t))
41 

References unpack().

◆ unpack()

def timeUnitHelper.unpack (   i)
unpack 64bit unsigned long long into 2 32bit unsigned int, return tuple (high,low)

Definition at line 17 of file timeUnitHelper.py.

17 def unpack(i):
18  """unpack 64bit unsigned long long into 2 32bit unsigned int, return tuple (high,low)
19  """
20  high=i>>32
21  low=i&0xFFFFFFFF
22  return(high,low)
23 

References mathSSE.return().

Referenced by timeStamptoDate(), timeStamptoUTC(), unpackFromString(), and unpackLumiid().

◆ unpackFromString()

def timeUnitHelper.unpackFromString (   i)
unpack 64bit unsigned long long in string format into 2 32bit unsigned int, return tuple(high,low)

Definition at line 24 of file timeUnitHelper.py.

24 def unpackFromString(i):
25  """unpack 64bit unsigned long long in string format into 2 32bit unsigned int, return tuple(high,low)
26  """
27  return unpack(int(i))
28 

References createfilelist.int, and unpack().

◆ unpackLumiid()

def timeUnitHelper.unpackLumiid (   i)
unpack 64bit lumiid to dictionary {'run','lumisection'}

Definition at line 42 of file timeUnitHelper.py.

42 def unpackLumiid(i):
43  """unpack 64bit lumiid to dictionary {'run','lumisection'}
44  """
45  j=unpack(i)
46  return {'run':j[0],'lumisection':j[1]}

References unpack().

Referenced by uploader.main(), and BeamSpotWorkflow.main().

timeUnitHelper.timeStamptoUTC
def timeStamptoUTC(i)
Definition: timeUnitHelper.py:35
mathSSE::return
return((rh ^ lh) &mask)
timeUnitHelper.unpackFromString
def unpackFromString(i)
Definition: timeUnitHelper.py:24
timeUnitHelper.timeStamptoDate
def timeStamptoDate(i)
Definition: timeUnitHelper.py:29
createfilelist.int
int
Definition: createfilelist.py:10
timeUnitHelper.unpack
def unpack(i)
Definition: timeUnitHelper.py:17
timeUnitHelper.pack
def pack(high, low)
Definition: timeUnitHelper.py:3
timeUnitHelper.packToString
def packToString(high, low)
Definition: timeUnitHelper.py:10
timeUnitHelper.unpackLumiid
def unpackLumiid(i)
Definition: timeUnitHelper.py:42