Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:12:55

0001 from __future__ import print_function
0002 import os
0003 import FWCore.ParameterSet.Config as cms
0004 
0005 #
0006 # --- [cosmic sequence (default=True)?]
0007 iscosmics = 'False'
0008 print('iscosmics (default=True) = '+str(iscosmics))
0009 # --- [name of job & output file (default=test)?]
0010 jobname = 'test'
0011 print('jobname (default=test) = '+str(jobname))
0012 #
0013 # --- [number of events (default=1000)]
0014 nevents = 1000
0015 print('nevents (default=1000)  = '+str(nevents))
0016 #
0017 # --- [turn on all histograms (default=True)?]
0018 allhist = 'True'
0019 print('allhist (default=True) = '+str(allhist))
0020 #
0021 #--- [trigger set (default=HLT)]
0022 trigger_set = 'HLT'
0023 print('trigger set name (default=HLT) = '+str(trigger_set))
0024 
0025 #-----
0026 process = cms.Process("test")
0027 process.load("CondCore.DBCommon.CondDBSetup_cfi")
0028 
0029 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0030 process.load("Configuration.StandardSequences.MagneticField_cff")
0031 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0032 
0033 #
0034 # DQM
0035 #
0036 process.load("DQMServices.Core.DQM_cfg")
0037 
0038 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
0039 
0040 
0041 #
0042 # BeamHaloData producer
0043 #
0044 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0045 process.load("Configuration.StandardSequences.Reconstruction_cff")
0046 process.load("Configuration/StandardSequences/MagneticField_cff")
0047 process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff")
0048 process.load("RecoMET/Configuration/RecoMET_BeamHaloId_cff")
0049 process.GlobalTag.globaltag ='GR_R_42_V19::All'
0050 
0051 # the task - JetMET objects
0052 if iscosmics =="True":
0053   process.load("DQMOffline.JetMET.jetMETDQMOfflineSourceCosmic_cff")
0054 else:
0055   process.load("DQMOffline.JetMET.jetMETDQMOfflineSource_cff")
0056 
0057 process.jetMETAnalyzer.OutputMEsInRootFile = cms.bool(True)
0058 process.jetMETAnalyzer.OutputFileName = cms.string("jetMETMonitoring_%s.root" % jobname)
0059 
0060 process.jetMETAnalyzer.TriggerResultsLabel = cms.InputTag("TriggerResults","",trigger_set)
0061 process.jetMETAnalyzer.processname = cms.string(trigger_set)
0062 
0063 #event cleanup stuff
0064 process.jetMETAnalyzer.doPrimaryVertexCheck   = cms.bool(False)
0065 #process.jetMETAnalyzer.doHLTPhysicsOn         = cms.bool(False)
0066 process.jetMETAnalyzer.tightBHFiltering       = cms.bool(False)
0067 
0068 process.jetMETAnalyzer.caloMETAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0069 #process.jetMETAnalyzer.caloMETAnalysis.doHLTPhysicsOn         = cms.bool(False)
0070 process.jetMETAnalyzer.caloMETAnalysis.tightBHFiltering       = cms.bool(False)
0071 process.jetMETAnalyzer.caloMETAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0072 
0073 process.jetMETAnalyzer.caloMETNoHFAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0074 #process.jetMETAnalyzer.caloMETNoHFAnalysis.doHLTPhysicsOn         = cms.bool(False)
0075 process.jetMETAnalyzer.caloMETNoHFAnalysis.tightBHFiltering       = cms.bool(False)
0076 process.jetMETAnalyzer.caloMETNoHFAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0077 
0078 process.jetMETAnalyzer.caloMETHOAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0079 #process.jetMETAnalyzer.caloMETHOAnalysis.doHLTPhysicsOn         = cms.bool(False)
0080 process.jetMETAnalyzer.caloMETHOAnalysis.tightBHFiltering       = cms.bool(False)
0081 process.jetMETAnalyzer.caloMETHOAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0082 
0083 process.jetMETAnalyzer.caloMETNoHFHOAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0084 #process.jetMETAnalyzer.caloMETNoHFHOAnalysis.doHLTPhysicsOn         = cms.bool(False)
0085 process.jetMETAnalyzer.caloMETNoHFHOAnalysis.tightBHFiltering       = cms.bool(False)
0086 process.jetMETAnalyzer.caloMETNoHFHOAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0087 
0088 process.jetMETAnalyzer.pfMETAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0089 #process.jetMETAnalyzer.pfMETAnalysis.doHLTPhysicsOn         = cms.bool(False)
0090 process.jetMETAnalyzer.pfMETAnalysis.tightBHFiltering       = cms.bool(False)
0091 process.jetMETAnalyzer.pfMETAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0092 
0093 process.jetMETAnalyzer.tcMETAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0094 #process.jetMETAnalyzer.tcMETAnalysis.doHLTPhysicsOn         = cms.bool(False)
0095 process.jetMETAnalyzer.tcMETAnalysis.tightBHFiltering       = cms.bool(False)
0096 process.jetMETAnalyzer.tcMETAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0097 
0098 process.jetMETAnalyzer.mucorrMETAnalysis.doPrimaryVertexCheck   = cms.bool(False)
0099 #process.jetMETAnalyzer.mucorrMETAnalysis.doHLTPhysicsOn         = cms.bool(False)
0100 process.jetMETAnalyzer.mucorrMETAnalysis.tightBHFiltering       = cms.bool(False)
0101 process.jetMETAnalyzer.mucorrMETAnalysis.tightJetIDFiltering    = cms.int32(-1) #-1 off, 0 minimal, 1 loose, 2 tight
0102 
0103 
0104 if allhist=="True":
0105   process.jetMETAnalyzer.DoJetPtAnalysis = cms.untracked.bool(True)
0106   process.jetMETAnalyzer.DoJetPtCleaning = cms.untracked.bool(True)
0107   process.jetMETAnalyzer.DoIterativeCone = cms.untracked.bool(True)
0108 
0109 process.jetMETAnalyzer.caloMETAnalysis.verbose = cms.int32(0)
0110 
0111 if allhist=="True":
0112   process.jetMETAnalyzer.caloMETAnalysis.allSelection       = cms.bool(True)
0113   process.jetMETAnalyzer.caloMETNoHFAnalysis.allSelection   = cms.bool(True)
0114   process.jetMETAnalyzer.caloMETHOAnalysis.allSelection     = cms.bool(True)
0115   process.jetMETAnalyzer.caloMETNoHFHOAnalysis.allSelection = cms.bool(True)
0116   process.jetMETAnalyzer.pfMETAnalysis.allSelection         = cms.bool(True)
0117   process.jetMETAnalyzer.tcMETAnalysis.allSelection         = cms.bool(True)
0118   process.jetMETAnalyzer.mucorrMETAnalysis.allSelection     = cms.bool(True)
0119 
0120 # the task - JetMET trigger
0121 process.load("DQMOffline.Trigger.JetMETHLTOfflineSource_cfi")
0122 
0123 # check # of bins
0124 process.load("DQMServices.Components.DQMStoreStats_cfi")
0125 
0126 # for igprof
0127 #process.IgProfService = cms.Service("IgProfService",
0128 #  reportFirstEvent            = cms.untracked.int32(0),
0129 #  reportEventInterval         = cms.untracked.int32(25),
0130 #  reportToFileAtPostEvent     = cms.untracked.string("| gzip -c > igdqm.%I.gz")
0131 #)
0132 
0133 #
0134 # /Wmunu/Summer09-MC_31X_V3-v1/GEN-SIM-RECO
0135 #process.source = cms.Source("PoolSource",
0136 #    fileNames = cms.untracked.vstring(*inputfiles))
0137 
0138 #Load files from text
0139 #import FWCore.Python.FileUtils as FileUtils
0140 import FWCore.Utilities.FileUtils as FileUtils
0141 readFiles = cms.untracked.vstring( FileUtils.loadListFromFile ('inputfile_MinimumBias_ReReco_122294.txt') )
0142 
0143 #Extend the list if needed...
0144 #readFiles.extend( FileUtils.loadListFromFile ('moreInfoIwant.txt') )
0145 
0146 #Read the input files
0147 process.source = cms.Source ("PoolSource",fileNames = readFiles)
0148 
0149 #
0150 process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*')
0151 #
0152 process.maxEvents = cms.untracked.PSet(
0153     input = cms.untracked.int32( nevents )
0154 )
0155 process.Timing = cms.Service("Timing")
0156 
0157 ## # Comment this out or reconfigure to see error messages 
0158 process.MessageLogger = cms.Service("MessageLogger",
0159     debugModules = cms.untracked.vstring('jetMETAnalyzer'),
0160     cout = cms.untracked.PSet(
0161         default = cms.untracked.PSet(
0162             limit = cms.untracked.int32(0)
0163         ),
0164         jetMETAnalyzer = cms.untracked.PSet(
0165             limit = cms.untracked.int32(100)
0166         ),
0167         noLineBreaks = cms.untracked.bool(True),
0168         DEBUG = cms.untracked.PSet(
0169             limit = cms.untracked.int32(0)
0170         ),
0171         threshold = cms.untracked.string('DEBUG')
0172     ),
0173     categories = cms.untracked.vstring('jetMETAnalyzer'),
0174     destinations = cms.untracked.vstring('cout')
0175 )
0176 
0177 
0178 process.options = cms.untracked.PSet(
0179     wantSummary = cms.untracked.bool(True)
0180 )
0181 
0182 process.FEVT = cms.OutputModule("PoolOutputModule",
0183     outputCommands = cms.untracked.vstring('keep *_MEtoEDMConverter_*_*'),
0184     #outputCommands = cms.untracked.vstring('keep *'),
0185     fileName = cms.untracked.string("reco_DQM_%s.root" % jobname)
0186 )
0187 
0188 process.options = cms.untracked.PSet(
0189     wantSummary = cms.untracked.bool(True) ## default is false
0190 
0191 )
0192 
0193 if iscosmics=="True":
0194   process.p = cms.Path(  process.BeamHaloId
0195                        * process.jetMETHLTOfflineSource
0196                        #                    * process.jetMETDQMOfflineSource
0197                        * process.jetMETDQMOfflineSourceCosmic
0198                        * process.MEtoEDMConverter
0199                        * process.dqmStoreStats)
0200 else:
0201   process.p = cms.Path(  process.BeamHaloId
0202                        * process.jetMETHLTOfflineSource
0203                        * process.jetMETDQMOfflineSource
0204                        #                    * process.jetMETDQMOfflineSourceCosmic
0205                        * process.MEtoEDMConverter
0206                        * process.dqmStoreStats)
0207   
0208 process.outpath = cms.EndPath(process.FEVT)
0209 process.DQM.collectorHost = ''
0210