File indexing completed on 2024-04-06 12:02:44
0001 import FWCore.ParameterSet.Config as cms
0002 import sys,os
0003 from __future__ import print_function
0004
0005 arguments=sys.argv
0006 sqlitename="ctppspixgain.db"
0007 tagname="CTPPSPixelGainCalibrations_test"
0008 runnumber=1
0009 outfile="output.root"
0010 if len(arguments)<3:
0011 print ("using defaults")
0012 print ("usage: cmsRun retrieve_sqlite_PixGainCalib_cfg.py "+sqlitename+" "+ tagname+" "+str(runnumber)+" "+outfile)
0013 else:
0014 sqlitename = arguments[2]
0015 if len(arguments)>3: tagname= arguments[3]
0016 if len(arguments)>4: runnumber=int(arguments[4])
0017 if len(arguments)>5: outfile=arguments[5]
0018
0019 process = cms.Process("ProcessOne")
0020
0021 process.source = cms.Source("EmptyIOVSource",
0022 timetype = cms.string('runnumber'),
0023 firstValue = cms.uint64(runnumber),
0024 lastValue = cms.uint64(runnumber),
0025 interval = cms.uint64(1)
0026 )
0027
0028
0029 process.load("CondCore.CondDB.CondDB_cfi")
0030
0031
0032 process.CondDB.connect = 'sqlite_file:'+sqlitename
0033
0034
0035 process.PoolDBESSource = cms.ESSource("PoolDBESSource",
0036 process.CondDB,
0037 DumpStat=cms.untracked.bool(True),
0038 toGet = cms.VPSet(cms.PSet(
0039 record = cms.string('CTPPSPixelGainCalibrationsRcd'),
0040 tag = cms.string(tagname)
0041 )),
0042 )
0043
0044
0045
0046 process.myprodtest = cms.EDAnalyzer("CTPPSPixGainCalibsESAnalyzer",
0047 outputrootfile=cms.untracked.string(outfile)
0048 )
0049
0050 process.p = cms.Path(process.myprodtest)
0051
0052