]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomMatrix.cxx
Coding rule violations corrected.
[u/mrichter/AliRoot.git] / ITS / AliITSgeomMatrix.cxx
index cc9c43ef2647bdde1082721b1f2ec62f9be471df..20a8251c45f1466ac46accc8393f265ed5a593ce 100644 (file)
@@ -63,9 +63,10 @@ AliITSgeomMatrix::AliITSgeomMatrix(){
     fm[0][0] = fm[1][1] = fm[2][2] = 1.0;
 }
 //----------------------------------------------------------------------
-AliITSgeomMatrix::AliITSgeomMatrix(const AliITSgeomMatrix &sourse){
+AliITSgeomMatrix::AliITSgeomMatrix(const AliITSgeomMatrix &sourse) : 
+    TObject(sourse){
 ////////////////////////////////////////////////////////////////////////
-// The standard copy constructor. This make a full / proper copy of
+// The standard Copy constructor. This make a full / proper copy of
 // this class.
 ////////////////////////////////////////////////////////////////////////
        Int_t i,j;
@@ -99,7 +100,7 @@ void AliITSgeomMatrix::operator=(const AliITSgeomMatrix &sourse){
        }// end for i
 }
 //----------------------------------------------------------------------
-AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
+AliITSgeomMatrix::AliITSgeomMatrix(Int_t idt,const Int_t id[3],
                   const Double_t rot[3],const Double_t tran[3]){
 ////////////////////////////////////////////////////////////////////////
 // This is a constructor for the AliITSgeomMatrix class. The matrix is
@@ -131,7 +132,7 @@ AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
     this->MatrixFromAngle();
 }
 //----------------------------------------------------------------------
-AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
+AliITSgeomMatrix::AliITSgeomMatrix(Int_t idt, const Int_t id[3],
                                    Double_t matrix[3][3],
                                    const Double_t tran[3]){
 ////////////////////////////////////////////////////////////////////////
@@ -242,7 +243,7 @@ void AliITSgeomMatrix::MatrixFromSixAngles(const Double_t *ang){
 }
 //----------------------------------------------------------------------
 AliITSgeomMatrix::AliITSgeomMatrix(const Double_t rotd[6]/*degrees*/,
-                                   const Int_t idt,const Int_t id[3],
+                                   Int_t idt,const Int_t id[3],
                                   const Double_t tran[3]){
 ////////////////////////////////////////////////////////////////////////
 // This is a constructor for the AliITSgeomMatrix class. The matrix is
@@ -311,7 +312,7 @@ void AliITSgeomMatrix::MatrixFromAngle(){
 
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPosition(const Double_t g0[3],Double_t l[3]){
+void AliITSgeomMatrix::GtoLPosition(const Double_t g0[3],Double_t l[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // Returns the local coordinates given the global coordinates [cm].
 ////////////////////////////////////////////////////////////////////////
@@ -327,7 +328,7 @@ void AliITSgeomMatrix::GtoLPosition(const Double_t g0[3],Double_t l[3]){
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPosition(const Double_t l[3],Double_t g[3]){
+void AliITSgeomMatrix::LtoGPosition(const Double_t l[3],Double_t g[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // Returns the global coordinates given the local coordinates [cm].
 ////////////////////////////////////////////////////////////////////////
@@ -342,7 +343,7 @@ void AliITSgeomMatrix::LtoGPosition(const Double_t l[3],Double_t g[3]){
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLMomentum(const Double_t g[3],Double_t l[3]){
+void AliITSgeomMatrix::GtoLMomentum(const Double_t g[3],Double_t l[3]) const{
 ////////////////////////////////////////////////////////////////////////
 // Returns the local coordinates of the momentum given the global
 // coordinates of the momentum. It transforms just like GtoLPosition
@@ -358,7 +359,7 @@ void AliITSgeomMatrix::GtoLMomentum(const Double_t g[3],Double_t l[3]){
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]){
+void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // Returns the Global coordinates of the momentum given the local
 // coordinates of the momentum. It transforms just like LtoGPosition
@@ -375,7 +376,7 @@ void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]){
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::GtoLPositionError(      Double_t g[3][3],
-                                               Double_t l[3][3]){
+                                               Double_t l[3][3]) const {
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Global coordinates it is rotated so that 
 // its representation in local coordinates can be returned. There is no
@@ -393,7 +394,7 @@ void AliITSgeomMatrix::GtoLPositionError(      Double_t g[3][3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::LtoGPositionError(      Double_t l[3][3],
-                                               Double_t g[3][3]){
+                                               Double_t g[3][3]) const {
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Local coordinates it is rotated so that 
 // its representation in global coordinates can be returned. There is no
@@ -411,7 +412,7 @@ void AliITSgeomMatrix::LtoGPositionError(      Double_t l[3][3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::GtoLPositionTracking(const Double_t g0[3],
-                                           Double_t l[3]){
+                                           Double_t l[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
 // This coordinate system is only relevant when the geometry represents
@@ -442,7 +443,7 @@ void AliITSgeomMatrix::GtoLPositionTracking(const Double_t g0[3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::LtoGPositionTracking(const Double_t l[3],
-                                           Double_t g[3]){
+                                           Double_t g[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
 // This coordinate system is only relevant when the geometry represents
@@ -473,7 +474,7 @@ void AliITSgeomMatrix::LtoGPositionTracking(const Double_t l[3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::GtoLMomentumTracking(const Double_t g[3],
-                                           Double_t l[3]){
+                                           Double_t l[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
 // This coordinate system is only relevant when the geometry represents
@@ -504,7 +505,7 @@ void AliITSgeomMatrix::GtoLMomentumTracking(const Double_t g[3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
-                                           Double_t g[3]){
+                                           Double_t g[3]) const {
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
 // This coordinate system is only relevant when the geometry represents
@@ -535,7 +536,7 @@ void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::GtoLPositionErrorTracking(     Double_t g[3][3],
-                                                Double_t l[3][3]){
+                                                Double_t l[3][3]) const {
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
 // This coordinate system is only relevant when the geometry represents
@@ -568,7 +569,7 @@ void AliITSgeomMatrix::GtoLPositionErrorTracking(     Double_t g[3][3],
 }
 //----------------------------------------------------------------------
 void AliITSgeomMatrix::LtoGPositionErrorTracking( Double_t l[3][3],
-                                                Double_t g[3][3]){
+                                                Double_t g[3][3]) const {
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
 // This coordinate system is only relevant when the geometry represents
@@ -600,7 +601,7 @@ void AliITSgeomMatrix::LtoGPositionErrorTracking( Double_t l[3][3],
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::PrintTitles(ostream *os){
+void AliITSgeomMatrix::PrintTitles(ostream *os) const {
 ////////////////////////////////////////////////////////////////////////
 // Standard output format for this class but it includes variable
 // names and formatting that makes it easer to read.
@@ -619,7 +620,7 @@ void AliITSgeomMatrix::PrintTitles(ostream *os){
     return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::PrintComment(ostream *os){
+void AliITSgeomMatrix::PrintComment(ostream *os) const {
 ////////////////////////////////////////////////////////////////////////
 //  output format used by Print..
 ////////////////////////////////////////////////////////////////////////
@@ -641,7 +642,7 @@ void AliITSgeomMatrix::Print(ostream *os){
     Int_t fmt;
 #endif
 #else
-#if defined __ICC || defined __ECC
+#if defined __ICC || defined __ECC || defined __xlC__
     ios::fmtflags fmt;
 #else
     Int_t fmt;
@@ -691,6 +692,15 @@ void AliITSgeomMatrix::Streamer(TBuffer &R__b){
       AliITSgeomMatrix::Class()->WriteBuffer(R__b, this);
    }
 }
+//______________________________________________________________________
+void AliITSgeomMatrix::SetTranslation(const Double_t tran[3]){
+  // Sets the translation vector and computes fCylR and fCylPhi.
+  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();
+}
+
 //----------------------------------------------------------------------
 ostream &operator<<(ostream &os,AliITSgeomMatrix &p){
 ////////////////////////////////////////////////////////////////////////