CMS DAS 2025 Generators Short Exercise: Setup

Set-up your working environment

Mattermost (chat)

There is a dedicated Mattermost team, called CMSDAS@LPC2025, setup to facilitate communication and discussions via live chat (which is also archived). The channel is hosted by the CERN Mattermost instance.

If you have never used Mattermost at CERN, please know that you will need your CERN login credentials (SSO) and you will need to join the CMSDAS@LPC2025 channel in order to be able to see (or find using the search channels functionality) the channels setup for communications related to the school.

If you already have used Mattermost at CERN, please know that when you click direct links to channels (as you will find below) that are within the CMSDAS@LPC2025 channel, you may be redirected to the last Mattermost team you used. If this happens, remember to click the signup link to join the CMSDAS@LPC2025 channel to switch to the correct team from which you should be able to see the individual channels. If that still doesn’t work, remove all cookies associated with cern.ch and restart your browser.

The ShortExGenerators will be available once you join or switch to the CMSDAS@LPC2025 channel!

Note that you can access Mattermost via browser or you can download the corresponding application running standalone on your laptop or smartphone. The laptop application does not work with CERN certificate login.

Important

This exercise is designed to run only on the LPC clusters as copies of the scripts are present there.

Set-up your working directory

Keep in mind your <USERNAME> and use it in the following instructions:

# login to the LPC cluster with DISPLAY set
ssh -Y <USERNAME>@cmslpc-el8.fnal.gov

# get to your no-backup working area
cd nobackup

# line to find out what shell you are in
echo $0

# create your working directory
mkdir cmsdas_2025_gen

Downloading MadGraph

Downloading MadGraph5 v3.5.2 from a CMS mirror.

cd ~/nobackup/cmsdas_2025_gen
wget https://cms-project-generators.web.cern.ch/cms-project-generators/MG5_aMC_v3.5.2.tar.gz
tar xf MG5_aMC_v3.5.2.tar.gz
rm MG5_aMC_v3.5.2.tar.gz

Running MadGraph

Please note that MG5_aMC_v3.5.2 requires Python 3.7 or higher. We will set up MadGraph with making virtual environments for Python 3.11 (available on the LPC clusters):

To quit the MadGraph interface use exit command.

Note: To deactivate the Python 3 virtual environment, type deactivate.

Downloading CMS generator tool

Cloning the CMS generator repository:

cd ~/nobackup/cmsdas_2025_gen
git clone -b mg352 https://github.com/cms-sw/genproductions.git genproductions_mg352

You can check that the MadGraph steering cards of the example we will be using are actually there:

ls -rtl genproductions_mg352/bin/MadGraph5_aMCatNLO/cards/examples/wplustest_4f_LO/
total 20
-rw-r--r-- 1 enibigir us_cms   223 Jan  6 14:06 wplustest_4f_LO_proc_card.dat
-rw-r--r-- 1 enibigir us_cms 15999 Jan  6 14:06 wplustest_4f_LO_run_card.dat

Let’s copy the two files

cp genproductions_mg352/bin/MadGraph5_aMCatNLO/cards/examples/wplustest_4f_LO/*.dat MG5_aMC_v3_5_2/

Open MG5_aMC_v3_5_2/wplustest_4f_LO_run_card.dat using your favorite editor (vim, emacs,…) and replace the following lines

250 = nevents ! Number of unweighted events requested
'lhapdf'    = pdlabel     ! PDF set
$DEFAULT_PDF_SETS = lhaid     ! if pdlabel=lhapdf, this is the lhapdf number

with

10000 = nevents ! Number of unweighted events requested
nn23lo1    = pdlabel     ! PDF set                                     
230000     = lhaid       ! if pdlabel=lhapdf, this is the lhapdf number

Preparing CMSSW working area

cd ~/nobackup/cmsdas_2025_gen
cmsrel CMSSW_12_4_8