Skip to content

Commit

Permalink
Merge pull request #1197 from argiro/condtools
Browse files Browse the repository at this point in the history
DB updates -- adjust to new interface, remove obsolete externals (element tree).
  • Loading branch information
ktf committed Oct 28, 2013
2 parents 3cffb64 + 68dd433 commit edff3dd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions CondTools/Ecal/python/EcalCondDB.py
Expand Up @@ -21,7 +21,7 @@ def usage():
print "Specify short options as '-o foo', long options as '--option=foo'"
print
print " -c, --connect= [connectstring]"
print " specify database, default oracle://cms_orcoff_prod/CMS_COND_31X_ECAL"
print " specify database, default frontier://FrontierProd/CMS_COND_31X_ECAL"
print
print " -P, --authpath= [authenticationpath], default /afs/cern.ch/cms/DB/conddb "
print
Expand All @@ -39,7 +39,7 @@ def usage():
print " Example EcalCondDB.py -t tag"
print
print " -d, --dump= [file] dump record to xml file"
print " Example EcalCondDB.py -d=file.xml -t tag -s since"
print " Example EcalCondDB.py -d file.xml -t tag -s since"
print
print " -p, --plot= [file] plot record to file, extension specifies ",\
"format (.root,.png,.jpg,.gif,.svg)"
Expand Down Expand Up @@ -73,7 +73,7 @@ def usage():
print ex," , use -h or --help for help"
sys.exit(0)

dbName = "oracle://cms_orcoff_prod/CMS_COND_31X_ECAL"
dbName = "frontier://FrontierProd/CMS_COND_31X_ECAL"
authpath= "/afs/cern.ch/cms/DB/conddb"

tags=[]
Expand Down Expand Up @@ -148,7 +148,7 @@ def usage():
a = FWIncantation()

rdbms = RDBMS(authpath)
db = rdbms.getDB(dbName)
db = rdbms.getReadOnlyDB(dbName)

import EcalCondTools

Expand Down
14 changes: 7 additions & 7 deletions CondTools/Ecal/python/EcalCondTools.py
@@ -1,7 +1,7 @@
#
# Misc functions to manipulate Ecal records
# author: Stefano Argiro
# id: $Id: EcalCondTools.py,v 1.12 2009/11/03 17:40:07 yma Exp $
# id: $Id: EcalCondTools.py,v 1.14 2013/05/06 08:29:44 argiro Exp $
#
#
# WARNING: we assume that the list of iovs for a given tag
Expand All @@ -18,7 +18,7 @@
def listTags(db):
'''List all available tags for a given db '''
try:
db.startTransaction()
db.startReadOnlyTransaction()
tags = db.allTags()
db.commitTransaction()
for tag in tags.split():
Expand All @@ -43,7 +43,7 @@ def dumpXML(db,tag,since,filename='dump.xml'):
'''Dump record in XML format for a given tag '''
try :
iov = inspect.Iov(db,tag)
db.startTransaction()
db.startReadOnlyTransaction()
Plug = __import__(str(db.payloadModules(tag)[0]))
payload = Plug.Object(db)
listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
Expand All @@ -67,7 +67,7 @@ def plot (db, tag,since,filename='plot.root'):

try :
iov = inspect.Iov(db,tag)
db.startTransaction()
db.startReadOnlyTransaction()
Plug = __import__(str(db.payloadModules(tag)[0]))
payload = Plug.Object(db)
listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
Expand Down Expand Up @@ -100,7 +100,7 @@ def compare(tag1,db1,since1,
if tag1.find(".xml") < 0:
found=0
try:
db1.startTransaction()
db1.startReadOnlyTransaction()
Plug = __import__(str(db1.payloadModules(tag1)[0]))
payload = Plug.Object(db1)
listOfIovElem= [iovElem for iovElem in db1.iov(tag1).elements]
Expand Down Expand Up @@ -135,7 +135,7 @@ def compare(tag1,db1,since1,
if tag2.find(".xml")<0:
found=0
try:
db2.startTransaction()
db2.startReadOnlyTransaction()
Plug = __import__(str(db2.payloadModules(tag2)[0]))
what = {'how':'barrel'}
w = inspect.setWhat(Plug.What(),what)
Expand Down Expand Up @@ -242,7 +242,7 @@ def histo (db, tag,since,filename='histo.root'):
found=0
try:
# exec('import '+db.moduleName(tag)+' as Plug')
db.startTransaction()
db.startReadOnlyTransaction()
Plug = __import__(str(db.payloadModules(tag)[0]))
payload = Plug.Object(db)
listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
Expand Down
4 changes: 2 additions & 2 deletions CondTools/Ecal/scripts/loadConditions.py
Expand Up @@ -9,7 +9,7 @@

import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
from elementtree.ElementTree import parse
from xml.etree.ElementTree import parse
import sys,os


Expand Down Expand Up @@ -74,7 +74,7 @@ def readTagAndSince(filename, headertag='EcalCondHeader'):
'EcalChannelStatus':'EcalChannelStatusAnalyzer', \
'EcalTBWeights':'EcalTBWeightsAnalyzer', \
'EcalIntercalibConstants':'EcalIntercalibConstantsAnalyzer', \
'EcalIntercalibConstantsMC':'EcalIntercalibConstantsMCAnalyzer', \
'EcalIntercalibConstantsMC':'EcalIntercalibConstantsMCAnalyzer', \
'EcalIntercalibErrors':'EcalIntercalibErrorsAnalyzer'
}

Expand Down

0 comments on commit edff3dd

Please sign in to comment.