Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process('test')
0004 
0005 # minimum of logs
0006 process.MessageLogger = cms.Service("MessageLogger",
0007   statistics = cms.untracked.vstring(),
0008   destinations = cms.untracked.vstring('cout'),
0009   cout = cms.untracked.PSet(
0010     threshold = cms.untracked.string('INFO')
0011   )
0012 )
0013 
0014 # raw data source
0015 #process.source = cms.Source("EmptySource",
0016 #)
0017 
0018 process.maxEvents = cms.untracked.PSet(
0019   input = cms.untracked.int32(1)
0020 )
0021 
0022 # A data source must always be defined. We don't need it, so here's a dummy one.
0023 process.source = cms.Source("EmptyIOVSource",
0024     timetype = cms.string('runnumber'),
0025     # timetype = cms.string('lumiid'),
0026     firstValue = cms.uint64(1),
0027     lastValue = cms.uint64(1),
0028     interval = cms.uint64(1)
0029 )
0030 
0031 # Load beam parameters
0032 process.load("CondFormats.PPSObjects.CTPPSBeamParametersESSource_cfi")
0033 # process.CTPPSBeamParametersESSource.verbosity = cms.untracked.uint32(2)
0034 
0035 # Test retrieving the ESSource data 
0036 process.get = cms.EDAnalyzer("RetrieveCTPPSBeamParameters",
0037     verbose = cms.untracked.bool(True)
0038 )
0039   
0040 # ========================  Test writing to DB  ==========================================
0041 
0042 # Load CondDB service
0043 process.load("CondCore.CondDB.CondDB_cfi")
0044 
0045 # Output database (in this case local sqlite file)
0046 process.CondDB.connect = 'sqlite_file:CTPPSBeamParameters.db'
0047 
0048 # We define the output service.
0049 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0050     process.CondDB,
0051     timetype = cms.untracked.string('runnumber'),
0052     # timetype = cms.untracked.string('timestamp'),
0053     # timetype = cms.untracked.string('lumiid'),
0054     toPut = cms.VPSet(
0055       cms.PSet(
0056           record = cms.string('CTPPSBeamParametersRcd'),
0057           tag = cms.string('CTPPSBeamParameters_v1')
0058       )
0059     )
0060 )
0061 
0062 process.write = cms.EDAnalyzer("WriteCTPPSBeamParameters",
0063     record = cms.string('CTPPSBeamParametersRcd'),
0064     loggingOn= cms.untracked.bool(True),
0065     SinceAppendMode=cms.bool(True),
0066     Source=cms.PSet(
0067         IOVRun=cms.untracked.uint32(1)
0068     )
0069 )
0070 
0071 # ===============================================================================
0072 
0073 
0074 process.path = cms.Path(
0075   process.get*process.write
0076 )