]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/Base/AliTPCSpaceCharge3D.h
Merge branch 'TPCdev' of https://git.cern.ch/reps/AliRoot into TPCdev
[u/mrichter/AliRoot.git] / TPC / Base / AliTPCSpaceCharge3D.h
CommitLineData
cc3e558a 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////////////////////////////////////////////////////////////////////////////
b4caed64 8// AliTPCSpaceCharge3D class //
cc3e558a 9// Authors: Stefan Rossegger //
10////////////////////////////////////////////////////////////////////////////
11
12#include "AliTPCCorrection.h"
13class TH3F;
92a85338 14class TH3;
cc3e558a 15
16class AliTPCSpaceCharge3D : public AliTPCCorrection {
17public:
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 fT1=t1; fT2=t2;
28 const Double_t wt0=t2*omegaTau; fC0=1./(1.+wt0*wt0);
29 const Double_t wt1=t1*omegaTau; fC1=wt1/(1.+wt1*wt1);
30 };
31 void SetC0C1(Float_t c0,Float_t c1) {fC0=c0;fC1=c1;} // CAUTION: USE WITH CARE
32 Float_t GetC0() const {return fC0;}
33 Float_t GetC1() const {return fC1;}
34
35 // setters and getters
36 void SetCorrectionFactor(Float_t correctionFactor) {fCorrectionFactor=correctionFactor;}
37 Float_t GetCorrectionFactor() const {return fCorrectionFactor;}
38
15687d71 39 void SetSCDataFileName(TString fname);
40 const char* GetSCDataFileName() { return fSCDataFileName.Data(); }
cc3e558a 41
15687d71 42 void InitSpaceCharge3DDistortion(); // faster model and more accurate ;-)
43 void InitSpaceCharge3DDistortionCourse(); // real 3D but not accurate enough
2bf29b72 44 void ForceInitSpaceCharge3DDistortion() { fInitLookUp=kFALSE; InitSpaceCharge3DDistortion(); }
cc3e558a 45
92a85338 46 void InitSpaceCharge3DPoisson(Int_t kRows, Int_t kColumns, Int_t kPhiSlices, Int_t kIterations);
47a84680 47 void ForceInitSpaceCharge3DPoisson(Int_t kRows, Int_t kColumns, Int_t kPhiSlices, Int_t kIterations) { fInitLookUp=kFALSE; InitSpaceCharge3DPoisson(kRows,kColumns,kPhiSlices,kIterations); }
92a85338 48 Float_t GetSpaceChargeDensity(Float_t r, Float_t phi, Float_t z, Int_t mode);
15687d71 49 TH2F* CreateHistoSCinXY(Float_t z, Int_t nx=100, Int_t ny=100, Int_t mode=0);
50 TH2F* CreateHistoSCinZR(Float_t phi, Int_t nz=100, Int_t nr=100, Int_t mode=0);
cc3e558a 51
52
53 void WriteChargeDistributionToFile(const char* fname = "SC-Alice.root");
54
55 virtual void Print(const Option_t* option="") const;
92a85338 56 // MI - Add the "real" 3D histogram as an optional input (26.06.2013)
57 //
58 void SetInputSpaceCharge(TH3 * hisSpaceCharge3D, TH2 * hisRPhi, TH2* hisRZ, Double_t norm);
db59c7fb 59 void SetInputSpaceCharge3D(TH3 * hisSpaceCharge3D){fSpaceChargeHistogram3D= hisSpaceCharge3D;}
60
92a85338 61 const TH3 * GetInputSpaceCharge3D(){return fSpaceChargeHistogram3D;} // MI add
62 const TH2 * GetInputSpaceChargeRPhi(){return fSpaceChargeHistogramRPhi;} // MI add
63 const TH2 * GetInputSpaceChargeRZ(){return fSpaceChargeHistogramRZ;} // MI add
cc3e558a 64
cc3e558a 65 virtual void GetCorrection(const Float_t x[],const Short_t roc,Float_t dx[]);
66
8a94851d 67 static AliTPCSpaceCharge3D *MakeCorrection22D(const char * filename = "SpaceChargeMap.root", Double_t multiplicity = 950., Double_t intRate = 5e4, Double_t epsIROC = 10., Double_t epsOROC=10,
68 Double_t gasfactor = 1.,
69 Double_t radialScaling = 1.5);
cc3e558a 70private:
71
9f3b99e2 72 // maximum sizes of lookup tables
73 enum {kNRows= 90 }; // the maximum on row-slices so far ~ 2cm slicing
74 enum {kNPhiSlices= 144 }; // the maximum of phi-slices so far = (8 per sector)
75 enum {kNColumns= 130 }; // the maximum on column-slices so ~ 2cm slicing
76
cc3e558a 77 AliTPCSpaceCharge3D(const AliTPCSpaceCharge3D &); // not implemented
78 AliTPCSpaceCharge3D &operator=(const AliTPCSpaceCharge3D &); // not implemented
79
80 Float_t fC0; // coefficient C0 (compare Jim Thomas's notes for definitions)
81 Float_t fC1; // coefficient C1 (compare Jim Thomas's notes for definitions)
82 Float_t fCorrectionFactor; // Space Charge Correction factor in comparison to initialized
83 // look up table which was created for M_mb = 900 and IR = 3000
84 // compare Internal Note Nr: ???
85
2bf29b72 86 Bool_t fInitLookUp; // flag to check if the Look Up table was created
cc3e558a 87
2bf29b72 88 TMatrixF *fLookUpErOverEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
89 TMatrixF *fLookUpEphiOverEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
90 TMatrixF *fLookUpDeltaEz[kNPhi]; // Array to store electric field integral (int Er/Ez)
cc3e558a 91
15687d71 92 TString fSCDataFileName; // file which contains the space charge distribution
93 TString fSCLookUpPOCsFileName3D; // filename of the precalculated lookup tables (for individual voxels)
94 TString fSCLookUpPOCsFileNameRZ; // filename of the precalculated lookup tables (for individual voxels)
95 TString fSCLookUpPOCsFileNameRPhi; // filename of the precalculated lookup tables (for individual voxels)
cc3e558a 96
15687d71 97
2bf29b72 98 TMatrixF *fSCdensityDistribution[kNPhi]; // 3D space charge distribution
15687d71 99 TMatrixD *fSCdensityInRZ; // (r,z) space charge distribution
100 TMatrixD *fSCdensityInRPhiA; // (r,phi) space charge distribution
101 TMatrixD *fSCdensityInRPhiC; // (r,phi) space charge distribution
92a85338 102 TH3 * fSpaceChargeHistogram3D; // Histogram with the input space charge histogram - used as an optional input
103 TH2 * fSpaceChargeHistogramRPhi; // Histogram with the input space charge histogram - used as an optional input
104 TH2 * fSpaceChargeHistogramRZ; // Histogram with the input space charge histogram - used as an optional input
2bf29b72 105 ClassDef(AliTPCSpaceCharge3D,2);
cc3e558a 106};
107
108#endif