2 import FWCore.ParameterSet.Config
as cms
3 import FWCore.ParameterSet.VarParsing
as VarParsing
4 process = cms.Process(
"LHCInfoPerFillPopulator")
7 sourceConnection =
'oracle://cms_omds_adg/CMS_RUNINFO_R' 8 if socket.getfqdn().
find(
'.cms') != -1:
9 sourceConnection =
'oracle://cms_omds_lb/CMS_RUNINFO_R' 12 options.register(
'mode' 14 , VarParsing.VarParsing.multiplicity.singleton
15 , VarParsing.VarParsing.varType.string
16 ,
"The mode the fills are going to be process and the data gathered. Accepted values: duringFill endFill" 18 options.register(
'destinationConnection' 19 ,
'sqlite_file:lhcinfo_pop_test.db' 20 , VarParsing.VarParsing.multiplicity.singleton
21 , VarParsing.VarParsing.varType.string
22 ,
"Connection string to the DB where payloads will be possibly written." 24 options.register(
'targetConnection' 26 , VarParsing.VarParsing.multiplicity.singleton
27 , VarParsing.VarParsing.varType.string
28 ,
"""Connection string to the target DB: 29 if not empty (default), this provides the latest IOV and payloads to compare; 30 it is the DB where payloads should be finally uploaded.""" 32 options.register(
'tag' 33 ,
'LHCInfoPerFill_PopCon_test' 34 , VarParsing.VarParsing.multiplicity.singleton
35 , VarParsing.VarParsing.varType.string
36 ,
"Tag written in destinationConnection and finally appended in targetConnection." 38 options.register(
'messageLevel' 40 , VarParsing.VarParsing.multiplicity.singleton
41 , VarParsing.VarParsing.varType.int
42 ,
"Message level; default to 0" 44 options.register(
'startTime' 45 ,
'2021-09-10 03:10:18.000' 46 , VarParsing.VarParsing.multiplicity.singleton
47 , VarParsing.VarParsing.varType.string
48 ,
"""Date and time of the start of processing: 49 processes only fills starting at startTime or later""" 51 options.register(
'endTime' 53 , VarParsing.VarParsing.multiplicity.singleton
54 , VarParsing.VarParsing.varType.string
55 ,
"""Date and time of the start of processing: 56 processes only fills starting before endTime; 57 default to empty string which sets no restriction""" 60 options.register(
'sourceConnection' 61 ,
"oracle://cms_orcon_adg/CMS_RUNTIME_LOGGER" 62 , VarParsing.VarParsing.multiplicity.singleton
63 , VarParsing.VarParsing.varType.string
64 ,
"""beam data source connection string (aka PPS db)""" 66 options.register(
'ecalConnection' 67 ,
"oracle://cms_orcon_adg/CMS_DCS_ENV_PVSS_COND" 68 , VarParsing.VarParsing.multiplicity.singleton
69 , VarParsing.VarParsing.varType.string
70 ,
"""ecal data source connection string""" 72 options.register(
'oms' 73 ,
"http://vocms0184.cern.ch/agg/api/v1" 74 , VarParsing.VarParsing.multiplicity.singleton
75 , VarParsing.VarParsing.varType.string
80 options.register(
'lastLumiFile' 82 , VarParsing.VarParsing.multiplicity.singleton
83 , VarParsing.VarParsing.varType.string
84 ,
"""duringFill only: path to file with lumiid to override the last lumisection processed by HLT. 85 Used for testing. Leave empty for production behaviour (getting this info from OMS)""" 87 options.register(
'frontierKey' 89 , VarParsing.VarParsing.multiplicity.singleton
90 , VarParsing.VarParsing.varType.string
91 ,
"""duringFill only: run-unique key for writing with OnlinePopCon 92 (used for confirming proper upload)""" 97 options.register(
'authenticationPath' 99 , VarParsing.VarParsing.multiplicity.singleton
100 , VarParsing.VarParsing.varType.string
101 ,
"""for now this option was always left empty""" 104 options.parseArguments()
105 if options.mode
is None:
106 raise ValueError(
"mode argument not provided. Supported modes are: duringFill endFill")
107 if options.mode
not in (
"duringFill",
"endFill"):
108 raise ValueError(
"Wrong mode argument. Supported modes are: duringFill endFill")
110 CondDBConnection = CondDB.clone( connect = cms.string( options.destinationConnection ) )
111 CondDBConnection.DBParameters.messageLevel = cms.untracked.int32( options.messageLevel )
112 CondDBConnection.DBParameters.authenticationPath = cms.untracked.string(options.authenticationPath)
114 process.MessageLogger = cms.Service(
"MessageLogger",
115 cout = cms.untracked.PSet(threshold = cms.untracked.string(
'INFO')),
116 destinations = cms.untracked.vstring(
'cout')
119 process.source = cms.Source(
"EmptyIOVSource",
120 lastValue = cms.uint64(1),
121 timetype = cms.string(
'runnumber'),
122 firstValue = cms.uint64(1),
123 interval = cms.uint64(1)
127 if options.mode ==
'endFill':
128 timetype =
'timestamp' 132 if options.mode ==
"endFill":
133 process.PoolDBOutputService = cms.Service(
"PoolDBOutputService",
135 timetype = cms.untracked.string(timetype),
136 toPut = cms.VPSet(cms.PSet(record = cms.string(
'LHCInfoPerFillRcd'),
137 tag = cms.string( options.tag )
142 process.OnlineDBOutputService = cms.Service(
"OnlineDBOutputService",
144 preLoadConnectionString = cms.untracked.string(
'frontier://FrontierProd/CMS_CONDITIONS' 145 if not options.destinationConnection.startswith(
'sqlite')
146 else options.destinationConnection ),
147 lastLumiFile = cms.untracked.string(options.lastLumiFile),
148 omsServiceUrl = cms.untracked.string(
'http://cmsoms-eventing.cms:9949/urn:xdaq-application:lid=100/getRunAndLumiSection' 149 if not options.lastLumiFile
else "" ),
152 latency = cms.untracked.uint32(2),
153 timetype = cms.untracked.string(timetype),
154 toPut = cms.VPSet(cms.PSet(
155 record = cms.string(
'LHCInfoPerFillRcd'),
156 tag = cms.string( options.tag ),
157 onlyAppendUpdatePolicy = cms.untracked.bool(
True)
159 frontierKey = cms.untracked.string(options.frontierKey)
163 process.Test1 = cms.EDAnalyzer(
"LHCInfoPerFillPopConAnalyzer" if options.mode ==
"endFill" else "LHCInfoPerFillOnlinePopConAnalyzer",
164 SinceAppendMode = cms.bool(
True),
165 record = cms.string(
'LHCInfoPerFillRcd'),
166 name = cms.untracked.string(
'LHCInfo'),
168 startTime = cms.untracked.string(options.startTime),
169 endTime = cms.untracked.string(options.endTime),
170 endFill = cms.untracked.bool(options.mode ==
"endFill"),
171 name = cms.untracked.string(
"LHCInfoPerFillPopConSourceHandler"),
172 connectionString = cms.untracked.string(options.sourceConnection),
173 ecalConnectionString = cms.untracked.string(options.ecalConnection),
174 omsBaseUrl = cms.untracked.string(options.oms),
175 authenticationPath = cms.untracked.string(options.authenticationPath),
176 debug=cms.untracked.bool(
False)
178 loggingOn = cms.untracked.bool(
True),
179 IsDestDbCheckedInQueryLog = cms.untracked.bool(
False)
182 process.p = cms.Path(process.Test1)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)