Linear Collider Forum



Home » Simulation » Full Simulations » Converting HepMC to Mokka compatible format
Re: Converting HepMC to Mokka compatible format [message #1952 is a reply to message #1950] Wed, 21 April 2010 01:54 Go to previous messageGo to previous message
gaede
Messages: 233
Registered: January 2004
Location: DESY, Hamburg
Hi,

Mokka can read either stdhep binary files or ASCII files that follow the hepevt common block (old pytha) - either in a long or short version. I don't know if pythia C++ can still write the hepevt ascii. In any case it should be straight forward to write a script that converts the HepMC ascii into one of the hepevt formats.
For details see code snippet from $MOKKA/source/Kernel/LCAscHepRdr.cc below.

-Frank.

 
    int NHEP;  // number of entries
    inputFile >> NHEP;

 //...
 
    int ISTHEP;   // status code
    int IDHEP;    // PDG code
    int JMOHEP1;  // first mother
    int JMOHEP2;  // last mother
    int JDAHEP1;  // first daughter
    int JDAHEP2;  // last daughter
    double PHEP1; // px in GeV/c
    double PHEP2; // py in GeV/c
    double PHEP3; // pz in GeV/c
    double PHEP4; // energy in GeV
    double PHEP5; // mass in GeV/c**2
    double VHEP1; // x vertex position in mm
    double VHEP2; // y vertex position in mm
    double VHEP3; // z vertex position in mm
    double VHEP4; // production time in mm/c

    std::vector<int> *daughter1 = new std::vector<int> ();
    std::vector<int> *daughter2 =  new std::vector<int> ();

    for( int IHEP=0; IHEP<NHEP; IHEP++ )
      {
    if ( theFileFormat == HEPEvt)
      inputFile >> ISTHEP >> IDHEP >> JDAHEP1 >> JDAHEP2
          >> PHEP1 >> PHEP2 >> PHEP3 >> PHEP5;
    else
      inputFile >> ISTHEP >> IDHEP
            >> JMOHEP1 >> JMOHEP2
            >> JDAHEP1 >> JDAHEP2
            >> PHEP1 >> PHEP2 >> PHEP3
            >> PHEP4 >> PHEP5
            >> VHEP1 >> VHEP2 >> VHEP3
            >> VHEP4;


 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:Converter from Les Houches event xml files to stdhep format?
Next Topic:How to count events in .stdhep file
Goto Forum:
  


Current Time: Sun Dec 16 09:50:59 Pacific Standard Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software