CMS 3D CMS Logo

updateTPGWeightIdMap.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import FWCore.ParameterSet.VarParsing as VarParsing
3 
4 options = VarParsing.VarParsing('analysis')
5 
6 options.register ('input', # input text file with encoded weight groups
7  'EcalTPGWeightIdMap.txt',
8  VarParsing.VarParsing.multiplicity.singleton,
9  VarParsing.VarParsing.varType.string,
10  "input")
11 options.register ('output', # output file with SQLite format
12  'EcalTPGWeightIdMap.db',
13  VarParsing.VarParsing.multiplicity.singleton,
14  VarParsing.VarParsing.varType.string,
15  "output")
16 options.register ('filetype', # input file format txt/xml
17  'txt',
18  VarParsing.VarParsing.multiplicity.singleton,
19  VarParsing.VarParsing.varType.string,
20  "filetype")
21 options.register('outputtag',
22  'EcalTPGWeightIdMap',
23  VarParsing.VarParsing.multiplicity.singleton,
24  VarParsing.VarParsing.varType.string,
25  "outputtag")
26 options.parseArguments()
27 
28 process = cms.Process("ProcessOne")
29 
30 process.MessageLogger = cms.Service("MessageLogger",
31  cerr = cms.untracked.PSet(
32  enable = cms.untracked.bool(False)
33  ),
34  cout = cms.untracked.PSet(
35  enable = cms.untracked.bool(True),
36  threshold = cms.untracked.string('DEBUG')
37  ),
38  debugModules = cms.untracked.vstring('*')
39 )
40 
41 process.source = cms.Source("EmptyIOVSource",
42  lastValue = cms.uint64(100000000000),
43  timetype = cms.string('runnumber'),
44  firstValue = cms.uint64(100000000000),
45  interval = cms.uint64(1)
46 )
47 
48 process.load("CondCore.CondDB.CondDB_cfi")
49 
50 process.CondDB.connect = 'sqlite_file:%s'%(options.output)
51 
52 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
53  process.CondDB,
54  logconnect = cms.untracked.string('sqlite_file:log.db'),
55  toPut = cms.VPSet(
56  cms.PSet(
57  record = cms.string('EcalTPGWeightIdMapRcd'),
58  tag = cms.string(options.outputtag)
59  )
60  )
61 )
62 
63 process.Test1 = cms.EDAnalyzer("ExTestEcalTPGWeightIdMapAnalyzer",
64  record = cms.string('EcalTPGWeightIdMapRcd'),
65  loggingOn= cms.untracked.bool(True),
66  IsDestDbCheckedInQueryLog=cms.untracked.bool(True),
67  SinceAppendMode=cms.bool(True),
68  Source=cms.PSet(
69  firstRun = cms.string('1'),
70  lastRun = cms.string('10'),
71  OnlineDBSID = cms.string(''),
72  OnlineDBUser = cms.string(''),
73  OnlineDBPassword = cms.string(''),
74  LocationSource = cms.string(''),
75  Location = cms.string(''),
76  GenTag = cms.string(''),
77  RunType = cms.string(''),
78  fileType = cms.string(options.filetype),
79  fileName = cms.string(options.input),
80  )
81 )
82 
83 process.p = cms.Path(process.Test1)