-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cfg writer for SimBeamSpotObjects payloads
- Loading branch information
1 parent
bec539c
commit daf6dd0
Showing
2 changed files
with
57 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
IOMC/EventVertexGenerators/test/BeamProfile2DBWriter_cfg.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
import FWCore.ParameterSet.VarParsing as VarParsing | ||
|
||
process = cms.Process("writeBeamProfile2DB") | ||
|
||
options = VarParsing.VarParsing() | ||
options.register('unitTest', | ||
False, # default value | ||
VarParsing.VarParsing.multiplicity.singleton, # singleton or list | ||
VarParsing.VarParsing.varType.bool, # string, int, or float | ||
"are we running the unit test?") | ||
options.register('inputTag', | ||
"myTagName", # default value | ||
VarParsing.VarParsing.multiplicity.singleton, # singleton or list | ||
VarParsing.VarParsing.varType.string, # string, int, or float | ||
"output tag name") | ||
options.parseArguments() | ||
|
||
|
||
process.load("FWCore.MessageLogger.MessageLogger_cfi") | ||
from CondCore.CondDB.CondDB_cfi import * | ||
|
||
if options.unitTest : | ||
tag_name = 'simBS_tag' | ||
else: | ||
tag_name = options.inputTag | ||
|
||
################################# | ||
# Produce a SQLITE FILE | ||
################################# | ||
CondDBSimBeamSpotObjects = CondDB.clone(connect = cms.string('sqlite_file:test_%s.db' % tag_name)) # choose an output name | ||
process.PoolDBOutputService = cms.Service("PoolDBOutputService", | ||
CondDBSimBeamSpotObjects, | ||
timetype = cms.untracked.string('runnumber'), | ||
toPut = cms.VPSet(cms.PSet(record = cms.string("SimBeamSpotObjectsRcd"), # SimBeamSpot record | ||
tag = cms.string(tag_name))), # choose your favourite tag | ||
loadBlobStreamer = cms.untracked.bool(False) | ||
) | ||
|
||
process.source = cms.Source("EmptySource") | ||
|
||
process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(1)) | ||
|
||
process.simbeamspotwriter = cms.EDAnalyzer("BeamProfile2DB", | ||
X0 = cms.double(0.0458532), # in cm | ||
Y0 = cms.double(-0.016966), # in cm | ||
Z0 = cms.double(-0.074992), # in cm | ||
SigmaZ = cms.double(3.6), # in cm | ||
BetaStar = cms.double(30.0), # in cm | ||
Emittance = cms.double(3.931e-8) # in cm | ||
) | ||
|
||
process.p = cms.Path(process.simbeamspotwriter) |