}
//_____________________________________________________________________________
-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)
+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)
{
// standard constructor with 3 translation + 3 rotation parameters
//
- fVolPath=volpath;
- fVolUID=voluid;
SetTranslation(x, y, z);
SetRotation(psi, theta, phi);
}
//_____________________________________________________________________________
-AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, ELayerID detId, Int_t volId, Double_t x, Double_t y, Double_t z, Double_t psi, Double_t theta, Double_t 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)
{
// standard constructor with 3 translation + 3 rotation parameters
+ // 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)
+ //
+ if(global){
+ SetTranslation(x, y, z);
+ SetRotation(psi, theta, phi);
+ }else{
+ if(!SetLocalPars(x,y,z,psi,theta,phi)) throw "Alignment object creation failed (TGeo instance needed)!\n";
+ }
+}
+
+
+//_____________________________________________________________________________
+AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t volUID, TGeoMatrix& m) : AliAlignObj(volpath,volUID)
+{
+ // standard constructor with TGeoMatrix
//
- fVolPath=volpath;
- SetVolUID(detId,volId);
- SetTranslation(x, y, z);
- SetRotation(psi, theta, phi);
+ SetTranslation(m);
+ SetRotation(m);
}
//_____________________________________________________________________________
-AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t voluid, TGeoMatrix& m)
+AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, ELayerID layerId, Int_t volId, TGeoMatrix& m) : AliAlignObj(volpath,layerId,volId)
{
// standard constructor with TGeoMatrix
//
- fVolPath=volpath;
- fVolUID=voluid;
SetTranslation(m);
SetRotation(m);
}
//_____________________________________________________________________________
-AliAlignObjMatrix::AliAlignObjMatrix(const AliAlignObjMatrix& theAlignObj) :
+AliAlignObjMatrix::AliAlignObjMatrix(const AliAlignObj& theAlignObj) :
AliAlignObj(theAlignObj)
{
//copy constructor
}
//_____________________________________________________________________________
-AliAlignObjMatrix &AliAlignObjMatrix::operator =(const AliAlignObjMatrix& theAlignObj)
+AliAlignObjMatrix &AliAlignObjMatrix::operator =(const AliAlignObj& theAlignObj)
{
// assignment operator
//
m.SetRotation(rot);
}
+//_____________________________________________________________________________
+AliAlignObj& AliAlignObjMatrix::Inverse() const
+{
+ // Return a temporary inverse of the alignment
+ // object. This means 'mis
+ static AliAlignObjMatrix a;
+ a = *this;
+
+ TGeoHMatrix m;
+ GetMatrix(m);
+ a.SetMatrix(m.Inverse());
+
+ return a;
+}