]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAlignObj.h
New constructors added to AliAlignObj and the derived classes (R.Grosso)
[u/mrichter/AliRoot.git] / STEER / AliAlignObj.h
index 4789269358616861fb54942e3a8c2644a2c2d6cc..6810d5336c7e329feb8d8eff9f2ad848a0c280df 100644 (file)
 #include "TString.h"
 #include "TGeoMatrix.h"
 
+class AliTrackPoint;
+class AliTrackPointArray;
+
 class AliAlignObj : public TObject {
 
  public:
 
-  AliAlignObj();
-  AliAlignObj(const AliAlignObj& theAlignObj);
-  AliAlignObj& operator= (const AliAlignObj& theAlignObj);
-  virtual ~AliAlignObj();
   enum ELayerID{kInvalidLayer=0,
                kFirstLayer=1,
                kSPD1=1, kSPD2=2,
@@ -31,6 +30,13 @@ class AliAlignObj : public TObject {
                kRICH=18,
                kMUON=19,
                kLastLayer=20};
+  AliAlignObj();
+  AliAlignObj(const char* volpath, UShort_t voluid);
+  AliAlignObj(const char* volpath, ELayerID detId, Int_t modId);
+  AliAlignObj(const AliAlignObj& theAlignObj);
+  AliAlignObj& operator= (const AliAlignObj& theAlignObj);
+  AliAlignObj& operator*=(const AliAlignObj& theAlignObj);
+  virtual ~AliAlignObj();
 
   //Setters
   virtual void SetTranslation(Double_t x, Double_t y, Double_t z) = 0;
@@ -39,6 +45,8 @@ class AliAlignObj : public TObject {
   virtual Bool_t SetRotation(const TGeoMatrix& m) = 0;
   virtual void SetPars(Double_t x, Double_t y, Double_t z, Double_t psi,
                Double_t theta, Double_t phi) = 0;
+  virtual Bool_t SetLocalPars(Double_t x, Double_t y, Double_t z,
+                             Double_t psi, Double_t theta, Double_t phi);
   virtual void SetMatrix(const TGeoMatrix& m) = 0;
   void  SetVolPath(const TString& volpath) {fVolPath=volpath;}
   void  SetVolUID(UShort_t voluid) {fVolUID=voluid;}
@@ -53,27 +61,62 @@ class AliAlignObj : public TObject {
   virtual void GetPars(Double_t transl[], Double_t rot[]) const=0;
   virtual void GetMatrix(TGeoHMatrix& m) const=0;
 
+  Bool_t   IsSortable() const {return kTRUE;}
+  Int_t         GetLevel() const;
+  virtual Int_t Compare(const TObject* obj) const;
+
+  virtual AliAlignObj& Inverse() const=0;
+
+  void  Transform(AliTrackPoint &p) const;
+  void  Transform(AliTrackPointArray &array) const;
+
   void  Print(Option_t *) const;
 
   static Int_t       LayerSize(Int_t layer) { return fgLayerSize[layer]; }
   static const char* LayerName(Int_t layer) { return fgLayerName[layer]; }
 
   static UShort_t LayerToVolUID(ELayerID layerId, Int_t modId);
+  static UShort_t LayerToVolUID(Int_t    layerId, Int_t modId);
   static ELayerID VolUIDToLayer(UShort_t voluid, Int_t &modId);
   static ELayerID VolUIDToLayer(UShort_t voluid);
+
+  static const char* GetVolPath(UShort_t voluid) {
+    Int_t modId;
+    ELayerID layerId = VolUIDToLayer(voluid,modId);
+    return GetVolPath(layerId,modId);
+  }
+  static const char* GetVolPath(ELayerID layerId, Int_t modId);
+
+  Bool_t ApplyToGeometry();
+  static Bool_t   GetFromGeometry(const char *path, AliAlignObj &alobj);
+
+  static void         InitAlignObjFromGeometry();
+  static AliAlignObj* GetAlignObj(UShort_t voluid) {
+    Int_t modId;
+    ELayerID layerId = VolUIDToLayer(voluid,modId);
+    return GetAlignObj(layerId,modId);
+  }
+  static AliAlignObj* GetAlignObj(ELayerID layerId, Int_t modId);
+
  protected:
 
   void AnglesToMatrix(const Double_t *angles, Double_t *rot) const;
   Bool_t MatrixToAngles(const Double_t *rot, Double_t *angles) const;
 
+  static void InitVolPaths();
+
   //Volume identifiers
   TString  fVolPath; // Volume path inside TGeo geometry
   UShort_t fVolUID;  // Unique volume ID
 
   static Int_t       fgLayerSize[kLastLayer - kFirstLayer];
   static const char* fgLayerName[kLastLayer - kFirstLayer];
-  
-  ClassDef(AliAlignObj, 1)
+
+  static TString*    fgVolPath[kLastLayer - kFirstLayer];
+
+  static AliAlignObj** fgAlignObjs[kLastLayer - kFirstLayer];
+
+  ClassDef(AliAlignObj, 2)
 };
 
 #endif