Difference between revisions of "MCatNLO Step 3"

From Atlas Wiki
Jump to navigation Jump to search
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
On this page we will use the <>.event files that were produced by MCatNLO (see step 2) as input to Herwig. Using the Athena program we will use Herwig to have the top quarks decay and finally we will produce a combined ntuple (CBNT) and Pool file as was done for Rome.
+
On this page we will use the <>.event files that were produced by MCatNLO and use Herwig (using the Athena framework) to decay the tops and produce the parton shower. We will produce a combined ntuple CBNT and POOL file.
  
:'''1) Create a few directories'''
+
<font color=red><b>Main idea:</b></font>
  
:Go again to your generation area where you have produced your <>.event-files and  create two new directories. One where you will store the output files (CBNT and POOL files) and one where you will put the necessary files (basic joboptions file for example) to start the athena job:
+
The main idea is to call athena with a joboptions file where you specify the location of the event file. In addition it is required to have an additional input file. We will again use a script that will take the BASIC forms for these input files and prodice unique input files for each job and take care of the bookkeeping.
 +
 
 +
==1) Set-up Athena and output directories==
 +
 
 +
We will use Athena to do the decay. Make sure that you have correctly set up the athena environment. To see how to do this please check xxx.
  
 
<font color=red>  
 
<font color=red>  
 
<pre>
 
<pre>
cd /project/atlas/users/ivov/MyMCatNLO/
+
cd /MyMCatNLO
mkdir MyMCatNLO_BASICS
+
mkdir ATHENA_BASICS
mkdir MyMCatNLO_OUTPUT
+
mkdir POOLCBNT
mkdir MyMCatNLO_OUTPUT/InputAndLogFiles
+
mkdir POOLCBNT/InputAndLogfiles
 
</pre>
 
</pre>
 
</font>
 
</font>
  
:'''2) Get necessary files required for Athena running'''
+
==2) Get the basic input files ==
 
 
:Since we have used MCatNLO to produce the ttbar momenta, we will have to signal to Herwig that it only has to decay the top quarks and must take the top-momenta from your external <>.event-file. When using Athena, this is done using a joboptions file.
 
  
:<font color = red>Note:</font> In addition a file that is called <font color=blue>inparmMcAtNlo.dat</font> is expected in your run directory that provides the location of the <>.event file and some additional input variables related to the generated samnple in MCatNLO.
+
Since we have used MCatNLO to produce the <math>t</math> and <math>\bar{t}</math> momenta, we have to signal to Herwig that it must these from your external <>.event-file. In Athena, this is done inside a joboptions file.
 +
Again we start at again to your MCatNLO working directory area. Create two new directories where we'll store the basic input files (basic joboptions file and other athena related files) and the output files (the combined ntuple for the generator information and POOL files).  
  
: (A)<u> First get some Athena python-files in your run directory:</u>
 
 
<font color=red>  
 
<font color=red>  
 
<pre>
 
<pre>
cd MyMCatNLO_BASICS
+
cd /MyMCatNLO/ATHENA_BASICS
get_files PDGTABLE.MeV
 
get_files PartPropSvc.py
 
 
</pre>
 
</pre>
 
</font>
 
</font>
  
: (B)<u> Get the two basic input files that are job-dependent:</u>
+
<b>(a) Get some Athena python-files and check set-up</b>
  
:For each job, the script (presented in step 4) will take the two following basic-files and add the job-dependent quantities to produce a unique joboptions file per athena job.
+
Get these athena python files into your BASICS area using get_files.
 
 
: (B1) <u>Get the two basic input files that are job-dependent:</u>
 
 
 
:The first file is the joboptions file:
 
 
<font color=red>  
 
<font color=red>  
 
<pre>
 
<pre>
cp /afs/cern.ch/user/i/ivo/public/MCatNLO_scripts/joboptions_MyMCatNLO_Step3.py.BASIC .
+
get_files PDGTABLE.MeV
 +
get_files PartPropSvc.py
 
</pre>
 
</pre>
 
</font>
 
</font>
  
 +
This is a good check to see if you have set-up athena correctly. If this fails please make sure you have the Athena envoronment set-up correctly.
  
:The lines that will be changed by the script are related to the number of events, the random number seeds for the generators and the output files.
+
<b>(b) Get the basic joboptions file</b>
 +
 
 +
Get the basic joboptions file:  [http://www.nikhef.nl/~ivov/MCatNLO_Scripts/joboptions_MCatNLO_Rome_POOLCBNT.py.BASIC joboptions_MCatNLO_Rome_POOLCBNT.py.BASIC]
 +
 
 +
The lines that will be changed by the script are related to the number of events, the random number seeds for the generators and the output files.
  
 
<font color=blue size="-1">  
 
<font color=blue size="-1">  
Line 56: Line 58:
 
</font>
 
</font>
  
: (B2) <u>MCatNLO parameter file</u>
 
  
:The second file is a file with some McatNLO settings. Also copy this file to the basics directory.
+
<b>(c) Get the inparmMcAtNlo.dat (MCatNLO parameter) file</b>
 +
 
 +
When starting the athena job, a file called <font color=blue> inparmMcAtNlo.dat </font> is expected in your run directory. It contains the location of the <>.event file and some additional input variables related to the generated MCatNLO sample.
 +
 
 +
Get the additional MCatNLO parameter file:  [http://www.nikhef.nl/~ivov/MCatNLO_Scripts/inparmMcAtNlo.dat.BASIC inparmMcAtNlo.dat.BASIC]
  
<font color=red>
 
<pre>
 
cp /afs/cern.ch/user/i/ivo/public/MCatNLO_scripts/inparmMcAtNlo.dat.BASIC .
 
</pre>
 
</font>
 
  
:The lines that will be changed by the script are related to the number of events, the random number seeds for the generators and the output files.
+
The lines that will be changed by the script are related to the number of events, the random number seeds for the generators and the output files.
  
 
<font color=blue size="-1">  
 
<font color=blue size="-1">  
 
<pre>
 
<pre>
 
  './XINPUTDIRX/XINPUTNAMEX'    ! event file
 
  './XINPUTDIRX/XINPUTNAMEX'    ! event file
   XNEVENTSX                    ! number of events
+
   XNEVENTSX                    ! number of events in the event file
 
</pre>
 
</pre>
 
</font>
 
</font>
  
 +
==3) Get the script and taylor it to your needs==
  
:'''3) Get the script and taylor it to your needs'''
+
The last step is to get the script and start the jobs. For each job it will:
 +
 
 +
::o create a directory called Job<job#>
 +
:::o create two unique input files
 +
:::o copy all otehr nexessary files here and start the job
 +
:::o copy output files (CBNT,POOL and Logfiles) to an output directory
 +
::o remove directory Job<job#>
 +
 
 +
<b>(a) Get the script</b>
 +
 
 +
Go to your working area:
 
<font color=red>  
 
<font color=red>  
 
<pre>
 
<pre>
cd /project/atlas/users/ivov/MyMCatNLO/
+
cd /MyMCatNLO/
cp /afs/cern.ch/users/i/ivo/public/MCatNLO_scripts/ShipOff_MyMCatNLO_Step3.py .
 
 
</pre>
 
</pre>
 
</font>
 
</font>
  
:In the script we need to define a few variables of which the input and output directories are most important.
+
and get the python script:  [http://www.nikhef.nl/~ivov/MCatNLO_Scripts/ShipOff_MCatNLO_Rome_POOLCBNT.py ShipOff_MCatNLO_Rome_POOLCBNT.py]
 +
 
 +
 
 +
<b>(b) Tailor the script to your environment</b>
 +
 
 +
In the script you need to define the variables related to the input and output directories. These are defined in the first "routine" in the script.
  
 
<font color=blue size="-1">  
 
<font color=blue size="-1">  
 
<pre>
 
<pre>
input_dir          = "/project/atlas/users/ivov/MyMCatNLO/MyMCatNLO_MATRIXELEMENT/"
+
input_dir          = "/data/atlas/users/ivov/MyMCatNLO/MATRIXELEMENT/"
output_dir          = "/project/atlas/users/ivov/MyMCatNLO/MyMCatNLO_OUTPUT/"
+
output_dir          = "/data/atlas/users/ivov/MyMCatNLO/POOLCBNT/"
steering_files_dir  = "/project/atlas/users/ivov/MyMCatNLO/MyMCatNLO_BASICS/"
+
steering_files_dir  = "/data/atlas/users/ivov/MyMCatNLO/ATHENA_BASICS/"
 +
</pre>
 +
</font>
  
Nevents            12500
+
At the same place in the script also parameters related to the number of events, the number of jobs etc have to be set.
Nevents_joboptions  =       1
+
 
Njobs              =      1
+
<font color=blue size="-1">
 +
<pre>
 +
Nevents_eventfile   =    500
 +
Nevents_joboptions  =     20
 +
Njobs              =      2
 
f_LogFile          =      0
 
f_LogFile          =      0
 
</pre>
 
</pre>
 
</font>
 
</font>
  
 +
<font color=red><b>Important:</b></font>
 +
The variable called Nevents_eventfile is linked to the number of events that are in the <>.events files. Make sure therefore that this number is the same as in the header of the <>.events file (should be made automatic). The variable Nevents_joboptions controls the number of events that will be processed.
  
:<font color=red><b>Important:</b></font>
+
==4) Run the script==
:The variable called Nevents is linked to the number of events that are in the <>.events files. Make sure therefore that this number is the same as in the header of the <>.events file.
 
  
:'''4)Run the script'''
+
Once the number of events and the number of jobs are defined start the run:
 +
 
 +
<font color=red>
 +
<pre>
 +
./ShipOff_MCatNLO_Rome_POOLCBNT.py
 +
</pre>
 +
</font>
 +
 
 +
Once you get it running for a single job, set the parameter <b>f_Logfile=1</b> and <b>Njobs=2</b> to produce two files
 +
where the logfile is automatically written to the output
 +
directory.
 +
 
 +
<u>You are finished</u>
 +
 
 +
 
 +
<b> What did we produce ??</b>
 +
 
 +
<font color=blue size="-1">
 +
<pre>
 +
[ivov@njord MyMCatNLO]$ ls -lrt ./POOLCBNT/*
 +
-rw-r--r--    1 ivov    atlas    2511240 May 10 11:38 ./POOLCBNT/MCatNLO.POOL.Job1.root
 +
-rw-r--r--    1 ivov    atlas    1044531 May 10 11:38 ./POOLCBNT/MCatNLO.CBNT.Job1.root
 +
-rw-r--r--    1 ivov    atlas    2429914 May 10 11:38 ./POOLCBNT/MCatNLO.POOL.Job2.root
 +
-rw-r--r--    1 ivov    atlas    1014065 May 10 11:38 ./POOLCBNT/MCatNLO.CBNT.Job2.root
 +
 
 +
./POOLCBNT/InputAndLogfiles:
 +
total 540
 +
-rw-r--r--    1 ivov    atlas      250943 May 10 11:38 Logfile.Job1.log
 +
-rw-r--r--    1 ivov    atlas        5114 May 10 11:38 joboptions_Job1.py
 +
-rw-r--r--    1 ivov    atlas        492 May 10 11:38 inparmMcAtNlo.dat.Job1
 +
-rw-r--r--    1 ivov    atlas      263851 May 10 11:38 Logfile.Job2.log
 +
-rw-r--r--    1 ivov    atlas        5114 May 10 11:38 joboptions_Job2.py
 +
-rw-r--r--    1 ivov    atlas        492 May 10 11:38 inparmMcAtNlo.dat.Job2
 +
</pre>
 +
</font>
  
When running the script a directory called Job1 filled with the files from the 'basic' directory and changed so that the variables are unique. The output Ntuple is stored in the output directory.
+
To POOL files you have produced can then be transformed to AOD after full reconstruction or Atlfast.

Latest revision as of 09:39, 10 May 2005

On this page we will use the <>.event files that were produced by MCatNLO and use Herwig (using the Athena framework) to decay the tops and produce the parton shower. We will produce a combined ntuple CBNT and POOL file.

Main idea:

The main idea is to call athena with a joboptions file where you specify the location of the event file. In addition it is required to have an additional input file. We will again use a script that will take the BASIC forms for these input files and prodice unique input files for each job and take care of the bookkeeping.

1) Set-up Athena and output directories

We will use Athena to do the decay. Make sure that you have correctly set up the athena environment. To see how to do this please check xxx.

cd /MyMCatNLO
mkdir ATHENA_BASICS
mkdir POOLCBNT
mkdir POOLCBNT/InputAndLogfiles

2) Get the basic input files

Since we have used MCatNLO to produce the and momenta, we have to signal to Herwig that it must these from your external <>.event-file. In Athena, this is done inside a joboptions file. Again we start at again to your MCatNLO working directory area. Create two new directories where we'll store the basic input files (basic joboptions file and other athena related files) and the output files (the combined ntuple for the generator information and POOL files).

cd /MyMCatNLO/ATHENA_BASICS

(a) Get some Athena python-files and check set-up

Get these athena python files into your BASICS area using get_files.

get_files PDGTABLE.MeV
get_files PartPropSvc.py

This is a good check to see if you have set-up athena correctly. If this fails please make sure you have the Athena envoronment set-up correctly.

(b) Get the basic joboptions file

Get the basic joboptions file: joboptions_MCatNLO_Rome_POOLCBNT.py.BASIC

The lines that will be changed by the script are related to the number of events, the random number seeds for the generators and the output files.

theApp.EvtMax = XNEVENTSX
AtRndmGenSvc.Seeds = ["JIMMY  XRNDJIMMY0X XRNDJIMMY1X", "JIMMY_INIT  XRNDJIMMY2X XRNDJIMMY3X",
                      "TAUOLA XRNDTAUOLA0X XRNDTAUOLA1X", "TAUOLA_INIT XRNDTAUOLA2X XRNDTAUOLA3X", 
                      "PHOTOS XRNDPHOTOS0X XRNDPHOTOS1X", "PHOTOS_INIT XRNDPHOTOS2X XRNDPHOTOS3X"]
NTupleSvc.Output     = [ "FILE1 DATAFILE='./XOutputDirCBNTX/MCatNLO.CBNT.JobXJOBNUMBERX.root' OPT='NEW'" ]
Stream1.OutputFile = "./XOutputDirPOOLX/MCatNLO.POOL.JobXJOBNUMBERX.root"


(c) Get the inparmMcAtNlo.dat (MCatNLO parameter) file

When starting the athena job, a file called inparmMcAtNlo.dat is expected in your run directory. It contains the location of the <>.event file and some additional input variables related to the generated MCatNLO sample.

Get the additional MCatNLO parameter file: inparmMcAtNlo.dat.BASIC


The lines that will be changed by the script are related to the number of events, the random number seeds for the generators and the output files.

 './XINPUTDIRX/XINPUTNAMEX'     ! event file
  XNEVENTSX                     ! number of events in the event file

3) Get the script and taylor it to your needs

The last step is to get the script and start the jobs. For each job it will:

o create a directory called Job<job#>
o create two unique input files
o copy all otehr nexessary files here and start the job
o copy output files (CBNT,POOL and Logfiles) to an output directory
o remove directory Job<job#>

(a) Get the script

Go to your working area:

cd /MyMCatNLO/

and get the python script: ShipOff_MCatNLO_Rome_POOLCBNT.py


(b) Tailor the script to your environment

In the script you need to define the variables related to the input and output directories. These are defined in the first "routine" in the script.

input_dir           = "/data/atlas/users/ivov/MyMCatNLO/MATRIXELEMENT/"
output_dir          = "/data/atlas/users/ivov/MyMCatNLO/POOLCBNT/"
steering_files_dir  = "/data/atlas/users/ivov/MyMCatNLO/ATHENA_BASICS/"

At the same place in the script also parameters related to the number of events, the number of jobs etc have to be set.

Nevents_eventfile   =     500
Nevents_joboptions  =      20
Njobs               =       2
f_LogFile           =       0

Important: The variable called Nevents_eventfile is linked to the number of events that are in the <>.events files. Make sure therefore that this number is the same as in the header of the <>.events file (should be made automatic). The variable Nevents_joboptions controls the number of events that will be processed.

4) Run the script

Once the number of events and the number of jobs are defined start the run:

./ShipOff_MCatNLO_Rome_POOLCBNT.py

Once you get it running for a single job, set the parameter f_Logfile=1 and Njobs=2 to produce two files where the logfile is automatically written to the output directory.

You are finished


What did we produce ??

[ivov@njord MyMCatNLO]$ ls -lrt ./POOLCBNT/*
-rw-r--r--    1 ivov     atlas     2511240 May 10 11:38 ./POOLCBNT/MCatNLO.POOL.Job1.root
-rw-r--r--    1 ivov     atlas     1044531 May 10 11:38 ./POOLCBNT/MCatNLO.CBNT.Job1.root
-rw-r--r--    1 ivov     atlas     2429914 May 10 11:38 ./POOLCBNT/MCatNLO.POOL.Job2.root
-rw-r--r--    1 ivov     atlas     1014065 May 10 11:38 ./POOLCBNT/MCatNLO.CBNT.Job2.root

./POOLCBNT/InputAndLogfiles:
total 540
-rw-r--r--    1 ivov     atlas      250943 May 10 11:38 Logfile.Job1.log
-rw-r--r--    1 ivov     atlas        5114 May 10 11:38 joboptions_Job1.py
-rw-r--r--    1 ivov     atlas         492 May 10 11:38 inparmMcAtNlo.dat.Job1
-rw-r--r--    1 ivov     atlas      263851 May 10 11:38 Logfile.Job2.log
-rw-r--r--    1 ivov     atlas        5114 May 10 11:38 joboptions_Job2.py
-rw-r--r--    1 ivov     atlas         492 May 10 11:38 inparmMcAtNlo.dat.Job2

To POOL files you have produced can then be transformed to AOD after full reconstruction or Atlfast.