StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcRSMaker.h
1 #ifndef STAR_ST_TRS_MAKER_HH
2 #define STAR_ST_TRS_MAKER_HH
3 
5 // //
6 // StTpcRSMaker virtual base class for Maker //
7 // //
9 #ifndef StMaker_H
10 #include "StMaker.h"
11 #endif
12 #ifndef HEP_SYSTEM_OF_UNITS_H
13 #include "SystemOfUnits.h"
14 #endif
15 #ifndef ST_NO_NAMESPACES
16 using namespace units;
17 #endif
18 #include "StTpcRawData.h"
19 #include "TF1F.h"
20 #include "TH1.h"
21 #include "TTree.h"
22 #include "StTpcDb/StTpcDb.h"
23 #include "StMagF.h"
24 #include "TArrayF.h"
25 #include "TArrayI.h"
26 class Altro;
28 class StTpcDigitalSector;
29 class HitPoint_t;
30 class g2t_tpc_hit_st;
31 class g2t_vertex_st;
33 struct SignalSum_t {
34  Float_t Sum;
35  Short_t Adc;
36  Short_t TrackId;
37 };
38 class StTpcRSMaker : public StMaker {
39  public:
40  enum EMode {kPAI = 0,// switch to PAI from GEANT (obsolete)
41  kBICHSEL = 1,// switch to Bichsel from GEANT
42  kHEED = 6,// switch to HEED
43  kGAINOAtALL = 2,// do not use GAIN at all
44  kdEdxCorr = 3,// do use TpcdEdxCorrection
45  kDistortion = 4,// include distortions
46  kNoToflight = 5 // don't account for particle time of flight
47  };
48  enum {kPadMax = 32, kTimeBacketMax = 64, kRowMax = 72};
49  StTpcRSMaker(const char *name="TpcRS");
50  virtual ~StTpcRSMaker();
51  virtual Int_t InitRun(int runnumber);
52  virtual Int_t Make();
53  virtual Int_t Finish();
54  TF1F *GetShaperResponse(Int_t io = 0, Int_t sector = 1) {return (TF1F *) mShaperResponses[io][sector-1];}
55  TF1F *GetChargeFraction(Int_t io = 0, Int_t sector = 20) {return (TF1F *) mChargeFraction[io][sector-1];}
56  TF1F *GetPadResponseFunction(Int_t io = 0, Int_t sector = 20){return (TF1F *) mPadResponseFunction[io][sector-1];}
57  TF1F *GetPolya(Int_t io = 0) {return (TF1F *) mPolya[io];}
58  TF1 *GetTimeShape0(Int_t io = 0) {return fgTimeShape0[io];}
59  TF1 *GetTimeShape3(Int_t io = 0) {return fgTimeShape3[io];}
60  TF1 *GetHeed() {return mHeed;}
61  virtual void Print(Option_t *option="") const;
62  StTpcDigitalSector *DigitizeSector(Int_t sector);
63  void SetLaserScale(Double_t m=1) {mLaserScale = m;}
64  static Int_t AsicThresholds();
65  static Int_t SearchT(const void *elem1, const void **elem2);
66  static Int_t CompareT(const void **elem1, const void **elem2);
67  static Double_t shapeEI(Double_t *x, Double_t *par=0);
68  static Double_t shapeEI_I(Double_t *x, Double_t *par=0);
69  static Double_t shapeEI3(Double_t *x, Double_t *par=0);
70  static Double_t shapeEI3_I(Double_t *x, Double_t *par=0);
71  static Double_t fei(Double_t t, Double_t t0, Double_t T);
72  static Double_t feiFunc(Double_t *x, Double_t *par) {return fei(x[0],par[0],par[1]);}
73  TF1 *Fei();
74  static Double_t polya(Double_t *x, Double_t *par);
75  SignalSum_t *GetSignalSum(Int_t sector);
76  SignalSum_t *ResetSignalSum(Int_t sector);
77  void SettauIntegrationX(Double_t p = 74.6e-9, Int_t io=0) {mtauIntegrationX[io] = p;}
78  void SettauCX(Double_t p = 1000.0e-9, Int_t io=0) {mtauCX[io] = p;}
79  void SetCutEle(Double_t p = 1e-4) {mCutEle = p;}
80  static Double_t Ec(Double_t *x, Double_t *p); // minimal energy to create an ion pair
81  static TF1 *fEc(Double_t w = 26.2); // HEED function to generate Ec
82  private:
83  static Double_t ShaperFunc(Double_t *x, Double_t *p);
84  static Double_t PadResponseFunc(Double_t *x, Double_t *p);
85  static Double_t Gatti(Double_t *x, Double_t *p);
86  static Double_t InducedCharge(Double_t s, Double_t h, Double_t ra, Double_t Va, Double_t &t0);
87  static Float_t GetCutEle();
88 #if defined(__CINT__)
89  Bool_t TrackSegment2Propagate(g2t_tpc_hit_st *tpc_hitC, g2t_vertex_st *gver, HitPoint_t *TrackSegmentHits);
90  void GenerateSignal(HitPoint_t *TrackSegmentHits,Int_t sector, Int_t rowMin, Int_t rowMax, Double_t sigmaJitterT, Double_t sigmaJitterX);
91  Double_t dEdxCorrection(HitPoint_t *TrackSegmentHits);
92 #else
93  Bool_t TrackSegment2Propagate(g2t_tpc_hit_st *tpc_hitC, g2t_vertex_st *gver, HitPoint_t &TrackSegmentHits);
94  void GenerateSignal(HitPoint_t &TrackSegmentHits, Int_t sector, Int_t rowMin, Int_t rowMax, Double_t sigmaJitterT, Double_t sigmaJitterX);
95  Double_t dEdxCorrection(HitPoint_t &TrackSegmentHits);
96 #endif
97  static TF1 *fgTimeShape3[2];
98  static TF1 *fgTimeShape0[2];
99  Char_t beg[1];
100  TTree *fTree;
101  SignalSum_t *m_SignalSum;
102  TF1F *mShaperResponses[2][24];
103  TF1F *mChargeFraction[2][24];
104  TF1F *mPadResponseFunction[2][24];
105  TF1F *mPolya[2];
106  TF1 *mHeed;
107  StTpcdEdxCorrection *m_TpcdEdxCorrection; // !
108  Double_t InnerAlphaVariation[24];
109  Double_t OuterAlphaVariation[24];
110  Altro *mAltro[2][24];
111  // local variables
112  Int_t numberOfSectors;
113  Int_t NoPads;
114  Int_t numberOfTimeBins;
115  Int_t numberOfInnerSectorAnodeWires;
116  Double_t firstInnerSectorAnodeWire;
117  Double_t lastInnerSectorAnodeWire;
118  Int_t numberOfOuterSectorAnodeWires;
119  Double_t firstOuterSectorAnodeWire;
120  Double_t lastOuterSectorAnodeWire;
121  Double_t anodeWirePitch;
122  Double_t numberOfElectronsPerADCcount;
123  Double_t anodeWireRadius;
124  Double_t innerSectorAnodeVoltage[24];
125  Double_t outerSectorAnodeVoltage[24];
126  Double_t mtauIntegrationX[2];
127  Double_t mtauCX[2];
128  Double_t mLocalYDirectionCoupling[2][24][7];
129  Double_t msMin, msMax;
130  TArrayI mNoTpcHitsAll;
131  TArrayI mNoTpcHitsReal;
132  Int_t mNSplittedHits;
133  Double_t xOnWire, yOnWire, zOnWire;
134  Double_t mGainLocal;
135  Double_t QAv;
136  Double_t TotalSignal;
137  Int_t pad0;
138  Int_t tbk0;
139  Double_t TotalSignalInCluster;
140  Double_t padsdE[kPadMax];
141  Double_t tbksdE[kTimeBacketMax];
142  Double_t rowsdEH[kRowMax];
143  Double_t rowsdE[kRowMax];
144  Char_t end[1];
145  Double_t mLaserScale;
146  const Double_t minSignal;
147  const Double_t ElectronRange;
148  const Double_t ElectronRangeEnergy;
149  const Double_t ElectronRangePower;
150  const Int_t NoOfSectors;
151  Int_t NoOfPads;
152  const Int_t NoOfTimeBins;
153  Double_t mCutEle;
154  static Short_t mADCs[__MaxNumberOfTimeBins__];
155  public:
156  virtual const char *GetCVS() const {
157  static const char cvs[]=
158  "Tag $Name: $ $Id: StTpcRSMaker.h,v 1.33 2018/12/09 23:22:59 fisyak Exp $ built " __DATE__ " " __TIME__ ;
159  return cvs;
160  }
161  ClassDef(StTpcRSMaker,0) //StAF chain virtual base class for Makers
162 };
163 #endif
164 // $Id: StTpcRSMaker.h,v 1.33 2018/12/09 23:22:59 fisyak Exp $
165 // $Log: StTpcRSMaker.h,v $
166 // Revision 1.33 2018/12/09 23:22:59 fisyak
167 // Reshape
168 //
169 // Revision 1.32 2018/11/01 13:27:20 fisyak
170 // Synchronize mCutEle with GEANT3 tracking media setting for TPCE_SENSITIVE_GAS, bug#3369
171 //
172 // Revision 1.31 2018/10/17 20:45:28 fisyak
173 // Restore update for Run XVIII dE/dx calibration removed by Gene on 08/07/2018
174 //
175 // Revision 1.28 2016/09/18 22:45:25 fisyak
176 // Clean up, add Heed model, adjust for new StTpcdEdxCorrections
177 //
178 // Revision 1.27 2015/07/19 22:48:14 fisyak
179 // Fix cvs message
180 //
181 // Revision 1.26 2015/07/19 22:14:07 fisyak
182 // Clean up __PAD_BLOCK__, recalculate no. of real hits in g2t_track n_tpc_hit (excluding pseudo pad row), add current and accumulated charge in dE/dx correction
183 //
184 // Revision 1.25 2012/05/07 15:36:22 fisyak
185 // Remove hardcoded TPC parameters
186 //
187 // Revision 1.24 2012/04/03 14:05:18 fisyak
188 // Speed up using GetSaveL (__PAD_BLOCK__), sluggish shape histograms, Heed electron generation
189 //
190 // Revision 1.23 2011/12/13 17:23:22 fisyak
191 // remove YXTProd, add WIREHISTOGRAM and WIREMAP, use particle definition from StarClassLibrary
192 //
193 // Revision 1.22 2011/10/14 23:27:51 fisyak
194 // Back to standard version
195 //
196 // Revision 1.20 2011/09/18 22:39:48 fisyak
197 // Extend dN/dx table (H.Bichsel 09/12/2011) to fix bug #2174 and #2181, clean-up
198 //
199 // Revision 1.19 2011/03/17 14:29:31 fisyak
200 // Add extrapolation in region beta*gamma < 0.3
201 //
202 // Revision 1.18 2010/06/14 23:34:26 fisyak
203 // Freeze at Version V
204 //
205 // Revision 1.17 2010/03/22 23:45:06 fisyak
206 // Freeze version with new parameters table
207 //
208 // Revision 1.16 2010/03/17 15:53:16 fisyak
209 // Move StTpcdEdxCorrection to StdEdxY2Maker to avoid dependence of StTpcDb on StDetectorDbMaker
210 //
211 // Revision 1.15 2010/03/16 19:41:46 fisyak
212 // Move diffusion and sec/row correction in DB, clean up
213 //
214 // Revision 1.14 2010/02/26 18:53:33 fisyak
215 // Take longitudinal Diffusion from Laser track fit, add Gating Grid
216 //
217 // Revision 1.13 2010/01/26 19:47:26 fisyak
218 // Include dE/dx calibration and distortions in the simulation
219 //
220 // Revision 1.12 2009/10/30 21:12:00 fisyak
221 // Freeze version rcf9108.F, Clean up
222 //
223 // Revision 1.11 2009/10/03 21:29:09 fisyak
224 // Clean up, move all TpcT related macro into StTpcMcAnalysisMaker
225 //
226 // Revision 1.10 2009/09/21 13:20:39 fisyak
227 // Variant O4, no mSigmaJitter, 100 keV
228 //
229 // Revision 1.9 2009/09/01 15:06:44 fisyak
230 // Version N
231 //
232 // Revision 1.8 2009/08/24 20:16:41 fisyak
233 // Freeze with new Altro parameters
234 //
235 // Revision 1.7 2008/12/29 15:24:55 fisyak
236 // Freeze ~/WWW/star/Tpc/TpcRS/ComparisonMIP31
237 //
238 // Revision 1.6 2008/12/18 23:06:38 fisyak
239 // Take care about references to TGiant
240 //
241 // Revision 1.5 2008/08/18 15:54:26 fisyak
242 // Version 20
243 //
244 // Revision 1.4 2008/07/30 23:53:19 fisyak
245 // Freeze
246 //
247 // Revision 1.3 2008/07/18 16:21:17 fisyak
248 // Remove TF1F
249 //
250 // Revision 1.2 2008/06/19 22:45:43 fisyak
251 // Freeze problem with TPX parameterization
252 //
253 // Revision 1.1.1.1 2008/04/28 14:39:47 fisyak
254 // Start new Tpc Response Simulator
255 //
256 // Revision 1.14 2008/04/24 10:42:04 fisyak
257 // Fix binning issues
258 //
259 // Revision 1.13 2008/04/04 15:00:11 fisyak
260 // Freeze before shaper modifications
261 //
262 // Revision 1.12 2005/02/07 21:40:31 fisyak
263 // rename antique TGeant3 to TGiant3
264 //
265 // Revision 1.11 2005/01/26 21:45:31 fisyak
266 // Freeze correction made in June
267 //
268 // Revision 1.9 2004/05/29 21:16:27 fisyak
269 // Fix pad direction, add sorting for ADC/cluster nonlinearity, replace product by sum of logs
270 //
271 // Revision 1.8 2004/05/04 13:39:06 fisyak
272 // Add TF1
273 //
274 // Revision 1.7 2004/04/22 01:05:03 fisyak
275 // Freeze the version before modification parametrization for K3
276 //
277 // Revision 1.6 2004/04/06 01:50:13 fisyak
278 // Switch from Double_t to Float_t for sum
279 //
280 // Revision 1.5 2004/03/30 19:30:04 fisyak
281 // Add Laser
282 //
283 // Revision 1.4 2004/03/21 19:00:43 fisyak
284 // switch to GEANT step length
285 //
286 // Revision 1.3 2004/03/20 17:57:15 fisyak
287 // Freeze the version of PAI model
288 //
289 // Revision 1.2 2004/03/17 20:47:43 fisyak
290 // Add version with TrsCluster TTree
291 //
292 // Revision 1.1.1.1 2004/03/05 20:51:25 fisyak
293 // replacement for Trs
294 //
Definition: TF1F.h:5
Definition: Altro.h:22