import FWCore.ParameterSet.Config as cmsis related to the mechanics of the python configuration language.
source = cms.Source("EmptySource")plugs in the event loop driver (see details).
from Configuration.Generator.PythiaUESettings_cfi import *is important because it brings standard pre-fabricated block to describe setting for the Underlying Event (UE), as currently approved by the CMS collaboration. Later in this writeup we will revisit several details of the UE settings. Specifically, the configuration of the generator's module, Pythia6GeneratorFilter in this case, starts with the line
generator = cms.EDFilter("Pythia6GeneratorFilter",followed by the module's configuration parameters; remember that "generator" is the only label allowed for any event generation software component within CMSSW, as we already mentioned in the WorkBook.
pythiaHepMCVerbosity = cms.untracked.bool(False), maxEventsToPrint = cms.untracked.int32(0), pythiaPylistVerbosity = cms.untracked.int32(0),For example, if a user wished to print the final-state event in the HepMC
pythiaHepMCVerbosity
from False to True: pythiaHepMCVerbosity = cms.untracked.bool(True)Obviously,
maxEventsToPrint
defines how many events one wants to display (starting from the 1st event; skipping events is NOT possible).pythiaPylistVerbosity
parameters; if you are uncertain what setting to choose, please look for the available optionsfilterEfficiency = cms.untracked.double(1.0), crossSection = cms.untracked.double(55000000000.), crossSectionNLO=cms.untracked.double(-1.),These are so called user-determined parameters; they are NOT used by Pythia6 in the event generation process, but they get recorded within GenEventInfoProduct. Pythia6-calculated cross section is recorded separately, also within GenEventInfoProduct.
crossSection
and crossSectionNLO
parameters are not included in the examplecomEnergy = cms.double(10000.0), PythiaParameters = cms.PSet(...)Obviously, thse parameter are tracked; i.e. you will NEVER be able to merge samples generated with different settings of these parameters, as it would be a nonsense from the physics point of view.
PPInitialState
), we now allow 3 other initial states, for tuning and analysis needs. Additional options are:
PPbarInitialState = cms.PSet ( )
ElectronPositronInitialState = cms.PSet ( )
ElectronProtonInitialState = cms.PSet( electronMomentum = cms.double(400.), protonMomentum = cms.double(-400.) ),In the first two cases the event kinematics will be defined by the
comEnergy
parameter. In the third case, additional parameters are required, to specify beam pz and direction.PPInitialState
) has been specified; if not, default will be kept. Thus, it is NOT necessary to give PPInitialState
in your configuration.
Now, we would like to return to PythiaParameters.
The format of the PythiaParameters configuration subset greatly follows native language of Pythia6
(see complete Pythia6 ManaulPythiaParameters = cms.PSet( pythiaUESettingsBlock, processParameters = cms.vstring(...), # This is a vector of ParameterSet names to be read, in this order parameterSets = cms.vstring('pythiaUESettings', 'processParameters') )Additional parameter in the subset,
parameterSets
, actually determines which groups must be picked up by Pythia6.processParameters = cms.vstring('MSEL = 0 ! User defined processes', 'MSUB(81) = 1 ! qqbar to QQbar', 'MSUB(82) = 1 ! gg to QQbar', 'MSTP(7) = 6 ! flavour = top', 'PMAS(6,1) = 175. ! top quark mass'),are specific to ttbar event generation.
processParameters = cms.vstring('MSEL=6 ! Top pair processes', 'PMAS(6,1) = 175. ! top quark mass'),This is recommended (by me) because it is easily generalizable to b quark pair production ('MSEL=5') and 4th generation quark production ('MSEL=7' or 'MSEL=8', but also modify the 4th generation CKM elements: 'VCKM(4,3)=.01', for example)
'MSTJ(22)=2 ! Decay those unstable particles', 'PARJ(71)=10 . ! for which ctau 10 mm',will tell Pythia6 to decay unstable particles that can travel no farther than 10mm (1cm) from the collision point. Particles of life time greater than 10mm have a chance to interact with the detector's material prior they can decay in flight; for this reason it has been decided to keep then undecayed by the generator and then treated by the detector simulation step.
'MSTP(51)=10042 ! structure function chosen (external PDF CTEQ6L1)', 'MSTP(52)=2 ! work with LHAPDF',These settings mean that the for the generation we choose the PDF set from an external package LHAPDF, rather than one of the options available within Pythia6 package. For other details on various Pythia6-specific cards one should consult complete Pythia6 Manaul
processParameters
vector of strings, which will look as follows:
processParameters = cms.vstring( 'MSEL=0 ! User defined processes', 'MSUB(81)=1 ! qq->QQ massive', 'MSUB(82)=1 ! gg->QQ massive', 'MSTP(7)=5 ! 5 for BB_bar', 'CKIN(3)=50. ! Pt hat lower cut', 'CKIN(4)=120. ! Pt hat upper cut', 'CKIN(13)=0. ! etamin', 'CKIN(14)=2.5 ! etamax', 'CKIN(15)=-2.5 ! -etamax', 'CKIN(16)=0. ! -etamin' )Here and in the examples below we demonstrate how a user needs to modify the
=processParameters
group of cards of the very first ttbar example, in order to re-configure Pythia6 generation for different topologies.
Note that you are not really obliged to use processParameters
as a name of group of Pythia6 cards; for example, myParameters
will be an equally good name, but you will need to reflect it properly in the field of the parameterSets
, like this:
parameterSets = cms.vstring('pythiaUESettings', 'myParameters')(this name
parametersSets
is NOT negotiable but is mandatory).
processParameters
(or similar) group of Pythia6 configuration cards will like like this:
processParameters = cms.vstring( 'PMAS(25,1)=300. ! Higgs', 'MSUB(3)=1 ! fi ~fj -> H', 'MSUB(102)=1 ! g g -> H', 'MSUB(123)=1 ! fi fj -> H fi fj (ZZ fusion)', 'MSUB(124)=1 ! fi fj -> H fk fl (W+W- fusion)', 'MSTJ(11)=3 ! Fragmentation', 'MSTJ(41)=1 ! Switch off Pythia QED bremsshtrahlung')
processParameters = cms.vstring( 'MSEL=0 ! define production mechanism using MSUB', 'MSUB(22)=1 ! Z pair production', 'MSTJ(41)=1 ! Switch off Pythia QED bremsshtrahlung', 'CKIN(3)=25.5 !', 'CKIN(41)=5. !', 'CKIN(42)=150. !', 'CKIN(43)=5. !', 'CKIN(44)=150. !')
processParameters = cms.vstring( 'MSEL=39 ! inclusive SUSY', 'IMSS(1)=2 ! mSUGRA', 'RMSS(4)=1. ! SIGN(MU)', 'RMSS(5)=10. ! TAN(BETA)', 'RMSS(16)=0. ! A0', 'RMSS(1)=200. ! M12', 'RMSS(8)=250. ! M0')
qqJets.cfg
change the "myParameters" subset in your config file as follows:
processParameters = cms.vstring( 'MSEL=0 ! for user specification of sub-processes', 'MSUB(11)=1 ! qq->qq ON, if one needs quark jets', 'MSUB(68)=1 ! gg->gg ON, if one needs gluon jets', 'CKIN(3)=100. ! Pt low cut but also the Et jet required', 'CKIN(13)=0. ! etamin', 'CKIN(14)=1.4 ! etamax', 'CKIN(15)=-1.4 ! -etamax', 'CKIN(16)=0. ! -etamin')
processParameters = cms.vstring( 'MSEL=0 !', 'MSUB(25)=1 !', 'MDME(190,1)=0 !', 'MDME(191,1)=0 !', 'MDME(192,1)=0 !', 'MDME(193,1)=0 !', 'MDME(194,1)=0 !', 'MDME(195,1)=0 !', 'MDME(196,1)=0 !', 'MDME(197,1)=0 !', 'MDME(198,1)=0 !', 'MDME(199,1)=0 !', 'MDME(200,1)=0 !', 'MDME(201,1)=0 !', 'MDME(202,1)=0 !', 'MDME(203,1)=0 !', 'MDME(204,1)=0 !', 'MDME(205,1)=0 !', 'MDME(206,1)=1 ! (W+ --> nu e+ ON)', 'MDME(207,1)=1 ! (W+ --> nu mu+ ON)', 'MDME(208,1)=1 ! (W+ --> nu tau+ ON)', 'MDME(209,1)=0 !')
PythiaParameters
subset:
SLHAParameters = cms.vstring('SLHAFILE = Configuration/Generator/data/CSA07SUSYBSM_LM9p_sftsdkpyt_slha.out'),which is also listed in the
parameterSets
field:
parameterSets = cms.vstring('pythiaUESettings', 'processParameters','SLHAParameters')The settings of your
processParameters
group of cards should like like this:
processParameters = cms.vstring( 'MSEL=39 ! All SUSY processes ', 'IMSS(1) = 11 ! Spectrum from external SLHA file')These settings will be standard for telling Pythia to read an SLHA spectrum; you may notice them in use through several other examples in the collection, such as GM1_cfi.py
'IMSS(21) = 33 ! LUN number for SLHA File (must be 33) ', 'IMSS(22) = 33 ! Read-in SLHA decay table '),are a left over from an older implementation; they are no longer necessary as this has been re-routed into the core code of Pythia6Interface, for consistency. If you would like to generate an SLHA spectrum file on your own, with ISASUGRA, you can download and run the "isasugra.x" executable from /afs/cern.ch/user/p/paige/public/isajet. Other recommended programs are SUSPECT and SOFTSUSY.
PYUPDAParameters = cms.vstring( 'PYUPDAFILE = Configuration/Generator/data/Pythia_H0_pyupda.in' # "PYUPDApostPYINIT" )(N.B. By default, Pythia uses the PYUPDA cards before its initialisation using PYINIT. Where Pythia has theoretical reasons for believing that it knows a particle's properties, (e.g. gauge bosons), the call to PYINIT may overwrite the changes to those particle's properties made by PYUPDA, and so ignore the latter. If you find this is happening, you can try introducing the PYUPDApostPYINIT parameter above, which causes the PYUPDA cards to be used after the call to PYINIT. Do not do this unless you find it is necessary, since Pythia is not guaranteed to work in this mode (but usually does). If you do use this option, print out a few events to check that it is working). (N.B. If you are modifying gauge boson or SUSY branching ratios, it is recommended not to delete rows from the existing branching ratio table, although you can add new ones at the end of it. This is because Pythia may use the original rows to infer the particle's couplings and hence production cross-sections. It makes hard-wired assumptions when doing this about the location of these rows, and will be confused if you delete any. Similarly, beware of setting these original branching ratios to exactly zero, since this can result in the particles couplings to these final state particles being zero and so result in it having zero production cross section. This prevents Pythia simulating it. You can safely reduce them by a large factor (e.g. 1000) however. (N.B. If you wish a previously stable particle to decay, then in addition to adding a decay table for it, you should specifying in the cards that it has a non-zero width). How can you create your PYUPDA input card file in the first place ? This is easy. Replace the above configuration parameters by:
PYUPDAParameters = cms.vstring( 'PYUPDAFILE = pyupda.out', 'PYUPDAWRITE' )and run CMSSW for a few events. It will print to the file "pyupda.out" the (PYUPDA format) properties and decay modes of all known particles. You can edit this, keeping just the particles you are interested in, and modifying their properties. An example is here
processParameters
subset:
CSAParameters = cms.vstring( 'CSAMODE = 7 ! towards a "flat" QCD spectrum', 'PTPOWER = 4.5 ! reweighting of the pt spectrum' )Other available selections of reweighting algorithm (CSAMODE card) are:
1 for QCD dijet 2 for EWK soup 3 for HLT soup 4 for soft muon soup 5 for exotics soup ? 6 for cross-section reweighted quarkonia production
cmsDriver.py
exactly as shown in the previous sections.source = cms.Source("LHESource", fileNames = cms.untracked.vstring( 'file:../../../GeneratorInterface/Pythia6Interface/test/ttbar_5flavours_xqcut20_10TeV.lhe') )which is feed with the parton-level MadGraph sample. Please be advised that in this example we refer to a "private" sample that is normally used for debugging by developers. In the future we'll offer other sample as they become available. As an alternative, you can produce your own MadGraph sample, as described in the dedicated CMS Madgraph document.
generator = cms.EDFilter("Pythia6HadronizerFilter",- it means that we use Pythia6-based module that is dedicated to processing externally generated partons, rather than Pythia6GeneratorFilter shown in previous examples.
processParameters = cms.vstring('MSEL=0 ! User defined processes', 'PMAS(5,1)=4.4 ! b quark mass', 'PMAS(6,1)=172.4 ! t quark mass', 'MSTJ(1)=1 ! Fragmentation/hadronization on or off', 'MSTP(61)=1 ! Parton showering on or off'),(i.e. for processing, for example, Alpgen sample the settings will be different).
jetMatching = cms.untracked.PSet( scheme = cms.string("Madgraph"), mode = cms.string("auto"), # soup, or "inclusive" / "exclusive" MEMAIN_etaclmax = cms.double(5.0), MEMAIN_qcut = cms.double(30.0), MEMAIN_minjets = cms.int32(-1), MEMAIN_maxjets = cms.int32(-1), )Please note that the use of matching procedure is optional; Pythia6HadronizerFilter may operate without it.
HepMCProduct
will be empty. Those event will be filtered out of the output, because event generation step is included in the "production filtering sequence":
ProductionFilterSequence = cms.Sequence(generator)(which will later on will be reflected in the PoolOutputModule configuration, if you process the fragment through
cmsDriver.py
).
Pythia6HadronizerFilter is also used to process externally generated parton level events by any ME tool, for example
Alpgen partons or, in a simpler case, by the CMSSW-incorporated BcGenerator.
scramv1 project CMSSW CMSSW_X_Y_Z
cd CMSSW_X_Y_Z/src/
project CMSSW
cvs co -r CMSSW_X_Y_Z GeneratorInterface/Pythia6Interface
cd GeneratorInterface/Pythia6Interface
eval `scramv1 run -csh`
eval `scramv1 run -sh`
scramv1 b
eval `scramv1 ru -(c)sh`under your local scram CMSSW area or in the standard install area on the CMSSW release you are interested about.
source $GCC_BASE/etc/profile.d/init.cshwhere where GCC_BASE value can be obtained as output of
scramv1 tool tag cxxcompiler GCC_BASEexecuted in your release area or in the standard CMSSW release area.
scramv1 setup -i pythia6and answering subsequent questions about the location of the "base", the includes, and the libraries - obviously, you should give full path to the area where your local install of Pythia6 is.
ldd /PATH/TO/YOUR/LIB/<lib-of-your-interest>.so
Reviewer/Editor and Date (copy from screen) | Comments |
---|---|
Main.tomalini - 12 Nov. 2008 | Added PYUPDA section |