Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
import FWCore.ParameterSet.Config as cms
import sys,os

arguments=sys.argv
sqlitename="ctppspixgain.db"
tagname="CTPPSPixelGainCalibrations_test"
runnumber=1
outfile="output.root"
if len(arguments)<3:
    print ("using defaults")
    print ("usage: cmsRun retrieve_sqlite_PixGainCalib_cfg.py "+sqlitename+" "+ tagname+" "+str(runnumber)+" "+outfile)
else:
    sqlitename = arguments[2]
    if len(arguments)>3: tagname= arguments[3]
    if len(arguments)>4: runnumber=int(arguments[4])
    if len(arguments)>5: outfile=arguments[5]

process = cms.Process("ProcessOne")

process.source = cms.Source("EmptyIOVSource",
    timetype = cms.string('runnumber'),
    firstValue = cms.uint64(runnumber),
    lastValue = cms.uint64(runnumber),
    interval = cms.uint64(1)
)

#Database output service
process.load("CondCore.CondDB.CondDB_cfi")

# input database (in this case local sqlite file)
process.CondDB.connect = 'sqlite_file:'+sqlitename


process.PoolDBESSource = cms.ESSource("PoolDBESSource",
    process.CondDB,
    DumpStat=cms.untracked.bool(True),
    toGet = cms.VPSet(cms.PSet(
        record = cms.string('CTPPSPixelGainCalibrationsRcd'),
        tag = cms.string(tagname)
    )),
)



process.myprodtest = cms.EDAnalyzer("CTPPSPixGainCalibsESAnalyzer",
                                    outputrootfile=cms.untracked.string(outfile)
                                    )

process.p = cms.Path(process.myprodtest)