]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomMatrix.h
New version from Boris and Enrico with improved ghost removal
[u/mrichter/AliRoot.git] / ITS / AliITSgeomMatrix.h
index 06afcc5ec657e688ecf7bb671ab3e8ac49ae91eb..b3777ff64cc28b1fc8d99698a6c00cef19fe15c0 100644 (file)
@@ -11,7 +11,7 @@
 // By Bjorn S. Nilsen
 ////////////////////////////////////////////////////////////////////////
 
-class AliITSgeomMatrix{
+class AliITSgeomMatrix : public TObject {
  public:
        AliITSgeomMatrix(); // Default constructor
        AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
@@ -24,14 +24,19 @@ class AliITSgeomMatrix{
        AliITSgeomMatrix(const AliITSgeomMatrix &source);
        void operator=(const AliITSgeomMatrix &sourse); // copy
        virtual ~AliITSgeomMatrix(){};
-       void print(ostream *os);
+       void PrintComment(ostream *os);
+       void Print(ostream *os);
        void PrintTitles(ostream *os);
-       void read(istream *is);
+       void Read(istream *is);
 
        void SetAngles(const Double_t rot[3]){// [radians]
               for(Int_t i=0;i<3;i++)frot[i] = rot[i];this->MatrixFromAngle();}
        void SetTranslation(const Double_t tran[3]){
-                           for(Int_t i=0;i<3;i++) ftran[i] = tran[i];}
+                           for(Int_t i=0;i<3;i++) ftran[i] = tran[i];
+                           fCylR   = TMath::Sqrt(ftran[0]*ftran[0]+
+                                                 ftran[1]*ftran[1]);
+                           fCylPhi = TMath::ATan2(ftran[1],ftran[0]);
+                           if(fCylPhi<0.0) fCylPhi += TMath::Pi();}
        void SetMatrix(Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
         for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
        void SetDetectorIndex(const Int_t idt) {fDetectorIndex = idt;}
@@ -41,6 +46,10 @@ class AliITSgeomMatrix{
                           for(Int_t i=0;i<3;i++)  rot[i] = frot[i];}
        void GetTranslation(Double_t tran[3]){
                            for(Int_t i=0;i<3;i++) tran[i] = ftran[i];}
+       void GetTranslationCylinderical(Double_t tran[3]){
+                           tran[0] = fCylR;
+                           tran[1] = fCylPhi;
+                           tran[2] = ftran[2];}
        void GetMatrix(Double_t matrix[3][3]){for(Int_t i=0;i<3;i++)
                         for(Int_t j=0;j<3;j++) matrix[i][j] = fm[i][j];}
        Int_t GetDetectorIndex() {return fDetectorIndex;}
@@ -72,10 +81,16 @@ class AliITSgeomMatrix{
  private: // Data members.
        Int_t    fDetectorIndex; // Detector type index (like fShapeIndex was)
        Int_t    fid[3];         // layer, ladder, detector numbers.
-       Double_t frot[3];        // vector of rotations about x,y,z [radians].
+       Double_t frot[3];        //! vector of rotations about x,y,z [radians].
        Double_t ftran[3];       // Translation vector of module x,y,z.
+       Double_t fCylR,fCylPhi;  //! Translation vector in Cylinderical coord.
        Double_t fm[3][3];       // Rotation matrix based on frot.
 
+       // Note, fCylR and fCylPhi are added as data members because it costs
+       // about a factor of 10 to compute them over looking them up. Since
+       // they are used in some tracking algorithms this can be a large cost
+       // in computing time. They are not written out but computed.
+
        ClassDef(AliITSgeomMatrix,1) // Matrix class used by AliITSgeom.
 };
 // Input and output function for standard C++ input/output.