00001 //---------------------------------------------------------------------------// 00002 // BOOST --- BESIII Object_Oriented Simulation Tool // 00003 //---------------------------------------------------------------------------// 00004 //Description: Hit in MUC 00005 //Author: Youzy Peking University mail: youzy@hep.pku.cn 00006 //Created: Nov, 2003 00007 //Modified: 00008 //Comment: 00009 //---------------------------------------------------------------------------// 00010 00011 // 00012 // $Id: BesMucHit.hh,v 1.3 2009/08/25 13:33:54 xieyg Exp $ 00013 // GEANT4 tag $Name: MucSim-00-01-03 $ 00014 00015 #ifndef BesMucHit_h 00016 #define BesMucHit_h 1 00017 00018 #include "G4VHit.hh" 00019 #include "G4THitsCollection.hh" 00020 #include "G4Allocator.hh" 00021 #include "G4ThreeVector.hh" 00022 #include "G4VPhysicalVolume.hh" 00023 #include "G4LogicalVolume.hh" 00024 //#include "BesDetectorConstruction.hh" 00025 00026 class BesMucHit : public G4VHit 00027 { 00028 public: 00029 BesMucHit(); 00030 BesMucHit(int prt, int seg, int lay, int str, int trId, int trIndex); 00031 //BesMucHit(BesDetectorConstruction*); 00032 ~BesMucHit(); 00033 BesMucHit(const BesMucHit&); 00034 const BesMucHit& operator=(const BesMucHit&); 00035 int operator==(const BesMucHit&) const; 00036 00037 inline void* operator new(size_t); 00038 inline void operator delete(void*); 00039 00040 void Draw(); 00041 void Print(); 00042 00043 public: 00044 00045 void SetTrackID(G4int track) { m_TrackID = track; }; 00046 void SetTrackIndex(G4int index) { m_TrackIndex = index;}; 00047 void SetPDGCode(G4int pdg) { m_PDGCode = pdg; }; 00048 void SetEdep(G4double de) { m_Edep = de; }; 00049 void SetEnergy(G4double energy) { m_Energy = energy; }; 00050 void SetTime(G4double t) { m_Time = t; }; 00051 void SetPos(G4ThreeVector xyz) { m_Pos = xyz; }; 00052 void SetPosLocal(G4ThreeVector xyzLocal) { m_PosLocal = xyzLocal; }; 00053 void SetDir(G4ThreeVector dir) { m_Dir = dir; }; 00054 void SetMomentum(G4ThreeVector momentum) { m_Momentum = momentum; }; 00055 void SetVolume(G4VPhysicalVolume* pv); 00056 void SetPart(G4int part) { m_Part = part; }; 00057 void SetSeg(G4int seg) { m_Seg = seg; }; 00058 void SetGap(G4int gap) { m_Gap = gap; }; 00059 void SetStrip(G4int strip) { m_Strip = strip; }; 00060 00061 00062 G4int GetTrackID() { return m_TrackID; }; 00063 G4int GetTrackIndex() { return m_TrackIndex;}; 00064 G4int GetPDGCode() { return m_PDGCode; }; 00065 G4double GetEdep() { return m_Edep; }; 00066 G4double GetEnergy() { return m_Energy; }; 00067 G4double GetTime() { return m_Time; }; 00068 G4ThreeVector GetPos() { return m_Pos; }; 00069 G4ThreeVector GetPosLocal() { return m_PosLocal; }; 00070 G4ThreeVector GetDir() { return m_Dir; }; 00071 G4ThreeVector GetMomentum() { return m_Momentum; }; 00072 G4VPhysicalVolume* GetVolume() { return m_Volume; }; 00073 G4String GetVolumeName() { return m_VolumeName; }; 00074 G4int GetPart() { return m_Part; }; 00075 G4int GetSeg() { return m_Seg; }; 00076 G4int GetGap() { return m_Gap; }; 00077 G4int GetStrip() { return m_Strip; }; 00078 G4int GetPanel() { return m_Panel; }; 00079 G4int GetGasChamber() { return m_GasChamber; }; 00080 00081 private: 00082 00083 G4int m_TrackID; // g4 track id 00084 G4int m_TrackIndex; // MC truth id 00085 G4int m_PDGCode; 00086 G4double m_Edep; 00087 G4double m_Energy; 00088 G4double m_Time; 00089 G4ThreeVector m_Pos; 00090 G4ThreeVector m_PosLocal; 00091 G4ThreeVector m_Dir; 00092 G4ThreeVector m_Momentum; 00093 G4VPhysicalVolume* m_Volume; 00094 G4String m_VolumeName; 00095 G4int m_Part; 00096 G4int m_Seg; 00097 G4int m_Gap; 00098 G4int m_Strip; 00099 G4int m_Panel; 00100 G4int m_GasChamber; 00101 // BesDetectorConstruction* detector; 00102 }; 00103 00104 typedef G4THitsCollection<BesMucHit> BesMucHitsCollection; 00105 00106 extern G4Allocator<BesMucHit> BesMucHitAllocator; 00107 00108 inline void* BesMucHit::operator new(size_t) 00109 { 00110 void *aHit; 00111 aHit = (void *) BesMucHitAllocator.MallocSingle(); 00112 return aHit; 00113 } 00114 00115 inline void BesMucHit::operator delete(void *aHit) 00116 { 00117 BesMucHitAllocator.FreeSingle((BesMucHit*) aHit); 00118 } 00119 00120 #endif 00121 00122