Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 # Particle gun whose pt and rapidity distributions can be specified
0002 # by TGraphs, and later handled by pythia for decays. The example here
0003 # is jpsi, with kinematic distributions from hep-ph/0310274v1
0004 # and chosen to decay into two muons
0005 
0006 import FWCore.ParameterSet.Config as cms
0007 
0008 ### from Configuration.Generator.PythiaUESettings_cfi import *
0009 from GeneratorInterface.Pythia6Interface.pythiaDefault_cff import *
0010 
0011 process = cms.Process("Gen")
0012 
0013 process.load("FWCore.MessageService.MessageLogger_cfi")
0014 
0015 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0016 
0017 # Event output
0018 process.load("Configuration.EventContent.EventContent_cff")
0019 
0020 process.RandomNumberGeneratorService = cms.Service("RandomNumberGeneratorService",
0021     generator = cms.PSet(
0022         initialSeed = cms.untracked.uint32(123456789),
0023         engineName = cms.untracked.string('HepJamesRandom')
0024     )
0025 )
0026 
0027 process.maxEvents = cms.untracked.PSet(
0028     input = cms.untracked.int32(5)
0029 )
0030 
0031 process.source = cms.Source("EmptySource")
0032 
0033 process.generator = cms.EDProducer("Pythia6PtYDistGun",
0034 
0035    maxEventsToPrint = cms.untracked.int32(5),
0036    pythiaHepMCVerbosity = cms.untracked.bool(True),
0037    pythiaPylistVerbosity = cms.untracked.int32(1),
0038 
0039    PGunParameters = cms.PSet(                    
0040       ParticleID = cms.vint32(443),
0041       kinematicsFile = cms.FileInPath(
0042          'HeavyIonsAnalysis/Configuration/data/jpsipbpb.root'),                   
0043       PtBinning = cms.int32(100000),
0044       YBinning = cms.int32(500),
0045       MinPt = cms.double(0.0),
0046       MaxPt = cms.double(100.0),
0047       MinY = cms.double(-10.0),
0048       MaxY = cms.double(10.0),
0049       MinPhi = cms.double(-3.14159265359),
0050       MaxPhi = cms.double(3.14159265359),
0051    ),                    
0052 
0053    PythiaParameters = cms.PSet(
0054       pythiaDefaultBlock,
0055       jpsiDecay = cms.vstring(
0056          'BRAT(858) = 0 ! switch off',
0057          'BRAT(859) = 1 ! switch on',
0058          'BRAT(860) = 0 ! switch off',
0059          'MDME(858,1) = 0 ! switch off',
0060          'MDME(859,1) = 1 ! switch on',
0061          'MDME(860,1) = 0 ! switch off'),
0062       upsilonDecay = cms.vstring(
0063          'BRAT(1034) = 0 ! switch off',
0064          'BRAT(1035) = 1 ! switch on',
0065          'BRAT(1036) = 0 ! switch off',
0066          'BRAT(1037) = 0 ! switch off',
0067          'BRAT(1038) = 0 ! switch off',
0068          'BRAT(1039) = 0 ! switch off',
0069          'BRAT(1040) = 0 ! switch off',
0070          'BRAT(1041) = 0 ! switch off',
0071          'BRAT(1042) = 0 ! switch off',
0072          'MDME(1034,1) = 0 ! switch off',
0073          'MDME(1035,1) = 1 ! switch on',
0074          'MDME(1036,1) = 0 ! switch off',
0075          'MDME(1037,1) = 0 ! switch off',
0076          'MDME(1038,1) = 0 ! switch off',
0077          'MDME(1039,1) = 0 ! switch off',
0078          'MDME(1040,1) = 0 ! switch off',
0079          'MDME(1041,1) = 0 ! switch off',
0080          'MDME(1042,1) = 0 ! switch off'),
0081       parameterSets = cms.vstring('pythiaDefault','jpsiDecay')
0082    )
0083 
0084 )
0085 
0086 # For upsilon generation, add in your configuration the uncommented lines :
0087 #
0088 #process.generator.PGunParameters.kinematicsFile = cms.FileInPath('HeavyIonsAnalysis/Configuration/data/upsipbpb.root')
0089 #process.generator.PGunParameters.ParticleID = cms.vint32(553)
0090 
0091 process.FEVT = cms.OutputModule("PoolOutputModule",
0092     process.FEVTSIMEventContent,
0093     fileName = cms.untracked.string('gen_ptydist_jpsi.root')
0094 )
0095 
0096 process.p = cms.Path(process.generator)
0097 process.outpath = cms.EndPath(process.FEVT)
0098 ### process.schedule = cms.Schedule(process.p,process.outpath)
0099 process.schedule = cms.Schedule(process.p)
0100