Line data Source code
1 : #ifndef ALITPCSPACECHARGE3D_H
2 : #define ALITPCSPACECHARGE3D_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : /// \class AliTPCSpaceCharge3D
8 : /// \author Stefan Rossegger, Marian Ivanov
9 :
10 : #include "AliTPCCorrection.h"
11 : class TH2F;
12 : class TH2;
13 : class TH3F;
14 : class TH3;
15 :
16 : class AliTPCSpaceCharge3D : public AliTPCCorrection {
17 : public:
18 : AliTPCSpaceCharge3D();
19 : virtual ~AliTPCSpaceCharge3D();
20 :
21 : // initialization and update functions
22 : virtual void Init();
23 : virtual void Update(const TTimeStamp &timeStamp);
24 :
25 : // common setters and getters for tangled ExB effect
26 : virtual void SetOmegaTauT1T2(Float_t omegaTau,Float_t t1,Float_t t2) {
27 0 : fT1=t1; fT2=t2;
28 0 : const Double_t wt0=t2*omegaTau; fC0=1./(1.+wt0*wt0);
29 0 : const Double_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
30 0 : };
31 0 : void SetC0C1(Float_t c0,Float_t c1) {fC0=c0;fC1=c1;} // CAUTION: USE WITH CARE
32 0 : Float_t GetC0() const {return fC0;}
33 0 : Float_t GetC1() const {return fC1;}
34 :
35 : // setters and getters
36 0 : void SetCorrectionFactor(Float_t correctionFactor) {fCorrectionFactor=correctionFactor;}
37 0 : Float_t GetCorrectionFactor() const {return fCorrectionFactor;}
38 :
39 : void InitSpaceCharge3DDistortion(); // faster model and more accurate ;-)
40 : void InitSpaceCharge3DDistortionCourse(); // real 3D but not accurate enough
41 0 : void ForceInitSpaceCharge3DDistortion() { fInitLookUp=kFALSE; InitSpaceCharge3DDistortion(); }
42 :
43 : void InitSpaceCharge3DPoisson (Int_t kRows, Int_t kColumns, Int_t kPhiSlices, Int_t kIterations, IntegrationType integrationType=kIntegral);
44 : void ForceInitSpaceCharge3DPoisson(Int_t kRows, Int_t kColumns, Int_t kPhiSlices, Int_t kIterations, IntegrationType integrationType=kIntegral)
45 0 : { fInitLookUp=kFALSE; InitSpaceCharge3DPoisson(kRows,kColumns,kPhiSlices,kIterations, integrationType); }
46 : Float_t GetSpaceChargeDensity(Float_t r, Float_t phi, Float_t z);
47 : TH2F* CreateHistoSCinXY(Float_t z, Int_t nx=100, Int_t ny=100);
48 : TH2F* CreateHistoSCinZR(Float_t phi, Int_t nz=100, Int_t nr=100);
49 :
50 :
51 : void WriteChargeDistributionToFile(const char* fname = "SC-Alice.root");
52 :
53 : virtual void Print(const Option_t* option="") const;
54 : // MI - Add the "real" 3D histogram as an optional input (26.06.2013)
55 : //
56 : void SetInputSpaceCharge(TH3 * hisSpaceCharge3D, Double_t norm);
57 0 : void SetInputSpaceCharge3D(TH3 * hisSpaceCharge3D){SetInputSpaceCharge(hisSpaceCharge3D, 1);}
58 :
59 0 : const TH3 * GetInputSpaceCharge3D(){return fSpaceChargeHistogram3D;} // MI add
60 0 : const TH2 * GetInputSpaceChargeRPhi(){return fSpaceChargeHistogramRPhi;} // MI add
61 0 : const TH2 * GetInputSpaceChargeRZ(){return fSpaceChargeHistogramRZ;} // MI add
62 :
63 : virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
64 :
65 : private:
66 :
67 : // maximum sizes of lookup tables
68 : enum {kNRows= 90 }; // the maximum on row-slices so far ~ 2cm slicing
69 : enum {kNPhiSlices= 144 }; // the maximum of phi-slices so far = (8 per sector)
70 : enum {kNColumns= 130 }; // the maximum on column-slices so ~ 2cm slicing
71 :
72 : AliTPCSpaceCharge3D(const AliTPCSpaceCharge3D &); // not implemented
73 : AliTPCSpaceCharge3D &operator=(const AliTPCSpaceCharge3D &); // not implemented
74 :
75 : Float_t fC0; ///< coefficient C0 (compare Jim Thomas's notes for definitions)
76 : Float_t fC1; ///< coefficient C1 (compare Jim Thomas's notes for definitions)
77 : Float_t fCorrectionFactor; ///< Space Charge Correction factor in comparison to initialized
78 : // look up table which was created for M_mb = 900 and IR = 3000
79 : // compare Internal Note Nr: ???
80 :
81 : Bool_t fInitLookUp; ///< flag to check if the Look Up table was created
82 :
83 : TMatrixF *fLookUpErOverEz[kNPhi]; ///< Array to store electric field integral (int Er/Ez)
84 : TMatrixF *fLookUpEphiOverEz[kNPhi]; ///< Array to store electric field integral (int Er/Ez)
85 : TMatrixF *fLookUpDeltaEz[kNPhi]; ///< Array to store electric field integral (int Er/Ez)
86 :
87 : TString fSCDataFileName; ///< file which contains the space charge distribution
88 : TString fSCLookUpPOCsFileName3D; ///< filename of the precalculated lookup tables (for individual voxels)
89 : TString fSCLookUpPOCsFileNameRZ; ///< filename of the precalculated lookup tables (for individual voxels)
90 : TString fSCLookUpPOCsFileNameRPhi; ///< filename of the precalculated lookup tables (for individual voxels)
91 :
92 :
93 : TMatrixF *fSCdensityDistribution[kNPhi]; ///< 3D space charge distribution
94 : TMatrixD *fSCdensityInRZ; ///< (r,z) space charge distribution
95 : TMatrixD *fSCdensityInRPhiA; ///< (r,phi) space charge distribution
96 : TMatrixD *fSCdensityInRPhiC; ///< (r,phi) space charge distribution
97 : TH3 * fSpaceChargeHistogram3D; ///< Histogram with the input space charge histogram - used as an optional input
98 : TH2 * fSpaceChargeHistogramRPhi; ///< Histogram with the input space charge histogram - used as an optional input
99 : TH2 * fSpaceChargeHistogramRZ; ///< Histogram with the input space charge histogram - used as an optional input
100 : /// \cond CLASSIMP
101 24 : ClassDef(AliTPCSpaceCharge3D,2);
102 : /// \endcond
103 : };
104 :
105 : #endif
|