2 import FWCore.ParameterSet.Config
as cms
3 import FWCore.ParameterSet.VarParsing
as VarParsing
4 process = cms.Process(
"LHCInfoPerLSPopulator")
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' 16 options.register(
'mode' 18 , VarParsing.VarParsing.multiplicity.singleton
19 , VarParsing.VarParsing.varType.string
20 ,
"The mode the fills are going to be process and the data gathered. Accepted values: duringFill endFill" 22 options.register(
'destinationConnection' 23 ,
'sqlite_file:lhcinfo_pop_test.db' 24 , VarParsing.VarParsing.multiplicity.singleton
25 , VarParsing.VarParsing.varType.string
26 ,
"Connection string to the DB where payloads will be possibly written." 28 options.register(
'targetConnection' 30 , VarParsing.VarParsing.multiplicity.singleton
31 , VarParsing.VarParsing.varType.string
32 ,
"""Connection string to the target DB: 33 if not empty (default), this provides the latest IOV and payloads to compare; 34 it is the DB where payloads should be finally uploaded.""" 36 options.register(
'tag' 37 ,
'LHCInfoPerLS_PopCon_test' 38 , VarParsing.VarParsing.multiplicity.singleton
39 , VarParsing.VarParsing.varType.string
40 ,
"Tag written in destinationConnection and finally appended in targetConnection." 42 options.register(
'messageLevel' 44 , VarParsing.VarParsing.multiplicity.singleton
45 , VarParsing.VarParsing.varType.int
46 ,
"Message level; default to 0" 48 options.register(
'startTime' 49 ,
'2021-09-10 03:10:18.000' 50 , VarParsing.VarParsing.multiplicity.singleton
51 , VarParsing.VarParsing.varType.string
52 ,
"""Date and time of the start of processing: 53 processes only fills starting at startTime or later""" 55 options.register(
'endTime' 57 , VarParsing.VarParsing.multiplicity.singleton
58 , VarParsing.VarParsing.varType.string
59 ,
"""Date and time of the start of processing: 60 processes only fills starting before endTime; 61 default to empty string which sets no restriction""" 63 options.parseArguments()
64 if options.mode
is None:
65 raise ValueError(
"mode argument not provided. Supported modes are: duringFill endFill")
66 if options.mode
not in (
"duringFill",
"endFill"):
67 raise ValueError(
"Wrong mode argument. Supported modes are: duringFill endFill")
69 CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) )
70 CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel )
72 process.MessageLogger = cms.Service(
"MessageLogger",
73 cout = cms.untracked.PSet(threshold = cms.untracked.string(
'INFO')),
74 destinations = cms.untracked.vstring(
'cout')
77 process.source = cms.Source(
"EmptyIOVSource",
78 lastValue = cms.uint64(1),
79 timetype = cms.string(
'runnumber'),
80 firstValue = cms.uint64(1),
81 interval = cms.uint64(1)
85 if options.mode ==
'endFill':
86 timetype =
'timestamp' 90 process.PoolDBOutputService = cms.Service(
"PoolDBOutputService",
92 timetype = cms.untracked.string(timetype),
93 toPut = cms.VPSet(cms.PSet(record = cms.string(
'LHCInfoPerLSRcd'),
94 tag = cms.string( options.tag )
99 process.Test1 = cms.EDAnalyzer(
"LHCInfoPerLSPopConAnalyzer",
100 SinceAppendMode = cms.bool(
True),
101 record = cms.string(
'LHCInfoPerLSRcd'),
102 name = cms.untracked.string(
'LHCInfo'),
103 Source = cms.PSet(fill = cms.untracked.uint32(6417),
104 startTime = cms.untracked.string(options.startTime),
105 endTime = cms.untracked.string(options.endTime),
106 endFill = cms.untracked.bool(
True if options.mode ==
"endFill" else False),
107 name = cms.untracked.string(
"LHCInfoPerLSPopConSourceHandler"),
108 connectionString = cms.untracked.string(
"oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER"),
109 omsBaseUrl = cms.untracked.string(
"http://vocms0184.cern.ch/agg/api/v1"),
110 authenticationPath = cms.untracked.string(
""),
111 debug=cms.untracked.bool(
False)
113 loggingOn = cms.untracked.bool(
True),
114 IsDestDbCheckedInQueryLog = cms.untracked.bool(
False)
117 process.p = cms.Path(process.Test1)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)