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.cc 00011 00012 #include "BesEmcDigi.hh" 00013 00014 G4Allocator<BesEmcDigi> BesEmcDigiAllocator; 00015 00016 BesEmcDigi::BesEmcDigi() 00017 { 00018 m_partId=0; 00019 m_nTheta=0; 00020 m_nPhi=0; 00021 m_energy=0; 00022 m_time=0; 00023 digiWaveform = new BesEmcWaveform(); 00024 } 00025 00026 BesEmcDigi::~BesEmcDigi() 00027 { 00028 if(digiWaveform) 00029 delete digiWaveform; 00030 } 00031 00032 BesEmcDigi::BesEmcDigi(const BesEmcDigi& right) 00033 :G4VDigi() 00034 { 00035 m_partId=right.m_partId; 00036 m_nTheta=right.m_nTheta; 00037 m_nPhi=right.m_nPhi; 00038 m_energy=right.m_energy; 00039 m_time=right.m_time; 00040 } 00041 00042 00043 const BesEmcDigi& BesEmcDigi::operator=(const BesEmcDigi& right) 00044 { 00045 m_partId=right.m_partId; 00046 m_nTheta=right.m_nTheta; 00047 m_nPhi=right.m_nPhi; 00048 m_energy=right.m_energy; 00049 m_time=right.m_time; 00050 return *this; 00051 } 00052 00053 00054 BesEmcDigi& BesEmcDigi::operator+=(const BesEmcDigi& right) 00055 { 00056 BesEmcDigi *digi = const_cast<BesEmcDigi*>(&right); 00057 digiWaveform->updateWaveform(digi); 00058 00059 G4long bin; 00060 m_energy=digiWaveform->max(bin); 00061 m_time=(G4double)bin; 00062 00063 return *this; 00064 } 00065 00066 00067 int BesEmcDigi::operator==(const BesEmcDigi& right) const 00068 { 00069 return (this==&right) ? 1 : 0; 00070 } 00071 00072 00073 void BesEmcDigi::Draw() 00074 { 00075 } 00076 00077 00078 void BesEmcDigi::Print() 00079 { 00080 } 00081 00082 void BesEmcDigi::MakeWaveform() 00083 { 00084 digiWaveform->updateWaveform(this); 00085 }