Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:44

0001 from __future__ import print_function
0002 import FWCore.ParameterSet.Config as cms
0003 import sys,os
0004 
0005 arguments = sys.argv
0006 infile = "Gains.root"
0007 tagname = "CTPPSPixelGainCalibrations_test"
0008 sqlitename = "ctppsgains_test.db"
0009 runnumber = 1
0010 doDummy = False
0011 gainlo = 0.0
0012 gainhi = 100.0
0013 minNp = 3
0014 if len(arguments)<3:
0015     print ("using default values")
0016     mystr = "usage: cmsRun write-ctpps-pixel-gainscalibrations_cfg.py "+ infile +" "+ tagname +" "+ sqlitename +" "+ str(runnumber) +" "+ str(doDummy) +" "+ str(gainlo) +" "+ str(gainhi) +" "+ str(minNp)
0017     print (mystr)
0018 else:
0019     infile = arguments[2]
0020     if len(arguments)>3: tagname    = arguments[3]
0021     if len(arguments)>4: sqlitename = arguments[4]
0022     if len(arguments)>5:
0023         runnumber  = int(arguments[5])
0024         print ("runno = ",runnumber)
0025     if len(arguments)>6:
0026         doDummy    = (arguments[6].lower()=="true")
0027         print ("useDummyValues = ",doDummy)
0028     if len(arguments)>7:
0029         gainlo     = float(arguments[7])
0030         print ("gainLowLimit = ",gainlo)
0031     if len(arguments)>8:
0032         gainhi     = float(arguments[8])
0033         print ("gainHighLimit = ",gainhi)
0034     if len(arguments)>9:
0035         minNp      = int(arguments[9])
0036         print ("minimumNpFit = ",minNp)
0037 
0038 
0039 
0040 process = cms.Process("CTPPSPixelGainDB")
0041 
0042 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
0043 
0044 process.pixGainDB = cms.EDAnalyzer("WriteCTPPSPixGainCalibrations",
0045                                    inputrootfile = cms.untracked.string(infile),
0046                                    record = cms.untracked.string('CTPPSPixelGainCalibrationsRcd'),
0047                                    useDummyValues = cms.untracked.bool(doDummy),
0048                                    gainLowLimit = cms.untracked.double(gainlo),
0049                                    gainHighLimit=cms.untracked.double(gainhi),
0050                                    minimumNpfit = cms.untracked.int32(minNp)
0051                                    )
0052 
0053 
0054 process.source = cms.Source("EmptyIOVSource",
0055     timetype = cms.string('runnumber'),
0056     firstValue = cms.uint64(runnumber),
0057     lastValue = cms.uint64(runnumber),
0058     interval = cms.uint64(1)
0059     )
0060 
0061 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0062     BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0063     DBParameters = cms.PSet(
0064         messageLevel = cms.untracked.int32(10),
0065         authenticationPath = cms.untracked.string('.')
0066         ),
0067     toPut = cms.VPSet(
0068         cms.PSet(
0069             record = cms.string('CTPPSPixelGainCalibrationsRcd'),
0070             tag = cms.string(tagname)
0071             )
0072         ),
0073     connect = cms.string('sqlite_file:'+sqlitename)
0074 )
0075 
0076 process.p = cms.Path(process.pixGainDB)