File indexing completed on 2024-04-06 12:02:42
0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003
0004 process = cms.Process("READ")
0005
0006 options = VarParsing.VarParsing()
0007 options.register('unitTest',
0008 False,
0009 VarParsing.VarParsing.multiplicity.singleton,
0010 VarParsing.VarParsing.varType.bool,
0011 "are we running the unit test?")
0012 options.register('inputTag',
0013 "myTagName",
0014 VarParsing.VarParsing.multiplicity.singleton,
0015 VarParsing.VarParsing.varType.string,
0016 "output tag name")
0017 options.register('startRun',
0018 1,
0019 VarParsing.VarParsing.multiplicity.singleton,
0020 VarParsing.VarParsing.varType.int,
0021 "location of the input data")
0022 options.register('startLumi',
0023 1,
0024 VarParsing.VarParsing.multiplicity.singleton,
0025 VarParsing.VarParsing.varType.int,
0026 "IOV Start Lumi")
0027 options.parseArguments()
0028
0029 process.load("FWCore.MessageService.MessageLogger_cfi")
0030 process.MessageLogger.cerr.FwkReport.reportEvery = 1000000
0031
0032 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0033
0034
0035
0036
0037
0038 process.source = cms.Source("EmptySource",
0039 firstRun = cms.untracked.uint32(options.startRun),
0040 firstLuminosityBlock = cms.untracked.uint32(options.startRun),
0041 numberEventsInLuminosityBlock = cms.untracked.uint32(1),
0042 numberEventsInRun = cms.untracked.uint32(1),
0043 )
0044
0045
0046
0047
0048
0049 if options.unitTest:
0050 tag_name = 'simBS_tag'
0051 else:
0052 tag_name = options.inputTag
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070
0071 from CondCore.CondDB.CondDB_cfi import *
0072 CondDBSimBeamSpot = CondDB.clone(connect = cms.string("sqlite_file:test_%s.db" % tag_name))
0073 process.PoolDBESSource = cms.ESSource("PoolDBESSource",
0074 CondDBSimBeamSpot,
0075 DumpStat=cms.untracked.bool(True),
0076 toGet = cms.VPSet(cms.PSet(
0077 record = cms.string('SimBeamSpotObjectsRcd'),
0078 tag = cms.string(tag_name)
0079 ))
0080 )
0081
0082
0083
0084
0085 from CondTools.BeamSpot.beamProfile2DBReader_cfi import beamProfile2DBReader
0086 process.BeamProfile2DBRead = beamProfile2DBReader.clone(rawFileName = 'reference_SimBeamSpotObjects.txt')
0087
0088
0089
0090
0091 process.TFileService = cms.Service("TFileService",
0092 fileName=cms.string("reference_SimBeamSpotObjects.root")
0093 )
0094
0095
0096 process.p = cms.Path(process.BeamProfile2DBRead)