CMS 3D CMS Logo

Public Member Functions | Private Attributes

iovInspector::Iov Class Reference

List of all members.

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

 __db
 __me
 __modName
 __tag

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.

00060                                                                     :
00061            self.__db = db
00062            self.__tag = tag
00063            self.__db.startReadOnlyTransaction()
00064            try : 
00065                self.__modName = str(db.payloadModules(tag)[0])
00066                Plug = __import__(self.__modName)
00067            except RuntimeError :
00068                self.__modName = 0
00069 
00070            myDB =  db.iov(tag)
00071            self.__me = db.iov(tag)
00072            if (till) : self.__me = myDB.range(since,till)
00073            if (head) : self.__me = myDB.rangeHead(sinte, till, head)
00074            if (tail) : self.__me = myDB.rangeTail(since, till, tail)
00075            self.__db.commitTransaction()


Member Function Documentation

def iovInspector::Iov::comment (   self)

Definition at line 146 of file iovInspector.py.

00147                         :
           return self.__me.comment()
def iovInspector::Iov::list (   self)

Definition at line 76 of file iovInspector.py.

00077                       :
00078            ret = []
00079            for elem in self.__me.elements :
00080                ret.append( (elem.payloadToken(), elem.since(), elem.till(),0))
00081            return ret
    
def iovInspector::Iov::payLoad (   self,
  since 
)

Definition at line 154 of file iovInspector.py.

00155                                :
00156            listOfIovElem= [iovElem for iovElem in self.__me.elements if iovElem.since() == since]
00157            IOVElem = listOfIovElem[0]
00158            self.__db.startReadOnlyTransaction()
00159            Plug = __import__(self.__modName)
00160            payload = Plug.Object(self.__db)
00161            payload.load(IOVElem)
00162            self.__db.commitTransaction()
00163            #print payload
00164            return payload
00165               
              
def iovInspector::Iov::payloadClasses (   self)

Definition at line 152 of file iovInspector.py.

00153                                :
           return list(self.__me.payloadClasses())
def iovInspector::Iov::payloadSummaries (   self)

Definition at line 82 of file iovInspector.py.

00083                                  :
00084            ret = []
00085            self.__db.startReadOnlyTransaction()
00086            Plug = __import__(self.__modName)
00087            payload = Plug.Object(self.__db)
00088            for elem in self.__me.elements:
00089               payloadtoken=elem.payloadToken()
00090               payload.load(elem)
00091               ret.append(payload.summary())
00092            self.__db.commitTransaction()
00093            return ret
           
def iovInspector::Iov::revision (   self)

Definition at line 148 of file iovInspector.py.

00149                          :
           return self.__me.revision()
def iovInspector::Iov::summaries (   self)

Definition at line 94 of file iovInspector.py.

00095                            :
00096            if (self.__modName==0) : return ["no plugin for "  + self.__tag+" no summaries"]
00097            self.__db.startReadOnlyTransaction()
00098            Plug = __import__(self.__modName)
00099            ret = []
00100            p = Plug.Object(self.__db)
00101            for elem in self.__me.elements :
00102                p.load(elem)
00103                ret.append( (elem.payloadToken(), elem.since(), elem.till(), p.summary()))
00104            self.__db.commitTransaction()
00105            return ret
           
def iovInspector::Iov::timestamp (   self)

Definition at line 150 of file iovInspector.py.

00151                           :
           return  CondDB.unpackTime(self.__me.timestamp())
def iovInspector::Iov::timetype (   self)

Definition at line 144 of file iovInspector.py.

00145                          :
           return  self.__me.timetype()
def iovInspector::Iov::trend (   self,
  what 
)

Definition at line 106 of file iovInspector.py.

00107                              :
00108            if (self.__modName==0) : return ["no plugin for "  + self.__tag+" no trend"]
00109            self.__db.startReadOnlyTransaction()
00110            Plug = __import__(self.__modName)
00111            ret = []
00112            w = setWhat(Plug.What(),what)
00113            ex = Plug.Extractor(w)
00114            p = Plug.Object(self.__db)
00115            for elem in self.__me.elements :
00116                p.load(elem)
00117                p.extract(ex)
00118                v = [i for i in ex.values()]
00119                ret.append((elem.since(),elem.till(),v))
00120            self.__db.commitTransaction()
00121            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 122 of file iovInspector.py.

00123                                                 :
00124            '''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
00125            '''
00126            if (self.__modName==0) : return ["no plugin for "  + self.__tag+" no trend"]
00127            self.__db.startReadOnlyTransaction()
00128            Plug = __import__(self.__modName)
00129            ret = []
00130            w = setWhat(Plug.What(),what)
00131            ex = Plug.Extractor(w)
00132 
00133            p = Plug.Object(self.__db)
00134            for elem in self.__me.elements :
00135                   since = elem.since()
00136                   till = elem.till()
00137                   if (head < since < tail) or (since < head < till) or (since < tail < till):
00138                          p.load(elem)
00139                          p.extract(ex)
00140                          v = [i for i in ex.values()]
00141                          ret.append((elem.since(),elem.till(),v))
00142            self.__db.commitTransaction()
00143            return ret
    

Member Data Documentation

Definition at line 59 of file iovInspector.py.

Definition at line 59 of file iovInspector.py.

Definition at line 59 of file iovInspector.py.

Definition at line 59 of file iovInspector.py.