]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Made fixes for HP compiler. All function parameter default values placed
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Sep 2000 14:25:50 +0000 (14:25 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 5 Sep 2000 14:25:50 +0000 (14:25 +0000)
in .h file. Fixed the usual problem with HP comilers and the "for(Int_t i..."
business. Replaced casting (Double_t [3][3]) to (Double_t (*)[3]) for HP.
Lastly removed all "const" before function parameters which were 2 dim. arrays,
because on HP root generates some strange code (?). Thanks Peter for the
changes.

ITS/AliITSgeom.cxx
ITS/AliITSgeom.h
ITS/AliITSgeomMatrix.cxx
ITS/AliITSgeomMatrix.h

index a4a28809c5ee6a9ac5ce76683a5e931c9e107f42..545e07efa01221e8c1446fbb3ff1e0617bfd8d04 100644 (file)
 
 /*
 $Log$
 
 /*
 $Log$
+Revision 1.9  2000/08/29 20:19:03  nilsen
+Removed dependancy on structure AliITSeomS and replaced it with class
+AliITSgeomMatrix. Added many new functions with many new arguments. Most
+in the form of in line functions for speed.
+
 Revision 1.4.4.6  2000/06/04 16:33:32  Nilsen
 A restructured AliITSgeom class. Now used AliITSgeomMatrix.
 
 Revision 1.4.4.6  2000/06/04 16:33:32  Nilsen
 A restructured AliITSgeom class. Now used AliITSgeomMatrix.
 
@@ -909,7 +914,7 @@ void AliITSgeom::GeantToTracking(AliITSgeom &source){
    return;
 }
 //______________________________________________________________________
    return;
 }
 //______________________________________________________________________
-Int_t AliITSgeom::GetNearest(const Double_t g[3],const Int_t lay=0){
+Int_t AliITSgeom::GetNearest(const Double_t g[3],const Int_t lay){
 ////////////////////////////////////////////////////////////////////////
 //      Finds the Detector (Module) that is nearest the point g [cm] in
 // ALICE Global coordinates. If layer !=0 then the search is restricted
 ////////////////////////////////////////////////////////////////////////
 //      Finds the Detector (Module) that is nearest the point g [cm] in
 // ALICE Global coordinates. If layer !=0 then the search is restricted
@@ -929,7 +934,7 @@ Int_t AliITSgeom::GetNearest(const Double_t g[3],const Int_t lay=0){
      return in;
 }
 //______________________________________________________________________
      return in;
 }
 //______________________________________________________________________
-void AliITSgeom::GetNearest27(const Double_t g[3],Int_t n[27],const Int_t lay=0){
+void AliITSgeom::GetNearest27(const Double_t g[3],Int_t n[27],const Int_t lay){
 ////////////////////////////////////////////////////////////////////////
 //      Finds 27 Detectors (Modules) that are nearest the point g [cm] in
 // ALICE Global coordinates. If layer !=0 then the search is restricted
 ////////////////////////////////////////////////////////////////////////
 //      Finds 27 Detectors (Modules) that are nearest the point g [cm] in
 // ALICE Global coordinates. If layer !=0 then the search is restricted
index 79a572c9be9162535c690de8853ed4a904bed1c8..7cd4bd638b4f1c8d5f8e4109967799b3bf718449 100644 (file)
@@ -268,9 +268,9 @@ class AliITSgeom : public TObject {
     // module index number. The global and local coordinate are
     // given in two floating point arrays g[3], and l[3].
     void GtoL(const Int_t index,const Float_t *g,Float_t *l){
     // module index number. The global and local coordinate are
     // given in two floating point arrays g[3], and l[3].
     void GtoL(const Int_t index,const Float_t *g,Float_t *l){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          fGm[index]->GtoLPosition(dg,dl);
          fGm[index]->GtoLPosition(dg,dl);
-         for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+         for(i=0;i<3;i++) l[i] =dl[i];}
     //     Transforms from the ALICE Global coordinate system
     // to the detector local coordinate system for the detector
     // defined by the layer, ladder, and detector numbers. The
     //     Transforms from the ALICE Global coordinate system
     // to the detector local coordinate system for the detector
     // defined by the layer, ladder, and detector numbers. The
@@ -291,9 +291,9 @@ class AliITSgeom : public TObject {
     // module index number. The global and local coordinate are
     // given in two Double point arrays g[3], and l[3].
     void GtoL(const Int_t index,const Double_t *g,Double_t *l){
     // module index number. The global and local coordinate are
     // given in two Double point arrays g[3], and l[3].
     void GtoL(const Int_t index,const Double_t *g,Double_t *l){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          fGm[index]->GtoLPosition(dg,dl);
          fGm[index]->GtoLPosition(dg,dl);
-         for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+         for(i=0;i<3;i++) l[i] =dl[i];}
 //
     //     Transforms from the ALICE Global coordinate system
     // to the detector local coordinate system (used for ITS tracking)
 //
     //     Transforms from the ALICE Global coordinate system
     // to the detector local coordinate system (used for ITS tracking)
@@ -330,9 +330,9 @@ class AliITSgeom : public TObject {
     // for the detector module index number. The global and local
     // coordinate are given in two float point arrays g[3], and l[3].
     void GtoLMomentum(const Int_t index,const Float_t *g,Float_t *l){
     // for the detector module index number. The global and local
     // coordinate are given in two float point arrays g[3], and l[3].
     void GtoLMomentum(const Int_t index,const Float_t *g,Float_t *l){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          fGm[index]->GtoLMomentum(dg,dl);
          fGm[index]->GtoLMomentum(dg,dl);
-         for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+         for(i=0;i<3;i++) l[i] =dl[i];}
     //     Transforms of momentum types of quantities from the ALICE
     // Global coordinate system to the detector local coordinate system
     // for the detector layer ladder and detector numbers. The global
     //     Transforms of momentum types of quantities from the ALICE
     // Global coordinate system to the detector local coordinate system
     // for the detector layer ladder and detector numbers. The global
@@ -346,9 +346,9 @@ class AliITSgeom : public TObject {
     // for the detector module index number. The global and local
     // coordinate are given in two Double point arrays g[3], and l[3].
     void GtoLMomentum(const Int_t index,const Double_t *g,Double_t *l){
     // for the detector module index number. The global and local
     // coordinate are given in two Double point arrays g[3], and l[3].
     void GtoLMomentum(const Int_t index,const Double_t *g,Double_t *l){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dg[i] = g[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          fGm[index]->GtoLMomentum(dg,dl);
          fGm[index]->GtoLMomentum(dg,dl);
-         for(Int_t i=0;i<3;i++) l[i] =dl[i];}
+         for(i=0;i<3;i++) l[i] =dl[i];}
 //
     //     Transforms of momentum types of quantities from the ALICE
     // Global coordinate system to the detector local coordinate system
 //
     //     Transforms of momentum types of quantities from the ALICE
     // Global coordinate system to the detector local coordinate system
@@ -394,9 +394,9 @@ class AliITSgeom : public TObject {
     // module index number. The global and local coordinate are
     // given in two floating point arrays g[3], and l[3].
     void LtoG(const Int_t index,const Float_t *l,Float_t *g){
     // module index number. The global and local coordinate are
     // given in two floating point arrays g[3], and l[3].
     void LtoG(const Int_t index,const Float_t *l,Float_t *g){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dl[i] = l[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
          fGm[index]->LtoGPosition(dl,dg);
          fGm[index]->LtoGPosition(dl,dg);
-         for(Int_t i=0;i<3;i++) g[i] =dg[i];}
+         for(i=0;i<3;i++) g[i] =dg[i];}
     //     Transforms from the detector local coordinate system
     // to the ALICE Global coordinate system for the detector
     // defined by the layer, ladder, and detector numbers. The
     //     Transforms from the detector local coordinate system
     // to the ALICE Global coordinate system for the detector
     // defined by the layer, ladder, and detector numbers. The
@@ -417,9 +417,9 @@ class AliITSgeom : public TObject {
     // module index number. The global and local coordinate are
     // given in two Double point arrays g[3], and l[3].
     void LtoG(const Int_t index,const Double_t *l,Double_t *g){
     // module index number. The global and local coordinate are
     // given in two Double point arrays g[3], and l[3].
     void LtoG(const Int_t index,const Double_t *l,Double_t *g){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dl[i] = l[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
          fGm[index]->LtoGPosition(dl,dg);
          fGm[index]->LtoGPosition(dl,dg);
-         for(Int_t i=0;i<3;i++) g[i] =dg[i];}
+         for(i=0;i<3;i++) g[i] =dg[i];}
 //
     //     Transforms from the detector local coordinate system (used
     // for ITS tracking) to the ALICE Global coordinate system 
 //
     //     Transforms from the detector local coordinate system (used
     // for ITS tracking) to the ALICE Global coordinate system 
@@ -456,9 +456,9 @@ class AliITSgeom : public TObject {
     // for the detector module index number. The global and local
     // coordinate are given in two float point arrays g[3], and l[3].
     void LtoGMomentum(const Int_t index,const Float_t *l,Float_t *g){
     // for the detector module index number. The global and local
     // coordinate are given in two float point arrays g[3], and l[3].
     void LtoGMomentum(const Int_t index,const Float_t *l,Float_t *g){
-         Double_t dg[3],dl[3];for(Int_t i=0;i<3;i++) dl[i] = l[i];
+         Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
          fGm[index]->LtoGMomentum(dl,dg);
          fGm[index]->LtoGMomentum(dl,dg);
-         for(Int_t i=0;i<3;i++) g[i] =dg[i];}
+         for(i=0;i<3;i++) g[i] =dg[i];}
     //     Transforms of momentum types of quantities from the detector
     // local coordinate system to the ALICE Global coordinate system
     // for the detector layer ladder and detector numbers. The global
     //     Transforms of momentum types of quantities from the detector
     // local coordinate system to the ALICE Global coordinate system
     // for the detector layer ladder and detector numbers. The global
@@ -573,7 +573,7 @@ class AliITSgeom : public TObject {
     // system. The specific detector is determined by the module index
     // number.
     void GtoLErrorMatrix(const Int_t index,const Double_t **g,Double_t **l){
     // system. The specific detector is determined by the module index
     // number.
     void GtoLErrorMatrix(const Int_t index,const Double_t **g,Double_t **l){
-         fGm[index]->GtoLPositionError((Double_t[3][3])g,(Double_t[3][3])l);}
+         fGm[index]->GtoLPositionError((Double_t (*)[3])g,(Double_t (*)[3])l);}
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // the ALICE Global coordinate system to a detector local coordinate
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // the ALICE Global coordinate system to a detector local coordinate
@@ -582,16 +582,16 @@ class AliITSgeom : public TObject {
     void GtoLErrorMatrixTracking(const Int_t index,const Double_t **g,
                                 Double_t **l){
        if(IsGeantToTracking()) fGm[index]->GtoLPositionError((
     void GtoLErrorMatrixTracking(const Int_t index,const Double_t **g,
                                 Double_t **l){
        if(IsGeantToTracking()) fGm[index]->GtoLPositionError((
-           Double_t[3][3])g,(Double_t[3][3])l);
+           Double_t (*)[3])g,(Double_t (*)[3])l);
        else fGm[index]->GtoLPositionErrorTracking(
        else fGm[index]->GtoLPositionErrorTracking(
-            (Double_t[3][3])g,(Double_t[3][3])l);}
+            (Double_t (*)[3])g,(Double_t (*)[3])l);}
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // the detector local coordinate system to a ALICE Global coordinate
     // system. The specific detector is determined by the module index
     // number.
     void LtoGErrorMatrix(const Int_t index,const Double_t **l,Double_t **g){
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // the detector local coordinate system to a ALICE Global coordinate
     // system. The specific detector is determined by the module index
     // number.
     void LtoGErrorMatrix(const Int_t index,const Double_t **l,Double_t **g){
-         fGm[index]->LtoGPositionError((Double_t[3][3])l,(Double_t[3][3])g);}
+         fGm[index]->LtoGPositionError((Double_t (*)[3])l,(Double_t (*)[3])g);}
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // the detector local coordinate system (used by ITS tracking) to a
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // the detector local coordinate system (used by ITS tracking) to a
@@ -600,9 +600,9 @@ class AliITSgeom : public TObject {
     void LtoGErrorMatrixTracking(const Int_t index,const Double_t **l,
                                 Double_t **g){
          if(IsGeantToTracking()) fGm[index]->LtoGPositionError((
     void LtoGErrorMatrixTracking(const Int_t index,const Double_t **l,
                                 Double_t **g){
          if(IsGeantToTracking()) fGm[index]->LtoGPositionError((
-           Double_t[3][3])g,(Double_t[3][3])l);
-       else fGm[index]->LtoGPositionErrorTracking((Double_t[3][3])l,
-                                              (Double_t[3][3])g);}
+           Double_t (*)[3])g,(Double_t (*)[3])l);
+       else fGm[index]->LtoGPositionErrorTracking((Double_t (*)[3])l,
+                                              (Double_t (*)[3])g);}
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // one detector local coordinate system to another detector local
 //
     //     Transforms a matrix, like an Uncertainty or Error matrix from
     // one detector local coordinate system to another detector local
index bf6fe3afafecd925e859bc883cf6ab24108ca9ca..3b74fd46792283692f57578f5e48c0ea4d834f17 100644 (file)
 
 /*
 $Log$
 
 /*
 $Log$
+Revision 1.2  2000/08/29 20:16:50  nilsen
+New class for ITS coordiante transformations used by AliITSgeom nearly
+exclusively.
+
 Revision 1.1.2.1  2000/06/04 16:32:31  Nilsen
 A new class to hold the matrix information needed by AliITSgeom.
 
 Revision 1.1.2.1  2000/06/04 16:32:31  Nilsen
 A new class to hold the matrix information needed by AliITSgeom.
 
@@ -117,7 +121,7 @@ AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
 }
 //----------------------------------------------------------------------
 AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
 }
 //----------------------------------------------------------------------
 AliITSgeomMatrix::AliITSgeomMatrix(const Int_t idt, const Int_t id[3],
-                                   const Double_t matrix[3][3],
+                                   Double_t matrix[3][3],
                                    const Double_t tran[3]){
 ////////////////////////////////////////////////////////////////////////
 // This is a constructor for the AliITSgeomMatrix class. The rotation matrix
                                    const Double_t tran[3]){
 ////////////////////////////////////////////////////////////////////////
 // This is a constructor for the AliITSgeomMatrix class. The rotation matrix
@@ -353,7 +357,7 @@ void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]){
        return;
 }
 //----------------------------------------------------------------------
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionError(const Double_t g[3][3],
+void AliITSgeomMatrix::GtoLPositionError(Double_t g[3][3],
                                                Double_t l[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Global coordinates it is rotated so that 
                                                Double_t l[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Global coordinates it is rotated so that 
@@ -368,7 +372,7 @@ void AliITSgeomMatrix::GtoLPositionError(const Double_t g[3][3],
        return;
 }
 //----------------------------------------------------------------------
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionError(const Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionError(Double_t l[3][3],
                                                Double_t g[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Local coordinates it is rotated so that 
                                                Double_t g[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Local coordinates it is rotated so that 
@@ -508,7 +512,7 @@ void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
        return;
 }
 //----------------------------------------------------------------------
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionErrorTracking(const Double_t g[3][3],
+void AliITSgeomMatrix::GtoLPositionErrorTracking(Double_t g[3][3],
                                                 Double_t l[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
                                                 Double_t l[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
@@ -538,7 +542,7 @@ void AliITSgeomMatrix::GtoLPositionErrorTracking(const Double_t g[3][3],
        return;
 }
 //----------------------------------------------------------------------
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionErrorTracking(const Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionErrorTracking(Double_t l[3][3],
                                                 Double_t g[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
                                                 Double_t g[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
index 7043684e5f10dc0fe638b0b94d463e0e950df650..06afcc5ec657e688ecf7bb671ab3e8ac49ae91eb 100644 (file)
@@ -17,7 +17,7 @@ class AliITSgeomMatrix{
        AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
                         const Double_t rot[3],const Double_t tran[3]);
         AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
        AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
                         const Double_t rot[3],const Double_t tran[3]);
         AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
-                        const Double_t matrix[3][3],const Double_t tran[3]);
+                        Double_t matrix[3][3],const Double_t tran[3]);
         AliITSgeomMatrix(const Double_t rotd[6]/*degrees Geant angles*/,
                          const Int_t idt,const Int_t id[3],
                          const Double_t tran[3]);
         AliITSgeomMatrix(const Double_t rotd[6]/*degrees Geant angles*/,
                          const Int_t idt,const Int_t id[3],
                          const Double_t tran[3]);
@@ -32,7 +32,7 @@ class AliITSgeomMatrix{
               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++)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];}
-       void SetMatrix(const Double_t matrix[3][3]){ for(Int_t i=0;i<3;i++)
+       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;}
        void SetIndex(const Int_t id[3]){
         for(Int_t j=0;j<3;j++) fm[i][j]=matrix[i][j];this->AngleFromMatrix();}
        void SetDetectorIndex(const Int_t idt) {fDetectorIndex = idt;}
        void SetIndex(const Int_t id[3]){
@@ -52,16 +52,16 @@ class AliITSgeomMatrix{
        void LtoGPosition(const Double_t l[3],Double_t g[3]);
        void GtoLMomentum(const Double_t g[3],Double_t l[3]);
        void LtoGMomentum(const Double_t l[3],Double_t g[3]);
        void LtoGPosition(const Double_t l[3],Double_t g[3]);
        void GtoLMomentum(const Double_t g[3],Double_t l[3]);
        void LtoGMomentum(const Double_t l[3],Double_t g[3]);
-       void GtoLPositionError(const Double_t g[3][3],Double_t l[3][3]);
-       void LtoGPositionError(const Double_t l[3][3],Double_t g[3][3]);
+       void GtoLPositionError(Double_t g[3][3],Double_t l[3][3]);
+       void LtoGPositionError(Double_t l[3][3],Double_t g[3][3]);
        // Tracking Related Routines
        void GtoLPositionTracking(const Double_t g[3],Double_t l[3]);
        void LtoGPositionTracking(const Double_t l[3],Double_t g[3]);
        void GtoLMomentumTracking(const Double_t g[3],Double_t l[3]);
        void LtoGMomentumTracking(const Double_t l[3],Double_t g[3]);
        // Tracking Related Routines
        void GtoLPositionTracking(const Double_t g[3],Double_t l[3]);
        void LtoGPositionTracking(const Double_t l[3],Double_t g[3]);
        void GtoLMomentumTracking(const Double_t g[3],Double_t l[3]);
        void LtoGMomentumTracking(const Double_t l[3],Double_t g[3]);
-       void GtoLPositionErrorTracking(const Double_t g[3][3],
+       void GtoLPositionErrorTracking(Double_t g[3][3],
                                       Double_t l[3][3]);
                                       Double_t l[3][3]);
-       void LtoGPositionErrorTracking(const Double_t l[3][3],
+       void LtoGPositionErrorTracking(Double_t l[3][3],
                                       Double_t g[3][3]);
        Double_t Distance2(const Double_t t[3]){Double_t d=0.0,q;
                  for(Int_t i=0;i<3;i++){q = t[i]-ftran[i]; d += q*q;}
                                       Double_t g[3][3]);
        Double_t Distance2(const Double_t t[3]){Double_t d=0.0,q;
                  for(Int_t i=0;i<3;i++){q = t[i]-ftran[i]; d += q*q;}