CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
runTestDB.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="HFhits40_MC_Hydjet2760GeV_MC_3XY_V24_v0"
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="../data/CentralityTables.root"
22 ivars.outputFile="Test.db"
23 
24 ivars.parseArguments()
25 
26 hiRecord = 'HeavyIonRcd'
27 
28 import FWCore.ParameterSet.Config as cms
29 
30 process = cms.Process('DUMMY')
31 
32 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
33 
34 process.MessageLogger = cms.Service("MessageLogger",
35  cout = cms.untracked.PSet(
36  threshold = cms.untracked.string('INFO')
37  ),
38  destinations = cms.untracked.vstring('cout')
39  )
40 
41 process.source = cms.Source("EmptyIOVSource",
42  timetype = cms.string("runnumber"),
43  firstValue = cms.uint64(1),
44  lastValue = cms.uint64(1),
45  interval = cms.uint64(1)
46  )
47 
48 
49 process.makeCentralityTableDB = cms.EDAnalyzer('CentralityPopConProducer',
50  Source = cms.PSet(makeDBFromTFile = cms.untracked.bool(True),
51  inputFile = cms.string(ivars.inputFile),
52  rootTag = cms.string(ivars.outputTag)
53  ),
54  record = cms.string(hiRecord),
55  name= cms.untracked.string(ivars.outputTag),
56  loggingOn = cms.untracked.bool(True)
57  )
58 
59 process.load("CondCore.DBCommon.CondDBCommon_cfi")
60 process.CondDBCommon.connect = "oracle://cms_orcoff_prep/CMS_COND_PHYSICSTOOLS"
61 process.CondDBCommon.DBParameters.messageLevel = cms.untracked.int32(3)
62 process.CondDBCommon.DBParameters.authenticationPath = "authPath"
63 
64 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
65  process.CondDBCommon,
66  logconnect = cms.untracked.string("sqlite_file:" + "LogsTest.db"),
67  timetype = cms.untracked.string("runnumber"),
68  toPut = cms.VPSet(cms.PSet(record = cms.string(hiRecord),
69  tag = cms.string(ivars.outputTag)
70  )
71  )
72  )
73 
74 
75 
76 
77 process.step = cms.Path(process.makeCentralityTableDB)
78 
79 
80 
81 
82 
83