#ifndef LEMuSROScintHit_h #define LEMuSROScintHit_h 1 #include "G4VHit.hh" #include "G4THitsCollection.hh" #include "G4Allocator.hh" #include "G4ThreeVector.hh" #include "G4LogicalVolume.hh" #include "G4VPhysicalVolume.hh" class LEMuSROScintHit : public G4VHit { public: // contructor and destructor LEMuSROScintHit(); ~LEMuSROScintHit(); void Draw(); void Print(); void print(G4String name); // operator for hit collector definition LEMuSROScintHit(const LEMuSROScintHit &right); const LEMuSROScintHit& operator=(const LEMuSROScintHit &right); G4int operator==(const LEMuSROScintHit &right) const; inline void *operator new(size_t); inline void operator delete(void *aHit); // private variables private: G4double energy_deposition, time_of_flight,spin; G4ThreeVector position, momentum; G4LogicalVolume* lv_Volume; G4VPhysicalVolume* pv_Volume; G4String particle_name; // inline functions public: inline void SetEnergyDeposition(G4double ed){energy_deposition = ed;} inline void AddEnergyDeposition(G4double ed){energy_deposition += ed;} inline G4double GetEnergyDeposition(){return energy_deposition;} inline void SetTimeOfFlight(G4double tf){ time_of_flight=tf;} inline void AddTimeOfFlight(G4double tf){ time_of_flight+=tf;} inline G4double GetTimeOfFlight(){return time_of_flight;} inline void SetSpin(G4double sp){ spin=sp;} inline G4double GetSpin(){return spin;} inline void SetPosition(G4ThreeVector pos){position =pos;} inline G4ThreeVector GetPosition(){return position;} inline void SetMomentum(G4ThreeVector mom){momentum =mom;} inline G4ThreeVector GetMomentum(){return momentum;} inline void SetParticleName(G4String name){particle_name=name;} inline G4String GetParticleName(){return particle_name;} inline G4LogicalVolume* GetLogicalVolume(){return lv_Volume;} inline G4VPhysicalVolume* GetPhysicalVolume(){return pv_Volume;} }; // define the collection class according to template G4THitsCollection typedef G4THitsCollection LEMuSROScintHitsCollection; extern G4Allocator LEMuSROScintHitAllocator; inline void* LEMuSROScintHit :: operator new(size_t) { void *aHit; aHit = (void*) LEMuSROScintHitAllocator.MallocSingle(); return aHit; } inline void LEMuSROScintHit :: operator delete(void *aHit) { LEMuSROScintHitAllocator.FreeSingle((LEMuSROScintHit*) aHit); } #endif