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("writeBeamProfile2DB")
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.parseArguments()
0018
0019
0020 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0021 from CondCore.CondDB.CondDB_cfi import *
0022
0023 if options.unitTest :
0024 tag_name = 'simBS_tag'
0025 else:
0026 tag_name = options.inputTag
0027
0028
0029
0030
0031 CondDBSimBeamSpotObjects = CondDB.clone(connect = cms.string('sqlite_file:test_%s.db' % tag_name))
0032 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0033 CondDBSimBeamSpotObjects,
0034 timetype = cms.untracked.string('runnumber'),
0035 toPut = cms.VPSet(cms.PSet(record = cms.string("SimBeamSpotObjectsRcd"),
0036 tag = cms.string(tag_name))),
0037 loadBlobStreamer = cms.untracked.bool(False)
0038 )
0039
0040 process.source = cms.Source("EmptySource")
0041
0042 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1))
0043
0044 from CondTools.BeamSpot.beamProfile2DBWriter_cfi import beamProfile2DBWriter
0045
0046
0047 process.BeamProfile2DBWriter = beamProfile2DBWriter.clone(X0 = 0.0458532,
0048 Y0 = -0.016966,
0049 Z0 = -0.074992,
0050 SigmaZ = 3.6,
0051 BetaStar = 30.0,
0052 Emittance = 3.931e-8,)
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 process.p = cms.Path(process.BeamProfile2DBWriter)