1 #ifndef ALI_MILLEPEDE_H
2 #define ALI_MILLEPEDE_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
10 /// \class AliMillepede
11 /// \brief Class for detector alignment - modified C++ implementation of original
14 // Author: Javier Castillo
20 class AliMillepede : public TObject {
23 /// Standard constructor
26 virtual ~AliMillepede( ); /// Destructor
29 virtual Int_t InitMille(int nglo, int nloc, int nstd,
30 double lResCut, double lResCutInit);
31 virtual Int_t GlobalFit(double par[], double error[], double pull[]);
32 virtual Int_t SetGlobalParameters(double *param);
33 virtual Int_t SetGlobalParameter(int iPar, double vPar);
34 virtual Int_t SetParSigma(int iPar, double sigma);
35 virtual Int_t SetNonLinear(int index);
36 virtual Int_t SetGlobalConstraint(double dercs[], double rhs);
37 virtual Int_t SetLocalEquation(double dergb[], double derlc[], double rmeas, double sigma);
38 virtual Int_t LocalFit(int n, double localParams[], Bool_t bSingleFit);
39 /// Get number of local equations
40 virtual Int_t GetNLocalEquations() const {return fNLocalEquations;};
41 /// Set number of local equations
42 virtual void SetNLocalEquations(int value) {fNLocalEquations = value;};
43 virtual Int_t PrintGlobalParameters() const;
44 virtual Int_t SetIterations (double cutfac);
45 virtual Double_t GetParError(int iPar) const;
51 static const int fgkMaxGlobalPar = 1000; ///< Max. number of global parameters
52 static const int fgkMaxLocalPar = 20; ///< Max. number of local parameters
53 static const int fgkMaxGloCsts = 20; ///< Max. number of constraint equations
54 static const int fgkMaxGloPC = 1010; ///< fgkMaxGlobalPar+fgkMaxGloCsts
59 // Double_t GetParCorrelation(int i, int j);
61 int SpmInv(double v[][fgkMaxGloPC], double b[], int n);
62 int SpmInv(double v[][fgkMaxLocalPar], double b[], int n);
63 int SpAVAt(double v[][fgkMaxLocalPar], double a[][fgkMaxLocalPar], double w[][fgkMaxGlobalPar], int n, int m);
64 int SpAX(double a[][fgkMaxLocalPar], double x[], double y[], int n, int m);
65 double Chi2DoFLim(int n, int nd);
69 double fMatCGlo[fgkMaxGloPC][fgkMaxGloPC]; ///< Matrix C global
70 double fMatCLoc[fgkMaxLocalPar][fgkMaxLocalPar]; ///< Matrix C local
71 double fMatCGloLoc[fgkMaxGlobalPar][fgkMaxLocalPar]; ///< Rectangular matrix C g*l
72 double fMatCGloCorr[fgkMaxGlobalPar][fgkMaxGlobalPar];///< Correction of matrix C global
73 double fMatDerConstr[fgkMaxGloCsts][fgkMaxGlobalPar]; ///< Constrained derivatives
75 // Vectors and useful variables
77 double fDiagCGlo[fgkMaxGloPC]; ///< Initial diagonal elements of C global matrix
78 double fVecBGlo[fgkMaxGloPC]; ///< Vector B global (parameters)
79 double fVecBGloCorr[fgkMaxGlobalPar]; ///< Correction of vector B global
80 double fVecBLoc[fgkMaxLocalPar]; ///< Vector B local (parameters)
82 double fInitPar[fgkMaxGlobalPar]; ///< Initial global parameters
83 double fDeltaPar[fgkMaxGlobalPar]; ///< Variation of global parameters
84 double fSigmaPar[fgkMaxGlobalPar]; ///< Sigma of allowed variation of global parameter
86 double fLagMult[fgkMaxGloCsts]; ///< Lagrange multipliers of constrained equations
88 Bool_t fIsNonLinear[fgkMaxGlobalPar]; ///< Flag for non linear parameters
89 int fGlo2CGLRow[fgkMaxGlobalPar]; ///< Global parameter to row in "used" g*l matrix
90 int fCGLRow2Glo[fgkMaxGlobalPar]; ///< Row in "used" g*l matrix to global parameter
92 TArrayI fIndexLocEq; ///< Table of parameter indexes in local equation
93 TArrayD fDerivLocEq; ///< Table of local equation derivatives wrt. parameter
94 TArrayI fIndexAllEqs; ///< Index in all loc. eq. storage for iterations
95 TArrayD fDerivAllEqs; ///< derivative in all loc. eq. storage for iterations
96 TArrayI fLocEqPlace; ///< Loc. Eq. position in AllEqs storage
98 Int_t fNIndexLocEq; ///< Number of entries in fIndexLocEq
99 Int_t fNDerivLocEq; ///< Number of entries in fDerivLocEq
100 Int_t fNIndexAllEqs; ///< Number of entries in fIndexAllEqs
101 Int_t fNDerivAllEqs; ///< Number of entries in fDerivAllEqs
102 Int_t fNLocEqPlace; ///< Number of entries in fLocEqPlace
105 int fNLocalEquations; ///< Number of local equations
106 double fResCutInit; ///< Cut in residual for first iterartion
107 double fResCut; ///< Cut in residual for other iterartiona
109 double fChi2CutFactor; ///< Cut factor for chi2 cut to accept local fit
110 double fChi2CutRef; ///< Reference cut for chi2 cut to accept local fit
112 int fIter; ///< Current iteration
113 int fMaxIter; ///< Maximum number of iterations
114 int fNStdDev; ///< Number of standard deviations for chi2 cut
115 int fNGlobalConstraints; ///< Number of constraint equations
116 int fNLocalFits; ///< Number of local fits
117 int fNLocalFitsRejected; ///< Number of local fits rejected
118 int fNGlobalPar; ///< Number of global parameters
119 int fNLocalPar; ///< Number of local parameters
121 ClassDef(AliMillepede, 0) // Millepede Class