test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
iovInspector.Iov Class Reference

Public Member Functions

def __init__
 
def comment
 
def list
 
def payLoad
 
def payloadClasses
 
def payloadSummaries
 
def revision
 
def summaries
 
def timestamp
 
def timetype
 
def trend
 
def trendinrange
 

Private Attributes

 __comment
 
 __db
 
 __me
 
 __modName
 
 __payloadClasses
 
 __revision
 
 __tag
 
 __timestamp
 
 __timetype
 

Detailed Description

Definition at line 58 of file iovInspector.py.

Constructor & Destructor Documentation

def iovInspector.Iov.__init__ (   self,
  db,
  tag,
  since = 0,
  till = 0,
  head = 0,
  tail = 0 
)

Definition at line 59 of file iovInspector.py.

59 
60  def __init__(self, db, tag, since=0, till=0, head=0, tail=0) :
61  self.__db = db
62  self.__tag = tag
63  self.__db.startReadOnlyTransaction()
64  try :
65  self.__modName = str(db.payloadModules(tag)[0])
66  Plug = __import__(self.__modName)
67  except RuntimeError :
68  self.__modName = 0
69  iov = db.iov(tag)
70  #the __me data member is always an IOVRange
71  #the IOVSequence is used in the ctor only
72  self.__me = iov.range(iov.firstSince(), iov.lastTill())
73  if (till) : self.__me = iov.range(since,till)
74  if (head) : self.__me = iov.head(head)
75  if (tail) : self.__me = iov.tail(tail)
76  self.__timetype = iov.timetype()
77  self.__comment = iov.comment()
78  self.__revision = iov.revision()
79  self.__timestamp = CondDB.unpackTime(iov.timestamp())
80  self.__payloadClasses = list(iov.payloadClasses())
81  self.__db.commitTransaction()

Member Function Documentation

def iovInspector.Iov.comment (   self)

Definition at line 152 of file iovInspector.py.

References iovInspector.Iov.__comment.

153  def comment(self):
return self.__comment
def iovInspector.Iov.list (   self)

Definition at line 82 of file iovInspector.py.

82 
83  def list(self) :
84  ret = []
85  for elem in self.__me.elements :
86  ret.append( (elem.payloadToken(), elem.since(), elem.till(),0))
87  return ret
def iovInspector.Iov.payLoad (   self,
  since 
)

Definition at line 160 of file iovInspector.py.

References iovInspector.Iov.__db, and iovInspector.Iov.__modName.

161  def payLoad(self, since):
162  listOfIovElem= [iovElem for iovElem in self.__me.elements if iovElem.since() == since]
163  IOVElem = listOfIovElem[0]
164  self.__db.startReadOnlyTransaction()
165  Plug = __import__(self.__modName)
166  payload = Plug.Object(self.__db)
167  payload.load(IOVElem)
168  self.__db.commitTransaction()
169  #print payload
170  return payload
171 
def iovInspector.Iov.payloadClasses (   self)

Definition at line 158 of file iovInspector.py.

References iovInspector.Iov.__payloadClasses.

159  def payloadClasses(self):
return self.__payloadClasses
def iovInspector.Iov.payloadSummaries (   self)

Definition at line 88 of file iovInspector.py.

References iovInspector.Iov.__db, and iovInspector.Iov.__modName.

88 
89  def payloadSummaries(self):
90  ret = []
91  self.__db.startReadOnlyTransaction()
92  Plug = __import__(self.__modName)
93  payload = Plug.Object(self.__db)
94  for elem in self.__me.elements:
95  payloadtoken=elem.payloadToken()
96  payload.load(elem)
97  ret.append(payload.summary())
98  self.__db.commitTransaction()
99  return ret
def iovInspector.Iov.revision (   self)

Definition at line 154 of file iovInspector.py.

References iovInspector.Iov.__revision.

155  def revision(self):
return self.__revision
def iovInspector.Iov.summaries (   self)

Definition at line 100 of file iovInspector.py.

References iovInspector.Iov.__db, iovInspector.Iov.__modName, and iovInspector.Iov.__tag.

101  def summaries(self) :
102  if (self.__modName==0) : return ["no plugin for " + self.__tag+" no summaries"]
103  self.__db.startReadOnlyTransaction()
104  Plug = __import__(self.__modName)
105  ret = []
106  p = Plug.Object(self.__db)
107  for elem in self.__me.elements :
108  p.load(elem)
109  ret.append( (elem.payloadToken(), elem.since(), elem.till(), p.summary()))
110  self.__db.commitTransaction()
111  return ret
def iovInspector.Iov.timestamp (   self)

Definition at line 156 of file iovInspector.py.

References iovInspector.Iov.__timestamp.

157  def timestamp(self):
return self.__timestamp
def iovInspector.Iov.timetype (   self)

Definition at line 150 of file iovInspector.py.

References iovInspector.Iov.__timetype.

151  def timetype(self):
return self.__timetype
def iovInspector.Iov.trend (   self,
  what 
)

Definition at line 112 of file iovInspector.py.

References iovInspector.Iov.__db, iovInspector.Iov.__modName, iovInspector.Iov.__tag, and iovInspector.setWhat().

113  def trend(self, what) :
114  if (self.__modName==0) : return ["no plugin for " + self.__tag+" no trend"]
115  self.__db.startReadOnlyTransaction()
116  Plug = __import__(self.__modName)
117  ret = []
118  w = setWhat(Plug.What(),what)
119  ex = Plug.Extractor(w)
120  p = Plug.Object(self.__db)
121  for elem in self.__me.elements :
122  p.load(elem)
123  p.extract(ex)
124  v = [i for i in ex.values()]
125  ret.append((elem.since(),elem.till(),v))
126  self.__db.commitTransaction()
127  return ret
def iovInspector.Iov.trendinrange (   self,
  what,
  head,
  tail 
)
extract trend in the given range. the input parameters are in 64bit integer format. Users should pack the timestamp or lumiid before calling this method

Definition at line 128 of file iovInspector.py.

References iovInspector.Iov.__db, iovInspector.Iov.__modName, iovInspector.Iov.__tag, and iovInspector.setWhat().

129  def trendinrange(self, what, head, tail) :
130  '''extract trend in the given range. the input parameters are in 64bit integer format. Users should pack the timestamp or lumiid before calling this method
131  '''
132  if (self.__modName==0) : return ["no plugin for " + self.__tag+" no trend"]
133  self.__db.startReadOnlyTransaction()
134  Plug = __import__(self.__modName)
135  ret = []
136  w = setWhat(Plug.What(),what)
137  ex = Plug.Extractor(w)
138 
139  p = Plug.Object(self.__db)
140  for elem in self.__me.elements :
141  since = elem.since()
142  till = elem.till()
143  if (head < since < tail) or (since < head < till) or (since < tail < till):
144  p.load(elem)
145  p.extract(ex)
146  v = [i for i in ex.values()]
147  ret.append((elem.since(),elem.till(),v))
148  self.__db.commitTransaction()
149  return ret

Member Data Documentation

iovInspector.Iov.__comment
private

Definition at line 76 of file iovInspector.py.

Referenced by iovInspector.Iov.comment().

iovInspector.Iov.__db
private

Definition at line 60 of file iovInspector.py.

Referenced by iovInspector.Iov.payLoad(), iovInspector.Iov.payloadSummaries(), iovInspector.Iov.summaries(), iovInspector.Iov.trend(), and iovInspector.Iov.trendinrange().

iovInspector.Iov.__me
private

Definition at line 71 of file iovInspector.py.

Referenced by iovInspector.PayLoad.object().

iovInspector.Iov.__modName
private

Definition at line 64 of file iovInspector.py.

Referenced by iovInspector.Iov.payLoad(), iovInspector.Iov.payloadSummaries(), iovInspector.Iov.summaries(), iovInspector.Iov.trend(), and iovInspector.Iov.trendinrange().

iovInspector.Iov.__payloadClasses
private

Definition at line 79 of file iovInspector.py.

Referenced by iovInspector.Iov.payloadClasses().

iovInspector.Iov.__revision
private

Definition at line 77 of file iovInspector.py.

Referenced by iovInspector.Iov.revision().

iovInspector.Iov.__tag
private

Definition at line 61 of file iovInspector.py.

Referenced by iovInspector.Iov.summaries(), iovInspector.Iov.trend(), and iovInspector.Iov.trendinrange().

iovInspector.Iov.__timestamp
private

Definition at line 78 of file iovInspector.py.

Referenced by iovInspector.Iov.timestamp().

iovInspector.Iov.__timetype
private

Definition at line 75 of file iovInspector.py.

Referenced by iovInspector.Iov.timetype().