File indexing completed on 2024-11-28 23:11:15
0001
0002
0003
0004
0005
0006 import FWCore.ParameterSet.Config as cms
0007
0008 from FWCore.ParameterSet.VarParsing import VarParsing
0009
0010
0011 options = VarParsing ('analysis')
0012 options.register('inputFile',
0013 None,
0014 VarParsing.multiplicity.singleton,
0015 VarParsing.varType.string,
0016 "Input file to use.")
0017 options.register('fromLocalXML',
0018 False,
0019 VarParsing.multiplicity.singleton,
0020 VarParsing.varType.bool,
0021 "Read Material description for XML files in release or in local installation"
0022 )
0023 options.register('sample',
0024 'SingleMuPt100',
0025 VarParsing.multiplicity.singleton,
0026 VarParsing.varType.string,
0027 """Input sample to use. Will also modify the output filename accordingly.
0028 Currently supported samples are:
0029 SingleMuPt10,
0030 [SingleMuPt100],
0031 SingleElectronPt35,
0032 SingleElectronPt10,
0033 TTbar_PU25""")
0034 options.register('ntuple',
0035 False,
0036 VarParsing.multiplicity.singleton,
0037 VarParsing.varType.bool,
0038 "Flag to trigger the production of MTV ntuple",
0039 )
0040 options.parseArguments()
0041
0042
0043 output_file_inRECO = 'file:matbdgForReco_FromReco_%s.root' % options.sample
0044 output_file_inDQM = 'file:matbdgForReco_FromReco_%s_inDQM.root'% options.sample
0045 input_file = '/store/relval/CMSSW_8_1_0_pre6/RelValSingleMuPt100_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/58AD9241-0A2A-E611-AB04-0025905B856E.root'
0046 input_files = []
0047
0048 if options.fromLocalXML == True:
0049 output_file_inRECO = 'file:matbdgForReco_FromReco_%s_FromLocalXML.root' % options.sample
0050 output_file_inDQM = 'file:matbdgForReco_FromReco_%s_FromLocalXML_inDQM.root' % options.sample
0051
0052 if options.sample == 'SingleMuPt10':
0053 input_file = ['/store/relval/CMSSW_8_1_0_pre6/RelValSingleMuPt10_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/0263098F-092A-E611-AC04-0CC47A745250.root',
0054 '/store/relval/CMSSW_8_1_0_pre6/RelValSingleMuPt10_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/2081A255-092A-E611-9EA6-0CC47A4C8E2E.root',
0055 '/store/relval/CMSSW_8_1_0_pre6/RelValSingleMuPt10_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/80727153-092A-E611-948F-0CC47A745294.root',
0056 '/store/relval/CMSSW_8_1_0_pre6/RelValSingleMuPt10_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/E676F884-092A-E611-8121-0CC47A4D7602.root',
0057 '/store/relval/CMSSW_8_1_0_pre6/RelValSingleMuPt10_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/F06FBE84-092A-E611-ADA9-0CC47A4D769C.root']
0058
0059 if options.sample == 'SingleElectronPt35':
0060 input_file = '/store/relval/CMSSW_8_1_0_pre6/RelValSingleElectronPt35_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/64866125-092A-E611-ACC3-0025905B8612.root'
0061
0062 if options.sample == 'SingleElectronPt10':
0063 input_file = '/store/relval/CMSSW_8_1_0_pre6/RelValSingleElectronPt10_UP15/GEN-SIM-DIGI-RAW-HLTDEBUG/80X_mcRun2_asymptotic_v14-v1/00000/E05284C8-092A-E611-AED9-0CC47A4D75EC.root'
0064
0065 if options.sample == 'TTbar_PU25':
0066 input_files = ['/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/C262684A-B92C-E611-A9CD-0CC47A4C8F08.root',
0067 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/C2EC8F1F-BA2C-E611-9EF5-0CC47A4C8E56.root',
0068 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/C4989350-B92C-E611-998D-0CC47A4D76AC.root',
0069 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/C68B5B52-B92C-E611-9AA3-0025905A613C.root',
0070 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/CADAE916-B92C-E611-AC71-0CC47A78A414.root',
0071 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/CC36B308-B92C-E611-B34B-003048FFD7AA.root',
0072 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/CC92BC5C-B92C-E611-B68B-0025905B857A.root',
0073 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/DE9B7443-B92C-E611-BD58-0CC47A78A2EC.root',
0074 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/E6DCC67A-B92C-E611-A83A-0CC47A4D76B2.root',
0075 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/EAFB710C-B92C-E611-A31D-0025905B85AA.root',
0076 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/F628B94F-B92C-E611-836C-0CC47A4D7646.root',
0077 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/FAA55833-BA2C-E611-BAFA-0025905A6092.root',
0078 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/FC4C281A-BA2C-E611-B1C3-0CC47A4C8F06.root',
0079 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/FC5E3132-B92C-E611-8C42-0025905B85FC.root',
0080 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/FC929909-B92C-E611-851F-0025905B85D2.root',
0081 '/store/relval/CMSSW_8_1_0_pre6/RelValTTbar_13/GEN-SIM-DIGI-RAW-HLTDEBUG/PU25ns_80X_mcRun2_asymptotic_v14-v1/00000/FEBE1221-B92C-E611-B8CE-0025905A608E.root']
0082
0083 if options.inputFile is not None:
0084 input_file = options.inputFile
0085
0086 from Configuration.Eras.Era_Run2_2016_cff import Run2_2016
0087 process = cms.Process('MATERIAL',Run2_2016)
0088
0089
0090 process.load('Configuration.StandardSequences.Services_cff')
0091 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0092 process.load('FWCore.MessageService.MessageLogger_cfi')
0093 process.load('Configuration.EventContent.EventContent_cff')
0094 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0095 if options.fromLocalXML:
0096 print("Loading material from local XMLs")
0097 process.load('Configuration.Geometry.GeometryExtended2016Reco_cff')
0098 else:
0099 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0100 process.load('Configuration.StandardSequences.MagneticField_cff')
0101 process.load('Configuration.StandardSequences.RawToDigi_cff')
0102 process.load('Configuration.StandardSequences.Reconstruction_cff')
0103 process.load('Configuration.StandardSequences.Validation_cff')
0104 process.load('DQMOffline.Configuration.DQMOfflineMC_cff')
0105 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0106
0107 process.maxEvents = cms.untracked.PSet(
0108 input = cms.untracked.int32(-1)
0109 )
0110
0111
0112 process.source = cms.Source("PoolSource",
0113 fileNames = cms.untracked.vstring(input_file),
0114
0115 secondaryFileNames = cms.untracked.vstring()
0116 )
0117 if len(input_files):
0118 process.source.fileNames = cms.untracked.vstring()
0119 process.source.fileNames.extend(input_files)
0120 process.options = cms.untracked.PSet(
0121
0122 )
0123
0124
0125 process.configurationMetadata = cms.untracked.PSet(
0126 annotation = cms.untracked.string('step3 nevts:10'),
0127 name = cms.untracked.string('Applications'),
0128 version = cms.untracked.string('$Revision: 1.19 $')
0129 )
0130
0131
0132
0133 process.RECOSIMoutput = cms.OutputModule("PoolOutputModule",
0134 dataset = cms.untracked.PSet(
0135 dataTier = cms.untracked.string('GEN-SIM-RECO'),
0136 filterName = cms.untracked.string('')
0137 ),
0138 eventAutoFlushCompressedSize = cms.untracked.int32(5242880),
0139 fileName = cms.untracked.string(output_file_inRECO),
0140 outputCommands = process.RECOSIMEventContent.outputCommands,
0141 splitLevel = cms.untracked.int32(0)
0142 )
0143
0144 process.DQMoutput = cms.OutputModule("DQMRootOutputModule",
0145 dataset = cms.untracked.PSet(
0146 dataTier = cms.untracked.string('DQMIO'),
0147 filterName = cms.untracked.string('')
0148 ),
0149 fileName = cms.untracked.string(output_file_inDQM),
0150 outputCommands = process.DQMEventContent.outputCommands,
0151 splitLevel = cms.untracked.int32(0)
0152 )
0153
0154
0155 from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
0156 process.materialdumper = DQMEDAnalyzer('TrackingRecoMaterialAnalyser',
0157 tracks = cms.InputTag("generalTracks"),
0158 vertices = cms.InputTag("offlinePrimaryVertices"),
0159 DoPredictionsOnly = cms.bool(False),
0160 Fitter = cms.string('KFFitterForRefitInsideOut'),
0161 TrackerRecHitBuilder = cms.string('WithAngleAndTemplate'),
0162 Smoother = cms.string('KFSmootherForRefitInsideOut'),
0163 MuonRecHitBuilder = cms.string('MuonRecHitBuilder'),
0164 RefitDirection = cms.string('alongMomentum'),
0165 RefitRPCHits = cms.bool(True),
0166 Propagator = cms.string('SmartPropagatorAnyRKOpposite'),
0167
0168 PropagatorAlong = cms.string("RungeKuttaTrackerPropagator"),
0169 PropagatorOpposite = cms.string("RungeKuttaTrackerPropagatorOpposite")
0170 )
0171
0172
0173
0174 process.mix.playback = True
0175 process.mix.digitizers = cms.PSet()
0176 for a in process.aliases: delattr(process, a)
0177 process.RandomNumberGeneratorService.restoreStateLabel=cms.untracked.string("randomEngineStateProducer")
0178 from Configuration.AlCa.GlobalTag import GlobalTag
0179 process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:run2_mc', '')
0180
0181
0182 process.raw2digi_step = cms.Path(process.RawToDigi)
0183 process.reconstruction_step = cms.Path(process.reconstruction_trackingOnly)
0184 process.prevalidation_step = cms.Path(process.globalPrevalidationTrackingOnly)
0185 process.dqmoffline_step = cms.Path(process.DQMOfflineTracking)
0186 process.dqmofflineOnPAT_step = cms.Path(process.PostDQMOffline)
0187 process.validation_step = cms.EndPath(process.globalValidationTrackingOnly)
0188 process.RECOSIMoutput_step = cms.EndPath(process.RECOSIMoutput)
0189 process.DQMoutput_step = cms.EndPath(process.DQMoutput)
0190 process.materialdumper_step = cms.Path(process.materialdumper)
0191
0192
0193 process.schedule = cms.Schedule(process.raw2digi_step,process.reconstruction_step,process.materialdumper_step,process.prevalidation_step,process.validation_step,process.dqmoffline_step,process.dqmofflineOnPAT_step,process.RECOSIMoutput_step,process.DQMoutput_step)
0194
0195
0196
0197
0198 from SimGeneral.MixingModule.fullMixCustomize_cff import setCrossingFrameOn
0199
0200
0201 process = setCrossingFrameOn(process)
0202
0203
0204
0205
0206 process.options.numberOfThreads=cms.untracked.uint32(6)
0207 process.options.numberOfStreams=cms.untracked.uint32(0)
0208
0209 if options.ntuple:
0210 from Validation.RecoTrack.customiseTrackingNtuple import customiseTrackingNtuple
0211 process = customiseTrackingNtuple(process)
0212 process.trackingNtuple.includeAllHits = False
0213 process.trackingNtuple.includeSeeds = False