Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-01-13 01:43:24

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 process = cms.Process("Demo")
0005 
0006 #prepare options
0007 
0008 options = VarParsing.VarParsing("analysis")
0009 
0010 options.register ('globalTag',
0011                   "auto:run3_data_prompt",
0012                   VarParsing.VarParsing.multiplicity.singleton,  # singleton or list
0013                   VarParsing.VarParsing.varType.string,          # string, int, or float
0014                   "GlobalTag")
0015 
0016 options.register ('runNumber',
0017                   1,
0018                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0019                   VarParsing.VarParsing.varType.int,            # string, int, or float
0020                   "run number")
0021 
0022 options.register ('additionalConds',
0023                   "sqlite_file:gainManipulations.db",
0024                   VarParsing.VarParsing.multiplicity.singleton, # singleton or list
0025                   VarParsing.VarParsing.varType.string,         # string, int, or float
0026                   "location of the additional conditions")
0027 
0028 options.parseArguments()
0029 
0030 
0031 ##
0032 ## MessageLogger
0033 ##
0034 process.load('FWCore.MessageService.MessageLogger_cfi')   
0035 process.MessageLogger.cerr.enable = False
0036 process.MessageLogger.SiStripApvGainRescaler=dict()
0037 process.MessageLogger.cout = cms.untracked.PSet(
0038     enable    = cms.untracked.bool(True),
0039     enableStatistics = cms.untracked.bool(True),
0040     threshold = cms.untracked.string("INFO"),
0041     default   = cms.untracked.PSet(limit = cms.untracked.int32(0)),                       
0042     FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1),
0043                                    reportEvery = cms.untracked.int32(1000)
0044                                    ),                                                      
0045     SiStripApvGainRescaler  = cms.untracked.PSet( limit = cms.untracked.int32(-1))
0046     )
0047 
0048 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0049 from Configuration.AlCa.GlobalTag import GlobalTag
0050 process.GlobalTag = GlobalTag(process.GlobalTag,options.globalTag, '')
0051 process.GlobalTag.toGet = cms.VPSet(
0052     ### N.B. This contains the G1_new (to be used for the rescale)
0053     cms.PSet(record = cms.string("SiStripApvGain3Rcd"),
0054              tag = cms.string("G1_new"),
0055              connect = cms.string(options.additionalConds)
0056              ),
0057     ### N.B. This contains the G2_old (to be used for the rescale)
0058     cms.PSet(record = cms.string("SiStripApvGain2Rcd"),
0059              tag = cms.string("G2_old"),
0060              connect = cms.string(options.additionalConds)
0061              ),
0062     ### N.B. This contains the G1_old (to be used for the rescale)
0063     cms.PSet(record = cms.string("SiStripApvGainRcd"),
0064              tag = cms.string("G1_old"),
0065              connect = cms.string(options.additionalConds)
0066              )
0067     )
0068 
0069 process.source = cms.Source("EmptySource",
0070                             firstRun = cms.untracked.uint32(options.runNumber),
0071                             numberEventsInRun = cms.untracked.uint32(1),
0072                             )
0073 
0074 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1) )
0075 
0076 process.load("CondTools.SiStrip.rescaleGain2byGain1_cfi") 
0077 
0078 # process.demo = cms.EDAnalyzer('SiStripApvGainRescaler',
0079 #                               Record = cms.untracked.string("SiStripApvGainRcd"),
0080 #                               )
0081 
0082 ##
0083 ## Database output service
0084 ##
0085 process.load("CondCore.CondDB.CondDB_cfi")
0086 
0087 ##
0088 ## Output database (in this case local sqlite file)
0089 ##
0090 process.CondDB.connect = 'sqlite_file:G2_new.db'
0091 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0092                                           process.CondDB,
0093                                           timetype = cms.untracked.string('runnumber'),
0094                                           toPut = cms.VPSet(cms.PSet(record = cms.string('SiStripApvGainRcd'),
0095                                                                      tag = cms.string('G2_new')
0096                                                                      )
0097                                                             )
0098                                           )
0099 
0100 process.p = cms.Path(process.rescaleGain2byGain1)