AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONSurveyObj.h
Go to the documentation of this file.
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 */
5 
9 //
10 // Author: Javier Castillo
11 
12 #include <TObject.h>
13 
14 class TObjArray;
15 class TGeoCombiTrans;
16 class TVector3;
17 class TH2;
18 class TF2;
19 class TFitter;
20 class TArrayD;
21 
22 class AliSurveyPoint;
23 
24 class AliMUONSurveyObj:public TObject
25 {
26 
27  public:
29  virtual ~AliMUONSurveyObj();
30 
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);
34 
36  virtual Int_t AddStickerTargets(TString stBaseName, Int_t lTargetMax = 9) = 0;
38  virtual Int_t AddGButtonTargets(TString btBaseName, Int_t lTargetMax = 9) = 0;
39 
40  void AddStickerTarget(AliSurveyPoint *stPoint);
41  void AddGButtonTarget(AliSurveyPoint *btPoint);
42  void AddLButtonTarget(AliSurveyPoint *btPoint);
43  void AddLButtonTarget(TVector3 *btVector);
44 
45  Int_t GetNStickerTargets();
46  AliSurveyPoint *GetStickerTarget(Int_t stIndex);
47  Int_t GetNGButtonTargets();
48  AliSurveyPoint *GetGButtonTarget(Int_t btIndex);
49  Int_t GetNLButtonTargets();
50  AliSurveyPoint *GetLButtonTarget(Int_t btIndex);
52  void SetBaseTransformation(TGeoCombiTrans *baseTrf, Bool_t ownerBaseTrf = kFALSE) {
53  fBaseTrf = baseTrf;
54  fOwnerBaseTrf=ownerBaseTrf;
55  }
57  virtual void SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf = kFALSE) {
58  fLocalTrf=localTrf;
59  fOwnerLocalTrf=ownerLocalTrf;
60  }
61 
63  TGeoCombiTrans* GetLocalTrf() const {return fLocalTrf;}
65  TGeoCombiTrans* GetBaseTrf() const {return fBaseTrf;}
67  TGeoCombiTrans* GetAlignTrf()const {return fAlignTrf;}
68 
70  void SetUseCM(Bool_t bUseCM = kTRUE) {fUseCM = bUseCM;}
72  Bool_t GetUseCM() const {return fUseCM;}
73 
74  void SetPlane(TString pName, Double_t xMin=-2000., Double_t xMax=+2000., Double_t yMin=-2000., Double_t yMax=2000.);
75  void SetPlaneParameters(Double_t p0, Double_t p1, Double_t p2);
76 
77  void DrawSTargets();
78  Double_t FitPlane();
79 
81  TF2* GetPlane() const {return fPlane;}
82 
84  TFitter* GetFitter() const {return fFitter;}
85 
86  Int_t SurveyToAlign(TGeoCombiTrans &quadTransf, Double_t *parErr, Double_t psi=0., Double_t tht=0., Double_t epsi=0., Double_t etht=0.);
87  Int_t SurveyToAlign(Double_t psi=0., Double_t tht=0., Double_t epsi=0., Double_t etht=0.);
88  Double_t SurveyChi2(Double_t *par);
89 
90  Double_t EvalFunction(const TF2 *lFunction, Int_t iP1, Int_t iP2, const Char_t *lCoord);
91 
92  void CalculateTranslation(TF2 *xFunc, TF2 *yFunc, TF2 *zFunc, Int_t iP1, Int_t iP2, Double_t *lCenTemp);
93  // TGeoCombiTrans *CalculateTransformation(TF2 *xFunc, TF2 *yFunc, TF2 *zFunc, TF2 *pFunc, Int_t iP1, Int_t iP2);
94 
95  Double_t CalculateGlobalDiff(TGeoCombiTrans &lTransf, Int_t nPoints, TArrayD &lDiff);
96 
97  Int_t CalculateBestTransf(Int_t iP1, Int_t iP2, Double_t *lXYZ, Double_t *lPTP);
98 
99  void CalculateMeanTransf(Double_t *lXYZ, Double_t *lPTP);
100 
102  void SetXMin(Double_t xMin) {fXMin = xMin;}
104  void SetXMax(Double_t xMax) {fXMax = xMax;}
106  void SetYMin(Double_t yMin) {fYMin = yMin;}
108  void SetYMax(Double_t yMax) {fYMax = yMax;}
110  void SetZMin(Double_t zMin) {fZMin = zMin;}
112  void SetZMax(Double_t zMax) {fZMax = zMax;}
113 
114  virtual void PrintLocalTrf();
115  virtual void PrintAlignTrf();
116 
117  void FillSTHistograms(TString baseNameC, TH2 *hSTc, TString baseNameA="", TH2 *hSTa = 0);
118 
119  Double_t GetAlignResX();
120  Double_t GetAlignResY();
121 
122  AliSurveyPoint* ConvertPointUnits(AliSurveyPoint *stPoint, Float_t lFactor = 0.1);
123 
124  private:
126  AliMUONSurveyObj(const AliMUONSurveyObj& right);
129 
130  Double_t EqPlane(const Double_t *x, const Double_t *par) const {
132  return (-par[1]*x[0] +par[0]*x[1] -par[2]); // then psi=ATan(par[0]) and tht=ATan(par[0])
133  // return (-par[0]*x[0] -par[1]*x[1] -par[2]);
134  }
135 
139  TGeoCombiTrans *fLocalTrf;
140  TGeoCombiTrans *fAlignTrf;
141  TGeoCombiTrans *fBaseTrf;
142 
143  Bool_t fOwnerLocalTrf;
144  Bool_t fOwnerAlignTrf;
145  Bool_t fOwnerBaseTrf;
146 
147  Bool_t fUseCM;
148 
149  TF2 *fPlane;
150 
151  TFitter *fFitter;
152 
153  Double_t fXMin;
154  Double_t fXMax;
155  Double_t fYMin;
156  Double_t fYMax;
157  Double_t fZMin;
158  Double_t fZMax;
159 
160 
161 ClassDef(AliMUONSurveyObj, 0) //Class for alignment of muon spectrometer
162 };
163 
164 #endif
Double_t fYMin
yMin for functions fitting
virtual void PrintAlignTrf()
virtual Int_t AddGButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax=9)
Double_t SurveyChi2(Double_t *par)
void AddLButtonTarget(AliSurveyPoint *btPoint)
Bool_t fUseCM
Use centimeters, survey units are mm but aliroot uses cm.
Double_t fZMax
zMax for functions fitting
void FillSTHistograms(TString baseNameC, TH2 *hSTc, TString baseNameA="", TH2 *hSTa=0)
#define TObjArray
TGeoCombiTrans * fAlignTrf
Local alignment transformation.
Double_t CalculateGlobalDiff(TGeoCombiTrans &lTransf, Int_t nPoints, TArrayD &lDiff)
TF2 * GetPlane() const
Returns the plane (TF2) representing the object.
Double_t fXMax
xMax for functions fitting
TFitter * GetFitter() const
Returns the TFitter used for the best local to global transformation determination.
Double_t EqPlane(const Double_t *x, const Double_t *par) const
void CalculateTranslation(TF2 *xFunc, TF2 *yFunc, TF2 *zFunc, Int_t iP1, Int_t iP2, Double_t *lCenTemp)
virtual Int_t AddLButtonTargets(TObjArray *pArray, TString btBaseName, Int_t lTargetMax=9)
void AddStickerTarget(AliSurveyPoint *stPoint)
TObjArray * fLBTargets
Array of TVector3 or AliSurveyPoint of local position of Button Targets.
void SetYMin(Double_t yMin)
Set yMin for functions fitting.
Int_t CalculateBestTransf(Int_t iP1, Int_t iP2, Double_t *lXYZ, Double_t *lPTP)
TF2 * fPlane
TF2 for plane fitting.
TGeoCombiTrans * GetBaseTrf() const
Returns the base (global) transformation.
AliSurveyPoint * GetGButtonTarget(Int_t btIndex)
Bool_t fOwnerBaseTrf
Flag for owner of fBaseTrf.
void CalculateMeanTransf(Double_t *lXYZ, Double_t *lPTP)
Bool_t fOwnerLocalTrf
Flag for owner of fLocalTrf.
TGeoCombiTrans * fBaseTrf
Base Transformation.
TObjArray * fSTargets
Array of AliSurveyPoint of Sticker Targets.
void SetUseCM(Bool_t bUseCM=kTRUE)
Define wether to work in mm (survey units) or cm (alice units)
Double_t fYMax
yMax for functions fitting
void SetBaseTransformation(TGeoCombiTrans *baseTrf, Bool_t ownerBaseTrf=kFALSE)
Set transformation of geoemtrical element.
void SetPlane(TString pName, Double_t xMin=-2000., Double_t xMax=+2000., Double_t yMin=-2000., Double_t yMax=2000.)
virtual Int_t AddStickerTargets(TObjArray *pArray, TString stBaseName, Int_t lTargetMax=9)
void SetYMax(Double_t yMax)
Set yMax for functions fitting.
AliMUONSurveyObj & operator=(const AliMUONSurveyObj &right)
Not implemented.
TFitter * fFitter
Fitter for best local to global transformation.
void SetPlaneParameters(Double_t p0, Double_t p1, Double_t p2)
void SetZMin(Double_t zMin)
Set zMin for functions fitting.
AliSurveyPoint * GetLButtonTarget(Int_t btIndex)
Double_t EvalFunction(const TF2 *lFunction, Int_t iP1, Int_t iP2, const Char_t *lCoord)
void SetXMax(Double_t xMax)
Set xMax for functions fitting.
Double_t fZMin
zMin for functions fitting
virtual ~AliMUONSurveyObj()
Bool_t GetUseCM() const
Indicates if working in mm (survey units) or cm (alice units)
Int_t SurveyToAlign(TGeoCombiTrans &quadTransf, Double_t *parErr, Double_t psi=0., Double_t tht=0., Double_t epsi=0., Double_t etht=0.)
TGeoCombiTrans * GetAlignTrf() const
Returns the alignment transformation.
TObjArray * fGBTargets
Array of AliSurveyPoint of Button Targets.
void AddGButtonTarget(AliSurveyPoint *btPoint)
virtual void PrintLocalTrf()
virtual void SetLocalTransformation(TGeoCombiTrans *localTrf, Bool_t ownerLocalTrf=kFALSE)
Set local transformation of geometrical element.
Bool_t fOwnerAlignTrf
Flag for owner of fAlignTrf.
Double_t fXMin
xMin for functions fitting
void SetXMin(Double_t xMin)
Set xMin for functions fitting.
AliSurveyPoint * ConvertPointUnits(AliSurveyPoint *stPoint, Float_t lFactor=0.1)
AliSurveyPoint * GetStickerTarget(Int_t stIndex)
Base class for survey of muon spectrometer.
TGeoCombiTrans * fLocalTrf
Local transformation.
void SetZMax(Double_t zMax)
Set zMax for functions fitting.
TGeoCombiTrans * GetLocalTrf() const
Returns the local transformation.