00001 //---------------------------------------------------------------------------// 00002 // BOOST --- BESIII Object_Oriented Simulation Tool // 00003 //---------------------------------------------------------------------------// 00004 //Description: 00005 // 00006 // The shape of the ideal signal is generated from the response function of 00007 // the crystal-photodiode-preAmplifier-mainAmplifier combination. The signal 00008 // from crystal is an exponential decay with the time constant tau_CsI. In 00009 // the Laplace domain, it equals 1/(s+a), where a=1/tau_CsI. Assume that the 00010 // preAmplifier has a step function 1/s. The mainAmplifier has a CR-RC-RC 00011 // shape. CR=s/(s+b), RC=1/(s+b), where b=1/tau_s, the shaping time constant. 00012 // The response time of the photodiode, and the time of deposition of energy 00013 // in the CsI crystal are presumed to be infinitely short, the response 00014 // funtion is then 00015 // 00016 // F(s) = [1/(s+a)]*(1/s)*[s/(s+b)^3] = 1/(s+a)(s+b)^3. 00017 // 00018 // In BESIII EMC, tau_CsI=tau_s=1.0e-6s. So the response fuction is 1/(s+a)^4. 00019 // In time domain, it is 00020 // 00021 // f(t) = t^3*exp(-t/tau)/6 00022 // 00023 //Author: Hemiao 00024 //Created: Oct 25, 2004 00025 //Modified: 00026 // May 23, 2005 00027 // The mainAmplifier changes to CR-RC-RC-RC, and the response funtion is then 00028 // F(s) = [1/(s+a)]*(1/s)*[s/(s+b)^4] = 1/(s+a)(s+b)^4. 00029 // In time domain, it is 00030 // f(t) = t^4*exp(-t/tau)/24 00031 //Comment: 00032 //---------------------------------------------------------------------------// 00033 // $Id: BesEmcWaveform.hh 00034 00035 #ifndef BesEmcWaveform_h 00036 #define BesEmcWaveform_h 00037 00038 #include "globals.hh" 00039 #include "BesEmcHit.hh" 00040 00041 class BesEmcHit; 00042 class BesEmcDigi; 00043 00044 class BesEmcWaveform{ 00045 00046 public: 00047 00048 // Constructors 00049 BesEmcWaveform(); 00050 BesEmcWaveform(G4long, G4double, G4double); 00051 00052 // Destructors 00053 virtual ~BesEmcWaveform(); 00054 00055 // Operators 00056 inline G4double &operator[](G4long ) const; 00057 virtual BesEmcWaveform &operator*=(const G4double &); 00058 virtual BesEmcWaveform &operator/=(const G4double &); 00059 virtual BesEmcWaveform &operator+=(const BesEmcWaveform &); 00060 virtual BesEmcWaveform &operator=(const BesEmcWaveform &); 00061 00062 // Selectors 00063 inline G4long length() const { return array_size;} 00064 inline G4double* GetWave() const { return emcWave; } 00065 inline G4double GetTau() const { return m_tau; } 00066 inline G4double GetSampleTime() const { return m_sampleTime; } 00067 inline G4double GetPeakTime() const { return m_peakTime; } 00068 inline G4double GetTimeOffset() const { return m_timeOffset; } 00069 inline G4int GetBitNb() const { return m_bitNb; } 00070 inline G4int GetGainFlag() const { return m_flag; } 00071 inline G4double GetPhotonsPerMeV() const { return m_photonsPerMeV; } 00072 inline G4double GetNonuniformity() const { return m_nonuniformity; } 00073 G4double max(G4long &binOfMax) const; 00074 // returns the max of the array 00075 00076 // Modifiers 00077 void updateWaveform(BesEmcHit *); 00078 void updateWaveform(BesEmcDigi *); 00079 void makeWaveform(G4double energy, G4double time); 00080 void digitize(); 00081 void addElecNoise(G4double, G4double); //first parameter: incoherent noise width 00082 //second parameter: coherent noise 00083 void print(); 00084 00085 protected: 00086 00087 G4double *emcWave; 00088 G4long array_size; 00089 00090 private: 00091 00092 G4double m_tau; //tau_CsI=tau_CR=tau_RC=1000.*ns 00093 G4double m_sampleTime; //sample time = 50.*ns 00094 G4double m_peakTime; //peak time = 4000.*ns 00095 G4double m_timeOffset; //the beginning of sample time = 2500.*ns 00096 G4int m_bitNb; //10 bit flash ADC 00097 G4int m_flag; 00098 //flag = 0, 1, 2 correspond to three different range of measurement 00099 00100 G4double m_photonsPerMeV; //photons produced in crystal per MeV 00101 G4double m_nonuniformity; //non-uniformity of Light Output 00102 00103 G4double m_highRange; //2.5GeV 00104 G4double m_highPrecision; 00105 G4double m_midRange; //0.625GeV 00106 G4double m_midPrecision; 00107 G4double m_lowRange; //0.078GeV 00108 G4double m_lowPrecision; 00109 00110 }; 00111 00112 inline G4double &BesEmcWaveform::operator[](G4long index) const 00113 { 00114 if(index<0 || index>array_size-1){ 00115 G4cout << "Array bounds exceeded. Index " << index << G4endl; 00116 ::abort(); 00117 } 00118 return emcWave[index]; 00119 } 00120 00121 #endif