00001 //---------------------------------------------------------------------------// 00002 // BOOST --- BESIII Object_Oriented Simulation Tool // 00003 //---------------------------------------------------------------------------// 00004 //Description: 00005 //Author: Hemiao 00006 //Created: Sep, 2004 00007 //Modified: 00008 //Comment: 00009 //---------------------------------------------------------------------------// 00010 // $Id: BesEmcDigi.hh 00011 00012 #ifndef BesEmcDigi_h 00013 #define BesEmcDigi_h 1 00014 00015 #include "G4VDigi.hh" 00016 #include "G4TDigiCollection.hh" 00017 #include "G4Allocator.hh" 00018 #include "BesEmcWaveform.hh" 00019 00020 class BesEmcDigi : public G4VDigi 00021 { 00022 public: 00023 BesEmcDigi(); 00024 virtual ~BesEmcDigi(); 00025 00026 BesEmcDigi(const BesEmcDigi&); 00027 const BesEmcDigi& operator=(const BesEmcDigi&); 00028 00029 virtual BesEmcDigi& operator+=(const BesEmcDigi&); 00030 virtual G4int operator==(const BesEmcDigi&) const; 00031 inline void* operator new(size_t); 00032 inline void operator delete(void*); 00033 00034 virtual void Draw(); 00035 virtual void Print(); 00036 00037 public: 00038 void MakeWaveform(); 00039 00040 public: 00041 void SetPartId(G4int id) { m_partId = id; }; 00042 void SetThetaNb(G4int nTheta) { m_nTheta = nTheta; }; 00043 void SetPhiNb(G4int nPhi) { m_nPhi = nPhi; }; 00044 void SetEnergy(G4double energy) { m_energy = energy; }; 00045 void SetTime(G4double time) { m_time = time;}; 00046 void SetTrackIndex(G4int index){ m_trackIndex = index; }; 00047 void SetWaveform(BesEmcWaveform* wave) { digiWaveform = wave; }; 00048 00049 G4int GetPartId() {return m_partId;}; 00050 G4int GetThetaNb() { return m_nTheta;}; 00051 G4int GetPhiNb() { return m_nPhi; }; 00052 G4double GetEnergy() { return m_energy; }; 00053 G4double GetTime(){ return m_time; }; 00054 G4int GetTrackIndex(){ return m_trackIndex; }; 00055 BesEmcWaveform* GetWaveform(){ return digiWaveform; }; 00056 00057 private: 00058 BesEmcWaveform* digiWaveform; 00059 00060 private: 00061 G4int m_partId; 00062 G4int m_nTheta; 00063 G4int m_nPhi; 00064 G4double m_energy; 00065 G4double m_time; 00066 G4int m_trackIndex; 00067 }; 00068 00069 typedef G4TDigiCollection<BesEmcDigi> BesEmcDigitsCollection; 00070 00071 extern G4Allocator<BesEmcDigi> BesEmcDigiAllocator; 00072 00073 inline void* BesEmcDigi::operator new(size_t) 00074 { 00075 void *aDigi; 00076 aDigi = (void *) BesEmcDigiAllocator.MallocSingle(); 00077 return aDigi; 00078 } 00079 00080 inline void BesEmcDigi::operator delete(void *aDigi) 00081 { 00082 BesEmcDigiAllocator.FreeSingle((BesEmcDigi*) aDigi); 00083 } 00084 00085 #endif 00086