]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONAlignment.h
- Set alignment resolution in alignment objects
[u/mrichter/AliRoot.git] / MUON / AliMUONAlignment.h
CommitLineData
010eb601 1#ifndef ALIMUONALIGNMENT_H
2#define ALIMUONALIGNMENT_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8/// \ingroup rec
9/// \class AliMUONAlignment
10/// \brief Class for alignment of muon spectrometer
11//
12// Authors: Bruce Becker, Javier Castillo
13
14#include <TObject.h>
15
16class TGeoCombiTrans;
17class TClonesArray;
18class AliMillepede;
19class AliMUONGeometryTransformer;
20class AliMUONTrack;
21class AliMUONTrackParam;
96ebe67e 22class AliMUONVCluster;
010eb601 23
24class AliMUONAlignment:public TObject
25{
26
27public:
28 AliMUONAlignment();
29 virtual ~AliMUONAlignment();
30
31 void ProcessTrack(AliMUONTrack *track);
c4ee792d 32 /// Set geometry transformer
010eb601 33 void SetGeometryTransformer(AliMUONGeometryTransformer * transformer) {
34 fTransform = transformer;
35 }
36
058c815d 37 /// Set flag for Magnetic field On/Off
38 void SetBFieldOn(Bool_t bBFieldOn) {
39 fBFieldOn = bBFieldOn;
40 }
010eb601 41 void FixStation(Int_t iSt);
3b2890be 42 void FixHalfSpectrometer(Bool_t *bStOnOff, Bool_t *bSpecLROnOff);
010eb601 43 void AllowVariations(Bool_t *bStOnOff);
44 void SetNonLinear(Bool_t *bStOnOff, Bool_t *bVarXYT);
45 void AddConstraints(Bool_t *bStOnOff, Bool_t *bVarXYT);
3b2890be 46 void AddConstraints(Bool_t *bStOnOff, Bool_t *bVarXYT, Bool_t *bDetTLBR, Bool_t *bSpecLROnOff);
010eb601 47 void ResetConstraints();
48
49 void FixParameter(Int_t param, Double_t value);
50 void SetNonLinear(Int_t param);
51 void AddConstraint(Double_t *factor, Double_t value );
52 void InitGlobalParameters(Double_t *par);
c4ee792d 53 /// Set array of local derivatives
010eb601 54 void SetLocalDerivative(Int_t index, Double_t value) {
55 fLocalDerivatives[index] = value;
56 }
c4ee792d 57 /// Set array of global derivatives
010eb601 58 void SetGlobalDerivative(Int_t index, Double_t value) {
59 fGlobalDerivatives[index] = value;
60 }
61 void LocalFit(Int_t iTrack, Double_t *lTrackParam, Int_t lSingleFit);
62 void GlobalFit(Double_t *parameters,Double_t *errors,Double_t *pulls);
63 void PrintGlobalParameters();
64 Double_t GetParError(Int_t iPar);
65
66 AliMUONGeometryTransformer*
67 ReAlign(const AliMUONGeometryTransformer * transformer, double *misAlignments, Bool_t verbose);
68
4818a9b7 69 void SetAlignmentResolution(const TClonesArray* misAlignArray, Int_t chId, Double_t chResX, Double_t chResY, Double_t deResX, Double_t deResY);
70
c4ee792d 71 private:
72 /// Not implemented
010eb601 73 AliMUONAlignment(const AliMUONAlignment& right);
c4ee792d 74 /// Not implemented
010eb601 75 AliMUONAlignment& operator = (const AliMUONAlignment& right);
010eb601 76
77 void Init(Int_t nGlobal, Int_t nLocal, Int_t nStdDev);
3b2890be 78 void ConstrainT(Int_t lDetElem, Int_t lCh, Double_t *lConstraintT, Int_t iVar, Double_t lWeight=1.0);
79 void ConstrainL(Int_t lDetElem, Int_t lCh, Double_t *lConstraintL, Int_t iVar, Double_t lWeight=1.0);
80 void ConstrainB(Int_t lDetElem, Int_t lCh, Double_t *lConstraintB, Int_t iVar, Double_t lWeight=1.0);
81 void ConstrainR(Int_t lDetElem, Int_t lCh, Double_t *lConstraintR, Int_t iVar, Double_t lWeight=1.0);
010eb601 82 void FillDetElemData();
83 void FillRecPointData();
84 void FillTrackParamData();
85 void ResetLocalEquation();
86 void LocalEquationX();
87 void LocalEquationY();
88
89 TGeoCombiTrans ReAlign(const TGeoCombiTrans& transform, double *detElemMisAlignment) const;
90
c4ee792d 91 Bool_t fBFieldOn; ///< Flag for Magnetic filed On/Off
010eb601 92
c4ee792d 93 Bool_t fDoF[3]; ///< Flags degrees of freedom to align (x,y,phi)
94 Double_t fAllowVar[3]; ///< "Encouraged" variation for degrees of freedom
95 Double_t fStartFac; ///< Initial value for chi2 cut
96 ///< if > 1 Iterations in AliMillepede are turned on
97 Double_t fResCutInitial; ///< Cut on residual for first iteration
98 Double_t fResCut; ///< Cut on residual for other iterations
99
100 AliMillepede *fMillepede; ///< Detector independent alignment class
010eb601 101
96ebe67e 102 TClonesArray *fTrackParamAtCluster; ///< Array of track parameters
103 AliMUONTrack *fTrack; ///< AliMUONTrack
104 AliMUONVCluster *fCluster; ///< AliMUONVCluster
105 AliMUONTrackParam *fTrackParam; ///< Track parameters
c4ee792d 106
107 Int_t fNGlobal; ///< Number of global parameters
108 Int_t fNLocal; ///< Number of local parameters
109 Int_t fNStdDev; ///< Number of standard deviations for chi2 cut
110 Double_t fClustPos[3]; ///< Cluster position
111 Double_t fClustPosLoc[3]; ///< Cluster position in local coordinates
112 Double_t fTrackSlope0[2]; ///< Track slope at reference point
113 Double_t fTrackSlope[2]; ///< Track slope at current point
114 Double_t fTrackPos0[3]; ///< Track intersection at reference point
115 Double_t fTrackPos[3]; ///< Track intersection at current point
116 Double_t fTrackPosLoc[3]; ///< Track intersection at current point in local coordinates
117 Double_t fMeas[2]; ///< Current measurement (depend on B field On/Off)
118 Double_t fSigma[2]; ///< Estimated resolution on measurement
119
120 Double_t fGlobalDerivatives[468]; ///< Array of global derivatives
121 Double_t fLocalDerivatives[4]; ///< Array of local derivatives
122
123 Double_t fConstraintX[468]; ///< Array for constraint equation all X
124 Double_t fConstraintY[468]; ///< Array for constraint equation all Y
125 Double_t fConstraintP[468]; ///< Array for constraint equation all P
126 Double_t fConstraintXT[468]; ///< Array for constraint equation X Top half
127 Double_t fConstraintYT[468]; ///< Array for constraint equation Y Top half
128 Double_t fConstraintPT[468]; ///< Array for constraint equation P Top half
3b2890be 129 Double_t fConstraintXZT[468]; ///< Array for constraint equation X vs Z Top half
130 Double_t fConstraintYZT[468]; ///< Array for constraint equation Y vs Z Top half
131 Double_t fConstraintPZT[468]; ///< Array for constraint equation P vs Z Top half
132 Double_t fConstraintXYT[468]; ///< Array for constraint equation X vs Y Top half
133 Double_t fConstraintYYT[468]; ///< Array for constraint equation Y vs Y Top half
134 Double_t fConstraintPYT[468]; ///< Array for constraint equation P vs Y Top half
c4ee792d 135 Double_t fConstraintXB[468]; ///< Array for constraint equation X Bottom half
136 Double_t fConstraintYB[468]; ///< Array for constraint equation Y Bottom half
137 Double_t fConstraintPB[468]; ///< Array for constraint equation P Bottom half
3b2890be 138 Double_t fConstraintXZB[468]; ///< Array for constraint equation X vs Z Bottom half
139 Double_t fConstraintYZB[468]; ///< Array for constraint equation Y vs Z Bottom half
140 Double_t fConstraintPZB[468]; ///< Array for constraint equation P vs Z Bottom half
141 Double_t fConstraintXYB[468]; ///< Array for constraint equation X vs Y Bottom half
142 Double_t fConstraintYYB[468]; ///< Array for constraint equation Y vs Y Bottom half
143 Double_t fConstraintPYB[468]; ///< Array for constraint equation P vs Y Bottom half
c4ee792d 144 Double_t fConstraintXR[468]; ///< Array for constraint equation X Right half
145 Double_t fConstraintYR[468]; ///< Array for constraint equation Y Right half
146 Double_t fConstraintPR[468]; ///< Array for constraint equation P Right half
3b2890be 147 Double_t fConstraintXZR[468]; ///< Array for constraint equation X vs Z Right half
148 Double_t fConstraintYZR[468]; ///< Array for constraint equation Y vs Z Right half
149 Double_t fConstraintPZR[468]; ///< Array for constraint equation P vs Z Right half
150 Double_t fConstraintXYR[468]; ///< Array for constraint equation X vs Y Right half
151 Double_t fConstraintYYR[468]; ///< Array for constraint equation Y vs Y Right half
152 Double_t fConstraintPYR[468]; ///< Array for constraint equation P vs Y Right half
c4ee792d 153 Double_t fConstraintXL[468]; ///< Array for constraint equation X Left half
154 Double_t fConstraintYL[468]; ///< Array for constraint equation Y Left half
155 Double_t fConstraintPL[468]; ///< Array for constraint equation P Left half
3b2890be 156 Double_t fConstraintXZL[468]; ///< Array for constraint equation X vs Z Left half
157 Double_t fConstraintYZL[468]; ///< Array for constraint equation Y vs Z Left half
158 Double_t fConstraintPZL[468]; ///< Array for constraint equation P vs Z Left half
159 Double_t fConstraintXYL[468]; ///< Array for constraint equation X vs Y Left half
160 Double_t fConstraintYYL[468]; ///< Array for constraint equation Y vs Y Left half
161 Double_t fConstraintPYL[468]; ///< Array for constraint equation P vs Y Left half
c4ee792d 162 Double_t fConstraintX3[468]; ///< Array for constraint equation St3 X
163 Double_t fConstraintY3[468]; ///< Array for constraint equation St3 Y
164 Double_t fConstraintX4[468]; ///< Array for constraint equation St4 X
165 Double_t fConstraintY4[468]; ///< Array for constraint equation St4 Y
166 Double_t fConstraintP4[468]; ///< Array for constraint equation St4 P
167 Double_t fConstraintX5[468]; ///< Array for constraint equation St5 X
168 Double_t fConstraintY5[468]; ///< Array for constraint equation St5 Y
169
170 Int_t fDetElemId; ///< Detection element id
171 Int_t fDetElemNumber; ///< Detection element number
172 Double_t fPhi; ///< Azimuthal tilt of detection element
173 Double_t fCosPhi; ///< Cosine of fPhi
174 Double_t fSinPhi; ///< Sine of fPhi
175 Double_t fDetElemPos[3]; ///< Position of detection element
176
177 AliMUONGeometryTransformer *fTransform; ///< Geometry transformation
178
179 static Int_t fgNSt; ///< Number tracking stations
180 static Int_t fgNCh; ///< Number tracking chambers
3b2890be 181 static Int_t fgNTrkMod; ///< Number of tracking modules (4 ch + 6*2 half-ch)
c4ee792d 182 static Int_t fgNParCh; ///< Number of degrees of freedom per chamber
183 static Int_t fgNDetElem; ///< Total number of detection elements
184 static Int_t fgNDetElemCh[10]; ///< Number of detection elements per chamber
185 static Int_t fgSNDetElemCh[10];///< Sum of detection elements up to this chamber (inc)
010eb601 186
69d7ac2e 187ClassDef(AliMUONAlignment, 0) //Class for alignment of muon spectrometer
188};
010eb601 189
190#endif