Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-26 02:34:12

0001 ##-----
0002 # Set job-specific inputs based on shell
0003 # the following enviromental variables
0004 # export COSMIC_MODE=True # or False
0005 # export JOB_NAME="CosmicStream112220"
0006 # export NEVENTS=1000
0007 # export ALL_HISTS=True
0008 # export TRIGGER_SET=HLT
0009 # export READ_LIST_FROM_FILE=False # or True
0010 # export INPUTFILES='' # root file(s)
0011 # export INPUTFILES_LIST='inputfile_BeamHaloExpress_120015.txt'
0012 # for details see https://twiki.cern.ch/twiki/bin/view/CMS/JetMETDQMPromptAnalysis
0013 ##-----
0014 import os
0015 import FWCore.ParameterSet.Config as cms
0016 #
0017 # --- [cosmic sequence (default=True)?]
0018 iscosmics = (os.environ.get('COSMIC_MODE','True'))
0019 print('iscosmics (default=True) = '+str(iscosmics))
0020 #
0021 # --- [name of job & output file (default=test)?]
0022 jobname = (os.environ.get('JOB_NAME','test'))
0023 print('jobname (default=test) = '+str(jobname))
0024 #
0025 # --- [number of events (default=1000)]
0026 nevents = int(os.environ.get('NEVENTS','1000'))
0027 print('nevents (default=1000)  = '+str(nevents))
0028 #
0029 # --- [turn on all histograms (default=True)?]
0030 allhist = (os.environ.get('ALL_HISTS','True'))
0031 print('allhist (default=True) = '+str(allhist))
0032 #
0033 #--- [read list of input files from a text file? or not (default=False)]
0034 read_from_file = (os.environ.get('READ_LIST_FROM_FILE','False'))
0035 print('read list of input files from a text file (default=False) = '+str(read_from_file))
0036 #
0037 #--- [trigger set (default=HLT)]
0038 trigger_set = (os.environ.get('TRIGGER_SET','HLT'))
0039 print('trigger set name (default=HLT) = '+str(trigger_set))
0040 #
0041 #--- [define list of input files]
0042 inputfiles = []
0043 if read_from_file=="True":
0044   #--- [name of the text file (default=inputfile_list_default.txt)]
0045   filename = (os.environ.get('INPUTFILES_LIST','inputfile_list_default.txt'))
0046   file=open(filename)
0047   print(file.read())
0048   f = open(filename)
0049   try:
0050     for line in f:
0051         inputfiles.append(line)
0052   finally:
0053     f.close()
0054 else:
0055   inputfiles = os.environ.get('INPUTFILES',
0056   '/store/data/BeamCommissioning09/MinimumBias/RECO/Dec19thReReco_341_v1/0001/02EC80FB-FEEC-DE11-B28D-00261894389E.root').split(",")
0057   #'/store/data/Commissioning09/MinimumBias/RECO/v4/000/102/347/F85D1BC6-A06A-DE11-BDF8-0019B9F581C9.root').split(",")
0058   #'/store/data/CRAFT09/Calo/RECO/v1/000/112/220/F0B768A4-5E93-DE11-B222-000423D94524.root').split(",")
0059 
0060 print('List of input files')
0061 print(inputfiles)
0062 #-----
0063 
0064 #
0065 #-----
0066 process = cms.Process("test")
0067 process.load("CondCore.DBCommon.CondDBSetup_cfi")
0068 
0069 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0070 process.load("Configuration.StandardSequences.MagneticField_cff")
0071 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0072 
0073 #
0074 # DQM
0075 #
0076 process.load("DQMServices.Core.DQM_cfg")
0077 
0078 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
0079 
0080 #
0081 # HCALNoise module
0082 #
0083 process.load("RecoMET.METProducers.hcalnoiseinfoproducer_cfi")
0084 process.hcalnoise.refillRefVectors = cms.bool(True)
0085 process.hcalnoise.hcalNoiseRBXCollName = "hcalnoise"
0086 process.hcalnoise.requirePedestals = cms.bool(False)
0087 
0088 #
0089 # BeamHaloData producer
0090 #
0091 process.load("Configuration.StandardSequences.GeometryRecoDB_cff")
0092 process.load("Configuration/StandardSequences/MagneticField_cff")
0093 process.load("Configuration/StandardSequences/FrontierConditions_GlobalTag_cff")
0094 process.load("RecoMET/Configuration/RecoMET_BeamHaloId_cff")
0095 process.GlobalTag.globaltag ='GR09_R_34X_V2::All'
0096 
0097 # the task - JetMET objects
0098 if iscosmics =="True":
0099   process.load("DQMOffline.JetMET.jetMETDQMOfflineSourceCosmic_cff")
0100 else:
0101   process.load("DQMOffline.JetMET.jetMETDQMOfflineSource_cff")
0102 
0103 process.jetMETAnalyzer.OutputMEsInRootFile = cms.bool(True)
0104 process.jetMETAnalyzer.OutputFileName = cms.string("jetMETMonitoring_%s.root" % jobname)
0105 process.jetMETAnalyzer.TriggerResultsLabel = cms.InputTag("TriggerResults","",trigger_set)
0106 process.jetMETAnalyzer.processname = cms.string(trigger_set)
0107 #process.jetMETAnalyzer.TriggerResultsLabel = cms.InputTag("TriggerResults","","HLT8E29")
0108 #process.jetMETAnalyzer.processname = cms.string("HLT8E29")
0109 
0110 if allhist=="True":
0111   process.jetMETAnalyzer.DoJetPtAnalysis = cms.untracked.bool(True)
0112   process.jetMETAnalyzer.DoJetPtCleaning = cms.untracked.bool(True)
0113   process.jetMETAnalyzer.DoIterativeCone = cms.untracked.bool(True)
0114 
0115 #process.jetMETAnalyzer.caloMETAnalysis.verbose = cms.int32(1)
0116 
0117 if allhist=="True":
0118   process.jetMETAnalyzer.caloMETAnalysis.allSelection       = cms.bool(True)
0119   process.jetMETAnalyzer.caloMETNoHFAnalysis.allSelection   = cms.bool(True)
0120   process.jetMETAnalyzer.caloMETHOAnalysis.allSelection     = cms.bool(True)
0121   process.jetMETAnalyzer.caloMETNoHFHOAnalysis.allSelection = cms.bool(True)
0122   process.jetMETAnalyzer.pfMETAnalysis.allSelection         = cms.bool(True)
0123   process.jetMETAnalyzer.tcMETAnalysis.allSelection         = cms.bool(True)
0124   process.jetMETAnalyzer.mucorrMETAnalysis.allSelection     = cms.bool(True)
0125 
0126 # the task - JetMET trigger
0127 process.load("DQMOffline.Trigger.JetMETHLTOfflineSource_cfi")
0128 
0129 # check # of bins
0130 process.load("DQMServices.Components.DQMStoreStats_cfi")
0131 
0132 # for igprof
0133 #process.IgProfService = cms.Service("IgProfService",
0134 #  reportFirstEvent            = cms.untracked.int32(0),
0135 #  reportEventInterval         = cms.untracked.int32(25),
0136 #  reportToFileAtPostEvent     = cms.untracked.string("| gzip -c > igdqm.%I.gz")
0137 #)
0138 
0139 #
0140 # /Wmunu/Summer09-MC_31X_V3-v1/GEN-SIM-RECO
0141 process.source = cms.Source("PoolSource",
0142     fileNames = cms.untracked.vstring(*inputfiles))
0143 
0144 #
0145 process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*')
0146 
0147 #
0148 process.maxEvents = cms.untracked.PSet(
0149     input = cms.untracked.int32( nevents )
0150 )
0151 process.Timing = cms.Service("Timing")
0152 
0153 ## # Comment this out or reconfigure to see error messages 
0154 process.MessageLogger = cms.Service("MessageLogger",
0155     debugModules = cms.untracked.vstring('jetMETAnalyzer'),
0156     cout = cms.untracked.PSet(
0157         default = cms.untracked.PSet(
0158             limit = cms.untracked.int32(0)
0159         ),
0160         jetMETAnalyzer = cms.untracked.PSet(
0161             limit = cms.untracked.int32(100)
0162         ),
0163         noLineBreaks = cms.untracked.bool(True),
0164         DEBUG = cms.untracked.PSet(
0165             limit = cms.untracked.int32(0)
0166         ),
0167         threshold = cms.untracked.string('DEBUG')
0168     ),
0169     categories = cms.untracked.vstring('jetMETAnalyzer'),
0170     destinations = cms.untracked.vstring('cout')
0171 )
0172 
0173 
0174 process.options = cms.untracked.PSet(
0175     wantSummary = cms.untracked.bool(True)
0176 )
0177 
0178 process.FEVT = cms.OutputModule("PoolOutputModule",
0179     outputCommands = cms.untracked.vstring('keep *_MEtoEDMConverter_*_*'),
0180     #outputCommands = cms.untracked.vstring('keep *'),
0181     fileName = cms.untracked.string("reco_DQM_%s.root" % jobname)
0182 )
0183 
0184 process.options = cms.untracked.PSet(
0185     wantSummary = cms.untracked.bool(True) ## default is false
0186 
0187 )
0188 
0189 if iscosmics=="True":
0190   process.p = cms.Path(process.hcalnoise
0191                      * process.BeamHaloId
0192                      * process.jetMETHLTOfflineSource
0193 #                    * process.jetMETDQMOfflineSource
0194                      * process.jetMETDQMOfflineSourceCosmic
0195                      * process.MEtoEDMConverter
0196                      * process.dqmStoreStats)
0197 else:
0198   process.p = cms.Path(process.hcalnoise
0199                      * process.BeamHaloId
0200                      * process.jetMETHLTOfflineSource
0201                      * process.jetMETDQMOfflineSource
0202 #                    * process.jetMETDQMOfflineSourceCosmic
0203                      * process.MEtoEDMConverter
0204                      * process.dqmStoreStats)
0205 
0206 process.outpath = cms.EndPath(process.FEVT)
0207 process.DQM.collectorHost = ''
0208 
0209