00001 00002 00003 #ifndef MollerDetectorHit_h 00004 #define MollerDetectorHit_h 1 00005 00006 #include "G4VHit.hh" 00007 #include "G4THitsCollection.hh" 00008 #include "G4Allocator.hh" 00009 #include "G4ThreeVector.hh" 00010 #include "G4LogicalVolume.hh" 00011 #include "G4Transform3D.hh" 00012 #include "G4RotationMatrix.hh" 00013 //#include "G4ParticleDefinition.hh" // Include from 'particle+matter' 00014 #include "G4ios.hh" 00015 00016 class G4AttDef; 00017 class G4AttValue; 00018 00019 class MollerDetectorHit : public G4VHit 00020 { 00021 public: 00022 00023 // Constructor/Destrcutor 00024 00025 MollerDetectorHit(); 00026 MollerDetectorHit(G4int z); 00027 virtual ~MollerDetectorHit(); 00028 MollerDetectorHit(const MollerDetectorHit &right); 00029 const MollerDetectorHit& operator=(const MollerDetectorHit &right); 00030 int operator==(const MollerDetectorHit &right) const; 00031 00032 // Operators 00033 inline void *operator new(size_t); 00034 inline void operator delete(void *aHit); 00035 00036 00037 // Other member functions 00038 virtual void Draw(); 00039 virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; 00040 virtual std::vector<G4AttValue>* CreateAttValues() const; 00041 virtual void Print(); 00042 00043 //G4ParticleDefinition* GetParticleDefinition(); 00044 00045 // Get/Set functions 00046 inline void SetLayerID(G4int z) 00047 { layerID = z; } 00048 inline G4int GetLayerID() const 00049 { return layerID; } 00050 00051 inline void SetTrackID(G4int id) 00052 { trackID = id; } 00053 inline G4int GetTrackID() const 00054 { return trackID; } 00055 00056 inline void SetWorldPos(G4ThreeVector xyz) 00057 { worldPos = xyz; } 00058 inline G4ThreeVector GetWorldPos() const 00059 { return worldPos; } 00060 inline void SetVertexPos(G4ThreeVector xyz) 00061 { vertexPos = xyz; } 00062 inline G4ThreeVector GetVertexPos() const 00063 { return vertexPos; } 00064 00065 inline void SetMomentum(G4ThreeVector xyz) 00066 { momentum = xyz; } 00067 inline G4ThreeVector GetMomentum() const 00068 { return momentum; } 00069 inline void SetKineticEnergy(G4double e) 00070 { kineE = e; } 00071 inline G4double GetKineticEnergy() 00072 { return kineE; } 00073 00074 00075 inline void SetMomentum0(G4ThreeVector xyz) 00076 { p0 = xyz; } 00077 inline G4ThreeVector GetMomentum0() const 00078 { return p0; } 00079 inline void SetMomentum1(G4ThreeVector xyz) 00080 { p1 = xyz; } 00081 inline G4ThreeVector GetMomentum1() const 00082 { return p1; } 00083 inline void SetMomentum2(G4ThreeVector xyz) 00084 { p2 = xyz; } 00085 inline G4ThreeVector GetMomentum2() const 00086 { return p2; } 00087 00088 inline void SetKineticEnergy0(G4double e) 00089 { kineE0 = e; } 00090 inline G4double GetKineticEnergy0() 00091 { return kineE0; } 00092 inline void SetKineticEnergy1(G4double e) 00093 { kineE1 = e; } 00094 inline G4double GetKineticEnergy1() 00095 { return kineE1; } 00096 inline void SetKineticEnergy2(G4double e) 00097 { kineE2 = e; } 00098 inline G4double GetKineticEnergy2() 00099 { return kineE2; } 00100 00101 inline void SetScatAngle(G4double ang) 00102 { scat_ang = ang; } 00103 inline G4double GetScatAngle() 00104 { return scat_ang; } 00105 00106 inline void SetCreatorProcess(G4String creator) 00107 { creatorProcess = creator; } 00108 inline G4String GetCreatorProcess() const 00109 { return creatorProcess; } 00110 inline void SetParticleName(G4String name) 00111 { particleName = name; } 00112 inline G4String GetParticleName() const 00113 { return particleName; } 00114 00115 inline void SetIon(G4bool i) 00116 { ion = i; } 00117 inline G4bool GetIon() const 00118 { return ion; } 00119 inline void SetType(G4int i) 00120 { partType = i; } 00121 inline G4int GetType() const 00122 { return partType; } 00123 inline void SetVolume(G4double i) 00124 { volume = i; } 00125 inline G4double GetVolume() const 00126 { return volume; } 00127 00128 private: 00129 00130 G4int layerID, partType, trackID; 00131 00132 G4double kineE, kineE0, kineE1, kineE2, volume, scat_ang; 00133 00134 G4ThreeVector worldPos; 00135 G4ThreeVector vertexPos; 00136 00137 G4ThreeVector momentum; 00138 00139 G4ThreeVector p0; 00140 G4ThreeVector p1; 00141 G4ThreeVector p2; 00142 00143 //G4ParticleDefinition* thisParticleDefinition; 00144 G4String creatorProcess; 00145 G4String particleName; 00146 G4bool ion; 00147 00148 //static std::map<G4String,G4AttDef> fAttDefs; 00149 00150 00151 00152 }; 00153 00154 typedef G4THitsCollection<MollerDetectorHit> MollerDetectorHitsCollection; 00155 00156 extern G4Allocator<MollerDetectorHit> MollerDetectorHitAllocator; 00157 00158 inline void* MollerDetectorHit::operator new(size_t) 00159 { 00160 void *aHit; 00161 aHit = (void *) MollerDetectorHitAllocator.MallocSingle(); 00162 return aHit; 00163 } 00164 00165 inline void MollerDetectorHit::operator delete(void *aHit) 00166 { 00167 MollerDetectorHitAllocator.FreeSingle((MollerDetectorHit*) aHit); 00168 } 00169 00170 #endif