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 ##-----
0003 # Set job-specific inputs based on shell
0004 # the following enviromental variables
0005 # export COSMIC_MODE=True # or False
0006 # export JOB_NAME="CosmicStream112220"
0007 # export NEVENTS=1000
0008 # export ALL_HISTS=True
0009 # export TRIGGER_SET=HLT
0010 # export READ_LIST_FROM_FILE=False # or True
0011 # export INPUTFILES='' # root file(s)
0012 # export INPUTFILES_LIST='inputfile_BeamHaloExpress_120015.txt'
0013 # for details see https://twiki.cern.ch/twiki/bin/view/CMS/JetMETDQMPromptAnalysis
0014 ##-----
0015 import os
0016 import FWCore.ParameterSet.Config as cms
0017 #
0018 # --- [cosmic sequence (default=True)?]
0019 iscosmics = (os.environ.get('COSMIC_MODE','False'))
0020 print('iscosmics (default=True) = '+str(iscosmics))
0021 #
0022 # --- [name of job & output file (default=test)?]
0023 jobname = (os.environ.get('JOB_NAME','test'))
0024 print('jobname (default=test) = '+str(jobname))
0025 #
0026 # --- [number of events (default=1000)]
0027 nevents = int(os.environ.get('NEVENTS','1000'))
0028 print('nevents (default=1000)  = '+str(nevents))
0029 #
0030 # --- [turn on all histograms (default=True)?]
0031 allhist = (os.environ.get('ALL_HISTS','True'))
0032 print('allhist (default=True) = '+str(allhist))
0033 #
0034 #--- [read list of input files from a text file? or not (default=False)]
0035 read_from_file = (os.environ.get('READ_LIST_FROM_FILE','True'))
0036 print('read list of input files from a text file (default=False) = '+str(read_from_file))
0037 #
0038 #--- [trigger set (default=HLT)]
0039 trigger_set = (os.environ.get('TRIGGER_SET','HLT'))
0040 print('trigger set name (default=HLT) = '+str(trigger_set))
0041 #
0042 #--- [define list of input files]
0043 inputfiles = []
0044 if read_from_file=="True":
0045   #--- [name of the text file (default=inputfile_list_default.txt)]
0046   filename = (os.environ.get('INPUTFILES_LIST','inputfile_list_default.txt'))
0047   file=open(filename)
0048   print(file.read())
0049   f = open(filename)
0050   try:
0051     for line in f:
0052         inputfiles.append(line)
0053   finally:
0054     f.close()
0055 else:
0056   inputfiles = os.environ.get('INPUTFILES',
0057   '/store/hidata/HIRun2010/HIAllPhysics/RECO/PromptReco-v2/000/150/314/D28FA8E9-4EEA-DF11-9B2A-000423D987E0.root').split(",")
0058   #'/store/data/Commissioning09/MinimumBias/RECO/v4/000/102/347/F85D1BC6-A06A-DE11-BDF8-0019B9F581C9.root').split(",")
0059   #'/store/data/CRAFT09/Calo/RECO/v1/000/112/220/F0B768A4-5E93-DE11-B222-000423D94524.root').split(",")
0060 
0061 print('List of input files')
0062 print(inputfiles)
0063 #-----
0064 
0065 #
0066 #-----
0067 process = cms.Process("test")
0068 process.load("CondCore.DBCommon.CondDBSetup_cfi")
0069 
0070 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0071 
0072 #
0073 # DQM
0074 #
0075 process.load("DQMServices.Core.DQM_cfg")
0076 
0077 process.load("DQMServices.Components.MEtoEDMConverter_cfi")
0078 
0079 ###for HI running
0080 #process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0081 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0082 process.load('Configuration.StandardSequences.Reconstruction_cff')
0083 process.load('RecoJets.JetAssociationProducers.trackExtrapolator_cfi')
0084 process.load('RecoJets.JetAssociationProducers.ak7JTA_cff') 
0085 process.load('RecoJets.JetAssociationProducers.ak5JTA_cff')
0086 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff')
0087 process.load('HLTrigger/HLTfilters/hltLevel1GTSeed_cfi')
0088 process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
0089 
0090 process.GlobalTag.globaltag ='GR_P_V27A::All'
0091 
0092 # the task - JetMET objects
0093 if iscosmics =="True":
0094   process.load("DQMOffline.JetMET.jetMETDQMOfflineSourceCosmic_cff")
0095 else:
0096   process.load("DQMOffline.JetMET.jetMETDQMOfflineSourceHI_cff")
0097 
0098 process.jetMETAnalyzer.OutputMEsInRootFile = cms.bool(True)
0099 process.jetMETAnalyzer.OutputFileName = cms.string("jetMETMonitoring_%s.root" % jobname)
0100 process.jetMETAnalyzer.TriggerResultsLabel = cms.InputTag("TriggerResults","",trigger_set)
0101 process.jetMETAnalyzer.processname = cms.string(trigger_set)
0102 
0103 # check # of bins
0104 process.load("DQMServices.Components.DQMStoreStats_cfi")
0105 
0106 # for igprof
0107 #process.IgProfService = cms.Service("IgProfService",
0108 #  reportFirstEvent            = cms.untracked.int32(0),
0109 #  reportEventInterval         = cms.untracked.int32(25),
0110 #  reportToFileAtPostEvent     = cms.untracked.string("| gzip -c > igdqm.%I.gz")
0111 #)
0112 
0113 #
0114 # /Wmunu/Summer09-MC_31X_V3-v1/GEN-SIM-RECO
0115 process.source = cms.Source("PoolSource",
0116     fileNames = cms.untracked.vstring(*inputfiles))
0117 
0118 #
0119 process.source.inputCommands = cms.untracked.vstring('keep *', 'drop *_MEtoEDMConverter_*_*')
0120 
0121 #
0122 process.maxEvents = cms.untracked.PSet(
0123     input = cms.untracked.int32( nevents )
0124 )
0125 process.Timing = cms.Service("Timing")
0126 
0127 ## # Comment this out or reconfigure to see error messages 
0128 process.MessageLogger = cms.Service("MessageLogger",
0129     debugModules = cms.untracked.vstring('jetMETAnalyzer'),
0130     cout = cms.untracked.PSet(
0131         default = cms.untracked.PSet(
0132             limit = cms.untracked.int32(0)
0133         ),
0134         jetMETAnalyzer = cms.untracked.PSet(
0135             limit = cms.untracked.int32(1)
0136         ),
0137         noLineBreaks = cms.untracked.bool(True),
0138         DEBUG = cms.untracked.PSet(
0139             limit = cms.untracked.int32(0)
0140         ),
0141         threshold = cms.untracked.string('DEBUG')
0142     ),
0143     categories = cms.untracked.vstring('jetMETAnalyzer'),
0144     destinations = cms.untracked.vstring('cout')
0145 )
0146 
0147 
0148 process.options = cms.untracked.PSet(
0149     wantSummary = cms.untracked.bool(True)
0150 )
0151 
0152 process.FEVT = cms.OutputModule("PoolOutputModule",
0153     outputCommands = cms.untracked.vstring('keep *_MEtoEDMConverter_*_*'),
0154     #outputCommands = cms.untracked.vstring('keep *'),
0155     fileName = cms.untracked.string("reco_DQM_%s.root" % jobname)
0156 )
0157 
0158 process.options = cms.untracked.PSet(
0159     wantSummary = cms.untracked.bool(True) ## default is false
0160 
0161 )
0162 
0163 if iscosmics=="True":
0164   process.p = cms.Path(process.jetMETDQMOfflineSourceCosmic
0165                      * process.dqmStoreStats
0166                      * process.MEtoEDMConverter
0167                      )
0168 else:
0169   process.p = cms.Path(process.jetMETDQMOfflineSource
0170                      * process.dqmStoreStats
0171                      * process.MEtoEDMConverter
0172                      )
0173 
0174 process.outpath = cms.EndPath(process.FEVT)
0175 process.DQM.collectorHost = ''
0176 
0177