]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSgeomMatrix.cxx
Example macro for the creation of tags (P.Christakoglou)
[u/mrichter/AliRoot.git] / ITS / AliITSgeomMatrix.cxx
index 3618e0a57dcf1d9a7a6e3f01c0d8eeaf2486576f..20a8251c45f1466ac46accc8393f265ed5a593ce 100644 (file)
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.15  2002/10/14 14:57:00  hristov
-Merging the VirtualMC branch to the main development branch (HEAD)
-
-Revision 1.13.6.1  2002/06/10 17:51:15  hristov
-Merged with v3-08-02
-
-Revision 1.14  2002/05/19 18:17:03  hristov
-Changes needed by ICC/IFC compiler (Intel)
-
-Revision 1.13  2002/01/28 21:49:19  nilsen
-Fixed a logical bug in functions GtoLPositionError, LtoGPositionError,
-GtoLPositionErrorTracking, and LtoGPositionErrorTracking.
-
-Revision 1.12  2001/10/12 22:07:20  nilsen
-A patch for C++ io manipulation functions so that they will work both
-with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
-other platforms.
-
-Revision 1.11  2001/09/04 14:54:31  hristov
-Const multidimentional arrays cause problems in the CINT dictionary on HP, const removed
-
-Revision 1.10  2001/08/24 21:06:37  nilsen
-Added more documentation, fixed up some coding violations, and some
-forward declorations.
-
-Revision 1.9  2001/03/23 15:21:56  nilsen
-Added Cylinderical Coordinates for use with Tracking. Fixed a but in the
-Streamer, It was not setting a value for frot[3] as it should when reading.
-
-Revision 1.8  2001/02/09 00:00:57  nilsen
-Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
-bugs in iostream based streamers used to read and write .det files. Fixed
-some detector sizes. Fixed bugs in some default-special constructors.
-
-Revision 1.7  2001/02/03 00:00:30  nilsen
-New version of AliITSgeom and related files. Now uses automatic streamers,
-set up for new formatted .det file which includes detector information.
-Additional smaller modifications are still to come.
-
-Revision 1.5  2000/10/02 16:32:35  barbera
-Forward declaration added
-
-Revision 1.1.2.6  2000/10/02 15:52:05  barbera
-Forward declaration added
-
-Revision 1.4  2000/09/07 17:30:45  nilsen
-fixed a bug in SixAnglesFromMatrix.
-
-Revision 1.3  2000/09/05 14:25:50  nilsen
-Made fixes for HP compiler. All function parameter default values placed
-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.
-
-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.
-
-*/
+/* $Id$ */
 
 ////////////////////////////////////////////////////////////////////////
 // This is the implementation file for AliITSgeomMatrix class. It 
@@ -128,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;
@@ -164,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
@@ -196,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]){
 ////////////////////////////////////////////////////////////////////////
@@ -307,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
@@ -376,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].
 ////////////////////////////////////////////////////////////////////////
@@ -392,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].
 ////////////////////////////////////////////////////////////////////////
@@ -407,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
@@ -423,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
@@ -440,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
@@ -458,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
@@ -476,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
@@ -507,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
@@ -538,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
@@ -566,11 +502,10 @@ void AliITSgeomMatrix::GtoLMomentumTracking(const Double_t g[3],
        l[2] = +l0[2];
     } // end if
     return;
-       return;
 }
 //----------------------------------------------------------------------
 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
@@ -601,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
@@ -634,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
@@ -666,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.
@@ -685,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..
 ////////////////////////////////////////////////////////////////////////
@@ -707,7 +642,7 @@ void AliITSgeomMatrix::Print(ostream *os){
     Int_t fmt;
 #endif
 #else
-#if defined __ICC
+#if defined __ICC || defined __ECC || defined __xlC__
     ios::fmtflags fmt;
 #else
     Int_t fmt;
@@ -757,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){
 ////////////////////////////////////////////////////////////////////////