#include "G4VHit.hh" #include "G4THitsCollection.hh" #include "G4Allocator.hh" #include "G4ThreeVector.hh" #ifndef _PIMUHIT_H_ #define _PIMUHIT_H_ class PiMuHit : public G4VHit { public: PiMuHit(); PiMuHit(const PiMuHit&); virtual ~PiMuHit(); // operators const PiMuHit& operator=(const PiMuHit&); G4int operator==(const PiMuHit&) const; inline void* operator new(size_t); inline void operator delete(void*); // methods from base class virtual void Draw(); virtual void Print(); // Set methods void SetTrackID (G4int track) { fTrackID = track; }; void SetChamberNb(G4int chamb) { fChamberNb = chamb; }; void SetEdep (G4double de) { fEdep = de; }; void SetPos (G4ThreeVector xyz){ fPos = xyz; }; void SetMom (G4ThreeVector xyz){ fMom = xyz; }; void SetPtype (G4int type) { fPtype = type; }; // Get methods G4int GetTrackID() const { return fTrackID; }; G4int GetChamberNb() const { return fChamberNb; }; G4double GetEdep() const { return fEdep; }; G4ThreeVector GetPos() const { return fPos; }; G4ThreeVector GetMom() const { return fMom; }; G4int GetPtype() const { return fPtype; }; private: G4int fTrackID; G4int fChamberNb; G4double fEdep; G4ThreeVector fPos; G4ThreeVector fMom; G4int fPtype; // GEANT PDG particle type }; //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... typedef G4THitsCollection PiMuHitsCollection; extern G4Allocator PiMuHitAllocator; //------------------------------ // new //------------------------------ inline void* PiMuHit::operator new(size_t) { void *hit; hit = (void *) PiMuHitAllocator.MallocSingle(); return hit; } //------------------------------ // delete //------------------------------ inline void PiMuHit::operator delete(void *hit) { PiMuHitAllocator.FreeSingle((PiMuHit*) hit); } #endif // _PIMUHIT_H_