00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // 00030 00031 00032 #ifndef G4HEPEvtParticle_h 00033 #define G4HEPEvtParticle_h 1 00034 00035 #include "globals.hh" 00036 #include "G4Allocator.hh" 00037 #include "G4PrimaryParticle.hh" 00038 00039 // class desccription: 00040 // 00041 // This class is exclusively used by G4HEPEvtInterface. This class represents 00042 // one particle in /HEPEVT/ list. 00043 00044 class G4HEPEvtParticle 00045 { 00046 public: 00047 inline void *operator new(size_t); 00048 inline void operator delete(void *aStackedTrack); 00049 00050 G4HEPEvtParticle(); 00051 G4HEPEvtParticle(G4PrimaryParticle* pp, 00052 G4int isthep, G4int jdahep1, G4int jdahep2); 00053 ~G4HEPEvtParticle(); 00054 00055 G4HEPEvtParticle & operator=(const G4HEPEvtParticle &right); 00056 G4int operator==(const G4HEPEvtParticle &right) const; 00057 G4int operator!=(const G4HEPEvtParticle &right) const; 00058 00059 private: 00060 G4PrimaryParticle * theParticle; 00061 G4int ISTHEP; // Status code of the entry 00062 // Set to be 0 after generating links of 00063 // G4PrimaryParticle object 00064 G4int JDAHEP1; 00065 G4int JDAHEP2; 00066 00067 public: 00068 inline G4PrimaryParticle * GetTheParticle() 00069 { return theParticle; } 00070 inline void Done() 00071 { ISTHEP *= -1; } 00072 inline G4int GetISTHEP() 00073 { return ISTHEP; } 00074 inline G4int GetJDAHEP1() 00075 { return JDAHEP1; } 00076 inline G4int GetJDAHEP2() 00077 { return JDAHEP2; } 00078 }; 00079 00080 #if defined G4EVENT_ALLOC_EXPORT 00081 extern G4DLLEXPORT G4Allocator<G4HEPEvtParticle> aHEPEvtParticleAllocator; 00082 #else 00083 extern G4DLLIMPORT G4Allocator<G4HEPEvtParticle> aHEPEvtParticleAllocator; 00084 #endif 00085 00086 inline void * G4HEPEvtParticle::operator new(size_t) 00087 { 00088 void * aHEPEvtParticle; 00089 aHEPEvtParticle = (void *) aHEPEvtParticleAllocator.MallocSingle(); 00090 return aHEPEvtParticle; 00091 } 00092 00093 inline void G4HEPEvtParticle::operator delete(void * aHEPEvtParticle) 00094 { 00095 aHEPEvtParticleAllocator.FreeSingle((G4HEPEvtParticle *) aHEPEvtParticle); 00096 } 00097 00098 00099 #endif 00100