Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

HepEvt.h

Go to the documentation of this file.
00001 // -*- C++ -*-  $Id: HepEvt.h,v 1.1 2000/01/17 23:37:29 burnett Exp $
00002 //
00003 
00004 // define the HEPEVT commom
00005 #ifndef __HEPEVT_H
00006 #define __HEPEVT_H
00007 
00008 #include "gismo/Generator.h"
00009 #include "CLHEP/Utilities/fortran.h"
00010 typedef long integer;
00011 typedef float real;
00012 
00013 unsigned const nmxhep = 50;
00014 extern "C"{
00015 //BEGIN_FORTRAN_COMMON(hepevt)
00016 extern struct HEPEVT{
00017  integer nevhep;                // event number
00018  integer        nhep;                  // number of entries
00019  integer isthep[nmxhep];        // status code
00020  integer idhep[nmxhep];         // PDG particle id
00021  integer jmohep[nmxhep][2];     // position of first, second mother
00022  integer jdahep[nmxhep][2];     // position of first, last daughter
00023  real      phep[nmxhep][5];       // 4-momemtum, mass (GeV)
00024  real    vhep[nmxhep][4];       // vertex, production time in mm
00025 END_FORTRAN_COMMON(hepevt)
00026 }
00027 
00028 class HepEvt  : public Generator
00029 {
00030 public:
00031         static long& nevhep(){return FORTRAN_COMMON(hepevt).nevhep;}
00032         static long& nhep(){ return FORTRAN_COMMON(hepevt).nhep;}
00033         static long& isthep(int i){return FORTRAN_COMMON(hepevt).isthep[i-1];}
00034         static long& idhep(int i){return FORTRAN_COMMON(hepevt).idhep[i-1];}
00035         static long* jmohep(int i){return FORTRAN_COMMON(hepevt).jmohep[i-1];}
00036         static long* jdahep(int i){return FORTRAN_COMMON(hepevt).jdahep[i-1];}
00037 
00038         static float* phep(int i){return FORTRAN_COMMON(hepevt).phep[i-1];}
00039         static float* vhep(int i){return FORTRAN_COMMON(hepevt).vhep[i-1];}
00040 //      static float& mass(int i){return FORTRAN_COMMON(hepevt).phep[i-1][4];}
00041 
00042         HepEvt(std::istream& _in);
00043         // constructor that reads from an open stream
00044 
00045         MCParticle * getEvent();
00046         // creates structure with next event
00047 
00048         int readEvent();
00049         // fill the common from input file. failed if n()==0
00050 
00051         void propagate(const Medium*);
00052         // special propagate that should find the unpropagated daughters
00053 
00054 private:
00055         std::istream& inputFile;
00056         bool _hasVertices;
00057 };
00058 
00059 
00060 
00061 #endif
00062 

Generated at Mon Nov 26 18:18:33 2001 by doxygen1.2.3 written by Dimitri van Heesch, © 1997-2000