1 #ifndef ALIMUONSURVEYOBJ_H
2 #define ALIMUONSURVEYOBJ_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
7 /// \class AliMUONSurveyObj
8 /// \brief Base class for survey of muon spectrometer
10 // Author: Javier Castillo
24 class AliMUONSurveyObj:public TObject
29 virtual ~AliMUONSurveyObj();
31 virtual Int_t AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax = 9);
32 virtual Int_t AddGButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax = 9);
33 virtual Int_t AddLButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax = 9);
35 virtual Int_t AddStickerTargets(TString stBaseName, Int_t lTargetMax = 9) = 0;
36 virtual Int_t AddGButtonTargets(TString btBaseName, Int_t lTargetMax = 9) = 0;
38 void AddStickerTarget(AliSurveyPoint *stPoint);
39 void AddGButtonTarget(AliSurveyPoint *btPoint);
40 void AddLButtonTarget(AliSurveyPoint *btPoint);
41 void AddLButtonTarget(TVector3 *btVector);
43 Int_t GetNStickerTargets();
44 AliSurveyPoint *GetStickerTarget(Int_t stIndex);
45 Int_t GetNGButtonTargets();
46 AliSurveyPoint *GetGButtonTarget(Int_t btIndex);
47 Int_t GetNLButtonTargets();
48 AliSurveyPoint *GetLButtonTarget(Int_t btIndex);
49 /// Set transformation of geoemtrical element
50 void SetBaseTransformation(TGeoCombiTrans *baseTrf, Bool_t ownerBaseTrf = kFALSE) {
52 fOwnerBaseTrf=ownerBaseTrf;
54 /// Set local transformation of geometrical element
55 virtual void SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf = kFALSE) {
57 fOwnerLocalTrf=ownerLocalTrf;
60 TGeoCombiTrans* GetLocalTrf(){return fLocalTrf;}
61 TGeoCombiTrans* GetBaseTrf(){return fBaseTrf;}
62 TGeoCombiTrans* GetAlignTrf(){return fAlignTrf;}
64 void SetPlane(TString pName, Double_t xMin=-2000., Double_t xMax=+2000., Double_t yMin=-2000., Double_t yMax=2000.);
65 void SetPlaneParameters(Double_t p0, Double_t p1, Double_t p2);
70 TF2* GetPlane() {return fPlane;}
72 TFitter* GetFitter() {return fFitter;}
74 Int_t SurveyToAlign(TGeoCombiTrans &quadTransf, Double_t *parErr, Double_t psi=0., Double_t tht=0., Double_t epsi=0., Double_t etht=0.);
75 Int_t SurveyToAlign(Double_t psi=0., Double_t tht=0., Double_t epsi=0., Double_t etht=0.);
76 Double_t SurveyChi2(Double_t *par);
78 Double_t EvalFunction(TF2 *lFunction, Int_t iP1, Int_t iP2, const Char_t *lCoord);
80 void CalculateTranslation(TF2 *xFunc, TF2 *yFunc, TF2 *zFunc, Int_t iP1, Int_t iP2, Double_t *lCenTemp);
81 // TGeoCombiTrans *CalculateTransformation(TF2 *xFunc, TF2 *yFunc, TF2 *zFunc, TF2 *pFunc, Int_t iP1, Int_t iP2);
83 Double_t CalculateGlobalDiff(TGeoCombiTrans &lTransf, Int_t nPoints, TArrayD &lDiff);
85 Int_t CalculateBestTransf(Int_t iP1, Int_t iP2, Double_t *lXYZ, Double_t *lPTP);
87 void CalculateMeanTransf(Double_t *lXYZ, Double_t *lPTP);
89 void SetXMin(Double_t xMin) {fXMin = xMin;}
90 void SetXMax(Double_t xMax) {fXMax = xMax;}
91 void SetYMin(Double_t yMin) {fYMin = yMin;}
92 void SetYMax(Double_t yMax) {fYMax = yMax;}
93 void SetZMin(Double_t zMin) {fZMin = zMin;}
94 void SetZMax(Double_t zMax) {fZMax = zMax;}
96 virtual void PrintLocalTrf();
97 virtual void PrintAlignTrf();
99 void FillSTHistograms(TString baseNameC, TH2 *hSTc, TString baseNameA="", TH2 *hSTa = 0);
101 Double_t GetAlignResX();
102 Double_t GetAlignResY();
106 AliMUONSurveyObj(const AliMUONSurveyObj& right);
108 AliMUONSurveyObj& operator = (const AliMUONSurveyObj& right);
110 Double_t eqPlane(Double_t *x, Double_t *par){
111 return (-par[1]*x[0] +par[0]*x[1] -par[2]); // then psi=ATan(par[0]) and tht=ATan(par[0])
112 // return (-par[0]*x[0] -par[1]*x[1] -par[2]);
115 TObjArray *fSTargets; ///< Array of AliSurveyPoint of Sticker Targets
116 TObjArray *fGBTargets; ///< Array of AliSurveyPoint of Button Targets
117 TObjArray *fLBTargets; ///< Array of TVector3 or AliSurveyPoint of local position of Button Targets
118 TGeoCombiTrans *fLocalTrf; ///< Local transformation
119 TGeoCombiTrans *fAlignTrf; ///< Local alignment transformation
120 TGeoCombiTrans *fBaseTrf; ///< Base Transformation
122 Bool_t fOwnerLocalTrf; ///< Flag for owner of fLocalTrf
123 Bool_t fOwnerAlignTrf; ///< Flag for owner of fAlignTrf
124 Bool_t fOwnerBaseTrf; ///< Flag for owner of fBaseTrf
126 TF2 *fPlane; ///< TF2 for plane fitting
128 TFitter *fFitter; ///< Fitter for best local to global transformation
138 ClassDef(AliMUONSurveyObj, 0) //Class for alignment of muon spectrometer