Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:27

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