Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-10-27 04:18:05

0001 ## 11.02.16: Copied from https://raw.githubusercontent.com/dcurry09/EMTF8/master/L1Trigger/L1TMuonEndCap/test/runMuonEndCap.py
0002 
0003 import FWCore.ParameterSet.Config as cms
0004 import os
0005 import sys
0006 import subprocess
0007 
0008 process = cms.Process('L1TMuonEmulation')
0009 
0010 ## Import standard configurations
0011 process.load('Configuration.StandardSequences.Services_cff')
0012 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0013 process.load('FWCore.MessageService.MessageLogger_cfi')
0014 process.load('Configuration.EventContent.EventContent_cff')
0015 process.load('Configuration.Geometry.GeometryExtended2016Reco_cff') ## Is this appropriate for 2015 data/MC? - AWB 18.04.16
0016 process.load('Configuration.StandardSequences.MagneticField_AutoFromDBCurrent_cff') ## Will this work on 0T data? - AWB 18.04.16
0017 process.load('Configuration.StandardSequences.RawToDigi_Data_cff') ## Will this work for MC? - AWB 18.04.16
0018 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0019 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0020 
0021 # ## Extra tools
0022 # process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",
0023 #                                         ignoreTotal = cms.untracked.int32(1),
0024 #                                         monitorPssAndPrivate = cms.untracked.bool(True))
0025 
0026 ## CSCTF digis, phi / pT LUTs?
0027 process.load("L1TriggerConfig.L1ScalesProducers.L1MuTriggerScalesConfig_cff")
0028 process.load("L1TriggerConfig.L1ScalesProducers.L1MuTriggerPtScaleConfig_cff")
0029 
0030 ## Import RECO muon configurations
0031 process.load("RecoMuon.TrackingTools.MuonServiceProxy_cff")
0032 process.load("RecoMuon.TrackingTools.MuonTrackLoader_cff")
0033 
0034 ## Lumi JSON tools
0035 import FWCore.PythonUtilities.LumiList as LumiList
0036 # process.source.lumisToProcess = LumiList.LumiList(filename = 'goodList.json').getVLuminosityBlockRange()
0037 
0038 ## Message Logger and Event range
0039 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1000)
0040 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000000) )  ## ~10k / 1 minute per file
0041 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(False))
0042 
0043 process.options = cms.untracked.PSet(
0044     # SkipEvent = cms.untracked.vstring('ProductNotFound')
0045 )
0046 
0047 ## Global Tags
0048 from Configuration.AlCa.GlobalTag import GlobalTag
0049 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_data', '') ## Good for 2015/2016 data/MC? - AWB 18.04.16
0050 # process.GlobalTag = GlobalTag(process.GlobalTag, 'GR_P_V56', '') ## Used for anything? - AWB 18.04.16
0051 
0052 ## Event Setup Producer
0053 process.load('L1Trigger.L1TMuonEndCap.fakeEmtfParams_cff') ## Why does this file have "fake" in the name? - AWB 18.04.16
0054                                                            ## for the data we should rely on the global tag mechanism - KK 2016.04.28
0055 process.esProd = cms.EDAnalyzer("EventSetupRecordDataGetter",
0056                                 toGet = cms.VPSet(
0057         ## Apparently L1TMuonEndCapParamsRcd doesn't exist in CondFormats/DataRecord/src/ (Important? - AWB 18.04.16)
0058         cms.PSet(record = cms.string('L1TMuonEndCapParamsRcd'),
0059                  data = cms.vstring('L1TMuonEndCapParams'))
0060         ),
0061                                 verbose = cms.untracked.bool(True)
0062                                 )
0063 
0064 
0065 readFiles = cms.untracked.vstring()
0066 secFiles  = cms.untracked.vstring()
0067 process.source = cms.Source(
0068     'PoolSource',
0069     fileNames = readFiles,
0070     secondaryFileNames= secFiles
0071     #, eventsToProcess = cms.untracked.VEventRange('201196:265380261')
0072     )
0073 
0074 eos_cmd = '/afs/cern.ch/project/eos/installation/pro/bin/eos.select'
0075 
0076 ## 2017 Cosmics, with RPC!
0077 # in_dir_name = '/store/express/Commissioning2017/ExpressCosmics/FEVT/Express-v1/000/291/781/00000/'
0078 # in_dir_name = '/store/express/Commissioning2017/ExpressCosmics/FEVT/Express-v1/000/291/891/00000/'
0079 # in_dir_name = '/store/express/Commissioning2017/ExpressCosmics/FEVT/Express-v1/000/292/080/00000/'
0080 # in_dir_name = '/store/express/Commissioning2017/ExpressCosmics/FEVT/Express-v1/000/292/497/00000/'
0081 # in_dir_name = '/store/express/Commissioning2017/ExpressCosmics/FEVT/Express-v1/000/293/111/00000/'
0082 in_dir_name = '/store/express/Commissioning2017/ExpressCosmics/FEVT/Express-v1/000/293/580/00000/'
0083 
0084 # ## ZeroBias, IsolatedBunch data
0085 # in_dir_name = '/store/data/Run2016H/ZeroBiasIsolatedBunch0/RAW/v1/000/282/650/00000/'
0086 
0087 # ## SingleMu, Z-->mumu, high pT RECO muon
0088 #in_dir_name = '/store/group/dpg_trigger/comm_trigger/L1Trigger/Data/Collisions/SingleMuon/Skims/200-pt-muon-skim_from-zmumu-skim-cmssw-8013/SingleMuon/'
0089 #in_dir_name = in_dir_name+'crab_200-pt-muon-skim_from-zmumu-skim-cmssw-8013__SingleMuon_ZMu-2016B_v1/160710_225040/0000/'
0090 #in_dir_name = in_dir_name+'crab_200-pt-muon-skim_from-zmumu-skim-cmssw-8013__SingleMuon_ZMu-2016B_v2/160710_225006/0000/'
0091 #in_dir_name = in_dir_name+'crab_200-pt-muon-skim_from-zmumu-skim-cmssw-8013__SingleMuon_ZMu-2016C_v2/160710_225057/0000/'
0092 #in_dir_name = in_dir_name+'crab_200-pt-muon-skim_from-zmumu-skim-cmssw-8013__SingleMuon_ZMu-2016C_v2/160710_225057/0001/'
0093 #in_dir_name = in_dir_name+'crab_200-pt-muon-skim_from-zmumu-skim-cmssw-8013__SingleMuon_ZMu-2016D_v2/160710_225023/0000/'
0094 
0095 nFiles = 0
0096 for in_file_name in subprocess.check_output([eos_cmd, 'ls', in_dir_name]).splitlines():
0097     if not ('.root' in in_file_name): continue
0098     #if ( int(in_file_name.split('RECO_')[1].split('.roo')[0]) < 755 ): continue
0099     nFiles += 1
0100     ## if (nFiles % 10 != 0): continue ## Only process every 10th file
0101     readFiles.extend( cms.untracked.vstring(in_dir_name+in_file_name) )    
0102 
0103 # readFiles.extend([
0104 #         #'file:/afs/cern.ch/work/a/abrinke1/public/EMTF/Run2016G/RAW/279024/52622B4D-B265-E611-8099-FA163E326094.root'
0105 #         ])
0106 
0107 # secFiles.extend([
0108 #         'root://eoscms.cern.ch//eoscms//eos/cms/store/data/Run2015B/SingleMuon/RAW/v1/000/251/168/00000/382EE8DB-2825-E511-B3E0-02163E013597.root'
0109 #         ])
0110 
0111 
0112 process.content = cms.EDAnalyzer("EventContentAnalyzer")
0113 process.dumpED = cms.EDAnalyzer("EventContentAnalyzer")
0114 process.dumpES = cms.EDAnalyzer("PrintEventSetupContent")
0115 
0116 process.load('EventFilter.L1TRawToDigi.emtfStage2Digis_cfi')
0117 
0118 process.L1TMuonSeq = cms.Sequence(
0119     process.emtfStage2Digis
0120     )
0121 
0122 process.L1TMuonPath = cms.Path(
0123     process.L1TMuonSeq
0124     )
0125 
0126 # outCommands = cms.untracked.vstring('keep *')
0127 outCommands = cms.untracked.vstring(
0128 
0129     'keep *_*emtf*_*_*',
0130     'keep *_*Emtf*_*_*',
0131     'keep *_*EMTF*_*_*',
0132 
0133     'keep recoMuons_muons__*',
0134     'keep CSCDetIdCSCCorrelatedLCTDigiMuonDigiCollection_*_*_*',
0135     'keep *_csctfDigis_*_*',
0136     'keep *_emtfStage2Digis_*_*',
0137     'keep *_simEmtfDigis_*_*',
0138     'keep *_gmtStage2Digis_*_*',
0139     'keep *_simGmtStage2Digis_*_*',
0140 
0141     )
0142 
0143 out_dir = "/afs/cern.ch/work/a/abrinke1/public/EMTF/Commissioning/2017/"
0144 
0145 process.out = cms.OutputModule("PoolOutputModule", 
0146                                # fileName = cms.untracked.string("EMTF_Tree_highPt200MuonSkim_2016D_debug.root"),
0147                                # fileName = cms.untracked.string("EMTF_Tree_ZeroBias_IsoBunch_282650_SingleHit_test.root"),
0148                                # fileName = cms.untracked.string(out_dir+"EMTF_Unpacked_Cosmics_291891_RPC_all_files.root"),
0149                                fileName = cms.untracked.string(out_dir+"EMTF_Unpacked_Cosmics_293580_RPC_100k.root"),
0150                                outputCommands = outCommands
0151                                )
0152 
0153 process.output_step = cms.EndPath(process.out)
0154 
0155 process.schedule = cms.Schedule(process.L1TMuonPath)
0156 
0157 process.schedule.extend([process.output_step])
0158 
0159 ## What does this do? Necessary? - AWB 29.04.16
0160 from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_PostLS1
0161 process = customise_csc_PostLS1(process)