TPythia6 with LHE-type file

Dear experts

I have been trying to read a LHE-type file with events like below

      1

1 -1 11 0 0 0 0 0.000000000E+00 0.000000000E+00 0.120000000E+03 0.120000000E+03 0.511000000E-03 0.000000000E+00 0.900000000E+01
2 -1 -11 0 0 0 0 0.000000000E+00 0.000000000E+00 -0.120000000E+03 0.120000000E+03 0.511000000E-03 0.000000000E+00 0.900000000E+01
3 1 11 1 2 0 0 0.140209102E-02 0.196969917E-02 0.706960149E+02 0.706960149E+02 0.511000000E-03 0.000000000E+00 0.900000000E+01
4 1 -11 1 2 0 0 -0.123095462E+00 -0.133093708E+00 -0.394986978E+02 0.394991139E+02 0.511000000E-03 0.000000000E+00 0.900000000E+01
5 2 25 1 2 0 0 0.121693371E+00 0.131124008E+00 -0.311973170E+02 0.129804871E+03 0.126000000E+03 0.000000000E+00 0.900000000E+01
6 1 5 5 0 501 0 0.287938782E+02 0.555688285E+02 -0.221552978E+02 0.665612638E+02 0.475000000E+01 0.000000000E+00 0.900000000E+01
7 1 -5 5 0 0 501 -0.286721848E+02 -0.554377045E+02 -0.904201922E+01 0.632436074E+02 0.475000000E+01 0.000000000E+00 0.900000000E+01

where “1” on the top left is the event number and the rows begin with the particle number (total of 7 particles) in the first column.

Could you give me a hint on how I could read it in such a way for processing the events in Pythia6 and Fastjet (showering, hadronization and jet clustering)?

Thank you in advance.

Athena

Hi Athena,

this does not seem to be a question directly related to ROOT but you might be interested in tools like ExRootLHEFConverter or similar to import LHE files in ROOT format. This is something for sure useful as you will then be able to take advantage of ROOT Trees for generator level analyses. For the subsequent steps quite some literature is available on the web.
For sure ROOT6 will be of great help as no dictionaries are needed for interactive usage of C++ libraries, e.g. at the prompt or in macros, for example fastjet (see example below and here: sft.its.cern.ch/jira/browse/ROOT-6272)

Cheers,
Danilo

Fastjet and ROOT6
at the shell

curl -O http://fastjet.fr/repo/fastjet-3.0.6.tar.gz
tar zxvf fastjet-3.0.6.tar.gz
cd fastjet-3.0.6/
./configure --prefix=$PWD/../fastjet-install
make -j 12
make check
make install
cd ..
ROOT_INCLUDE_PATH=fastjet-install/include/ LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/fastjet-install/lib/ root -b

ROOT Prompt (from the first fastjet example)

gSystem->Load("libfastjet")
#include "fastjet/ClusterSequence.hh"
#include <iostream>
using namespace fastjet;
using namespace std;

  // an event with three particles:   px    py  pz      E
  vector<PseudoJet> particles {PseudoJet(   99.0,  0.1,  0, 100.0), 
                                              PseudoJet(    4.0, -0.1,  0,   5.0), 
                                              PseudoJet(  -99.0,    0,  0,  99.0)}
  
  // choose a jet definition
  auto R = 0.7;
  JetDefinition jet_def(antikt_algorithm, R);

  // run the clustering, extract the jets
  ClusterSequence cs(particles, jet_def);

  auto jets = sorted_by_pt(cs.inclusive_jets());

  // print out some infos
  cout << "Clustering with " << jet_def.description() << endl;

  // print the jets
  cout <<   "        pt y phi" << endl;

  for (auto&& jet : jets) {
     cout << "jet data:" << jet.pt() << " " 
            << jet.rap() << " " << jet.phi() << endl;
     auto constituents = jet.constituents();
     for (auto&& constituent : constituents) {
        cout << "    constituent's pt: " << constituent.pt() << endl;
    }
 }