]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSAlignMille.h
Adding the correction for wrongly simulated pid TOF signal
[u/mrichter/AliRoot.git] / ITS / AliITSAlignMille.h
CommitLineData
483fd7d8 1#ifndef ALIITSALIGNMILLE_H
2#define ALIITSALIGNMILLE_H
3/* Copyright(c) 2007-2009 , ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8
9/// \ingroup rec
10/// \class AliITSAlignMille
11/// \brief Class for alignment of ITS
12//
13// Authors: Marcello Lunardon
14
15#include <TString.h>
16#include <TObject.h>
17#include "AliTrackPointArray.h"
18
75d480f6 19// number of used objects
20#define ITSMILLENDETELEM 2198
21#define ITSMILLENPARCH 6
22#define ITSMILLENLOCAL 5
23#define ITSMILLENSTDEV 3
24
483fd7d8 25class AliMillepede;
26class AliAlignObjParams;
27class TGeoManager;
28class TGeoHMatrix;
0856765c 29class AliITSAlignMilleModule;
d3603b4d 30class AliTrackFitterRieman;
75d480f6 31class AliITSAlignMilleData;
d3603b4d 32
483fd7d8 33class AliITSAlignMille:public TObject
34{
483fd7d8 35public:
36 AliITSAlignMille(const Char_t *configFilename="AliITSAlignMille.conf", Bool_t initmille=kTRUE);
37 virtual ~AliITSAlignMille();
38
39 // geometry methods
d3603b4d 40 Int_t GetModuleIndex(const Char_t *symname);
483fd7d8 41 Int_t GetModuleIndex(UShort_t voluid);
42 UShort_t GetModuleVolumeID(const Char_t *symname);
43 UShort_t GetModuleVolumeID(Int_t index);
0856765c 44 void SetCurrentModule(Int_t index);
45 void SetCurrentSensitiveModule(Int_t index); // set as current the SENSITIVE module with index 'index'
483fd7d8 46
47 // configuration methods
48 void SetGeometryFileName(const Char_t* filename="geometry.root")
49 { fGeometryFileName = filename; }
50 const Char_t* GetGeometryFileName() {return fGeometryFileName.Data();}
0856765c 51 const Char_t* GetPreAlignmentFileName() {return fPreAlignmentFileName.Data();}
483fd7d8 52 void PrintCurrentModuleInfo();
0856765c 53 void Print(Option_t*) const;
d3603b4d 54 Bool_t IsConfigured() const {return fIsConfigured;}
55 void SetRequiredPoint(Char_t* where, Int_t ndet, Int_t updw, Int_t nreqpts);
483fd7d8 56
57 // fitting methods
58 void SetMinNPtsPerTrack(Int_t pts=3) {fMinNPtsPerTrack=pts;}
483fd7d8 59 Int_t ProcessTrack(AliTrackPointArray *track);
b80c197e 60 AliTrackPointArray *PrepareTrack(const AliTrackPointArray *track); // build a new AliTrackPointArray with selected conditions
483fd7d8 61 void InitTrackParams(int meth=1);
d3603b4d 62 Bool_t InitRiemanFit();
63 AliTrackFitterRieman *GetRiemanFitter() const {return fRieman;}
483fd7d8 64 Int_t InitModuleParams();
65 Int_t CheckCurrentTrack();
0856765c 66 Bool_t CheckVolumeID(UShort_t voluid) const; // checks voluid for sensitive volumes
67 Int_t IsDefined(UShort_t voluid) const;
68 Int_t IsContained(UShort_t voluid) const;
b80c197e 69 Int_t CalcIntersectionPoint(const Double_t *lpar, const Double_t *gpar);
483fd7d8 70 Int_t CalcDerivatives(Int_t paridx, Bool_t islpar);
75d480f6 71 const Double_t* GetLocalIntersectionPoint() const {return fPintLoc;}
72 const Double_t* GetGlobalIntersectionPoint() const {return fPintGlo;}
0856765c 73 void SetInitTrackParamsMeth(Int_t meth=1) {fInitTrackParamsMeth=meth;}
b80c197e 74 AliTrackPointArray *SortTrack(const AliTrackPointArray *atp);
d3603b4d 75 void SetTemporaryExcludedModule(Int_t index) {fTempExcludedModule=index;}
483fd7d8 76
77 // millepede methods
78 void FixParameter(Int_t param, Double_t value);
79 void AddConstraint(Double_t *factor, Double_t value );
80 void InitGlobalParameters(Double_t *par);
81 void SetLocalDerivative(Int_t index, Double_t value)
82 {fLocalDerivatives[index] = value;}
83 void SetGlobalDerivative(Int_t index, Double_t value)
84 {fGlobalDerivatives[index] = value;}
85 void LocalFit(Int_t iTrack, Double_t *lTrackParam, Int_t lSingleFit);
86 void GlobalFit(Double_t *parameters,Double_t *errors,Double_t *pulls);
87 void PrintGlobalParameters();
88 Double_t GetParError(Int_t iPar);
75d480f6 89 Int_t AddLocalEquation(AliITSAlignMilleData &m);
b80c197e 90 void SetLocalEquations(const AliITSAlignMilleData *m, Int_t neq);
483fd7d8 91
92 // fitting stuffs
75d480f6 93 AliTrackPointArray *GetCurrentTrack() const {return fTrack;}
94 const AliTrackPoint *GetCurrentCluster() const {return &fCluster;}
95 void SetCurrentTrack(AliTrackPointArray * const atp) {fTrack=atp;}
96 void SetCurrentCluster(const AliTrackPoint &atp) {fCluster=atp;}
483fd7d8 97
98 // geometry stuffs
d3603b4d 99 Int_t GetNModules() const {return fNModules;}
100 Int_t GetCurrentModuleIndex() const {return fCurrentModuleIndex;}
75d480f6 101 TGeoHMatrix *GetCurrentModuleHMatrix() const {return fCurrentModuleHMatrix;}
102 const Double_t *GetCurrentModuleTranslation() const {return fCurrentModuleTranslation;}
d3603b4d 103 Int_t GetCurrentModuleInternalIndex() const {return fCurrentModuleInternalIndex;}
75d480f6 104 const Int_t *GetModuleIndexArray() const {return fModuleIndex;}
105 const Int_t *GetProcessedPoints() const {return fProcessedPoints;}
d3603b4d 106 Int_t GetTotBadLocEqPoints() const {return fTotBadLocEqPoints;}
b80c197e 107 AliITSAlignMilleModule *GetMilleModule(UShort_t voluid) const; // get pointer to the defined supermodule
75d480f6 108 AliITSAlignMilleModule *GetCurrentModule() const;
109 const UShort_t *GetModuleVolumeIDArray() const {return fModuleVolumeID;}
d3603b4d 110
111 // debug stuffs
75d480f6 112 const Double_t *GetMeasLoc() const { return fMeasLoc;}
113 const Double_t *GetSigmaLoc() const { return fSigmaLoc;}
d3603b4d 114 Double_t GetBField() const {return fBField;}
75d480f6 115 const Double_t *GetLocalInitParam() const {return fLocalInitParam;}
d3603b4d 116 Double_t GetLocalDX() const {return fDerivativeXLoc;}
117 Double_t GetLocalDZ() const {return fDerivativeZLoc;}
118 Double_t GetParSigTranslations() const {return fParSigTranslations;}
119 Double_t GetParSigRotations() const {return fParSigRotations;}
75d480f6 120 Int_t GetPreAlignmentQualityFactor(Int_t index) const; // if not prealign. return -1
d3603b4d 121 void SetBug(Int_t bug) {fBug=bug;} // 1:SSD inversion sens.18-19
122
483fd7d8 123 private:
124
125 // configuration methods
126 Int_t LoadConfig(const Char_t *cfile="AliITSAlignMille.conf");
0856765c 127 Int_t LoadSuperModuleFile(const Char_t *cfile="ITSMilleSuperModules.root");
483fd7d8 128 void ResetLocalEquation();
129 void InitGeometry();
0856765c 130 Int_t ApplyToGeometry();
483fd7d8 131
132 // millepede methods
133 void Init(Int_t nGlobal, Int_t nLocal, Int_t nStdDev);
134
135 // millepede stuffs
136 AliMillepede *fMillepede; ///< Detector independent alignment class
137 static Int_t fgNParCh; ///< Number of degrees of freedom per chamber
138 static Int_t fgNDetElem; ///< Total number of detection elements
139 Double_t fStartFac; ///< Initial value for chi2 cut
140 ///< if > 1 Iterations in AliMil. are turned on
141 Double_t fResCutInitial; ///< Cut on residual for first iteration
142 Double_t fResCut; ///< Cut on residual for other iterations
143 Int_t fNGlobal; ///< Number of global parameters
144 Int_t fNLocal; ///< Number of local parameters
145 Int_t fNStdDev; ///< Number of standard deviations for chi2 cut
146 Bool_t fIsMilleInit; ///
147 Double_t fParSigTranslations; ///< init sigma for transl. params [cm]
148 Double_t fParSigRotations; ///< init sigma for rot. params [deg]
149
150 // fitting stuffs
151 AliTrackPointArray *fTrack; ///< pointer to current track
152 AliTrackPoint fCluster; ///< current cluster
153 Double_t *fGlobalDerivatives; ///< Array of global derivatives
75d480f6 154 Double_t fLocalDerivatives[ITSMILLENLOCAL]; ///< Array of local deriv.
155 Double_t fLocalInitParam[ITSMILLENLOCAL]; ///< Array with inital values for local parameters for current track
156 Double_t fModuleInitParam[ITSMILLENPARCH]; ///< Array with inital values for current module parameters (init geometry)
483fd7d8 157 Double_t fPintLoc[3]; ///
158 Double_t fPintLoc0[3]; ///
159 Double_t fPintGlo[3]; ///
160 Double_t fMeasLoc[3]; // current point local coordinates (the original ones)
161 Double_t fMeasGlo[3]; // current point glob. coord (AliTrackPoint)
162 Double_t fSigmaLoc[3]; // stdev current point
d3603b4d 163 Double_t fSigmaXfactor; ///
164 Double_t fSigmaZfactor; ///
483fd7d8 165 AliAlignObjParams *fTempAlignObj; ///
166 Double_t fDerivativeXLoc; // localX deriv.
167 Double_t fDerivativeZLoc; // localZ deriv.
483fd7d8 168 Int_t fMinNPtsPerTrack; ///
0856765c 169 Int_t fInitTrackParamsMeth; ///
d3603b4d 170 Int_t *fProcessedPoints; /// array of statistics of used points per module
171 Int_t fTotBadLocEqPoints; /// total number of reject points because of bad EqLoc
172 AliTrackFitterRieman *fRieman; /// riemann fitter for helices
173 Bool_t fRequirePoints; // required points in specific layers
174 Int_t fNReqLayUp[6]; /// number of points required in layer[n] with Y>0
175 Int_t fNReqLayDown[6]; /// number of points required in layer[n] with Y<0
176 Int_t fNReqLay[6]; /// number of points required in layer[n]
177 Int_t fNReqDetUp[3]; /// number of points required in Detector[n] with Y>0
178 Int_t fNReqDetDown[3]; /// number of points required in Detector[n] with Y<0
179 Int_t fNReqDet[3]; /// number of points required in Detector[n]
180 Int_t fTempExcludedModule; /// single module temporary excluded from initial fit
0856765c 181
483fd7d8 182 // geometry stuffs
183 TString fGeometryFileName; ///
0856765c 184 TString fPreAlignmentFileName; ///
483fd7d8 185 TGeoManager *fGeoManager; ///
0856765c 186 Int_t fCurrentModuleIndex; /// SuperModule index
187 Int_t fCurrentModuleInternalIndex; /// SuperModule internal index
188 Int_t fCurrentSensVolIndex; /// Current point (sens. vol.) index
483fd7d8 189 Double_t fCurrentModuleTranslation[3]; ///
190 Int_t fNModules; /// number of defined modules from config file
75d480f6 191 Int_t fModuleIndex[ITSMILLENDETELEM*2]; ///
192 UShort_t fModuleVolumeID[ITSMILLENDETELEM*2]; ///
193 Bool_t fFreeParam[ITSMILLENDETELEM*2][ITSMILLENPARCH]; ///
483fd7d8 194 Bool_t fUseLocalShifts; ///
0856765c 195 Bool_t fUseSuperModules; ///
196 Bool_t fUsePreAlignment; ///
d3603b4d 197 Bool_t fUseSortedTracks; /// default is kTRUE
198 Bool_t fBOn; /// magentic field ON
199 Double_t fBField; /// value of magnetic field
0856765c 200 Int_t fNSuperModules; /// number of custom supermodules in SM file
201 TGeoHMatrix *fCurrentModuleHMatrix; /// SuperModule matrix
d3603b4d 202 Bool_t fIsConfigured; ///
75d480f6 203 Int_t fPreAlignQF[ITSMILLENDETELEM*2]; ///
204 Double_t fSensVolSigmaXfactor[ITSMILLENDETELEM*2]; ///
205 Double_t fSensVolSigmaZfactor[ITSMILLENDETELEM*2]; ///
d3603b4d 206 Int_t fBug; /// tag for temporary bug correction
0856765c 207
75d480f6 208 AliITSAlignMilleModule *fMilleModule[ITSMILLENDETELEM*2]; /// array of super modules to be aligned
0856765c 209
75d480f6 210 AliITSAlignMilleModule *fSuperModule[ITSMILLENDETELEM*2]; /// array of super modules defined in supermodule file
483fd7d8 211
212 AliITSAlignMille(const AliITSAlignMille& rhs);
213 AliITSAlignMille& operator=(const AliITSAlignMille& rhs);
214
215
0856765c 216 ClassDef(AliITSAlignMille, 0)
217
218};
483fd7d8 219
220#endif