G4-DESCSS/include/G4HumanPhantomHit.h

50 lines
1.4 KiB
C++

#ifndef G4HumanPhantomHit_h
#define G4HumanPhantomHit_h 1
#include "G4Allocator.hh"
#include "G4THitsCollection.hh"
#include "G4ThreeVector.hh"
#include "G4VHit.hh"
#include "tls.hh" // FOR MT
class G4HumanPhantomHit : public G4VHit {
public:
G4HumanPhantomHit();
~G4HumanPhantomHit();
G4HumanPhantomHit(const G4HumanPhantomHit&);
const G4HumanPhantomHit& operator=(const G4HumanPhantomHit&);
G4bool operator==(const G4HumanPhantomHit&) const;
inline void* operator new(size_t);
inline void operator delete(void*);
void Draw();
void Print();
public:
void SetBodyPartID(G4String bodyPartName) { bodyPartID = bodyPartName; };
void SetEdep(G4double de) { edep = de; };
G4String GetBodyPartID() { return bodyPartID; };
G4double GetEdep() { return edep; };
private:
G4String bodyPartID;
G4double edep;
};
typedef G4THitsCollection<G4HumanPhantomHit> G4HumanPhantomHitsCollection;
extern G4ThreadLocal G4Allocator<G4HumanPhantomHit>* G4HumanPhantomHitAllocator;
inline void* G4HumanPhantomHit::operator new(size_t) {
if (!G4HumanPhantomHitAllocator) G4HumanPhantomHitAllocator = new G4Allocator<G4HumanPhantomHit>;
return (void*)G4HumanPhantomHitAllocator->MallocSingle();
}
inline void G4HumanPhantomHit::operator delete(void* aHit) {
G4HumanPhantomHitAllocator->FreeSingle((G4HumanPhantomHit*)aHit);
}
#endif