StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFtpcSlowSimReadout.hh
1 // $Id: StFtpcSlowSimReadout.hh,v 1.4 2002/10/16 12:31:56 fsimon Exp $
2 // $Log: StFtpcSlowSimReadout.hh,v $
3 // Revision 1.4 2002/10/16 12:31:56 fsimon
4 // gain factors and time offset included, Hardware <-> DAQ mapping taken into
5 // account for Db access
6 //
7 // Revision 1.3 2001/04/20 12:50:26 jcs
8 // cleanup comments
9 //
10 // Revision 1.2 2001/03/06 23:36:19 jcs
11 // use database instead of params
12 //
13 // Revision 1.1 2000/11/23 10:16:43 hummler
14 // New FTPC slow simulator in pure maker form
15 //
16 //
18 // Author: W.G.Gong
19 // Email: gong@mppmu.mpg.de
20 // Date: Oct 25, 1996
21 //
22 // Modifications:
23 // Janet Seyboth jcs@mppmu.mpg.de
24 // February 18, 1998
25 // Remove all references to point file
27 
28 #ifndef STAR_StFtpcSlowSimReadout
29 #define STAR_StFtpcSlowSimReadout
30 
32 class StFtpcSlowSimField;
33 class StFtpcParamReader;
34 class StFtpcDbReader;
35 extern int Locate(const int npt, const float* x, const float xx);
36 
37 //
38 // class readout will handle avalanche, pad/shaper response
39 // and digitization
40 //
42 {
43 public:
45  StFtpcDbReader *dbReader,
46  float *adcIn, const StFtpcSlowSimField *field);
48  void Avalanche(const StFtpcSlowSimCluster *cl);
49  // electron multiplification
50  void PadResponse(const StFtpcSlowSimCluster *cl);
51  // width including pad response in [um]
52  void ShaperResponse(const StFtpcSlowSimCluster *cl);
53  // width including shaper response in [nsec]
54  void Digitize(const StFtpcSlowSimCluster *cl, const int irow);
55  // add noise and fill the pixel array
56  // mADCArray[pad,time]
57  void OutputADC();
58  void Print() const ; // print readout parameters
59 
60  float GetPadLength() const {return pad_length; }
61 
62  int WhichSlice(const float time); // which time slice
63  int WhichPad(const float phi, int &isec);
64  // which pad is phi and which sector
65  float TimeOfSlice(const int slice);// time for slice in nsec
66  float PhiOfPad(const int pad, const int deg_or_rad);
67  // phi for pad
68  // deg_or_rad = 1: in deg
69  // 0: in rad
70  float InteGauss(const float x_1, const float x_2,
71  const float x_0, const float sig);
72  float ranmar();
73  void rmarin(int ij, int kl);
74 
75  int GetHardPad(const int daqsec, const int daqpad, const int irow);
76  int GetHardSec(const int daqsec, const int irow);
77 
78 
79 private:
80  struct raset1 {
81  float u[97];
82  float c;
83  };
84 
85  struct raset1 uc;
86  StFtpcParamReader *mParam;
87  StFtpcDbReader *mDb;
88 
89  int mMaxAdc; // maximum ADC value from parameters
90  int mGaussIntSteps; // steps for gauss calculation from par's
91  float mGasGain; // gas gain from parameters
92  float mOuterRadius; // outer radius of chamber sensitive volume
93  float mInverseFinalVelocity;
94  int mRandomNumberGenerator; // which random number generator
95  float* mADCArray; // pixel array (float)
96 
97  float mFinalElectrons; // number of electrons after avalanche
98  float sigma_pad; // azimuthal sigma after pad response in um
99  float pad_off; // azimuthal width from crossing angle in cm
100  float sigma_tim; // radial sigma after shaper response in nsec
101  float time_off; // radial width from dip angle in nsec
102 
103  int number_plane; // number of readout planes
104  float pad_pitch; // pad pitch in cm
105  float pad_length; // pad length in cm
106  float sigma_prf; // pad-response-function sigma in um
107  float shaper_time; // FWHM of shaper time in nsec
108  float slice; // SCA time slice in nsec
109 
110  float* pcum; // cumulative Polya dist
111  int gnch; // No. of bins
112  float glow; // lower bound
113  float ghigh; // upper bound
114  float gdelta; // bin size
115  float phiMin, phiMax; // angle range for base sector
116  void polya(const int nch, const float low,
117  const float high, const float delta);
118  // get pcum[]
119  int sample_polya(const float gain);
120  // sample gas gain for the averaged gain
121 
122 };
123 
124 #endif
125