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

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.

Referenced by pat::MET::PackedMETUncertainty.add(), CmsShowMainFrame.getSummaryViewWeight(), BeamSpotWorkflow.main(), reco::TrackResiduals.pack_pull(), reco::TrackResiduals.pack_residual(), pat::MET::PackedMETUncertainty.PackedMETUncertainty(), packToString(), omtf::RpcPacker.RpcPacker(), pat::MET::PackedMETUncertainty.set(), CmsShowMainFrame.setSummaryViewWeight(), L1MuGMTLFDeltaEtaLUT.TheLookupFunction(), and L1MuGMTLFCOUDeltaEtaLUT.TheLookupFunction().

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 
def pack(high, low)
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.

References pack().

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 
def pack(high, low)
def packToString(high, low)
def timeUnitHelper.timeStamptoDate (   i)
convert 64bit timestamp to local date in string format

Definition at line 29 of file timeUnitHelper.py.

References unpack().

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

Definition at line 35 of file timeUnitHelper.py.

References unpack().

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 
def timeStamptoUTC(i)
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.

References mathSSE.return().

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

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 
return((rh^lh)&mask)
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.

References createfilelist.int, and unpack().

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 
def unpackFromString(i)
def timeUnitHelper.unpackLumiid (   i)
unpack 64bit lumiid to dictionary {'run','lumisection'}

Definition at line 42 of file timeUnitHelper.py.

References unpack().

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

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]}
47