Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 # ## Basic (but usually unnecessary) imports
0003 # import os
0004 # import sys
0005 
0006 import subprocess
0007 
0008 import FWCore.ParameterSet.Config as cms
0009 
0010 
0011 from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
0012 process = cms.Process('reL1T', Run2_2016)
0013 
0014 ## Import standard configurations
0015 process.load('Configuration.StandardSequences.Services_cff')
0016 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0017 process.load('FWCore.MessageService.MessageLogger_cfi')
0018 process.load('Configuration.EventContent.EventContent_cff')
0019 process.load('SimGeneral.MixingModule.mixNoPU_cfi') ## What does this module do? - AWB 05.09.16
0020 process.load('Configuration.StandardSequences.GeometryRecoDB_cff') ## What does this module do? - AWB 05.09.16
0021 process.load('Configuration.StandardSequences.MagneticField_cff') ## Different than in data ("MagneticField_AutoFromDBCurrent_cff"?)
0022 process.load('Configuration.StandardSequences.SimL1EmulatorRepack_FullMC_cff') ## Different than in data
0023 process.load('Configuration.StandardSequences.RawToDigi_cff') ## Different than in data ("RawToDigi_Data_cff"?)
0024 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0025 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0026 
0027 process.load('L1Trigger.CSCTriggerPrimitives.cscTriggerPrimitiveDigis_cfi')
0028 
0029 ## CSCTF digis, phi / pT LUTs?
0030 process.load("L1TriggerConfig.L1ScalesProducers.L1MuTriggerScalesConfig_cff")
0031 process.load("L1TriggerConfig.L1ScalesProducers.L1MuTriggerPtScaleConfig_cff")
0032 
0033 ## Import RECO muon configurations
0034 process.load("RecoMuon.TrackingTools.MuonServiceProxy_cff")
0035 process.load("RecoMuon.TrackingTools.MuonTrackLoader_cff")
0036 
0037 ## Message Logger and Event range
0038 process.MessageLogger.cerr.FwkReport.reportEvery = cms.untracked.int32(1)
0039 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000) )
0040 process.options = cms.untracked.PSet(wantSummary = cms.untracked.bool(False))
0041 
0042 ## Global Tags
0043 from Configuration.AlCa.GlobalTag import GlobalTag
0044 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
0045 
0046 ## Default parameters for firmware version, pT LUT XMLs, and coordinate conversion LUTs
0047 process.load('L1Trigger.L1TMuonEndCap.fakeEmtfParams_cff')
0048 
0049 
0050 readFiles = cms.untracked.vstring()
0051 process.source = cms.Source(
0052     'PoolSource',
0053     fileNames = readFiles
0054     )
0055 
0056 # eos_cmd = '/afs/cern.ch/project/eos/installation/pro/bin/eos.select'
0057 
0058 # in_dir_name = '/store/relval/CMSSW_8_0_19/RelValNuGun_UP15/GEN-SIM-DIGI-RECO/PU25ns_80X_mcRun2_asymptotic_2016_TrancheIV_v2_Tr4GT_v2_FastSim-v1/00000/'
0059 
0060 # for in_file_name in subprocess.check_output([eos_cmd, 'ls', in_dir_name]).splitlines():
0061 #     if not ('.root' in in_file_name): continue
0062 #     readFiles.extend( cms.untracked.vstring(in_dir_name+in_file_name) )
0063 
0064 dir_str = 'root://cms-xrd-global.cern.ch/'
0065 dir_str += '/store/mc/RunIISpring16DR80/SingleMu_Pt1To1000_FlatRandomOneOverPt/GEN-SIM-RAW/NoPURAW_NZS_withHLT_80X_mcRun2_asymptotic_v14-v1/60000/'
0066 
0067 readFiles.extend([
0068         
0069         # ## Tau-to-3-mu MC
0070         # 'root://eoscms.cern.ch//eos/cms/store/user/wangjian/DsTau3Mu_FullSim_1007/merged_fltr.root'
0071 
0072         ## SingleMu MC, noPU, flat in 1/pT
0073         ## DAS: dataset=/SingleMu_Pt1To1000_FlatRandomOneOverPt/RunIISpring16DR80-NoPURAW_NZS_withHLT_80X_mcRun2_asymptotic_v14-v1/GEN-SIM-RAW
0074 
0075         'file:/afs/cern.ch/work/a/abrinke1/public/EMTF/MC/SingleMu_Pt1To1000_FlatRandomOneOverPt/26CA310A-4164-E611-BE48-001E67248566.root',
0076 
0077         # dir_str+'26CA310A-4164-E611-BE48-001E67248566.root',
0078         # dir_str+'2C138BAC-4164-E611-8D9C-001E6724865B.root',
0079         # dir_str+'4CF53555-4164-E611-8347-001E67248566.root',
0080         # dir_str+'7E409BA3-3D64-E611-B392-001E67248142.root',
0081         # dir_str+'AE863F4E-3764-E611-977A-001E67248A25.root',
0082         # dir_str+'E65524B4-E964-E611-805F-0CC47A7139C4.root',
0083 
0084         # dir_str+'14C3C3CB-3864-E611-B770-20CF3027A624.root',
0085         # dir_str+'4645B2E7-3864-E611-9724-5404A64A1265.root',
0086         # dir_str+'507EEB74-3964-E611-B03B-3417EBE5361A.root',
0087         # dir_str+'683F88CB-4464-E611-AE40-20CF3027A5D8.root',
0088         # dir_str+'74715FCC-3864-E611-AA0F-3417EBE539DA.root',
0089         # dir_str+'769D60D3-3964-E611-8D1C-44A8423D7989.root',
0090         # dir_str+'E4541CA0-3664-E611-9DC1-00221982B650.root',
0091 
0092         # dir_str+'401C4E92-3F64-E611-B190-00259090765E.root',
0093         # dir_str+'644DC20B-3464-E611-9858-0025909083EE.root',
0094         # dir_str+'A6DBC3A6-E964-E611-8798-002590907826.root',
0095         # dir_str+'D24C4348-3664-E611-BFB7-00259090784E.root',
0096         # dir_str+'E8BE669B-3C64-E611-9170-00259090766E.root',
0097         # dir_str+'EEF06A5C-3564-E611-8F72-002590908EC2.root',
0098         # dir_str+'F04B42E3-3D64-E611-AA23-0025909083EE.root',
0099         # dir_str+'FCC1A3C5-4064-E611-8812-002590907836.root',
0100 
0101         ])
0102 
0103 process.content = cms.EDAnalyzer("EventContentAnalyzer")
0104 process.dumpED = cms.EDAnalyzer("EventContentAnalyzer")
0105 process.dumpES = cms.EDAnalyzer("PrintEventSetupContent")
0106 
0107 
0108 # Path and EndPath definitions
0109 
0110 # ## Defined in Configuration/StandardSequences/python/SimL1EmulatorRepack_FullMC_cff.py
0111 # process.L1RePack_step = cms.Path(process.SimL1Emulator)
0112 SimL1Emulator_AWB = cms.Sequence(process.unpackRPC+process.unpackCSC)
0113 process.L1RePack_step = cms.Path(SimL1Emulator_AWB)
0114 
0115 ## Defined in Configuration/StandardSequences/python/RawToDigi_cff.py
0116 ## Includes L1TRawToDigi, defined in L1Trigger/Configuration/python/L1TRawToDigi_cff.py
0117 # process.raw2digi_step = cms.Path(process.RawToDigi)
0118 
0119 process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag('unpackCSC', 'MuonCSCComparatorDigi')
0120 process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = cms.InputTag('unpackCSC', 'MuonCSCWireDigi')
0121 
0122 process.load('L1Trigger.L1TMuonEndCap.simEmtfDigis_cfi')
0123 
0124 process.simEmtfDigis.verbosity = cms.untracked.int32(0)
0125 
0126 ##############################################
0127 ###  Settings for 2016 vs. 2017 emulation  ###
0128 ##############################################
0129 
0130 # ## *** 2016 ***
0131 # ## From python/fakeEmtfParams_cff.py
0132 # process.emtfParams.PtAssignVersion = cms.int32(5)
0133 # process.emtfParams.FirmwareVersion = cms.int32(49999) ## Settings as of end-of-year 2016
0134 # process.emtfParams.PrimConvVersion = cms.int32(0)
0135 # process.emtfForestsDB.toGet = cms.VPSet(
0136 #     cms.PSet(
0137 #         record = cms.string("L1TMuonEndCapForestRcd"),
0138 #         tag = cms.string("L1TMuonEndCapForest_static_2016_mc")
0139 #         )
0140 #     )
0141 
0142 # ## From python/simEmtfDigis_cfi.py
0143 # process.simEmtfDigis.RPCEnable                 = cms.bool(False)
0144 # process.simEmtfDigis.spTBParams16.ThetaWindow  = cms.int32(4)
0145 # process.simEmtfDigis.spPCParams16.FixME11Edges = cms.bool(False)
0146 # process.simEmtfDigis.spPAParams16.PtLUTVersion = cms.int32(5)
0147 # process.simEmtfDigis.spPAParams16.BugGMTPhi    = cms.bool(True)
0148 
0149 
0150 # ## *** 2017 ***
0151 # ## From python/fakeEmtfParams_cff.py
0152 # process.emtfParams.PtAssignVersion = cms.int32(7)
0153 # process.emtfParams.FirmwareVersion = cms.int32(50001) ## Settings as of beginning-of-year 2017
0154 # process.emtfParams.PrimConvVersion = cms.int32(1)
0155 # # process.emtfForestsDB.toGet = cms.VPSet(
0156 # #     cms.PSet(
0157 # #         record = cms.string("L1TMuonEndCapForestRcd"),
0158 # #         tag = cms.string("L1TMuonEndCapForest_static_Sq_20170523_mc")
0159 # #         )
0160 # #     )
0161 
0162 # ## From python/simEmtfDigis_cfi.py
0163 # process.simEmtfDigis.RPCEnable                 = cms.bool(True)
0164 # process.simEmtfDigis.spTBParams16.ThetaWindow  = cms.int32(8)
0165 # process.simEmtfDigis.spPCParams16.FixME11Edges = cms.bool(True)
0166 # process.simEmtfDigis.spPAParams16.PtLUTVersion = cms.int32(7)
0167 # process.simEmtfDigis.spPAParams16.BugGMTPhi    = cms.bool(False)
0168 
0169 # process.simEmtfDigis.spPAParams16.ReadPtLUTFile = cms.bool(True)
0170 
0171 
0172 # RawToDigi_AWB = cms.Sequence(process.muonCSCDigis+process.muonRPCDigis+process.csctfDigis)
0173 RawToDigi_AWB = cms.Sequence(process.simCscTriggerPrimitiveDigis+process.muonCSCDigis+process.muonRPCDigis+process.csctfDigis+process.simEmtfDigis)
0174 # RawToDigi_AWB = cms.Sequence(process.simMuonCSCDigis+process.cscTriggerPrimitiveDigis+process.muonCSCDigis+process.muonRPCDigis+process.cscTriggerPrimitiveDigis+process.csctfDigis+process.simEmtfDigis)
0175 process.raw2digi_step = cms.Path(RawToDigi_AWB)
0176 
0177 ## Defined in Configuration/StandardSequences/python/EndOfProcess_cff.py
0178 process.endjob_step = cms.EndPath(process.endOfProcess)
0179 
0180 # process.L1TMuonSeq = cms.Sequence(
0181 #     process.muonCSCDigis + ## Unpacked CSC LCTs from TMB
0182 #     process.csctfDigis + ## Necessary for legacy studies, or if you use csctfDigis as input
0183 #     process.muonRPCDigis +
0184 #     ## process.esProd + ## What do we loose by not having this? - AWB 18.04.16
0185 #     process.emtfStage2Digis +
0186 #     process.simEmtfDigis
0187 #     ## process.ntuple
0188 #     )
0189 
0190 # process.L1TMuonPath = cms.Path(
0191 #     process.L1TMuonSeq
0192 #     )
0193 
0194 # outCommands = cms.untracked.vstring('keep *')
0195 outCommands = cms.untracked.vstring(
0196 
0197     'keep recoMuons_muons__*',
0198     'keep *Gen*_*_*_*',
0199     'keep *_*Gen*_*_*',
0200     'keep *gen*_*_*_*',
0201     'keep *_*gen*_*_*',
0202     'keep CSCDetIdCSCCorrelatedLCTDigiMuonDigiCollection_*_*_*', ## muonCSCDigis
0203     'keep RPCDetIdRPCDigiMuonDigiCollection_*_*_*', ## muonRPCDigis
0204     #'keep CSCCorrelatedLCTDigiCollection_muonCSCDigis_*_*',
0205     #'keep *_*_*muonCSCDigis*_*',
0206     #'keep *_*_*_*muonCSCDigis*',
0207     'keep *_csctfDigis_*_*',
0208     'keep *_emtfStage2Digis_*_*',
0209     'keep *_simEmtfDigis_*_*',
0210     'keep *_simEmtfDigis_*_*',
0211     'keep *_simEmtfDigisMC_*_*',
0212     'keep *_gmtStage2Digis_*_*',
0213     'keep *_simGmtStage2Digis_*_*',
0214 
0215     )
0216 
0217 # out_dir = "/afs/cern.ch/work/a/abrinke1/public/EMTF/Commissioning/2017/"
0218 out_dir = "./"
0219 
0220 process.treeOut = cms.OutputModule("PoolOutputModule", 
0221                                    # fileName = cms.untracked.string("EMTF_MC_Tree_RelValNuGun_UP15_1k.root"),
0222                                    # fileName = cms.untracked.string("EMTF_MC_Tree_tau_to_3_mu_RPC_debug.root"),
0223                                    # fileName = cms.untracked.string(out_dir+"EMTF_MC_Tree_SingleMu_2017_fromXMLv7_test.root"),
0224                                    fileName = cms.untracked.string(out_dir+"EMTF_MC_Tree_SingleMu_2017_v7_O2O_v5_test.root"),
0225                                    outputCommands = outCommands
0226                                    )
0227 
0228 process.treeOut_step = cms.EndPath(process.treeOut) ## Keep output tree - AWB 08.07.16
0229 
0230 # Schedule definition
0231 process.schedule = cms.Schedule(process.L1RePack_step,process.raw2digi_step,process.endjob_step,process.treeOut_step)
0232 
0233 # process.output_step = cms.EndPath(process.treeOut)
0234 # process.schedule = cms.Schedule(process.L1TMuonPath)
0235 # process.schedule.extend([process.output_step])
0236 
0237 # ## What does this do? Necessary? - AWB 29.04.16
0238 # from SLHCUpgradeSimulations.Configuration.muonCustoms import customise_csc_PostLS1
0239 # process = customise_csc_PostLS1(process)