StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StTpcdEdxCorrection.h
1 // $Id: StTpcdEdxCorrection.h,v 1.17 2021/05/10 16:54:45 fisyak Exp $
2 #ifndef STAR_StTpcdEdxCorrection
3 #define STAR_StTpcdEdxCorrection
4 //
5 //#include "StDetectorDbMaker/St_trigDetSumsC.h"
6 #include "StTrackPidTraits.h"
7 #include "TString.h"
8 #include "TChair.h"
9 #include "StDetectorDbMaker/St_tpcGasC.h"
10 #include "StDetectorDbMaker/St_tpcCorrectionC.h"
11 //class St_trigDetSums;
12 //class trigDetSums_st;
13 //________________________________________________________________________________
14 struct dE_t {
15  public:
16  Float_t dE;
17  Float_t dx;
18  Float_t dEdx;
19  Float_t dEdxL;
20  Float_t ddEdxL;
21  Float_t dEdxN;
22  void Print(Option_t *option="") const {
23  cout << Form("dE = %5.2f keV, dx = %f5.2f cm, dE/dx = %5.2f keV/cm, dEdxL = %f, ddEdxL = %f",1e6*dE,dx,1e6*dEdx,dEdxL,ddEdxL) << endl;
24  }
25 };
26 //________________________________________________________________________________
28  dEdxCorrection_t(const Char_t *name = "",const Char_t *title = "", TChair *chair=0) :
29  Name(name), Title(title), Chair(chair) {}
30  const Char_t *Name;
31  const Char_t *Title;
32  TChair *Chair;
33 };
34 //________________________________________________________________________________
35 class dEdxY2_t;
36 class StTpcdEdxCorrection : public TObject {
37  public:
38  enum ESector : int {kTpcOuter = 0, kTpcInner = 1, kiTpc = 2};
39  enum EOptions : int {
40  kUncorrected = 0,//U
41  kAdcCorrection = 1,//R
42  kAdcCorrectionC = 2,//R
43  kEdge = 3,//E correction near edge of chamber
44  kAdcCorrectionMDF = 4,//RMDF
45  kAdcCorrection3MDF = 5,//RMDF 3D
46  kAdcCorrection4MDF = 6,//RMDF 4D
47  kAdcCorrection5MDF = 7,//RMDF +4D
48  kAdcCorrection6MDF = 8,//AdcCorrectionC +4D
49  kTpcdCharge = 9,//D
50  kTpcrCharge = 10,//D
51  kTpcCurrentCorrection = 11,//
52  kTpcSecRowB = 12,//S
53  kTpcSecRowC = 13,//S
54  kTpcRowQ = 14,//
55  kTpcAccumulatedQ = 15,//
56  ktpcPressure = 16,//P
57  ktpcTime = 17,//t
58  kDrift = 18,//O
59  kMultiplicity = 19,//M
60  kGatingGrid = 20,//G
61  kzCorrectionC = 21,//Z
62  kzCorrection = 22,//Z
63  ktpcMethaneIn = 23,//m
64  ktpcGasTemperature = 24,//T
65  ktpcWaterOut = 25,//W
66  kSpaceCharge = 26,//C space charge near the wire
67  kPhiDirection = 27,//p correction wrt local interception angle
68  kTanL = 28,//p correction wrt local tan(lambda)
69  kdXCorrection = 29,//X
70  kEtaCorrection = 30,//Eta
71  kEtaCorrectionB = 31,//EtaB
72  kTpcEffectivedX = 32,//X Effective pad row height
73  kTpcPadTBins = 33,//d
74  kTpcZDC = 34,//
75  kTpcPadMDF = 35,
76  kTpcPadMDC = 36,
77  kAdcI = 37,
78  knPad = 38,
79  knTbk = 39,
80  kdZdY = 40,
81  kdXdY = 41,
82  kTpcLast = 42,//
83  kTpcNoAnodeVGainC = 43,//
84  kTpcLengthCorrection = 44,//
85  kTpcLengthCorrectionMDF= 45,//
86  kTpcLengthCorrectionMD2= 46,//
87  kTpcLengthCorrectionMDN= 47,//
88  kTpcdEdxCor = 48,//
89  kTpcAllCorrections = 49 //
90  };
91  StTpcdEdxCorrection(Int_t Option=0, Int_t debug=0);
93  Int_t dEdxCorrection(dEdxY2_t &dEdx, Bool_t doIT=kTRUE);
94  Int_t dEdxTrackCorrection(Int_t type, dst_dedx_st &dedx, Double_t etaG = 0);
95  Int_t dEdxTrackCorrection(EOptions k, Int_t type, dst_dedx_st &dedx, Double_t etaG = 0);
96  void SettpcGas (St_tpcGas *m = 0) {m_tpcGas = m;}
97 
98  void SetDebug(Int_t m=0) {m_Debug = m;}
99  void SetMask (Long_t m=0) {m_Mask = m;}
100  void SetSimulation(Bool_t k = kTRUE) {m_IsSimulation = k;}
101  void ReSetCorrections();
102  St_tpcGas *tpcGas() {return m_tpcGas;}
103  // St_trigDetSums *trigDetSums() {return m_trigDetSums;}
104  const dEdxCorrection_t &CorrectionStatus(Int_t k = 0) {return *&m_Corrections[k];}
105  St_tpcCorrectionC *Correction(Int_t k = 0) { return dynamic_cast<St_tpcCorrectionC *>(m_Corrections[k].Chair);}
106  St_tpcCorrectionC *drift() {return Correction(kDrift);}
107  St_tpcCorrectionC *Multiplicity() {return Correction(kMultiplicity);}
108  St_tpcCorrectionC *AdcCorrection() {return Correction(kAdcCorrection);}
109  St_tpcCorrectionC *zCorrection() {return Correction(kzCorrection);}
110  St_tpcCorrectionC *dXCorrection() {return Correction(kdXCorrection);}
111  St_tpcCorrectionC *EtaCorrection() {return Correction(kEtaCorrection);}
112  St_tpcCorrectionC *TpcdEdxCor() {return Correction(kTpcdEdxCor);}
113  St_tpcCorrectionC *TpcLengthCorrection() {return Correction(kTpcLengthCorrection);}
114  St_tpcCorrectionC *tpcPressure() {return Correction(ktpcPressure);}
115  St_tpcCorrectionC *tpcMethaneIn() {return Correction(ktpcMethaneIn);}
116  St_tpcCorrectionC *tpcGasTemperature() {return Correction(ktpcGasTemperature);}
117  St_tpcCorrectionC *tpcWaterOut() {return Correction(ktpcWaterOut);}
118  St_tpcCorrectionC *TpcPadTBins() {return Correction(kTpcPadTBins);}
119  Int_t Debug() {return m_Debug;}
120  Long_t Mask() {return m_Mask;}
121  Float_t Adc2GeV() {return mAdc2GeV;}
122  void Print(Option_t *opt = "") const;
123  Bool_t IsFixedTarget() {return m_isFixedTarget;}
124  Bool_t IsSimulation() {return m_IsSimulation;}
125 
126  private:
127  Long_t m_Mask;
128  St_tpcGas *m_tpcGas;
129  dEdxY2_t *mdEdx;
130  Float_t mAdc2GeV;
131  dEdxCorrection_t m_Corrections[kTpcAllCorrections];
132  Int_t m_Debug;
133  Bool_t m_isFixedTarget;
134  Bool_t m_IsSimulation;
135  Double_t m_TrigT0; //us
136  Double_t mTimeBinWidth;
137  Double_t mInnerSectorzOffset;
138  Double_t mOuterSectorzOffset;
139 };
140 //________________________________________________________________________________
141 class dEdxY2_t {
142  public:
143  dEdxY2_t() {}
144  virtual ~dEdxY2_t() {}
145  /* U->R->S->P->O->Z->X
146  U->R (TpcAdcCorrection) -> P (tpcPressure) ->
147  S (TpcSecRowB/TpcSecRowC) -> O (TpcDriftDistOxygen) ->
148  Z (TpcZCorrection) -> X(TpcdXCorrection) */
149  Char_t first[1];
150  Int_t sector;
151  Int_t row;
152  Int_t channel;
153  Float_t pad;
154  Int_t Npads; // cluster size in pads
155  Int_t Ntbks; // clustre size in time buckets
156  Float_t ZdriftDistance; // drift distance
157  Float_t ZdriftDistanceO2; // ZdriftDistance*ppmOxygenIn
158  Float_t ZdriftDistanceO2W; // ZdriftDistance*ppmOxygenIn*ppmWaterOut
159  Float_t DeltaZ; // distance to privious cluster
160  Float_t QRatio; // Ratio to previous cluster Charge
161  Float_t QRatioA; // Ratio to Sum of all previous cluster Charge
162  Float_t QSumA; // Sum of all previous cluster Charge
163  Float_t dxC; // corrected dx which should be used with FitN
164  Float_t xyz[3]; // local
165  Float_t xyzD[3]; // local direction
166  Float_t edge; // distance to sector edge
167  Float_t PhiR; // relative phi
168  Float_t resXYZ[3]; // track SectorLocal residual wrt local track
169  Float_t Prob;
170  Float_t zdev;
171  Float_t zP; // the most probable value from Bichsel
172  Float_t zG; // global z oh Hit
173  Float_t sigmaP; // sigma from Bichsel
174  Float_t dCharge; // d_undershoot_Q/Q = ratio of modified - original charge normalized on original charge
175  Float_t rCharge; // d_rounding_Q/Q = estimated rounding normalized on original charge
176  Int_t lSimulated;
177  Float_t Qcm; // accumulated charge uC/cm
178  Float_t Crow; // Current per row;
179  Float_t Zdc; // ZDC rate from trigger
180  Float_t Weight; // 1/.sigma^2 of TpcSecRow gas gain correction
181  Float_t adc; // adc count from cluster finder
182  Float_t TanL;
183  Float_t Voltage; // Anode Voltage
184  Float_t xpad; // relative position in pad [-1.0,1.0] from G->L->Pad
185  Float_t yrow; // relative position in row [-0.5,0.0] inner, and [0.0,0.5] outer
186  Float_t xpadR; // relative position in pad [-1.0,1.0] from TpcHit
187  Int_t qB; // sign of curvature charge * sign of mag. field
188  Float_t tpcTime;
189  dE_t C[StTpcdEdxCorrection::kTpcAllCorrections+1];
190  dE_t F;
191  Float_t AdcI; // Log10(integrated ADC over time for a given socket0 or 0
192  Float_t dZdY; // cluster projection on on Z
193  Float_t dXdY; // cluster projection on Wire
194  Float_t driftTime; // in microsecconds
195  Float_t dX_TrackFit; // dX from local curvature obtained during track fit
196  Float_t dX_Helix; // dX from helices from the first and last hit
197  Float_t etaG; // eta at the first hit point
198  Char_t last[1];
199  void Reset() {memset(first, 0, last - first);}
200 };
201 #endif
Definition: TChair.h:27