4 import FWCore.ParameterSet.Config
as cms
5 import FWCore.ParameterSet.VarParsing
as VarParsing
7 sourceConnection =
'oracle://cms_omds_adg/CMS_TRK_R' 8 if socket.getfqdn().
find(
'.cms') != -1:
9 sourceConnection =
'oracle://cms_omds_lb/CMS_TRK_R' 12 options.register(
'delay' 14 , VarParsing.VarParsing.multiplicity.singleton
15 , VarParsing.VarParsing.varType.int
16 ,
"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." 18 options.register(
'destinationConnection' 19 ,
'sqlite_file:SiStripDetVOff.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(
'conddbConnection' 25 ,
'oracle://cms_orcon_adg/CMS_CONDITIONS' 26 , VarParsing.VarParsing.multiplicity.singleton
27 , VarParsing.VarParsing.varType.string
28 ,
"Connection string to the DB from which the last IOV is read." 30 options.register(
'tag' 31 ,
'SiStripDetVOff_test' 32 , VarParsing.VarParsing.multiplicity.singleton
33 , VarParsing.VarParsing.varType.string
34 ,
"Tag written in destinationConnection and finally appended in targetConnection." 36 options.parseArguments()
39 dt = datetime.datetime.utcnow() - datetime.timedelta(hours=options.delay)
40 tmax = [dt.year, dt.month, dt.day, dt.hour, 0, 0, 0]
43 authPath = os.environ[
'COND_AUTH_PATH']
if 'COND_AUTH_PATH' in os.environ
else os.environ[
"HOME"]
45 process = cms.Process(
"SiStripDCSO2O")
47 process.MessageLogger = cms.Service(
"MessageLogger",
48 debugModules = cms.untracked.vstring(
"*" ),
49 cout = cms.untracked.PSet( threshold = cms.untracked.string(
"DEBUG" ) ),
50 destinations = cms.untracked.vstring(
"cout" )
53 process.maxEvents = cms.untracked.PSet(
54 input = cms.untracked.int32(1)
56 process.source = cms.Source(
"EmptySource",
57 numberEventsInRun = cms.untracked.uint32(1),
58 firstRun = cms.untracked.uint32(1)
62 process.SiStripDetVOffBuilder = cms.Service(
63 "SiStripDetVOffBuilder",
64 onlineDB = cms.string(sourceConnection),
65 authPath=cms.string(authPath),
68 Tmin = cms.vint32(2016, 1, 1, 0, 0, 0, 0),
69 Tmax = cms.vint32(tmax),
72 TSetMin = cms.vint32(2007, 11, 26, 0, 0, 0, 0),
75 queryType = cms.string(
'STATUSCHANGE'),
78 DeltaTmin = cms.uint32(2),
81 MaxIOVlength = cms.uint32(90),
84 lastValueFile = cms.string(
''),
87 lastValueFromFile = cms.bool(
False),
90 debugModeOn = cms.bool(
False),
93 DetIdListFile = cms.string(
'CalibTracker/SiStripCommon/data/SiStripDetInfo.dat'),
96 HighVoltageOnThreshold = cms.double(0.97),
99 PsuDetIdMapFile = cms.string(
"CalibTracker/SiStripDCS/data/StripPSUDetIDMap_FromFeb2016.dat"),
102 ExcludedDetIdListFile = cms.string(
'')
106 process.load(
"CondCore.CondDB.CondDB_cfi")
107 process.siStripPopConDetVOff = cms.EDAnalyzer(
"SiStripO2ODetVOff",
111 conditionDatabase = cms.string(options.conddbConnection),
112 condDbFile = cms.string(options.destinationConnection),
113 targetTag = cms.string(options.tag),
115 maxTimeBeforeNewIOV=cms.untracked.int32(168)
118 process.p = cms.Path(process.siStripPopConDetVOff)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)