Exemple #1
0
def dumpXML(db,tag,since,filename='dump.xml'):
    '''Dump record in XML format for a given tag '''
    try :
       iov = inspect.Iov(db,tag)
       token = getToken(db,tag,since)       
       payload=inspect.PayLoad(db,token)
       out = open(filename,'w')
       print >> out, payload
      
    except Exception,er :
        print er
Exemple #2
0
def plot (db, tag,since,filename='plot.root'):
    '''Invoke the plot function from the wrapper and save to the specified \
       file. The file format will reflect the extension given.'''
    
    try :
        iov = inspect.Iov(db,tag)
        iovlist = iov.list()
        token = getToken(db,tag,since)       
        payload=inspect.PayLoad(db,token)
        payload.plot(filename,"",[],[])
            
    except Exception,er :
        print er
Exemple #3
0
def dumpXML(db, tag, since, filename='dump.xml'):
    '''Dump record in XML format for a given tag '''
    try:
        iov = inspect.Iov(db, tag)
        db.startReadOnlyTransaction()
        Plug = __import__(str(db.payloadModules(tag)[0]))
        payload = Plug.Object(db)
        listOfIovElem = [iovElem for iovElem in db.iov(tag).elements]
        inst = 0
        for elem in db.iov(tag).elements:
            inst = inst + 1
            if str(elem.since()) == str(since):
                found = inst
                break
        db.commitTransaction()
        payload = inspect.PayLoad(db, tag, elem)
        out = open(filename, 'w')
        print(payload, file=out)

    except Exception as er:
        print(" dumpXML exception ", er)
Exemple #4
0
def plot(db, tag, since, filename='plot.root'):
    '''Invoke the plot function from the wrapper and save to the specified \
       file. The file format will reflect the extension given.'''

    try:
        iov = inspect.Iov(db, tag)
        db.startReadOnlyTransaction()
        Plug = __import__(str(db.payloadModules(tag)[0]))
        payload = Plug.Object(db)
        listOfIovElem = [iovElem for iovElem in db.iov(tag).elements]
        inst = 0
        for elem in db.iov(tag).elements:
            inst = inst + 1
            if str(elem.since()) == str(since):
                found = inst
                break
        db.commitTransaction()
        payload = inspect.PayLoad(db, tag, elem)
        payload.plot(filename, "", [], [])

    except Exception as er:
        print(" plot exception ", er)
Exemple #5
0
if do_list_tags:
    tags = db.allTags()
    for tag in tags.split():
        print tag
    sys.exit(0)

try:
    iov = inspect.Iov(db, tag)
    print "===iov list ==="
    iovlist = iov.list()
    print iovlist
    print "===iov summaries ==="
    print iov.summaries()
    print "===payload dump ==="
    for p in iovlist:
        payload = inspect.PayLoad(db, p[0])
        #print payload.summary()
        if dump_to_file:
            print "Dumping to file:", outfile
            out = open(outfile, "w")
            print >> out, payload
        else:
            #print payload
            if drawmap:
                payload.plot("plot", "", [], [])

    if do_plot:
        exec('import ' + db.moduleName(tag) + ' as Plug')
        #what = {'how':'singleChannel','which': [0,1,2]}
        what = {'how': 'barrel'}
        w = setWhat(Plug.What(), what)
Exemple #6
0
ans = {'which':[0,2,12],'quantity':[0]}
iov = inspect.Iov(db,tag)
print iov.trend(ans)
ans = {'which':[0,2,12],'quantity':[1]}
print iov.trend(ans)
ans = {'which':[0,2,12],'quantity':[0,1]}
print iov.trend(ans)




# tag = tags.split()[0]

token = log.payloadToken

p = inspect.PayLoad(db,token)
print p

p=0

p = db.payLoad(token)
o = Plug.Object(p)
o.summary()
o.dump()
o=0

tag = tags.split()[0]
iov = inspect.Iov(db,tag)
iov.summaries()
iov.trend("",[0,2,12])