|
| 1 | +import socket |
| 2 | +import FWCore.ParameterSet.Config as cms |
| 3 | +import FWCore.ParameterSet.VarParsing as VarParsing |
| 4 | +process = cms.Process("LHCInfoPerLSPopulator") |
| 5 | +from CondCore.CondDB.CondDB_cfi import * |
| 6 | +#process.load("CondCore.DBCommon.CondDBCommon_cfi") |
| 7 | +#process.CondDBCommon.connect = 'sqlite_file:lhcinfoperls_pop_test.db' |
| 8 | +#process.CondDBCommon.DBParameters.authenticationPath = '.' |
| 9 | +#process.CondDBCommon.DBParameters.messageLevel=cms.untracked.int32(1) |
| 10 | + |
| 11 | +sourceConnection = 'oracle://cms_omds_adg/CMS_RUNINFO_R' |
| 12 | +if socket.getfqdn().find('.cms') != -1: |
| 13 | + sourceConnection = 'oracle://cms_omds_lb/CMS_RUNINFO_R' |
| 14 | + |
| 15 | +options = VarParsing.VarParsing() |
| 16 | +options.register( 'destinationConnection' |
| 17 | + , 'sqlite_file:lhcinfo_pop_test.db' #default value |
| 18 | + , VarParsing.VarParsing.multiplicity.singleton |
| 19 | + , VarParsing.VarParsing.varType.string |
| 20 | + , "Connection string to the DB where payloads will be possibly written." |
| 21 | + ) |
| 22 | +options.register( 'targetConnection' |
| 23 | + , '' #default value |
| 24 | + , VarParsing.VarParsing.multiplicity.singleton |
| 25 | + , VarParsing.VarParsing.varType.string |
| 26 | + , """Connection string to the target DB: |
| 27 | + if not empty (default), this provides the latest IOV and payloads to compare; |
| 28 | + it is the DB where payloads should be finally uploaded.""" |
| 29 | + ) |
| 30 | +options.register( 'tag' |
| 31 | + , 'LHCInfoPerLS_PopCon_start_test' |
| 32 | + , VarParsing.VarParsing.multiplicity.singleton |
| 33 | + , VarParsing.VarParsing.varType.string |
| 34 | + , "Tag written in destinationConnection and finally appended in targetConnection." |
| 35 | + ) |
| 36 | +options.register( 'messageLevel' |
| 37 | + , 0 #default value |
| 38 | + , VarParsing.VarParsing.multiplicity.singleton |
| 39 | + , VarParsing.VarParsing.varType.int |
| 40 | + , "Message level; default to 0" |
| 41 | + ) |
| 42 | +options.parseArguments() |
| 43 | + |
| 44 | +CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) ) |
| 45 | +CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel ) |
| 46 | + |
| 47 | +process.MessageLogger = cms.Service("MessageLogger", |
| 48 | + cout = cms.untracked.PSet(threshold = cms.untracked.string('INFO')), |
| 49 | + destinations = cms.untracked.vstring('cout') |
| 50 | + ) |
| 51 | + |
| 52 | +process.source = cms.Source("EmptyIOVSource", |
| 53 | + lastValue = cms.uint64(1), |
| 54 | + timetype = cms.string('runnumber'), |
| 55 | + firstValue = cms.uint64(1), |
| 56 | + interval = cms.uint64(1) |
| 57 | + ) |
| 58 | + |
| 59 | +process.PoolDBOutputService = cms.Service("PoolDBOutputService", |
| 60 | + CondDBConnection, |
| 61 | + timetype = cms.untracked.string('timestamp'), |
| 62 | + toPut = cms.VPSet(cms.PSet(record = cms.string('LHCInfoPerLSRcd'), |
| 63 | + tag = cms.string( options.tag ) |
| 64 | + ) |
| 65 | + ) |
| 66 | + ) |
| 67 | + |
| 68 | +process.Test1 = cms.EDAnalyzer("LHCInfoPerLSPopConAnalyzer", |
| 69 | + SinceAppendMode = cms.bool(True), |
| 70 | + record = cms.string('LHCInfoPerLSRcd'), |
| 71 | + name = cms.untracked.string('LHCInfo'), |
| 72 | + Source = cms.PSet(fill = cms.untracked.uint32(6417), |
| 73 | + startTime = cms.untracked.string('2022-08-04 16:00:34.000'), |
| 74 | + # endTime = cms.untracked.string('2018-04-06 05:00:00.000'), |
| 75 | + samplingInterval = cms.untracked.uint32( 600 ), |
| 76 | + endFill = cms.untracked.bool(True), |
| 77 | + connectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"), |
| 78 | + ecalConnectionString = cms.untracked.string("oracle://cms_orcon_adg/CMS_DCS_ENV_PVSS_COND"), |
| 79 | + DIPSchema = cms.untracked.string("CMS_BEAM_COND"), |
| 80 | + omsBaseUrl = cms.untracked.string("http://vocms0184.cern.ch/agg/api/v1"), |
| 81 | + #authenticationPath = cms.untracked.string("."), |
| 82 | + debug=cms.untracked.bool(False) |
| 83 | + ), |
| 84 | + loggingOn = cms.untracked.bool(True), |
| 85 | + IsDestDbCheckedInQueryLog = cms.untracked.bool(False) |
| 86 | + ) |
| 87 | + |
| 88 | +process.p = cms.Path(process.Test1) |
0 commit comments