User Tools

Site Tools


community:hepsim:dev_truth

This is an old revision of the document!


<< back to HepSim manual

Creating truth-level samples

HepSim is optimized to keep truth-level in the “archive” format called ProMC. It allows to keep data in a compact form optimized for data streaming over the network, together with logfiles which will help to identify the MC settings.

ProMC files can be created directly by Pythi8 (the example “main46.cc” in the Pythi8). Or, you can convert files in the format “HEPMC”, “LHE”, “STDHEP” to ProMC as shown in the “example” directory of the installed ProMC package (look at $PROMC/examples). The converters are:

  • hepmc2promc
  • lhe2promc
  • stdhep2promc

Look at the ProMC manual for more examples.

Using Madgraph5

To run MG5 with ProMC, please install ProMC package first. The download MG5 with preconfigured ProMC output from package_mg14tev.tgz.

wget https://atlaswww.hep.anl.gov/hepsim/soft/package_mg14tev.tgz
tar -zvxf package_mg14tev.tgz

Now check that ProMC is correctly installed. You should be able to compile “stdhep2promc” converter.

cd package/stdhep2promc
make

If successful, then you should see the binary file “stdhep2promc”.

Now let compile “MG5”. Go to the directory “MG5_aMC_v2_3_2_2”. We assume 64bit Scientific Linux 6.5 computer. Setup gcc47. In the case of ATLAS setup, use:

source setup_gcc47.sh

To create multiple number of files in the ProMC format for “ttbar+jet”, run this script:

./A_RUN_ttbar_jet

It does the following: It runs the script “RUN_ttbar_jet_14tev” which creates promc files inside “out” directory. The number of output files are given inside the script A_RUN_ttbar_jet. You should reduce this number if you want to stop earlier.

All MG5 settings for this particular run are in the directory “run_ttbar_jet_14tev”. This is the standard MG5 directory.

To check the output ProMc file, look at the browser:

wget  http://atlaswww.hep.anl.gov/asc/promc/download/browser_promc.jar  # get GUI browser
java -jar browser_promc.jar out/file.promc 

where “file” is the name of the file being created. Typically, it takes 3h to create one file with 10,000 events.

Single-particle gun

ProMC files with single particles can be created using the ProMC. Download the recent ProMC package and look at the directory:

wget http://atlaswww.hep.anl.gov/asc/promc/download/current.php -O ProMC.tgz
tar -zvxf ProMC.tgz
cd examples/particle_gun
source setup.sh
javac promc_gun.java
java promc_gun pions.promc 100 211 1000 # E=0-100 GeV, PID=211, events=1000

This creates file “pions.promc” with 2 particles per event, with the maximum energy of 100 GeV (randomly distributed from 0 to 100). The particles are pions (pi+, pid=211). The total number of events 1000. The phi and theta distributions are flat After file creation, look at the events using the file browser. You can also modify the java code to change the single-particle events.

Pileups mixing

One can mix events from a signal ProMC file with inelastic (minbias) events using a “pileup” mixing program. The next example assumes that either the hs-tools package or Jas4pp is installed.

hs-pileup pN signal.promc minbias.promc output.promc

Here “p” indicates that N events from minbias.promc will be mixed with every event from signal.promc using a Poisson distribution. If “p” is missing, then exactly N events from minbias.promc will be mixed with single event from signal.promc. Use large number of events in minbias.promc to minimise reuse of the same events from the minbias.promc. The barcode of particles inside output.promc indicates the event origin.

Here is an example to create events with pileup for the paper http://arxiv.org/abs/1504.08042 Phys. Rev. D 91, 114018 (2015): We mix h→ HH signal file with MinBias Pythia8 (A2 tune) sample using <mu>=200 (Poisson mean):

wget http://atlaswww.hep.anl.gov/asc/hepsim/soft/hs-toolkit.tgz -O - | tar -xz;
source hs-toolkit/setup.sh
wget http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/minbias_a2_pythia8_l3/tev100_pythia8_MinBias_l3__A2_001.promc
wget http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/s0higgshiggs_alltau/tev100_s0higgshiggs_alltau_0001.promc
hs-pileup p200 tev100_s0higgshiggs_alltau_0001.promc tev100_pythia8_MinBias_l3__A2_001.promc output.promc 

Look at the “output.promc” with the browser to see how events are filled. Now you can use DELPHES to create fast simulation files using events with pileup.

Note: pileup mixer is implemented in Java, therefore it uses 64bit zip. For C++ programs, please use ProMCBook(“file.promc”, “r”, true) to open ProMC files (notice “true” as a new argument). For example, for the Delphes program, change the line

inputFile = new ProMCBook(argv[i], "r");       # 32bit zip

in readers/DelphesProMC.cpp to

inputFile = new ProMCBook(argv[i], "r", true); # 64bit zip

Sergei Chekanov 2016/04/27 09:24

community/hepsim/dev_truth.1465823179.txt.gz · Last modified: 2016/06/13 13:06 by asc