MCatNLO Step 2

From Atlas Wiki
Jump to navigation Jump to search

In this step we will have MCatNLo produce events-files. To do this we will:

  • Build the executable
  • Construct the BASIC input files
  • Produce X event files containing Y events each using automated scripts

1) Build the executable

First go the the directory with the MCatNLO code:


Then construct an input file in the same way as you did for the integration step.

cp MCatNLO.inputs.Integration MCatNLO.inputs.EventGeneration

In this file you only need to change one line:


The build the executable, first remove the directory called Linux (this contains the executable that was used for the integration step). After that, simply build the executable:

rm -Rf Linux 

This will create the executable in a new directory: /Linux/TTbarNLO_EXE_THISLIB

Copy the executable to the BASIC directory

To have all necessary file together for the event generation, also save the executable in the 'BASIC' directory where you have stored the results from the integration.


2) Run the executable (simple try)

To run the executable you are required to have in the directory from where you launch the job:

o the information from the integration step
o the PDF

By doing the integration step we have already these files in the running directory. Furthermore, when running the executable, again you are asked for many input variables. To automate this please create a new input file.

cp ./Integrationstep.inputfile ./Eventgenerationstep.Inputfile

As a first run, you only have to say you do not need the integration anymore In the input file you therefore have to change the values for itmx1 and itmx2:

  0 0                                                   ! itmx1,itmx2

You can of course also set the Number of events to whatever you like say (100) and plug in your favorite seed for the random numbers (say 1234567).

running the executable

To run the executable simply do:

./Linux/TTbarNLO_EXE_THISLIB < Eventgenerationstep.Inputfile

This is extremely fast and for each run three of the so called event-files are produced:

The file contains the 100 events you have generated. The "_a" and "_b" files are subsets of this file that contain the events that respectively did and did not radiate a hard gluon.

3) Run the executable (the real thing more automated)

(a) Set up the basics

To automate this we created a small script that allows you to generate sets of events. A first thing to do is to save the executable and the input file in the BASICS directory:

  cp ./Linux/TTbarNLO_EXE_THISLIB   ./../CTEQ5M1_BASICS/
  cp Eventgenerationstep.Inputfile  ./../CTEQ5M1_BASICS/

(b) Creating a basic input file that can be manipulated by the scripts

Since for each run the script will change the name of the output file, the number of events and the seed for the random numbers, the input file should contain some tags that can be read by the script so a unique input file can be created for each run.

Go to the BASICS directory:

  mv Eventgenerationstep.Inputfile Eventgenerationstep.Inputfile.BASIC 

In the file Eventgenerationstep.Inputfile.BASIC change the lines related to the filename, the Number of events and the random number seed so that the script can tag them and change them to something unique for each job:

 'XXX_Filename'                ! prefix for event files
  XXX_Nevents_Per_Job          ! number of events
  XXX_Random_Seed              ! seed for rnd numbers

(c) Create output directory

For each job the output files (.event files) will be stored together with the log- and inputfiles. We first create that directory:

  cd /MyMCatNLO/
  mkdir MatrixElement
  mkdir MatrixElement/InputAndLogfiles

(d) Get the script

Again, first go to the run directory

  cd /MyMCatNLO/

Then get the script: This (python) script will be used to generate the event files.

(e) Prepare the script

There are a few variables you need to set. They are set in the first "routine" of the script:

MyFilename          = "TTbar"   
base_dir            = "/data/atlas/users/ivov/scratch/MyMCatNLO/CTEQ5M1_BASICS/"
MatrixElement_dir   = "/data/atlas/users/ivov/scratch/MyMCatNLO/MatrixElement/"
Nevents        =         500      # Number of events per file
Njobs          =           2      # Number of files

MyFilename: The name that was defined when creating the executable (The name of the MCatNLO executable is TTbarNLO_EXE_THISLIB). It will also be the prefix for all event files.

base_dir: The directory containing the basic files (executable,PDF, standard input file)

MatrixElement_dir: The directory where the files related to the job will be stored (the input- and logfile and the event files.

(f) Runnning the script

  cd /MyMCatNLO/

(g) Where is what and what is it??

With these settings you will have produced 2 files each contining 500 events and the Logfiles. Just a print of what is in my run directory:

[ivov@eomer MyMCatNLO]$ ls -lrt ./MatrixElement/*
-rw-r--r--    1 ivov     atlas       33888 May  8 17:47 ./MatrixElement/
-rw-r--r--    1 ivov     atlas       33888 May  8 17:47 ./MatrixElement/

total 24
-rw-r--r--    1 ivov     atlas        4353 May  8 17:47 logfile_Job2
-rw-r--r--    1 ivov     atlas        4353 May  8 17:47 logfile_Job1
-rw-r--r--    1 ivov     atlas        1122 May  8 17:47 inputfile_Job2
-rw-r--r--    1 ivov     atlas        1122 May  8 17:47 inputfile_Job1

A short explanation of what is inside the event files can be found here: EventFile.pdf.