87 lines
2.3 KiB
C++
87 lines
2.3 KiB
C++
#ifndef LEMuSRCryoHit_h
|
|
#define LEMuSRCryoHit_h 1
|
|
|
|
#include "G4VHit.hh"
|
|
#include "G4THitsCollection.hh"
|
|
#include "G4Allocator.hh"
|
|
#include "G4ThreeVector.hh"
|
|
#include "G4LogicalVolume.hh"
|
|
#include "G4VPhysicalVolume.hh"
|
|
|
|
class LEMuSRCryoHit : public G4VHit
|
|
{
|
|
public:
|
|
// contructor and destructor
|
|
LEMuSRCryoHit();
|
|
~LEMuSRCryoHit();
|
|
|
|
void Draw();
|
|
void Print();
|
|
void print(G4String name);
|
|
|
|
// operator for hit collector definition
|
|
LEMuSRCryoHit(const LEMuSRCryoHit &right);
|
|
const LEMuSRCryoHit& operator=(const LEMuSRCryoHit &right);
|
|
G4int operator==(const LEMuSRCryoHit &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<LEMuSRCryoHit> LEMuSRCryoHitsCollection;
|
|
|
|
extern G4Allocator<LEMuSRCryoHit> LEMuSRCryoHitAllocator;
|
|
|
|
inline void* LEMuSRCryoHit :: operator new(size_t)
|
|
{
|
|
void *aHit;
|
|
aHit = (void*) LEMuSRCryoHitAllocator.MallocSingle();
|
|
return aHit;
|
|
}
|
|
|
|
inline void LEMuSRCryoHit :: operator delete(void *aHit)
|
|
{
|
|
LEMuSRCryoHitAllocator.FreeSingle((LEMuSRCryoHit*) aHit);
|
|
}
|
|
|
|
|
|
#endif
|