Graduation-Project/include/GeneHe3detHit.hh

61 lines
1.7 KiB
C++
Raw Normal View History

2023-04-09 22:30:59 +08:00
#ifndef GeneHe3detHit_hh
#define GeneHe3detHit_hh 1
2023-02-13 14:50:36 +08:00
2023-04-09 22:30:59 +08:00
#include "G4Allocator.hh"
#include "G4THitsCollection.hh"
#include "G4ThreeVector.hh"
#include "G4VHit.hh"
2023-02-13 14:50:36 +08:00
class GeneHe3detHit : public G4VHit {
public:
GeneHe3detHit();
~GeneHe3detHit();
GeneHe3detHit(const GeneHe3detHit&);
const GeneHe3detHit& operator=(const GeneHe3detHit&);
int operator==(const GeneHe3detHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Draw();
void Print();
public:
void SetCpNo(G4int id) { cpNo = id; };
void SetEdep(G4double de) { edep = de; };
void SetPos(G4ThreeVector xyz) { pos = xyz; };
void SetParticle(G4String name) { particleName = name; };
void SetParticleEnergy(G4double e1) { particleEnergy = e1; };
void SetTime(G4double t2) { HitTime = t2; };
inline G4int GetCpNo() { return cpNo; };
inline G4double GetEdep() { return edep; };
inline G4ThreeVector GetPos() { return pos; };
inline G4String GetParticle() { return particleName; };
inline G4double GetParticleEnergy() { return particleEnergy; };
inline G4double GetTime() { return HitTime; };
private:
2023-04-09 13:51:16 +08:00
// Copy number 探测器编号
2023-02-13 14:50:36 +08:00
G4int cpNo;
G4double edep;
G4ThreeVector pos;
G4double HitTime;
G4String particleName;
G4double particleEnergy;
};
typedef G4THitsCollection<GeneHe3detHit> GeneHe3detHitsCollection;
extern G4Allocator<GeneHe3detHit> GeneHe3detHitAllocator;
inline void* GeneHe3detHit::operator new(size_t) {
void* aHit;
aHit = (void*)GeneHe3detHitAllocator.MallocSingle();
return aHit;
}
inline void GeneHe3detHit::operator delete(void* aHit) { GeneHe3detHitAllocator.FreeSingle((GeneHe3detHit*)aHit); }
#endif