00001 #ifndef STAR_ST_TRS_MAKER_HH
00002 #define STAR_ST_TRS_MAKER_HH
00003
00005
00006
00007
00009 #ifndef StMaker_H
00010 #include "StMaker.h"
00011 #endif
00012 #ifndef HEP_SYSTEM_OF_UNITS_H
00013 #include "SystemOfUnits.h"
00014 #endif
00015 #ifndef ST_NO_NAMESPACES
00016 using namespace units;
00017 #endif
00018 #include "StTpcRawData.h"
00019 #include "TF1F.h"
00020 #include "TH1.h"
00021 #include "TTree.h"
00022 #include "PAI.h"
00023
00024 #include "tables/St_g2t_tpc_hit_Table.h"
00025 #include "tables/St_g2t_track_Table.h"
00026 #include "tables/St_g2t_vertex_Table.h"
00027 #include "StTpcDb/StTpcDb.h"
00028 #include "StdEdxY2Maker/StTpcdEdxCorrection.h"
00029 #include "StMagF.h"
00030 #include "TArrayF.h"
00031 class Altro;
00032 struct SignalSum_t {
00033 Float_t Sum;
00034 Short_t Adc;
00035 Short_t TrackId;
00036 };
00037 class StTpcRSMaker : public StMaker {
00038 public:
00039 enum EMode {kPAI = 0,
00040 kBICHSEL = 1,
00041 kGAINOAtALL = 2,
00042 kdEdxCorr = 3,
00043 kDistortion = 4,
00044 kNoToflight = 5
00045 };
00046 StTpcRSMaker(const char *name="TpcRS");
00047 virtual ~StTpcRSMaker();
00048 virtual Int_t InitRun(int runnumber);
00049 virtual Int_t Make();
00050 virtual Int_t Finish();
00051 TF1F *GetShaperResponse(Int_t io = 0, Int_t sector = 1) {return (TF1F *) mShaperResponses[io][sector-1];}
00052 TF1F *GetChargeFraction(Int_t io = 0) {return (TF1F *) mChargeFraction[io];}
00053 TF1F *GetPadResponseFunction(Int_t io = 0){return (TF1F *) mPadResponseFunction[io];}
00054 TF1F *GetPolya(Int_t io = 0) {return (TF1F *) mPolya[io];}
00055 TF1F *GetTimeShape0(Int_t io = 0) {return fgTimeShape0[io];}
00056 TF1F *GetTimeShape3(Int_t io = 0) {return fgTimeShape3[io];}
00057 TF1 *GetHeed() {return mHeed;}
00058 Double_t GetNoPrimaryClusters(Double_t betaGamma, Int_t charge);
00059 virtual void Print(Option_t *option="") const;
00060 void DigitizeSector(Int_t sector);
00061 void SetLaserScale(Double_t m=1) {mLaserScale = m;}
00062 static Int_t AsicThresholds(Short_t ADCs[__MaxNumberOfTimeBins__]);
00063 static Int_t SearchT(const void *elem1, const void **elem2);
00064 static Int_t CompareT(const void **elem1, const void **elem2);
00065 static Double_t shapeEI(Double_t *x, Double_t *par=0);
00066 static Double_t shapeEI_I(Double_t *x, Double_t *par=0);
00067 static Double_t shapeEI3(Double_t *x, Double_t *par=0);
00068 static Double_t shapeEI3_I(Double_t *x, Double_t *par=0);
00069 static Double_t fei(Double_t t, Double_t t0, Double_t T);
00070 static Double_t polya(Double_t *x, Double_t *par);
00071 SignalSum_t *GetSignalSum();
00072 SignalSum_t *ResetSignalSum();
00073 void SettauIntegrationX(Double_t p = 74.6e-9, Int_t io=0) {mtauIntegrationX[io] = p;}
00074 void SettauCX(Double_t p = 1000.0e-9, Int_t io=0) {mtauCX[io] = p;}
00075 void SetCutEle(Double_t p = 1e-4) {mCutEle = p;}
00076 static Double_t Ec(Double_t *x, Double_t *p);
00077 static TF1 *fEc(Double_t w = 26.2);
00078 private:
00079 static Double_t ShaperFunc(Double_t *x, Double_t *p);
00080 static Double_t PadResponseFunc(Double_t *x, Double_t *p);
00081 static Double_t Gatti(Double_t *x, Double_t *p);
00082 static Double_t InducedCharge(Double_t s, Double_t h, Double_t ra, Double_t Va, Double_t &t0);
00083 static TF1F *fgTimeShape3[2];
00084 static TF1F *fgTimeShape0[2];
00085 Char_t beg[1];
00086 TTree *fTree;
00087 SignalSum_t *m_SignalSum;
00088 TH1D* mdNdx;
00089 TH1D* mdNdE;
00090 TF1F *mShaperResponses[2][24];
00091 TF1F *mChargeFraction[2];
00092 TF1F *mPadResponseFunction[2];
00093 TF1F *mPolya[2];
00094 TF1F *mGG;
00095 TF1 *mHeed;
00096 StTpcdEdxCorrection *m_TpcdEdxCorrection;
00097 PAI *mPAI;
00098 Double_t InnerAlphaVariation;
00099 Double_t OuterAlphaVariation;
00100 Altro *mAltro;
00101 Char_t end[1];
00102 Double_t mLaserScale;
00103
00104 Int_t NumberOfInnerRows;
00105 Int_t numberOfSectors;
00106 Int_t NumberOfRows;
00107 Int_t NoPads;
00108 Int_t numberOfTimeBins;
00109 Int_t numberOfInnerSectorAnodeWires;
00110 Double_t firstInnerSectorAnodeWire;
00111 Double_t lastInnerSectorAnodeWire;
00112 Int_t numberOfOuterSectorAnodeWires;
00113 Double_t firstOuterSectorAnodeWire;
00114 Double_t lastOuterSectorAnodeWire;
00115 Double_t anodeWirePitch;
00116 Double_t numberOfElectronsPerADCcount;
00117 Double_t anodeWireRadius;
00118 const Double_t minSignal;
00119 Double_t innerSectorAnodeVoltage;
00120 Double_t outerSectorAnodeVoltage;
00121 const Double_t ElectronRange;
00122 const Double_t ElectronRangeEnergy;
00123 const Double_t ElectronRangePower;
00124 Double_t mtauIntegrationX[2];
00125 Double_t mtauCX[2];
00126 const Int_t NoOfSectors;
00127 Int_t NoOfRows;
00128 Int_t NoOfInnerRows;
00129 const Int_t NoOfPads;
00130 const Int_t NoOfTimeBins;
00131 Double_t mCutEle;
00132 public:
00133 virtual const char *GetCVS() const {
00134 static const char cvs[]=
00135 "Tag $Name: $ $Id: StTpcRSMaker.h,v 1.25 2012/05/07 15:36:22 fisyak Exp $ built __DATE__ __TIME__";
00136 return cvs;
00137 }
00138 ClassDef(StTpcRSMaker,0)
00139 };
00140 #endif
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253