Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:53

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 from FWCore.ParameterSet.VarParsing import VarParsing
0004 options = VarParsing ('python')
0005 options.register('outFilename', 'particleLevel.root',  VarParsing.multiplicity.singleton, VarParsing.varType.string, "Output file name")
0006 options.register('photos', 'off', VarParsing.multiplicity.singleton, VarParsing.varType.string, "ME corrections")
0007 options.register('lepton', 13, VarParsing.multiplicity.singleton, VarParsing.varType.int, "Lepton ID for Z decays")
0008 options.setDefault('maxEvents', 10000)
0009 options.parseArguments()
0010 print(options)
0011 
0012 process = cms.Process("PROD")
0013 
0014 # import of standard configurations
0015 process.load('Configuration.StandardSequences.Services_cff')
0016 process.load('SimGeneral.HepPDTESSource.pythiapdt_cfi')
0017 process.load("FWCore.MessageLogger.MessageLogger_cfi")
0018 process.MessageLogger.cerr.FwkReport.reportEvery = int(options.maxEvents/100)
0019 
0020 from IOMC.RandomEngine.RandomServiceHelper import RandomNumberServiceHelper
0021 randSvc = RandomNumberServiceHelper(process.RandomNumberGeneratorService)
0022 randSvc.populate()
0023 
0024 # set input to process
0025 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(options.maxEvents) )
0026 
0027 process.source = cms.Source("EmptySource")
0028 
0029 process.generator = cms.EDFilter("Pythia8GeneratorFilter",
0030     maxEventsToPrint = cms.untracked.int32(0),
0031     pythiaPylistVerbosity = cms.untracked.int32(1),
0032     filterEfficiency = cms.untracked.double(1.0),
0033     pythiaHepMCVerbosity = cms.untracked.bool(False),
0034     comEnergy = cms.double(7000.),
0035     PythiaParameters = cms.PSet(
0036         processParameters = cms.vstring('WeakSingleBoson:ffbar2gmZ = on',
0037                                         'PhaseSpace:mHatMin = 50.',
0038                                         '23:onMode = off', 
0039                                         '23:onIfAny = %i' % options.lepton,
0040                                         #'PartonLevel:MPI = off',
0041                                         #'PartonLevel:ISR = off',
0042                                         #'PartonLevel:FSR = off',
0043                                         #'HadronLevel:all = off',
0044                                         ),
0045         parameterSets = cms.vstring('processParameters')
0046     )
0047 )
0048 
0049 if options.photos == 'exp':
0050     process.generator.ExternalDecays = cms.PSet(
0051         Photospp = cms.untracked.PSet(
0052             parameterSets = cms.vstring("setExponentiation", "setInfraredCutOff", "setMeCorrectionWtForW", "setMeCorrectionWtForZ", "setMomentumConservationThreshold", "setPairEmission", "setPhotonEmission", "setStopAtCriticalError"),
0053             setExponentiation = cms.bool(True),
0054             setMeCorrectionWtForW = cms.bool(True),
0055             setMeCorrectionWtForZ = cms.bool(True),
0056             setInfraredCutOff = cms.double(0.00011),
0057             setMomentumConservationThreshold = cms.double(0.1),
0058             setPairEmission = cms.bool(True),
0059             setPhotonEmission = cms.bool(True),
0060             setStopAtCriticalError = cms.bool(False),
0061         ),
0062         parameterSets = cms.vstring("Photospp")
0063     )
0064     process.generator.PythiaParameters.processParameters += cms.vstring(
0065         'ParticleDecays:allowPhotonRadiation = off',
0066         'TimeShower:QEDshowerByL = off',
0067     )
0068 
0069 if options.photos == 'single':
0070     process.generator.ExternalDecays = cms.PSet(
0071         Photospp = cms.untracked.PSet(
0072             parameterSets = cms.vstring("setExponentiation", "setInfraredCutOff", "setMeCorrectionWtForW", "setMeCorrectionWtForZ", "setMomentumConservationThreshold", "setPairEmission", "setPhotonEmission", "setStopAtCriticalError"),
0073             setExponentiation = cms.bool(False),
0074             setInfraredCutOff = cms.double(0.001),
0075             setMeCorrectionWtForW = cms.bool(True),
0076             setMeCorrectionWtForZ = cms.bool(True),
0077             setMomentumConservationThreshold = cms.double(0.1),
0078             setPairEmission = cms.bool(True),
0079             setPhotonEmission = cms.bool(True),
0080             setStopAtCriticalError = cms.bool(False),
0081         ),
0082         parameterSets = cms.vstring("Photospp")
0083     )
0084     process.generator.PythiaParameters.processParameters += cms.vstring(
0085         'ParticleDecays:allowPhotonRadiation = off',
0086         'TimeShower:QEDshowerByL = off'
0087     )
0088 
0089 if options.photos == 'double':
0090     process.generator.ExternalDecays = cms.PSet(
0091         Photospp = cms.untracked.PSet(
0092             parameterSets = cms.vstring("setExponentiation", "setDoubleBrem", "setInfraredCutOff", "setMeCorrectionWtForW", "setMeCorrectionWtForZ", "setMomentumConservationThreshold", "setPairEmission", "setPhotonEmission", "setStopAtCriticalError"),
0093             setExponentiation = cms.bool(False),
0094             setDoubleBrem = cms.bool(True),
0095             setInfraredCutOff = cms.double(0.001),
0096             setMeCorrectionWtForW = cms.bool(True),
0097             setMeCorrectionWtForZ = cms.bool(True),
0098             setMomentumConservationThreshold = cms.double(0.1),
0099             setPairEmission = cms.bool(True),
0100             setPhotonEmission = cms.bool(True),
0101             setStopAtCriticalError = cms.bool(False),
0102         ),
0103         parameterSets = cms.vstring("Photospp")
0104     )
0105     process.generator.PythiaParameters.processParameters += cms.vstring(
0106         'ParticleDecays:allowPhotonRadiation = off',
0107         'TimeShower:QEDshowerByL = off'
0108     )
0109 
0110 if options.photos == 'quatro':
0111     process.generator.ExternalDecays = cms.PSet(
0112         Photospp = cms.untracked.PSet(
0113             parameterSets = cms.vstring("setExponentiation", "setQuatroBrem", "setInfraredCutOff", "setMeCorrectionWtForW", "setMeCorrectionWtForZ", "setMomentumConservationThreshold", "setPairEmission", "setPhotonEmission", "setStopAtCriticalError"),
0114             setExponentiation = cms.bool(False),
0115             setQuatroBrem = cms.bool(True),
0116             setInfraredCutOff = cms.double(0.001),
0117             setMeCorrectionWtForW = cms.bool(True),
0118             setMeCorrectionWtForZ = cms.bool(True),
0119             setMomentumConservationThreshold = cms.double(0.1),
0120             setPairEmission = cms.bool(True),
0121             setPhotonEmission = cms.bool(True),
0122             setStopAtCriticalError = cms.bool(False),
0123         ),
0124         parameterSets = cms.vstring("Photospp")
0125     )
0126     process.generator.PythiaParameters.processParameters += cms.vstring(
0127         'ParticleDecays:allowPhotonRadiation = off',
0128         'TimeShower:QEDshowerByL = off'
0129     )
0130 
0131 if options.photos == 'nofsr':
0132     process.generator.PythiaParameters.processParameters += cms.vstring(
0133         'TimeShower:QEDshowerByL = off'
0134     )
0135 
0136 ## configure process options
0137 process.options = cms.untracked.PSet(
0138     allowUnscheduled = cms.untracked.bool(True),
0139     wantSummary      = cms.untracked.bool(True)
0140 )
0141 
0142 process.genParticles = cms.EDProducer("GenParticleProducer",
0143     saveBarCodes = cms.untracked.bool(True),
0144     src = cms.InputTag("generator:unsmeared"),
0145     abortOnUnknownPDGCode = cms.untracked.bool(False)
0146 )
0147 process.printTree1 = cms.EDAnalyzer("ParticleListDrawer",
0148     src = cms.InputTag("genParticles"),
0149     maxEventsToPrint  = cms.untracked.int32(10)
0150 )
0151 
0152 process.load("GeneratorInterface.RivetInterface.particleLevel_cfi")
0153 process.particleLevel.src = cms.InputTag("generator:unsmeared")
0154 process.particleLevel.lepConeSize = 0.1
0155 
0156 process.load("GeneratorInterface.RivetInterface.rivetAnalyzer_cfi")
0157 process.rivetAnalyzer.HepMCCollection = cms.InputTag("generator:unsmeared")
0158 process.rivetAnalyzer.AnalysisNames = cms.vstring('CMS_2015_I1346843', 'MC_ZINC_MU', 'MC_ZINC_MU_BARE', 'MC_ZINC_EL', 'MC_ZINC_EL_BARE', 'MC_PHOTONS', 'MC_MUONS', 'MC_ELECTRONS')
0159 process.rivetAnalyzer.OutputFile = cms.string('run.yoda')
0160 
0161 process.path = cms.Path(process.generator*process.rivetAnalyzer)#*process.particleLevel*process.genParticles*process.printTree1)
0162