00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019
00020
00021
00022
00023
00024
00025
00027
00028 #ifndef STAR_StFtpcSlowSimReadout
00029 #define STAR_StFtpcSlowSimReadout
00030
00031 class StFtpcSlowSimCluster;
00032 class StFtpcSlowSimField;
00033 class StFtpcParamReader;
00034 class StFtpcDbReader;
00035 extern int Locate(const int npt, const float* x, const float xx);
00036
00037
00038
00039
00040
00041 class StFtpcSlowSimReadout
00042 {
00043 public:
00044 StFtpcSlowSimReadout(StFtpcParamReader *paramReader,
00045 StFtpcDbReader *dbReader,
00046 float *adcIn, const StFtpcSlowSimField *field);
00047 ~StFtpcSlowSimReadout();
00048 void Avalanche(const StFtpcSlowSimCluster *cl);
00049
00050 void PadResponse(const StFtpcSlowSimCluster *cl);
00051
00052 void ShaperResponse(const StFtpcSlowSimCluster *cl);
00053
00054 void Digitize(const StFtpcSlowSimCluster *cl, const int irow);
00055
00056
00057 void OutputADC();
00058 void Print() const ;
00059
00060 float GetPadLength() const {return pad_length; }
00061
00062 int WhichSlice(const float time);
00063 int WhichPad(const float phi, int &isec);
00064
00065 float TimeOfSlice(const int slice);
00066 float PhiOfPad(const int pad, const int deg_or_rad);
00067
00068
00069
00070 float InteGauss(const float x_1, const float x_2,
00071 const float x_0, const float sig);
00072 float ranmar();
00073 void rmarin(int ij, int kl);
00074
00075 int GetHardPad(const int daqsec, const int daqpad, const int irow);
00076 int GetHardSec(const int daqsec, const int irow);
00077
00078
00079 private:
00080 struct raset1 {
00081 float u[97];
00082 float c;
00083 };
00084
00085 struct raset1 uc;
00086 StFtpcParamReader *mParam;
00087 StFtpcDbReader *mDb;
00088
00089 int mMaxAdc;
00090 int mGaussIntSteps;
00091 float mGasGain;
00092 float mOuterRadius;
00093 float mInverseFinalVelocity;
00094 int mRandomNumberGenerator;
00095 float* mADCArray;
00096
00097 float mFinalElectrons;
00098 float sigma_pad;
00099 float pad_off;
00100 float sigma_tim;
00101 float time_off;
00102
00103 int number_plane;
00104 float pad_pitch;
00105 float pad_length;
00106 float sigma_prf;
00107 float shaper_time;
00108 float slice;
00109
00110 float* pcum;
00111 int gnch;
00112 float glow;
00113 float ghigh;
00114 float gdelta;
00115 float phiMin, phiMax;
00116 void polya(const int nch, const float low,
00117 const float high, const float delta);
00118
00119 int sample_polya(const float gain);
00120
00121
00122 };
00123
00124 #endif
00125