Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:31

0001 #! /usr/bin/env cmsRun
0002 # Author: Izaak Neutelings (March 2020)
0003 from __future__ import print_function
0004 import FWCore.ParameterSet.Config as cms
0005 from Configuration.StandardSequences.Eras import eras
0006 
0007 # SETTINGS
0008 run       = 313000
0009 era       = eras.Run2_2017
0010 verbose   = False #or True
0011 threshold = 'INFO' if verbose else 'WARNING'
0012 print(">>> run = %s"%run)
0013 
0014 # LOAD PROCESS
0015 process = cms.Process("SiPixelVCalReader",era)
0016 process.load("FWCore.MessageService.MessageLogger_cfi")
0017 process.load("Configuration.StandardSequences.GeometryDB_cff")
0018 #process.load("Configuration.StandardSequences.GeometryIdeal_cff")
0019 #process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0020 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0021 #process.load("CondTools.SiPixel.SiPixelGainCalibrationService_cfi")
0022 process.load("CondCore.CondDB.CondDB_cfi")
0023 
0024 # BASIC SETTINGS
0025 process.source = cms.Source("EmptyIOVSource",
0026     firstValue = cms.uint64(run),
0027     lastValue = cms.uint64(run),
0028     #firstRun = cms.untracked.uint32(run),
0029     timetype = cms.string('runnumber'),
0030     interval = cms.uint64(1),
0031 )
0032 ###process.source = cms.Source("EmptySource",
0033 ###    #lastRun = cms.untracked.uint32(1),
0034 ###    #timetype = cms.string('runnumber'),
0035 ###    #interval = cms.uint32(1),
0036 ###    firstRun = cms.untracked.uint32(run) # select the geometry for Phase-I pixels
0037 ###)
0038 process.maxEvents = cms.untracked.PSet(
0039     input = cms.untracked.int32(1)
0040 )
0041 
0042 # GLOBAL TAG
0043 from Configuration.AlCa.GlobalTag import GlobalTag
0044 #from Configuration.AlCa.autoCond import autoCond
0045 #process.GlobalTag.globaltag = "auto:run2_data'" #autoCond['run2_design']
0046 # In case you of conditions missing, or if you want to test a specific GT
0047 #process.GlobalTag.globaltag = 'PRE_DES72_V6'
0048 process.GlobalTag = GlobalTag(process.GlobalTag,'auto:run2_data','')
0049 print(">>> globaltag = '%s'"%(process.GlobalTag.globaltag))
0050 
0051 # EXTRA
0052 outfile = "siPixelVCal.root"
0053 print(">>> outfile = '%s'"%outfile)
0054 process.TFileService = cms.Service("TFileService",
0055     fileName = cms.string(outfile)
0056 )
0057 process.MessageLogger = cms.Service("MessageLogger",
0058     cerr = cms.untracked.PSet(
0059         enable = cms.untracked.bool(False)
0060     ),
0061     cout = cms.untracked.PSet(
0062         enable = cms.untracked.bool(True),
0063         threshold = cms.untracked.string('WARNING')
0064     )
0065 )
0066 process.Timing = cms.Service("Timing")
0067 
0068 # READER
0069 sqlfile = "sqlite_file:siPixelVCal.db"
0070 print(">>> sqlfile = '%s'"%sqlfile)
0071 process.VCalReaderSource = cms.ESSource("PoolDBESSource",
0072     #BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0073     DBParameters = cms.PSet(
0074         messageLevel = cms.untracked.int32(0),
0075         authenticationPath = cms.untracked.string('')
0076     ),
0077     connect = cms.string(sqlfile),
0078     toGet = cms.VPSet(
0079         cms.PSet(
0080             record = cms.string("SiPixelVCalRcd"),
0081             #tag = cms.string("trivial_VCal")
0082             tag = cms.string("SiPixelVCal_v1")
0083             #tag = cms.string("SiPixelVCal_2015_v2")
0084         ),
0085         #cms.PSet(
0086         #    record = cms.string("SiPixelVCalSimRcd"),
0087         #    tag = cms.string("trivial_VCal_Sim")
0088         #)
0089     ),
0090 )
0091 process.myprefer = cms.ESPrefer("PoolDBESSource","VCalReaderSource")
0092 
0093 process.VCalReader = cms.EDAnalyzer("SiPixelVCalReader",
0094     printDebug = cms.untracked.bool(False),
0095     useSimRcd = cms.bool(False)
0096 )
0097 #process.VCalSimReader = cms.EDAnalyzer("SiPixelVCalReader",
0098 #    printDebug = cms.untracked.bool(False),
0099 #    useSimRcd = cms.bool(True)                                    
0100 #)
0101 
0102 #process.p = cms.Path(process.VCalReader*process.VCalSimReader)
0103 process.p = cms.Path(process.VCalReader)