00001
00002
00003
00004
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
00016 extern struct HEPEVT{
00017 integer nevhep;
00018 integer nhep;
00019 integer isthep[nmxhep];
00020 integer idhep[nmxhep];
00021 integer jmohep[nmxhep][2];
00022 integer jdahep[nmxhep][2];
00023 real phep[nmxhep][5];
00024 real vhep[nmxhep][4];
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
00041
00042 HepEvt(std::istream& _in);
00043
00044
00045 MCParticle * getEvent();
00046
00047
00048 int readEvent();
00049
00050
00051 void propagate(const Medium*);
00052
00053
00054 private:
00055 std::istream& inputFile;
00056 bool _hasVertices;
00057 };
00058
00059
00060
00061 #endif
00062