00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00032
00042
00043
00048
00049
00062
00063
00064 #ifndef _MJVWAVEFORMCRYSTAL_HH
00065 #define _MJVWAVEFORMCRYSTAL_HH
00066
00067
00068
00069
00070 #include <CLHEP/Units/SystemOfUnits.h>
00071 #include <CLHEP/Vector/ThreeVector.h>
00072
00073
00074 class MJWaveformChargePoint;
00075 class MJVWaveformSegment;
00076
00077 class MJVWaveformCrystal
00078 {
00079 public:
00080
00081
00082 MJVWaveformCrystal();
00083
00084
00085 MJVWaveformCrystal(const MJVWaveformCrystal &);
00086
00087
00088 virtual ~MJVWaveformCrystal();
00089
00090
00091 void AddChargePoint(MJWaveformChargePoint *chgpt);
00092
00093
00094
00095
00096 virtual void Construct() = 0;
00102 virtual HepDouble ConvertEnergyLossToCharge(HepDouble eloss);
00103
00109 virtual Hep3Vector ConvertGridpointToCoordinate(HepInt *location) = 0;
00110 virtual void ConvertCoordinateToGridpoint(const Hep3Vector *coord,
00111 HepInt *loc) = 0;
00112
00113 virtual void GenerateSignal();
00114
00120 virtual void GetDriftFieldVector(const Hep3Vector *pos,Hep3Vector *efield)=0;
00121
00125 virtual HepDouble GetInitialGridPointSigma();
00126
00130 virtual Hep3Vector GetHoleVelocity(const Hep3Vector *position);
00131
00135 virtual Hep3Vector GetElectronVelocity(const Hep3Vector *position);
00136
00140 virtual HepBoolean InDeadLayer(const Hep3Vector *position) { return false; }
00141
00145 void ResetAllSegmentWaveforms();
00146
00150 virtual void SetConstants(void);
00151
00156 virtual HepBoolean OutsideCrystal(Hep3Vector *pos) { return false; }
00157
00158
00159
00160 HepBoolean DiffusionOn() { return fDiffusionOn; }
00161 HepDouble GetBiasVoltage() { return fBiasVoltage; }
00162 HepDouble GetDielectricConstant() { return fDielectricConstant; }
00163 virtual HepDouble GetDielectricConstant(Hep3Vector *pos)
00164 { return fDielectricConstant; }
00165 HepDouble GetDiffusionConstant() { return fDiffusionConstant; }
00166 virtual HepDouble GetDiffusionConstant(Hep3Vector *pos)
00167 { return fDiffusionConstant; }
00168 HepInt GetDiffusionStepInterval()
00169 { return fDiffusionStepInterval; }
00170 MJVWaveformSegment *GetFirstSegment() {return fFirstSegment; }
00171 HepDouble GetGridPointSize() { return fGridPointSize; }
00172 MJVWaveformCrystal *GetNextCrystal() { return fNextCrystal; }
00173 MJVWaveformCrystal *GetPreviousCrystal() { return fPreviousCrystal; }
00174 HepDouble GetSpaceChargeDensity() { return fSpaceChargeDensity; }
00175 virtual HepDouble GetSpaceChargeDensity(Hep3Vector *pos)
00176 { return fSpaceChargeDensity; }
00177 HepDouble GetTimeStep() { return fTimeStep; }
00178 HepInt GetTrappingStepInterval(){return fTrappingStepInterval;}
00179 void SetBiasVoltage(HepDouble voltage)
00180 { fBiasVoltage = voltage; }
00181 void SetGridPointSize(HepDouble sz) { fGridPointSize = sz; }
00182 void SetNextCrystal(MJVWaveformCrystal *xtal)
00183 { fNextCrystal = xtal; }
00184 void SetPreviousCrystal(MJVWaveformCrystal *xtal)
00185 { fPreviousCrystal = xtal;}
00186 HepBoolean TrappingOn() { return fTrappingOn; }
00187
00188
00189 protected:
00190
00191 void AddSegment(MJVWaveformSegment *seg);
00192 void DeleteChargePoints();
00193
00194
00195 private:
00196
00197 HepDouble fDielectricConstant;
00198 HepDouble fDiffusionConstant;
00199 HepBoolean fDiffusionOn;
00200 HepInt fDiffusionStepInterval;
00201 HepDouble fGridPointSize;
00202 HepDouble fSpaceChargeDensity;
00203 HepDouble fTimeStep;
00204 HepInt fTrappingStepInterval;
00205 HepBoolean fTrappingOn;
00206 HepDouble fBiasVoltage;
00207
00208
00209 MJWaveformChargePoint *fFirstChargePoint;
00210 MJWaveformChargePoint *fLastChargePoint;
00211 HepInt fNumberOfChargePoints;
00212
00213
00214 MJWaveformChargePoint *fFirstActiveChargePoint;
00215 MJWaveformChargePoint *fLastActiveChargePoint;
00216
00217
00218 MJVWaveformSegment *fFirstSegment;
00219 MJVWaveformSegment *fLastSegment;
00220 HepInt fNumberOfSegments;
00221
00222
00223
00224 MJVWaveformCrystal *fNextCrystal;
00225 MJVWaveformCrystal *fPreviousCrystal;
00226
00227
00228 HepDouble kmu_0_e;
00229 HepDouble kmu_0_h;
00230 HepDouble kbeta_e;
00231 HepDouble kbeta_h;
00232 HepDouble keps_0_e;
00233 HepDouble keps_0_h;
00234
00235 void DeleteSegments();
00236
00237 };
00238
00239 #endif