]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Added more documentation, fixed up some coding violations, and some
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Aug 2001 21:06:37 +0000 (21:06 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 24 Aug 2001 21:06:37 +0000 (21:06 +0000)
forward declorations.

ITS/AliITSgeom.cxx
ITS/AliITSgeom.h
ITS/AliITSgeomMatrix.cxx
ITS/AliITSgeomMatrix.h
ITS/AliITSgeomSDD.cxx
ITS/AliITSgeomSDD.h
ITS/AliITSgeomSPD.cxx
ITS/AliITSgeomSPD.h
ITS/AliITSgeomSSD.cxx
ITS/AliITSgeomSSD.h

index 5f725cd02c04f1b1e02d32487066232412e02fc9..07c10204fbdda7351f26f62458d364a27c8f2139 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.17  2001/07/27 08:06:48  hristov
+Use global gRandom generator (M.Ivanov)
+
 Revision 1.16  2001/02/08 23:57:00  nilsen
 Fixed up some informational printouts.
 
@@ -35,14 +38,14 @@ Forward declaration added
 
 Revision 1.10  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..."
+in .h file. Fixed the usual problem with HP compilers 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.9  2000/08/29 20:19:03  nilsen
-Removed dependancy on structure AliITSeomS and replaced it with class
+Removed dependency 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.
 
@@ -189,26 +192,21 @@ pixel coordinate system.
 #include <ctype.h>
 
 #include <TSystem.h>
-#include <TVector.h>
-#include <TObject.h>
 #include <TRandom.h>
 
 #include "AliITSgeom.h"
-//#include "AliITSgeomMatrix.h" // include in AliITSgeom.h
 #include "AliITSgeomSPD.h"
 #include "AliITSgeomSDD.h"
 #include "AliITSgeomSSD.h"
 
 ClassImp(AliITSgeom)
 
-//_____________________________________________________________________
+//______________________________________________________________________
 AliITSgeom::AliITSgeom(){
-////////////////////////////////////////////////////////////////////////
-//     The default constructor for the AliITSgeom class. It, by default,
-// sets fNlayers to zero and zeros all pointers.
-////////////////////////////////////////////////////////////////////////
-    // Default constructor.
-    // Do not allocate anything zero everything
+    //     The default constructor for the AliITSgeom class. It, by default,
+    // sets fNlayers to zero and zeros all pointers.
+    // Do not allocate anything zero everything.
+
     fTrans   = 0; // standard GEANT global/local coordinate system.
     fNlayers = 0;
     fNlad    = 0;
@@ -218,21 +216,25 @@ AliITSgeom::AliITSgeom(){
     strcpy(fVersion,"test");
     return;
 }
-//_____________________________________________________________________
+//______________________________________________________________________
 AliITSgeom::AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets,
                       Int_t mods){
-////////////////////////////////////////////////////////////////////////
-//     A simple constructor to set basic geometry class variables
-// Input:
-//      itype  the type of transofmation kept.
-//             0 => Standard Geant
-//         bit 1 => ITS tracking
-//         bit 2 => A change in the coordiante system has been made.
-//         others are still to be defined as needed.
-//      nlayers The number of ITS layers also set the size of the arrays
-//      *nlads  an array of the number of ladders for each layer
-//      *ndets  an array of the number of detectors per ladder for each layer.
-////////////////////////////////////////////////////////////////////////
+    //     A simple constructor to set basic geometry class variables
+    // Inputs:
+    // Int_t itype   the type of transformation kept.
+    //               bit 0 => Standard GEANT
+    //               bit 1 => ITS tracking
+    //               bit 2 => A change in the coordinate system has been made.
+    //               others are still to be defined as needed.
+    // Int_t nlayers The number of ITS layers also set the size of the arrays
+    // Int_t *nlads  an array of the number of ladders for each layer. This
+    //               array must be nlayers long.
+    // Int_t *ndets  an array of the number of detectors per ladder for each
+    //               layer. This array must be nlayers long.
+    // Int_t mods    The number of modules. Typicaly the sum of all the 
+    //               detectors on every layer and ladder.
+    // Outputs:
+    // none
     Int_t i;
 
     fTrans    = itype;
@@ -249,8 +251,27 @@ AliITSgeom::AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets,
 }
 //______________________________________________________________________
 void AliITSgeom::CreatMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
-                            AliITSDetector idet,Double_t tran[3],
-                            Double_t rot[10]){
+                            AliITSDetector idet,const Double_t tran[3],
+                            const Double_t rot[10]){
+    // Given the translation vector tran[3] and the rotation matrix rot[1],
+    // this function creates and adds to the TObject Array fGm the
+    // AliITSgeomMatrix object.
+    // Inputs are:
+    // Int_t           mod     The module number. The location in TObjArray
+    // Int_t           lay     The layer where this module is
+    // Int_t           lad     On which ladder this module is
+    // Int_t           det     Which detector on this ladder this module is
+    // AliITSDetector idet     The type of detector see AliITSgeom.h
+    // Double_t       tran[3]  The translation vector
+    // Double_t       rot[10]  The rotation matrix.
+    // Outputs are:
+    //   none
+    // The rot[10] matrix is set up like:
+    /*   / rot[0]  rot[1]  rot[2] \
+    //  |  rot[3]  rot[4]  rot[5]  |
+    //   \ rot[6]  rot[7]  rot[8] /  if(rot[9]!=0) then the Identity matrix
+    // is used regardless of the values in rot[0]-rot[8].
+    */
     Int_t id[3];
     Double_t r[3][3] = {{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0}};
 
@@ -263,17 +284,14 @@ void AliITSgeom::CreatMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
     } // end if
     fGm->AddAt(new AliITSgeomMatrix(idet,id,r,tran),mod);
 }
-//_____________________________________________________________________
+//______________________________________________________________________
 AliITSgeom::~AliITSgeom(){
-////////////////////////////////////////////////////////////////////////
-//     The destructor for the AliITSgeom class. If the arrays fNlad,
-// fNdet, or fGm have had memory allocated to them, there pointer values
-// are non zero, then this memory space is freed and they are set
-// to zero. In addition, fNlayers is set to zero. The destruction of
-// TObjArray fShape is, by default, handled by the TObjArray destructor.
-////////////////////////////////////////////////////////////////////////
-  // Default destructor.
-  // if arrays exist delete them. Then set everything to zero.
+    //     The destructor for the AliITSgeom class. If the arrays fNlad,
+    // fNdet, or fGm have had memory allocated to them, there pointer values
+    // are non zero, then this memory space is freed and they are set
+    // to zero. In addition, fNlayers is set to zero. The destruction of
+    // TObjArray fShape is, by default, handled by the TObjArray destructor.
+
    if(fGm!=0){
       for(Int_t i=0;i<fNlayers;i++) delete fGm->At(i);
       delete fGm;
@@ -288,6 +306,19 @@ AliITSgeom::~AliITSgeom(){
 }
 //______________________________________________________________________
 void AliITSgeom::ReadNewFile(const char *filename){
+    // It is generaly preferred to define the geometry in AliITSgeom
+    // directly from the GEANT geometry, see AliITSvPPRasymm.cxx for
+    // and example. Under some circumstances this may not be possible.
+    // This function will read in a formatted file for all of the
+    // information needed to define the geometry in AliITSgeom.
+    // Unlike the older file format, this file may contain comments
+    // and the order of the data does not need to be completely
+    // respected. A file can be created using the function WriteNewFile
+    // defined below.
+    // Inputs are:
+    // const char *filename The file name of the file to be read in.
+    // Outputs are:
+    //  none
     Int_t ncmd=9;
     const char *cmda[]={"Version"        ,"fTrans"  ,"fNmodules",
                        "fNlayers"       ,"fNladers","fNdetectors",
@@ -322,7 +353,6 @@ void AliITSgeom::ReadNewFile(const char *filename){
            } // end if second /
        } // end if first /
        fp->putback(c);
-//     fp->unget();
        *fp >> cmd;
        for(i=0;i<ncmd;i++) if(strcmp(cmd,cmda[i])==0) break;
        switch (i){
@@ -410,8 +440,12 @@ void AliITSgeom::ReadNewFile(const char *filename){
 }
 //______________________________________________________________________
 void AliITSgeom::WriteNewFile(const char *filename){
-// Writes AliITSgeom, AliITSgeomMatrix, and the defined AliITSgeomS*D classes
-// to a file in a format that is more readable and commentable.
+    // Writes AliITSgeom, AliITSgeomMatrix, and the defined AliITSgeomS*D
+    // classes to a file in a format that is more readable and commendable.
+    // Inputs are:
+    // const char *filename The file name of the file to be write to.
+    // Outputs are:
+    //  none
     ofstream *fp;
     Int_t i;
     char *filtmp;
@@ -427,7 +461,7 @@ void AliITSgeom::WriteNewFile(const char *filename){
     *fp << ", kSDD=" << (Int_t) kSDD << ", kSSD=" << (Int_t) kSSD;
     *fp << ", kSSDp=" << (Int_t) kSSDp << ", and kSDDp=" << (Int_t) kSDDp;
     *fp << "*/" << endl;
-    *fp << "Version " << fVersion << endl;//This should be consistant with the
+    *fp << "Version " << fVersion << endl;//This should be consistent with the
                                            // geometry version.
     *fp << "fTrans " << fTrans << endl;
     *fp << "fNmodules " << fNmodules << endl;
@@ -467,134 +501,139 @@ void AliITSgeom::WriteNewFile(const char *filename){
     delete fp;
     return;
 }
-//_____________________________________________________________________
+//______________________________________________________________________
 AliITSgeom::AliITSgeom(const char *filename){
-////////////////////////////////////////////////////////////////////////
-//     The constructor for the AliITSgeom class. All of the data to fill
-// this structure is read in from the file given my the input filename.
-////////////////////////////////////////////////////////////////////////
-   FILE     *pf=0;
-   Int_t    i,lm=0,id[3];
-   Int_t    l,a,d;
-   Float_t  x,y,z,o,p,q,r,s,t;
-   Double_t rot6[6],tran[3];
-   char     buf[200],*buff=0; // input character buffer;
-   char *filtmp;
-
-   filtmp = gSystem->ExpandPathName(filename);
-   cout << "AliITSgeom reading old .det file " << filtmp << endl;
-   fShape = 0;
-   strcpy(fVersion,"DefauleV5");
-   pf = fopen(filtmp,"r");
+    //     The constructor for the AliITSgeom class. All of the data to fill
+    // this structure is read in from the file given my the input filename.
+    // Inputs are:
+    // const char *filename The file name of the file to be read in.
+    // Outputs are:
+    //  none
+    FILE     *pf=0;
+    Int_t    i,lm=0,id[3];
+    Int_t    l,a,d;
+    Float_t  x,y,z,o,p,q,r,s,t;
+    Double_t rot6[6],tran[3];
+    char     buf[200],*buff=0; // input character buffer;
+    char *filtmp;
 
-   fNlayers = 6; // set default number of ladders
-TryAgain:
-   fNlad    = new Int_t[fNlayers];
-   fNdet    = new Int_t[fNlayers];
-   fNmodules = 0;
-   // find the number of ladders and detectors in this geometry.
-   for(i=0;i<fNlayers;i++){fNlad[i]=fNdet[i]=0;} // zero out arrays
-   while(fgets(buf,200,pf)!=NULL){ // for ever loop
-      for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
-           buff = &(buf[i]);
-           break;
-      } // end for i
-      // remove blank lines and comments.
-      if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
-         (buff[0]=='/'&&buff[1]=='/')) continue;
-      if(isalpha(buff[0])) { // must be the new file formated file.
+    filtmp = gSystem->ExpandPathName(filename);
+    cout << "AliITSgeom reading old .det file " << filtmp << endl;
+    fShape = 0;
+    strcpy(fVersion,"DefauleV5");
+    pf = fopen(filtmp,"r");
+
+    fNlayers = 6; // set default number of ladders
+ TryAgain:
+    fNlad    = new Int_t[fNlayers];
+    fNdet    = new Int_t[fNlayers];
+    fNmodules = 0;
+    // find the number of ladders and detectors in this geometry.
+    for(i=0;i<fNlayers;i++){fNlad[i]=fNdet[i]=0;} // zero out arrays
+    while(fgets(buf,200,pf)!=NULL){ // for ever loop
+       for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
+           buff = &(buf[i]);
+           break;
+       } // end for i
+       // remove blank lines and comments.
+       if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
+          (buff[0]=='/'&&buff[1]=='/')) continue;
+       if(isalpha(buff[0])) { // must be the new file formated file.
             fclose(pf);
             delete[] fNlad;delete[] fNdet;
             ReadNewFile(filename);
             return;
-      } // end if isalpha(buff[0])
-      sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
-                  &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
-      if(l>lm) lm = l;
-      if(l<1 || l>fNlayers) {
-         printf("error in file %s layer=%d min. is 1 max is %d\n",
-                 filename,l,fNlayers);
-         continue;
-      }// end if l
-      fNmodules++;
-      if(l<=fNlayers&&fNlad[l-1]<a) fNlad[l-1] = a;
-      if(l<=fNlayers&&fNdet[l-1]<d) fNdet[l-1] = d;
-   } // end while ever loop
-   if(lm>fNlayers){
+       } // end if isalpha(buff[0])
+       sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
+              &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
+       if(l>lm) lm = l;
+       if(l<1 || l>fNlayers) {
+           printf("error in file %s layer=%d min. is 1 max is %d\n",
+                  filename,l,fNlayers);
+           continue;
+       }// end if l
+       fNmodules++;
+       if(l<=fNlayers&&fNlad[l-1]<a) fNlad[l-1] = a;
+       if(l<=fNlayers&&fNdet[l-1]<d) fNdet[l-1] = d;
+    } // end while ever loop
+    if(lm>fNlayers){
        delete[] fNlad;
        delete[] fNdet;
        fNlayers = lm;
        goto TryAgain;
-   } // end if lm>fNlayers
-   // counted the number of ladders and detectors now allocate space.
-   fGm = new TObjArray(fNmodules,0);
+    } // end if lm>fNlayers
+    // counted the number of ladders and detectors now allocate space.
+    fGm = new TObjArray(fNmodules,0);
 
-   // Set up Shapes for a default configuration of 6 layers.
-   fTrans   = 0; // standard GEANT global/local coordinate system.
-   // prepare to read in transforms
-   lm = 0; // reuse lm as counter of modules.
-   rewind(pf); // start over reading file
-   while(fgets(buf,200,pf)!=NULL){ // for ever loop
-      for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
-           buff = &(buf[i]);
-           break;
-      } // end for i
-      // remove blank lines and comments.
-      if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
-        (buff[0]=='/'&&buff[1]=='/')) continue;
-      x = y = z = o = p = q = r = s = t = 0.0;
-      sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
-                  &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
-      if(l<1 || l>fNlayers) {
-         printf("error in file %s layer=%d min. is 1 max is %d/n",
-                 filename,l,fNlayers);
-         continue;
-      }// end if l
-      id[0] = l;id[1] = a;id[2] = d;
-      tran[0] = tran[1] = tran[2]  = 0.0;
-      tran[0] = (Double_t)x;tran[1] = (Double_t)y;tran[2] = (Double_t)z;
-      rot6[0] = rot6[1] = rot6[2] = rot6[3] = rot6[4] = rot6[5] =0.0;
-      rot6[0] = (Double_t)o;rot6[1] = (Double_t)p;rot6[2] = (Double_t)q;
-      rot6[3] = (Double_t)r;rot6[4] = (Double_t)s;rot6[5] = (Double_t)t;
-      switch (l){
-      case 1: case 2: // layer 1 or2 SPD
-          fGm->AddAt(new AliITSgeomMatrix(rot6,kSPD,id,tran),lm++);
-         break;
-      case 3: case 4: // layer 3 or 4 SDD
-          fGm->AddAt(new AliITSgeomMatrix(rot6,kSDD,id,tran),lm++);
-         break;
-      case 5: case 6: // layer 5 or 6 SSD
-          fGm->AddAt(new AliITSgeomMatrix(rot6,kSSD,id,tran),lm++);
-         break;
-      } // end switch
-   } // end while ever loop
-   fclose(pf);
+    // Set up Shapes for a default configuration of 6 layers.
+    fTrans   = 0; // standard GEANT global/local coordinate system.
+    // prepare to read in transforms
+    lm = 0; // reuse lm as counter of modules.
+    rewind(pf); // start over reading file
+    while(fgets(buf,200,pf)!=NULL){ // for ever loop
+       for(i=0;i<200;i++)if(buf[i]!=' '){ // remove blank spaces.
+           buff = &(buf[i]);
+           break;
+       } // end for i
+       // remove blank lines and comments.
+       if(buff[0]=='\n'||buff[0]=='#'||buff[0]=='!'||
+          (buff[0]=='/'&&buff[1]=='/')) continue;
+       x = y = z = o = p = q = r = s = t = 0.0;
+       sscanf(buff,"%d %d %d %f %f %f %f %f %f %f %f %f",
+              &l,&a,&d,&x,&y,&z,&o,&p,&q,&r,&s,&t);
+       if(l<1 || l>fNlayers) {
+           printf("error in file %s layer=%d min. is 1 max is %d/n",
+                  filename,l,fNlayers);
+           continue;
+       }// end if l
+       id[0] = l;id[1] = a;id[2] = d;
+       tran[0] = tran[1] = tran[2]  = 0.0;
+       tran[0] = (Double_t)x;tran[1] = (Double_t)y;tran[2] = (Double_t)z;
+       rot6[0] = rot6[1] = rot6[2] = rot6[3] = rot6[4] = rot6[5] =0.0;
+       rot6[0] = (Double_t)o;rot6[1] = (Double_t)p;rot6[2] = (Double_t)q;
+       rot6[3] = (Double_t)r;rot6[4] = (Double_t)s;rot6[5] = (Double_t)t;
+       switch (l){
+       case 1: case 2: // layer 1 or2 SPD
+           fGm->AddAt(new AliITSgeomMatrix(rot6,kSPD,id,tran),lm++);
+           break;
+       case 3: case 4: // layer 3 or 4 SDD
+           fGm->AddAt(new AliITSgeomMatrix(rot6,kSDD,id,tran),lm++);
+           break;
+       case 5: case 6: // layer 5 or 6 SSD
+           fGm->AddAt(new AliITSgeomMatrix(rot6,kSSD,id,tran),lm++);
+           break;
+       } // end switch
+    } // end while ever loop
+    fclose(pf);
 }
-
-//________________________________________________________________________
+//______________________________________________________________________
 AliITSgeom::AliITSgeom(AliITSgeom &source){
-////////////////////////////////////////////////////////////////////////
-//     The copy constructor for the AliITSgeom class. It calls the
-// = operator function. See the = operator function for more details.
-////////////////////////////////////////////////////////////////////////
+    //     The copy constructor for the AliITSgeom class. It calls the
+    // = operator function. See the = operator function for more details.
+    // Inputs are:
+    // AliITSgeom &source  The AliITSgeom class with which to make this
+    //                     a copy of.
+    // Outputs are:
+    // none.
 
     *this = source;  // Just use the = operator for now.
-
     return;
 }
-
-//________________________________________________________________________
-void AliITSgeom::operator=(AliITSgeom &source){
-////////////////////////////////////////////////////////////////////////
-//     The = operator function for the AliITSgeom class. It makes an
-// independent copy of the class in such a way that any changes made
-// to the copied class will not affect the source class in any way.
-// This is required for many ITS alignment studies where the copied
-// class is then modified by introducing some misalignment.
-////////////////////////////////////////////////////////////////////////
+//______________________________________________________________________
+AliITSgeom& AliITSgeom::operator=(AliITSgeom &source){
+    //     The = operator function for the AliITSgeom class. It makes an
+    // independent copy of the class in such a way that any changes made
+    // to the copied class will not affect the source class in any way.
+    // This is required for many ITS alignment studies where the copied
+    // class is then modified by introducing some misalignment.
+    // Inputs are:
+    // AliITSgeom &source  The AliITSgeom class with which to make this
+    //                     a copy of.
+    // Outputs are:
+    // return  *this       The a new copy of source.
    Int_t i;
 
-   if(this == &source) return; // don't assign to ones self.
+   if(this == &source) return *this; // don't assign to ones self.
 
    // if there is an old structure allocated delete it first.
    if(this->fGm != 0){
@@ -617,16 +656,20 @@ void AliITSgeom::operator=(AliITSgeom &source){
        this->fGm->AddAt(new AliITSgeomMatrix(*(
           (AliITSgeomMatrix*)(source.fGm->At(i)))),i);
    } // end for i
-   return;
-}//_____________________________________________________________________
-Int_t AliITSgeom::GetModuleIndex(const Int_t lay,const Int_t lad,
-                                const Int_t det){
-////////////////////////////////////////////////////////////////////////
-//      This routine computes the module index number from the layer,
-// ladder, and detector numbers. The number of ladders and detectors
-// per layer is determined when this geometry package is constructed,
-// see AliITSgeom(const char *filename) for specifics.
-////////////////////////////////////////////////////////////////////////
+   return *this;
+}
+//______________________________________________________________________
+Int_t AliITSgeom::GetModuleIndex(Int_t lay,Int_t lad,Int_t det){
+    //      This routine computes the module index number from the layer,
+    // ladder, and detector numbers. The number of ladders and detectors
+    // per layer is determined when this geometry package is constructed,
+    // see AliITSgeom(const char *filename) for specifics.
+    // Inputs are:
+    // Int_t lay  The layer number. Starting from 1.
+    // Int_t lad  The ladder number. Starting from 1.
+    // Int_t det  The detector number. Starting from 1.
+    // Outputs are:
+    // return the module index number, starting from zero.
     Int_t i,j,k,id[3];
 
     i = fNdet[lay-1] * (lad-1) + det - 1;
@@ -644,14 +687,17 @@ Int_t AliITSgeom::GetModuleIndex(const Int_t lay,const Int_t lad,
     return -1;
 }
 //______________________________________________________________________
-void AliITSgeom::GetModuleId(const Int_t index,
-                            Int_t &lay,Int_t &lad,Int_t &det){
-////////////////////////////////////////////////////////////////////////
-//      This routine computes the layer, ladder and detector number 
-// given the module index number. The number of ladders and detectors
-// per layer is determined when this geometry package is constructed,
-// see AliITSgeom(const char *filename) for specifics.
-////////////////////////////////////////////////////////////////////////
+void AliITSgeom::GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det){
+    //      This routine computes the layer, ladder and detector number 
+    // given the module index number. The number of ladders and detectors
+    // per layer is determined when this geometry package is constructed,
+    // see AliITSgeom(const char *filename) for specifics.
+    // Inputs are:
+    // Int_t index  The module index number, starting from zero.
+    // Outputs are:
+    // Int_t lay    The layer number. Starting from 1.
+    // Int_t lad    The ladder number. Starting from 1.
+    // Int_t det    The detector number. Starting from 1.
     Int_t id[3];
 
     GetGeomMatrix(index)->GetIndex(id);
@@ -678,446 +724,498 @@ void AliITSgeom::GetModuleId(const Int_t index,
     return;
 */
 }
-//___________________________________________________________________________
-Int_t AliITSgeom::GetStartDet(const Int_t dtype){
-  /////////////////////////////////////////////////////////////////////////
-  // returns the starting module index value for a give type of detector id
-  /////////////////////////////////////////////////////////////////////////
-
-  switch(dtype){
-  case 0:
-     return GetModuleIndex(1,1,1);
-     break;
-  case 1:
-     return GetModuleIndex(3,1,1);
-     break;
-  case 2:
-     return GetModuleIndex(5,1,1);
-     break;
-  default:
-     printf("<AliITSgeom::GetFirstDet> undefined detector type\n");
-     return 0;
-  } // end switch
-
-  printf("<AliITSgeom::GetFirstDet> undefined detector type\n");
-  return 0;
+//______________________________________________________________________
+Int_t AliITSgeom::GetStartDet(Int_t dtype){
+    // returns the starting module index value for a give type of detector id.
+    // This assumes that the detector types are different on different layers
+    // and that they are not mixed up.
+    // Inputs are:
+    // Int_t dtype A detector type number. 0 for SPD, 1 for SDD, and 2 for SSD.
+    // outputs:
+    // return the module index for the first occurance of that detector type.
+
+    switch(dtype){
+    case 0:
+       return GetModuleIndex(1,1,1);
+       break;
+    case 1:
+       return GetModuleIndex(3,1,1);
+       break;
+    case 2:
+       return GetModuleIndex(5,1,1);
+       break;
+    default:
+       Warning("GetStartDet","undefined detector type %d",dtype);
+       return 0;
+    } // end switch
+
+    Warning("GetStartDet","undefined detector type %d",dtype);
+    return 0;
 }
-
-//___________________________________________________________________________
-Int_t AliITSgeom::GetLastDet(const Int_t dtype){
-  /////////////////////////////////////////////////////////////////////////
-  // returns the last module index value for a give type of detector id
-  /////////////////////////////////////////////////////////////////////////
-
-  switch(dtype){
-  case 0:
-     return GetLastSPD();
-     break;
-   case 1:
-     return GetLastSDD();
-     break;
-   case 2:
-     return GetLastSSD();
-     break;
-   default:
-     printf("<AliITSgeom::GetLastDet> undefined detector type\n");
-     return 0;
-  } // end switch
-
-  printf("<AliITSgeom::GetLastDet> undefined detector type\n");
-  return 0;
+//______________________________________________________________________
+Int_t AliITSgeom::GetLastDet(Int_t dtype){
+    // returns the last module index value for a give type of detector id.
+    // This assumes that the detector types are different on different layers
+    // and that they are not mixed up.
+    // Inputs are:
+    // Int_t dtype A detector type number. 0 for SPD, 1 for SDD, and 2 for SSD.
+    // outputs are:
+    // return the module index for the last occurance of that detector type.
+
+    switch(dtype){
+    case 0:
+       return GetLastSPD();
+       break;
+    case 1:
+       return GetLastSDD();
+       break;
+    case 2:
+       return GetLastSSD();
+       break;
+    default:
+       Warning("GetLastDet","undefined detector type %d",dtype);
+       return 0;
+    } // end switch
+
+    Warning("GetLastDet","undefined detector type %d",dtype);
+    return 0;
 }
-
-//___________________________________________________________________________
+//______________________________________________________________________
 void AliITSgeom::PrintComparison(FILE *fp,AliITSgeom *other){
-////////////////////////////////////////////////////////////////////////
-//     This function was primarily created for diagnostic reasons. It
-// print to a file pointed to by the file pointer fp the difference
-// between two AliITSgeom classes. The format of the file is basicly,
-// define d? to be the difference between the same element of the two
-// classes. For example dfrx = this->GetGeomMatrix(i)->frx 
-// - other->GetGeomMatrix(i)->frx.
-// if(at least one of dfx0, dfy0, dfz0,dfrx,dfry,dfrz are non zero) then print
-// layer ladder detector dfx0 dfy0 dfz0 dfrx dfry dfrz
-// if(at least one of the 9 elements of dfr[] are non zero) then print
-// layer ladder detector dfr[0] dfr[1] dfr[2]
-//                       dfr[3] dfr[4] dfr[5]
-//                       dfr[6] dfr[7] dfr[8]
-// Only non zero values are printed to save space. The differences are
-// typical written to a file because there are usually a lot of numbers
-// printed out and it is usually easier to read them in some nice editor
-// rather than zooming quickly past you on a screen. fprintf is used to
-// do the printing. The fShapeIndex difference is not printed at this time.
-////////////////////////////////////////////////////////////////////////
-   Int_t    i,j,idt[3],ido[3];
-   Double_t tt[3],to[3];  // translation
-   Double_t rt[3],ro[3];  // phi in radians
-   Double_t mt[3][3],mo[3][3]; // matrixes
-   AliITSgeomMatrix *gt,*go;
-   Bool_t   t;
-
-   for(i=0;i<this->fNmodules;i++){
-         gt  =  this->GetGeomMatrix(i);
-        go  = other->GetGeomMatrix(i);
-         gt->GetIndex(idt);
-         go->GetIndex(ido);
-         t = kFALSE;
-         for(i=0;i<3;i++) t = t&&idt[i]!=ido[i];
-         if(t) fprintf(fp,"%4.4d %1.1d %2.2d %2.2d %1.1d %2.2d %2.2d\n",i,
-                       idt[0],idt[1],idt[2],ido[0],ido[1],ido[2]);
-         gt->GetTranslation(tt);
-         go->GetTranslation(to);
-         gt->GetAngles(rt);
-         go->GetAngles(ro);
-         t = kFALSE;
-         for(i=0;i<3;i++) t = t&&tt[i]!=to[i];
-        if(t) fprintf(fp,"%1.1d %2.2d %2.2d dTrans=%f %f %f drot=%f %f %f\n",
-                      idt[0],idt[1],idt[2],
-                       tt[0]-to[0],tt[1]-to[1],tt[2]-to[2],
-                       rt[0]-ro[0],rt[1]-ro[1],rt[2]-ro[2]);
-        t = kFALSE;
-         gt->GetMatrix(mt);
-         go->GetMatrix(mo);
-        for(i=0;i<3;i++)for(j=0;j<3;j++)  t = mt[i][j] != mo[i][j];
-        if(t){
-            fprintf(fp,"%1.1d %2.2d %2.2d dfr= %e %e %e\n",
-                     idt[0],idt[1],idt[2],
-                 mt[0][0]-mo[0][0],mt[0][1]-mo[0][1],mt[0][2]-mo[0][2]);
-            fprintf(fp,"        dfr= %e %e %e\n",
-                 mt[1][0]-mo[1][0],mt[1][1]-mo[1][1],mt[1][2]-mo[1][2]);
-            fprintf(fp,"        dfr= %e %e %e\n",
-                 mt[2][0]-mo[2][0],mt[2][1]-mo[2][1],mt[2][2]-mo[2][2]);
-        } // end if t
-   } // end for i
-   return;
+    //     This function was primarily created for diagnostic reasons. It
+    // print to a file pointed to by the file pointer fp the difference
+    // between two AliITSgeom classes. The format of the file is basicly,
+    // define d? to be the difference between the same element of the two
+    // classes. For example dfrx = this->GetGeomMatrix(i)->frx 
+    // - other->GetGeomMatrix(i)->frx.
+    // if(at least one of dfx0, dfy0, dfz0,dfrx,dfry,dfrz are non zero) then
+    // print layer ladder detector dfx0 dfy0 dfz0 dfrx dfry dfrz
+    // if(at least one of the 9 elements of dfr[] are non zero) then print
+    // layer ladder detector dfr[0] dfr[1] dfr[2]
+    //                       dfr[3] dfr[4] dfr[5]
+    //                       dfr[6] dfr[7] dfr[8]
+    // Only non zero values are printed to save space. The differences are
+    // typical written to a file because there are usually a lot of numbers
+    // printed out and it is usually easier to read them in some nice editor
+    // rather than zooming quickly past you on a screen. fprintf is used to
+    // do the printing. The fShapeIndex difference is not printed at this time.
+    // Inputs are:
+    // FILE *fp           A file pointer to an opened file for writing in which
+    //                    the results of the comparison will be written.
+    // AliITSgeom *other  The other AliITSgeom class to which this one is
+    //                    being compared.
+    // outputs are:
+    // none
+    Int_t    i,j,idt[3],ido[3];
+    Double_t tt[3],to[3];  // translation
+    Double_t rt[3],ro[3];  // phi in radians
+    Double_t mt[3][3],mo[3][3]; // matrixes
+    AliITSgeomMatrix *gt,*go;
+    Bool_t   t;
+
+    for(i=0;i<this->fNmodules;i++){
+       gt  =  this->GetGeomMatrix(i);
+       go  = other->GetGeomMatrix(i);
+       gt->GetIndex(idt);
+       go->GetIndex(ido);
+       t = kFALSE;
+       for(i=0;i<3;i++) t = t&&idt[i]!=ido[i];
+       if(t) fprintf(fp,"%4.4d %1.1d %2.2d %2.2d %1.1d %2.2d %2.2d\n",i,
+                     idt[0],idt[1],idt[2],ido[0],ido[1],ido[2]);
+       gt->GetTranslation(tt);
+       go->GetTranslation(to);
+       gt->GetAngles(rt);
+       go->GetAngles(ro);
+       t = kFALSE;
+       for(i=0;i<3;i++) t = t&&tt[i]!=to[i];
+       if(t) fprintf(fp,"%1.1d %2.2d %2.2d dTrans=%f %f %f drot=%f %f %f\n",
+                     idt[0],idt[1],idt[2],
+                     tt[0]-to[0],tt[1]-to[1],tt[2]-to[2],
+                     rt[0]-ro[0],rt[1]-ro[1],rt[2]-ro[2]);
+       t = kFALSE;
+       gt->GetMatrix(mt);
+       go->GetMatrix(mo);
+       for(i=0;i<3;i++)for(j=0;j<3;j++)  t = mt[i][j] != mo[i][j];
+       if(t){
+           fprintf(fp,"%1.1d %2.2d %2.2d dfr= %e %e %e\n",
+                   idt[0],idt[1],idt[2],
+                   mt[0][0]-mo[0][0],mt[0][1]-mo[0][1],mt[0][2]-mo[0][2]);
+           fprintf(fp,"        dfr= %e %e %e\n",
+                   mt[1][0]-mo[1][0],mt[1][1]-mo[1][1],mt[1][2]-mo[1][2]);
+           fprintf(fp,"        dfr= %e %e %e\n",
+                   mt[2][0]-mo[2][0],mt[2][1]-mo[2][1],mt[2][2]-mo[2][2]);
+       } // end if t
+    } // end for i
+    return;
 }
-
-//___________________________________________________________________________
-void AliITSgeom::PrintData(FILE *fp,
-                          const Int_t lay,const Int_t lad,const Int_t det){
-////////////////////////////////////////////////////////////////////////
-//     This function prints out the coordinate transformations for
-// the particular detector defined by layer, ladder, and detector
-// to the file pointed to by the File pointer fp. fprintf statements
-// are used to print out the numbers. The format is
-// layer ladder detector Trans= fx0 fy0 fz0 rot= frx fry frz Shape=fShapeIndex
-//                         dfr= fr[0] fr[1] fr[2]
-//                         dfr= fr[3] fr[4] fr[5]
-//                         dfr= fr[6] fr[7] fr[8]
-// By indicating which detector, some control over the information 
-// is given to the user. The output it written to the file pointed
-// to by the file pointer fp. This can be set to stdout if you want.
-////////////////////////////////////////////////////////////////////////
-   AliITSgeomMatrix *gt;
-   Double_t t[3],r[3],m[3][3];
-
-   gt = this->GetGeomMatrix(GetModuleIndex(lay,lad,det));
-   gt->GetTranslation(t);
-   gt->GetAngles(r);
-   fprintf(fp,"%1.1d %2.2d %2.2d Trans=%f %f %f rot=%f %f %f Shape=%d\n",
-          lay,lad,det,t[0],t[1],t[2],r[0],r[1],r[2],
-           gt->GetDetectorIndex());
-   gt->GetMatrix(m);
-   fprintf(fp,"        dfr= %e %e %e\n",m[0][0],m[0][1],m[0][2]);
-   fprintf(fp,"        dfr= %e %e %e\n",m[1][0],m[1][1],m[1][2]);
-   fprintf(fp,"        dfr= %e %e %e\n",m[2][0],m[2][1],m[2][2]);
-   return;
+//______________________________________________________________________
+void AliITSgeom::PrintData(FILE *fp,Int_t lay,Int_t lad,Int_t det){
+    //     This function prints out the coordinate transformations for
+    // the particular detector defined by layer, ladder, and detector
+    // to the file pointed to by the File pointer fp. fprintf statements
+    // are used to print out the numbers. The format is
+    // layer ladder detector Trans= fx0 fy0 fz0 rot= frx fry frz 
+    // Shape=fShapeIndex
+    //                         dfr= fr[0] fr[1] fr[2]
+    //                         dfr= fr[3] fr[4] fr[5]
+    //                         dfr= fr[6] fr[7] fr[8]
+    // By indicating which detector, some control over the information 
+    // is given to the user. The output it written to the file pointed
+    // to by the file pointer fp. This can be set to stdout if you want.
+    // Inputs are:
+    // FILE *fp           A file pointer to an opened file for writing in which
+    //                    the results of the comparison will be written.
+    // Int_t lay          The layer number. Starting from 1.
+    // Int_t lad          The ladder number. Starting from 1.
+    // Int_t det          The detector number. Starting from 1.
+    // outputs are:
+    // none
+    AliITSgeomMatrix *gt;
+    Double_t t[3],r[3],m[3][3];
+
+    gt = this->GetGeomMatrix(GetModuleIndex(lay,lad,det));
+    gt->GetTranslation(t);
+    gt->GetAngles(r);
+    fprintf(fp,"%1.1d %2.2d %2.2d Trans=%f %f %f rot=%f %f %f Shape=%d\n",
+           lay,lad,det,t[0],t[1],t[2],r[0],r[1],r[2],
+           gt->GetDetectorIndex());
+    gt->GetMatrix(m);
+    fprintf(fp,"        dfr= %e %e %e\n",m[0][0],m[0][1],m[0][2]);
+    fprintf(fp,"        dfr= %e %e %e\n",m[1][0],m[1][1],m[1][2]);
+    fprintf(fp,"        dfr= %e %e %e\n",m[2][0],m[2][1],m[2][2]);
+    return;
 }
-//___________________________________________________________________________
-ofstream & AliITSgeom::PrintGeom(ofstream &R__b){
-////////////////////////////////////////////////////////////////////////
-//     Stream out an object of class AliITSgeom to standard output.
-////////////////////////////////////////////////////////////////////////
+//______________________________________________________________________
+ofstream & AliITSgeom::PrintGeom(ofstream &rb){
+    //     Stream out an object of class AliITSgeom to standard output.
+    // Intputs are:
+    // ofstream &rb    The output streaming buffer.
+    // Outputs are:
+    // ofstream &rb    The output streaming buffer.
     Int_t i;
 
-    R__b.setf(ios::scientific);
-    R__b << fTrans << " ";
-    R__b << fNmodules << " ";
-    R__b << fNlayers << " ";
-    for(i=0;i<fNlayers;i++) R__b << fNlad[i] << " ";
-    for(i=0;i<fNlayers;i++) R__b << fNdet[i] << "\n";
+    rb.setf(ios::scientific);
+    rb << fTrans << " ";
+    rb << fNmodules << " ";
+    rb << fNlayers << " ";
+    for(i=0;i<fNlayers;i++) rb << fNlad[i] << " ";
+    for(i=0;i<fNlayers;i++) rb << fNdet[i] << "\n";
     for(i=0;i<fNmodules;i++) {
-       R__b <<setprecision(16) << *(GetGeomMatrix(i)) << "\n";
+       rb <<setprecision(16) << *(GetGeomMatrix(i)) << "\n";
     } // end for i
-    return R__b;
+    return rb;
 }
-//___________________________________________________________________________
-ifstream & AliITSgeom::ReadGeom(ifstream &R__b){
-////////////////////////////////////////////////////////////////////////
-//     Stream in an object of class AliITSgeom from standard input.
-////////////////////////////////////////////////////////////////////////
-      Int_t i;
-
-      fNlad = new Int_t[fNlayers];
-      fNdet = new Int_t[fNlayers];
-      if(fGm!=0){
-         for(i=0;i<fNmodules;i++) delete GetGeomMatrix(i);
-         delete fGm;
-      } // end if fGm!=0
+//______________________________________________________________________
+ifstream & AliITSgeom::ReadGeom(ifstream &rb){
+    //     Stream in an object of class AliITSgeom from standard input.
+    // Intputs are:
+    // ifstream &rb    The input streaming buffer.
+    // Outputs are:
+    // ifstream &rb    The input streaming buffer.
+    Int_t i;
 
-      R__b >> fTrans >> fNmodules >> fNlayers;
-      fNlad = new Int_t[fNlayers];
-      fNdet = new Int_t[fNlayers];
-      for(i=0;i<fNlayers;i++) R__b >> fNlad[i];
-      for(i=0;i<fNlayers;i++) R__b >> fNdet[i];
-      fGm = new TObjArray(fNmodules,0);
-      for(i=0;i<fNmodules;i++){
-         fGm->AddAt(new AliITSgeomMatrix,i);
-         R__b >> *(GetGeomMatrix(i));
-      } // end for i
-      return R__b;
+    fNlad = new Int_t[fNlayers];
+    fNdet = new Int_t[fNlayers];
+    if(fGm!=0){
+       for(i=0;i<fNmodules;i++) delete GetGeomMatrix(i);
+       delete fGm;
+    } // end if fGm!=0
+
+    rb >> fTrans >> fNmodules >> fNlayers;
+    fNlad = new Int_t[fNlayers];
+    fNdet = new Int_t[fNlayers];
+    for(i=0;i<fNlayers;i++) rb >> fNlad[i];
+    for(i=0;i<fNlayers;i++) rb >> fNdet[i];
+    fGm = new TObjArray(fNmodules,0);
+    for(i=0;i<fNmodules;i++){
+       fGm->AddAt(new AliITSgeomMatrix,i);
+       rb >> *(GetGeomMatrix(i));
+    } // end for i
+    return rb;
 }
-//___________________________________________________________________________
-
 //______________________________________________________________________
 //     The following routines modify the transformation of "this"
 // geometry transformations in a number of different ways.
 //______________________________________________________________________
 void AliITSgeom::GlobalChange(const Float_t *tran,const Float_t *rot){
-////////////////////////////////////////////////////////////////////////
-//     This function performs a Cartesian translation and rotation of
-// the full ITS from its default position by an amount determined by
-// the three element arrays dtranslation and drotation. If every element
-// of dtranslation and drotation are zero then there is no change made
-// the geometry. The change is global in that the exact same translation
-// and rotation is done to every detector element in the exact same way.
-// The units of the translation are those of the Monte Carlo, usually cm,
-// and those of the rotation are in radians. The elements of dtranslation
-// are dtranslation[0] = x, dtranslation[1] = y, and dtranslation[2] = z.
-// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
-// drotation[2] = rz. A change in x will move the hole ITS in the ALICE
-// global x direction, the same for a change in y. A change in z will
-// result in a translation of the ITS as a hole up or down the beam line.
-// A change in the angles will result in the inclination of the ITS with
-// respect to the beam line, except for an effective rotation about the
-// beam axis which will just rotate the ITS as a hole about the beam axis.
-////////////////////////////////////////////////////////////////////////
-   Int_t    i,j;
-   Double_t t[3],r[3];
-   AliITSgeomMatrix *g;
-
-   fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-   for(i=0;i<fNmodules;i++){
-         g = this->GetGeomMatrix(i);
-         g->GetTranslation(t);
-         g->GetAngles(r);
-         for(j=0;j<3;j++){
-              t[j] += tran[j];
-              r[j] += rot[j];
-         } // end for j
-         g->SetTranslation(t);
-         g->SetAngles(r);
-   } // end for i
-   return;
+    //     This function performs a Cartesian translation and rotation of
+    // the full ITS from its default position by an amount determined by
+    // the three element arrays tran and rot. If every element
+    // of tran and rot are zero then there is no change made
+    // the geometry. The change is global in that the exact same translation
+    // and rotation is done to every detector element in the exact same way.
+    // The units of the translation are those of the Monte Carlo, usually cm,
+    // and those of the rotation are in radians. The elements of tran
+    // are tran[0] = x, tran[1] = y, and tran[2] = z.
+    // The elements of rot are rot[0] = rx, rot[1] = ry, and
+    // rot[2] = rz. A change in x will move the hole ITS in the ALICE
+    // global x direction, the same for a change in y. A change in z will
+    // result in a translation of the ITS as a hole up or down the beam line.
+    // A change in the angles will result in the inclination of the ITS with
+    // respect to the beam line, except for an effective rotation about the
+    // beam axis which will just rotate the ITS as a hole about the beam axis.
+    // Intputs are:
+    // Float_t *tran   A 3 element array representing the global translations.
+    //                 the elements are x,y,z in cm.
+    // Float_t *rot    A 3 element array representing the global rotation
+    //                 angles about the three axis x,y,z in radians
+    // Outputs are:
+    // none.
+    Int_t    i,j;
+    Double_t t[3],r[3];
+    AliITSgeomMatrix *g;
+
+    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
+    for(i=0;i<fNmodules;i++){
+       g = this->GetGeomMatrix(i);
+       g->GetTranslation(t);
+       g->GetAngles(r);
+       for(j=0;j<3;j++){
+           t[j] += tran[j];
+           r[j] += rot[j];
+       } // end for j
+       g->SetTranslation(t);
+       g->SetAngles(r);
+    } // end for i
+    return;
 }
-//___________________________________________________________________________
-void AliITSgeom::GlobalCylindericalChange(const Float_t *tran,const Float_t *rot){
-////////////////////////////////////////////////////////////////////////
-//     This function performs a cylindrical translation and rotation of
-// each ITS element by a fixed about in radius, rphi, and z from its
-// default position by an amount determined by the three element arrays
-// dtranslation and drotation. If every element of dtranslation and
-// drotation are zero then there is no change made the geometry. The
-// change is global in that the exact same distance change in translation
-// and rotation is done to every detector element in the exact same way.
-// The units of the translation are those of the Monte Carlo, usually cm,
-// and those of the rotation are in radians. The elements of dtranslation
-// are dtranslation[0] = r, dtranslation[1] = rphi, and dtranslation[2] = z.
-// The elements of drotation are drotation[0] = rx, drotation[1] = ry, and
-// drotation[2] = rz. A change in r will results in the increase of the
-// radius of each layer by the same about. A change in rphi will results in
-// the rotation of each layer by a different angle but by the same
-// circumferential distance. A change in z will result in a translation
-// of the ITS as a hole up or down the beam line. A change in the angles
-// will result in the inclination of the ITS with respect to the beam
-// line, except for an effective rotation about the beam axis which will
-// just rotate the ITS as a hole about the beam axis.
-////////////////////////////////////////////////////////////////////////
-   Int_t    i,j;
-   Double_t t[3],ro[3],r,r0,phi,rphi;
-   AliITSgeomMatrix *g;
-
-   fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-   for(i=0;i<fNmodules;i++){
-         g = this->GetGeomMatrix(i);
-         g->GetTranslation(t);
-         g->GetAngles(ro);
-        r = r0= TMath::Hypot(t[1],t[0]);
-        phi   = TMath::ATan2(t[1],t[0]);
-        rphi  = r0*phi;
-        r    += tran[0];
-        rphi += tran[1];
-        phi   = rphi/r0;
-         t[0]  = r*TMath::Cos(phi);
-         t[1]  = r*TMath::Sin(phi);
-         t[2] += tran[2];
-         for(j=0;j<3;j++){
-              ro[j] += rot[j];
-         } // end for j
-         g->SetTranslation(t);
-         g->SetAngles(ro);
-   } // end for i
-   return;
+//______________________________________________________________________
+void AliITSgeom::GlobalCylindericalChange(const Float_t *tran,
+                                         const Float_t *rot){
+    //     This function performs a cylindrical translation and rotation of
+    // each ITS element by a fixed about in radius, rphi, and z from its
+    // default position by an amount determined by the three element arrays
+    // tran and rot. If every element of tran and
+    // rot are zero then there is no change made the geometry. The
+    // change is global in that the exact same distance change in translation
+    // and rotation is done to every detector element in the exact same way.
+    // The units of the translation are those of the Monte Carlo, usually cm,
+    // and those of the rotation are in radians. The elements of tran
+    // are tran[0] = r, tran[1] = rphi, and tran[2] = z.
+    // The elements of rot are rot[0] = rx, rot[1] = ry, and
+    // rot[2] = rz. A change in r will results in the increase of the
+    // radius of each layer by the same about. A change in rphi will results in
+    // the rotation of each layer by a different angle but by the same
+    // circumferential distance. A change in z will result in a translation
+    // of the ITS as a hole up or down the beam line. A change in the angles
+    // will result in the inclination of the ITS with respect to the beam
+    // line, except for an effective rotation about the beam axis which will
+    // just rotate the ITS as a hole about the beam axis.
+    // Intputs are:
+    // Float_t *tran   A 3 element array representing the global translations.
+    //                 the elements are r,theta,z in cm/radians.
+    // Float_t *rot    A 3 element array representing the global rotation
+    //                 angles about the three axis x,y,z in radians
+    // Outputs are:
+    // none.
+    Int_t    i,j;
+    Double_t t[3],ro[3],r,r0,phi,rphi;
+    AliITSgeomMatrix *g;
+
+    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
+    for(i=0;i<fNmodules;i++){
+       g = this->GetGeomMatrix(i);
+       g->GetTranslation(t);
+       g->GetAngles(ro);
+       r = r0= TMath::Hypot(t[1],t[0]);
+       phi   = TMath::ATan2(t[1],t[0]);
+       rphi  = r0*phi;
+       r    += tran[0];
+       rphi += tran[1];
+       phi   = rphi/r0;
+       t[0]  = r*TMath::Cos(phi);
+       t[1]  = r*TMath::Sin(phi);
+       t[2] += tran[2];
+       for(j=0;j<3;j++){
+           ro[j] += rot[j];
+       } // end for j
+       g->SetTranslation(t);
+       g->SetAngles(ro);
+    } // end for i
+    return;
 }
-//___________________________________________________________________________
+//______________________________________________________________________
 void AliITSgeom::RandomChange(const Float_t *stran,const Float_t *srot){
-////////////////////////////////////////////////////////////////////////
-//     This function performs a Gaussian random displacement and/or
-// rotation about the present global position of each active
-// volume/detector of the ITS. The sigma of the random displacement
-// is determined by the three element array stran, for the
-// x y and z translations, and the three element array srot,
-// for the three rotation about the axis x y and z.
-////////////////////////////////////////////////////////////////////////
-   Int_t    i,j;
-   Double_t t[3],r[3];
-   //MI   TRandom ran;
-   AliITSgeomMatrix *g;
-
-   fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-   for(i=0;i<fNmodules;i++){
-         g = this->GetGeomMatrix(i);
-         g->GetTranslation(t);
-         g->GetAngles(r);
-         for(j=0;j<3;j++){
-              t[j] += gRandom->Gaus(0.0,stran[j]);
-              r[j] += gRandom->Gaus(0.0, srot[j]);
-         } // end for j
-         g->SetTranslation(t);
-         g->SetAngles(r);
-   } // end for i
-   return;
+    //     This function performs a Gaussian random displacement and/or
+    // rotation about the present global position of each active
+    // volume/detector of the ITS. The sigma of the random displacement
+    // is determined by the three element array stran, for the
+    // x y and z translations, and the three element array srot,
+    // for the three rotation about the axis x y and z.
+    // Intputs are:
+    // Float_t *stran  A 3 element array representing the global translations
+    //                 variances. The elements are x,y,z in cm.
+    // Float_t *srot   A 3 element array representing the global rotation
+    //                 angles variances about the three axis x,y,z in radians.
+    // Outputs are:
+    // none.
+    Int_t    i,j;
+    Double_t t[3],r[3];
+    AliITSgeomMatrix *g;
+
+    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
+    for(i=0;i<fNmodules;i++){
+       g = this->GetGeomMatrix(i);
+       g->GetTranslation(t);
+       g->GetAngles(r);
+       for(j=0;j<3;j++){
+           t[j] += gRandom->Gaus(0.0,stran[j]);
+           r[j] += gRandom->Gaus(0.0, srot[j]);
+       } // end for j
+       g->SetTranslation(t);
+       g->SetAngles(r);
+    } // end for i
+    return;
 }
-//___________________________________________________________________________
+//______________________________________________________________________
 void AliITSgeom::RandomCylindericalChange(const Float_t *stran,
                                          const Float_t *srot){
-////////////////////////////////////////////////////////////////////////
-//     This function performs a Gaussian random displacement and/or
-// rotation about the present global position of each active
-// volume/detector of the ITS. The sigma of the random displacement
-// is determined by the three element array stran, for the
-// r rphi and z translations, and the three element array srot,
-// for the three rotation about the axis x y and z. This random change
-// in detector position allow for the simulation of a random uncertainty
-// in the detector positions of the ITS.
-////////////////////////////////////////////////////////////////////////
-   Int_t    i,j;
-   Double_t t[3],ro[3],r,r0,phi,rphi;
-   TRandom ran;
-   AliITSgeomMatrix *g;
-
-   fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
-   for(i=0;i<fNmodules;i++){
-         g = this->GetGeomMatrix(i);
-         g->GetTranslation(t);
-         g->GetAngles(ro);
-        r = r0= TMath::Hypot(t[1],t[0]);
-        phi   = TMath::ATan2(t[1],t[0]);
-        rphi  = r0*phi;
-        r    += ran.Gaus(0.0,stran[0]);
-        rphi += ran.Gaus(0.0,stran[1]);
-        phi   = rphi/r0;
-         t[0]  = r*TMath::Cos(phi);
-         t[1]  = r*TMath::Sin(phi);
-         t[2] += ran.Gaus(0.0,stran[2]);
-         for(j=0;j<3;j++){
-              ro[j] += ran.Gaus(0.0, srot[j]);
-         } // end for j
-         g->SetTranslation(t);
-         g->SetAngles(ro);
-   } // end for i
-   return;
+    //     This function performs a Gaussian random displacement and/or
+    // rotation about the present global position of each active
+    // volume/detector of the ITS. The sigma of the random displacement
+    // is determined by the three element array stran, for the
+    // r rphi and z translations, and the three element array srot,
+    // for the three rotation about the axis x y and z. This random change
+    // in detector position allow for the simulation of a random uncertainty
+    // in the detector positions of the ITS.
+    // Intputs are:
+    // Float_t *stran  A 3 element array representing the global translations
+    //                 variances. The elements are r,theta,z in cm/readians.
+    // Float_t *srot   A 3 element array representing the global rotation
+    //                 angles variances about the three axis x,y,z in radians.
+    // Outputs are:
+    // none.
+    Int_t    i,j;
+    Double_t t[3],ro[3],r,r0,phi,rphi;
+    TRandom ran;
+    AliITSgeomMatrix *g;
+
+    fTrans = (fTrans && 0xfffd) + 2;  // set bit 1 true.
+    for(i=0;i<fNmodules;i++){
+       g = this->GetGeomMatrix(i);
+       g->GetTranslation(t);
+       g->GetAngles(ro);
+       r = r0= TMath::Hypot(t[1],t[0]);
+       phi   = TMath::ATan2(t[1],t[0]);
+       rphi  = r0*phi;
+       r    += ran.Gaus(0.0,stran[0]);
+       rphi += ran.Gaus(0.0,stran[1]);
+       phi   = rphi/r0;
+       t[0]  = r*TMath::Cos(phi);
+       t[1]  = r*TMath::Sin(phi);
+       t[2] += ran.Gaus(0.0,stran[2]);
+       for(j=0;j<3;j++){
+           ro[j] += ran.Gaus(0.0, srot[j]);
+       } // end for j
+       g->SetTranslation(t);
+       g->SetAngles(ro);
+    } // end for i
+    return;
 }
 //______________________________________________________________________
 void AliITSgeom::GeantToTracking(AliITSgeom &source){
-/////////////////////////////////////////////////////////////////////////
-//     Copy the geometry data but change it to go between the ALICE
-// Global coordinate system to that used by the ITS tracking. A slightly
-// different coordinate system is used when tracking. This coordinate 
-// system is only relevant when the geometry represents the cylindrical
-// ALICE ITS geometry. For tracking the Z axis is left alone but X-> -Y
-// and Y-> X such that X always points out of the ITS cylinder for every
-// layer including layer 1 (where the detectors are mounted upside down).
-//Begin_Html
-/*
-<img src="picts/ITS/AliITSgeomMatrix_T1.gif">
-*/
-//End_Html
-////////////////////////////////////////////////////////////////////////
-   Int_t    i,j,k,l,id[3];
-   Double_t R0[3][3],R1[3][3];
-   Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
-   Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
-
-   *this = source;  // copy everything
-   for(i=0;i<GetIndexMax();i++){
-       GetGeomMatrix(i)->GetIndex(id);
-       GetGeomMatrix(i)->GetMatrix(R0);
-       if(id[0]==1){ // Layer 1 is treated different from the others.
-          for(j=0;j<3;j++) for(k=0;k<3;k++){
-              R1[j][k] = 0.;
-              for(l=0;l<3;l++) R1[j][k] += A0[j][l]*R0[l][k];
-          } // end for j,k
-       }else{
-          for(j=0;j<3;j++) for(k=0;k<3;k++){
-              R1[j][k] = 0.;
-              for(l=0;l<3;l++) R1[j][k] += A1[j][l]*R0[l][k];
-          } // end for j,k
-       } // end if
-       GetGeomMatrix(i)->SetMatrix(R1);
-   } // end for i
-   this->fTrans = (this->fTrans && 0xfffe) + 1;  // set bit 0 true.
-   return;
+    //     Copy the geometry data but change it to go between the ALICE
+    // Global coordinate system to that used by the ITS tracking. A slightly
+    // different coordinate system is used when tracking. This coordinate 
+    // system is only relevant when the geometry represents the cylindrical
+    // ALICE ITS geometry. For tracking the Z axis is left alone but X-> -Y
+    // and Y-> X such that X always points out of the ITS cylinder for every
+    // layer including layer 1 (where the detectors are mounted upside down).
+    // Inputs are:
+    // AliITSgeom &source  The AliITSgeom class with which to make this
+    //                     a copy of.
+    // Outputs are:
+    // return  *this       The a new copy of source.
+    //Begin_Html
+    /*
+      <img src="picts/ITS/AliITSgeomMatrix_T1.gif">
+    */
+    //End_Html
+    Int_t    i,j,k,l,id[3];
+    Double_t r0[3][3],r1[3][3];
+    Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
+    Double_t a1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
+
+    *this = source;  // copy everything
+    for(i=0;i<GetIndexMax();i++){
+       GetGeomMatrix(i)->GetIndex(id);
+       GetGeomMatrix(i)->GetMatrix(r0);
+       if(id[0]==1){ // Layer 1 is treated different from the others.
+           for(j=0;j<3;j++) for(k=0;k<3;k++){
+               r1[j][k] = 0.;
+               for(l=0;l<3;l++) r1[j][k] += a0[j][l]*r0[l][k];
+           } // end for j,k
+       }else{
+           for(j=0;j<3;j++) for(k=0;k<3;k++){
+               r1[j][k] = 0.;
+               for(l=0;l<3;l++) r1[j][k] += a1[j][l]*r0[l][k];
+           } // end for j,k
+       } // end if
+       GetGeomMatrix(i)->SetMatrix(r1);
+    } // end for i
+    this->fTrans = (this->fTrans && 0xfffe) + 1;  // set bit 0 true.
+    return;
 }
 //______________________________________________________________________
-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
-// to Detectors (Modules) in that particular layer.
-////////////////////////////////////////////////////////////////////////
-     Int_t    i,l,a,e,in=0;
-     Double_t d,dn=1.0e10;
-     Bool_t   t=lay!=0; // skip if lay = 0 default value check all layers.
+Int_t AliITSgeom::GetNearest(const Double_t g[3],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
+    // to Detectors (Modules) in that particular layer.
+    // Inputs are:
+    // Double_t g[3]  The ALICE Cartesean global coordinate from which the
+    //                distance is to be calculated with.
+    // Int_t lay      The layer to restrict the search to. If layer=0 then
+    //                all layers are searched. Default is lay=0.
+    // Outputs are:
+    // return         The module number representing the nearest module.
+    Int_t    i,l,a,e,in=0;
+    Double_t d,dn=1.0e10;
+    Bool_t   t=lay!=0; // skip if lay = 0 default value check all layers.
 
-     for(i=0;i<fNmodules;i++){
-          if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
-          if((d=GetGeomMatrix(i)->Distance2(g))<dn){
-               dn = d;
-               in = i;
-          } // end if
-     } // end for i
-     return in;
+    for(i=0;i<fNmodules;i++){
+       if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
+       if((d=GetGeomMatrix(i)->Distance2(g))<dn){
+           dn = d;
+           in = i;
+       } // end if
+    } // end for i
+    return in;
 }
 //______________________________________________________________________
-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
-// to Detectors (Modules) in that particular layer. The number 27 comes 
-// from including the nearest detector and all those around it (up, down,
-// left, right, forwards, backwards, and the corners).
-////////////////////////////////////////////////////////////////////////
-     Int_t    i,l,a,e,in[27]={0,0,0,0,0,0,0,0,0,
-                              0,0,0,0,0,0,0,0,0,
-                              0,0,0,0,0,0,0,0,0,};
-     Double_t d,dn[27]={1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
-                        1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
-                        1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
-                        1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
-                        1.0e10,1.0e10,1.0e10};
-     Bool_t   t=(lay!=0); // skip if lay = 0 default value check all layers.
+void AliITSgeom::GetNearest27(const Double_t g[3],Int_t n[27],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
+    // to Detectors (Modules) in that particular layer. The number 27 comes 
+    // from including the nearest detector and all those around it (up, down,
+    // left, right, forwards, backwards, and the corners).
+    // Inputs are:
+    // Double_t g[3]  The ALICE Cartesean global coordinate from which the
+    //                distance is to be calculated with.
+    // Int_t lay      The layer to restrict the search to. If layer=0 then
+    //                all layers are searched. Default is lay=0.
+    // Outputs are:
+    // Int_t n[27]    The module number representing the nearest 27 modules
+    //                in order.
+    Int_t    i,l,a,e,in[27]={0,0,0,0,0,0,0,0,0,
+                            0,0,0,0,0,0,0,0,0,
+                            0,0,0,0,0,0,0,0,0,};
+    Double_t d,dn[27]={1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+                      1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+                      1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+                      1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,1.0e10,
+                      1.0e10,1.0e10,1.0e10};
+    Bool_t   t=(lay!=0); // skip if lay = 0 default value check all layers.
 
-     for(i=0;i<fNmodules;i++){
-          if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
-          for(a=0;a<27;a++){
-               d = GetGeomMatrix(i)->Distance2(g);
-               if(d<dn[a]){
-                   for(e=26;e>a;e--){dn[e] = dn[e-1];in[e] = in[e-1];}
-                   dn[a] = d; in[a] = i;
-               } // end if d<dn[i]
-          } // end for a
-     } // end for i
-     for(i=0;i<27;i++) n[i] = in[i];
+    for(i=0;i<fNmodules;i++){
+       if(t){GetModuleId(i,l,a,e);if(l!=lay) continue;}
+       for(a=0;a<27;a++){
+           d = GetGeomMatrix(i)->Distance2(g);
+           if(d<dn[a]){
+               for(e=26;e>a;e--){dn[e] = dn[e-1];in[e] = in[e-1];}
+               dn[a] = d; in[a] = i;
+           } // end if d<dn[i]
+       } // end for a
+    } // end for i
+    for(i=0;i<27;i++) n[i] = in[i];
 }
 //----------------------------------------------------------------------
index cba3677275d48460da17516b5fdb5b92202129c9..9ef4a4c411f738d31a57fc9784e5a2ad2198aeac 100644 (file)
 // the information needed to do the coordinate transformation are kept in
 // a specialized structure for ease of implementation.
 /////////////////////////////////////////////////////////////////////////
-#include <iostream.h>
-#include <fstream.h>
+#include <TObject.h>
 #include <TObjArray.h>
 #include <TVector.h>
 
 #include "AliITSgeomMatrix.h"
 
+class ofstream;
+class ifstream;
 
 typedef enum {kSPD=0, kSDD=1, kSSD=2, kSSDp=3,kSDDp=4} AliITSDetector;
 
@@ -36,36 +37,36 @@ class AliITSgeom : public TObject {
     AliITSgeom(const char *filename);  // Constructor
     AliITSgeom(Int_t itype,Int_t nlayers,Int_t *nlads,Int_t *ndets,
               Int_t nmods); // Constructor
-    //     this function allocates a AliITSgeomMatrix for a particular
-    // module.
+    // this function allocates a AliITSgeomMatrix for a particular module.
     void CreatMatrix(Int_t mod,Int_t lay,Int_t lad,Int_t det,
-                    AliITSDetector idet,Double_t tran[3],Double_t rot[10]);
+                    AliITSDetector idet,const Double_t tran[3],
+                    const Double_t rot[10]);
     void ReadNewFile(const char *filename);  // Constructor for new format.
     void WriteNewFile(const char *filename); // Output for new format.
     AliITSgeom(AliITSgeom &source);    // Copy constructor
-    void operator=(AliITSgeom &source);// = operator
+    AliITSgeom& operator=(AliITSgeom &source);// = operator
     virtual ~AliITSgeom();             // Default destructor
 // Getters
     Int_t GetTransformationType() const {return fTrans;}
 //
-    // returns kTRUE if the tranformation defined by this class is
-    // for Global Geant coordiante system to the local Geant coordinate system
+    // returns kTRUE if the transformation defined by this class is
+    // for Global GEANT coordinate system to the local GEANT coordinate system
     // of the detector. These are the transformation used by GEANT.
     Bool_t IsGeantToGeant()     const {return (fTrans == 0);}
-    // returns kTRUE if the tranformation defined by this class is
-    // for Global Geant coordiante system to the local "Tracking" coordinate
+    // returns kTRUE if the transformation defined by this class is
+    // for Global GEANT coordinate system to the local "Tracking" coordinate
     // system of the detector. These are the transformation used by the
     // Tracking code.
     Bool_t IsGeantToTracking()  const {return ((fTrans&&0xfffe)!= 0);}
-    // returns kTRUE if the tranformation defined by this class is
-    // for Global Geant coordiante system to the local Geant coordinate system
-    // of the detector but may have been displaced by some typicaly small
-    // abount. These are modified transformation simular to that used by GEANT.
+    // returns kTRUE if the transformation defined by this class is
+    // for Global GEANT coordinate system to the local GEANT coordinate system
+    // of the detector but may have been displaced by some typically small
+    // amount. These are modified transformation similar to that used by GEANT.
     Bool_t IsGeantToDisplaced() const {return ((fTrans&&0xfffd)!= 0);}
     // returns kTRUE if the shape defined by ishape has been defined in this
     // set of transformations. Typical values of ishape are kSPD, kSDD, kSSD,
     // SSD2.
-    Bool_t IsShapeDefined(Int_t ishape){
+    Bool_t IsShapeDefined(Int_t ishape)const {
        if(fShape!=0){return ((fShape->At(ishape))!=0);}else return kFALSE;}
 //
     //     This function returns a pointer to the particular AliITSgeomMatrix
@@ -74,22 +75,22 @@ class AliITSgeom : public TObject {
        return (AliITSgeomMatrix*)(fGm->At(index));}
     //     This function returns the number of detectors/ladder for a give 
     // layer. In particular it returns fNdet[layer-1].
-    Int_t GetNdetectors(const Int_t lay) const {return fNdet[lay-1];}
+    Int_t GetNdetectors(Int_t lay) const {return fNdet[lay-1];}
     //     This function returns the number of ladders for a give layer. In
     // particular it returns fNlad[layer-1].
-    Int_t GetNladders(const Int_t lay)   const {return fNlad[lay-1];}
+    Int_t GetNladders(Int_t lay)   const {return fNlad[lay-1];}
     //     This function returns the number of layers defined in the ITS
     // geometry. In particular it returns fNlayers.
     Int_t GetNlayers()                   const {return fNlayers;}
-    Int_t GetModuleIndex(const Int_t lay,const Int_t lad,const Int_t det);
+    Int_t GetModuleIndex(Int_t lay,Int_t lad,Int_t det);
     //     This function returns the module index number given the layer,
     // ladder and detector numbers put into the array id[3].
     Int_t GetModuleIndex(const Int_t *id){
        return GetModuleIndex(id[0],id[1],id[2]);}
-    void  GetModuleId(const Int_t index,Int_t &lay,Int_t &lad,Int_t &det);
+    void  GetModuleId(Int_t index,Int_t &lay,Int_t &lad,Int_t &det);
 //
-    Int_t GetStartDet(const Int_t dtype );
-    Int_t GetLastDet(const Int_t dtype);
+    Int_t GetStartDet(Int_t dtype );
+    Int_t GetLastDet(Int_t dtype);
     //     Returns the starting module index number for SPD detector,
     // assuming the modules are placed in the "standard" cylindrical
     // ITS structure.
@@ -115,74 +116,74 @@ class AliITSgeom : public TObject {
     // ITS structure.
     Int_t GetLastSSD()  {return GetModuleIndex(6,fNlad[5],fNdet[5]);}
     //     Returns the last module index number.
-    Int_t GetIndexMax() {return fNmodules;}
+    Int_t GetIndexMax() const {return fNmodules;}
 //
     //     This function returns the rotation angles for a give module 
     // in the Double point array ang[3]. The angles are in radians
-    void  GetAngles(const Int_t index,Double_t *ang) {
+    void  GetAngles(Int_t index,Double_t *ang) {
                     GetGeomMatrix(index)->GetAngles(ang);}
     //     This function returns the rotation angles for a give module
     // in the three floating point variables provided. rx = frx,
     // fy = fry, rz = frz. The angles are in radians
-    void  GetAngles(const Int_t index,Float_t &rx,Float_t &ry,Float_t &rz) {
+    void  GetAngles(Int_t index,Float_t &rx,Float_t &ry,Float_t &rz) {
                     Double_t a[3];GetAngles(index,a);
                     rx = a[0];ry = a[1];rz = a[2];}
     //     This function returns the rotation angles for a give detector on
     // a give ladder in a give layer in the three floating point variables
     // provided. rx = frx, fy = fry, rz = frz. The angles are in radians
-    void  GetAngles(const Int_t lay,const Int_t lad,const Int_t det,
+    void  GetAngles(Int_t lay,Int_t lad,Int_t det,
                     Float_t &rx,Float_t &ry,Float_t &rz) {
                     GetAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);}
 //
     //     This function returns the 6 GEANT rotation angles for a give 
     // module in the double point array ang[3]. The angles are in degrees
-    void  GetGeantAngles(const Int_t index,Double_t *ang){
+    void  GetGeantAngles(Int_t index,Double_t *ang){
        GetGeomMatrix(index)->SixAnglesFromMatrix(ang);}
 //
     //     This function returns the Cartesian translation for a give
     // module in the Double array t[3]. The units are
     // those of the Monte Carlo, generally cm.
-    void  GetTrans(const Int_t index,Double_t *t) {
+    void  GetTrans(Int_t index,Double_t *t) {
                    GetGeomMatrix(index)->GetTranslation(t);}
     //     This function returns the Cartesian translation for a give
     // module index in the three floating point variables provided.
     // x = fx0, y = fy0, z = fz0. The units are those of the Mont
     // Carlo, generally cm.
-    void  GetTrans(const Int_t index,Float_t &x,Float_t &y,Float_t &z) {
+    void  GetTrans(Int_t index,Float_t &x,Float_t &y,Float_t &z) {
                    Double_t t[3];GetTrans(index,t);
                    x = t[0];y = t[1];z = t[2];}
     //     This function returns the Cartesian translation for a give
     // detector on a give ladder in a give layer in the three floating
     // point variables provided. x = fx0, y = fy0, z = fz0. The units are
     // those of the Monte Carlo, generally cm.
-    void  GetTrans(const Int_t lay,const Int_t lad,const Int_t det,
+    void  GetTrans(Int_t lay,Int_t lad,Int_t det,
                    Float_t &x,Float_t &y,Float_t &z) {
                    GetTrans(GetModuleIndex(lay,lad,det),x,y,z);}
 //
     //     This function returns the Cartesian translation for a give
     // module in the Double array t[3]. The units are
     // those of the Monte Carlo, generally cm.
-    void  GetTransCyln(const Int_t index,Double_t *t) {
+    void  GetTransCyln(Int_t index,Double_t *t) {
                    GetGeomMatrix(index)->GetTranslationCylinderical(t);}
     //     This function returns the Cartesian translation for a give
     // module index in the three floating point variables provided.
     // x = fx0, y = fy0, z = fz0. The units are those of the Mont
     // Carlo, generally cm.
-    void  GetTransCyln(const Int_t index,Float_t &x,Float_t &y,Float_t &z) {
+    void  GetTransCyln(Int_t index,Float_t &x,Float_t &y,Float_t &z) {
                    Double_t t[3];GetTransCyln(index,t);
                    x = t[0];y = t[1];z = t[2];}
     //     This function returns the Cartesian translation for a give
     // detector on a give ladder in a give layer in the three floating
     // point variables provided. x = fx0, y = fy0, z = fz0. The units are
     // those of the Monte Carlo, generally cm.
-    void  GetTransCyln(const Int_t lay,const Int_t lad,const Int_t det,
+    void  GetTransCyln(Int_t lay,Int_t lad,Int_t det,
                    Float_t &x,Float_t &y,Float_t &z) {
                    GetTransCyln(GetModuleIndex(lay,lad,det),x,y,z);}
 //
     //      This function returns the Cartesian translation [cm] and the
     // 6 GEANT rotation angles [degrees]for a given layer ladder and
     // detector number, in the TVector x (at least 9 elements large).
-    void  GetCenterThetaPhi(const Int_t lay,const Int_t lad,const Int_t det,
+    void  GetCenterThetaPhi(Int_t lay,Int_t lad,Int_t det,
                            TVector &x){Double_t t[3],ang[6];
                            Int_t index=GetModuleIndex(lay,lad,det);
                            GetTrans(index,t);GetGeantAngles(index,ang);
@@ -192,35 +193,35 @@ class AliITSgeom : public TObject {
 //
     //     This function returns the rotation matrix in Double
     // precision for a given module.
-    void  GetRotMatrix(const Int_t index,Double_t mat[3][3]){
+    void  GetRotMatrix(Int_t index,Double_t mat[3][3]){
           GetGeomMatrix(index)->GetMatrix(mat);}
     //     This function returns the rotation matrix in a Double
     // precision pointer for a given module. mat[i][j] => mat[3*i+j].
-    void  GetRotMatrix(const Int_t index,Double_t *mat){
+    void  GetRotMatrix(Int_t index,Double_t *mat){
           Double_t rot[3][3];GetRotMatrix(index,rot);
           for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];}
     //     This function returns the rotation matrix in a floating 
     // precision pointer for a given layer ladder and detector module.
     // mat[i][j] => mat[3*i+j].
-    void  GetRotMatrix(const Int_t lay,const Int_t lad,const Int_t det,
+    void  GetRotMatrix(Int_t lay,Int_t lad,Int_t det,
                  Float_t *mat){GetRotMatrix(GetModuleIndex(lay,lad,det),mat);}
     //     This function returns the rotation matrix in a Double
     // precision pointer for a given layer ladder and detector module.
     // mat[i][j] => mat[3*i+j].
-    void  GetRotMatrix(const Int_t lay,const Int_t lad,const Int_t det,
+    void  GetRotMatrix(Int_t lay,Int_t lad,Int_t det,
                 Double_t *mat){GetRotMatrix(GetModuleIndex(lay,lad,det),mat);}
     //     This function returns the rotation matrix in a floating
     // precision pointer for a given module. mat[i][j] => mat[3*i+j].
-    void  GetRotMatrix(const Int_t index,Float_t *mat){
+    void  GetRotMatrix(Int_t index,Float_t *mat){
           Double_t rot[3][3];
          GetGeomMatrix(index)->GetMatrix(rot);
           for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++) mat[3*i+j] = rot[i][j];}
 //
     //     Will define fShape if it isn't already defined.
-    void DefineShapes(const Int_t size=4)
+    void DefineShapes(Int_t size=4)
        {if(fShape==0) fShape = new TObjArray(size);else fShape->Expand(size);}
-    //     this function returns a pointer to the class decribing a particluar
-    // detectory type based on AliITSDetector value. This will return a pointer
+    //     this function returns a pointer to the class describing a particular
+    // detector type based on AliITSDetector value. This will return a pointer
     // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or AliITSgeomSSD,
     // for example.
     virtual TObject *GetShape(const AliITSDetector idet)
@@ -229,38 +230,38 @@ class AliITSgeom : public TObject {
     // detector for a particular module index. This will return a pointer
     // to one of the classes AliITSgeomSPD, AliITSgeomSDD, or AliITSgeomSSD,
     // for example.
-    virtual TObject *GetShape(const Int_t index){
+    virtual TObject *GetShape(Int_t index){
        return fShape->At(GetGeomMatrix(index)->
                          GetDetectorIndex());}
     //     This function returns a pointer to the class describing the
     // detector for a particular layer ladder and detector numbers. This
     // will return a pointer to one of the classes AliITSgeomSPD,
     // AliITSgeomSDD, or AliITSgeomSSD, for example.
-    virtual TObject *GetShape(const Int_t lay,const Int_t lad,const Int_t det)
+    virtual TObject *GetShape(Int_t lay,Int_t lad,Int_t det)
                             {return GetShape(GetModuleIndex(lay,lad,det));}
 //
 //  Setters
     //     Sets the rotation angles and matrix for a give module index
     // via the double precision array a[3] [radians].
-    void SetByAngles(const Int_t index,const Double_t a[]){
+    void SetByAngles(Int_t index,const Double_t a[]){
        GetGeomMatrix(index)->SetAngles(a);}
     //     Sets the rotation angles and matrix for a give module index
     // via the 3 floating precision variables rx, ry, and rz [radians].
-    void SetByAngles(const Int_t index,
+    void SetByAngles(Int_t index,
                     const Float_t rx,const Float_t ry,const Float_t rz) {
                      Double_t a[3];a[0] = rx;a[1] = ry;a[2] = rz;
                      GetGeomMatrix(index)->SetAngles(a);}
     //     Sets the rotation angles and matrix for a give layer, ladder,
     // and detector numbers via the 3 floating precision variables rx,
     // ry, and rz [radians].
-    void SetByAngles(const Int_t lay,const Int_t lad,const Int_t det,
+    void SetByAngles(Int_t lay,Int_t lad,Int_t det,
                      const Float_t rx,const Float_t ry,const Float_t rz) {
                      SetByAngles(GetModuleIndex(lay,lad,det),rx,ry,rz);}
 //
     //     Sets the rotation angles and matrix for a give module index
     // via the Double precision array a[6] [degree]. The angles are those
     // defined by GEANT 3.12.
-    void SetByGeantAngles(const Int_t index,const Double_t *ang){
+    void SetByGeantAngles(Int_t index,const Double_t *ang){
        GetGeomMatrix(index)->MatrixFromSixAngles(ang);}
     //     Sets the rotation angles and matrix for a give layer, ladder
     // and detector, in the array id[3] via the Double precision array
@@ -270,19 +271,19 @@ class AliITSgeom : public TObject {
     //     Sets the rotation angles and matrix for a give layer, ladder
     // and detector, via the Double precision array a[6] [degree]. The
     // angles are those defined by GEANT 3.12.
-    void SetByGeantAngles(const Int_t lay,const Int_t lad,const Int_t det,
+    void SetByGeantAngles(Int_t lay,Int_t lad,Int_t det,
                          const Double_t *ang){
        SetByGeantAngles(GetModuleIndex(lay,lad,det),ang);}
 //
     //     This function sets a new translation vector, given by the
     // array x[3], for the Cartesian coordinate transformation
     // for a give module index.
-    void SetTrans(const Int_t index,Double_t x[]){
+    void SetTrans(Int_t index,Double_t x[]){
        GetGeomMatrix(index)->SetTranslation(x);}
     //     This function sets a new translation vector, given by the three
     // variables x, y, and z, for the Cartesian coordinate transformation
     // for the detector defined by layer, ladder and detector.
-    void SetTrans(const Int_t lay,const Int_t lad,const Int_t det,
+    void SetTrans(Int_t lay,Int_t lad,Int_t det,
                   Float_t x,Float_t y,Float_t z){Double_t t[3];
                   t[0] = x;t[1] = y;t[2] = z;
                   SetTrans(GetModuleIndex(lay,lad,det),t);}
@@ -297,7 +298,7 @@ class AliITSgeom : public TObject {
     // and replaces it with the one specified. This is primarily used to
     // changes the parameters to the segmentation class for a particular
     // type of detector.
-    void ReSetShape(const Int_t dtype,TObject *shp){
+    void ReSetShape(Int_t dtype,TObject *shp){
          fShape->RemoveAt(dtype);fShape->AddAt(shp,dtype);}
 //
 //  transformations
@@ -306,7 +307,7 @@ class AliITSgeom : public TObject {
     // defined by the layer, ladder, and detector numbers. The
     // global and local coordinate are given in two floating point
     // arrays g[3], and l[3].
-    void GtoL(const Int_t lay,const Int_t lad,const Int_t det,
+    void GtoL(Int_t lay,Int_t lad,Int_t det,
              const Float_t *g,Float_t *l){
          GtoL(GetModuleIndex(lay,lad,det),g,l);}
     //     Transforms from the ALICE Global coordinate system
@@ -320,7 +321,7 @@ class AliITSgeom : public TObject {
     // to the detector local coordinate system for the detector
     // 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){
+    void GtoL(Int_t index,const Float_t *g,Float_t *l){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          GetGeomMatrix(index)->GtoLPosition(dg,dl);
          for(i=0;i<3;i++) l[i] =dl[i];}
@@ -329,7 +330,7 @@ class AliITSgeom : public TObject {
     // defined by the layer, ladder, and detector numbers. The
     // global and local coordinate are given in two Double point
     // arrays g[3], and l[3].
-    void GtoL(const Int_t lay,const Int_t lad,const Int_t det,
+    void GtoL(Int_t lay,Int_t lad,Int_t det,
              const Double_t *g,Double_t *l){
          GtoL(GetModuleIndex(lay,lad,det),g,l);}
     //     Transforms from the ALICE Global coordinate system
@@ -343,7 +344,7 @@ class AliITSgeom : public TObject {
     // to the detector local coordinate system for the detector
     // 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){
+    void GtoL(Int_t index,const Double_t *g,Double_t *l){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          GetGeomMatrix(index)->GtoLPosition(dg,dl);
          for(i=0;i<3;i++) l[i] =dl[i];}
@@ -352,7 +353,7 @@ class AliITSgeom : public TObject {
     // to the detector local coordinate system (used for ITS tracking)
     // for the detector module index number. The global and local
     // coordinate are given in two Double point arrays g[3], and l[3].
-    void GtoLtracking(const Int_t index,const Double_t *g,Double_t *l){
+    void GtoLtracking(Int_t index,const Double_t *g,Double_t *l){
         if(IsGeantToTracking()) GtoL(index,g,l);
         else GetGeomMatrix(index)->GtoLPositionTracking(g,l);}
     //     Transforms from the ALICE Global coordinate system
@@ -366,7 +367,7 @@ class AliITSgeom : public TObject {
     // for the detector layer ladder and detector numbers. The global
     // and local coordinate are given in two Double point arrays g[3],
     // and l[3].
-    void GtoLtracking(const Int_t lay,const Int_t lad,const Int_t det,
+    void GtoLtracking(Int_t lay,Int_t lad,Int_t det,
                      const Double_t *g,Double_t *l){
         GtoLtracking(GetModuleIndex(lay,lad,det),g,l);}
 //
@@ -375,14 +376,14 @@ class AliITSgeom : public TObject {
     // for the detector layer ladder and detector numbers. The global
     // and local coordinate are given in two float point arrays g[3],
     // and l[3].
-    void GtoLMomentum(const Int_t lay,const Int_t lad,const Int_t det,
+    void GtoLMomentum(Int_t lay,Int_t lad,Int_t det,
                      const Float_t *g,Float_t *l){
                          GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);}
     //     Transforms of momentum types of quantities from the ALICE
     // Global coordinate system to the detector local coordinate system
     // 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){
+    void GtoLMomentum(Int_t index,const Float_t *g,Float_t *l){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          GetGeomMatrix(index)->GtoLMomentum(dg,dl);
          for(i=0;i<3;i++) l[i] =dl[i];}
@@ -391,14 +392,14 @@ class AliITSgeom : public TObject {
     // for the detector layer ladder and detector numbers. The global
     // and local coordinate are given in two Double point arrays g[3],
     // and l[3].
-    void GtoLMomentum(const Int_t lay,const Int_t lad,const Int_t det,
+    void GtoLMomentum(Int_t lay,Int_t lad,Int_t det,
                      const Double_t *g,Double_t *l){
          GtoLMomentum(GetModuleIndex(lay,lad,det),g,l);}
     //     Transforms of momentum types of quantities from the ALICE
     // Global coordinate system to the detector local coordinate system
     // 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){
+    void GtoLMomentum(Int_t index,const Double_t *g,Double_t *l){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dg[i] = g[i];
          GetGeomMatrix(index)->GtoLMomentum(dg,dl);
          for(i=0;i<3;i++) l[i] =dl[i];}
@@ -408,7 +409,7 @@ class AliITSgeom : public TObject {
     // (used for ITS tracking) for the detector module index number.
     // The global and local coordinate are given in two Double point
     // arrays g[3], and l[3].
-    void GtoLMomentumTracking(const Int_t index,const Double_t *g,Double_t *l){
+    void GtoLMomentumTracking(Int_t index,const Double_t *g,Double_t *l){
          if(IsGeantToTracking()) GtoLMomentum(index,g,l);
          else GetGeomMatrix(index)->GtoLMomentumTracking(g,l);}
     //     Transforms of momentum types of quantities from the ALICE
@@ -423,7 +424,7 @@ class AliITSgeom : public TObject {
     // (used for ITS tracking) for the detector layer ladder and detector
     // numbers. The global and local coordinate are given in two Double point
     // arrays g[3], and l[3].
-    void GtoLMomentumTracking(const Int_t lay,const Int_t lad,const Int_t det,
+    void GtoLMomentumTracking(Int_t lay,Int_t lad,Int_t det,
                              const Double_t *g,Double_t *l){
                         GtoLMomentumTracking(GetModuleIndex(lay,lad,det),g,l);}
 //
@@ -432,7 +433,7 @@ class AliITSgeom : public TObject {
     // defined by the layer, ladder, and detector numbers. The
     // global and local coordinate are given in two floating point
     // arrays g[3], and l[3].
-    void LtoG(const Int_t lay,const Int_t lad,const Int_t det,
+    void LtoG(Int_t lay,Int_t lad,Int_t det,
              const Float_t *l,Float_t *g){
                      LtoG(GetModuleIndex(lay,lad,det),l,g);}
     //     Transforms from the detector local coordinate system
@@ -446,7 +447,7 @@ class AliITSgeom : public TObject {
     // to the ALICE Global coordinate system for the detector
     // 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){
+    void LtoG(Int_t index,const Float_t *l,Float_t *g){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
          GetGeomMatrix(index)->LtoGPosition(dl,dg);
          for(i=0;i<3;i++) g[i] =dg[i];}
@@ -455,7 +456,7 @@ class AliITSgeom : public TObject {
     // defined by the layer, ladder, and detector numbers. The
     // global and local coordinate are given in two Double point
     // arrays g[3], and l[3].
-    void LtoG(const Int_t lay,const Int_t lad,const Int_t det,
+    void LtoG(Int_t lay,Int_t lad,Int_t det,
              const Double_t *l,Double_t *g){
                       LtoG(GetModuleIndex(lay,lad,det),l,g);}
     //     Transforms from the detector local coordinate system
@@ -469,7 +470,7 @@ class AliITSgeom : public TObject {
     // to the ALICE Global coordinate system for the detector
     // 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){
+    void LtoG(Int_t index,const Double_t *l,Double_t *g){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
          GetGeomMatrix(index)->LtoGPosition(dl,dg);
          for(i=0;i<3;i++) g[i] =dg[i];}
@@ -478,7 +479,7 @@ class AliITSgeom : public TObject {
     // for ITS tracking) to the ALICE Global coordinate system 
     // for the detector module index number. The global and local
     // coordinate are given in two Double point arrays g[3], and l[3].
-    void LtoGtracking(const Int_t index,const Double_t *l,Double_t *g){
+    void LtoGtracking(Int_t index,const Double_t *l,Double_t *g){
         if(IsGeantToTracking()) LtoG(index,l,g);
         else GetGeomMatrix(index)->LtoGPositionTracking(l,g);}
     //     Transforms from the detector local coordinate system (used
@@ -492,7 +493,7 @@ class AliITSgeom : public TObject {
     // for the detector layer ladder and detector numbers. The global
     // and local coordinate are given in two Double point arrays g[3],
     // and l[3].
-    void LtoGtracking(const Int_t lay,const Int_t lad,const Int_t det,
+    void LtoGtracking(Int_t lay,Int_t lad,Int_t det,
                      const Double_t *l,Double_t *g){
         LtoGtracking(GetModuleIndex(lay,lad,det),l,g);}
 //
@@ -501,14 +502,14 @@ class AliITSgeom : public TObject {
     // for the detector layer ladder and detector numbers. The global
     // and local coordinate are given in two float point arrays g[3],
     // and l[3].
-    void LtoGMomentum(const Int_t lay,const Int_t lad,const Int_t det,
+    void LtoGMomentum(Int_t lay,Int_t lad,Int_t det,
                      const Float_t *l,Float_t *g){
          LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);}
     //     Transforms of momentum types of quantities from the detector
     // local coordinate system to the ALICE Global coordinate system
     // 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){
+    void LtoGMomentum(Int_t index,const Float_t *l,Float_t *g){
          Double_t dg[3],dl[3];Int_t i;for(i=0;i<3;i++) dl[i] = l[i];
          GetGeomMatrix(index)->LtoGMomentum(dl,dg);
          for(i=0;i<3;i++) g[i] =dg[i];}
@@ -517,14 +518,14 @@ class AliITSgeom : public TObject {
     // for the detector layer ladder and detector numbers. The global
     // and local coordinate are given in two Double point arrays g[3],
     // and l[3].
-    void LtoGMomentum(const Int_t lay,const Int_t lad,const Int_t det,
+    void LtoGMomentum(Int_t lay,Int_t lad,Int_t det,
                           const Double_t *l,Double_t *g){
                         LtoGMomentum(GetModuleIndex(lay,lad,det),l,g);}
     //     Transforms of momentum types of quantities from the detector
     // local coordinate system to the ALICE Global coordinate system
     // for the detector module index number. The global and local
     // coordinate are given in two Double point arrays g[3], and l[3].
-    void LtoGMomentum(const Int_t index,const Double_t *l,Double_t *g){
+    void LtoGMomentum(Int_t index,const Double_t *l,Double_t *g){
          GetGeomMatrix(index)->LtoGMomentum(l,g);}
 //
     //     Transforms of momentum types of quantities from the detector 
@@ -532,7 +533,7 @@ class AliITSgeom : public TObject {
     // system ALICE Global for the detector module index number.
     // The global and local coordinate are given in two Double point
     // arrays g[3], and l[3].
-    void LtoGMomentumTracking(const Int_t index,const Double_t *l,Double_t *g){
+    void LtoGMomentumTracking(Int_t index,const Double_t *l,Double_t *g){
          if(IsGeantToTracking()) LtoGMomentum(index,l,g);
          else GetGeomMatrix(index)->LtoGMomentumTracking(l,g);}
     //     Transforms of momentum types of quantities from the detector
@@ -547,7 +548,7 @@ class AliITSgeom : public TObject {
     // Global coordinate system for the detector layer ladder and detector
     // numbers. The global and local coordinate are given in two Double point
     // arrays g[3], and l[3].
-    void LtoGMomentumTracking(const Int_t lay,const Int_t lad,const Int_t det,
+    void LtoGMomentumTracking(Int_t lay,Int_t lad,Int_t det,
                              const Double_t *l,Double_t *g){
                         LtoGMomentumTracking(GetModuleIndex(lay,lad,det),l,g);}
 //
@@ -556,7 +557,7 @@ class AliITSgeom : public TObject {
     // module index1 number to the detector module index2 number. The
     //  local coordinates are given in two Double point arrays l1[3],
     // and l2[3].
-    void LtoL(const Int_t index1,const Int_t index2,Double_t *l1,Double_t *l2){
+    void LtoL(Int_t index1,Int_t index2,Double_t *l1,Double_t *l2){
          Double_t g[3]; LtoG(index1,l1,g);GtoL(index2,g,l2);}
     //     Transforms from one detector local coordinate system
     // to another detector local coordinate system for the detector
@@ -571,7 +572,7 @@ class AliITSgeom : public TObject {
     // for ITS tracking) for the detector module index1 number to the
     // detector module index2 number. The local coordinates are given
     // in two Double point arrays l1[3], and l2[3].
-    void LtoLtracking(const Int_t index1,const Int_t index2,
+    void LtoLtracking(Int_t index1,Int_t index2,
                           Double_t *l1,Double_t *l2){
          Double_t g[3]; LtoGtracking(index1,l1,g);GtoLtracking(index2,g,l2);}
     //     Transforms from one detector local coordinate system (used for
@@ -589,7 +590,7 @@ class AliITSgeom : public TObject {
     // system for the detector module index1 number to the detector
     // module index2 number. The local coordinates are given in two
     // Double point arrays l1[3], and l2[3].
-    void LtoLMomentum(const Int_t index1,const Int_t index2,
+    void LtoLMomentum(Int_t index1,Int_t index2,
                      const Double_t *l1,Double_t *l2){
          Double_t g[3]; LtoGMomentum(index1,l1,g);GtoLMomentum(index2,g,l2);}
     //     Transforms of momentum types of quantities from one detector
@@ -607,7 +608,7 @@ class AliITSgeom : public TObject {
     // module index1 number to the detector module index2 number. The
     // local coordinates are given in two Double point arrays l1[3],
     // and l2[3].
-    void LtoLMomentumTracking(const Int_t index1,const Int_t index2,
+    void LtoLMomentumTracking(Int_t index1,Int_t index2,
                           Double_t *l1,Double_t *l2){
          Double_t g[3]; LtoGMomentumTracking(index1,l1,g);
                         GtoLMomentumTracking(index2,g,l2);}
@@ -625,14 +626,14 @@ class AliITSgeom : public TObject {
     // the ALICE Global coordinate system to a detector local coordinate
     // system. The specific detector is determined by the module index
     // number.
-    void GtoLErrorMatrix(const Int_t index,const Double_t **g,Double_t **l){
+    void GtoLErrorMatrix(Int_t index,const Double_t **g,Double_t **l){
          GetGeomMatrix(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
     // system (used by ITS tracking). The specific detector is determined
     // by the module index number.
-    void GtoLErrorMatrixTracking(const Int_t index,const Double_t **g,
+    void GtoLErrorMatrixTracking(Int_t index,const Double_t **g,
                                 Double_t **l){
        if(IsGeantToTracking()) GetGeomMatrix(index)->GtoLPositionError((
            Double_t (*)[3])g,(Double_t (*)[3])l);
@@ -643,14 +644,14 @@ class AliITSgeom : public TObject {
     // 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){
+    void LtoGErrorMatrix(Int_t index,const Double_t **l,Double_t **g){
          GetGeomMatrix(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
     // ALICE Global coordinate system. The specific detector is determined
     // by the module index number.
-    void LtoGErrorMatrixTracking(const Int_t index,const Double_t **l,
+    void LtoGErrorMatrixTracking(Int_t index,const Double_t **l,
                                 Double_t **g){
          if(IsGeantToTracking()) GetGeomMatrix(index)->LtoGPositionError((
            Double_t (*)[3])g,(Double_t (*)[3])l);
@@ -661,7 +662,7 @@ class AliITSgeom : public TObject {
     // one detector local coordinate system to another detector local
     // coordinate system. The specific detector is determined by the
     // two module index number index1 and index2.
-    void LtoLErrorMatrix(const Int_t index1,const Int_t index2,
+    void LtoLErrorMatrix(Int_t index1,Int_t index2,
                         const Double_t **l1,Double_t **l2){
        Double_t g[3][3];
                   LtoGErrorMatrix(index1,l1,(Double_t **)g);
@@ -672,27 +673,55 @@ class AliITSgeom : public TObject {
     // another detector local coordinate system (used by ITS tracking).
     // The specific detector is determined by the two module index number
     // index1 and index2.
-    void LtoLErrorMatrixTraking(const Int_t index1,const Int_t index2,
+    void LtoLErrorMatrixTraking(Int_t index1,Int_t index2,
                         const Double_t **l1,Double_t **l2){Double_t g[3][3];
                   LtoGErrorMatrixTracking(index1,l1,(Double_t **)g);
                   GtoLErrorMatrixTracking(index2,(const Double_t **)g,l2);}
 //  Find Specific Modules
-    Int_t    GetNearest(const Double_t g[3],const Int_t lay=0);
-    void     GetNearest27(const Double_t g[3],Int_t n[27],const Int_t lay=0);
+    // Locate the nearest module to the point g, in ALICE global Cartesian
+    // coordinates [cm] in a give layer. If layer = 0 then it search in
+    // all layers.
+    Int_t    GetNearest(const Double_t g[3],Int_t lay=0);
+    // Locates the nearest 27 modules, in nearest order, to the point g, in
+    // ALICE global Cartesian coordinates [cm] in a give layer. If layer = 0
+    // then it searches in all layers. (there are 27 elements in a 3x3x3
+    // cube.
+    void     GetNearest27(const Double_t g[3],Int_t n[27],Int_t lay=0);
     // Returns the distance [cm] between the point g[3] and the center of
     // the detector/module specified by the the module index number.
-    Double_t Distance(const Int_t index,const Double_t g[3]){
+    Double_t Distance(Int_t index,const Double_t g[3]){
          return  TMath::Sqrt(GetGeomMatrix(index)->Distance2(g));}
 //  Geometry manipulation
+    // This function performs a Cartesian translation and rotation of
+    // the full ITS from its default position by an amount determined by
+    // the three element arrays tran and rot.
     void GlobalChange(const Float_t  *tran,const Float_t  *rot);
+    // This function performs a Cylindrical translation and rotation of
+    // the full ITS from its default position by an amount determined by
+    // the three element arrays tran and rot.
     void GlobalCylindericalChange(const Float_t *tran,const Float_t *rot);
+    // This function performs a Gaussian random displacement and/or
+    // rotation about the present global position of each active
+    // volume/detector of the ITS with variances given by stran and srot.
     void RandomChange(const Float_t *stran,const Float_t *srot);
+    // This function performs a Gaussian random displacement and/or
+    // rotation about the present global position of each active
+    // volume/detector of the ITS with variances given by stran and srot.
+    // But in Cylindrical coordinates.
     void RandomCylindericalChange(const Float_t *stran,const Float_t *srot);
+    // This function converts these transformations from Alice global and
+    // local to Tracking global and local.
     void GeantToTracking(AliITSgeom &source); // This converts the geometry
 //  Other routines.
+    // This routine prints, to a file, the difference between this class
+    // and "other".
     void PrintComparison(FILE *fp,AliITSgeom *other);
-    void PrintData(FILE *fp,const Int_t lay,const Int_t lad,const Int_t det);
+    // This routine prints, to a file, the contents of this class.
+    void PrintData(FILE *fp,Int_t lay,Int_t lad,Int_t det);
+    // This function prints out this class in a single stream. This steam
+    // can be read by ReadGeom.
     ofstream &PrintGeom(ofstream &out);
+    // This function reads in that single steam printed out by PrintGeom.
     ifstream &ReadGeom(ifstream &in);
 
  private:
@@ -700,9 +729,9 @@ class AliITSgeom : public TObject {
     Int_t      fTrans;   // Flag to keep track of which transformation 
     Int_t      fNmodules;// The total number of modules
     Int_t      fNlayers; // The number of layers.
-    Int_t     *fNlad;    //[fNlayers] Array of the number of ladders/layer(layer)
-    Int_t     *fNdet;    //[fNlayers] Array of the number of detectors/ladder(layer)
-    TObjArray *fGm;      // Structure of trans. and rotation.
+    Int_t     *fNlad;  //[fNlayers] Array of the number of ladders/layer(layer)
+    Int_t     *fNdet;//[fNlayers] Array of the number of detector/ladder(layer)
+    TObjArray *fGm;      // Structure of translation. and rotation.
     TObjArray *fShape;   // Array of shapes and detector information.
 
     ClassDef(AliITSgeom,2) // ITS geometry class
index 960691b2170d54c11125501bbee5553793634db1..0056a34dd7700fbb22ce054b70a86076063bd526 100644 (file)
 
 /*
 $Log$
+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
@@ -50,6 +54,17 @@ Revision 1.1.2.1  2000/06/04 16:32:31  Nilsen
 A new class to hold the matrix information needed by AliITSgeom.
 
 */
+
+////////////////////////////////////////////////////////////////////////
+// This is the implementation file for AliITSgeomMatrix class. It 
+// contains the routines to manipulate, setup, and queary the geometry 
+// of a given ITS module. An ITS module may be one of at least three
+// ITS detector technologies, Silicon Pixel, Drift, or Strip Detectors,
+// and variations of these in size and/or layout. These routines let
+// one go between ALICE global coordiantes (cm) to a given modules 
+// specific local coordinates (cm).
+////////////////////////////////////////////////////////////////////////
+
 #include <iostream.h>
 #include <iomanip.h>
 #include <TMath.h>
@@ -400,7 +415,7 @@ void AliITSgeomMatrix::LtoGMomentum(const Double_t l[3],Double_t g[3]){
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionError(Double_t g[3][3],
+void AliITSgeomMatrix::GtoLPositionError(const Double_t g[3][3],
                                                Double_t l[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Global coordinates it is rotated so that 
@@ -415,7 +430,7 @@ void AliITSgeomMatrix::GtoLPositionError(Double_t g[3][3],
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionError(Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionError(const Double_t l[3][3],
                                                Double_t g[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // Given an Uncertainty matrix in Local coordinates it is rotated so that 
@@ -555,7 +570,7 @@ void AliITSgeomMatrix::LtoGMomentumTracking(const Double_t l[3],
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::GtoLPositionErrorTracking(Double_t g[3][3],
+void AliITSgeomMatrix::GtoLPositionErrorTracking(const Double_t g[3][3],
                                                 Double_t l[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
@@ -571,21 +586,21 @@ void AliITSgeomMatrix::GtoLPositionErrorTracking(Double_t g[3][3],
 //End_Html
 ////////////////////////////////////////////////////////////////////////
        Int_t    i,j,k,m;
-       Double_t Rt[3][3];
-       Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
-       Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
+       Double_t rt[3][3];
+       Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
+       Double_t a1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
 
        if(fid[0]==1) for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
-           Rt[i][k] = A0[i][j]*fm[j][k];
+           rt[i][k] = a0[i][j]*fm[j][k];
        else for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
-           Rt[i][k] = A1[i][j]*fm[j][k];
+           rt[i][k] = a1[i][j]*fm[j][k];
        for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
-               l[i][m] = Rt[j][i]*g[j][k]*Rt[k][m];
+               l[i][m] = rt[j][i]*g[j][k]*rt[k][m];
                // g = R^t l R
        return;
 }
 //----------------------------------------------------------------------
-void AliITSgeomMatrix::LtoGPositionErrorTracking(Double_t l[3][3],
+void AliITSgeomMatrix::LtoGPositionErrorTracking(const Double_t l[3][3],
                                                 Double_t g[3][3]){
 ////////////////////////////////////////////////////////////////////////
 // A slightly different coordinate system is used when tracking.
@@ -601,16 +616,16 @@ void AliITSgeomMatrix::LtoGPositionErrorTracking(Double_t l[3][3],
 //End_Html
 ////////////////////////////////////////////////////////////////////////
        Int_t    i,j,k,m;
-       Double_t Rt[3][3];
-       Double_t A0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
-       Double_t A1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
+       Double_t rt[3][3];
+       Double_t a0[3][3] = {{0.,+1.,0.},{-1.,0.,0.},{0.,0.,+1.}};
+       Double_t a1[3][3] = {{0.,-1.,0.},{+1.,0.,0.},{0.,0.,+1.}};
 
        if(fid[0]==1) for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
-           Rt[i][k] = A0[i][j]*fm[j][k];
+           rt[i][k] = a0[i][j]*fm[j][k];
        else for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)
-           Rt[i][k] = A1[i][j]*fm[j][k];
+           rt[i][k] = a1[i][j]*fm[j][k];
        for(i=0;i<3;i++)for(j=0;j<3;j++)for(k=0;k<3;k++)for(m=0;m<3;m++)
-               g[i][m] = Rt[i][j]*l[j][k]*Rt[m][k];
+               g[i][m] = rt[i][j]*l[j][k]*rt[m][k];
                // g = R l R^t
        return;
 }
index b3777ff64cc28b1fc8d99698a6c00cef19fe15c0..29dff4d92674659949a478e40d739ec0d28ba406 100644 (file)
 // By Bjorn S. Nilsen
 ////////////////////////////////////////////////////////////////////////
 
+#include <TObject.h>
+
 class AliITSgeomMatrix : public TObject {
  public:
        AliITSgeomMatrix(); // Default constructor
+       // Standard constructor #1
        AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
                         const Double_t rot[3],const Double_t tran[3]);
+       // Standard constructor #2
         AliITSgeomMatrix(const Int_t idt,const Int_t id[3],
                         Double_t matrix[3][3],const Double_t tran[3]);
-        AliITSgeomMatrix(const Double_t rotd[6]/*degrees Geant angles*/,
+       // Standard constructor #3
+        AliITSgeomMatrix(const Double_t rotd[6]/*degrees GEANT angles*/,
                          const Int_t idt,const Int_t id[3],
                          const Double_t tran[3]);
+       // Copy operator
        AliITSgeomMatrix(const AliITSgeomMatrix &source);
+       // Alignment operator
        void operator=(const AliITSgeomMatrix &sourse); // copy
-       virtual ~AliITSgeomMatrix(){};
+       virtual ~AliITSgeomMatrix(){}; // default constructor.
+       // Prints a line describing the output format of the function Print.
        void PrintComment(ostream *os);
+       // Prints out the content of this class in ASCII format.
        void Print(ostream *os);
+       // Prints out the content of this class in ASCII format but includes
+       // formating and strings that make it more humanly readable.
        void PrintTitles(ostream *os);
+       // Reads in the content of this class in the format of Print
        void Read(istream *is);
 
+       // Given the rotation angles [radians] it fills frot and computes
+       // the rotation matrix fm.
        void SetAngles(const Double_t rot[3]){// [radians]
               for(Int_t i=0;i<3;i++)frot[i] = rot[i];this->MatrixFromAngle();}
+       // Sets the translation vector and computes fCylR and fCylPhi.
        void SetTranslation(const Double_t tran[3]){
                            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();}
+       // sets the rotation matrix and computes the rotation angles [radians]
        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();}
+       // Sets the detector index value
        void SetDetectorIndex(const Int_t idt) {fDetectorIndex = idt;}
+       // Sets the detector layer, ladder, detector (id) values.
        void SetIndex(const Int_t id[3]){
                           for(Int_t i=0;i<3;i++) fid[i] = id[i];}
+       // Returns the rotation angles [radians]
        void GetAngles(Double_t rot[3]){// [radians]
                           for(Int_t i=0;i<3;i++)  rot[i] = frot[i];}
+       // Returns the translation vector [cm]
        void GetTranslation(Double_t tran[3]){
                            for(Int_t i=0;i<3;i++) tran[i] = ftran[i];}
+       // Returns the translation vector in cylindrical
+       // coordinates [cm,radians]
        void GetTranslationCylinderical(Double_t tran[3]){
                            tran[0] = fCylR;
                            tran[1] = fCylPhi;
                            tran[2] = ftran[2];}
+       // Returns the values of the rotation matrix
        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;}
+       // Returns the detector index value.
+       Int_t GetDetectorIndex() const {return fDetectorIndex;}
+       // returns the modules index layer, ladder, detector
        void  GetIndex(Int_t id[3]){for(Int_t i=0;i<3;i++) id[i] = fid[i];}
+       // Sets the rotation matrix based on the 6 GEANT rotation
+       // angles [radian]
        void  MatrixFromSixAngles(const Double_t *ang);
+       // Returns the 6 GEANT rotation angles [radians] from the
+       // existing rotation matrix.
        void  SixAnglesFromMatrix(Double_t *ang);
 
+       // Given a position in Cartesian ALICE global coordinates [cm]
+       // returns the position in Cartesian detector/module local
+       //coordinates [cm]
        void GtoLPosition(const Double_t g[3],Double_t l[3]);
+       // Given a position in Cartesian detector/module local coordinates [cm]
+       // returns the position in Cartesian ALICE global
+       //coordinates [cm]
        void LtoGPosition(const Double_t l[3],Double_t g[3]);
+       // Given a momentum in Cartesian ALICE global coordinates
+       // returns the momentum in Cartesian detector/module local
+       //coordinates
        void GtoLMomentum(const Double_t g[3],Double_t l[3]);
+       // Given a momentum in Cartesian detector/module local coordinates 
+       // returns the momentum in Cartesian ALICE global coordinates
        void LtoGMomentum(const Double_t l[3],Double_t g[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]);
+       // given a position error matrix in ALICE Cartesian global
+       // coordinates [cm] returns a position error matrix in detector/
+       // module local Cartesian local coordinates [cm]
+       void GtoLPositionError(const Double_t g[3][3],Double_t l[3][3]);
+       // given a position error matrix in detector/module Cartesian local
+       // coordinates [cm] returns a position error matrix in ALICE
+       // Cartesian global coordinates [cm]
+       void LtoGPositionError(const Double_t l[3][3],Double_t g[3][3]);
        // Tracking Related Routines
        void GtoLPositionTracking(const Double_t g[3],Double_t l[3]);
+       // Given a position in Cartesian Tracking global coordinates [cm]
+       // returns the position in Cartesian detector/module local
+       // coordinates [cm]
        void LtoGPositionTracking(const Double_t l[3],Double_t g[3]);
+       // Given a position in Cartesian detector/module local coordinates [cm]
+       // returns the position in Cartesian Tracking global
+       //coordinates [cm]
        void GtoLMomentumTracking(const Double_t g[3],Double_t l[3]);
+       // Given a momentum in Cartesian detector/module local coordinates 
+       // returns the momentum in Cartesian Tracking global coordinates
        void LtoGMomentumTracking(const Double_t l[3],Double_t g[3]);
-       void GtoLPositionErrorTracking(Double_t g[3][3],
+       // given a position error matrix in Tracking Cartesian global
+       // coordinates [cm] returns a position error matrix in detector/
+       // module local Cartesian local coordinates [cm]
+       void GtoLPositionErrorTracking(const Double_t g[3][3],
                                       Double_t l[3][3]);
-       void LtoGPositionErrorTracking(Double_t l[3][3],
+       // given a position error matrix in detector/module Cartesian local
+       // coordinates [cm] returns a position error matrix in Tracking
+       // Cartesian global coordinates [cm]
+       void LtoGPositionErrorTracking(const Double_t l[3][3],
                                       Double_t g[3][3]);
+       // Computes the distance squared [cm^2] between a point t[3] and
+       // this module/detector
        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;}
                  return d;}
  private: // private functions
+       // Given the rotation matrix fm it fills the rotation angles frot
        void MatrixFromAngle();
+       // Given the rotation angles frot it fills the rotation matrix fm
        void AngleFromMatrix();
  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 ftran[3];       // Translation vector of module x,y,z.
-       Double_t fCylR,fCylPhi;  //! Translation vector in Cylinderical coord.
+       Double_t fCylR,fCylPhi;  //! Translation vector in Cylindrical coord.
        Double_t fm[3][3];       // Rotation matrix based on frot.
 
        // Note, fCylR and fCylPhi are added as data members because it costs
index 973f061dbff8f7d10c3ad89e8ec036b2d5dd845e..c3a2500c4ee108b9d83c761868db6e5bd9d69957 100644 (file)
 
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry 
+tree for the ITS pixels. This fixes both the funny distribution of pixel 
+coordinates and the missing hits/digits/points in many sectors of the ITS 
+pixel barrel. Also included is a patch to properly get and use the detector 
+dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -45,11 +52,18 @@ Revision 1.2  1999/09/29 09:24:20  fca
 Introduction of the Copyright and cvs Log
 
 */
+
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Drift Detector, SDD, specific geometry.
+// It is being replaced by AliITSsegmentationSDD class. This file also
+// constains classes derived from AliITSgeomSDD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
+
 #include <iostream.h>
 #include <iomanip.h>
 #include <stdlib.h>
 #include <TShape.h>
-#include <TBRIK.h>
 
 #include "AliITSgeomSDD.h"
 
@@ -288,6 +302,9 @@ istream &operator>>(istream &is,AliITSgeomSDD &r){
 //======================================================================
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -310,7 +327,8 @@ AliITSgeomSDD256::AliITSgeomSDD256() : AliITSgeomSDD(){
     // Default Constructor
 }
 //----------------------------------------------------------------------
-AliITSgeomSDD256::AliITSgeomSDD256(Int_t npar,Float_t *par) : AliITSgeomSDD(){
+AliITSgeomSDD256::AliITSgeomSDD256(Int_t npar,const Float_t *par) : 
+    AliITSgeomSDD(){
 ////////////////////////////////////////////////////////////////////////
 //    constructor
 /*
@@ -704,7 +722,7 @@ _____________________________________________
 #R              (37779, 35085), pad size (184, 140)
 */
 ////////////////////////////////////////////////////////////////////////
-    const Float_t kDxyz[]   = {3.6250,0.01499,4.3794};//cm. (Geant 3.12 units)
+//   const Float_t kDxyz[]   = {3.6250,0.01499,4.3794};//cm. (Geant 3.12 units)
                                       // Size of sensitive region of detector
     const Float_t kPeriod   = 25.0E-09; // 40 MHz sampling frequence
     const Float_t kVelocity = 5.46875E+03; // cm/s drift velocity
@@ -713,15 +731,15 @@ _____________________________________________
     const Int_t   kNAnodes  = 256;  // nuber of anodes connected
     const Float_t kAnodePitch = 0.0294; // cm
     const Float_t kAnodesZ  = -3.7485; // cm Starting location of anodes in z
-    Float_t AnodeLowEdges[kNAnodes+1];
+    Float_t anodeLowEdges[kNAnodes+1];
     Int_t i;
 
 //    cout << "AliITSgeomSDD256 default creator called: start" << end;
-    AnodeLowEdges[0] = kAnodesZ;
-    for(i=0;i<kNAnodes;i++) AnodeLowEdges[i+1] = kAnodePitch+AnodeLowEdges[i];
+   anodeLowEdges[0] = kAnodesZ;
+    for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kAnodePitch+anodeLowEdges[i];
     AliITSgeomSDD::ResetSDD(par,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
-                           kNAnodes+1,AnodeLowEdges,
-                           kNAnodes+1,AnodeLowEdges);
+                           kNAnodes+1,anodeLowEdges,
+                           kNAnodes+1,anodeLowEdges);
 //    cout << "AliITSgeomSDD256 default creator called: end" << endl;
 }
 //________________________________________________________________________
@@ -745,6 +763,9 @@ istream &operator>>(istream &is,AliITSgeomSDD256 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -774,16 +795,16 @@ AliITSgeomSDD300::AliITSgeomSDD300() : AliITSgeomSDD(){
     const Float_t kAnodeXL = -3.500; // cm
     const Float_t kAnodeXR = +3.500; // cm
     const Float_t kAnodesZ = -3.75; // cm
-    Float_t AnodeLowEdges[kNAnodes+1];
+    Float_t anodeLowEdges[kNAnodes+1];
     const Float_t kanode = 0.0250;// cm anode separation.
     Int_t i;
 
 //    cout << "AliITSgeomSDD300 default creator called: start" << endl;
-    AnodeLowEdges[0] = kAnodesZ;
-    for(i=0;i<kNAnodes;i++) AnodeLowEdges[i+1] = kanode+AnodeLowEdges[i];
+   anodeLowEdges[0] = kAnodesZ;
+    for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kanode+anodeLowEdges[i];
     AliITSgeomSDD::ResetSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
-                           kNAnodes+1,AnodeLowEdges,
-                           kNAnodes+1,AnodeLowEdges);
+                           kNAnodes+1,anodeLowEdges,
+                           kNAnodes+1,anodeLowEdges);
 //    cout << "AliITSgeomSDD300 default creator called: end" << endl;
 }
 //________________________________________________________________________
index 034173f9a7bcb26079ddf2e94ad92f543453addc..076b57e50a6e50bf79165f0038b22055cf35b288 100644 (file)
@@ -4,6 +4,15 @@
  * See cxx source for full Copyright notice                               */
 
 /* $Id$ */
+
+
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Drift Detector, SDD, specific geometry.
+// It is being replaced by AliITSsegmentationSDD class. This file also
+// constains classes derived from AliITSgeomSDD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
+
 #include <TObject.h>
 #include <TBRIK.h>
 
@@ -91,7 +100,7 @@ class AliITSgeomSDD256 : public AliITSgeomSDD {
 
  public:
     AliITSgeomSDD256();
-    AliITSgeomSDD256(Int_t npar,Float_t *par);
+    AliITSgeomSDD256(Int_t npar,const Float_t *par);
 
     // This clas now has version 0 so that it will not be written to a root
     // file. This is good since there are no longer any data members to this
index b3f72dff2f3701834a81a22f0b9a35f6ea02064a..3ac4a4b4ca93ff48dd09fe60d31d7a100b06c4d9 100644 (file)
 
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry 
+tree for the ITS pixels. This fixes both the funny distribution of pixel 
+coordinates and the missing hits/digits/points in many sectors of the ITS 
+pixel barrel. Also included is a patch to properly get and use the detector 
+dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  2001/04/26 22:44:34  nilsen
 Bug fix.
 
@@ -30,6 +37,13 @@ Additional smaller modifications are still to come.
 
 */
 
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Pixel Detector, SPD, specific geometry.
+// It is being replaced by AliITSsegmentationSPD class. This file also
+// constains classes derived from AliITSgeomSPD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
+
 #include <iostream.h>
 #include <iomanip.h>
 #include <TShape.h>
@@ -218,6 +232,9 @@ istream &operator>>(istream &is,AliITSgeomSPD &r){
 
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  2001/04/26 22:44:34  nilsen
 Bug fix.
 
@@ -315,6 +332,9 @@ istream &operator>>(istream &is,AliITSgeomSPD300 &r){
 //=====================================================================
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  2001/04/26 22:44:34  nilsen
 Bug fix.
 
@@ -368,11 +388,11 @@ AliITSgeomSPD425Short::AliITSgeomSPD425Short(Int_t npar,Float_t *par) :
 // micron pixels (large detector).
 ////////////////////////////////////////////////////////////////////////
 
-    const Float_t kdx=0.6400,kdy=0.015,kdz=3.480;   // cm; Standard pixel
-                                                    // detector size is 2dx
-                                                    //  wide, 2dz long, and
-                                                    //  2dy thick. Geant 3.12
-                                                    // units.
+    const Float_t kdx=0.6400/*,kdy=0.015*/,kdz=3.480; // cm; Standard pixel
+                                                      // detector size is 2dx
+                                                      //  wide, 2dz long, and
+                                                      //  2dy thick. Geant 3.12
+                                                      // units.
     const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
     const Int_t   knbinx = 256;    // number of pixels along x direction.
     const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
@@ -442,6 +462,9 @@ istream &operator>>(istream &is,AliITSgeomSPD425Short &r){
 
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  2001/04/26 22:44:34  nilsen
 Bug fix.
 
index 39e8c4a3f8edbc124153ba85bd23cb754116e065..b232198a3d5f7cbe778d30b40b794129129f41bc 100644 (file)
@@ -8,6 +8,12 @@
 #include <TObject.h>
 #include <TBRIK.h>
 
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Pixel Detector, SPD, specific geometry.
+// It is being replaced by AliITSsegmentationSPD class. This file also
+// constains classes derived from AliITSgeomSPD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
 
 class TShape;
 
index 592857d3991e5cf1c0774ebe57e31787908dff5d..004ea550a512fd26f7b26089e0326b8e2655d920 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -45,6 +48,14 @@ Revision 1.2  1999/09/29 09:24:20  fca
 Introduction of the Copyright and cvs Log
 
 */
+
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Strip Detector, SSD, specific geometry.
+// It is being replaced by AliITSsegmentationSSD class. This file also
+// constains classes derived from AliITSgeomSSD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
+
 #include <iostream.h>
 #include <iomanip.h>
 #include <stdlib.h>
@@ -161,6 +172,14 @@ AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
 }
 //______________________________________________________________________
 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
+    // Given a GEANT detector local coordinate, cm, this function returns
+    // the detector specific P and N side strip numbers.
+    // Inputs are:
+    // Float_t x   Geant detector local x coordinate in cm
+    // Float_t z   Geant detector local z coordinate in cm
+    // outputs are:
+    // Int_t &a    Detector anode strip number (P side)
+    // Int_t &c    Detector cathode strip number (N side)
     Float_t d,b;
     Int_t i;
 
@@ -253,6 +272,9 @@ istream &operator>>(istream &is,AliITSgeomSSD &r){
 //======================================================================
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -321,6 +343,9 @@ istream &operator>>(istream &is,AliITSgeomSSD175 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -345,6 +370,10 @@ AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
 //----------------------------------------------------------------------
 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) : 
                                                             AliITSgeomSSD(){
+    // Default constructor for AliITSgeomSSD with strip angles of
+    // 275 miliradians and 75 miliradians. This constructor initlizes
+    // AliITSgeomSSD with the correct values. This is the miror image
+    // of the AliITSgeomSSD75and275 class.
     const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
     // Size of sensitive detector area x,y(thickness),z
     const Float_t kangleA  = 0.0275; // angle in rad. of anode and cathodes
@@ -394,6 +423,9 @@ istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
 //======================================================================
 /*
 $Log$
+Revision 1.11  2001/05/16 08:17:49  hristov
+Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
+
 Revision 1.10  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
@@ -416,6 +448,10 @@ AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
 }
 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) : 
                                                             AliITSgeomSSD(){
+    // Default constructor for AliITSgeomSSD with strip angles of
+    // 75 miliradians and 275 miliradians. This constructor initlizes
+    // AliITSgeomSSD with the correct values. This is the miror image
+    // of the AliITSgeomSSD275and75 class.
     const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
     // Size of sensitive detector area x,y(thickness),z
     const Float_t kangleA  = 0.0075; // angle in rad. of anode and cathodes
index d4d6aa5e8fc59ca271352016cad4fc7179d25185..8b2ca671156f0def1a8742bfb98ea9fa0ee8ca7d 100644 (file)
@@ -5,6 +5,13 @@
 
 /* $Id$ */
 
+////////////////////////////////////////////////////////////////////////
+// This class is for the Silicon Strip Detector, SSD, specific geometry.
+// It is being replaced by AliITSsegmentationSSD class. This file also
+// constains classes derived from AliITSgeomSSD which do nothing but
+// initilize this one with predefined values.
+////////////////////////////////////////////////////////////////////////
+
 #include <TObject.h>
 #include <TBRIK.h>