Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:34

0001 #
0002 import FWCore.ParameterSet.Config as cms
0003 
0004 process = cms.Process("GenTest")
0005 
0006 process.maxEvents = cms.untracked.PSet(
0007     input = cms.untracked.int32(20000)
0008 )
0009 
0010 # Input source
0011 process.source = cms.Source("EmptySource")
0012 
0013 process.options = cms.untracked.PSet(
0014 
0015 )
0016 
0017 # import of standard configurations
0018 process.load('Configuration.StandardSequences.Services_cff')
0019 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0020 process.load('FWCore.MessageService.MessageLogger_cfi')
0021 process.load('Configuration.EventContent.EventContent_cff')
0022 
0023 process.load('SimGeneral.MixingModule.mixNoPU_cfi')
0024  
0025 process.load('Configuration.StandardSequences.Generator_cff')
0026 
0027 process.load('GeneratorInterface.Core.genFilterSummary_cff')
0028 
0029 process.load('Configuration.StandardSequences.SimIdeal_cff')
0030 # process.load('Configuration/StandardSequences/Sim_cff')
0031 
0032 process.load('Configuration.StandardSequences.EndOfProcess_cff')
0033 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0034 
0035 
0036 RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0037     generator = cms.PSet(
0038 # 1st file    
0039 #        initialSeed = cms.untracked.uint32(100000000),
0040 # 2nd file
0041 #        initialSeed = cms.untracked.uint32(123456789),
0042 # 3rd file    
0043 #        initialSeed = cms.untracked.uint32(200000000),
0044 # 4th file    
0045 #        initialSeed = cms.untracked.uint32(300000000),
0046 # 5th file    
0047 #        initialSeed = cms.untracked.uint32(400000000),
0048 # 6th file    
0049         initialSeed = cms.untracked.uint32(500000000),
0050 
0051         engineName = cms.untracked.string('HepJamesRandom')
0052     )
0053 )
0054 
0055 
0056 ###########################################
0057 # list of possible events to be generated #
0058 ###########################################
0059 #
0060 # single muons 
0061 process.generator = cms.EDProducer("FlatRandomPtGunProducer",
0062     PGunParameters = cms.PSet(
0063         MaxPt = cms.double(100.1),
0064         MinPt = cms.double(99.9),
0065         PartID = cms.vint32(13),
0066         MaxEta = cms.double(2.5),
0067         MaxPhi = cms.double(3.14159265359),
0068         MinEta = cms.double(-2.5),
0069         MinPhi = cms.double(-3.14159265359) ## in radians
0070 
0071     ),
0072     Verbosity = cms.untracked.int32(0), ## set to 1 (or greater)  for printouts
0073 
0074     psethack = cms.string('single muon pt 100'),
0075     AddAntiParticle = cms.bool(False), # True makes to muons per event
0076 #    firstRun = cms.untracked.uint32(1)
0077     firstRun = cms.untracked.uint32(2)
0078 #    firstRun = cms.untracked.uint32(3)
0079 #    firstRun = cms.untracked.uint32(4)
0080 )
0081 
0082 ## # choose particle
0083 #process.generator.PGunParameters.PartID[0] = 13
0084 ## # example: for 4 muons to test with vertex
0085 ## #process.generator.PGunParameters.PartID = cms.untracked.vint32(13,-13,13,-13)
0086 ## # example: for opposite sign back-to-back dimuon pairs set to True
0087 ## # define limits for Pt
0088 #process.generator.PGunParameters.MinPt = 40.0
0089 #process.generator.PGunParameters.MaxPt = 50.0
0090 ## # define limits for Pseudorapidity
0091 #process.generator.PGunParameters.MinEta = -3
0092 #process.generator.PGunParameters.MaxEta = 3
0093 #process.source.firstRun = cms.untracked.uint32(10)
0094 #process.source.firstEvent = cms.untracked.uint32(9001)
0095 #process.source.firstLuminosityBlock = cms.untracked.uint32(10)
0096 
0097 
0098 #process.MessageLogger = cms.Service("MessageLogger",
0099 #    debugModules = cms.untracked.vstring('PixelDigisTest'),
0100 #    destinations = cms.untracked.vstring('cout'),
0101 #    destinations = cms.untracked.vstring("log","cout"),
0102 #    cout = cms.untracked.PSet(
0103 #        threshold = cms.untracked.string('ERROR')
0104 #    )
0105 #    log = cms.untracked.PSet(
0106 #        threshold = cms.untracked.string('DEBUG')
0107 #    )
0108 #)
0109 
0110 #process.load("Geometry.TrackerSimData.trackerSimGeometryXML_cfi")
0111 #process.load("Geometry.CMSCommonData.cmsSimIdealGeometryXML_cfi")
0112 
0113 #process.load("Configuration.StandardSequences.Geometry_cff")
0114 #process.load("Configuration.StandardSequences.GeometryIdeal_cff")
0115 process.load('Configuration.StandardSequences.GeometryRecoDB_cff')
0116 process.load('Configuration.StandardSequences.GeometrySimDB_cff')
0117 
0118 
0119 # does using an empty PixelSkimmedGeometry.txt file speeds up job with lots more channels?
0120 #process.siPixelFakeGainOfflineESSource = cms.ESSource("SiPixelFakeGainOfflineESSource",
0121 #    file = cms.FileInPath('SLHCUpgradeSimulations/Geometry/data/longbarrel/PixelSkimmedGeometry_empty.txt')
0122 #)
0123 #process.es_prefer_fake_gain = cms.ESPrefer("SiPixelFakeGainOfflineESSource","siPixelFakeGainOfflineESSource")
0124 
0125 #process.siPixelFakeLorentzAngleESSource = cms.ESSource("SiPixelFakeLorentzAngleESSource",
0126 #    file = cms.FileInPath('SLHCUpgradeSimulations/Geometry/data/longbarrel/PixelSkimmedGeometry.txt')
0127 #)
0128 #process.es_prefer_fake_lorentz = cms.ESPrefer("SiPixelFakeLorentzAngleESSource","siPixelFakeLorentzAngleESSource")
0129 
0130 
0131 ##############################
0132 # magnetic field in solenoid #
0133 ##############################
0134 #
0135 process.load('Configuration.StandardSequences.MagneticField_38T_cff')
0136 
0137 # Parametrized magnetic field (new mapping, 4.0 and 3.8T)
0138 process.VolumeBasedMagneticFieldESProducer.useParametrizedTrackerField = True
0139 
0140 #########################
0141 # event vertex smearing #
0142 #########################
0143 #
0144 #process.load("Configuration.StandardSequences.VtxSmearedGauss_cff")
0145 #process.load("Configuration.StandardSequences.VtxSmearedBetafuncEarlyCollision_cff")
0146 process.load('IOMC.EventVertexGenerators.VtxSmearedRealistic8TeVCollision_cfi')
0147 
0148 
0149 ###########
0150 # what is this?
0151 # process.load("Configuration.StandardSequences.Services_cff")
0152 
0153 # what is this?
0154 #process.load("SimTracker.Configuration.SimTracker_cff")
0155 
0156 # needed for global transformation
0157 # this crashes
0158 # process.load("Configuration.StandardSequences.FakeConditions_cff")
0159 
0160 #process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")# Choose the global tag here:
0161 #process.GlobalTag.globaltag = 'MC_53_V15::All'
0162 #process.GlobalTag.globaltag = 'DESIGN53_V15::All'
0163 #process.GlobalTag.globaltag = 'START53_V15::All'
0164 # ideal
0165 process.GlobalTag.globaltag = 'MC_70_V1::All'
0166 # realistiv alignment and calibrations 
0167 #process.GlobalTag.globaltag = 'START70_V1::All'
0168 
0169 #process.load("Geometry.TrackerGeometryBuilder.trackerGeometry_cfi")
0170 #process.load("Geometry.TrackerNumberingBuilder.trackerNumberingGeometry_cfi")
0171 #process.load("Configuration.StandardSequences.MagneticField_cff")
0172 # include "MagneticField/Engine/data/volumeBasedMagneticField.cfi"
0173 
0174 
0175 ###############################
0176 # global output of simulation #
0177 ###############################
0178 #
0179 process.o1 = cms.OutputModule(
0180     "PoolOutputModule",
0181 # definition of branches to keep or drop
0182     outputCommands = cms.untracked.vstring('keep *','drop PCaloHits_*_*_*','drop *_*_MuonCSCHits_*',
0183                                            'drop *_*_MuonDTHits_*','drop *_*_MuonRPCHits_*',
0184                                            'drop *_*_MuonPLTHits_*','drop *_*_TotemHitsRP_*',
0185                                            'drop *_*_TotemHitsT1_*','drop *_*_TotemHitsT2Gem_*',
0186                                            ),
0187 
0188 # definition of output file (full path)
0189     fileName = cms.untracked.string('/afs/cern.ch/user/d/dkotlins/work/MC/mu/pt100/simhits/simHits6.root')
0190 )
0191 
0192 #
0193 process.outpath = cms.EndPath(process.o1)
0194 
0195 #process.simulation_step = cms.Path(process.psim)
0196 # process.digitisation_step = cms.Path(process.pdigi)
0197 
0198 #process.p = cms.Path(process.generator*process.genParticles)
0199 process.p = cms.Path(process.generator*process.genParticles*process.psim)
0200 
0201 process.schedule = cms.Schedule(process.p,process.outpath)