Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-11 03:56:57

0001 import FWCore.ParameterSet.Config as cms
0002 import FWCore.ParameterSet.VarParsing as VarParsing
0003 
0004 options = VarParsing.VarParsing()
0005 options.register('runN',
0006                  1,
0007                  VarParsing.VarParsing.multiplicity.singleton,
0008                  VarParsing.VarParsing.varType.int,
0009                  "runN in the IOV.")
0010 options.register('tag',
0011                  'SiStripApvGain_GR10_v1_hlt',
0012                  VarParsing.VarParsing.multiplicity.singleton,
0013                  VarParsing.VarParsing.varType.string,
0014                  "input tag")
0015 options.register('inputFiles',
0016                  'frontier://FrontierProd/CMS_CONDITIONS',
0017                  VarParsing.VarParsing.multiplicity.singleton,
0018                  VarParsing.VarParsing.varType.string,
0019                  "input files")
0020 options.parseArguments()
0021 
0022 if (not options.tag or not options.inputFiles):
0023     raise ValueError('usage: cmsRun SiStripApvGainReader_cfg.py inputFiles=my_input_file  tag=my_tag')
0024 process = cms.Process("SiStripApvGainReader")
0025 
0026 process.MessageLogger = cms.Service(
0027     "MessageLogger",
0028     debugModules = cms.untracked.vstring(''),
0029     threshold = cms.untracked.string('INFO'),
0030     destinations = cms.untracked.vstring('SiStripApvGainReader.log')
0031     )
0032 
0033 ##
0034 ## Empty events source
0035 ## (specify the run number to pick correct IOV) 
0036 ##
0037 process.source = cms.Source("EmptySource",
0038                             numberEventsInRun = cms.untracked.uint32(1),
0039                             firstRun = cms.untracked.uint32(options.runN)
0040                             )
0041 
0042 process.maxEvents = cms.untracked.PSet(
0043     input = cms.untracked.int32(1)
0044     )
0045 
0046 ##
0047 ## To Correctly build the SiStripGainRcd in the ES
0048 ## we need all the dependent records => specify a Global Tag  
0049 ##
0050 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0051 from Configuration.AlCa.GlobalTag import GlobalTag
0052 
0053 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '')
0054 
0055 
0056 ##
0057 ## Prefer the SiStripApvGainRcd or SiStripApvGain2Rcd
0058 ## under test  
0059 ##
0060 process.poolDBESSource = cms.ESSource("PoolDBESSource",
0061                                       connect = cms.string(options.inputFiles),
0062                                       toGet = cms.VPSet(cms.PSet(record = cms.string('SiStripApvGainRcd'),
0063                                                                  tag = cms.string(options.tag)
0064                                                                  )
0065                                                         )
0066                                       )
0067 process.prefer_poolDBESSource = cms.ESPrefer("PoolDBESSource","poolDBESSource")
0068 
0069 ##
0070 ## Dump the Gain payload. It will be in the format
0071 ## DetId APV1 APV2 APV3 APV4 (APV5) (APV6) 
0072 ##
0073 process.gainreader = cms.EDAnalyzer("SiStripApvGainReader",
0074                                     printDebug = cms.untracked.bool(True),
0075                                     outputFile = cms.untracked.string("SiStripApvGains_dump.txt"),
0076                                     gainType   = cms.untracked.uint32(0)    #0 for G1, 1 for G2
0077                                     )
0078 
0079 process.TFileService = cms.Service("TFileService",
0080                                    fileName = cms.string("gain.root"),
0081                                    closeFileFast = cms.untracked.bool(True)
0082                                    )
0083 
0084 process.p1 = cms.Path(process.gainreader)
0085 
0086