Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
import FWCore.ParameterSet.Config as cms
from Configuration.Generator.Pythia8CommonSettings_cfi import *
from Configuration.Generator.MCTunes2017.PythiaCP5Settings_cfi import *
from GeneratorInterface.EvtGenInterface.EvtGenSetting_cff import *

generator = cms.EDFilter("Pythia8GeneratorFilter",
                         comEnergy = cms.double(13000.0),
                         crossSection = cms.untracked.double(54000000000),
                         filterEfficiency = cms.untracked.double(3.0e-4),
                         pythiaHepMCVerbosity = cms.untracked.bool(False),
                         maxEventsToPrint = cms.untracked.int32(0),
                         pythiaPylistVerbosity = cms.untracked.int32(0),
                         ExternalDecays = cms.PSet(
                         #using alternative name for decayer
                         EvtGen1 = cms.untracked.PSet(
	                    #uses latest evt and decay tables from evtgen 
                            decay_table = cms.string('GeneratorInterface/EvtGenInterface/data/DECAY_NOLONGLIFE.DEC'),
                            particle_property_file = cms.FileInPath('GeneratorInterface/EvtGenInterface/data/evt.pdl'),
                            convertPythiaCodes = cms.untracked.bool(False),
                            #here we will use the user.dec store in the release
                            user_decay_file = cms.vstring('GeneratorInterface/ExternalDecays/data/Bs_mumu.dec'),
                            list_forced_decays = cms.vstring('MyB_s0','Myanti-B_s0'),
                            operates_on_particles = cms.vint32()
                         ),
                         parameterSets = cms.vstring('EvtGen1')
                        ),
                        PythiaParameters = cms.PSet(
                           pythia8CommonSettingsBlock,
                           pythia8CP5SettingsBlock,
                           processParameters = cms.vstring(
                              #filter of a b-quark before hadronizing, and use a better data-like process
                              'PTFilter:filter = on',
                              'PTFilter:quarkToFilter = 5',
                              'PTFilter:scaleToFilter = 1.0',
                              'SoftQCD:nonDiffractive = on',
                           ),
                           parameterSets = cms.vstring('pythia8CommonSettings',
                                    'pythia8CP5Settings',
                                    'processParameters',
                           )
                        )
)

generator.PythiaParameters.processParameters.extend(EvtGenExtraParticles)

MuMuFilter = cms.EDFilter("MCParticlePairFilter",
                          Status = cms.untracked.vint32(1, 1),
                          MinPt = cms.untracked.vdouble(3., 3.),
                          MaxEta = cms.untracked.vdouble(2.5, 2.5),
                          MinEta = cms.untracked.vdouble(-2.5, -2.5),
                          ParticleCharge = cms.untracked.int32(-1),
                          ParticleID1 = cms.untracked.vint32(13,-13),
                          )

# -- Require Muon from Bs
MuFilter = cms.EDFilter("PythiaFilter",
                        Status = cms.untracked.int32(1),
                        MotherID = cms.untracked.int32(531),
                        MinPt = cms.untracked.double(3.),
                        ParticleID = cms.untracked.int32(13),
                        MaxEta = cms.untracked.double(2.5),
                        MinEta = cms.untracked.double(-2.5)
                        )

ProductionFilterSequence = cms.Sequence(generator*MuMuFilter*MuFilter)