Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-02-19 05:08:16

0001 import socket
0002 import FWCore.ParameterSet.Config as cms
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 process = cms.Process("LHCInfoPopulator")
0005 from CondCore.CondDB.CondDB_cfi import *
0006 #process.load("CondCore.DBCommon.CondDBCommon_cfi")
0007 #process.CondDBCommon.connect = 'sqlite_file:lhcinfo_pop_test.db'
0008 #process.CondDBCommon.DBParameters.authenticationPath = '.'
0009 #process.CondDBCommon.DBParameters.messageLevel=cms.untracked.int32(1)
0010 
0011 sourceConnection = 'oracle://cms_omds_adg/CMS_RUNINFO_R'
0012 if socket.getfqdn().find('.cms') != -1:
0013     sourceConnection = 'oracle://cms_omds_lb/CMS_RUNINFO_R'
0014 
0015 options = VarParsing.VarParsing()
0016 options.register( 'destinationConnection'
0017                 , 'sqlite_file:lhcinfo_pop_test.db' #default value
0018                 , VarParsing.VarParsing.multiplicity.singleton
0019                 , VarParsing.VarParsing.varType.string
0020                 , "Connection string to the DB where payloads will be possibly written."
0021                   )
0022 options.register( 'targetConnection'
0023                 , '' #default value
0024                 , VarParsing.VarParsing.multiplicity.singleton
0025                 , VarParsing.VarParsing.varType.string
0026                 , """Connection string to the target DB:
0027                      if not empty (default), this provides the latest IOV and payloads to compare;
0028                      it is the DB where payloads should be finally uploaded."""
0029                   )
0030 options.register( 'tag'
0031                 , 'LHCInfo_PopCon_start_test'
0032                 , VarParsing.VarParsing.multiplicity.singleton
0033                 , VarParsing.VarParsing.varType.string
0034                 , "Tag written in destinationConnection and finally appended in targetConnection."
0035                   )
0036 options.register( 'messageLevel'
0037                 , 0 #default value
0038                 , VarParsing.VarParsing.multiplicity.singleton
0039                 , VarParsing.VarParsing.varType.int
0040                 , "Message level; default to 0"
0041                   )
0042 options.parseArguments()
0043 
0044 CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) )
0045 CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel )
0046 
0047 process.MessageLogger = cms.Service("MessageLogger",
0048                                     cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')),
0049                                     destinations = cms.untracked.vstring('cout')
0050                                     )
0051 
0052 process.source = cms.Source("EmptyIOVSource",
0053                             lastValue = cms.uint64(1),
0054                             timetype = cms.string('runnumber'),
0055                             firstValue = cms.uint64(1),
0056                             interval = cms.uint64(1)
0057                             )
0058 
0059 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0060                                           CondDBConnection,
0061                                           timetype = cms.untracked.string('timestamp'),
0062                                           toPut = cms.VPSet(cms.PSet(record = cms.string('LHCInfoRcd'),
0063                                                                      tag = cms.string( options.tag )
0064                                                                      )
0065                                                             )
0066                                           )
0067 
0068 process.Test1 = cms.EDAnalyzer("LHCInfoPopConAnalyzer",
0069                                SinceAppendMode = cms.bool(True),
0070                                record = cms.string('LHCInfoRcd'),
0071                                name = cms.untracked.string('LHCInfo'),
0072                                Source = cms.PSet(fill = cms.untracked.uint32(6417),
0073                                    startTime = cms.untracked.string('2018-04-01 00:00:00.000'),
0074                                    #endTime = cms.untracked.string('2018-03-25 05:00:00.000'),
0075                                    samplingInterval = cms.untracked.uint32( 600 ),
0076                                    endFill = cms.untracked.bool(False),
0077                                    connectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"),
0078                                    ecalConnectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_DCS_ENV_PVSS_COND"),
0079                                    DIPSchema = cms.untracked.string("CMS_BEAM_COND"),
0080                                    omsBaseUrl = cms.untracked.string("http://vocms0184.cern.ch/agg/api/v1"),
0081                                    #authenticationPath =  cms.untracked.string("."),
0082                                    debug=cms.untracked.bool(False)
0083                                                  ),
0084                                loggingOn = cms.untracked.bool(True),
0085                                IsDestDbCheckedInQueryLog = cms.untracked.bool(False)
0086                                )
0087 
0088 process.p = cms.Path(process.Test1)