CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
makeDBFromTFile.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.VarParsing as VarParsing
2 
3 ivars = VarParsing.VarParsing('standard')
4 
5 ivars.register ('outputTag',
6  mult=ivars.multiplicity.singleton,
7  mytype=ivars.varType.string,
8  info="for testing")
9 ivars.outputTag="demo"
10 
11 ivars.register ('inputFile',
12  mult=ivars.multiplicity.singleton,
13  mytype=ivars.varType.string,
14  info="for testing")
15 
16 ivars.register ('outputFile',
17  mult=ivars.multiplicity.singleton,
18  mytype=ivars.varType.string,
19  info="for testing")
20 
21 ivars.inputFile="./input.root"
22 ivars.outputFile="./output.db"
23 
24 ivars.parseArguments()
25 
26 import FWCore.ParameterSet.Config as cms
27 
28 process = cms.Process('DUMMY')
29 
30 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
31 process.source = cms.Source("EmptyIOVSource",
32  timetype = cms.string("runnumber"),
33  firstValue = cms.uint64(1),
34  lastValue = cms.uint64(200),
35  interval = cms.uint64(1)
36  )
37 
38 process.load("CondCore.DBCommon.CondDBCommon_cfi")
39 process.CondDBCommon.connect = "sqlite_file:" + ivars.outputFile
40 
41 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
42  process.CondDBCommon,
43  timetype = cms.untracked.string("runnumber"),
44  toPut = cms.VPSet(cms.PSet(record = cms.string('HeavyIonRcd'),
45  tag = cms.string(ivars.outputTag)
46  )
47  )
48  )
49 
50 process.makeCentralityTableDB = cms.EDAnalyzer('CentralityTableProducer',
51  makeDBFromTFile = cms.untracked.bool(True),
52  inputTFile = cms.string(ivars.inputFile),
53  rootTag = cms.string(ivars.outputTag)
54  )
55 
56 process.step = cms.Path(process.makeCentralityTableDB)
57 
58 
59 
60 
61