Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 import FWCore.ParameterSet.Config as cms
0002 import sys
0003 
0004 process = cms.Process("SiPixel2DTemplateDBReaderTest")
0005 process.load("CondCore.DBCommon.CondDBSetup_cfi")
0006 process.load("FWCore.MessageService.MessageLogger_cfi")
0007 #process.load("CalibTracker.SiPixelESProducers.SiPixel2DTemplateDBObjectESProducer_cfi")
0008 
0009 #magfield and version are argument #1 and #2
0010 #magfield = float(sys.argv[2])
0011 #version = sys.argv[3]
0012 
0013 #magfield and version are hardcoded for the record
0014 magfield = 38
0015 version = "v2"
0016 
0017 ## Change to False if you do not want to test the global tag
0018 testGlobalTag = False
0019 
0020 if(magfield==0):
0021     magfieldString = "0T"
0022     magfieldCffStr = "0T"
0023 elif(magfield==2   or magfield==20):
0024     magfieldString = "2T"
0025     magfieldCffStr = "20T"
0026 elif(magfield==3   or magfield==30):
0027     magfieldString = "3T"
0028     magfieldCffStr = "30T"
0029 elif(magfield==3.5 or magfield==35):
0030     magfieldString = "35T"
0031     magfieldCffStr = "35T"
0032 elif(magfield==4   or magfield==40):
0033     magfieldString = "4T"
0034     magfieldCffStr = "40T"
0035 else:
0036     magfieldString = "38T"
0037     magfieldCffStr = "38T"
0038     magfield = 3.8
0039 
0040 #Load the correct Magnetic Field
0041 process.load("Configuration.StandardSequences.MagneticField_"+magfieldCffStr+"_cff")
0042 
0043 #Change to True if you would like a more detailed error output
0044 wantDetailedOutput = False
0045 #Change to True if you would like to output the full 2DTemplate database object
0046 wantFullOutput = False
0047 
0048 process.source = cms.Source("EmptySource")
0049 
0050 process.maxEvents = cms.untracked.PSet(
0051     input = cms.untracked.int32(1)
0052     )
0053 
0054 if testGlobalTag :
0055     process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
0056 #    process.GlobalTag.globaltag = "MC_70_V4::All"
0057     process.GlobalTag.globaltag = "START71_V1::All"
0058     
0059 #Uncomment these two lines to get from the global tag
0060 else:
0061     process.PoolDBESSource = cms.ESSource("PoolDBESSource",
0062                                           process.CondDBSetup,
0063                                           toGet = cms.VPSet(cms.PSet(
0064         record = cms.string('SiPixel2DTemplateDBObjectRcd'),
0065         tag = cms.string('SiPixel2DTemplateDBObject' + magfieldString + version)
0066         )),
0067                               timetype = cms.string('runnumber'),
0068                               #when arguments used
0069                               #connect = cms.string('sqlite_file:siPixel2DTemplates' + magfieldString + version + '.db')
0070                               #when parameters hardcoded
0071                               connect = cms.string('sqlite_file:siPixel2DTemplates38T_IOV5.db')
0072                               #connect = cms.string('sqlite_file:/afs/cern.ch/cms/CAF/CMSALCA/ALCA_TRACKERCALIB/Pixels/PixelDB2014/SiPixel2DTemplateDBObject/SiPixel2DTemplateDBObject_710pre7/builder/siPixel2DTemplates38T.db')
0073                               )
0074     process.PoolDBESSource.DBParameters.authenticationPath='.'
0075     process.PoolDBESSource.DBParameters.messageLevel=0
0076 
0077 process.reader = cms.EDAnalyzer("SiPixel2DTemplateDBObjectReader",
0078                               siPixel2DTemplateCalibrationLocation = cms.string(
0079 #                             "CalibTracker/SiPixelESProducers"),
0080                              "CondTools/SiPixel"),
0081                               wantDetailed2DTemplateDBErrorOutput = cms.bool(wantDetailedOutput),
0082                               wantFull2DTemplateDBOutput = cms.bool(wantFullOutput),
0083                               TestGlobalTag = cms.bool(testGlobalTag)
0084                               )
0085 
0086 #process.myprint = cms.OutputModule("AsciiOutputModule")
0087 
0088 process.p = cms.Path(process.reader)
0089 
0090 
0091 
0092 
0093 
0094