Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:44

0001 ##### configuration #####

0002 output_conditions = 'sqlite_file:alignment_config.db'  # output database

0003 run_number = 1  # beginning of the IOV

0004 db_tag = 'PPSAlignmentConfiguration_v1_express'  # database tag

0005 produce_logs = True  # if set to True, a file with logs will be produced.

0006 product_instance_label = 'db_test'  # ES product label

0007 # ESSource parameters can be configured below

0008 #########################

0009 
0010 import FWCore.ParameterSet.Config as cms
0011 
0012 process = cms.Process("writePPSAlignmentConfiguration")
0013 
0014 # Message Logger

0015 if produce_logs:
0016     process.MessageLogger = cms.Service("MessageLogger",
0017         destinations = cms.untracked.vstring('write_PPSAlignmentConfiguration',
0018                                              'cout'
0019                                             ),
0020         write_PPSAlignmentConfiguration = cms.untracked.PSet(
0021             threshold = cms.untracked.string('INFO')
0022         ),
0023         cout = cms.untracked.PSet(
0024             threshold = cms.untracked.string('WARNING')
0025         )
0026     )
0027 else:
0028     process.MessageLogger = cms.Service("MessageLogger",
0029         destinations = cms.untracked.vstring('cout'),
0030         cout = cms.untracked.PSet(
0031             threshold = cms.untracked.string('WARNING')
0032         )
0033     )
0034 
0035 # Load CondDB service

0036 process.load("CondCore.CondDB.CondDB_cfi")
0037 
0038 # output database

0039 process.CondDB.connect = output_conditions
0040 
0041 # A data source must always be defined. We don't need it, so here's a dummy one.

0042 process.source = cms.Source("EmptyIOVSource",
0043     timetype = cms.string('runnumber'),
0044     firstValue = cms.uint64(run_number),
0045     lastValue = cms.uint64(run_number),
0046     interval = cms.uint64(1)
0047 )
0048 
0049 # output service

0050 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0051     process.CondDB,
0052     timetype = cms.untracked.string('runnumber'),
0053     toPut = cms.VPSet(cms.PSet(
0054         record = cms.string('PPSAlignmentConfigurationRcd'),
0055         tag = cms.string(db_tag)
0056     ))
0057 )
0058 
0059 # ESSource

0060 process.ppsAlignmentConfigurationESSource = cms.ESSource("PPSAlignmentConfigurationESSource",
0061     # PPSAlignmentConfigurationESSource parameters, defaults will be taken from fillDescriptions

0062     label = cms.string(product_instance_label),
0063     sector_45 = cms.PSet(
0064         rp_N = cms.PSet(
0065             name = cms.string('db_test_RP'),
0066             id = cms.int32(44),
0067             y_max_fit_mode = cms.double(66.6)
0068         )
0069     ),
0070     y_alignment = cms.PSet(
0071         rp_L_F = cms.PSet(
0072             x_min = cms.double(102),
0073             x_max = cms.double(210.0)
0074         )
0075     ),
0076     extra_params = cms.vdouble( 1.15, 102., 777.7 )
0077 )
0078 
0079 # DB object maker

0080 process.config_writer = cms.EDAnalyzer("WritePPSAlignmentConfiguration",
0081     record = cms.string('PPSAlignmentConfigurationRcd'),
0082     loggingOn = cms.untracked.bool(True),
0083     SinceAppendMode = cms.bool(True),
0084     Source = cms.PSet(
0085         IOVRun = cms.untracked.uint32(1)
0086     ),
0087     label = cms.string(product_instance_label)
0088 )
0089 
0090 process.path = cms.Path(process.config_writer)