3 import FWCore.ParameterSet.Config
as cms
4 import FWCore.ParameterSet.VarParsing
as VarParsing
7 options.register(
'delay' 9 , VarParsing.VarParsing.multiplicity.singleton
10 , VarParsing.VarParsing.varType.int
11 ,
"Time delay (in hours) for the O2O. The O2O then queries the PVSS DB from last IOV until (current hour - delay), ignoring minutes and seconds." 13 options.register(
'sourceConnection' 14 ,
'oracle://cms_omds_adg/CMS_TRK_R' 15 , VarParsing.VarParsing.multiplicity.singleton
16 , VarParsing.VarParsing.varType.string
17 ,
"Connection string to the PVSS DB." 19 options.register(
'destinationConnection' 20 ,
'sqlite_file:SiStripDetVOff.db' 21 , VarParsing.VarParsing.multiplicity.singleton
22 , VarParsing.VarParsing.varType.string
23 ,
"Connection string to the DB where payloads will be possibly written." 25 options.register(
'conddbConnection' 26 ,
'oracle://cms_orcon_adg/CMS_CONDITIONS' 27 , VarParsing.VarParsing.multiplicity.singleton
28 , VarParsing.VarParsing.varType.string
29 ,
"Connection string to the DB from which the last IOV is read." 31 options.register(
'tag' 32 ,
'SiStripDetVOff_test' 33 , VarParsing.VarParsing.multiplicity.singleton
34 , VarParsing.VarParsing.varType.string
35 ,
"Tag written in destinationConnection and finally appended in targetConnection." 37 options.parseArguments()
40 dt = datetime.datetime.utcnow() - datetime.timedelta(hours=options.delay)
41 tmax = [dt.year, dt.month, dt.day, dt.hour, 0, 0, 0]
44 authPath = os.environ[
'COND_AUTH_PATH']
if 'COND_AUTH_PATH' in os.environ
else os.environ[
"HOME"]
46 process = cms.Process(
"SiStripDCSO2O")
48 process.MessageLogger = cms.Service(
"MessageLogger",
49 debugModules = cms.untracked.vstring(
"*" ),
50 cout = cms.untracked.PSet( threshold = cms.untracked.string(
"DEBUG" ) ),
51 destinations = cms.untracked.vstring(
"cout" )
54 process.maxEvents = cms.untracked.PSet(
55 input = cms.untracked.int32(1)
57 process.source = cms.Source(
"EmptySource",
58 numberEventsInRun = cms.untracked.uint32(1),
59 firstRun = cms.untracked.uint32(1)
63 process.SiStripDetVOffBuilder = cms.Service(
64 "SiStripDetVOffBuilder",
65 onlineDB=cms.string(options.sourceConnection),
66 authPath=cms.string(authPath),
69 Tmin = cms.vint32(2016, 1, 1, 0, 0, 0, 0),
70 Tmax = cms.vint32(tmax),
73 TSetMin = cms.vint32(2007, 11, 26, 0, 0, 0, 0),
76 queryType = cms.string(
'STATUSCHANGE'),
79 DeltaTmin = cms.uint32(2),
82 MaxIOVlength = cms.uint32(90),
85 lastValueFile = cms.string(
''),
88 lastValueFromFile = cms.bool(
False),
91 debugModeOn = cms.bool(
False),
94 DetIdListFile = cms.string(
'CalibTracker/SiStripCommon/data/SiStripDetInfo.dat'),
97 HighVoltageOnThreshold = cms.double(0.97),
100 PsuDetIdMapFile = cms.string(
"CalibTracker/SiStripDCS/data/StripPSUDetIDMap_FromFeb2016.dat"),
103 ExcludedDetIdListFile = cms.string(
'')
107 process.load(
"CondCore.CondDB.CondDB_cfi")
108 process.siStripPopConDetVOff = cms.EDAnalyzer(
"SiStripO2ODetVOff",
112 conditionDatabase = cms.string(options.conddbConnection),
113 condDbFile = cms.string(options.destinationConnection),
114 targetTag = cms.string(options.tag),
116 maxTimeBeforeNewIOV=cms.untracked.int32(168)
119 process.p = cms.Path(process.siStripPopConDetVOff)