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