CMS 3D CMS Logo

updateTPGOddWeightGroup.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  'EcalTPGOddWeightGroup.txt',
8  VarParsing.VarParsing.multiplicity.singleton,
9  VarParsing.VarParsing.varType.string,
10  "input")
11 options.register ('output', # output file with SQLite format
12  'EcalTPGOddWeightGroup.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  'EcalTPGOddWeightGroup',
23  VarParsing.VarParsing.multiplicity.singleton,
24  VarParsing.VarParsing.varType.string,
25  "outputtag")
26 options.parseArguments()
27 
28 
29 process = cms.Process("ProcessOne")
30 
31 process.MessageLogger = cms.Service("MessageLogger",
32  cerr = cms.untracked.PSet(
33  enable = cms.untracked.bool(False)
34  ),
35  cout = cms.untracked.PSet(
36  enable = cms.untracked.bool(True),
37  threshold = cms.untracked.string('DEBUG')
38  ),
39  debugModules = cms.untracked.vstring('*')
40 )
41 
42 process.source = cms.Source("EmptyIOVSource",
43  lastValue = cms.uint64(100000000000),
44  timetype = cms.string('runnumber'),
45  firstValue = cms.uint64(100000000000),
46  interval = cms.uint64(1)
47 )
48 
49 process.load("CondCore.CondDB.CondDB_cfi")
50 
51 process.CondDB.connect = 'sqlite_file:%s'%(options.output)
52 
53 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
54  process.CondDB,
55  logconnect = cms.untracked.string('sqlite_file:log.db'),
56  toPut = cms.VPSet(
57  cms.PSet(
58  record = cms.string('EcalTPGOddWeightGroupRcd'),
59  tag = cms.string(options.outputtag)
60  )
61  )
62 )
63 
64 process.Test1 = cms.EDAnalyzer("ExTestEcalTPGOddWeightGroupAnalyzer",
65  record = cms.string('EcalTPGOddWeightGroupRcd'),
66  loggingOn= cms.untracked.bool(True),
67  IsDestDbCheckedInQueryLog=cms.untracked.bool(True),
68  SinceAppendMode=cms.bool(True),
69  Source=cms.PSet(
70  firstRun = cms.string('1'),
71  lastRun = cms.string('10'),
72  OnlineDBSID = cms.string(''),
73  OnlineDBUser = cms.string(''),
74  OnlineDBPassword = cms.string(''),
75  LocationSource = cms.string(''),
76  Location = cms.string(''),
77  GenTag = cms.string(''),
78  RunType = cms.string(''),
79  fileType = cms.string(options.filetype),
80  fileName = cms.string(options.input),
81  )
82 )
83 
84 process.p = cms.Path(process.Test1)