CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/RecoHI/HiCentralityAlgos/tools/runTestDB.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.VarParsing as VarParsing
00002 
00003 ivars = VarParsing.VarParsing('standard')
00004 
00005 ivars.register ('outputTag',
00006                 mult=ivars.multiplicity.singleton,
00007                 mytype=ivars.varType.string,
00008                 info="for testing")
00009 ivars.outputTag="HFhits40_MC_Hydjet2760GeV_MC_3XY_V24_v0"
00010 
00011 ivars.register ('inputFile',
00012                 mult=ivars.multiplicity.singleton,
00013                 mytype=ivars.varType.string,
00014                 info="for testing")
00015 
00016 ivars.register ('outputFile',
00017                 mult=ivars.multiplicity.singleton,
00018                 mytype=ivars.varType.string,
00019                 info="for testing")
00020 
00021 ivars.inputFile="../data/CentralityTables.root"
00022 ivars.outputFile="Test.db"
00023 
00024 ivars.parseArguments()
00025 
00026 hiRecord = 'HeavyIonRcd'
00027 
00028 import FWCore.ParameterSet.Config as cms
00029 
00030 process = cms.Process('DUMMY')
00031 
00032 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
00033 
00034 process.MessageLogger = cms.Service("MessageLogger",
00035                                     cout = cms.untracked.PSet(
00036     threshold = cms.untracked.string('INFO')
00037     ),
00038                                     destinations = cms.untracked.vstring('cout')
00039                                     )
00040 
00041 process.source = cms.Source("EmptyIOVSource",
00042                             timetype = cms.string("runnumber"),
00043                             firstValue = cms.uint64(1),
00044                             lastValue = cms.uint64(1),
00045                             interval = cms.uint64(1)
00046                             )
00047 
00048 
00049 process.makeCentralityTableDB = cms.EDAnalyzer('CentralityPopConProducer',
00050                                                Source = cms.PSet(makeDBFromTFile = cms.untracked.bool(True),
00051                                                                  inputFile = cms.string(ivars.inputFile),
00052                                                                  rootTag = cms.string(ivars.outputTag)
00053                                                                  ),
00054                                                record = cms.string(hiRecord),
00055                                                name= cms.untracked.string(ivars.outputTag),
00056                                                loggingOn = cms.untracked.bool(True)
00057                                                )
00058 
00059 process.load("CondCore.DBCommon.CondDBCommon_cfi")
00060 process.CondDBCommon.connect = "oracle://cms_orcoff_prep/CMS_COND_PHYSICSTOOLS"
00061 process.CondDBCommon.DBParameters.messageLevel = cms.untracked.int32(3)
00062 process.CondDBCommon.DBParameters.authenticationPath = "authPath"
00063 
00064 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
00065                                           process.CondDBCommon,
00066                                           logconnect = cms.untracked.string("sqlite_file:" + "LogsTest.db"),
00067                                           timetype = cms.untracked.string("runnumber"),
00068                                           toPut = cms.VPSet(cms.PSet(record = cms.string(hiRecord),
00069                                                                      tag = cms.string(ivars.outputTag)
00070                                                                      )
00071                                                             )
00072                                           )
00073 
00074 
00075 
00076 
00077 process.step  = cms.Path(process.makeCentralityTableDB)
00078 
00079 
00080 
00081 
00082 
00083