]>
Commit | Line | Data |
---|---|---|
9318a5b4 | 1 | #ifndef ALITPCCALIBALIGN_H |
2 | #define ALITPCCALIBALIGN_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | //// | |
8 | //// | |
9 | //// | |
10 | ||
3326b323 | 11 | class TFile; |
8b3c60d8 | 12 | class TGraphErrors; |
3326b323 | 13 | class TH1; |
1d82fc56 | 14 | class THnSparse; |
3326b323 | 15 | #include <TLinearFitter.h> |
16 | #include <TMatrixDfwd.h> | |
17 | class TObjArray; | |
18 | class TTree; | |
19 | ||
20 | #include "AliTPCcalibBase.h" | |
21 | class AliExternalComparison; | |
22 | class AliExternalTrackParam; | |
774a5ee9 | 23 | class AliTPCPointCorrection; |
3326b323 | 24 | class AliTPCseed; |
9318a5b4 | 25 | |
e4042305 | 26 | class AliTPCcalibAlign:public AliTPCcalibBase { |
9318a5b4 | 27 | public: |
bb6bc8f6 | 28 | enum HistoType {kY=0, kZ =1, kPhi=2, kTheta=3, |
29 | kYPhi=4, kZTheta=5, | |
30 | kYz=6,kZz=7,kPhiZ=8,kThetaZ=9}; | |
31 | enum FitType{ k6=0, k9=1, k12=2}; | |
9318a5b4 | 32 | AliTPCcalibAlign(); |
e149f26d | 33 | AliTPCcalibAlign(const Text_t *name, const Text_t *title); |
bb6bc8f6 | 34 | AliTPCcalibAlign(const AliTPCcalibAlign &align); |
35 | // | |
9318a5b4 | 36 | virtual ~AliTPCcalibAlign(); |
774a5ee9 | 37 | void Process(AliESDEvent *event); |
b842d904 | 38 | virtual void ProcessSeed(AliTPCseed *track); |
39 | virtual void Process(AliTPCseed */*track*/){ return ;} | |
7eaa723e | 40 | virtual void Analyze(); |
41 | virtual void Terminate(); | |
3326b323 | 42 | virtual Long64_t Merge(TCollection* const list); |
4de48bc7 | 43 | void ExportTrackPoints(AliESDEvent *event); |
7eaa723e | 44 | // |
774a5ee9 | 45 | // |
46 | void MakeReportDy(TFile *output); | |
47 | void MakeReportDyPhi(TFile *output); | |
48 | // | |
49 | void UpdatePointCorrection(AliTPCPointCorrection * correction); | |
50 | // | |
51 | virtual void EvalFitters(Int_t minPoints=20); | |
8b3c60d8 | 52 | TH1 * GetHisto(HistoType type, Int_t s1, Int_t s2, Bool_t force=kFALSE); |
774a5ee9 | 53 | void MakeTree(const char *fname="alignTree.root", Int_t minPoints=20); |
8b3c60d8 | 54 | TGraphErrors * MakeGraph(Int_t sec0, Int_t sec1, Int_t dsec, |
55 | Int_t i0, Int_t i1, FitType type); | |
774a5ee9 | 56 | Int_t RefitLinear(const AliTPCseed * seed, Int_t isec, Double_t *fitParam, Int_t refSector, TMatrixD ¶m, TMatrixD&covar, Double_t xRef, Bool_t both=kFALSE); |
57 | ||
e4042305 | 58 | void ProcessTracklets(const AliExternalTrackParam &t1, |
59 | const AliExternalTrackParam &t2, | |
967eae0d | 60 | const AliTPCseed * seed, |
e4042305 | 61 | Int_t s1,Int_t s2); |
774a5ee9 | 62 | |
63 | void UpdateAlignSector(const AliTPCseed * seed,Int_t isec); | |
3326b323 | 64 | Int_t GetIndex(Int_t s1,Int_t s2) const {return 72*s1+s2;} |
972cf6f2 | 65 | // |
6f387311 | 66 | inline const TMatrixD * GetTransformation(Int_t s1,Int_t s2, Int_t fitType); |
67 | // | |
972cf6f2 | 68 | inline TLinearFitter* GetFitter12(Int_t s1,Int_t s2); |
69 | inline TLinearFitter* GetFitter9(Int_t s1,Int_t s2); | |
70 | inline TLinearFitter* GetFitter6(Int_t s1,Int_t s2); | |
71 | // | |
9318a5b4 | 72 | Bool_t GetTransformation12(Int_t s1,Int_t s2,TMatrixD &a); |
73 | Bool_t GetTransformation9(Int_t s1,Int_t s2,TMatrixD &a); | |
74 | Bool_t GetTransformation6(Int_t s1,Int_t s2,TMatrixD &a); | |
1d82fc56 | 75 | Int_t AcceptTracklet(const AliExternalTrackParam &tp1, |
3326b323 | 76 | const AliExternalTrackParam &tp2) const; |
774a5ee9 | 77 | Int_t AcceptTracklet(const Double_t *t1, |
3326b323 | 78 | const Double_t *t2) const; |
6f387311 | 79 | |
967eae0d | 80 | void ProcessDiff(const AliExternalTrackParam &t1, |
81 | const AliExternalTrackParam &t2, | |
82 | const AliTPCseed *seed, | |
83 | Int_t s1,Int_t s2); | |
6f387311 | 84 | void ProcessAlign(Double_t * t1, Double_t * t2, Int_t s1,Int_t s2); |
967eae0d | 85 | |
972cf6f2 | 86 | // Bool_t GetTransformationCovar12(Int_t s1,Int_t s2,TMatrixD &a, Bool_t norm=kFALSE); |
87 | // Bool_t GetTransformationCovar9(Int_t s1,Int_t s2,TMatrixD &a, Bool_t norm=kFALSE); | |
88 | // Bool_t GetTransformationCovar6(Int_t s1,Int_t s2,TMatrixD &a, Bool_t norm=kFALSE); | |
ae0ac7be | 89 | void Add(AliTPCcalibAlign * align); |
3326b323 | 90 | const Int_t *GetPoints() const {return fPoints;} |
91 | void Process(AliESDtrack *const track, Int_t runNo=-1){AliTPCcalibBase::Process(track,runNo);}; | |
6f387311 | 92 | TLinearFitter* GetOrMakeFitter12(Int_t s1,Int_t s2); |
93 | TLinearFitter* GetOrMakeFitter9(Int_t s1,Int_t s2); | |
94 | TLinearFitter* GetOrMakeFitter6(Int_t s1,Int_t s2); | |
972cf6f2 | 95 | void Process12(const Double_t *t1, const Double_t *t2, |
3326b323 | 96 | TLinearFitter *fitter) const; |
97 | void Process9(const Double_t *const t1, const Double_t *const t2, TLinearFitter *fitter) const; | |
98 | void Process6(const Double_t *const t1, const Double_t *const t2, TLinearFitter *fitter) const; | |
1d82fc56 | 99 | void ProcessTree(TTree * tree, AliExternalComparison *comp=0); |
100 | void GlobalAlign6(Int_t minPoints, Float_t sysError, Int_t niter); | |
101 | // | |
102 | // Cluster comparison Part | |
103 | // | |
6f387311 | 104 | // |
105 | // For visualization and test purposes | |
106 | // | |
107 | Double_t Correct(Int_t type, Int_t value, Int_t s1, Int_t s2, Double_t x, Double_t y, Double_t z, Double_t phi,Double_t theta); | |
108 | static Double_t SCorrect(Int_t type, Int_t value, Int_t s1, Int_t s2, Double_t x, Double_t y, Double_t z, Double_t phi,Double_t theta){return Instance()->Correct(type,value,s1,s2,x,y,z,phi,theta);} | |
109 | static AliTPCcalibAlign* Instance(); | |
3326b323 | 110 | void SetInstance(AliTPCcalibAlign* const param){fgInstance = param;} |
1d82fc56 | 111 | static void Constrain1Pt(AliExternalTrackParam &t1, const AliExternalTrackParam &t2, Bool_t noField); |
112 | void SetNoField(Bool_t noField){ fNoField=noField;} | |
774a5ee9 | 113 | |
114 | // | |
115 | // Kalman fileter for sectors | |
116 | // | |
117 | void MakeSectorKalman(); | |
3326b323 | 118 | void UpdateSectorKalman(Int_t sector, Int_t quadrant0, Int_t quadrant1, TMatrixD *const p0, TMatrixD *const c0, TMatrixD *const p1, TMatrixD *const c1); |
774a5ee9 | 119 | void UpdateSectorKalman(TMatrixD &par0, TMatrixD &cov0, TMatrixD ¶1, TMatrixD &cov1); |
120 | Double_t GetCorrectionSector(Int_t coord, Int_t sector, Double_t lx, Double_t ly, Double_t lz); | |
121 | static Double_t SGetCorrectionSector(Int_t coord, Int_t sector, Double_t lx, Double_t ly, Double_t lz); | |
122 | ||
123 | // | |
124 | // Kalman filter for full TPC | |
125 | // | |
126 | void MakeKalman(); | |
127 | void UpdateKalman(Int_t sector0, Int_t sector1, TMatrixD &p0, TMatrixD &c0, TMatrixD &p1, TMatrixD &c1); | |
128 | void UpdateKalman(TMatrixD &par0, TMatrixD &cov0, TMatrixD ¶1, TMatrixD &cov1); | |
129 | // | |
130 | //private: | |
131 | static Int_t CheckCovariance(TMatrixD &covar); | |
b842d904 | 132 | // |
133 | // | |
134 | void MakeResidualHistos(); | |
135 | ||
774a5ee9 | 136 | public: |
6f387311 | 137 | |
774a5ee9 | 138 | void FillHisto(const Double_t *t1, |
139 | const Double_t *t2, | |
6f387311 | 140 | Int_t s1,Int_t s2); |
141 | ||
3326b323 | 142 | protected: |
b842d904 | 143 | THnSparse *fClusterDelta[6]; //clusters residuals |
144 | ||
bb6bc8f6 | 145 | TObjArray fDphiHistArray; // array of residual histograms phi -kPhi |
146 | TObjArray fDthetaHistArray; // array of residual histograms theta -kTheta | |
147 | TObjArray fDyHistArray; // array of residual histograms y -kY | |
148 | TObjArray fDzHistArray; // array of residual histograms z -kZ | |
149 | // | |
150 | TObjArray fDyPhiHistArray; // array of residual histograms y -kYPhi | |
151 | TObjArray fDzThetaHistArray; // array of residual histograms z-z -kZTheta | |
152 | // | |
153 | TObjArray fDphiZHistArray; // array of residual histograms phi -kPhiz | |
154 | TObjArray fDthetaZHistArray; // array of residual histograms theta -kThetaz | |
155 | TObjArray fDyZHistArray; // array of residual histograms y -kYz | |
156 | TObjArray fDzZHistArray; // array of residual histograms z -kZz | |
157 | // | |
158 | // | |
972cf6f2 | 159 | TObjArray fFitterArray12; // array of fitters |
160 | TObjArray fFitterArray9; // array of fitters | |
161 | TObjArray fFitterArray6; // array of fitters | |
6f387311 | 162 | // |
163 | TObjArray fMatrixArray12; // array of transnformtation matrix | |
164 | TObjArray fMatrixArray9; // array of transnformtation matrix | |
1d82fc56 | 165 | TObjArray fMatrixArray6; // array of transnformtation matrix |
166 | // | |
167 | // | |
b842d904 | 168 | // |
169 | // | |
1d82fc56 | 170 | TObjArray fCombinedMatrixArray6; // array combeined transformation matrix |
171 | // | |
172 | AliExternalComparison *fCompTracklet; //tracklet comparison | |
6f387311 | 173 | // |
174 | Int_t fPoints[72*72]; // number of points in the fitter | |
774a5ee9 | 175 | Bool_t fNoField; // flag - no field data |
176 | // refernce x | |
177 | Double_t fXIO; // OROC-IROC boundary | |
178 | Double_t fXmiddle; // center of the TPC sector local X | |
179 | Double_t fXquadrant; // x quadrant | |
180 | // | |
181 | // Kalman filter for sector internal alignemnt | |
182 | // | |
183 | TObjArray fArraySectorIntParam; // array of sector alignment parameters | |
184 | TObjArray fArraySectorIntCovar; // array of sector alignment covariances | |
185 | // | |
186 | // Kalman filter for global alignment | |
187 | // | |
188 | TMatrixD *fSectorParamA; // Kalman parameter for A side | |
189 | TMatrixD *fSectorCovarA; // Kalman covariance for A side | |
190 | TMatrixD *fSectorParamC; // Kalman parameter for A side | |
191 | TMatrixD *fSectorCovarC; // Kalman covariance for A side | |
4de48bc7 | 192 | // |
193 | // | |
194 | // | |
195 | Bool_t fUseInnerOuter; // flag- use Inner Outer sector for left righ alignment | |
196 | ||
6f387311 | 197 | static AliTPCcalibAlign* fgInstance; //! Instance of this class (singleton implementation) |
774a5ee9 | 198 | private: |
199 | AliTPCcalibAlign& operator=(const AliTPCcalibAlign&);// not implemented | |
200 | ||
4de48bc7 | 201 | ClassDef(AliTPCcalibAlign,3) |
9318a5b4 | 202 | }; |
203 | ||
972cf6f2 | 204 | |
205 | TLinearFitter* AliTPCcalibAlign::GetFitter12(Int_t s1,Int_t s2) { | |
206 | return static_cast<TLinearFitter*>(fFitterArray12[GetIndex(s1,s2)]); | |
207 | } | |
208 | TLinearFitter* AliTPCcalibAlign::GetFitter9(Int_t s1,Int_t s2) { | |
209 | return static_cast<TLinearFitter*>(fFitterArray9[GetIndex(s1,s2)]); | |
210 | } | |
211 | TLinearFitter* AliTPCcalibAlign::GetFitter6(Int_t s1,Int_t s2) { | |
212 | return static_cast<TLinearFitter*>(fFitterArray6[GetIndex(s1,s2)]); | |
213 | } | |
214 | ||
6f387311 | 215 | const TMatrixD * AliTPCcalibAlign::GetTransformation(Int_t s1,Int_t s2, Int_t fitType){ |
216 | if (fitType==0) return static_cast<TMatrixD*>(fMatrixArray6[GetIndex(s1,s2)]); | |
217 | if (fitType==1) return static_cast<TMatrixD*>(fMatrixArray9[GetIndex(s1,s2)]); | |
218 | if (fitType==2) return static_cast<TMatrixD*>(fMatrixArray12[GetIndex(s1,s2)]); | |
1d82fc56 | 219 | return 0; |
6f387311 | 220 | } |
972cf6f2 | 221 | |
222 | ||
223 | ||
9318a5b4 | 224 | #endif |