]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possibility to specify local parameters added also to the constructor AliAlignObj...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 17 Mar 2006 16:07:54 +0000 (16:07 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 17 Mar 2006 16:07:54 +0000 (16:07 +0000)
STEER/AliAlignObjAngles.cxx
STEER/AliAlignObjAngles.h
STEER/AliAlignObjMatrix.cxx
STEER/AliAlignObjMatrix.h

index ece8da0782d17f19a27991f139e205df4bf5d3de..46f2d9fb85253afd32255e28a94d1bcd8c28363c 100644 (file)
@@ -46,14 +46,22 @@ AliAlignObjAngles::AliAlignObjAngles(const char* volpath, UShort_t voluid, Doubl
 }
 
 //_____________________________________________________________________________
-AliAlignObjAngles::AliAlignObjAngles(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) : AliAlignObj()
+AliAlignObjAngles::AliAlignObjAngles(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, Bool_t global) throw (const Char_t *) : AliAlignObj()
 {
   // 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)
+  // 
   fVolPath=volpath;
   SetVolUID(detId,volId);
-  fTranslation[0]=x; fTranslation[1]=y; fTranslation[2]=z;
-  fRotation[0]=psi; fRotation[1]=theta; fRotation[2]=phi;
+  if(global){
+    fTranslation[0]=x; fTranslation[1]=y; fTranslation[2]=z;
+    fRotation[0]=psi; fRotation[1]=theta; fRotation[2]=phi;
+  }else{
+    if(!SetLocalPars(x,y,z,psi,theta,phi)) throw "Alignment object creation failed (TGeo instance needed)!\n";
+  }
 }
 
 //_____________________________________________________________________________
index 45b21b31e2458da044467674dab4200bf0d0880d..48824ac52308f0b81e2608798ea38648af3ee23d 100644 (file)
@@ -20,7 +20,7 @@ class AliAlignObjAngles : public AliAlignObj{
  public:
   AliAlignObjAngles();
   AliAlignObjAngles(const char* volpath, UShort_t voluid, Double_t x, Double_t y, Double_t z, Double_t psi, Double_t theta, Double_t phi);
-  AliAlignObjAngles(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);
+  AliAlignObjAngles(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, Bool_t global=1) throw (const Char_t *);
   AliAlignObjAngles(const char* volpath, UShort_t voluid, TGeoMatrix& m);
   AliAlignObjAngles(const AliAlignObj& theAlignObj);
   AliAlignObjAngles& operator= (const AliAlignObj& theAlignObj);
index 3fc32c86a5c57c52a86ba9b31a3e5cb6ec4311f4..69386253ab315f520a18ff0b6242e9b10fe0cd79 100644 (file)
@@ -44,16 +44,25 @@ AliAlignObjMatrix::AliAlignObjMatrix(const char* volpath, UShort_t voluid, Doubl
 }
 
 //_____________________________________________________________________________
-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) : AliAlignObj()
+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, Bool_t global) throw (const Char_t *) : AliAlignObj()
 {
   // 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)
+  // 
   fVolPath=volpath;
   SetVolUID(detId,volId);
-  SetTranslation(x, y, z);
-  SetRotation(psi, theta, phi);
+  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()
 {
index 8e6acd3f7d088570646750b7d8837cd12ec0e811..c33f2738a4f53ba2f8269ea1bd0619d9a906d237 100644 (file)
@@ -16,7 +16,7 @@ class AliAlignObjMatrix : public AliAlignObj {
  public:
   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(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(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, Bool_t global=1) throw (const Char_t *);
   AliAlignObjMatrix(const char* volpath, UShort_t voluid, TGeoMatrix& m);
   AliAlignObjMatrix(const AliAlignObj& theAlignObj);
   AliAlignObjMatrix& operator= (const AliAlignObj& theAlignObj);