Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:10

0001 database = "sqlite_file:HFPhase1PMTParams_V00_mc.db"
0002 tag = "HFPhase1PMTParams_V00_mc"
0003 inputfile = "HFPhase1PMTParams_V00_mc.bbin"
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 
0007 process = cms.Process('HFPhase1PMTParamsDBWrite') 
0008 
0009 process.source = cms.Source('EmptyIOVSource',
0010     lastValue = cms.uint64(1),
0011     timetype = cms.string('runnumber'),
0012     firstValue = cms.uint64(1),
0013     interval = cms.uint64(1)
0014 ) 
0015 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) 
0016 
0017 process.load("CondCore.CondDB.CondDB_cfi")
0018 process.CondDB.connect = database
0019 # process.CondDB.dbFormat = cms.untracked.int32(1)
0020 
0021 # Data is tagged in the database by the "tag" parameter specified in the
0022 # PoolDBOutputService configuration. We then check if the tag already exists.
0023 #
0024 # -- If the tag does not exist, a new interval of validity (IOV) for this tag
0025 #    is created, valid till "end of time".
0026 #
0027 # -- If the tag already exists: the IOV of the previous data is stopped at
0028 #    "current time" and we register new data valid from now on (currentTime
0029 #    is the time of the current event!). 
0030 #
0031 # The "record" parameter should be the same in the PoolDBOutputService
0032 # configuration and in the module which writes the object. It is basically
0033 # used in order to just associate the record with the tag.
0034 #
0035 process.PoolDBOutputService = cms.Service(
0036     "PoolDBOutputService",
0037     process.CondDB,
0038     timetype = cms.untracked.string('runnumber'),
0039     toPut = cms.VPSet(cms.PSet(
0040         record = cms.string("HFPhase1PMTParamsRcd"),
0041         tag = cms.string(tag)
0042     ))
0043 )
0044 
0045 process.filereader = cms.EDAnalyzer(
0046     'HFPhase1PMTParamsDBWriter',
0047     inputFile = cms.string(inputfile),
0048     record = cms.string("HFPhase1PMTParamsRcd")
0049 )
0050 
0051 process.p = cms.Path(process.filereader)