1 |
import FWCore.ParameterSet.Config as cms
|
2 |
from FWCore.ParameterSet.VarParsing import VarParsing
|
3 |
from DQM.EcalCommon.CalibCommonParams_cfi import ecalCalibCommonParams
|
4 |
import os
|
5 |
|
6 |
options = VarParsing('analysis')
|
7 |
options.register('runtype', '', VarParsing.multiplicity.singleton, VarParsing.varType.string, '')
|
8 |
options.register('dbparams', '', VarParsing.multiplicity.singleton, VarParsing.varType.string, '')
|
9 |
options.register('generaltag', '', VarParsing.multiplicity.singleton, VarParsing.varType.string, '')
|
10 |
options.register('laserwl', '', VarParsing.multiplicity.list, VarParsing.varType.int, '')
|
11 |
options.register('ledwl', '', VarParsing.multiplicity.list, VarParsing.varType.int, '')
|
12 |
options.register('gains', '', VarParsing.multiplicity.list, VarParsing.varType.int, '')
|
13 |
options.register('pngains', '', VarParsing.multiplicity.list, VarParsing.varType.int, '')
|
14 |
|
15 |
options.parseArguments()
|
16 |
|
17 |
runtype = options.runtype
|
18 |
generaltag = options.generaltag
|
19 |
laserwl = []
|
20 |
if len(options.laserwl) > 0:
|
21 |
laserwl = options.laserwl
|
22 |
else:
|
23 |
laserwl = ecalCalibCommonParams.laserWavelengths.value()
|
24 |
ledwl = []
|
25 |
if len(options.ledwl) > 0:
|
26 |
ledwl = options.ledwl
|
27 |
else:
|
28 |
ledwl = ecalCalibCommonParams.ledWavelengths.value()
|
29 |
gains = []
|
30 |
if len(options.gains) > 0:
|
31 |
gains = options.gains
|
32 |
else:
|
33 |
gains = ecalCalibCommonParams.MGPAGains.value()
|
34 |
pngains = []
|
35 |
if len(options.pngains) > 0:
|
36 |
pngains = options.pngains
|
37 |
else:
|
38 |
pngains = ecalCalibCommonParams.MGPAGainsPN.value()
|
39 |
|
40 |
os.environ["TNS_ADMIN"] = "/etc"
|
41 |
|
42 |
dbName = ''
|
43 |
dbHostName = ''
|
44 |
dbHostPort = 1521
|
45 |
dbUserName = ''
|
46 |
dbPassword = ''
|
47 |
|
48 |
try:
|
49 |
file = open(options.dbparams, 'r')
|
50 |
for line in file:
|
51 |
if line.find('dbName') >= 0:
|
52 |
dbName = line.split()[2]
|
53 |
if line.find('dbHostName') >= 0:
|
54 |
dbHostName = line.split()[2]
|
55 |
if line.find('dbHostPort') >= 0:
|
56 |
dbHostPort = int(line.split()[2])
|
57 |
if line.find('dbUserName') >= 0:
|
58 |
dbUserName = line.split()[2]
|
59 |
if line.find('dbPassword') >= 0:
|
60 |
dbPassword = line.split()[2]
|
61 |
file.close()
|
62 |
except IOError:
|
63 |
pass
|
64 |
|
65 |
process = cms.Process("DQMDB")
|
66 |
|
67 |
process.source = cms.Source("EmptySource")
|
68 |
|
69 |
process.load("DQM.EcalCommon.EcalCondDBWriter_cfi")
|
70 |
process.ecalCondDBWriter.DBName = dbName
|
71 |
process.ecalCondDBWriter.userName = dbUserName
|
72 |
process.ecalCondDBWriter.password = dbPassword
|
73 |
process.ecalCondDBWriter.hostName = dbHostName
|
74 |
process.ecalCondDBWriter.hostPort = dbHostPort
|
75 |
process.ecalCondDBWriter.location = 'P5_Co'
|
76 |
process.ecalCondDBWriter.runType = runtype
|
77 |
process.ecalCondDBWriter.runGeneralTag = generaltag
|
78 |
process.ecalCondDBWriter.monRunGeneralTag = 'CMSSW-offline-private'
|
79 |
process.ecalCondDBWriter.inputRootFiles = cms.untracked.vstring(
|
80 |
options.inputFiles
|
81 |
)
|
82 |
process.ecalCondDBWriter.workerParams.laserWavelengths = laserwl
|
83 |
process.ecalCondDBWriter.workerParams.ledWavelengths = ledwl
|
84 |
process.ecalCondDBWriter.workerParams.MGPAGains = gains
|
85 |
process.ecalCondDBWriter.workerParams.MGPAGainsPN = pngains
|
86 |
process.ecalCondDBWriter.verbosity = 2
|
87 |
|
88 |
process.load("DQM.EcalCommon.EcalDQMBinningService_cfi")
|
89 |
|
90 |
process.load("DQMServices.Core.DQM_cfg")
|
91 |
|
92 |
process.maxEvents = cms.untracked.PSet(
|
93 |
input = cms.untracked.int32(1)
|
94 |
)
|
95 |
|
96 |
process.load("Geometry.CaloEventSetup.CaloGeometry_cfi")
|
97 |
|
98 |
process.load("Geometry.CaloEventSetup.CaloTopology_cfi")
|
99 |
|
100 |
process.load("Geometry.CaloEventSetup.EcalTrigTowerConstituents_cfi")
|
101 |
|
102 |
process.load("Geometry.CMSCommonData.cmsIdealGeometryXML_cfi")
|
103 |
|
104 |
process.load("Geometry.EcalMapping.EcalMapping_cfi")
|
105 |
|
106 |
process.load("Geometry.EcalMapping.EcalMappingRecord_cfi")
|
107 |
|
108 |
process.load("DQM.Integration.test.FrontierCondition_GT_cfi")
|
109 |
|
110 |
process.p = cms.Path(process.ecalCondDBWriter)
|