X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=STEER%2FAliAlignObjMatrix.cxx;h=6dfe9e81849478e80986f7219ce3940a133c1df1;hp=16bd3d86b667edbe1d1556326a2f53f34f5e9d85;hb=b760c02e201fe37341f97a186f57c999a88b363c;hpb=fe12e09c14250ca4a380175a67ffbd6bb844662e diff --git a/STEER/AliAlignObjMatrix.cxx b/STEER/AliAlignObjMatrix.cxx index 16bd3d86b66..6dfe9e81849 100644 --- a/STEER/AliAlignObjMatrix.cxx +++ b/STEER/AliAlignObjMatrix.cxx @@ -35,19 +35,8 @@ AliAlignObjMatrix::AliAlignObjMatrix() : } //_____________________________________________________________________________ -AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t voluid, Double_t x, Double_t y, Double_t z, Double_t psi, Double_t theta, Double_t phi) : - AliAlignObj(volpath, voluid), - fMatrix() -{ - // standard constructor with 3 translation + 3 rotation parameters - // - SetTranslation(x, y, z); - SetRotation(psi, theta, phi); -} - -//_____________________________________________________________________________ -AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, ELayerID layerId, Int_t volId, Double_t x, Double_t y, Double_t z, Double_t psi, Double_t theta, Double_t phi, Bool_t global) throw (const Char_t *) : - AliAlignObj(volpath,layerId,volId), +AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t volUId, Double_t x, Double_t y, Double_t z, Double_t psi, Double_t theta, Double_t phi, Bool_t global) throw (const Char_t *) : + AliAlignObj(volpath,volUId), fMatrix() { // standard constructor with 3 translation + 3 rotation parameters @@ -57,8 +46,7 @@ AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, ELayerID layerId, Int_ // constructor will fail (no object created) // if(global){ - SetTranslation(x, y, z); - SetRotation(psi, theta, phi); + SetPars(x, y, z, psi, theta, phi); }else{ if(!SetLocalPars(x,y,z,psi,theta,phi)) throw "Alignment object creation failed (TGeo instance needed)!\n"; } @@ -66,25 +54,23 @@ AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, ELayerID layerId, Int_ //_____________________________________________________________________________ -AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t volUID, TGeoMatrix& m) : - AliAlignObj(volpath,volUID), +AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t volUId, TGeoMatrix& m, Bool_t global) throw (const Char_t *) : + AliAlignObj(volpath,volUId), fMatrix() { // standard constructor with TGeoMatrix + // If the user explicitly sets the global variable to kFALSE then the + // parameters are interpreted as giving the local transformation. + // This requires to have a gGeoMenager active instance, otherwise the + // constructor will fail (no object created) // - SetTranslation(m); - SetRotation(m); -} -//_____________________________________________________________________________ -AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, ELayerID layerId, Int_t volId, TGeoMatrix& m) : - AliAlignObj(volpath,layerId,volId), - fMatrix() -{ - // standard constructor with TGeoMatrix - // - SetTranslation(m); - SetRotation(m); + if (global) { + SetMatrix(m); + } + else { + if (!SetLocalMatrix(m)) throw "Alignment object creation failed (TGeo instance needed)!\n"; + } } //_____________________________________________________________________________ @@ -98,8 +84,8 @@ AliAlignObjMatrix::AliAlignObjMatrix(const AliAlignObj& theAlignObj) : theAlignObj.GetTranslation(tr); SetTranslation(tr[0],tr[1],tr[2]); Double_t rot[3]; - theAlignObj.GetAngles(rot); - SetRotation(rot[0],rot[1],rot[2]); + if (theAlignObj.GetAngles(rot)) + SetRotation(rot[0],rot[1],rot[2]); } //_____________________________________________________________________________ @@ -113,8 +99,9 @@ AliAlignObjMatrix &AliAlignObjMatrix::operator =(const AliAlignObj& theAlignObj) theAlignObj.GetTranslation(tr); SetTranslation(tr[0],tr[1],tr[2]); Double_t rot[3]; - theAlignObj.GetAngles(rot); - SetRotation(rot[0],rot[1],rot[2]); + if (theAlignObj.GetAngles(rot)) + SetRotation(rot[0],rot[1],rot[2]); + return *this; } @@ -157,25 +144,6 @@ Bool_t AliAlignObjMatrix::SetRotation(const TGeoMatrix& m) return kTRUE; } -//_____________________________________________________________________________ -void AliAlignObjMatrix::SetMatrix(const TGeoMatrix& m) -{ - // Set rotation matrix and translation - // using TGeoMatrix - SetTranslation(m); - SetRotation(m); -} - -//_____________________________________________________________________________ -void AliAlignObjMatrix::SetPars(Double_t x, Double_t y, Double_t z, - Double_t psi, Double_t theta, Double_t phi) -{ - // Set rotation matrix and translation - // using 3 angles and 3 translations - SetTranslation(x,y,z); - SetRotation(psi,theta,phi); -} - //_____________________________________________________________________________ void AliAlignObjMatrix::GetTranslation(Double_t *tr) const { @@ -194,13 +162,6 @@ Bool_t AliAlignObjMatrix::GetAngles(Double_t *angles) const return MatrixToAngles(rot,angles); } -//_____________________________________________________________________________ -void AliAlignObjMatrix::GetPars(Double_t tr[], Double_t angles[]) const -{ - GetTranslation(tr); - GetAngles(angles); -} - //_____________________________________________________________________________ void AliAlignObjMatrix::GetMatrix(TGeoHMatrix& m) const {