Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-03 02:23:25

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