7 import pluginCondDBPyInterface
as CondDB
15 _atts = (att
for att
in dir(self.
__me)
if not (att[0]==
'_' or att[0:4]==
'set_' or att[0:6]==
'descr_'))
17 exec(
'_a=_w.'+_att+
'()')
18 if (_a.__class__==CondDB.VInt):
19 if(hasattr(self.
__me,
'descr_'+_att)) :
28 self.
__ret[att]=(
'single',[val
for val
in dir(a)
if not (val[0]==
'_' or val==
'name'or val==
'values')])
32 exec(
'_d=_w.descr_'+att+
'()')
33 self.
__ret[att]=(
'multiple',[val
for val
in _d])
36 self.
__ret[att]=(
'commaSeparated',[])
40 exec(
'import '+db.moduleName(tag)+
' as Plug')
46 for key
in ret.keys():
48 if (type(_val)==type([])) :
52 exec (
'w.set_'+key+
'(_vi)')
54 exec (
'w.set_'+key+
'(w.'+key+
'().'+ret[key]+
')')
59 def __init__(self, db, tag, since=0, till=0, head=0, tail=0) :
62 self.__db.startReadOnlyTransaction()
71 self.
__me = iov.range(iov.firstSince(), iov.lastTill())
72 if (till) : self.
__me = iov.range(since,till)
73 if (head) : self.
__me = iov.head(head)
74 if (tail) : self.
__me = iov.tail(tail)
80 self.__db.commitTransaction()
84 for elem
in self.__me.elements :
85 ret.append( (elem.payloadToken(), elem.since(), elem.till(),0))
90 self.__db.startReadOnlyTransaction()
92 payload = Plug.Object(self.
__db)
93 for elem
in self.__me.elements:
94 payloadtoken=elem.payloadToken()
96 ret.append(payload.summary())
97 self.__db.commitTransaction()
101 if (self.
__modName==0) :
return [
"no plugin for " + self.
__tag+
" no summaries"]
102 self.__db.startReadOnlyTransaction()
105 p = Plug.Object(self.
__db)
106 for elem
in self.__me.elements :
108 ret.append( (elem.payloadToken(), elem.since(), elem.till(), p.summary()))
109 self.__db.commitTransaction()
113 if (self.
__modName==0) :
return [
"no plugin for " + self.
__tag+
" no trend"]
114 self.__db.startReadOnlyTransaction()
118 ex = Plug.Extractor(w)
119 p = Plug.Object(self.
__db)
120 for elem
in self.__me.elements :
123 v = [i
for i
in ex.values()]
124 ret.append((elem.since(),elem.till(),v))
125 self.__db.commitTransaction()
129 '''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 if (self.
__modName==0) :
return [
"no plugin for " + self.
__tag+
" no trend"]
132 self.__db.startReadOnlyTransaction()
136 ex = Plug.Extractor(w)
138 p = Plug.Object(self.
__db)
139 for elem
in self.__me.elements :
142 if (head < since < tail)
or (since < head < till)
or (since < tail < till):
145 v = [i
for i
in ex.values()]
146 ret.append((elem.since(),elem.till(),v))
147 self.__db.commitTransaction()
161 listOfIovElem= [iovElem
for iovElem
in self.__me.elements
if iovElem.since() == since]
162 IOVElem = listOfIovElem[0]
163 self.__db.startReadOnlyTransaction()
165 payload = Plug.Object(self.
__db)
166 payload.load(IOVElem)
167 self.__db.commitTransaction()
178 self.__db.startReadOnlyTransaction()
183 self.__db.commitTransaction()
186 return self.__me.dump()
192 return self.__me.summary()
195 return self.__me.dump()
197 def plot(self, fname, s, il, fl) :
204 return self.__me.plot(fname,s,vi,vf)
209 vs = CondDB.VString()
216 return self.__me.trend_plot(fname,s,vi,vf,vs)
222 vs = CondDB.VString()
229 return self.__me.summary_adv(s,vi,vf,vs)
234 vs = CondDB.VString()
241 return self.__me.dumpFile(fname,s,vi,vf,vs)
perl if(1 lt scalar(@::datatypes))