StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRHICfRecoPos.h
1 #ifndef StRHICfRecoPos_hh
2 #define StRHICfRecoPos_hh
3 
4 #include <TROOT.h>
5 #include <TMath.h>
6 #include <TF1.h>
7 #include <TH1D.h>
8 #include <TSpectrum.h>
9 #include <TGraphErrors.h>
10 
11 #include "StRoot/StRHICfUtil/StRHICfFunction.h"
12 
14 {
15  public:
17  ~StRHICfRecoPos();
18 
19  void init();
20 
21  void setGSOBarEnergy(int tower, int layer, int xy, int bar, Double_t val);
22  void setGSOBarTable(int tower, int layer, int xy, int bar, Double_t val);
23 
24  bool fillData();
25  bool calculate();
26  bool separateMultiFit(int tower);
27 
28  int getGSOMaxLayer(int tower, int order);
29  int getMaximumBin(int tower, int layer, int xy);
30  int getEvalHitNum(int tower);
31  int getEvalHitNum(int tower, int layer, int xy);
32 
33  double getDepositEnergy(int tower, int layer);
34  double getMultiEnergySum(int tower, int layer, int xy, int order);
35  Double_t getSinglePeakPos(int tower, int layer, int xy);
36  Double_t getMultiPeakPos(int tower, int layer, int xy, int order);
37  double getSinglePeakHeight(int tower, int layer, int xy);
38  double getMultiPeakHeight(int tower, int layer, int xy, int order);
39 
40  double getMultiPeakRaw(int tower, int layer, int xy, int order);
41  double getEvalPeakHeight(int tower, int layer, int xy, int order);
42 
43  double getSingleChi2(int tower, int layer, int xy);
44  double getMultiChi2(int tower, int layer, int xy);
45 
46  bool getWorthy(int tower);
47  bool getOverlap(int tower, int xy);
48 
49  private:
50  void findMaxLayer();
51  void initSetParamaters();
52  void fitting();
53 
54  Double_t getLorenzianSingle(Double_t* x, Double_t *par);
55  Double_t getLorenzianMulti(Double_t* x, Double_t *par);
56 
57  // hit position finder base
58  TH1D* mGSOBarHist[kRHICfNtower][kRHICfNlayer][kRHICfNxy];
59  TH1D* mGSOBarHistExpend[kRHICfNtower][kRHICfNlayer][kRHICfNxy];
60  TGraphErrors* mGSOBarGraph[kRHICfNtower][kRHICfNlayer][kRHICfNxy];
61 
62  //hit position fitting
63  TF1* mSingleFit[kRHICfNtower][kRHICfNlayer][kRHICfNxy];
64  TF1* mMultiFit[kRHICfNtower][kRHICfNlayer][kRHICfNxy];
65  TF1* mEachFit[kRHICfNtower][kRHICfNlayer][kRHICfNxy][kRHICfNorder];
66 
67  TSpectrum* mSpectrum[kRHICfNtower][kRHICfNlayer][kRHICfNxy];
68 
69  int mGSOMaxLayer[kRHICfNtower][kRHICfNorder];
70  Double_t mGSOBarSE[kRHICfNlayer][kRHICfNxy][kRHICfNbarSmall];
71  Double_t mGSOBarTE[kRHICfNlayer][kRHICfNxy][kRHICfNbarLarge];
72  Double_t mGSOBarSTable[kRHICfNlayer][kRHICfNxy][kRHICfNbarSmall];
73  Double_t mGSOBarTTable[kRHICfNlayer][kRHICfNxy][kRHICfNbarLarge];
74 
75  bool mWorthy[kRHICfNtower];
76  bool mOverlap[kRHICfNtower][kRHICfNxy];
77 
78  // Define the constant
79  const Double_t mNoiseThreshold = 0.02;
80  const Double_t mPedADCRMS = 3.0;
81  const Double_t mAvgConvFactor = 3.5e5;
82  const Double_t m1000Vto600VFactor = 0.05;
83  const Double_t mSpecialFactor = 0.477;
84  const Double_t mGSOBarMapError = 0.15;
85  const Double_t mTSpecSigma = 1.0;
86  const Double_t mTSpecRatioThreshold = 0.05;
87  const Double_t mPeakDistThreshold = 3.0;
88 
89  // Define the fitting parameters
90  const Double_t mParWidth1 = 1.0;
91  const Double_t mParWidth2 = 10.0;
92  const Double_t mParRatio = 0.6;
93  const Double_t mParBaseLine = 0.00001;
94 
95  //Define the fitting parameter Limits
96  const Double_t mParWidth1Min = 0.5;
97  const Double_t mParWidth1Max = 5.0;
98  const Double_t mParHeightMin = 0.0;
99  const Double_t mParHeightMax = 100.0;
100  const Double_t mParWidth2Min = 5.0;
101  const Double_t mParWidth2Max = 40.0;
102  const Double_t mParRatioMin = 0.0;
103  const Double_t mParRatioMax = 1.0;
104 };
105 
106 #endif