LesHouches package
--Generic Interface for Les Houches Accord at CDF offline software.

Last updated: Mon Jan 23 19:01:27 CST 2006
Contents

News

Introduction

The purpose of this module in AC++ framework is to convert the event data from the ME-based external generators to our HEPG format using the built-in PS-generators such as PYTHIA or HERWIG inside CDF offline code. It allows users to control all the parameters of PS-generators via the tcl file, so that users can easily take the common parameters such as the tuning parameters for underlying events or hadronization scale, etc. We also present a method to interface an `` user original '' event generator using this module. We expect that it could be not only easy to access PYTHIA or HERWIG by tcl files, but also useful for the systematic studies of the PS-generators.

And also another benefit is that it will be easy to connect to the decay packages which treat the particle decay after getting an event, like TAUOLA or QQ. The spin information can be connected directly to those decay packages without any interfacing routines. Once the data file with a proper LHA format is given into LesHouchesModule , everything goes though inside CDF offline code. Since the events from the ME-based generators can be produced by the stand-alone execution of ME-based generators, it is potentially available to get event data from MCDB at Fermi lab.. In this point, it may also be useful to output the event file with STDHEP format. Therefore, there are four basic concepts in this module:


Reference -- Les Houches Accord

LesHouchesModule

This module has been implemented since CDF offline code ver. 4.11.1. It works inside all primitive executables like cdfGen, cdfSim, runMC except one modification in GNUmakefile. Actually, similar extension has already done since the upgrade of the PYTHIA version to 6.203 to use the external ME-generators like Grappa or WbbGen inside CDF offline code. This extension is known as libpythia_services. However to include all ME-generators inside one package (cdfGen etc.) leads huge size of the executable exceed over 500 M bytes. (It seems non-sense to include all.) To avoid this, a new framework has been developed ( libLesHouches ), where all ME-generators are outside offline code. This module is an interface module to convert the 4-vector information produced by the stand-alone executable to HEPG format using PYTHIA or HERWIG, to convert the already-exist STDHEP file into HEPG, or to write STDHEP file from the 4-vector information of ME.

The modification to run LesHouchesModule basically is only to replace the libpythia_services with the libLesHouches in GNUmakefile. For example, to make up cdfGen,


~% source ~cdfsoft/cdf2.cshrc
~% setup cdfsoft2 5.3.3
~% addpkg 5.3.3 [your dir. name]
~% cd [your dir. name]

~% addpkg LesHouches
~% cvs checkout -r1.9 LesHouches/src/les_upinit.cc
~% cvs checkout -r1.8 LesHouches/src/les_upevnt.cc
~% cvs checkout -r1.6 LesHouches/src/lespar.F
~% cvs checkout -r1.3 LesHouches/src/les_tauola.F
~% cvs checkout -r1.3 LesHouches/src/comphep_les.F
~% cvs checkout -r1.3 LesHouches/src/grappa_les.F
~% cvs checkout -r1.4 LesHouches/src/madgraph_les.F
~% cvs checkout -r1.1 LesHouches/src/baurmc_les.F
~% cvs checkout -r1.1 LesHouches/src/mcatnlo_les.F
~% cvs checkout -r1.1 LesHouches/src/mcatnlo_str.f
~% cvs checkout -r1.1 LesHouches/example/grappa_w4j_inclb_ctq5l.gen

~% addpkg generatorMods
~% cvs checkout -r1.4 generatorMods/generatorMods/HerwigMenu.hh
~% cvs checkout -r1.5 generatorMods/src/HerwigMenu.cc
~% cvs checkout -r1.4 generatorMods/generatorMods/LesHouchesModule.hh
~% cvs checkout -r1.6 generatorMods/src/LesHouchesModule.cc

Then, edit one line in generatorMods/test/GNUmakefile


override LOADLIBES +=  $(LUND_DIR)/lib/liblund.a -lLesHouches
(remove -lpythia_services)

~% gmake LesHouches.lib
~% gmake generatorMods.lib
~% gmake generatorMods.bin

You can find an executable "cdfGen".


~% cdfGen run_LesHouches.tcl

A similar instruction can be applied in cdfSim or runMC too.


Parameters (on Dec.2004)

Example tcl file

See this.

Don't forget to care the process specific parameters depending on your physics process(analysis), such as the primordial kt of Z production etc..

If the event file which you made by the external ME-generators does not suit in this module, you need to check the version of that ME-generator, then compare the file format with the current format supported by this module. The example data file can be seen ./LesHouches/example/.


How to run MCProd with LesHouches module (6.1.4)

Using MCProd package, the input event data for LesHouches module is directory passed through the detector simulation with the multi-run numbers. It allows us not only to save time/disk space/efforts to make the production data, but also to utilize the common parameter settings recommended by the physics groups which leads to more reliable studies for MC productions. The instructions are follows:

1) Make all from scratch.

~% source ~cdfsoft/cdf2.cshrc
~% setup cdfsoft2 6.1.4
~% newrel 6.1.4 [dir name]
~% cd [dir name]
~% srt_setup -a
~% addpkg mcProduction

Copy  runmegen.1.23.2006.tgz.

~% tar xzvf runmegen.1.23.2006.tgz
~% make mcProduction.v6_1_4_LHA

The tarball is also available  MCProd_v6_1_4_LHA.tar.gz (263M bytes).
2) Make the input dataset for MCProd.

After untar, "./mcProduction/script/Config.perl" will help to set the proper parameters to define the book file. On the top directory,

~% cp ./mcProduction/script/Config.perl ./
~% cp ./mcProduction/script/mcprod.csh ./
~% ./Config.perl -toteve 10000 -ingen grappa_w4j_inclb_ctq5l.gen -runlist runlist_summer2005 -gentyp Grappa -pstyp PYTHIA

The "-h" option assists to set the parameters. This script calculates backward starting from the given event number, then assign the proper number of event per run based on the runlist. The "mcprod.csh" is an example code for CAF job.

Note that the total number of required events is not same as the total number of produced events because the safety factor is applied for each run. The showring MC fails event processing with the fraction of 0.5% (for PYTHIA), the safety factor in each run is needed to be 0.5%. If we don't apply this, the same event will be processed.


3) Test run:

~% ./mcProduction/scripts/MCProd -J 233 -b cdfptop -d megen -n 10

The argument "-J" is the section number. This will be looping over until last
section defined in the book file in CAF jobs.

The argument "-b" is a catalogue directory indicated by physics group.
The argument "-d" is the catalogue file.
The argument "-n" is the number of events produced.

In this test sample, the section number "233" (whatever, I select randomly)
with just making 10 events is chosen.

4) Finally, large scale MC production will be

./mcProduction/scripts/MCProd -j 1 -b cdfptop -d megen
./mcProduction/scripts/MCProd -j 2 -b cdfptop -d megen
./mcProduction/scripts/MCProd -j 3 -b cdfptop -d megen
......

For example, the script to run in CAF jobs will be

------------------------------------------------------+
#!/bin/tcsh -f
setenv PATH /usr/krb5/bin/:/usr/bin:/bin
source ~cdfsoft/cdf2.cshrc
setup cdfsoft2 5.3.3
./mcProduction/scripts/MCProd -j $1 -b cdfptop -d megen
set X=$status
/bin/rm -rf CalTrigger Production RootObjs SimulationMods TclUtils TriggerMods
/bin/rm -rf XFTSim bin cesData dab etc farmsonly lib rcpdb svtsim
/bin/rm -rf XTRPSim cdfopr cint dbt etdata include mcProduction
/bin/rm -rf grappa_tt1j_7bdy_ctq5l.gen
exit $X
+------------------------------------------------------+

Save these lines as a csh script file, then through into CAF jobs.
!!!NOTE!!!

After running the MCProd, the script remove "*.dat" files automatically. Users must check their input file from the ME-generator does not contain the ".dat" as the file name.


How to use LHAPDF.(6.1.4)

LHAPDF include the latest version of PDFs. This is still not official. Some typical proseeses are only cross-checked. However, this may be useful if users want to estimate the PDF systematic uncertainties.

1) Make all from scratch.

~% make mcProduction.v6_1_4_LHAPDF

The tarball is also available  MCProd_v6_1_4_LHAPDF.tar.gz (298M bytes).
2) Copy PDF sets for LHAPDF.
~% tar xzvf mcProduction/scripts/lhapdf-5.0.0-beta.cdfmod.tgz
~% ln -s ./lhapdf-5.0.0-beta/PDFsets PDFsets
3) Modify the tcl file: After coping ant running the "Config.perl" and "mcprod.csh", modify the tcl file. For example, in "mcProduction/tcl/run_LesHouches.tcl", the settings
 PythiaMenu
  commonMenu
    set_mstp -index=51  -value=10000
    set_mstp -index=52  -value=2
  exit
 exit
uses "CTEQ6". You will see the following logs:
 ==== PYTHIA WILL USE LHAPDF ====
 *************************************
 *       LHAPDF Version 4.0          *
 *************************************

 >>>>>> PDF description: <<<<<<
 CTEQ6
 Reference:
 J. Pumplin, D.R. Stump, J. Huston, H.L. Lai, P. Nadolsky,
 W.K. Tung
 hep-ph/0201195
 >>>>>>                   <<<<<<

 Parametrization: CTEQ6

 ==============================================
 PDFset name PDFsets/cteq6.LHpdf
 with         40 members
 ====  initialized. ===========================
 Strong coupling at Mz for PDF is:  0.11800

How to run MCProd with LesHouches module (5.3.3)


~% source ~cdfsoft/cdf2.cshrc
~% setup cdfsoft2 5.3.3
~% newrel 5.3.3 [dir name]
~% cd [dir name]
~% addpkg mcProduction v5_3_3_v5

Copy  runmegen.7.19.2005.tgz.

~% tar xzvf runmegen.7.19.2005.tgz
~% ./mcProduction/scripts/build_all v5_3_3_megen_v7

After making the executables (cdfSim, Edm_EventLister, 
gdb, ProductionExe, and TRGSim++),

The tarball is also available  MCProd.5.3.3.v8.tgz.

~% mkdir mytest
~% cd mytest
~% tar xvf ./../MCProd_v5_3_3_megen_v7.tar

Run "Config.perl" or
Check the followings,

~% ./mcProduction/scripts/make_joblist.pl runlist_file N/nb N/section

1) Edit the book file (ex. mcProduction/book/cdfptop/megen)
   with proper NEV_PER_INV_NB, NEV_PER_SECTION, and 
   N_SECTIONS.

2) Edit the tcl file for your process (ex. 
   mcProduction/tcl/run_LesHouches.tcl) with proper ME-generator, 
   PS-generator, and input event file. (In case that the input file is STDHEP 
   file, set the file name and proper options to read STDHEP file.)

3) Make sure your input file in your working directory.

4) Test run.

How to define a new event format in LesHouches module

The version installed in LesHouchesModule may be different from your version of ME-generator. Or the event file may have completly different format or may be from a new generators. In this case, LesHouchesModule also provides a possibility to define a new event format to read and fed into CDF simulation. The instruction is follows:

0) Make sure that your generator really have the two files of "upinit.f" and "upevnt.f", just to check if that generator is really corresponding to the Les Houches format. And make sure this "upinit.f" and "upevnt.f" can handle that event file.

1) Before compiling the executable, we need to make up a new generator ID to read that event file in LesHouchesModule. That is, do

~% addpkg LesHouches

2) Change the name of "upinit.f" and "upevnt.f" to "user_upinit.f" and "user_upevnt.f" . Also change the subroutine name as well as "user_upinit.f" and "user_upevnt.f".

These are necessary to avoid the comflict with the other generators.

3) The "user_upinit.f" may have the "open file" command, but since the file is already opened in LesHouchesModule before going to "user_upinit" as the unit number "51", comment out this "OPEN" command, and change the unit ID to read the file to "51" in "user_upinit.f" and "user_upevnt.f".

4) Copy those "user_upinit.f" and "user_upevnt.f" into "./LesHouches/src/" . Please do not forget to add the other related subroutines if the "user_upinit.f" and "user_upevnt.f" need the other subroutines.

~% rm user_les.F

5) Make library.

~% gmake LesHouches.lib

The generator ID is "USER", that is, in tcl file,

LesGenType set "USER"
LesDatFile set "ggjj-short.dat"

How to change the PYTHIA/HERWIG version in CDF offline code

Current version of PYTHIA and HERWIG in CDF offline software are 6.203 and 6.500, respectively. Our module gives a possibility to use any versions of PYTHIA or HERWIG by changing a library of PYTHIA/HERWIG. This is the most remarkable feature of this module using the LHA format.

For instance, to use the latest version of PYTHIA.6.220, copy:

to ./LesHouches/test/, then modify to use it instead of $(LUND_DIR)/lib/liblund.a in ./LesHouches/test/GNUmakefile.


override LOADLIBES +=  libpythia6220mod.a

You can use any versions inside CDF offline code anytime. If you would like to use the different or more latest version of PYTHIA or HERWIG, contact Soushi Tsuno (tsuno@fnal.gov).

We should emphasis that this procedure is only available at CDF.


How to build the user original event generator

See examples:


Questions : Soushi Tsuno
e-mail : tsuno@fnal.gov
ex. : 2310 (FNAL office)
telephone: (+81)86-251-7817 (Okayama, Japan)
facsimile: (+81)86-251-7830