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: G4HepMCParticle.h,v 1.1 2007/09/03 06:45:32 dengzy Exp $ 00028 // GEANT4 tag $Name: G4Svc-00-01-52 $ 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 // class desccription: 00041 // 00042 // This class is exclusively used by G4HepMCInterface. 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; // Status code of the entry 00061 // Set to be 0 after generating links of 00062 // G4PrimaryParticle object 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