#ifndef PhaseSpaceHit_h #define PhaseSpaceHit_h 1 #include "G4VHit.hh" #include "G4THitsCollection.hh" #include "G4Allocator.hh" #include "G4Types.hh" #include "G4ThreeVector.hh" #include "G4LogicalVolume.hh" #include "G4Transform3D.hh" #include "G4RotationMatrix.hh" class G4AttDef; class PhaseSpaceHit : public G4VHit { public: PhaseSpaceHit(); PhaseSpaceHit( G4int, G4int, G4String, G4ThreeVector, G4ThreeVector, G4double ); virtual ~PhaseSpaceHit(); PhaseSpaceHit( const PhaseSpaceHit &right ); G4int operator==( const PhaseSpaceHit &right ) const; inline void *operator new( size_t ); inline void operator delete( void *aHit ); // virtual void Draw(); // virtual const std::map* GetAttDefs() const; // virtual std::vector* CreateAttValues() const; virtual void Print(); public: inline void IncrementCount() { fHitCount++; } inline void SetPos(G4ThreeVector xyz) { fPos = xyz; } inline void SetEdep(G4double edep) { fEdep = edep; } inline G4int GetCopyNo() { return fCopyNo; } inline G4int GetParentID() { return fParentID; } inline G4String GetParticleName() { return fParticleName; } inline G4ThreeVector GetPos() { return fPos; } inline G4ThreeVector GetMom() { return fMom; } inline G4double GetEnergy() { return fEnergy; } inline G4double GetEdep() { return fEdep; } inline G4int GetHitCount() { return fHitCount; } inline const G4LogicalVolume* GetLogV() { return fLogV; } private: G4int fCopyNo; G4int fParentID; G4String fParticleName; G4ThreeVector fPos; G4ThreeVector fMom; G4double fEnergy; G4double fEdep; G4int fHitCount; const G4LogicalVolume* fLogV; static std::map fAttDefs; }; // Define HitsCollection from template class typedef G4THitsCollection PhaseSpaceHitsCollection; extern G4ThreadLocal G4Allocator* psHitAllocator; //------------------------------------------------------------------------------------ // Memory management //------------------------------------------------------------------------------------ inline void* PhaseSpaceHit::operator new( size_t ) { if( !psHitAllocator ) psHitAllocator = new G4Allocator; return (void*) psHitAllocator->MallocSingle(); } inline void PhaseSpaceHit::operator delete( void *aHit ) { psHitAllocator->FreeSingle( (PhaseSpaceHit*) aHit ); } #endif