00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef G4HepMCParticle_h
00034 #define G4HepMCParticle_h 1
00035
00036 #include "globals.hh"
00037 #include "G4Allocator.hh"
00038 #include "G4PrimaryParticle.hh"
00039
00040
00041
00042
00043
00044 class G4HepMCParticle
00045 {
00046 public:
00047 inline void *operator new(size_t);
00048 inline void operator delete(void *aStackedTrack);
00049
00050 G4HepMCParticle();
00051 G4HepMCParticle(G4PrimaryParticle* pp,G4int isthep, G4int barcode);
00052 ~G4HepMCParticle();
00053
00054 const G4HepMCParticle & operator=(const G4HepMCParticle &right);
00055 G4int operator==(const G4HepMCParticle &right) const;
00056 G4int operator!=(const G4HepMCParticle &right) const;
00057
00058 private:
00059 G4PrimaryParticle * theParticle;
00060 G4int ISTHEP;
00061
00062
00063 G4int barcodeEndVtx;
00064 public:
00065 inline G4PrimaryParticle * GetTheParticle()
00066 { return theParticle; }
00067 inline void Done()
00068 { ISTHEP *= -1; }
00069 inline G4int GetISTHEP()
00070 { return ISTHEP; }
00071 inline G4int GetBarcodeEndVtx()
00072 { return barcodeEndVtx;}
00073 };
00074
00075 #if defined G4EVENT_ALLOC_EXPORT
00076 extern G4DLLEXPORT G4Allocator<G4HepMCParticle> aHEPEvtParticleAllocator;
00077 #else
00078 extern G4DLLIMPORT G4Allocator<G4HepMCParticle> aHEPEvtParticleAllocator;
00079 #endif
00080
00081 inline void * G4HepMCParticle::operator new(size_t)
00082 {
00083 void * aHEPEvtParticle;
00084 aHEPEvtParticle = (void *) aHEPEvtParticleAllocator.MallocSingle();
00085 return aHEPEvtParticle;
00086 }
00087
00088 inline void G4HepMCParticle::operator delete(void * aHEPEvtParticle)
00089 {
00090 aHEPEvtParticleAllocator.FreeSingle((G4HepMCParticle *) aHEPEvtParticle);
00091 }
00092
00093
00094 #endif
00095