File indexing completed on 2025-01-18 09:58:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4HEPEvtParticle_hh
0036 #define G4HEPEvtParticle_hh 1
0037
0038 #include "globals.hh"
0039 #include "evtdefs.hh"
0040 #include "G4Allocator.hh"
0041 #include "G4PrimaryParticle.hh"
0042
0043 class G4HEPEvtParticle
0044 {
0045 public:
0046
0047 G4HEPEvtParticle() = default;
0048 G4HEPEvtParticle(G4PrimaryParticle* pp,
0049 G4int isthep, G4int jdahep1, G4int jdahep2);
0050 ~G4HEPEvtParticle() = default;
0051
0052 G4HEPEvtParticle & operator=(const G4HEPEvtParticle& right);
0053 G4bool operator==(const G4HEPEvtParticle &right) const;
0054 G4bool operator!=(const G4HEPEvtParticle &right) const;
0055
0056 inline void *operator new(std::size_t);
0057 inline void operator delete(void* aStackedTrack);
0058
0059 inline G4PrimaryParticle* GetTheParticle() { return theParticle; }
0060 inline void Done() { ISTHEP *= -1; }
0061 inline G4int GetISTHEP() { return ISTHEP; }
0062 inline G4int GetJDAHEP1() { return JDAHEP1; }
0063 inline G4int GetJDAHEP2() { return JDAHEP2; }
0064
0065 private:
0066
0067 G4PrimaryParticle* theParticle = nullptr;
0068 G4int ISTHEP = 1;
0069
0070
0071 G4int JDAHEP1 = 1;
0072 G4int JDAHEP2 = 1;
0073 };
0074
0075 extern G4EVENT_DLL G4Allocator<G4HEPEvtParticle>*& aHEPEvtParticleAllocator();
0076
0077 inline void * G4HEPEvtParticle::operator new(std::size_t)
0078 {
0079 if (aHEPEvtParticleAllocator() == nullptr)
0080 {
0081 aHEPEvtParticleAllocator() = new G4Allocator<G4HEPEvtParticle>;
0082 }
0083 return (void *) aHEPEvtParticleAllocator()->MallocSingle();
0084 }
0085
0086 inline void G4HEPEvtParticle::operator delete(void * aHEPEvtParticle)
0087 {
0088 aHEPEvtParticleAllocator()->FreeSingle((G4HEPEvtParticle *) aHEPEvtParticle);
0089 }
0090
0091 #endif