Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:59

0001 //--------------------------------------------------------------------------
0002 //THIS IS A BRUTAL COPY OF HEPEVT_Wrapper from HEPMC
0003 //We need it because the EPOS generator needs a largeer version of HEPEVT to store the event
0004 #ifndef EPOS_EntriesAllocation
0005 #define EPOS_EntriesAllocation 99900
0006 #endif  // EPOS_EntriesAllocation
0007 
0008 //--------------------------------------------------------------------------
0009 #ifndef HEPMC_EPOS_COMMON_H
0010 #define HEPMC_EPOS_COMMON_H
0011 //////////////////////////////////////////////////////////////////////////
0012 //
0013 //      PARAMETER (NMXHEP=2000)
0014 //      COMMON/HEPCOM/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
0015 //     &        JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
0016 /**********************************************************/
0017 /*           D E S C R I P T I O N :                      */
0018 /*--------------------------------------------------------*/
0019 /* NEVHEP          - event number (or some special meaning*/
0020 /*                    (see documentation for details)     */
0021 /* NHEP            - actual number of entries in current  */
0022 /*                    event.                              */
0023 /* ISTHEP[IHEP]    - status code for IHEP'th entry - see  */
0024 /*                    documentation for details           */
0025 /* IDHEP [IHEP]    - IHEP'th particle identifier according*/
0026 /*                    to PDG.                             */
0027 /* JMOHEP[IHEP][0] - pointer to position of 1st mother    */
0028 /* JMOHEP[IHEP][1] - pointer to position of 2nd mother    */
0029 /* JDAHEP[IHEP][0] - pointer to position of 1st daughter  */
0030 /* JDAHEP[IHEP][1] - pointer to position of 2nd daughter  */
0031 /* PHEP  [IHEP][0] - X momentum                           */
0032 /* PHEP  [IHEP][1] - Y momentum                           */
0033 /* PHEP  [IHEP][2] - Z momentum                           */
0034 /* PHEP  [IHEP][3] - Energy                               */
0035 /* PHEP  [IHEP][4] - Mass                                 */
0036 /* VHEP  [IHEP][0] - X vertex                             */
0037 /* VHEP  [IHEP][1] - Y vertex                             */
0038 /* VHEP  [IHEP][2] - Z vertex                             */
0039 /* VHEP  [IHEP][3] - production time                      */
0040 /*========================================================*/
0041 // Remember, array(1) is the first entry in a fortran array, array[0] is the
0042 //           first entry in a C array.
0043 //
0044 // This interface to EPOS common block treats the block as
0045 // an array of bytes --- the precision and number of entries
0046 // is determined "on the fly" by the wrapper and used to decode
0047 // each entry.
0048 //
0049 // EPOS_EntriesAllocation is the maximum size of the EPOS common block
0050 //   that can be interfaced.
0051 //   It is NOT the actual size of the EPOS common used in each
0052 //   individual application. The actual size can be changed on
0053 //   the fly using EPOS_Wrapper::set_max_number_entries().
0054 // Thus EPOS_EntriesAllocation should typically be set
0055 // to the maximum possible number of entries --- 10000 is a good choice
0056 // (and is the number used by ATLAS versions of Pythia).
0057 //
0058 // Note: a statement like    *( (int*)&hepcom.data[0] )
0059 //      takes the memory address of the first byte in EPOS,
0060 //      interprets it as an integer pointer,
0061 //      and dereferences the pointer.
0062 //      i.e. it returns an integer corresponding to nevhep
0063 //
0064 
0065 #include <cctype>
0066 
0067 const unsigned int epos_bytes_allocation =
0068     sizeof(long int) * (2 + 6 * EPOS_EntriesAllocation) + sizeof(double) * (9 * EPOS_EntriesAllocation);
0069 
0070 #ifdef _WIN32  // Platform: Windows MS Visual C++
0071 struct HEPCOM_DEF {
0072   char data[epos_bytes_allocation];
0073 };
0074 extern "C" HEPCOM_DEF HEPCOM;
0075 #define hepcom HEPCOM
0076 
0077 #else
0078 extern "C" {
0079 extern struct {
0080   char data[epos_bytes_allocation];
0081 } hepcom_;
0082 }
0083 #define hepcom hepcom_
0084 
0085 #endif  // Platform
0086 
0087 #endif  // HEPMC_EPOS_COMMON_H
0088 
0089 //--------------------------------------------------------------------------
0090 #ifndef HEPMC_EPOS_WRAPPER_H
0091 #define HEPMC_EPOS_WRAPPER_H
0092 
0093 //////////////////////////////////////////////////////////////////////////
0094 // Matt.Dobbs@Cern.CH, April 24, 2000, refer to:
0095 // M. Dobbs and J.B. Hansen, "The HepMC C++ Monte Carlo Event Record for
0096 // High Energy Physics", Computer Physics Communications (to be published).
0097 //
0098 // Generic Wrapper for the fortran EPOS common block
0099 // This class is intended for static use only - it makes no sense to
0100 // instantiate it.
0101 // Updated: June 30, 2000 (static initialization moved to separate .cxx file)
0102 //////////////////////////////////////////////////////////////////////////
0103 //
0104 // The index refers to the fortran style index:
0105 // i.e. index=1 refers to the first entry in the EPOS common block.
0106 // all indices must be >0
0107 // number_entries --> integer between 0 and max_number_entries() giving total
0108 //                    number of sequential particle indices
0109 // first_parent/child --> index of first mother/child if there is one,
0110 //                        zero otherwise
0111 // last_parent/child --> if number children is >1, address of last parent/child
0112 //                       if number of children is 1, same as first_parent/child
0113 //                       if there are no children, returns zero.
0114 // is_double_precision --> T or F depending if floating point variables
0115 //                         are 8 or 4 bytes
0116 //
0117 
0118 #include <iostream>
0119 #include <cstdio>  // needed for formatted output using sprintf
0120 
0121 namespace EPOS {
0122 
0123   //! Generic Wrapper for the fortran EPOS common block
0124 
0125   /// \class EPOS_Wrapper
0126   /// This class is intended for static use only - it makes no sense to
0127   /// instantiate it.
0128   ///
0129   class EPOS_Wrapper {
0130   public:
0131     /// write information from EPOS common block
0132     static void print_hepcom(std::ostream& ostr = std::cout);
0133     /// write particle information to ostr
0134     static void print_hepcom_particle(int index, std::ostream& ostr = std::cout);
0135     /// set all entries in EPOS to zero
0136     static void zero_everything();
0137 
0138     ////////////////////
0139     // Access Methods //
0140     ////////////////////
0141     static int event_number();              //!< event number
0142     static int number_entries();            //!< num entries in current evt
0143     static int status(int index);           //!< status code
0144     static int id(int index);               //!< PDG particle id
0145     static int first_parent(int index);     //!< index of 1st mother
0146     static int last_parent(int index);      //!< index of last mother
0147     static int number_parents(int index);   //!< number of parents
0148     static int first_child(int index);      //!< index of 1st daughter
0149     static int last_child(int index);       //!< index of last daughter
0150     static int number_children(int index);  //!< number of children
0151     static double px(int index);            //!< X momentum
0152     static double py(int index);            //!< Y momentum
0153     static double pz(int index);            //!< Z momentum
0154     static double e(int index);             //!< Energy
0155     static double m(int index);             //!< generated mass
0156     static double x(int index);             //!< X Production vertex
0157     static double y(int index);             //!< Y Production vertex
0158     static double z(int index);             //!< Z Production vertex
0159     static double t(int index);             //!< production time
0160 
0161     ////////////////////
0162     // Set Methods    //
0163     ////////////////////
0164 
0165     /// set event number
0166     static void set_event_number(int evtno);
0167     /// set number of entries in EPOS
0168     static void set_number_entries(int noentries);
0169     /// set particle status
0170     static void set_status(int index, int status);
0171     /// set particle ID
0172     static void set_id(int index, int id);
0173     /// define parents of a particle
0174     static void set_parents(int index, int firstparent, int lastparent);
0175     /// define children of a particle
0176     static void set_children(int index, int firstchild, int lastchild);
0177     /// set particle momentum
0178     static void set_momentum(int index, double px, double py, double pz, double e);
0179     /// set particle mass
0180     static void set_mass(int index, double mass);
0181     /// set particle production vertex
0182     static void set_position(int index, double x, double y, double z, double t);
0183     //////////////////////
0184     // EPOS Floorplan //
0185     //////////////////////
0186     static unsigned int sizeof_int();                  //!< size of integer in bytes
0187     static unsigned int sizeof_real();                 //!< size of real in bytes
0188     static int max_number_entries();                   //!< size of common block
0189     static void set_sizeof_int(unsigned int);          //!< define size of integer
0190     static void set_sizeof_real(unsigned int);         //!< define size of real
0191     static void set_max_number_entries(unsigned int);  //!< define size of common block
0192 
0193   protected:
0194     /// navigate a byte array
0195     static double byte_num_to_double(unsigned int);
0196     /// navigate a byte array
0197     static int byte_num_to_int(unsigned int);
0198     /// pretend common block is an array of bytes
0199     static void write_byte_num(double, unsigned int);
0200     /// pretend common block is an array of bytes
0201     static void write_byte_num(int, unsigned int);
0202     /// print output legend
0203     static void print_legend(std::ostream& ostr = std::cout);
0204 
0205   private:
0206     static unsigned int s_sizeof_int;
0207     static unsigned int s_sizeof_real;
0208     static unsigned int s_max_number_entries;
0209   };
0210 
0211   //////////////////////////////
0212   // EPOS Floorplan Inlines //
0213   //////////////////////////////
0214   inline unsigned int EPOS_Wrapper::sizeof_int() { return s_sizeof_int; }
0215 
0216   inline unsigned int EPOS_Wrapper::sizeof_real() { return s_sizeof_real; }
0217 
0218   inline int EPOS_Wrapper::max_number_entries() { return (int)s_max_number_entries; }
0219 
0220   inline void EPOS_Wrapper::set_sizeof_int(unsigned int size) {
0221     if (size != sizeof(short int) && size != sizeof(long int) && size != sizeof(int)) {
0222       std::cerr << "HepMC is not able to handle integers "
0223                 << " of size other than 2 or 4."
0224                 << " You requested: " << size << std::endl;
0225     }
0226     s_sizeof_int = size;
0227   }
0228 
0229   inline void EPOS_Wrapper::set_sizeof_real(unsigned int size) {
0230     if (size != sizeof(float) && size != sizeof(double)) {
0231       std::cerr << "HepMC is not able to handle floating point numbers"
0232                 << " of size other than 4 or 8."
0233                 << " You requested: " << size << std::endl;
0234     }
0235     s_sizeof_real = size;
0236   }
0237 
0238   inline void EPOS_Wrapper::set_max_number_entries(unsigned int size) { s_max_number_entries = size; }
0239 
0240   inline double EPOS_Wrapper::byte_num_to_double(unsigned int b) {
0241     if (b >= epos_bytes_allocation)
0242       std::cerr << "EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
0243     if (s_sizeof_real == sizeof(float)) {
0244       float* myfloat = (float*)&hepcom.data[b];
0245       return (double)(*myfloat);
0246     } else if (s_sizeof_real == sizeof(double)) {
0247       double* mydouble = (double*)&hepcom.data[b];
0248       return (*mydouble);
0249     } else {
0250       std::cerr << "EPOS_Wrapper: illegal floating point number length." << s_sizeof_real << std::endl;
0251     }
0252     return 0;
0253   }
0254 
0255   inline int EPOS_Wrapper::byte_num_to_int(unsigned int b) {
0256     if (b >= epos_bytes_allocation)
0257       std::cerr << "EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
0258     if (s_sizeof_int == sizeof(short int)) {
0259       short int* myshortint = (short int*)&hepcom.data[b];
0260       return (int)(*myshortint);
0261     } else if (s_sizeof_int == sizeof(long int)) {
0262       long int* mylongint = (long int*)&hepcom.data[b];
0263       return (*mylongint);
0264       // on some 64 bit machines, int, short, and long are all different
0265     } else if (s_sizeof_int == sizeof(int)) {
0266       int* myint = (int*)&hepcom.data[b];
0267       return (*myint);
0268     } else {
0269       std::cerr << "EPOS_Wrapper: illegal integer number length." << s_sizeof_int << std::endl;
0270     }
0271     return 0;
0272   }
0273 
0274   inline void EPOS_Wrapper::write_byte_num(double in, unsigned int b) {
0275     if (b >= epos_bytes_allocation)
0276       std::cerr << "EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
0277     if (s_sizeof_real == sizeof(float)) {
0278       float* myfloat = (float*)&hepcom.data[b];
0279       (*myfloat) = (float)in;
0280     } else if (s_sizeof_real == sizeof(double)) {
0281       double* mydouble = (double*)&hepcom.data[b];
0282       (*mydouble) = (double)in;
0283     } else {
0284       std::cerr << "EPOS_Wrapper: illegal floating point number length." << s_sizeof_real << std::endl;
0285     }
0286   }
0287 
0288   inline void EPOS_Wrapper::write_byte_num(int in, unsigned int b) {
0289     if (b >= epos_bytes_allocation)
0290       std::cerr << "EPOS_Wrapper: requested hepcom data exceeds allocation" << std::endl;
0291     if (s_sizeof_int == sizeof(short int)) {
0292       short int* myshortint = (short int*)&hepcom.data[b];
0293       (*myshortint) = (short int)in;
0294     } else if (s_sizeof_int == sizeof(long int)) {
0295       long int* mylongint = (long int*)&hepcom.data[b];
0296       (*mylongint) = (int)in;
0297       // on some 64 bit machines, int, short, and long are all different
0298     } else if (s_sizeof_int == sizeof(int)) {
0299       int* myint = (int*)&hepcom.data[b];
0300       (*myint) = (int)in;
0301     } else {
0302       std::cerr << "EPOS_Wrapper: illegal integer number length." << s_sizeof_int << std::endl;
0303     }
0304   }
0305 
0306   //////////////
0307   // INLINES  //
0308   //////////////
0309 
0310   inline int EPOS_Wrapper::event_number() { return byte_num_to_int(0); }
0311 
0312   inline int EPOS_Wrapper::number_entries() {
0313     int nhep = byte_num_to_int(1 * sizeof_int());
0314     return (nhep <= max_number_entries() ? nhep : max_number_entries());
0315   }
0316 
0317   inline int EPOS_Wrapper::status(int index) { return byte_num_to_int((2 + index - 1) * sizeof_int()); }
0318 
0319   inline int EPOS_Wrapper::id(int index) {
0320     return byte_num_to_int((2 + max_number_entries() + index - 1) * sizeof_int());
0321   }
0322 
0323   inline int EPOS_Wrapper::first_parent(int index) {
0324     int parent = byte_num_to_int((2 + 2 * max_number_entries() + 2 * (index - 1)) * sizeof_int());
0325     return (parent > 0 && parent <= number_entries()) ? parent : 0;
0326   }
0327 
0328   inline int EPOS_Wrapper::last_parent(int index) {
0329     // Returns the Index of the LAST parent in the EPOS record
0330     // for particle with Index index.
0331     // If there is only one parent, the last parent is forced to
0332     // be the same as the first parent.
0333     // If there are no parents for this particle, both the first_parent
0334     // and the last_parent with return 0.
0335     // Error checking is done to ensure the parent is always
0336     // within range ( 0 <= parent <= nhep )
0337     //
0338     int firstparent = first_parent(index);
0339     int parent = byte_num_to_int((2 + 2 * max_number_entries() + 2 * (index - 1) + 1) * sizeof_int());
0340     return (parent > firstparent && parent <= number_entries()) ? parent : firstparent;
0341   }
0342 
0343   inline int EPOS_Wrapper::number_parents(int index) {
0344     int firstparent = first_parent(index);
0345     return (firstparent > 0) ? (1 + last_parent(index) - firstparent) : 0;
0346   }
0347 
0348   inline int EPOS_Wrapper::first_child(int index) {
0349     int child = byte_num_to_int((2 + 4 * max_number_entries() + 2 * (index - 1)) * sizeof_int());
0350     return (child > 0 && child <= number_entries()) ? child : 0;
0351   }
0352 
0353   inline int EPOS_Wrapper::last_child(int index) {
0354     // Returns the Index of the LAST child in the EPOS record
0355     // for particle with Index index.
0356     // If there is only one child, the last child is forced to
0357     // be the same as the first child.
0358     // If there are no children for this particle, both the first_child
0359     // and the last_child with return 0.
0360     // Error checking is done to ensure the child is always
0361     // within range ( 0 <= parent <= nhep )
0362     //
0363     int firstchild = first_child(index);
0364     int child = byte_num_to_int((2 + 4 * max_number_entries() + 2 * (index - 1) + 1) * sizeof_int());
0365     return (child > firstchild && child <= number_entries()) ? child : firstchild;
0366   }
0367 
0368   inline int EPOS_Wrapper::number_children(int index) {
0369     int firstchild = first_child(index);
0370     return (firstchild > 0) ? (1 + last_child(index) - firstchild) : 0;
0371   }
0372 
0373   inline double EPOS_Wrapper::px(int index) {
0374     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 0) * sizeof_real());
0375   }
0376 
0377   inline double EPOS_Wrapper::py(int index) {
0378     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 1) * sizeof_real());
0379   }
0380 
0381   inline double EPOS_Wrapper::pz(int index) {
0382     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 2) * sizeof_real());
0383   }
0384 
0385   inline double EPOS_Wrapper::e(int index) {
0386     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 3) * sizeof_real());
0387   }
0388 
0389   inline double EPOS_Wrapper::m(int index) {
0390     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 4) * sizeof_real());
0391   }
0392 
0393   inline double EPOS_Wrapper::x(int index) {
0394     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() +
0395                               (5 * max_number_entries() + (4 * (index - 1) + 0)) * sizeof_real());
0396   }
0397 
0398   inline double EPOS_Wrapper::y(int index) {
0399     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() +
0400                               (5 * max_number_entries() + (4 * (index - 1) + 1)) * sizeof_real());
0401   }
0402 
0403   inline double EPOS_Wrapper::z(int index) {
0404     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() +
0405                               (5 * max_number_entries() + (4 * (index - 1) + 2)) * sizeof_real());
0406   }
0407 
0408   inline double EPOS_Wrapper::t(int index) {
0409     return byte_num_to_double((2 + 6 * max_number_entries()) * sizeof_int() +
0410                               (5 * max_number_entries() + (4 * (index - 1) + 3)) * sizeof_real());
0411   }
0412 
0413   inline void EPOS_Wrapper::set_event_number(int evtno) { write_byte_num(evtno, 0); }
0414 
0415   inline void EPOS_Wrapper::set_number_entries(int noentries) { write_byte_num(noentries, 1 * sizeof_int()); }
0416 
0417   inline void EPOS_Wrapper::set_status(int index, int status) {
0418     if (index <= 0 || index > max_number_entries())
0419       return;
0420     write_byte_num(status, (2 + index - 1) * sizeof_int());
0421   }
0422 
0423   inline void EPOS_Wrapper::set_id(int index, int id) {
0424     if (index <= 0 || index > max_number_entries())
0425       return;
0426     write_byte_num(id, (2 + max_number_entries() + index - 1) * sizeof_int());
0427   }
0428 
0429   inline void EPOS_Wrapper::set_parents(int index, int firstparent, int lastparent) {
0430     if (index <= 0 || index > max_number_entries())
0431       return;
0432     write_byte_num(firstparent, (2 + 2 * max_number_entries() + 2 * (index - 1)) * sizeof_int());
0433     write_byte_num(lastparent, (2 + 2 * max_number_entries() + 2 * (index - 1) + 1) * sizeof_int());
0434   }
0435 
0436   inline void EPOS_Wrapper::set_children(int index, int firstchild, int lastchild) {
0437     if (index <= 0 || index > max_number_entries())
0438       return;
0439     write_byte_num(firstchild, (2 + 4 * max_number_entries() + 2 * (index - 1)) * sizeof_int());
0440     write_byte_num(lastchild, (2 + 4 * max_number_entries() + 2 * (index - 1) + 1) * sizeof_int());
0441   }
0442 
0443   inline void EPOS_Wrapper::set_momentum(int index, double px, double py, double pz, double e) {
0444     if (index <= 0 || index > max_number_entries())
0445       return;
0446     write_byte_num(px, (2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 0) * sizeof_real());
0447     write_byte_num(py, (2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 1) * sizeof_real());
0448     write_byte_num(pz, (2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 2) * sizeof_real());
0449     write_byte_num(e, (2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 3) * sizeof_real());
0450   }
0451 
0452   inline void EPOS_Wrapper::set_mass(int index, double mass) {
0453     if (index <= 0 || index > max_number_entries())
0454       return;
0455     write_byte_num(mass, (2 + 6 * max_number_entries()) * sizeof_int() + (5 * (index - 1) + 4) * sizeof_real());
0456   }
0457 
0458   inline void EPOS_Wrapper::set_position(int index, double x, double y, double z, double t) {
0459     if (index <= 0 || index > max_number_entries())
0460       return;
0461     write_byte_num(x,
0462                    (2 + 6 * max_number_entries()) * sizeof_int() +
0463                        (5 * max_number_entries() + (4 * (index - 1) + 0)) * sizeof_real());
0464     write_byte_num(y,
0465                    (2 + 6 * max_number_entries()) * sizeof_int() +
0466                        (5 * max_number_entries() + (4 * (index - 1) + 1)) * sizeof_real());
0467     write_byte_num(z,
0468                    (2 + 6 * max_number_entries()) * sizeof_int() +
0469                        (5 * max_number_entries() + (4 * (index - 1) + 2)) * sizeof_real());
0470     write_byte_num(t,
0471                    (2 + 6 * max_number_entries()) * sizeof_int() +
0472                        (5 * max_number_entries() + (4 * (index - 1) + 3)) * sizeof_real());
0473   }
0474 
0475   inline void EPOS_Wrapper::zero_everything() {
0476     set_event_number(0);
0477     set_number_entries(0);
0478     for (int i = 1; i <= max_number_entries(); ++i) {
0479       set_status(i, 0);
0480       set_id(i, 0);
0481       set_parents(i, 0, 0);
0482       set_children(i, 0, 0);
0483       set_momentum(i, 0, 0, 0, 0);
0484       set_mass(i, 0);
0485       set_position(i, 0, 0, 0, 0);
0486     }
0487   }
0488 
0489   inline void EPOS_Wrapper::print_hepcom(std::ostream& ostr) {
0490     ostr << "________________________________________"
0491          << "________________________________________" << std::endl;
0492     ostr << "***** HEPEVT Common Event#: " << event_number() << ", " << number_entries() << " particles (max "
0493          << max_number_entries() << ") *****";
0494     ostr << sizeof_int() << "-byte integers, " << sizeof_real() << "-byte floating point numbers, "
0495          << max_number_entries() << "-allocated entries." << std::endl;
0496     print_legend(ostr);
0497     ostr << "________________________________________"
0498          << "________________________________________" << std::endl;
0499     for (int i = 1; i <= number_entries(); ++i) {
0500       print_hepcom_particle(i, ostr);
0501     }
0502     ostr << "________________________________________"
0503          << "________________________________________" << std::endl;
0504   }
0505 
0506   inline void EPOS_Wrapper::print_hepcom_particle(int i, std::ostream& ostr) {
0507     char outline[81];
0508     sprintf(outline,
0509             "%4d %+4d %4d %4d    (%9.3g, %9.3g, %9.3g, %9.3g, %9.3g)",
0510             i,
0511             status(i),
0512             first_parent(i),
0513             first_child(i),
0514             px(i),
0515             py(i),
0516             pz(i),
0517             e(i),
0518             m(i));
0519     ostr << outline << "\n";
0520     sprintf(outline,
0521             "%+9d %4d %4d    (%9.3g, %9.3g, %9.3g, %9.3g)",
0522             // old version was:" (%+9.2e, %+9.2e, %+9.2e, %+9.2e)"
0523             id(i),
0524             last_parent(i),
0525             last_child(i),
0526             x(i),
0527             y(i),
0528             z(i),
0529             t(i));
0530     ostr << outline << std::endl;
0531   }
0532 
0533   inline void EPOS_Wrapper::print_legend(std::ostream& ostr) {
0534     char outline[81];
0535     sprintf(outline,
0536             "%4s %4s %4s %5s   %10s, %9s, %9s, %9s, %10s",
0537             "Indx",
0538             "Stat",
0539             "Par-",
0540             "chil-",
0541             "(  P_x",
0542             "P_y",
0543             "P_z",
0544             "Energy",
0545             "M ) ");
0546     ostr << outline << std::endl;
0547     sprintf(
0548         outline, "%9s %4s %4s    %10s, %9s, %9s, %9s) %9s", "ID ", "ents", "dren", "Prod (   X", "Y", "Z", "cT", "[mm]");
0549     ostr << outline << std::endl;
0550   }
0551 
0552 }  // namespace EPOS
0553 
0554 #endif  // HEPMC_EPOS_WRAPPER_H
0555 //--------------------------------------------------------------------------