Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-05 01:44:47

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 import FWCore.ParameterSet.VarParsing as VarParsing
0004 options = VarParsing.VarParsing()
0005 options.register("isUnitTest",
0006                  False,
0007                  VarParsing.VarParsing.multiplicity.singleton,
0008                  VarParsing.VarParsing.varType.bool,
0009                  "are we running the unit test")
0010 options.parseArguments()
0011 
0012 process = cms.Process("HitEffHarvest")
0013 process.load("Configuration.StandardSequences.MagneticField_cff")
0014 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0015 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0016 process.load('Configuration.StandardSequences.DQMSaverAtRunEnd_cff')
0017 process.load('FWCore.MessageService.MessageLogger_cfi')
0018 
0019 from Configuration.AlCa.GlobalTag import GlobalTag
0020 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '')  
0021 
0022 process.source = cms.Source("DQMRootSource",
0023     fileNames = cms.untracked.vstring('file:DQM.root')
0024 )
0025 
0026 runNumber = 325172
0027 
0028 process.maxEvents = cms.untracked.PSet(input = cms.untracked.int32(-1))
0029 
0030 process.hiteffharvest = cms.EDProducer("SiStripHitEfficiencyHarvester",
0031     Threshold           = cms.double(0.1),
0032     nModsMin            = cms.int32(5),
0033     AutoIneffModTagging = cms.untracked.bool(True),  # default true, automatic limit for each layer to identify inefficient modules
0034     Record              = cms.string('SiStripBadStrip'),
0035     doStoreOnDB         = cms.bool(True),
0036     ShowRings           = cms.untracked.bool(False),  # default False
0037     TkMapMin            = cms.untracked.double(0.90), # default 0.90
0038     Title               = cms.string(' Hit Efficiency - run {0:d}'.format(runNumber)))
0039 
0040 process.load("DQM.SiStripCommon.TkHistoMap_cff")
0041 
0042 process.allPath = cms.Path(process.hiteffharvest*process.DQMSaver)
0043 
0044 if(options.isUnitTest):
0045     process.MessageLogger.cerr.enable = False
0046     process.MessageLogger.TkHistoMap = dict()
0047     process.MessageLogger.SiStripHitEfficiency = dict()  
0048     process.MessageLogger.SiStripHitEfficiencyHarvester = dict()
0049     process.MessageLogger.cout = cms.untracked.PSet(
0050         enable    = cms.untracked.bool(True),        
0051         threshold = cms.untracked.string("INFO"),
0052         enableStatistics = cms.untracked.bool(True),
0053         default   = cms.untracked.PSet(limit = cms.untracked.int32(0)),                       
0054         FwkReport = cms.untracked.PSet(limit = cms.untracked.int32(-1),
0055                                        reportEvery = cms.untracked.int32(1)),
0056         TkHistoMap = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0057         SiStripHitEfficiency = cms.untracked.PSet( limit = cms.untracked.int32(-1)),
0058         SiStripHitEfficiencyHarvester =  cms.untracked.PSet( limit = cms.untracked.int32(-1))
0059     )
0060 else:
0061     process.MessageLogger = cms.Service(
0062         "MessageLogger",
0063         destinations = cms.untracked.vstring("log_hiteffharvest"),
0064         log_hiteffharvest = cms.untracked.PSet(
0065             threshold = cms.untracked.string("DEBUG"),
0066             default = cms.untracked.PSet(
0067                 limit = cms.untracked.int32(-1)
0068             )
0069         ),
0070         debugModules = cms.untracked.vstring("hiteffharvest"),
0071         categories=cms.untracked.vstring("TkHistoMap", 
0072                                          "SiStripHitEfficiency:HitEff", 
0073                                          "SiStripHitEfficiency", 
0074                                          "SiStripHitEfficiencyHarvester")
0075     )
0076 
0077 process.TFileService = cms.Service("TFileService",
0078         fileName = cms.string('SiStripHitEffHistos_run{0:d}_NEW.root'.format(runNumber))
0079 )
0080 
0081 process.PoolDBOutputService = cms.Service("PoolDBOutputService",
0082     BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService'),
0083     DBParameters = cms.PSet(
0084         authenticationPath = cms.untracked.string('/afs/cern.ch/cms/DB/conddb')
0085     ),
0086     timetype = cms.untracked.string('runnumber'),
0087     connect = cms.string('sqlite_file:dbfile_NEW.db'),
0088     toPut = cms.VPSet(cms.PSet(
0089         record = cms.string('SiStripBadStrip'),
0090         tag = cms.string('SiStripHitEffBadModules')
0091     ))
0092 )