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