New version and structure of ITS V11 geometry. Work still in progress.
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Feb 2003 17:03:52 +0000 (17:03 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Feb 2003 17:03:52 +0000 (17:03 +0000)
ITS/AliITSBaseGeometry.cxx [new file with mode: 0644]
ITS/AliITSBaseGeometry.h [new file with mode: 0644]
ITS/AliITSGeometrySSDCone.cxx [new file with mode: 0644]
ITS/AliITSGeometrySSDCone.h [new file with mode: 0644]
ITS/AliITSv11.cxx
ITS/AliITSv11.h

diff --git a/ITS/AliITSBaseGeometry.cxx b/ITS/AliITSBaseGeometry.cxx
new file mode 100644 (file)
index 0000000..e27d224
--- /dev/null
@@ -0,0 +1,1427 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+
+$Id$
+*/
+
+/*
+  A base geometry class defining all of the ITS volumes that make up an ITS
+geometry.
+Auhors: B. S. Nilsen
+Version 0
+Created February 2003.
+*/
+
+#include <Riostream.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <TMath.h>
+#include <TGeometry.h>
+#include <TNode.h>
+#include <TTUBE.h>
+#include <TTUBS.h>
+#include <TPCON.h>
+#include <TFile.h>    // only required for Tracking function?
+#include <TCanvas.h>
+#include <TObjArray.h>
+#include <TLorentzVector.h>
+#include <TObjString.h>
+#include <TClonesArray.h>
+#include <TBRIK.h>
+#include <TSystem.h>
+#include <AliRun.h>
+#include <AliMagF.h>
+#include <AliConst.h>
+#include "AliITSBaseGeometry.h"
+
+ClassImp(AliITSBaseGeometry)
+//______________________________________________________________________
+AliITSBaseGeometry::AliITSBaseGeometry(){
+    // Default construtor for the ITS Base Geometry class.
+    // Inputs:
+    //    none.
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    fScale = 1.0; // Default value.
+    fits = 0; // zero pointers.
+    fNCreates++; // incrament this creation counter.
+}
+//______________________________________________________________________
+AliITSBaseGeometry::AliITSBaseGeometry(AliModule *its,Int_t iflag){
+    // Standard construtor for the ITS Base Geometry class.
+    // Inputs:
+    //    Int_t iflag  flag to indecate specific swiches in the geometry
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    fScale = 1.0; // Default value.
+    fits = its; // get a copy of the pointer to the ITS.
+    fNCreates++; // incrament this creation counter.
+}
+//______________________________________________________________________
+AliITSBaseGeometry::~AliITSBaseGeometry(){
+    // Standeard destructor for the ITS Base Geometry class.
+    // Inputs:
+    //    Int_t iflag  flag to indecate specific swiches in the geometry
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    fits = 0; // This class does not own this class. It contaitns a pointer
+    // to it for conveniance.
+    fidmed = 0; // This class does not own this array of media indexs. It
+    fNCreates--;
+    if(fNCreates==0){ // Now delete the static members
+       Int_t i;
+       if(fVolName!=0){
+           for(i=0;i<fVolNameLast;i++) delete fVolName[i];
+           fVolNameSize = 0;
+           fVolNameLast = 0;
+           delete[] fVolName;
+       }// end if
+       delete[] fidrot;
+       fidrotsize = fidrotlast = 0;
+    }// end if
+}
+//______________________________________________________________________
+Int_t AliITSBaseGeometry::AddVolName(const TString name){
+    // Checks if the volume name already exist, if not it adds it to
+    // the list of volume names and returns an index to that volume name.
+    // it will create and expand the array of volume names as needed.
+    // If the volume name already exists, it will give an error message and
+    // return an index <0.
+    // Inputs:
+    //    const TString name  Volume name to be added to the list.
+    // Outputs:
+    //    none.
+    // Return:
+    //    The index where this volume name is stored.
+    Int_t i;
+
+    if(fVolName==0){ // must create array.
+       fVolNameSize = 1000;
+       fVolName = new TString[fVolNameSize];
+       fVolNameLast = 0;
+    } // end if
+    for(i=0;i<fVolNameLast;i++) if(fVolName[i].CompareTo(name)==0){ // Error
+       Error("AddVolName","Volume name already exists for volume %d",i);
+       return -1;
+    } // end for i
+    if(fVolNameSize==fVolNameLast-1){ // Array is full must expand.
+       Int_t size = fVolNameSize*2;
+       TString *old = fVolName;
+       fVolName = new TString[fVolNameSize];
+       for(i=0;i<fVolNameLast;i++) fVolName[i] = old[i];
+       delete[] old;
+       fVolNameSize = size;
+    } // end if
+    if(strcmp(ITSIndexToITSG3name(fVolNameLast),"ITSV")==0){
+       // Special Reserved Geant 3 volumen name. Skip it
+       // fill it with explination for conveniance.
+       fVolName[fVolNameLast] = "ITS Master Mother Volume";
+       fVolNameLast++;
+    } // end if
+    fVolName[fVolNameLast] = name;
+    fVolNameLast++;
+    return fVolNameLast-1; // return the index
+}
+//______________________________________________________________________
+char* AliITSBaseGeometry::ITSIndexToITSG3name(const Int_t i){
+    // Given the ITS volume index i, it returns the Geant3 ITS volume
+    // name. The valid characters must be in the range
+    // '0' through 'Z'. This will include all upper case letter and the
+    // numbers 0-9. In addition it does not will include the following simbols
+    // ":;<=>?@"
+    // Inputs:
+    //    const Int_t i  the ITS volume index
+    // Output:
+    //    none.
+    // Return:
+    //    char[4] with the ITS volume name starting from "I000" to "IZZZ"
+    const Int_t rangen=(Int_t)('9'-'0'+1); // range of numbers
+    const Int_t rangel=(Int_t)('Z'-'A'+1); // range of letters
+    const Int_t range = rangen+rangel; // the number of characters between 
+                                       // 0-9 and A-Z.
+    char a[4];
+    Int_t j = i;
+
+    a[0] = (char)('I');
+    a[1] = (char)('0'+j/(range*range));
+    if(a[1]>'9') a[1] += 'A'-'0'; // if it is a letter add in gap for simples.
+    j -= range*range*(a[1]-'0');
+    a[2] = (char)('0'+j/range);
+    if(a[2]>'9') a[2] += 'A'-'0'; // if it is a letter add in gap for simples.
+    j -= range*(a[2]-'0');
+    a[3] = (char)('0'+j);
+    if(a[3]>'9') a[3] += 'A'-'0'; // if it is a letter add in gap for simples.
+    return a;
+}
+//______________________________________________________________________
+Int_t AliITSBaseGeometry::ITSG3VnameToIndex(const char name[3])const{
+    // Given the last three characters of the ITS Geant3 volume name,
+    // this returns the index. The valid characters must be in the range
+    // '0' through 'Z'. This will include all upper case letter and the
+    // numbers 0-9. In addition it will include the following simbles
+    // ":;<=>?@"
+    // Inputs:
+    //    const char name[3]  The last three characters of the ITS Geant3
+    //                        volume name
+    // Output:
+    //    none.
+    // Return:
+    //    Int_t the index.
+    const Int_t rangen=(Int_t)('9'-'0'+1); // range of numbers
+    const Int_t rangel=(Int_t)('Z'-'A'+1); // range of letters
+    const Int_t range = rangen+rangel; // the number of characters between 
+                                       // 0-9 and A-Z.
+    Int_t i,j;
+
+    i = 0;
+    for(j=3;j>-1;j--){
+       if(isdigit(name[j])){ // number
+           i += (Int_t)(name[j]-'0')*TMath::Power(range,(Double_t)j);
+       }else{ // Letter
+           i += (Int_t)(name[j]-'A'+rangen)*TMath::Power(range,(Double_t)j);
+       } // end if
+    } // end for j
+    return i;
+}
+//______________________________________________________________________
+TString AliITSBaseGeometry::GetVolName(const Int_t i)const{
+    // Returns the volume name at a given index i. Index must be in
+    // range and the array of volume names must exist. If there is an
+    // error, a message is written and 0 is returned.
+    // Inputs:
+    //   const Int_t i Index
+    // Output:
+    //   none.
+    // Return:
+    //   A TString contianing the ITS volume name.
+
+    if(i<0||i>=fVolNameLast){
+       Error("GetVolName","Index=%d out of range but be witin 0<%d",i,
+             fVolName-1);
+       return 0;
+    } // end if Error
+    return fVolName[i];
+}
+//______________________________________________________________________
+Int_t AliITSBaseGeometry::GetVolumeIndex(const TString &a){
+    // Return the index corresponding the the volume name a. If the
+    // Volumen name is not found, return -1, and a warning message given.
+    // Inputs:
+    //   const TString &a  Name of volume for which index is wanted.
+    // Output:
+    //   none.
+    // Return:
+    //   Int_t Index corresponding the volume a. If not found -1 is returned.
+    Int_t i;
+
+    for(i=0;i<fVolNameLast;i++) if(fVolName[i].CompareTo(a)==0) return i;
+    Info("GetVolumeIndex","Volume name %s not found",a.Data());
+    return -1;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Box(const char gnam[3],const TString &dis,
+                            Double_t dx,Double_t dy,Double_t dz,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS bos geometries. Box with faces
+    // perpendicular to the axes. It has 3 paramters. See SetScale() for
+    // units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dx         half-length of box in x-axis
+    //    Double_t dy         half-length of box in y-axis
+    //    Double_t dz         half-length of box in z-axis
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[3];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dx;
+    param[1] = fScale*dy;
+    param[2] = fScale*dz;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"BOX ",fidmed[med],param,3);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Trapezoid1(const char gnam[3],const TString &dis,
+                                   Double_t dxn,Double_t dxp,Double_t dy,
+                                   Double_t dz,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS TRD1 geometries. Trapezoid with the 
+    // x dimension varing along z. It has 4 parameters. See SetScale() for
+    // units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dxn        half-length along x at the z surface positioned 
+    //                        at -DZ
+    //    Double_t dxp        half-length along x at the z surface positioned 
+    //                        at +DZ
+    //    Double_t dy         half-length along the y-axis
+    //    Double_t dz         half-length along the z-axis
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[4];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dxn;
+    param[1] = fScale*dxp;
+    param[2] = fScale*dy;
+    param[3] = fScale*dz;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"TRD1",fidmed[med],param,4);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Trapezoid2(const char gnam[3],const TString &dis,
+                                   Double_t dxn,Double_t dxp,Double_t dyn,
+                                   Double_t dyp,Double_t dz,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS TRD2 geometries. Trapezoid with the 
+    // x and y dimension varing along z. It has 5 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dxn        half-length along x at the z surface positioned 
+    //                        at -DZ
+    //    Double_t dxp        half-length along x at the z surface positioned 
+    //                        at +DZ
+    //    Double_t dyn        half-length along x at the z surface positioned 
+    //                        at -DZ
+    //    Double_t dyp        half-length along x at the z surface positioned 
+    //                        at +DZ
+    //    Double_t dz         half-length along the z-axis
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[5];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dxn;
+    param[1] = fScale*dxp;
+    param[2] = fScale*dyn;
+    param[3] = fScale*dyp;
+    param[4] = fScale*dz;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"TRD2",fidmed[med],param,5);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Trapezoid(const char gnam[3],const TString &dis,
+                                  Double_t dz,Double_t thet,Double_t phi,
+                                  Double_t h1,Double_t bl1,Double_t tl1,
+                                  Double_t alp1,Double_t h2,Double_t bl2,
+                                  Double_t tl2,Double_t alp2,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS TRAP geometries. General Trapezoid, 
+    // The faces perpendicular to z are trapezia and their centers are not 
+    // necessarily on a line parallel to the z axis. This shape has 11 
+    // parameters, but only cosidering that the faces should be planar, only 9 
+    // are really independent. A check is performed on the user parameters and 
+    // a message is printed in case of non-planar faces. Ignoring this warning 
+    // may cause unpredictable effects at tracking time. See SetScale() 
+    // for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dz         Half-length along the z-asix
+    //    Double_t thet       Polar angle of the line joing the center of the 
+    //                        face at -dz to the center of the one at dz 
+    //                        [degree].
+    //    Double_t phi        aximuthal angle of the line joing the center of 
+    //                        the face at -dz to the center of the one at +dz 
+    //                        [degree].
+    //    Double_t h1         half-length along y of the face at -dz.
+    //    Double_t bl1        half-length along x of the side at -h1 in y of 
+    //                        the face at -dz in z.
+    //    Double_t tl1        half-length along x of teh side at +h1 in y of 
+    //                        the face at -dz in z.
+    //    Double_t alp1       angle with respect to the y axis from the center 
+    //                        of the side at -h1 in y to the cetner of the 
+    //                        side at +h1 in y of the face at -dz in z 
+    //                        [degree].
+    //    Double_t h2         half-length along y of the face at +dz
+    //    Double_t bl2        half-length along x of the side at -h2 in y of
+    //                        the face at +dz in z.
+    //    Double_t tl2        half-length along x of the side at _h2 in y of 
+    //                        the face at +dz in z.
+    //    Double_t alp2       angle with respect to the y axis from the center 
+    //                        of the side at -h2 in y to the center of the 
+    //                        side at +h2 in y of the face at +dz in z 
+    //                        [degree].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[11];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dz;
+    param[1] = thet;
+    param[2] = phi;
+    param[3] = fScale*h1;
+    param[4] = fScale*bl1;
+    param[5] = fScale*tl1;
+    param[6] = alp1;
+    param[7] = fScale*h2;
+    param[8] = fScale*bl2;
+    param[9] = fScale*tl2;
+    param[10] = alp2;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"TRAP",fidmed[med],param,11);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Tube(const char gnam[3],const TString &dis,
+                             Double_t rmin,Double_t rmax,Double_t dz,
+                             Int_t med){
+    // Interface to TMC->Gsvolu() for ITS TUBE geometries. Simple Tube. It has
+    // 3 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t rmin       Inside Radius.
+    //    Double_t rmax       Outside Radius.
+    //    Double_t dz         half-length along the z-axis
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[3];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*rmin;
+    param[1] = fScale*rmax;
+    param[2] = fScale*dz;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"TUBE",fidmed[med],param,3);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::TubeSegment(const char gnam[3],const TString &dis,
+                                    Double_t rmin,Double_t rmax,Double_t dz,
+                                    Double_t phi1,Double_t phi2,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS TUBE geometries. Phi segment of a 
+    // tube. It has 5  parameters. Phi1 should be smaller than phi2. If this is
+    // not the case, the system adds 360 degrees to phi2. See SetScale() 
+    // for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t rmin       Inside Radius.
+    //    Double_t rmax       Outside Radius.
+    //    Double_t dz         half-length along the z-axis
+    //    Double_t phi1       Starting angle of the segment [degree].
+    //    Double_t phi2       Ending angle of the segment [degree].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[5];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*rmin;
+    param[1] = fScale*rmax;
+    param[2] = fScale*dz;
+    param[3] = phi1;
+    param[4] = phi2;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"TUBS",fidmed[med],param,5);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Cone(const char gnam[3],const TString &dis,
+                             Double_t dz,Double_t rmin1,Double_t rmax1,
+                             Double_t rmin2,Double_t rmax2,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS Cone geometries. Conical tube. It 
+    // has 5 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dz         half-length along the z-axis
+    //    Double_t rmin1      Inside Radius at -dz.
+    //    Double_t rmax1      Outside Radius at -dz.
+    //    Double_t rmin2      inside radius at +dz.
+    //    Double_t rmax2      outside radius at +dz.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[5];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dz;
+    param[1] = fScale*rmin1;
+    param[2] = fScale*rmax1;
+    param[3] = fScale*rmin2;
+    param[4] = fScale*rmax2;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"CONS",fidmed[med],param,5);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::ConeSegment(const char gnam[3],const TString &dis,
+                                    Double_t dz,Double_t rmin1,Double_t rmax1,
+                                    Double_t rmin2,Double_t rmax2,
+                                    Double_t phi1,Double_t phi2,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS ConS geometries. One segment of a 
+    // conical tube. It has 7 parameters. Phi1 should be smaller than phi2. If 
+    // this is not the case, the system adds 360 degrees to phi2. See 
+    // SetScale() for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dz         half-length along the z-axis
+    //    Double_t rmin1      Inside Radius at -dz.
+    //    Double_t rmax1      Outside Radius at -dz.
+    //    Double_t rmin2      inside radius at +dz.
+    //    Double_t rmax2      outside radius at +dz.
+    //    Double_t phi1       Starting angle of the segment [degree].
+    //    Double_t phi2       Ending angle of the segment [degree].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[7];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dz;
+    param[1] = fScale*rmin1;
+    param[2] = fScale*rmax1;
+    param[3] = fScale*rmin2;
+    param[4] = fScale*rmax2;
+    param[5] = phi1;
+    param[6] = phi2;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"CONS",fidmed[med],param,7);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Sphere(const char gnam[3],const TString &dis,
+                               Double_t rmin,Double_t rmax,Double_t the1,
+                               Double_t the2,Double_t phi1,Double_t phi2,
+                               Int_t med){
+    // Interface to TMC->Gsvolu() for ITS SPHE geometries. Segment of a 
+    // sphereical shell. It has 6 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t rmin       Inside Radius.
+    //    Double_t rmax       Outside Radius.
+    //    Double_t the1       staring polar angle of the shell [degree].
+    //    Double_t the2       ending polar angle of the shell [degree].
+    //    Double_t phui       staring asimuthal angle of the shell [degree].
+    //    Double_t phi2       ending asimuthal angle of the shell [degree].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[6];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*rmin;
+    param[1] = fScale*rmax;
+    param[2] = the1;
+    param[3] = the2;
+    param[4] = phi1;
+    param[5] = phi2;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"SPHE",fidmed[med],param,6);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Parallelepiped(const char gnam[3],const TString &dis,
+                                       Double_t dx,Double_t dy,Double_t dz,
+                                       Double_t alpha,Double_t thet,
+                                       Double_t phi,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS PARA geometries. Parallelepiped. It 
+    // has 6 parameters. See SetScale() for units. Default units are geant 3 
+    // [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dx         half-length allong x-axis
+    //    Double_t dy         half-length allong y-axis
+    //    Double_t dz         half-length allong z-axis
+    //    Double_t alpha      angle formed by the y axis and by the plane 
+    //                        joining the center of teh faces parallel to the 
+    //                        z-x plane at -dY and +dy [degree].
+    //    Double_t thet       polar angle of the line joining the centers of 
+    //                        the faces at -dz and +dz in z [degree].
+    //    Double_t phi        azimuthal angle of teh line joing the centers of 
+    //                        the faaces at -dz and +dz in z [degree].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[6];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dx;
+    param[1] = fScale*dy;
+    param[2] = fScale*dz;
+    param[3] = alpha;
+    param[4] = thet;
+    param[5] = phi;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"PARA",fidmed[med],param,6);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Polygon(const char gnam[3],const TString &dis,
+                                Double_t phi1,Double_t dphi,Int_t npdv,
+                                Int_t nz,Double_t *z,Double_t *rmin,
+                                Double_t *rmax,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS PGON geometry. Polygon It has 10 
+    // parameters or more. See SetScale() for units. Default units are geant 3 
+    // [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t phi1       the azimuthal angle at which the volume begins 
+    //                        (angles are counted clouterclockwise) [degrees].
+    //    Double_t dphi       opening angle of the volume, which extends from 
+    //                        phi1 to phi1+dphi [degree].
+    //    Int_t npdv          the number of sides of teh cross section between 
+    //                        the given phi limits.
+    //    Int_t nz            number of planes perpendicular to the z axis 
+    //                        where the dimension of the section is given - 
+    //                        this number should be at least 2 and NP triples 
+    //                        of number must follow.
+    //    Double_t *z         array [nz] of z coordiates of the sections..
+    //    Double_t *rmin      array [nz] of radius of teh circle tangent to 
+    //                        the sides of the inner polygon in teh 
+    //                        cross-section.
+    //    Double_t *rmax      array [nz] of radius of the circle tangent to 
+    //                        the sides of the outer polygon in the 
+    //                       cross-section.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t *param;
+    Int_t n,i;
+
+    if(fidmed==0) SetMedArray();
+    n = 4+3*nz;
+    param = new Float_t[n];
+    param[0] = phi1;
+    param[1] = dphi;
+    param[2] = (Float_t)npdv;
+    param[3] = (Float_t)nz;
+    for(i=0;i<nz;i++){
+       param[4+3*i] = z[i];
+       param[5+3*i] = rmin[i];
+       param[6+3*i] = rmax[i];
+    } // end for i
+    name[3] = 'I';
+    for(i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"PGON",fidmed[med],param,n);
+
+    delete[] param;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::PolyCone(const char gnam[3],const TString &dis,
+                                 Double_t phi1,Double_t dphi,Int_t nz,
+                                 Double_t *z,Double_t *rmin,Double_t *rmax,
+                                 Int_t med){
+    // Interface to TMC->Gsvolu() for ITS PCON geometry. Poly-cone It has 9 
+    // parameters or more. See SetScale() for units. Default units are geant 3 
+    // [cm].
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t phi1       the azimuthal angle at which the volume begins 
+    //                        (angles are counted clouterclockwise) [degrees].
+    //    Double_t dphi       opening angle of the volume, which extends from 
+    //                        phi1 to phi1+dphi [degree].
+    //    Int_t nz            number of planes perpendicular to the z axis 
+    //                        where the dimension of the section is given - 
+    //                        this number should be at least 2 and NP triples 
+    //                        of number must follow.
+    //    Double_t *z         Array [nz] of z coordinate of the section.
+    //    Double_t *rmin      Array [nz] of radius of teh inner circle in the 
+    //                        cross-section.
+    //    Double_t *rmax      Array [nz] of radius of the outer circle in the 
+    //                        cross-section.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t *param;
+    Int_t n,i;
+
+    if(fidmed==0) SetMedArray();
+    n = 3+3*nz;
+    param = new Float_t[n];
+    param[0] = phi1;
+    param[1] = dphi;
+    param[2] = (Float_t) nz;
+    for(i=0;i<nz;i++){
+       param[3+3*i] = z[i];
+       param[4+3*i] = rmin[i];
+       param[5+3*i] = rmax[i];
+    } // end for i
+    name[3] = 'I';
+    for(i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"PCON",fidmed[med],param,n);
+
+    delete[] param;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::TubeElliptical(const char gnam[3],const TString &dis,
+                              Double_t p1,Double_t p2,Double_t dz,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS ELTU geometries. Elliptical 
+    // cross-section Tube. It has 3 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm]. The equation of the surface 
+    // is x^2 * p1^-2 + y^2 * p2^-2 = 1.
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t p1         semi-axis of the elipse along x.
+    //    Double_t p2         semi-axis of the elipse along y.
+    //    Double_t dz         half-length along the z-axis
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[3];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*p1;
+    param[1] = fScale*p2;
+    param[2] = fScale*dz;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"ELTU",fidmed[med],param,3);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::HyperbolicTube(const char gnam[3],const TString &dis,
+                              Double_t rmin,Double_t rmax,Double_t dz,
+                              Double_t thet,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS HYPE geometries. Hyperbolic tube. 
+    // Fore example the inner and outer surfaces are hyperboloids, as would be 
+    // foumed by a system of cylinderical wires which were then rotated 
+    // tangentially about their centers. It has 4 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm]. The hyperbolic surfaces are 
+    // given by r^2 = (ztan(thet)^2 + r(z=0)^2.
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t rmin       Inner radius at z=0 where tube is narrowest.
+    //    Double_t rmax       Outer radius at z=0 where tube is narrowest.
+    //    Double_t dz         half-length along the z-axis
+    //    Double_t thet       stero angel of rotation of the two faces 
+    //                       [degrees].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[4];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*rmin;
+    param[1] = fScale*rmax;
+    param[2] = fScale*dz;
+    param[3] = thet;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"HYPE",fidmed[med],param,4);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::TwistedTrapezoid(const char gnam[3],
+                                         const TString &dis,
+                                Double_t dz,Double_t thet,Double_t phi,
+                                Double_t twist,Double_t h1,Double_t bl1,
+                                Double_t tl1,Double_t apl1,Double_t h2,
+                                Double_t bl2,Double_t tl2,Double_t apl2,
+                                Int_t med){
+    // Interface to TMC->Gsvolu() for ITS GTRA geometries. General twisted 
+    // trapazoid. The faces perpendicular to z are trapazia and their centers 
+    // are not necessarily on a line parallel to the z axis as the TRAP. 
+    // Additionally, the faces may be twisted so that none of their edges are 
+    // parallel. It is a TRAP shape, exept that it is twisted in the x-y plane 
+    // as a function of z. The parallel sides perpendicular to the x axis are 
+    // rotated with respect to the x axis by an angle TWIST, which is one of 
+    // the parameters. The shape is defined by the eight corners and is assumed
+    // to be constructed of straight lines joingin points on the boundry of the
+    // trapezoidal face at Z=-dz to the coresponding points on the face at 
+    // z=+dz. Divisions are not allowed. It has 12 parameters. See SetScale() 
+    // for units. Default units are geant 3 [cm]. Note: This shape suffers from
+    // the same limitations than the TRAP. The tracking routines assume that 
+    // the faces are planar, but htis constraint is not easily expressed in 
+    // terms of the 12 parameters. Additionally, no check on th efaces is 
+    // performed in this case. Users should avoid to use this shape as much as 
+    // possible, and if they have to do so, they should make sure that the 
+    // faces are really planes. If this is not the case, the result of the 
+    // trasport is unpredictable. To accelerat ethe computations necessary for 
+    // trasport, 18 additioanl parameters are calculated for this shape are
+    // 1 DXODZ dx/dz of the line joing the centers of the faces at z=+_dz.
+    // 2 DYODZ dy/dz of the line joing the centers of the faces at z=+_dz.
+    // 3 XO1    x at z=0 for line joing the + on parallel side, perpendicular 
+    //          corners at z=+_dz.
+    // 4 YO1    y at z=0 for line joing the + on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 5 DXDZ1  dx/dz for line joing the + on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 6 DYDZ1  dy/dz for line joing the + on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 7 X02    x at z=0 for line joing the - on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 8 YO2    y at z=0 for line joing the - on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 9 DXDZ2  dx/dz for line joing the - on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 10 DYDZ2dy/dz for line joing the - on parallel side, + on 
+    //          perpendicular corners at z=+-dz.
+    // 11 XO3   x at z=0 for line joing the - on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 12 YO3   y at z=0 for line joing the - on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 13 DXDZ3 dx/dzfor line joing the - on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 14 DYDZ3 dydz for line joing the - on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 15 XO4   x at z=0 for line joing the + on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 16 YO4   y at z=0 for line joing the + on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 17 DXDZ4 dx/dz for line joing the + on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // 18 DYDZ4 dydz for line joing the + on parallel side, - on 
+    //          perpendicular corners at z=+-dz.
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t dz         half-length along the z axis.
+    //    Double_t thet       polar angle of the line joing the center of the 
+    //                        face at -dz to the center of the one at +dz 
+    //                        [degrees].
+    //    Double_t phi        Azymuthal angle of teh line joing the centre of 
+    //                        the face at -dz to the center of the one at +dz 
+    //                        [degrees].
+    //    Double_t twist      Twist angle of the faces parallel to the x-y 
+    //                        plane at z=+-dz around an axis parallel to z 
+    //                        passing through their centre [degrees].
+    //    Double_t h1         Half-length along y of the face at -dz.
+    //    Double_t bl1        half-length along x of the side -h1 in y of the 
+    //                        face at -dz in z.
+    //    Double_t tl1        half-length along x of the side at +h1 in y of 
+    //                        the face at -dz in z.
+    //    Double_t apl1       Angle with respect to the y ais from the center 
+    //                        of the side at -h1 in y to the centere of the 
+    //                        side at +h1 in y of the face at -dz in z 
+    //                        [degrees].
+    //    Double_t h2         half-length along the face at +dz.
+    //    Double_t bl2        half-length along x of the side at -h2 in y of 
+    //                        the face at -dz in z.
+    //    Double_t tl2        half-length along x of the side at +h2 in y of 
+    //                        the face at +dz in z.
+    //    Double_t apl2       angle with respect to the y axis from the center 
+    //                        of the side at -h2 in y to the center of the side
+    //                        at +h2 in y of the face at +dz in z [degrees].
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[12];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*dz;
+    param[1] = thet;
+    param[2] = phi;
+    param[3] = twist;
+    param[4] = fScale*h1;
+    param[5] = fScale*bl1;
+    param[6] = fScale*tl1;
+    param[7] = apl1;
+    param[8] = fScale*h2;
+    param[9] = fScale*bl2;
+    param[10] = fScale*tl2;
+    param[11] = apl2;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"GTRA",fidmed[med],param,12);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::CutTube(const char gnam[3],const TString &dis,
+                                Double_t rmin,Double_t rmax,Double_t dz,
+                                Double_t phi1,Double_t phi2,Double_t lx,
+                                Double_t ly,Double_t lz,Double_t hx,
+                                Double_t hy,Double_t hz,Int_t med){
+    // Interface to TMC->Gsvolu() for ITS CTUB geometries. Cut tube. A tube cut
+    // at the extremities with planes not necessarily perpendicular tot he z 
+    // axis. It has 11 parameters. See SetScale() for units. Default units are 
+    // geant 3 [cm]. phi1 should be smaller than phi2. If this is not the case,
+    // the system adds 360 degrees to phi2.
+    // Inputs:
+    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //                        is appended to the front to indecate that this
+    //                        is an ITS volume.
+    //    TString &dis        String containging part discription.
+    //    Double_t rmin       Inner radius at z=0 where tube is narrowest.
+    //    Double_t rmax       Outer radius at z=0 where tube is narrowest.
+    //    Double_t dz         half-length along the z-axis
+    //    Double_t dz         half-length along the z-axis
+    //    Double_t phi1       Starting angle of the segment [degree].
+    //    Double_t phi2       Ending angle of the segment [degree].
+    //    Double_t lx         x component of a unit vector perpendicular to 
+    //                        the face at -dz.
+    //    Double_t ly         y component of a unit vector perpendicular to 
+    //                        the face at -dz.
+    //    Double_t lz         z component of a unit vector perpendicular to 
+    //                        the face at -dz.
+    //    Double_t hx         x component of a unit vector perpendicular to 
+    //                        the face at +dz.
+    //    Double_t hy         y component of a unit vector perpendicular to 
+    //                        the face at +dz.
+    //    Double_t hz         z component of a unit vector perpendicular to 
+    //                        the face at +dz.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[4];
+    Float_t param[11];
+
+    if(fidmed==0) SetMedArray();
+    param[0] = fScale*rmin;
+    param[1] = fScale*rmax;
+    param[2] = fScale*dz;
+    param[3] = phi1;
+    param[4] = phi2;
+    param[5] = lx;
+    param[6] = ly;
+    param[7] = lz;
+    param[8] = hx;
+    param[9] = hy;
+    param[10] = hz;
+    name[3] = 'I';
+    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
+    gMC->Gsvolu(name,"CTUB",fidmed[med],param,11);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Pos(const char vol[3],Int_t cn,const char moth[3],
+                            Double_t x,Double_t y,Double_t z,Int_t irot){
+    // Place a copy of a volume previously defined by a call to GSVOLU inside 
+    // its mother volulme moth.
+    // Inputs:
+    //   const char vol[3]  3 character geant volume name. The letter "I"
+    //                      is appended to the front to indecate that this
+    //                      is an ITS volume.
+    //   const char moth[3] 3 character geant volume name of the mother volume 
+    //                      in which vol will be placed. The letter "I" is 
+    //                      appended to the front to indecate that this is an 
+    //                      ITS volume.
+    //   Double_t x         The x positon of the volume in the mother's 
+    //                      reference system
+    //   Double_t y         The y positon of the volume in the mother's 
+    //                      reference system
+    //   Double_t z         The z positon of the volume in the mother's 
+    //                      reference system
+    //   Int_t irot         the index for the rotation matrix to be used.
+    //                      irot=-1 => unit rotation.
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+    char name[4],mother[4];
+    Float_t param[3];
+    Int_t r=0,i;
+
+    param[0] = x;
+    param[1] = y;
+    param[2] = z;
+    name[3] = 'I';
+    for(i=0;i<3;i++) name[i+1] = vol[i];
+    mother[3] = 'I';
+    for(i=0;i<3;i++) mother[i+1] = moth[i];
+    if(irot>=0) r=fidrot[irot];
+    gMC->Gspos(name,1,mother,param[0],param[1],param[2],r,"ONLY");
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Matrix(Int_t irot,Double_t thet1,Double_t phi1,
+                      Double_t thet2,Double_t phi2,
+                      Double_t thet3,Double_t phi3){
+    // Defines a Geant rotation matrix. checks to see if it is the unit
+    // matrix. If so, then no additonal matrix is defined. Stores rotation 
+    // matrix irot in the data structure JROTM. If the matrix is not 
+    // orthonormal, it will be corrected by setting y' perpendicular to x' 
+    // and z' = x' X y'. A warning message is printed in this case.
+    // Inputs:
+    //   Int_t irot     Intex specifing which rotation matrix.
+    //   Double_t thet1 Polar angle for axisw x [degrees].
+    //   Double_t phi1  azimuthal angle for axis x [degrees].
+    //   Double_t thet12Polar angle for axisw y [degrees].
+    //   Double_t phi2  azimuthal angle for axis y [degrees].
+    //   Double_t thet3 Polar angle for axisw z [degrees].
+    //   Double_t phi3  azimuthal angle for axis z [degrees].
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+    Float_t t1,p1,t2,p2,t3,p3;
+
+    if(thet1==90.0&&phi1==0.0&&thet2==90.0&&phi2==90.0&&thet3==0.0&&phi3==0.0){
+       fidrot[irot] = 0; // Unit matrix
+    }else{
+       t1 = thet1;
+       p1 = phi1;
+       t2 = thet2;
+       p2 = phi2;
+       t3 = thet3;
+       p3 = phi3;
+       fits->AliMatrix(fidrot[irot],t1,p1,t2,p2,t3,p3);
+    } // end if
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Matrix(Int_t irot,Int_t axis,Double_t thet){
+    // Defines a Geant rotation matrix. checks to see if it is the unit
+    // matrix. If so, then no additonal matrix is defined. Stores rotation 
+    // matrix irot in the data structure JROTM. If the matrix is not 
+    // orthonormal, it will be corrected by setting y' perpendicular to x' 
+    // and z' = x' X y'. A warning message is printed in this case.
+    // Inputs:
+    //   Int_t irot         Intex specifing which rotation matrix.
+    //   Int_t axis         Axis about which rotation is to be done.
+    //   Double_t thet      Angle to rotate by [degrees].
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    if(thet==0.0){
+       fidrot[irot] = 0; // Unit matrix
+    }else{
+       switch (irot) {
+       case 0: //Rotate about x-axis, x-axis does not change.
+           fits->AliMatrix(fidrot[irot],90.0,0.0,90.0+thet,90.0,thet,90.0);
+           break;
+       case 1: //Rotate about y-axis, y-axis does not change.
+           fits->AliMatrix(fidrot[irot],-90.0-thet,0.0,90.0,90.0,thet,90.0);
+           break;
+       case 2: //Rotate about z-axis, z-axis does not change.
+           fits->AliMatrix(fidrot[irot],90.0,thet,90.0,-thet-90.0,0.0,0.0);
+           break;
+       default:
+           Error("Matrix","axis must be either 0, 1, or 2. for matrix=%d",
+                 irot);
+           break;
+       } // end switch
+    } // end if
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Matrix(Int_t irot,Double_t rot[3][3]){
+    // Defines a Geant rotation matrix. checks to see if it is the unit
+    // matrix. If so, then no additonal matrix is defined. Stores rotation 
+    // matrix irot in the data structure JROTM. If the matrix is not 
+    // orthonormal, it will be corrected by setting y' perpendicular to x' 
+    // and z' = x' X y'. A warning message is printed in this case.
+    // Inputs:
+    //   Int_t irot         Intex specifing which rotation matrix.
+    //   Double_t rot[3][3] The 3 by 3 rotation matrix.
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    if(rot[0][0]==1.0&&rot[1][1]==1.0&&rot[2][2]==1.0&&
+       rot[0][1]==0.0&&rot[0][2]==0.0&&rot[1][0]==0.0&&
+       rot[1][2]==0.0&&rot[2][0]==0.0&&rot[2][1]==0.0){
+       fidrot[irot] = 0; // Unit matrix
+    }else{
+       Double_t si,c=180./TMath::Pi();
+       Double_t ang[6];
+
+       ang[1] = TMath::ATan2(rot[0][1],rot[0][0]);
+       if(TMath::Cos(ang[1])!=0.0) si = rot[0][0]/TMath::Cos(ang[1]);
+       else si = rot[0][1]/TMath::Sin(ang[1]);
+       ang[0] = TMath::ATan2(si,rot[0][2]);
+
+       ang[3] = TMath::ATan2(rot[1][1],rot[1][0]);
+       if(TMath::Cos(ang[3])!=0.0) si = rot[1][0]/TMath::Cos(ang[3]);
+       else si = rot[1][1]/TMath::Sin(ang[3]);
+       ang[2] = TMath::ATan2(si,rot[1][2]);
+
+       ang[5] = TMath::ATan2(rot[2][1],rot[2][0]);
+       if(TMath::Cos(ang[5])!=0.0) si = rot[2][0]/TMath::Cos(ang[5]);
+       else si = rot[2][1]/TMath::Sin(ang[5]);
+       ang[4] = TMath::ATan2(si,rot[2][2]);
+
+       for(Int_t i=0;i<6;i++) {ang[i] *= c; if(ang[i]<0.0) ang[i] += 360.;}
+       fits->AliMatrix(fidrot[irot],ang[0],ang[1],ang[2],ang[3],
+                       ang[4],ang[5]);
+    } // end if
+}
+//______________________________________________________________________
+Float_t AliITSBaseGeometry::GetA(Int_t z){
+    // Returns the isotopicaly averaged atomic number.
+    // Inputs:
+    //    Int_t z  Elemental number
+    // Outputs:
+    //    none.
+    // Return:
+    //    The atomic mass number.
+    const Float_t A[]={ 1.00794 ,  4.0026902,  6.941   ,  9.012182 , 10.811   ,
+                       12.01007 , 14.00674  , 15.9994  , 18.9984032, 20.1797  ,
+                       22.98970 , 24.3050   , 26.981538, 28.0855   , 30.973761,
+                       32.066   , 35.4527   , 39.948   , 39.0983   , 40.078   ,
+                       44.95591 , 47.867    , 50.9415  , 51.9961   , 54.938049,
+                       55.845   , 58.933200 , 58.6934  , 63.546    , 65.39    ,
+                       69.723   , 72.61     , 74.92160 , 78.96     , 79.904   ,
+                       83.80    , 85.4678   , 87.62    , 88.9085   , 91.224   ,
+                       92.90638 , 95.94     , 97.907215, 101.07    ,102.90550 ,
+                      106.42    ,107.8682   ,112.411   ,114.818    ,118.710   ,
+                      121.760   ,127.60     ,126.90447 ,131.29     ,132.90545 ,
+                      137.327   ,138.9055   ,140.116   ,140.90765  ,144.24    ,
+                      144.912746,150.36     ,151.964   ,157.25     ,158.92534 ,
+                      162.50    ,164.93032  ,167.26    ,168.93421  ,173.04    ,
+                      174.967   ,178.49     ,180.9479 ,183.84      ,186.207   ,
+                      190.23    ,192.217    ,195.078  ,196.96655   ,200.59    ,
+                      204.3833  ,207.2      ,208.98038,208.982415  ,209.987131,
+                      222.017570,223.019731 ,226.025402,227.027747 ,232.0381  ,
+                      231.03588 ,238.0289};
+
+    if(z<1||z>92){
+       Error("GetA","z must be 0<z<93. z=%d",z);
+       return 0.0;
+    } // end if
+    return A[z-1];
+}
+//______________________________________________________________________
+Float_t AliITSBaseGeometry::GetStandardMaxStepSize(Int_t istd){
+    // Returns one of a set of standard Maximum Step Size values.
+    // Inputs:
+    //   Int_t istd  Index to indecate which standard.
+    // Outputs:
+    //    none.
+    // Return:
+    //    The appropreate standard Maximum Step Size value [cm].
+    Float_t t[]={1.0, // default
+                0.0075, // Silicon detectors...
+                1.0, // Air in central detectors region
+                1.0  // Material in non-centeral region
+    };
+    return t[istd];
+}
+//______________________________________________________________________
+Float_t AliITSBaseGeometry::GetStandardThetaMax(Int_t istd){
+    // Returns one of a set of standard Theata Max values.
+    // Inputs:
+    //   Int_t istd  Index to indecate which standard.
+    // Outputs:
+    //    none.
+    // Return:
+    //    The appropreate standard Theta max value [degrees].
+    Float_t t[]={0.1, // default
+                0.1, // Silicon detectors...
+                0.1, // Air in central detectors region
+                1.0  // Material in non-centeral region
+    };
+    return t[istd];
+}
+//______________________________________________________________________
+Float_t AliITSBaseGeometry::GetStandardEfraction(Int_t istd){
+    // Returns one of a set of standard E fraction values.
+    // Inputs:
+    //   Int_t istd  Index to indecate which standard.
+    // Outputs:
+    //    none.
+    // Return:
+    //    The appropreate standard E fraction value [#].
+    Float_t t[]={0.1, // default
+                0.1, // Silicon detectors...
+                0.1, // Air in central detectors region
+                0.5  // Material in non-centeral region
+    };
+    return t[istd];
+}
+Float_t AliITSBaseGeometry::GetStandardEpsilon(Int_t istd){
+    // Returns one of the standard Epsilon valuse
+    // Inputs:
+    //    Int_t istd  index of standard cuts to get
+    // Output:
+    //    none.
+    // Return:
+    //    Float_t the standard Epsilon cut value.
+    Float_t t[]={1.0E-4, // default
+                1.0E-4, // Silicon detectors...
+                1.0E-4, // Air in central detector region
+                1.0E-3, // Material in non-cneteral regions
+    };
+
+    return t[istd];
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Element(Int_t imat,const char* name,Int_t z,
+                                Double_t dens,Int_t istd){
+    // Defines a Geant single element material and sets its Geant medium
+    // proporties. The average atomic A is assumed to be given by their
+    // natural abundances. Things like the radiation length are calculated
+    // for you.
+    // Inputs:
+    //    Int_t imat       Material number.
+    //    const char* name Material name. No need to add a $ at the end.
+    //    Int_t z          The elemental number.
+    //    Double_t dens    The density of the material [g/cm^3].
+    //    Int_t istd       Defines which standard set of transport parameters
+    //                     which should be used.
+    // Output:
+    //     none.
+    // Return:
+    //     none.
+    Float_t rad,Z,A=GetA(z),tmax,stemax,deemax,epsilon;
+    char *name2;
+    Int_t len;
+
+    len = strlen(name)+1;
+    name2 = new char[len];
+    strncpy(name2,name,len-1);
+    name2[len-1] = '\0';
+    name2[len-2] = '$';
+    Z = (Float_t)z;
+    rad = GetRadLength(z)/dens;
+    fits->AliMaterial(imat,name2,A,Z,dens,rad,0.0,0,0);
+    tmax    = GetStandardThetaMax(istd);    // degree
+    stemax  = GetStandardMaxStepSize(istd);  // cm
+    deemax  = GetStandardEfraction(istd);     // ratio
+    epsilon = GetStandardEpsilon(istd);       //
+    fits->AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
+                   gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
+    delete[] name2;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::MixtureByWeight(Int_t imat,const char* name,Int_t *z,
+                               Double_t *w,Double_t dens,Int_t n,Int_t istd){
+    // Defines a Geant material by a set of elements and weights, and sets 
+    // its Geant medium proporties. The average atomic A is assumed to be 
+    // given by their natural abundances. Things like the radiation length 
+    // are calculated for you.
+    // Inputs:
+    //    Int_t imat       Material number.
+    //    const char* name Material name. No need to add a $ at the end.
+    //    Int_t *z         Array of The elemental numbers.
+    //    Double_t *w      Array of relative weights.
+    //    Double_t dens    The density of the material [g/cm^3].
+    //    Int_t n          the number of elements making up the mixture.
+    //    Int_t istd       Defines which standard set of transport parameters
+    //                     which should be used.   
+    // Output:
+    //     none.
+    // Return:
+    //     none.
+    Float_t *Z,*A,*W,tmax,stemax,deemax,epsilon;
+    char *name2;
+    Int_t len,i;
+    Z = new Float_t[n];
+    A = new Float_t[n];
+    W = new Float_t[n];
+
+    len = strlen(name)+1;
+    name2 = new char[len];
+    strncpy(name2,name,len-1);
+    name2[len-1] = '\0';
+    name2[len-2] = '$';
+    for(i=0;i<n;i++){Z[i] = (Float_t)z[i];A[i] = (Float_t)GetA(z[i]);
+                     W[i] = (Float_t)w[i];}
+    fits->AliMixture(imat,name2,A,Z,dens,n,W);
+    tmax    = GetStandardThetaMax(istd);    // degree
+    stemax  = GetStandardMaxStepSize(istd);  // cm
+    deemax  = GetStandardEfraction(istd);     // #
+    epsilon = GetStandardEpsilon(istd);
+    fits->AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
+             gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
+    delete[] name2;
+    delete[] Z;
+    delete[] A;
+    delete[] W;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::MixtureByNumber(Int_t imat,const char* name,Int_t *z,
+                               Int_t *w,Double_t dens,Int_t n,Int_t istd){
+    // Defines a Geant material by a set of elements and number, and sets 
+    // its Geant medium proporties. The average atomic A is assumed to be 
+    // given by their natural abundances. Things like the radiation length 
+    // are calculated for you.
+    // Inputs:
+    //    Int_t imat       Material number.
+    //    const char* name Material name. No need to add a $ at the end.
+    //    Int_t *z         Array of The elemental numbers.
+    //    Int_t_t *w       Array of relative number.
+    //    Double_t dens    The density of the material [g/cm^3].
+    //    Int_t n          the number of elements making up the mixture.
+    //    Int_t istd       Defines which standard set of transport parameters
+    //                     which should be used.   
+    // Output:
+    //     none.
+    // Return:
+    //     none.
+    Float_t *Z,*A,*W,tmax,stemax,deemax,epsilon;
+    char *name2;
+    Int_t len,i;
+    Z = new Float_t[n];
+    A = new Float_t[n];
+    W = new Float_t[n];
+
+    len = strlen(name)+1;
+    name2 = new char[len];
+    strncpy(name2,name,len-1);
+    name2[len-1] = '\0';
+    name2[len-2] = '$';
+    for(i=0;i<n;i++){Z[i] = (Float_t)z[i];A[i] = (Float_t)GetA(z[i]);
+                     W[i] = (Float_t)w[i];}
+    fits->AliMixture(imat,name2,A,Z,dens,-n,W);
+    tmax    = GetStandardThetaMax(istd);    // degree
+    stemax  = GetStandardMaxStepSize(istd);  // cm
+    deemax  = GetStandardEfraction(istd);     // #
+    epsilon = GetStandardEpsilon(istd);
+    fits->AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
+                   gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
+    delete[] name2;
+    delete[] Z;
+    delete[] A;
+    delete[] W;
+}
+//______________________________________________________________________
+Double_t AliITSBaseGeometry::RadLength(Int_t iz,Double_t a){
+    // Computes the radiation length in accordance to the PDG 2000 Section
+    // 23.4.1 p. 166. Transladed from the c code of Flavio Tosello.
+    // Inputs:
+    //    Int_t iz    The elemental number
+    //    Dougle_t    The elemental average atomic mass number
+    // Outputs:
+    // Return:
+    //    Double_t returns the radiation length of the element iz in
+    //             [gm/cm^2].
+    Double_t z = (Double_t)iz;
+    Double_t alphaz = fAlpha*z;
+    Double_t alphaz2 = alphaz*alphaz;
+    Double_t c0 = +0.20206,c1 = -0.0369,c2 = +0.0083,c3 = -0.0020;
+    Double_t z12,z23,l,lp,c;
+
+    c = alphaz2*(1./(1.+alphaz2) + c0 + c1*alphaz2 + c2*alphaz2*alphaz2
+                 +c3*alphaz2*alphaz2*alphaz2);
+    z12 = TMath::Exp(TMath::Log(z)/3.0);
+    z23 = z12*z12;
+    switch (iz){
+    case 1: //Hydrogen
+       l  = 5.31;
+       lp = 6.144;
+       break;
+    case 2: //Helium
+       l  = 4.79;
+       lp = 5,621;
+       break;
+    case 3: //Lithium
+       l  = 4.74;
+       lp = 5.805;
+       break;
+    case 4: //Berilium
+       l  = 4.71;
+       lp = 5.924;
+       break;
+    default: //Others
+       l  = TMath::Log(184.15/z12);
+       lp = TMath::Log(1194.0/z23);
+       break;
+    } // end switch
+    Double_t re2,b,r,xz;
+
+    re2 = fRe*fRe;
+    b = 4.0*fAlpha*re2*fNa/a;
+    r = b*z*(z*(l-c)+lp);
+    xz = 1.0/r;
+    return xz; // [gm/cm^2]
+}
diff --git a/ITS/AliITSBaseGeometry.h b/ITS/AliITSBaseGeometry.h
new file mode 100644 (file)
index 0000000..e837b7f
--- /dev/null
@@ -0,0 +1,171 @@
+#ifndef ALIITSBASEGEOMETRY_H
+#define ALIITSBASEGEOMETRY_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/////////////////////////////////////////////////////////////////////////
+//  A basic geometry class for the ITS simulation geometry stucture
+/////////////////////////////////////////////////////////////////////////
+
+#include <TObject.h>
+#include <TArrayI.h>
+#include "AliModule.h"
+class TString;
+
+class AliITSBaseGeometry : public TObject {
+ public:
+    AliITSBaseGeometry(); // Default constructor
+    AliITSBaseGeometry(AliModule *its,Int_t iflag); // Standard Constructor
+    virtual ~AliITSBaseGeometry(); // Destructor
+    virtual void BuildDisplayGeometry(){}; // Calls ROOT geometry interface
+                                      // to AliRoot display
+    virtual void CreateG3Geometry(){}; // Calls Geant3 interface geometry routines
+    virtual void CreateG3Materials(){}; // Calls Geant3 interface for materials
+    virtual Int_t IsVersion() const{return 11;}// return version of geometry.
+
+    Int_t ITSG3VnameToIndex(const char name[3])const; // Get Index for Geant3 v name
+    char* ITSIndexToITSG3name(const Int_t i); // Get Geant3 volume name
+    Int_t AddVolName(const TString name); // Add volumen name to list
+    TString GetVolName(const Int_t i)const; // Return volume name at index
+    Int_t GetVolumeIndex(const TString &a);
+    void SetScalecm(){fScale = 1.0;}// Sets scale factor for centemeters
+    void SetScalemm(){fScale = 0.10;}// Sets scale factor for milimeters
+    void SetScalemicrons(){fScale = 1.0E-04;}// Sets scale factor for microns
+    void SetScale(Double_t s=1.0){fScale = s;}// Sets scale factor
+    Double_t GetScale()const{return fScale;}// Returns the scale factor
+    Bool_t IsScalecm()const{// Returens kTRUE if scale factor is set of [cm]
+        if(fScale==1.0) return kTRUE; return kFALSE;}
+    // Create a Box
+    void Box(const char gnam[3],const TString &dis,
+             Double_t dx,Double_t dy,Double_t dz,Int_t med);
+    // Greate A Trapizoid with the x dimension varing along z.
+    void Trapezoid1(const char gnam[3],const TString &dis,Double_t dxn,
+                    Double_t dxp,Double_t dy,Double_t dz,Int_t med);
+    // Greate A Trapizoid with the x and y dimension varing along z.
+    void Trapezoid2(const char gnam[3],const TString &dis,Double_t dxn,
+                    Double_t dxp,Double_t dyn,Double_t dyp,Double_t dz,
+                    Int_t med);
+    // General trapazoid.
+    void Trapezoid(const char gnam[3],const TString &dis,Double_t dz,
+                   Double_t thet,Double_t phi,Double_t h1,Double_t bl1,
+                   Double_t tl1,Double_t alp1,Double_t h2,Double_t bl2,
+                   Double_t tl2,Double_t alp2,Int_t med);
+    // Simple Tube.
+    void Tube(const char gnam[3],const TString &dis,Double_t rmin,
+              Double_t rmax,Double_t dz,Int_t med);
+    // Tube segment.
+    void TubeSegment(const char gnam[3],const TString &dis,Double_t rmin,
+                     Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
+                     Int_t med);
+    // Simple Cone.
+    void Cone(const char gnam[3],const TString &dis,Double_t dz,Double_t rmin1,
+              Double_t rmax1,Double_t rmin2,Double_t rmax2,Int_t med);
+    // Segment of a Cone.
+    void ConeSegment(const char gnam[3],const TString &dis,Double_t dz,
+                     Double_t rmin1,Double_t rmax1,Double_t rmin2,
+                     Double_t rmax2,Double_t phi1,Double_t phi2,Int_t med);
+    // Spherical shell segment.
+    void Sphere(const char gnam[3],const TString &dis,Double_t rmin,
+                Double_t rmax,Double_t the1,Double_t the2,Double_t phi1,
+                Double_t phi2,Int_t med);
+    // Parallelepiped.
+    void Parallelepiped(const char gnam[3],const TString &dis,Double_t dx,
+                        Double_t dy,Double_t dz,Double_t alph,Double_t thet,
+                        Double_t phi,Int_t med);
+    // Polygon.
+    void Polygon(const char gnam[3],const TString &dis,Double_t phi1,
+                 Double_t dphi,Int_t npdv,Int_t nz,Double_t *z,Double_t *rmin,
+                 Double_t *rmax,Int_t med);
+    //Poly-Cone
+    void PolyCone(const char gnam[3],const TString &dis,Double_t phi1,
+                  Double_t dphi,Int_t nz,Double_t *z,Double_t *rmin,
+                  Double_t *rmax,Int_t med);
+    // Ellliptical cross-sectino tube
+    void TubeElliptical(const char gnam[3],const TString &dis,Double_t p1,
+                        Double_t p2,Double_t dz,Int_t med);
+    // Hyperbolic tube
+    void HyperbolicTube(const char gnam[3],const TString &dis,Double_t rmin,
+                        Double_t rmax,Double_t dz,Double_t thet,Int_t med);
+    // Twisted genral trapezoid.
+    void TwistedTrapezoid(const char gnam[3],const TString &dis,Double_t dz,
+                          Double_t thet,Double_t phi,Double_t twist,
+                          Double_t h1,Double_t bl1,Double_t tl1,
+                          Double_t apl1,Double_t h2,Double_t bl2,
+                          Double_t tl2,Double_t apl2,Int_t med);
+    // Cut tube.
+    void CutTube(const char gnam[3],const TString &dis,Double_t rmin,
+                 Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
+                 Double_t lx,Double_t ly,Double_t lz,Double_t hx,Double_t hy,
+                 Double_t hz,Int_t med);
+    // Position one volume inside another
+    void Pos(const char vol[3],Int_t cn,const char moth[3],Double_t x,
+             Double_t y,Double_t z,Int_t irot);
+    void SetMedArray(){// Sets up the array of media
+        fidmed = ((fits->GetIdtmed())->GetArray())-199;}// Define rotation matrix
+    void Matrix(Int_t irot,Double_t thet1,Double_t phi1,Double_t thet2,
+                Double_t phi2,Double_t thet3,Double_t phi3);
+    // Defube ritatuib matrix
+    void Matrix(Int_t irot,Double_t rot[3][3]);
+    // Rotation matrix about axis i (i=0=>x, i=1=>y, i=2=>z).
+    void Matrix(Int_t irot,Int_t axis,Double_t thet);
+    // Rotation matrix about x axis
+    void XMatrix(Int_t irot,Double_t thet){Matrix(irot,0,thet);}
+    // Rotation matrix about y axis
+    void YMatrix(Int_t irot,Double_t thet){Matrix(irot,1,thet);}
+    // Rotation matrix about z axis
+    void ZMatrix(Int_t irot,Double_t thet){Matrix(irot,2,thet);}
+    // Define Element material and medium
+    void Element(Int_t imat,const char *name,Int_t z,Double_t dens,Int_t istd);
+    // Define Material by constituant weights
+    void MixtureByWeight(Int_t imat,const char *name,Int_t *z,Double_t *w,
+                         Double_t dens,Int_t nelments,Int_t istd);
+    // Define Material by constituant relative number
+    void MixtureByNumber(Int_t imat,const char *name,Int_t *z,Int_t *i,
+                         Double_t dens,Int_t nelments,Int_t istd);
+    // Returns standard radiation lenghts of elements.
+    Float_t GetRadLength(Int_t z){return RadLength(z,(Double_t)GetA(z));}
+    // Returns natrual abundance atomic mass numbers for a given element
+    Float_t GetA(Int_t z);
+    // Returns ITS standard Theata Max transport cut values
+    Float_t GetStandardThetaMax(Int_t istd);
+    // Returns ITS standard Max step size transport cut values
+    Float_t GetStandardMaxStepSize(Int_t istd);
+    // Returns ITS standard frational energy transport cut values
+    Float_t GetStandardEfraction(Int_t istd);
+    // Returns ITS standard epsilon transport cut values
+    Float_t GetStandardEpsilon(Int_t istd);
+    // Degree Versions of TMath functions (as needed)
+    Double_t Sind(Double_t t){return TMath::Sin(TMath::Pi()*t/180.);}
+    Double_t Cosd(Double_t t){return TMath::Cos(TMath::Pi()*t/180.);}
+    Double_t Tand(Double_t t){return TMath::Tan(TMath::Pi()*t/180.);}
+    Double_t ASind(Double_t t){return 180.0*TMath::ASin(t)/TMath::Pi();}
+    Double_t ACosd(Double_t t){return 180.0*TMath::ACos(t)/TMath::Pi();}
+    Double_t ATand(Double_t t){return 180.0*TMath::ATan(t)/TMath::Pi();}
+    Double_t ATand2(Double_t y,Double_t x){return 180.0*TMath::ATan2(y,x)/
+                                              TMath::Pi();}
+    Double_t RadLength(Int_t iz,Double_t a); // Computes radiation length
+                                             // for an element
+ private:
+    static Int_t fNCreates; //! Counts the number of time this class has
+    // been created.
+    static const Double_t fAlpha = 7.297352533e-3; //! find structure constant
+    static const Double_t fRe = 2.81794028e-13;//![cm]classical electron radius
+    static const Double_t fNa = 6.02214199e+23; //! [#/mole] Avogadro's number
+    static Int_t *fidrot;
+    static Int_t fidrotsize;
+    static Int_t fidrotlast;
+    static TString *fVolName; // Array of ITS Volumen names.
+    static Int_t fVolNameSize; // Size of Array fVolName
+    static Int_t fVolNameLast; // Last filled element of fVolName
+    Double_t fScale; // Scale factor (=1=>[cm]).
+    Int_t *fidmed; // pointer to array of medium numbers
+    AliModule *fits; // local pointer to ITS module needed for AliMixture...
+
+    ClassDef(AliITSBaseGeometry,1) // Basic ITS Geometry class
+};
+
+#endif
diff --git a/ITS/AliITSGeometrySSDCone.cxx b/ITS/AliITSGeometrySSDCone.cxx
new file mode 100644 (file)
index 0000000..e6f5c35
--- /dev/null
@@ -0,0 +1,548 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+/*
+$Log$
+$Id$
+*/
+
+#include <Riostream.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <TMath.h>
+#include <TGeometry.h>
+#include <TNode.h>
+#include <TTUBE.h>
+#include <TTUBS.h>
+#include <TPCON.h>
+#include <TFile.h>    // only required for Tracking function?
+#include <TCanvas.h>
+#include <TObjArray.h>
+#include <TLorentzVector.h>
+#include <TObjString.h>
+#include <TClonesArray.h>
+#include <TBRIK.h>
+#include <TSystem.h>
+#include <TVector3.h>
+
+#include "AliITSGeometrySSDCone.h"
+
+ClassImp(AliITSGeometrySSDCone)
+
+//______________________________________________________________________
+AliITSGeometrySSDCone::AliITSGeometrySSDCone(){
+    //Default Constructor for SSD Cone geometry
+
+    SetScalemm();
+}
+//______________________________________________________________________
+AliITSGeometrySSDCone::AliITSGeometrySSDCone(TVector3 *&tran,
+                                            const char moth[3],Int_t mat0){
+    //Standard Constructor for SSD Cone geometry
+    // Inputs:
+    //   Double_t z0  Z-axis shift of this volume
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+    Double_t t; // some general angle and coordinates [degrees].
+
+    th = 13.0; //mm, Thickness of Rohacell+carbon fiber
+    ct=1.5; //mm, Carbon finber thickness
+    r=15.0; // mm, Radius of curvature.
+    tc=51.0; // angle of SSD cone [degrees].
+    sintc=Sind(tc);costc=Cosd(tc);tantc=Tand(tc);
+    z0=0.0;zcylinder=170.0;zpost=196.0;
+    Routmax=0.5*985.0;RoutHole=0.5*965.0;Routmin=0.5*945.0;
+    Rholemax=0.5*890.0;Rholemin=0.5*740.0;
+    RPostmin=316.0;dRPost=23.0;zpostmax=196.0;phi0post=30.0;
+    Rinmax=0.5*590.0;Rincylinder=0.5*597.0;RinHole=0.5*575.0;
+    Rinmin=0.5*562.0;dzin=15.0;
+    nspoaks=12;ninscrews=40;npost=4;nmounts=4;
+    SSDcf=mat0+1; // SSD support cone Carbon Fiber materal number.
+    SSDfs=mat0+2; // SSD support cone inserto stesalite 4411w.
+    SSDfo=mat0+3; // SSD support cone foam, Rohacell 50A.
+    SSDsw=mat0+4; // SSD support cone screw material,Stainless steal
+    ncse=0; // number of screw ends (copy number)
+    ncpe=0; // number of pin end (copy number)
+    ncst=0; // number of screw tops (copy number)
+
+    SetScalemm();
+    // Lets start with the upper left outer carbon fiber surface.
+    // Between za[2],rmaxa[2] and za[4],rmaxa[4] there is a curved section
+    // given by rmaxa = rmaxa[2]-r*Sind(t) for 0<=t<=tc and 
+    // za = za[2] + r*Cosd(t) for 0<=t<=tc. Simularly between za[1],rmina[1
+    // and za[3],rmina[3] there is a curve section given by
+    // rmina = rmina[1]-r*Sind(t) for 0<=t<=tc and za = za[1]+r&Sind(t)
+    // for t<=0<=tc. These curves have been replaced by straight lines
+    // between the equivelent points for simplicity.
+    Double_t dza = th/sintc-(Routmax-Routmin)/tantc;
+    if(dza<=0){ // The number or order of the points are in error for a proper
+       // call to pcons!
+       Error("SSDcone","The definition of the points for a call to PCONS is"
+             " in error. abort.");
+       return;
+    } // end if
+    dphia=360.0;
+    phi0a= 0.0;
+    za[0]    = z0;
+    rmina[0] = Routmin;
+    rmaxa[0] = Routmax;
+    za[1]    = za[0]+13.5-5.0 - dza; // za[2] - dza.
+    rmina[1] = rmina[0];
+    rmaxa[1] =rmaxa[0];
+    za[2]    = za[0]+13.5-5.0; // From Drawing ALR-0767 and ALR-0767/3
+    rmaxa[2] = rmaxa[0];
+    za[3]    = za[1]+r*sintc;
+    rmina[3] = rmina[1]-r*sintc;
+    rmina[2] = rmina[1]+(rmina[3]-rmina[1])*(za[2]-za[1])/(za[3]-za[1]);
+    za[4]    = za[2]+r*sintc;
+    rmaxa[4] = rmaxa[2]-r*sintc;
+    rmaxa[3] = rmaxa[2]+(rmaxa[4]-rmaxa[2])*(za[3]-za[2])/(za[4]-za[2]);
+    rmina[5] = Rholemax;
+    za[5]    = za[3]+(za[4]-za[3])*(rmina[5]-rmina[3])/(rmina[4]-rmina[3]);
+    rmina[4] = rmina[3]+(rmina[5]-rmina[3])*(za[4]-za[3])/(za[5]-za[3]);
+    za[6]    = th/sintc+za[5];
+    rmina[6] = Rholemax;
+    rmaxa[6] = rmina[6];
+    rmaxa[5] = rmaxa[4]+(rmaxa[6]-rmaxa[4])*(za[5]-za[4])/(za[6]-za[4]);
+    //
+    // Now lets define the Inserto Stesalite 4411w material volume.
+    dphib=360.0;
+    phi0b= 0.0;
+    zb[0] = z0;
+    rminb[0] = rmina[0]+ct;
+    rmaxb[0] = rmaxa[0]-ct;
+    zb[1] = za[1];
+    rminb[1] = rminb[0];
+    rmaxb[1] = rmaxb[0];
+    zb[2] = za[2];
+    rmaxb[2] = rmaxb[1];
+    zb[3] = za[4] - ct/sintc;
+    rmaxb[3] = rmaxb[2] - (r-ct)*sintc;
+    zb[4] = za[3]+ct/sintc;
+    rminb[4] = rminb[1]-(r-ct)*sintc;
+    rminb[2] = rminb[1]+(rminb[4]-rminb[1])*(zb[2]-zb[1])/(zb[4]-zb[1]);
+    rminb[3] = rminb[1]+(rminb[4]-rminb[1])*(zb[3]-zb[1])/(zb[4]-zb[1]);
+    zb[5] = zb[4]+(ct-2.*ct)/sintc;
+    rminb[5] = rminb[4]+(ct-2.*ct)*tantc;
+    rmaxb[5] = rminb[5];
+    rmaxb[4] = rmaxb[3]+(rmaxb[5]-rmaxb[3])*(zb[4]-zb[3])/(zb[5]-zb[3]);
+    //
+    // Now lets define the Rohacell foam material volume.
+    dphic=360.0;
+    phi0c= 0.0;
+    zc[0] = zb[4];
+    rminc[0] = rminb[4];
+    rmaxc[0] = rminc[0];
+    zc[1] = zb[5];
+    rmaxc[1] = rminb[5];
+    zc[2] = za[5] + ct/sintc;
+    rminc[2] = rmina[5]+ct; // leave space for carbon fiber covering hole.
+    rminc[1] = rminc[0] +(rminc[2]-rminc[0])*(zc[1]-zc[0])/(zc[2]-zc[0]);
+    zc[3] = za[6] - ct/sintc;
+    rminc[3] = rmina[6]+ct;
+    rmaxc[3] = rminc[3];
+    rmaxc[2] = rmaxc[1]+(rmaxc[3]-rmaxc[1])*(zc[2]-zc[1])/(zc[3]-zc[1]);
+    //
+    // In volume SCB, th Inserto Stesalite 4411w material volume, there
+    // are a number of Stainless steel screw and pin studs which will be
+    // filled with screws/studs.
+    rmine=0.0,rmaxe=6.0,dze=0.5*10.0; // mm
+    rmine2=0.0;rmaxe2=6.0;dze2=0.5*12.0; // mm
+    //
+    // There is no carbon fiber between this upper left section and the
+    // SSD spoaks. We remove it by replacing it with Rohacell foam.
+    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
+    // carbon fiber thickness uniform in this phi direction. We can only
+    // make it a fixed angular thickness.
+    t *= 180.0/TMath::Pi();
+    dphif = 5.0 - 2.0*t; // degrees
+    phi0f = 12.5+t; // degrees see drawing ALR-0767.
+    zf[0] = zc[2];
+    rminf[0] = rminc[3];
+    rmaxf[0] = rminf[0];
+    rminf[1] = rmina[5];
+    rmaxf[1] = rminf[0];
+    zf[1] = zc[0]+(zc[2]-zc[0])*(rminf[1]-rminc[0])/(rminc[2]-rminc[0]);
+    zf[2] = zc[3];
+    rminf[2] = rminf[1];
+    rmaxf[2] = rmaxf[1];
+    zf[3] = zc[1]+(zc[3]-zc[1])*(rmaxf[3]-rmaxc[1])/(rmaxc[3]-rmaxc[1]);
+    rminf[3] = rmina[5];
+    rmaxf[3] = rminf[3];
+    //=================================================================
+    // Now for the spoak part of the SSD cone.
+    // It is not posible to inclue the radius of curvature between
+    // the spoak part and the upper left part of the SSD cone or lowwer right
+    // part. This would be discribed by the following curves.
+    // R = Rmax - (5mm)*Sin(t) phi = phi0+(5mm*180/(Pi*RoutHole))*Sin(t) 
+    // where 0<=t<=90 For the inner curve a simular equiation holds.
+    phi0g = 12.5; // degrees see drawing ALR-0767.
+    dphig = 5.0; // degrees
+    zg[0] = zb[5];
+    rming[0] = rmina[5];
+    rmaxg[0] = rming[0];
+    zg[1] = za[6];
+    rming[1] = -tantc*(zg[1]-za[3])+rmina[3];
+    rmaxg[1] = rmaxg[0];
+    rming[2] = Rholemin;
+    zg[2] = za[3]-(rming[2]-rmina[3])/tantc;
+    rmaxg[2] = -tantc*(zg[2]-za[4])+rmaxa[4];
+    rming[3] = rming[2];
+    rmaxg[3] = rming[3];
+    zg[3] = za[4]-(rmaxg[3]-rmaxa[4])/tantc;
+    // For the foam core.
+    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
+    // carbon fiber thickness uniform in this phi direction. We can only
+    // make it a fixed angular thickness.
+    t *= 180.0/TMath::Pi();
+    dphih = 5.0 - 2.0*t; // degrees
+    phi0h = 12.5+t; // degrees see drawing ALR-0767.
+    zh[0] = zf[2];
+    rminh[0] = rming[0];
+    rmaxh[0] = rmaxg[0];
+    zh[1] = zf[3];
+    rminh[1] = rming[1]-(ct/sintc-(zg[1]-zh[1]))*tantc;
+    rmaxh[1] = rmaxh[0];
+    zh[2] = zg[2]+ct/tantc;
+    rminh[2] = rming[2];
+    rmaxh[2] = rmaxg[2]-(ct/sintc-(zg[2]-zh[2]))*tantc;
+    zh[3] = zg[3]-ct/sintc;
+    rminh[3] = rminh[2];
+    rmaxh[3] = rminh[3];
+    //
+    //==================================================================
+    // Now for the Inner most part of the SSD cone.
+    phi0i = 0.0;
+    dphii = 360.0;
+    Double_t za,rmina,rmaxa; // additional point not needed in call to pcons.
+    zi[0] = zg[2];
+    rmini[0] = rming[2];
+    rmaxi[0] = rmini[0];
+    zi[1] = zg[3];
+    rmini[1] = -tantc*(zi[1]-za[3])+rmina[3];
+    rmaxi[1] = rmaxi[0];
+    rmini[5] = Rinmin;
+    rmaxi[5] = Rinmax+r*sintc;
+    zi[5] =za[4]+(rmaxa[4]-rmaxi[5])/tantc;
+    za = zi[5]+r*costc;
+    rmina = rmini[5];
+    rmaxa = Rinmax;
+    zi[3] = za-dzin;
+    zi[2] = zi[3] -r*costc;
+    rmini[2] = -tantc*(zi[2]-za[3])+rmina[3];
+    rmaxi[2] = -tantc*(zi[2]-za[4])+rmaxa[4];
+    rmini[3] = rmini[2] -r*costc;
+    zi[4] = zi[3];
+    rmini[4] = Rinmin;
+    rmaxi[4] = -tantc*(zi[4]-za[4])+rmaxa[4];
+    rmaxi[3] = rmaxi[4];
+    zi[6] = zcylinder;
+    rmini[6] = Rinmin;
+    rmaxi[6] = rmaxi[5] - (zi[5]-zi[6])*(rmaxi[5]-rmaxa)/(zi[5]-za);
+    zi[7] = zi[6];
+    rmini[7] = Rincylinder;
+    rmaxi[7] = rmaxi[6];
+    rmini[8] = Rincylinder;
+    rmaxi[8] = rmini[8];
+    zi[8] = zi[5]+(rmaxi[8]-rmaxi[5])*(za-zi[5])/(rmaxa-rmaxi[5]);
+    // Now for Inserto volume at the inner most radius.
+    phi0k = 0.0;
+    dphik = 360.0;
+    zk[1] = zi[3]+ct;
+    zk[0] = zk[1]-(r+ct)*costc;
+    rmink[0] = rmini[3]+(r+ct)*sintc;
+    rmaxk[0] = rmink[0];
+    rmink[1] = rmini[3];
+    zk[2] = zk[1];
+    rmink[2] = rmini[6];
+    rmaxk[2] = rmaxk[1];
+    zk[3] = zk[0]+(th+2.0*ct)*costc;
+    rmink[3] = rmini[6];
+    rmaxk[3] = rmaxk[0]+(th+2.0*ct)*sintc;
+    rmaxk[1] = rmaxk[0]+(rmaxk[3]-rmaxk[0])*(zk[1]-zk[0])/(zk[3]-zk[0]);
+    rmink[4] = rmini[6];
+    rmaxk[4] = rmaxi[5]-ct*sintc;
+    zk[4] = zc[1]+(zc3[3]-zc[1])*(rmaxk[4]-rmaxc[1])/(rmaxc[3]-rmaxc[1]);
+    zk[5] = zi[5]-r*costc-ct;
+    rmink[5] = rmini[6];
+    rmaxk[5] = rmini[8];
+    zk[6] = zi[6];
+    rmink[6] = rmini[6];
+    rmaxk[6] = rmaxi[6];
+    // Now for foam core at the inner most radius.
+    phi0j = 0.0;
+    dphij = 360.0;
+    rminj[0] = rmini[0]-ct;
+    zj[0] = zc[0]+(zc[2]-zc[0])*(rminj[0]-rminc[0])/(rminc[2]-rminc[0]);
+    rmaxj[0] = rminj[0];
+    rmaxj[1] = rmaxj[0];
+    zj[1] = zc[1]+(zc[3]-zc[1])*(rmaxj[1]-rmaxc[1])/(rmaxc[3]-rmaxc[1]);
+    rminj[1] = rminc[0]+(rminc[2]-rminc[0])*(zj[1]-zc[0])/(zc[2]-zc[0]);
+    zj[2] = zk[0];
+    rminj[2] = rmink[0];
+    rmaxj[2] = rmaxc[1]+(rmaxc[3]-rmaxc[1])*(zj[2]-zc[1])/(zc[3]-zc[1]);
+    zj[3] = zk[3];
+    rminj[3] = rmaxk[3];
+    rmaxj[3] = rminj[3];
+    // Now for foam core at the top of the inner most radius where 
+    // the spoaks are.
+    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
+    // carbon fiber thickness uniform in this phi direction. We can only
+    // make it a fixed angular thickness.
+    t *= 180.0/TMath::Pi();
+    dphil = 5.0 - 2.0*t; // degrees
+    phi0l = 12.5+t; // degrees see drawing ALR-0767.
+    zl[0] = zh[2];
+    rminl[0] = rmini[0];
+    rmaxl[0] = rminl[0];
+    zl[1] = zj[0];
+    rminl[1] = rminj[1];
+    rmaxl[1] = rmaxi[0];
+    zl[2] = zh[3];
+    rminl[2] = rminl[1];
+    rmaxl[2] = rmaxl[1];
+    zl[3] = zj[1];
+    rminl[3] = rminl[2];
+    rmaxl[3] = rminl[3];
+    // Now for the SSD mounting posts
+    dphio = 180.0*dRPost/(RPostmin+0.5*dRPost)/TMath::Pi(); // degrees
+    phi0o = phi0post; //
+    rmino[0] = RPostmin+dRPost;
+    rmaxo[0] = rmino[0];
+    zo[0] = za[4]+(rmaxa[4]-rmaxo[0])/tantc;
+    rmino[1] = RPostmin;
+    zo[1] = za[4]+(rmaxa[4]-rmino[1])/tantc;
+    rmaxo[1] = rmaxo[0];
+    zo[2] = z0+zpostmax;
+    rmino[2] = RPostmin;
+    rmaxo[2] = rmino[2]+dRPost;
+    // Now for the SSD mounting posts
+    t = 180.0*ct/(RPostmin+0.5*dRPost)/TMath::Pi();
+    dphip = dphio-2.0*t; // degrees
+    phi0p = phio0+t; //
+    rminp[0] = rmino[0]-ct;
+    rmaxp[0] = rminp[0];
+    zp[0] = za[4]+(rmaxa[4]-rmaxp[0])/tantc;
+    rminp[1] = rmino[0]+ct;
+    rmaxp[1] = rmino[0]-ct;
+    zp[1] = za[4]+(rmaxa[4]-rminp[1])/tantc;
+    rminp[2] = rminp[1];
+    rmaxp[2] = rmaxp[1];
+    zp[2] = z0-zpostmax;
+    // This insrto continues into the SSD cone displacing the foam
+    // and the carbon fiber surface at those points where the posts are.
+    dphim=360.0;
+    phi0m= 0.0;
+    rminm[0] = RPostmin+dRPost-ct;
+    rmaxm[0] = rminm[0];
+    zm[0] = zj[0]+(zj[2]-zj[0])*(rminm[0]-rminj[0])/(rminj[2]-rminj[0]);
+    rmaxm[1] = rmaxm[0];
+    zm[1] = zj[1]+(zj[3]-zj[1])*(rmaxm[1]-rmaxj[1])/(rmaxj[3]-rmaxj[1]);
+    rminm[2] = RPostmin+ct;
+    zm[2] = zj[0]+(zj[2]-zj[0])*(rminm[2]-rminj[0])/(rminj[2]-rminm[0]);
+    rmaxm[2] = rmaxj[1]+(rmaxj[3]-rmaxm[1])*(zm[2]-zj[1])/(zj[3]-zj[1]);
+    rminm[3] = rminm[2];
+    rmaxm[3] = rminm[3];
+    dphin=360.0;
+    phi0n= 0.0;
+    zn[0] = zm[1];
+    rminn[0] = rmaxm[1];
+    rmaxn[0] = rminn[0];
+    rmaxn[1] = rmaxn[0];
+    zn[1] = za[4]+(rmaxa[4]-rmaxn[1])/tantc;
+    rminn[1] = rmaxj[1]+(rmaxj[3]-rmaxj[1])*(zn[1]-zj[1])/(zj[3]-zj[1]);
+    zn[2] = zm[3];
+    rminn[2] = rminm[3];
+    rmaxn[2] = -tantc*(zn[2]-za[4])+rmaxa[4];
+    rminn[3] = rminn[2];
+    rmaxn[3] = rminn[3];
+    zn[3] = za[4]+(rmaxa[4]-rmaxn[3])/tantc;
+}
+//______________________________________________________________________
+void AliITSGeometrySSDCone::CreateG3Geometry(const char moth[3],
+                                            TVector3 &trans){
+    // Calls Geant 3 geometry inilization routines with the information
+    // stored in this class.
+    // Inputs:
+    //    none.
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    PolyCone("SCA","SSD Suport cone Carbon Fiber Surface outer left",
+            phi0a,dphia,nza,za,rmina,rmaxa,SSDcf);
+    Pos("SCA",1,moth,trans.x(),trans.y(),trans.z(),0);
+    XMatrix(1,180.0);
+    Pos("SCA",2,moth,trans.x(),trans.y(),-trans.z(),1);
+    PolyCone("SCB","SSD Suport cone Inserto Stesalite left edge",
+            phi0b,dphib,nzb,zb,rminb,rmaxb,SSDfs);
+    Pos("SCB",1,"SCA",0.0,.0,0.0,0);
+    PolyCone("SCC","SSD Suport cone Rohacell foam left edge",
+            phi0,dphi,nz,zc,rminc,rmaxc,SSDfo);
+    Pos("SCC",1,"SCA",0.0,.0,0.0,0);
+    Tube("SCD","Screw+stud used to mount things to the SSD support cone",
+        rmine,rmaxe,dze,SSDsw);
+    Tube("SCE","pin used to mount things to the SSD support cone",
+        rmine2,rmaxe2,dze2,SSDsw);
+    k=l=0;
+    for(i=0;i<2;i++){ // position for ITS-TPC mounting brackets
+       for(j=0;j<2;j++){ // 2 screws per bracket
+           ncse++;
+           t = -5.0+10.0*((Double_t)j)+180.*((Double_t)i);
+           x = RoutHole*Sind(t);
+           y = RoutHole*Cosd(t);
+           z = dz;
+           Pos("SCD",ncse,"SCB",x,y,z,0);
+       } // end for j
+       for(j=0;j<3;j++){ // 3 pins per bracket
+           ncpe++;
+           t = -3.0+3.0*((Double_t)j)+180.*((Double_t)i);
+           x = RoutHole*Sind(t);
+           y = RoutHole*Cosd(t);
+           z = dz;
+           Pos("SCE",ncpe,"SCB",x,y,z,0);
+       } // end for j
+    } // end for i
+    for(i=0;i<2;i++){ // position for ITS-rail mounting brackets
+       for(j=0;j<4;j++){ // 4 screws per bracket
+           a[4]={0.0,2.0,5.0,7.0}; // Relative angles.
+           ncse++;
+           t = 90.0-a[j]+187.*((Double_t)i);
+           x = RoutHole*Sind(t);
+           y = RoutHole*Cosd(t);
+           z = dz;
+           Pos("SCD",kncs,"SCB",x,y,z,0);
+       } // end for j
+       for(j=0;j<2;j++){ // 2 pins per bracket
+           ncpe++;
+           t = 88+7.0*((Double_t)j)+184.*((Double_t)i);
+           x = RoutHole*Sind(t);
+           y = RoutHole*Cosd(t);
+           z = dz;
+           Pos("SCE",ncse,"SCB",x,y,z,0);
+       } // end for j
+    } // end for i
+    for(i=0;i<nmounts;i++){ // mounting holes/screws for beam pipe support
+       // and SPD cone support (dump side,non-dump side has them to).
+       for(j=0;j<2;j++){ // 2 screws per bracket
+           ncse++;
+           t = 180.*20./(RoutHole*TMath::Pi());
+           t = 45.0+((Doulbe_t)(j-1))*t+90.*((Double_t)i);
+           x = RoutHole*Sind(t);
+           y = RoutHole*Cosd(t);
+           z = dz;
+           Pos("SCD",ncse,"SCB",x,y,z,0);
+       } // end for j
+       for(j=0;j<1;j++){ // 1 pins per bracket
+           ncpe++;
+           t = 45.0+90.*((Double_t)i);
+           x = RoutHole*Sind(t);
+           y = RoutHole*Cosd(t);
+           z = dz;
+           Pos("SCE",ncpe,"SCB",x,y,z,0);
+       } // end for j
+    } // end for i
+    PolyCone("SCF","SSD Suport cone Rohacell foam left edge",
+            phi0f,dphif,nzf,zf,rminf,rmaxf,SSDfo);
+    Pos("SCF",1,"SCA",0.0,.0,0.0,0);
+    for(i=1;i<nspoaks;i++){
+       Zmatrix(irot+i,360./((Double_t)nspoaks));
+       Pos("SCG",i+1,"SCA",0.0,.0,0.0,irot+i);
+    } // end for i
+    PolyCone("SCG","SSD spoak carbon fiber surfaces",
+            phi0g,dphig,nzg,zg,rming,rmaxc,SSDcf);
+    Pos("SCG",i+1,"SCA",0.0,.0,0.0,0);
+    for(i=1;i<nspoaks;i++){
+       Pos("SCG",i+1,"SCA",0.0,.0,0.0,irot+i);
+    } // end for i
+    PolyCone("SCH","SSD spoak foam core",
+            phi0h,dphih,nzh,zh,rminh,rmaxh,SSDfo);
+    Pos("SCH",1,"SCG",0.0,.0,0.0,0);
+    PolyCone("SCI","SSD lower/inner right part of SSD cone",
+            phi0i,dphii,nzi,zci,rminci,rmaxci,SSDcf);
+    Pos("SCI",1,moth,0.0,.0,0.0,0);
+    PolyCone("SCK","SSD inner most inserto material",
+            phi0k,dphik,nzk,zk,rmink,rmaxk,SSDfs);
+    Pos("SCK",1,"SCI",0.0,.0,0.0,0);
+    PolyCone("SCJ","SSD inner most foam core",
+            phi0j,dphij,nzj,zj,rminj,rmaxj,SSDfo);
+    Pos("SCJ",1,"SCI",0.0,.0,0.0,0);
+    PolyCone("SCL","SSD inner most foam core",
+            phi0l,dphil,nzl,zl,rminl,rmaxl,SSDfo);
+    Pos("SCL",1,"SCI",0.0,.0,0.0,0);
+    for(i=1;i<nspoaks;i++){
+       Pos("SCG",i+1,"SCA",0.0,.0,0.0,irot+i);
+    } // end for i
+    PolyCone("SCO","SSD mounting post, carbon fiber",
+            phi0,dphi,nz,zc,rminc,rmaxc,SSDcf);
+    Pos("SCO",1,moth,0.0,.0,0.0,0);
+    for(i=1;i<nposts;i++){
+       Zmatrix(irot+i,360./((Double_t)nposts));
+       Pos("SCO",i+1,moth,0.0,.0,0.0,irot+i);
+    } // end for
+    PolyCone("SCP","SSD mounting post, Inserto",
+            phi0p,dphip,nzp,zp,rminp,rmaxp,SSDfs);
+    Pos("SCP",1,"SCO",0.0,.0,0.0,0);
+    Pos("SCM",1,"SCJ",0.0,.0,0.0,0);
+    Pos("SCN",1,"SCI",0.0,.0,0.0,0);
+    for(i=1;i<nposts;i++){
+       Pos("SCN",i+1,"SCJ",0.0,.0,0.0,irot+i);
+       Pos("SCM",i+1,"SCI",0.0,.0,0.0,irot+i);
+    } // end for i
+    return;
+}
+//______________________________________________________________________
+void CreateG3Materials(){
+    // Fills the Geant 3 banks with Material and Medium definisions.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Returns:
+    //   none.
+    Double_t Z[5],W[5],dens;
+
+    Z[0] = 1.; W[0] = 0.5; // Hydrogen Content
+    Z[1] = 6.; W[1] = 0.5; // Carbon Content
+    MixtureByWeight(SSDcf,"Carbon Fiber for SSD support cone",Z,W,dens,2);
+    Z[0] = 1.; W[0] = 0.5; // Hydrogen Content
+    Z[1] = 6.; W[1] = 0.5; // Carbon Content
+    MixtureByWeight(SSDfs,"Inserto stealite 4411w for SSD support cone",
+                   Z,W,dens,2);
+    Z[0] = 1.; W[0] = 0.5; // Hydrogen Content
+    Z[1] = 6.; W[1] = 0.5; // Carbon Content
+    MixtureByWeight(SSDfo,"Foam core (Rohacell 50A) for SSD support cone",
+                   Z,W,dens,2);
+    Z[0] =  6.; W[0] = 0.5; // Carbon Content
+    Z[1] = 25.; W[1] = 0.5; // Iron Content
+    MixtureByWeight(SSDsw,"Stainless steal screw, pin, and stud material",
+                   Z,W,dens,2);
+}
+//______________________________________________________________________
+void AliITSGeometrySSDCone::BuildDisplayGeometry(){
+    // Fill Root geometry banks for fast simple ITS simulation event
+    // display. See Display.C, and related code, for more details.
+    // Inputs:
+    //    none.
+    // Outputs:
+    //   none.
+    // Return:
+    //  none.
+
+    // No need to display ITS cones.
+}
diff --git a/ITS/AliITSGeometrySSDCone.h b/ITS/AliITSGeometrySSDCone.h
new file mode 100644 (file)
index 0000000..fc2e807
--- /dev/null
@@ -0,0 +1,128 @@
+#ifndef ALIITSGEOMETRYSSDCONE_H
+#define ALIITSGEOMETRYSSDCONE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/*
+  ITS SSD Cone Geometry. Version 11
+*/
+#include "AliITSBaseGeometry.h"
+class TVector3;
+class  AliITSGeometrySSDCone : public AliITSBaseGeometry {
+ public:
+    AliITSGeometrySSDCone();
+    AliITSGeometrySSDCone(TVector3 *&tran,const char moth[3],Int_t mat0);
+    virtual ~AliITSGeometrySSDCone();
+    void CreateG3Geometry(const char moth[3],TVector3 &trans);
+    void CreateG3Materials();
+    void BuildDisplayGeometry();
+ private:
+    Double_t th; //mm, Thickness of Rohacell+carbon fiber
+    Double_t ct; //mm, Carbon finber thickness
+    Double_t r; // mm, Radius of curvature.
+    Double_t tc; // angle of SSD cone [degrees].
+    Double_t sintc,costc,tantc;
+    Double_t z0,zcylinder,zpost;
+    Double_t Routmax,RoutHole,Routmin;
+    Double_t Rholemax,Rholemin;
+    Double_t RPostmin,dRPost,zpostmax,phi0post;
+    Double_t Rinmax,Rincylinder,RinHole,Rinmin,dzin;
+    Int_t nspoaks,ninscrews,npost,nmounts;
+    Int_t SSDcf; // SSD support cone Carbon Fiber materal number.
+    Int_t SSDfs; // SSD support cone inserto stesalite 4411w.
+    Int_t SSDfo; // SSD support cone foam, Rohacell 50A.
+    Int_t SSDsw; // SSD support cone screw material,Stainless steal
+    Int_t ncse; // number of screw ends (copy number)
+    Int_t ncpe; // number of pin end (copy number)
+    Int_t ncst; // number of screw tops (copy number)
+    Double_t dphia,phi0a;
+    Int_t nza;
+    Double_t za[7];
+    Double_t rmina[7];
+    Double_t rmaxa[7];
+    Double_t dphib,phi0b;
+    Int_t nzb;
+    Double_t zb[6];
+    Double_t rminb[6];
+    Double_t rmaxb[6];
+    Double_t dphic,phi0c;
+    Int_t nzc;
+    Double_t zc[4];
+    Double_t rminc[4];
+    Double_t rmaxc[4];
+    Double_t dphid,phi0d;
+    Int_t nzd;
+    Double_t zd[4];
+    Double_t rmind[4];
+    Double_t rmaxd[4];
+    Double_t dze;
+    Double_t rmine;
+    Double_t rmaxe;
+    Double_t dze2;
+    Double_t rmine2;
+    Double_t rmaxe2;
+    Double_t dphif,phi0f;
+    Int_t nzf;
+    Double_t zf[4];
+    Double_t rminf[4];
+    Double_t rmaxf[4];
+    Double_t dphig,phi0g;
+    Int_t nzg;
+    Double_t zg[4];
+    Double_t rming[4];
+    Double_t rmaxg[4];
+    Double_t dphih,phi0h;
+    Int_t nzh;
+    Double_t zh[4];
+    Double_t rminh[4];
+    Double_t rmaxh[4];
+    Double_t dphii,phi0i;
+    Int_t nzi;
+    Double_t zi[8];
+    Double_t rmini[8];
+    Double_t rmaxi[8];
+    Double_t dphij,phi0j;
+    Int_t nzj;
+    Double_t zj[4];
+    Double_t rminj[4];
+    Double_t rmaxj[4];
+    Double_t dphik,phi0k;
+    Int_t nzk;
+    Double_t zk[7];
+    Double_t rmink[7];
+    Double_t rmaxk[7];
+    Double_t dphil,phi0l;
+    Int_t nzl;
+    Double_t zl[4];
+    Double_t rminl[4];
+    Double_t rmaxl[4];
+    Double_t dphim,phi0m;
+    Int_t nzm;
+    Double_t zm[4];
+    Double_t rminm[4];
+    Double_t rmaxm[4];
+    Double_t dphin,phi0n;
+    Int_t nzn;
+    Double_t zn[4];
+    Double_t rminn[4];
+    Double_t rmaxn[4];
+    Double_t dphio,phi0o;
+    Int_t nzo;
+    Double_t zo[3];
+    Double_t rmino[3];
+    Double_t rmaxo[3];
+    Double_t dphip,phi0p;
+    Int_t nzp;
+    Double_t zp[3];
+    Double_t rminp[3];
+    Double_t rmaxp[3];
+
+    ClassDef(AliITSGeometrySSDCone,1)// ITS SSD support cone geometry version 1
+};
+#endif
index 527930533a68acd57361613e8911dee2def2a849..e973399698b1cb5f32124ab4b91a1d34df6d98d2 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.5  2003/02/01 14:02:20  nilsen
+Work continues.
+
 Revision 1.4  2003/01/29 16:01:14  nilsen
 Update today's work.
 
@@ -90,1688 +93,150 @@ $Id$
 #include "AliITSClusterFinderSPD.h"
 #include "AliITSClusterFinderSDD.h"
 #include "AliITSClusterFinderSSD.h"
+//
+#include "AliITSGeometrySSDCone.h"
 
 
 ClassImp(AliITSv11)
 
 //______________________________________________________________________
 AliITSv11::AliITSv11() : AliITS() {
-    ////////////////////////////////////////////////////////////////////////
-    //    Standard default constructor for the ITS version 11.
-    ////////////////////////////////////////////////////////////////////////
-}
-//______________________________________________________________________
-AliITSv11::AliITSv11(const char *title) : AliITS("ITS", title){
-    ////////////////////////////////////////////////////////////////////////
-    //    Standard constructor for the ITS version 11.
-    ////////////////////////////////////////////////////////////////////////
-}
-//______________________________________________________________________
-AliITSv11::~AliITSv11() {
-    ////////////////////////////////////////////////////////////////////////
-    //    Standard destructor for the ITS version 11.
-    ////////////////////////////////////////////////////////////////////////
-}
-//______________________________________________________________________
-void AliITSv11::Box(const char gnam[3],const TString &dis,
-                   Double_t dx,Double_t dy,Double_t dz,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS bos geometries. Box with faces
-    // perpendicular to the axes. It has 3 paramters. See SetScale() for
-    // units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dx         half-length of box in x-axis
-    //    Double_t dy         half-length of box in y-axis
-    //    Double_t dz         half-length of box in z-axis
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[3];
-
-    param[0] = fScale*dx;
-    param[1] = fScale*dy;
-    param[2] = fScale*dz;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"BOX ",fidmed[med],param,3);
-}
-//______________________________________________________________________
-void AliITSv11::Trapezoid1(const char gnam[3],const TString &dis,
-                          Double_t dxn,Double_t dxp,Double_t dy,Double_t dz,
-                          Int_t med){
-    // Interface to TMC->Gsvolu() for ITS TRD1 geometries. Trapezoid with the 
-    // x dimension varing along z. It has 4 parameters. See SetScale() for
-    // units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dxn        half-length along x at the z surface positioned 
-    //                        at -DZ
-    //    Double_t dxp        half-length along x at the z surface positioned 
-    //                        at +DZ
-    //    Double_t dy         half-length along the y-axis
-    //    Double_t dz         half-length along the z-axis
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[4];
-
-    param[0] = fScale*dxn;
-    param[1] = fScale*dxp;
-    param[2] = fScale*dy;
-    param[3] = fScale*dz;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"TRD1",fidmed[med],param,4);
-}
-//______________________________________________________________________
-void AliITSv11::Trapezoid2(const char gnam[3],const TString &dis,Double_t dxn,
-                          Double_t dxp,Double_t dyn,Double_t dyp,Double_t dz,
-                          Int_t med){
-    // Interface to TMC->Gsvolu() for ITS TRD2 geometries. Trapezoid with the 
-    // x and y dimension varing along z. It has 5 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dxn        half-length along x at the z surface positioned 
-    //                        at -DZ
-    //    Double_t dxp        half-length along x at the z surface positioned 
-    //                        at +DZ
-    //    Double_t dyn        half-length along x at the z surface positioned 
-    //                        at -DZ
-    //    Double_t dyp        half-length along x at the z surface positioned 
-    //                        at +DZ
-    //    Double_t dz         half-length along the z-axis
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[5];
-
-    param[0] = fScale*dxn;
-    param[1] = fScale*dxp;
-    param[2] = fScale*dyn;
-    param[3] = fScale*dyp;
-    param[4] = fScale*dz;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"TRD2",fidmed[med],param,5);
-}
-//______________________________________________________________________
-void AliITSv11::Trapezoid(const char gnam[3],const TString &dis,Double_t dz,
-                         Double_t thet,Double_t phi,Double_t h1,Double_t bl1,
-                         Double_t tl1,Double_t alp1,Double_t h2,Double_t bl2,
-                         Double_t tl2,Double_t alp2,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS TRAP geometries. General Trapezoid, 
-    // The faces perpendicular to z are trapezia and their centers are not 
-    // necessarily on a line parallel to the z axis. This shape has 11 
-    // parameters, but only cosidering that the faces should be planar, only 9 
-    // are really independent. A check is performed on the user parameters and 
-    // a message is printed in case of non-planar faces. Ignoring this warning 
-    // may cause unpredictable effects at tracking time. See SetScale() 
-    // for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dz         Half-length along the z-asix
-    //    Double_t thet       Polar angle of the line joing the center of the 
-    //                        face at -dz to the center of the one at dz 
-    //                        [degree].
-    //    Double_t phi        aximuthal angle of the line joing the center of 
-    //                        the face at -dz to the center of the one at +dz 
-    //                        [degree].
-    //    Double_t h1         half-length along y of the face at -dz.
-    //    Double_t bl1        half-length along x of the side at -h1 in y of 
-    //                        the face at -dz in z.
-    //    Double_t tl1        half-length along x of teh side at +h1 in y of 
-    //                        the face at -dz in z.
-    //    Double_t alp1       angle with respect to the y axis from the center 
-    //                        of the side at -h1 in y to the cetner of the 
-    //                        side at +h1 in y of the face at -dz in z 
-    //                        [degree].
-    //    Double_t h2         half-length along y of the face at +dz
-    //    Double_t bl2        half-length along x of the side at -h2 in y of
-    //                        the face at +dz in z.
-    //    Double_t tl2        half-length along x of the side at _h2 in y of 
-    //                        the face at +dz in z.
-    //    Double_t alp2       angle with respect to the y axis from the center 
-    //                        of the side at -h2 in y to the center of the 
-    //                        side at +h2 in y of the face at +dz in z 
-    //                        [degree].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[11];
-
-    param[0] = fScale*dz;
-    param[1] = thet;
-    param[2] = phi;
-    param[3] = fScale*h1;
-    param[4] = fScale*bl1;
-    param[5] = fScale*tl1;
-    param[6] = alp1;
-    param[7] = fScale*h2;
-    param[8] = fScale*bl2;
-    param[9] = fScale*tl2;
-    param[10] = alp2;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"TRAP",fidmed[med],param,11);
-}
-//______________________________________________________________________
-void AliITSv11::Tube(const char gnam[3],const TString &dis,Double_t rmin,
-                    Double_t rmax,Double_t dz,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS TUBE geometries. Simple Tube. It has
-    // 3 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t rmin       Inside Radius.
-    //    Double_t rmax       Outside Radius.
-    //    Double_t dz         half-length along the z-axis
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[3];
-
-    param[0] = fScale*rmin;
-    param[1] = fScale*rmax;
-    param[2] = fScale*dz;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"TUBE",fidmed[med],param,3);
-}
-//______________________________________________________________________
-void AliITSv11::TubeSegment(const char gnam[3],const TString &dis,
-                           Double_t rmin,Double_t rmax,Double_t dz,
-                           Double_t phi1,Double_t phi2,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS TUBE geometries. Phi segment of a 
-    // tube. It has 5  parameters. Phi1 should be smaller than phi2. If this is
-    // not the case, the system adds 360 degrees to phi2. See SetScale() 
-    // for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t rmin       Inside Radius.
-    //    Double_t rmax       Outside Radius.
-    //    Double_t dz         half-length along the z-axis
-    //    Double_t phi1       Starting angle of the segment [degree].
-    //    Double_t phi2       Ending angle of the segment [degree].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[5];
-
-    param[0] = fScale*rmin;
-    param[1] = fScale*rmax;
-    param[2] = fScale*dz;
-    param[3] = phi1;
-    param[4] = phi2;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"TUBS",fidmed[med],param,5);
-}
-//______________________________________________________________________
-void AliITSv11::Cone(const char gnam[3],const TString &dis,Double_t dz,
-                    Double_t rmin1,Double_t rmax1,Double_t rmin2,
-                    Double_t rmax2,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS Cone geometries. Conical tube. It 
-    // has 5 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dz         half-length along the z-axis
-    //    Double_t rmin1      Inside Radius at -dz.
-    //    Double_t rmax1      Outside Radius at -dz.
-    //    Double_t rmin2      inside radius at +dz.
-    //    Double_t rmax2      outside radius at +dz.
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[5];
-
-    param[0] = fScale*dz;
-    param[1] = fScale*rmin1;
-    param[2] = fScale*rmax1;
-    param[3] = fScale*rmin2;
-    param[4] = fScale*rmax2;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"CONS",fidmed[med],param,5);
-}
-//______________________________________________________________________
-void AliITSv11::ConeSegment(const char gnam[3],const TString &dis,Double_t dz,
-                           Double_t rmin1,Double_t rmax1,Double_t rmin2,
-                           Double_t rmax2,Double_t phi1,Double_t phi2,
-                           Int_t med){
-    // Interface to TMC->Gsvolu() for ITS ConS geometries. One segment of a 
-    // conical tube. It has 7 parameters. Phi1 should be smaller than phi2. If 
-    // this is not the case, the system adds 360 degrees to phi2. See 
-    // SetScale() for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dz         half-length along the z-axis
-    //    Double_t rmin1      Inside Radius at -dz.
-    //    Double_t rmax1      Outside Radius at -dz.
-    //    Double_t rmin2      inside radius at +dz.
-    //    Double_t rmax2      outside radius at +dz.
-    //    Double_t phi1       Starting angle of the segment [degree].
-    //    Double_t phi2       Ending angle of the segment [degree].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[7];
-
-    param[0] = fScale*dz;
-    param[1] = fScale*rmin1;
-    param[2] = fScale*rmax1;
-    param[3] = fScale*rmin2;
-    param[4] = fScale*rmax2;
-    param[5] = phi1;
-    param[6] = phi2;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"CONS",fidmed[med],param,7);
-}
-//______________________________________________________________________
-void AliITSv11::Sphere(const char gnam[3],const TString &dis,Double_t rmin,
-                      Double_t rmax,Double_t the1,Double_t the2,Double_t phi1,
-                      Double_t phi2,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS SPHE geometries. Segment of a 
-    // sphereical shell. It has 6 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t rmin       Inside Radius.
-    //    Double_t rmax       Outside Radius.
-    //    Double_t the1       staring polar angle of the shell [degree].
-    //    Double_t the2       ending polar angle of the shell [degree].
-    //    Double_t phui       staring asimuthal angle of the shell [degree].
-    //    Double_t phi2       ending asimuthal angle of the shell [degree].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[6];
-
-    param[0] = fScale*rmin;
-    param[1] = fScale*rmax;
-    param[2] = the1;
-    param[3] = the2;
-    param[4] = phi1;
-    param[5] = phi2;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"SPHE",fidmed[med],param,6);
-}
-//______________________________________________________________________
-void AliITSv11::Parallelepiped(const char gnam[3],const TString &dis,
-                              Double_t dx,Double_t dy,Double_t dz,
-                              Double_t alph,Double_t thet,Double_t phi,
-                              Int_t med){
-    // Interface to TMC->Gsvolu() for ITS PARA geometries. Parallelepiped. It 
-    // has 6 parameters. See SetScale() for units. Default units are geant 3 
-    // [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dx         half-length allong x-axis
-    //    Double_t dy         half-length allong y-axis
-    //    Double_t dz         half-length allong z-axis
-    //    Double_t alpha      angle formed by the y axis and by the plane 
-    //                        joining the center of teh faces parallel to the 
-    //                        z-x plane at -dY and +dy [degree].
-    //    Double_t thet       polar angle of the line joining the centers of 
-    //                        the faces at -dz and +dz in z [degree].
-    //    Double_t phi        azimuthal angle of teh line joing the centers of 
-    //                        the faaces at -dz and +dz in z [degree].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[6];
-
-    param[0] = fScale*dx;
-    param[1] = fScale*dy;
-    param[2] = fScale*dz;
-    param[3] = alpha;
-    param[4] = thet;
-    param[5] = phi;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"PARA",fidmed[med],param,6);
-}
-//______________________________________________________________________
-void AliITSv11::Polygon(const char gnam[3],const TString &dis,Double_t phi1,
-                       Double_t dphi,Int_t npdv,Int_t nz,Double_t *z,
-                       Double_t *rmin,Double_t *rmax,Double_t ,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS PGON geometry. Polygon It has 10 
-    // parameters or more. See SetScale() for units. Default units are geant 3 
-    // [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t phi1       the azimuthal angle at which the volume begins 
-    //                        (angles are counted clouterclockwise) [degrees].
-    //    Double_t dphi       opening angle of the volume, which extends from 
-    //                        phi1 to phi1+dphi [degree].
-    //    Int_t npdv          the number of sides of teh cross section between 
-    //                        the given phi limits.
-    //    Int_t nz            number of planes perpendicular to the z axis 
-    //                        where the dimension of the section is given - 
-    //                        this number should be at least 2 and NP triples 
-    //                        of number must follow.
-    //    Double_t *z         array [nz] of z coordiates of the sections..
-    //    Double_t *rmin      array [nz] of radius of teh circle tangent to 
-    //                        the sides of the inner polygon in teh 
-    //                        cross-section.
-    //    Double_t *rmax      array [nz] of radius of the circle tangent to 
-    //                        the sides of the outer polygon in the 
-    //                       cross-section.
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t *param;
-    Int_t n,i;
-
-    n = 4+3*nz;
-    param = new Float_t[n]
-    param[0] = phi1;
-    param[1] = dphi;
-    param[2] = (Float_t)npdv;
-    param[3] = (Float_t)nz;
-    for(i=0;i<nz;i++){
-       param[4+3*i] = z[i];
-       param[5+3*i] = rmin[i];
-       param[6+3*i] = rmax[i];
-    } // end for i
-    name[0] = 'I';
-    for(i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"PGON",fidmed[med],param,n);
-
-    delete[] param;
-}
-//______________________________________________________________________
-void AliITSv11::PolyCone(const char gnam[3],const TString &dis,Double_t phi1,
-                        Double_t dphi,Int_t nz,Double_t *z,Double_t *rmin,
-                        Double_t *rmax,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS PCON geometry. Poly-cone It has 9 
-    // parameters or more. See SetScale() for units. Default units are geant 3 
-    // [cm].
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t phi1       the azimuthal angle at which the volume begins 
-    //                        (angles are counted clouterclockwise) [degrees].
-    //    Double_t dphi       opening angle of the volume, which extends from 
-    //                        phi1 to phi1+dphi [degree].
-    //    Int_t nz            number of planes perpendicular to the z axis 
-    //                        where the dimension of the section is given - 
-    //                        this number should be at least 2 and NP triples 
-    //                        of number must follow.
-    //    Double_t *z         Array [nz] of z coordinate of the section.
-    //    Double_t *rmin      Array [nz] of radius of teh inner circle in the 
-    //                        cross-section.
-    //    Double_t *rmax      Array [nz] of radius of the outer circle in the 
-    //                        cross-section.
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t *param;
-    Int_t n,i;
-
-    n = 3+3*nz;
-    param = new Float_t[n];
-    param[0] = phi1;
-    param[1] = dphi;
-    param[2] = (Float_t) nz;
-    for(i=0;i<nz;i++){
-       param[3+3*i] = z[i];
-       param[4+3*i] = rmin[i];
-       param[5+3*i] = rmax[i];
-    } // end for i
-    name[0] = 'I';
-    for(i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"PCON",fidmed[med],param,n);
-
-    delete[] param;
-}
-//______________________________________________________________________
-void AliITSv11::TubeElliptical(const char gnam[3],const TString &dis,
-                              Double_t p1,Double_t p2,Double_t dz,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS ELTU geometries. Elliptical 
-    // cross-section Tube. It has 3 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm]. The equation of the surface 
-    // is x^2 * p1^-2 + y^2 * p2^-2 = 1.
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t p1         semi-axis of the elipse along x.
-    //    Double_t p2         semi-axis of the elipse along y.
-    //    Double_t dz         half-length along the z-axis
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[3];
-
-    param[0] = fScale*p1;
-    param[1] = fScale*p2;
-    param[2] = fScale*dz;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"ELTU",fidmed[med],param,3);
-}
-//______________________________________________________________________
-void AliITSv11::HyperbolicTube(const char gnam[3],const TString &dis,
-                              Double_t rmin,Double_t rmax,Double_t dz,
-                              Double_t thet,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS HYPE geometries. Hyperbolic tube. 
-    // Fore example the inner and outer surfaces are hyperboloids, as would be 
-    // foumed by a system of cylinderical wires which were then rotated 
-    // tangentially about their centers. It has 4 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm]. The hyperbolic surfaces are 
-    // given by r^2 = (ztan(thet)^2 + r(z=0)^2.
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t rmin       Inner radius at z=0 where tube is narrowest.
-    //    Double_t rmax       Outer radius at z=0 where tube is narrowest.
-    //    Double_t dz         half-length along the z-axis
-    //    Double_t thet       stero angel of rotation of the two faces 
-    //                       [degrees].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[4];
-
-    param[0] = fScale*rmin;
-    param[1] = fScale*rmax;
-    param[2] = fScale*dz;
-    param[3] = thet;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"HYPE",fidmed[med],param,4);
-}
-//______________________________________________________________________
-void AliITSv11::TwistedTrapezoid(const char gnam[3],const TString &dis,
-                                Double_t dz,Double_t thet,Double_t phi,
-                                Double_t twist,Double_t h1,Double_t bl1,
-                                Double_t tl1,Double_t apl1,Double_t h2,
-                                Double_t bl2,Double_t tl2,Double_t apl2,
-                                Int_t med){
-    // Interface to TMC->Gsvolu() for ITS GTRA geometries. General twisted 
-    // trapazoid. The faces perpendicular to z are trapazia and their centers 
-    // are not necessarily on a line parallel to the z axis as the TRAP. 
-    // Additionally, the faces may be twisted so that none of their edges are 
-    // parallel. It is a TRAP shape, exept that it is twisted in the x-y plane 
-    // as a function of z. The parallel sides perpendicular to the x axis are 
-    // rotated with respect to the x axis by an angle TWIST, which is one of 
-    // the parameters. The shape is defined by the eight corners and is assumed
-    // to be constructed of straight lines joingin points on the boundry of the
-    // trapezoidal face at Z=-dz to the coresponding points on the face at 
-    // z=+dz. Divisions are not allowed. It has 12 parameters. See SetScale() 
-    // for units. Default units are geant 3 [cm]. Note: This shape suffers from
-    // the same limitations than the TRAP. The tracking routines assume that 
-    // the faces are planar, but htis constraint is not easily expressed in 
-    // terms of the 12 parameters. Additionally, no check on th efaces is 
-    // performed in this case. Users should avoid to use this shape as much as 
-    // possible, and if they have to do so, they should make sure that the 
-    // faces are really planes. If this is not the case, the result of the 
-    // trasport is unpredictable. To accelerat ethe computations necessary for 
-    // trasport, 18 additioanl parameters are calculated for this shape are
-    // 1 DXODZ dx/dz of the line joing the centers of the faces at z=+_dz.
-    // 2 DYODZ dy/dz of the line joing the centers of the faces at z=+_dz.
-    // 3 XO1    x at z=0 for line joing the + on parallel side, perpendicular 
-    //          corners at z=+_dz.
-    // 4 YO1    y at z=0 for line joing the + on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 5 DXDZ1  dx/dz for line joing the + on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 6 DYDZ1  dy/dz for line joing the + on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 7 X02    x at z=0 for line joing the - on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 8 YO2    y at z=0 for line joing the - on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 9 DXDZ2  dx/dz for line joing the - on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 10 DYDZ2dy/dz for line joing the - on parallel side, + on 
-    //          perpendicular corners at z=+-dz.
-    // 11 XO3   x at z=0 for line joing the - on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 12 YO3   y at z=0 for line joing the - on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 13 DXDZ3 dx/dzfor line joing the - on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 14 DYDZ3 dydz for line joing the - on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 15 XO4   x at z=0 for line joing the + on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 16 YO4   y at z=0 for line joing the + on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 17 DXDZ4 dx/dz for line joing the + on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // 18 DYDZ4 dydz for line joing the + on parallel side, - on 
-    //          perpendicular corners at z=+-dz.
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t dz         half-length along the z axis.
-    //    Double_t thet       polar angle of the line joing the center of the 
-    //                        face at -dz to the center of the one at +dz 
-    //                        [degrees].
-    //    Double_t phi        Azymuthal angle of teh line joing the centre of 
-    //                        the face at -dz to the center of the one at +dz 
-    //                        [degrees].
-    //    Double_t twist      Twist angle of the faces parallel to the x-y 
-    //                        plane at z=+-dz around an axis parallel to z 
-    //                        passing through their centre [degrees].
-    //    Double_t h1         Half-length along y of the face at -dz.
-    //    Double_t bl1        half-length along x of the side -h1 in y of the 
-    //                        face at -dz in z.
-    //    Double_t tl1        half-length along x of the side at +h1 in y of 
-    //                        the face at -dz in z.
-    //    Double_t apl1       Angle with respect to the y ais from the center 
-    //                        of the side at -h1 in y to the centere of the 
-    //                        side at +h1 in y of the face at -dz in z 
-    //                        [degrees].
-    //    Double_t h2         half-length along the face at +dz.
-    //    Double_t bl2        half-length along x of the side at -h2 in y of 
-    //                        the face at -dz in z.
-    //    Double_t tl2        half-length along x of the side at +h2 in y of 
-    //                        the face at +dz in z.
-    //    Double_t apl2       angle with respect to the y axis from the center 
-    //                        of the side at -h2 in y to the center of the side
-    //                        at +h2 in y of the face at +dz in z [degrees].
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[12];
-
-    param[0] = fScale*dz;
-    param[1] = thet;
-    param[2] = phi;
-    param[3] = twist;
-    param[4] = fScale*h1;
-    param[5] = fScale*bl1;
-    param[6] = fScale*tl1;
-    param[7] = alp1;
-    param[8] = fScale*h2;
-    param[9] = fScale*bl2;
-    param[10] = fScale*tl2;
-    param[11] = alp2;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"GTRA",fidmed[med],param,12);
-}
-//______________________________________________________________________
-void AliITSv11::CutTube(const char gnam[3],const TString &dis,Double_t rmin,
-                       Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
-                       Double_t lx,Double_t ly,Double_t lz,Double_t hx,
-                       Double_t hy,Double_t hz,Int_t med){
-    // Interface to TMC->Gsvolu() for ITS CTUB geometries. Cut tube. A tube cut
-    // at the extremities with planes not necessarily perpendicular tot he z 
-    // axis. It has 11 parameters. See SetScale() for units. Default units are 
-    // geant 3 [cm]. phi1 should be smaller than phi2. If this is not the case,
-    // the system adds 360 degrees to phi2.
-    // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
-    //                        is appended to the front to indecate that this
-    //                        is an ITS volume.
-    //    TString &dis        String containging part discription.
-    //    Double_t rmin       Inner radius at z=0 where tube is narrowest.
-    //    Double_t rmax       Outer radius at z=0 where tube is narrowest.
-    //    Double_t dz         half-length along the z-axis
-    //    Double_t dz         half-length along the z-axis
-    //    Double_t phi1       Starting angle of the segment [degree].
-    //    Double_t phi2       Ending angle of the segment [degree].
-    //    Double_t lx         x component of a unit vector perpendicular to 
-    //                        the face at -dz.
-    //    Double_t ly         y component of a unit vector perpendicular to 
-    //                        the face at -dz.
-    //    Double_t lz         z component of a unit vector perpendicular to 
-    //                        the face at -dz.
-    //    Double_t hx         x component of a unit vector perpendicular to 
-    //                        the face at +dz.
-    //    Double_t hy         y component of a unit vector perpendicular to 
-    //                        the face at +dz.
-    //    Double_t hz         z component of a unit vector perpendicular to 
-    //                        the face at +dz.
-    //    Int_t    med        media index number.
-    // Output:
-    //    none.
-    // Return.
-    //    none.
-    char name[4];
-    Float_t param[11];
-
-    param[0] = fScale*rmin;
-    param[1] = fScale*rmax;
-    param[2] = fScale*dz;
-    param[3] = phi1;
-    param[4] = phi2;
-    param[5] = lx;
-    param[6] = ly;
-    param[7] = lz;
-    param[8] = hx;
-    param[9] = hy;
-    param[10] = hz;
-    name[0] = 'I';
-    for(Int_t i=0;i<3;i++) name[i+1] = gnam[i];
-    gMC->Gsvolu(name,"CTUB",fidmed[med],param,11);
-}
-//______________________________________________________________________
-void AliITSv11::Pos(const char vol[3],Int_t cn,const char moth[3],Double_t x,
-                   Double_t y,Double_t z,Int_t irot){
-    // Place a copy of a volume previously defined by a call to GSVOLU inside 
-    // its mother volulme moth.
+    // Standard default constructor for the ITS version 11.
     // Inputs:
-    //   const char vol[3]  3 character geant volume name. The letter "I"
-    //                      is appended to the front to indecate that this
-    //                      is an ITS volume.
-    //   const char moth[3] 3 character geant volume name of the mother volume 
-    //                      in which vol will be placed. The letter "I" is 
-    //                      appended to the front to indecate that this is an 
-    //                      ITS volume.
-    //   Double_t x         The x positon of the volume in the mother's 
-    //                      reference system
-    //   Double_t y         The y positon of the volume in the mother's 
-    //                      reference system
-    //   Double_t z         The z positon of the volume in the mother's 
-    //                      reference system
-    //   Int_t irot         the index for the rotation matrix to be used.
-    //                      irot=-1 => unit rotation.
+    //   none.
     // Outputs:
-    //    none.
-    // Return:
-    //    none.
-    char name[4],mother[4];
-    Float_t param[3];
-    Int_t r=0,i;
+    //   none.
+    // Return
+    //   A default constructed AliITSv11 class.
 
-    param[0] = x;
-    param[1] = y;
-    param[2] = z;
-    name[0] = 'I';
-    for(i=0;i<3;i++) name[i+1] = vol[i];
-    mother[0] = 'I';
-    for(i=0;i<3;i++) mother[i+1] = moth[i];
-    if(irot>=0) r=fidrot[irot];
-    fMC->Gspos(name,mother,param[0],param[1],param[2],r,"ONLY");
+    fc = 0;
 }
 //______________________________________________________________________
-void AliITSv11::Matrix(Int_t irot,Double_t thet1,Double_t phi1,
-                      Double_t thet2,Double_t phi2,
-                      Double_t thet3,Double_t phi3){
-    // Defines a Geant rotation matrix. checks to see if it is the unit
-    // matrix. If so, then no additonal matrix is defined. Stores rotation 
-    // matrix irot in the data structure JROTM. If the matrix is not 
-    // orthonormal, it will be corrected by setting y' perpendicular to x' 
-    // and z' = x' X y'. A warning message is printed in this case.
+AliITSv11::AliITSv11(const char *title) : AliITS("ITS", title){
+    // Standard constructor for the ITS version 11.
     // Inputs:
-    //   Int_t irot     Intex specifing which rotation matrix.
-    //   Double_t thet1 Polar angle for axisw x [degrees].
-    //   Double_t phi1  azimuthal angle for axis x [degrees].
-    //   Double_t thet12Polar angle for axisw y [degrees].
-    //   Double_t phi2  azimuthal angle for axis y [degrees].
-    //   Double_t thet3 Polar angle for axisw z [degrees].
-    //   Double_t phi3  azimuthal angle for axis z [degrees].
+    //   none.
     // Outputs:
-    //    none.
-    // Return:
-    //    none.
-    Float_t t1,p1,t2,p2,t3,p3;
+    //   none.
+    // Return
+    //   A Standard constructed AliITSv11 class.
 
-    if(thet1==90.0&&phi1==0.0&&thet2==90.0&&phi2==90.0&&thet3==0.0&&phi3==0.0){
-       fidrot[irot] = 0; // Unit matrix
-    }else{
-       t1 = thet1;
-       p1 = phi1;
-       t2 = thet2;
-       p2 = phi2;
-       t3 = thet3;
-       p3 = phi3
-       AliMatrix(fidrot[irot],t1,p1,t2,p2,t3,p3);
-    } // end if
+    fc = 0;
 }
 //______________________________________________________________________
-void AliITSv11::Matrix(Int_t irot,Int_t axis,Double_t thet){
-    // Defines a Geant rotation matrix. checks to see if it is the unit
-    // matrix. If so, then no additonal matrix is defined. Stores rotation 
-    // matrix irot in the data structure JROTM. If the matrix is not 
-    // orthonormal, it will be corrected by setting y' perpendicular to x' 
-    // and z' = x' X y'. A warning message is printed in this case.
+AliITSv11::~AliITSv11() {
+    // Standard destructor for the ITS version 11.
     // Inputs:
-    //   Int_t irot         Intex specifing which rotation matrix.
-    //   Int_t axis         Axis about which rotation is to be done.
-    //   Double_t thet      Angle to rotate by [degrees].
+    //   none.
     // Outputs:
-    //    none.
-    // Return:
-    //    none.
+    //   none.
+    // Return
+    //   none.
 
-    if(thet==0.0){
-       fidrot[irot] = 0; // Unit matrix
-    }else{
-       switch (irot) {
-       case 0: //Rotate about x-axis, x-axis does not change.
-           AliMatrix(fidrot[irot],90.0,0.0,90.0+thet,90.0,thet,90.0);
-           break;
-       case 1: //Rotate about y-axis, y-axis does not change.
-           AliMatrix(fidrot[irot],-90.0-thet,0.0,90.0,90.0,thet,90.0);
-           break;
-       case 2: //Rotate about z-axis, z-axis does not change.
-           AliMatrix(fidrot[irot],90.0,thet,90.0,-thet-90.0,0.0,0.0);
-           break;
-       default:
-           Error("Matrix","axis must be either 0, 1, or 2. for matrix=%d",
-                 irot);
-           break;
-       } // end switch
-    } // end if
+    if(fc!=0) delete fc;
 }
 //______________________________________________________________________
-void AliITSv11::Matrix(Int_t irot,Double_t rot[3][3]){
-    // Defines a Geant rotation matrix. checks to see if it is the unit
-    // matrix. If so, then no additonal matrix is defined. Stores rotation 
-    // matrix irot in the data structure JROTM. If the matrix is not 
-    // orthonormal, it will be corrected by setting y' perpendicular to x' 
-    // and z' = x' X y'. A warning message is printed in this case.
+void AliITSv11::BuildGeometry(){
+    // This routine defines and Creates the geometry for version 11 of the ITS
+    // for use in the simulation display routines. This is a very simplified
+    // geometry for speed of viewing.
     // Inputs:
-    //   Int_t irot         Intex specifing which rotation matrix.
-    //   Double_t rot[3][3] The 3 by 3 rotation matrix.
+    //   none.
     // Outputs:
-    //    none.
-    // Return:
-    //    none.
-
-    if(rot[0][0]==1.0&&rot[1][1]==1.0&&rot[2][2]==1.0&&
-       rot[0][1]==0.0&&rot[0][2]==0.0&&rot[1][0]==0.0&&
-       rot[1][2]==0.0&&rot[2][0]==0.0&&rot[2][1]==0.0){
-       fidrot[irot] = 0; // Unit matrix
-    }else{
-       Double_t si,c=180./TMath::Pi();
-       Double_t ang[6];
-
-       ang[1] = TMath::ATan2(rot[0][1],rot[0][0]);
-       if(TMath::Cos(ang[1])!=0.0) si = rot[0][0]/TMath::Cos(ang[1]);
-       else si = rot[0][1]/TMath::Sin(ang[1]);
-       ang[0] = TMath::ATan2(si,rot[0][2]);
-
-       ang[3] = TMath::ATan2(rot[1][1],rot[1][0]);
-       if(TMath::Cos(ang[3])!=0.0) si = rot[1][0]/TMath::Cos(ang[3]);
-       else si = rot[1][1]/TMath::Sin(ang[3]);
-       ang[2] = TMath::ATan2(si,rot[1][2]);
+    //   none.
+    // Return
+    //   none.
 
-       ang[5] = TMath::ATan2(rot[2][1],rot[2][0]);
-       if(TMath::Cos(ang[5])!=0.0) si = rot[2][0]/TMath::Cos(ang[5]);
-       else si = rot[2][1]/TMath::Sin(ang[5]);
-       ang[4] = TMath::ATan2(si,rot[2][2]);
+    if(fc==0) fc = new AliITSGeometrySSDCone(new TVector3(0.0,0.0,0.0),"TSV",0);
 
-       for(Int_t i=0;i<6;i++) {ang[i] *= c; if(ang[i]<0.0) ang[i] += 360.;}
-       AliMatrix(fidrot[irot],ang[0],ang[1],ang[2],ang[3],ang[4],ang[5]);
-    } // end if
+    fc->BuildDisplayGeometry();
 }
 //______________________________________________________________________
-Float_t AliITSv11::GetA(Int_t z){
-    // Returns the isotopicaly averaged atomic number.
-    // Inputs:
-    //    Int_t z  Elemental number
-    // Outputs:
-    //    none.
-    // Return:
-    //    The atomic mass number.
-    const Float_t A[]={ 1.00794 ,  4.0026902,  6.941   ,  9.012182 , 10.811   ,
-                       12.01007 , 14.00674  , 15.9994  , 18.9984032, 20.1797  ,
-                       22.98970 , 24.3050   , 26.981538, 28.0855   , 30.973761,
-                       32.066   , 35.4527   , 39.948   , 39.0983   , 40.078   ,
-                       44.95591 , 47.867    , 50.9415  , 51.9961   , 54.938049,
-                       55.845   , 58.933200 , 58.6934  , 63.546    , 65.39    ,
-                       69.723   , 72.61     , 74.92160 , 78.96     , 79.904   ,
-                       83.80    , 85.4678   , 87.62    , 88.9085   , 91.224   ,
-                       92.90638 , 95.94     , 97.907215, 101.07    ,102.90550 ,
-                      106.42    ,107.8682   ,112.411   ,114.818    ,118.710   ,
-                      121.760   ,127.60     ,126.90447 ,131.29     ,132.90545 ,
-                      137.327   ,138.9055   ,140.116   ,140.90765  ,144.24    ,
-                      144.912746,150.36     ,151.964   ,157.25     ,158.92534 ,
-                      162.50     ,164.93032 ,167.26    ,168.93421  ,173.04    ,
-                      174.967    ,178.49    ,180.9479 ,183.84      ,186.207   ,
-                      190.23     ,192.217   ,195.078  ,196.96655   ,200.59    ,
-                      204.3833   ,207.2     ,208.98038,208.982415  ,209.987131,
-                      222.017570 ,223.019731,226.025402,227.027747 ,232.0381  ,
-                      231.03588  238.0289};
-
-    if(z<1||z>92){
-       Error("GetA","z must be 0<z<93. z=%d",z);
-       return 0.0;
-    } // end if
-    return A[z-1];
-}
-//______________________________________________________________________
-Float_t AliITSv11::GetStandardMaxStepSize(Int_t istd){
-    // Returns one of a set of standard Maximum Step Size values.
-    // Inputs:
-    //   Int_t istd  Index to indecate which standard.
-    // Outputs:
-    //    none.
-    // Return:
-    //    The appropreate standard Maximum Step Size value [cm].
-    Float_t t[]={1.0, // default
-                0.0075, // Silicon detectors...
-                1.0, // Air in central detectors region
-                1.0  // Material in non-centeral region
-    };
-    return t[istd];
-}
-//______________________________________________________________________
-Float_t AliITSv11::GetStandardThetaMax(Int_t istd){
-    // Returns one of a set of standard Theata Max values.
-    // Inputs:
-    //   Int_t istd  Index to indecate which standard.
-    // Outputs:
-    //    none.
-    // Return:
-    //    The appropreate standard Theta max value [degrees].
-    Float_t t[]={0.1, // default
-                0.1, // Silicon detectors...
-                0.1, // Air in central detectors region
-                1.0  // Material in non-centeral region
-    };
-    return t[istd];
-}
-//______________________________________________________________________
-Float_t AliITSv11::GetStandardEfraction(Int_t istd){
-    // Returns one of a set of standard E fraction values.
+void AliITSv11::CreateGeometry(){
+    // This routine defines and Creates the geometry for version 11 of the ITS.
     // Inputs:
-    //   Int_t istd  Index to indecate which standard.
+    //   none.
     // Outputs:
-    //    none.
-    // Return:
-    //    The appropreate standard E fraction value [#].
-    Float_t t[]={0.1, // default
-                0.1, // Silicon detectors...
-                0.1, // Air in central detectors region
-                1.0  // Material in non-centeral region
-    };
-    return t[istd];
-}
-//______________________________________________________________________
-void AliITSv11::Element(Int_t imat,const char* name,Int_t z,Double_t dens,
-                       Int_t istd){
-    // Defines a Geant single element material and sets its Geant medium
-    // proporties. The average atomic A is assumed to be given by their
-    // natural abundances. Things like the radiation length are calculated
-    // for you.
-    // Inputs:
-    //    Int_t imat       Material number.
-    //    const char* name Material name. No need to add a $ at the end.
-    //    Int_t z          The elemental number.
-    //    Double_t dens    The density of the material [g/cm^3].
-    //    Int_t istd       Defines which standard set of transport parameters
-    //                     which should be used.
-    // Output:
-    //     none.
-    // Return:
-    //     none.
-    Float_t rad,Z,A=GetA(z),tmax,stemax,deemax,epsilon;
-    char *name2;
-    Int_t len;
-
-    len = strlng(name)+1;
-    name2 = new char[len];
-    strncpy(name2,name,len-1);
-    name2[len-1] = '\0';
-    name2[len-2] = '$';
-    Z = (Float_t)z;
-    rad = GetRadLength(z)/dens;
-    AliMaterial(imat,name2,A,Z,dens,rad,0.0,0,0);
-    tmax    = GetStandardTheataMax(istd);    // degree
-    stemax  = GetStandardMaxStepSize(istd);  // cm
-    deemax  = GetStandardEfraction(istd);     // #
-    epsilon = GetStandardEpsilon(istd);
-    AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
-             gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
-    delete[] name2;
-}
-//______________________________________________________________________
-void AliITSv11::MixtureByWeight(Int_t imat,const char* name,Int_t *z,
-                               Double_t *w,Double_t dens,Int_t n,Int_t istd){
-    // Defines a Geant material by a set of elements and weights, and sets 
-    // its Geant medium proporties. The average atomic A is assumed to be 
-    // given by their natural abundances. Things like the radiation length 
-    // are calculated for you.
-    // Inputs:
-    //    Int_t imat       Material number.
-    //    const char* name Material name. No need to add a $ at the end.
-    //    Int_t *z         Array of The elemental numbers.
-    //    Double_t *w      Array of relative weights.
-    //    Double_t dens    The density of the material [g/cm^3].
-    //    Int_t n          the number of elements making up the mixture.
-    //    Int_t istd       Defines which standard set of transport parameters
-    //                     which should be used.   
-    // Output:
-    //     none.
-    // Return:
-    //     none.
-    Float_t rad,*Z,*A,tmax,stemax,deemax,epsilon;
-    char *name2;
-    Int_t len,i;
-    Z = new Float_t[n];
-    A = new Float_t[n];
+    //   none.
+    // Return
+    //   none.
 
-    len = strlng(name)+1;
-    name2 = new char[len];
-    strncpy(name2,name,len-1);
-    name2[len-1] = '\0';
-    name2[len-2] = '$';
-    for(i=0;i<n;i++){Z[i] = (Float_t)z[i];A[i] = (Float_t)GetA(z[i]);
-                     W[i] = (Float_t)w[i]}
-    rad = GetRadLength(z)/dens;
-    AliMixture(imat,name2,A,Z,dens,n,W);
-    tmax    = GetStandardTheataMax(istd);    // degree
-    stemax  = GetStandardMaxStepSize(istd);  // cm
-    deemax  = GetStandardEfraction(istd);     // #
-    epsilon = GetStandardEpsilon(istd);
-    AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
-             gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
-    delete[] name2;
+    if(fc==0) fc = new AliITSGeometrySSDCone(new TVector3(0.0,0.0,0.0),"TSV",0);
+    TVector3 t(0.0,0.0,0.0);
+    fc->CreateG3Geometry(t,"ITSV",0);
 }
 //______________________________________________________________________
-void AliITSv11::MixtureByNumber(Int_t imat,const char* name,Int_t *z,
-                               Int_t *w,Double_t dens,Int_t n,Int_t istd){
-    // Defines a Geant material by a set of elements and number, and sets 
-    // its Geant medium proporties. The average atomic A is assumed to be 
-    // given by their natural abundances. Things like the radiation length 
-    // are calculated for you.
-    // Inputs:
-    //    Int_t imat       Material number.
-    //    const char* name Material name. No need to add a $ at the end.
-    //    Int_t *z         Array of The elemental numbers.
-    //    Int_t_t *w       Array of relative number.
-    //    Double_t dens    The density of the material [g/cm^3].
-    //    Int_t n          the number of elements making up the mixture.
-    //    Int_t istd       Defines which standard set of transport parameters
-    //                     which should be used.   
-    // Output:
-    //     none.
-    // Return:
-    //     none.
-    Float_t rad,*Z,*A,tmax,stemax,deemax,epsilon;
-    char *name2;
-    Int_t len,i;
-    Z = new Float_t[n];
-    A = new Float_t[n];
-
-    len = strlng(name)+1;
-    name2 = new char[len];
-    strncpy(name2,name,len-1);
-    name2[len-1] = '\0';
-    name2[len-2] = '$';
-    for(i=0;i<n;i++){Z[i] = (Float_t)z[i];A[i] = (Float_t)GetA(z[i]);
-                     W[i] = (Float_t)w[i]}
-    rad = GetRadLength(z)/dens;
-    AliMixture(imat,name2,A,Z,dens,-n,W);
-    tmax    = GetStandardTheataMax(istd);    // degree
-    stemax  = GetStandardMaxStepSize(istd);  // cm
-    deemax  = GetStandardEfraction(istd);     // #
-    epsilon = GetStandardEpsilon(istd);
-    AliMedium(imat,name2,imat,0,gAlice->Field()->Integ(),
-             gAlice->Field()->Max(),tmax,stemax,deemax,epsilon,0.0);
-    delete[] name2;
-//______________________________________________________________________
-void AliITSv11::SSDConeDetail(TVector3 &tran,const char moth[3],Int_t mat0){
-    // Defines the volumes and materials for the ITS SSD Support cone.
-    // Based on drawings ALR-0767 and ALR-0767/3. Units are in mm.
+void AliITSv11::CreateMaterials(){
+    // Create ITS materials
+    //     This function defines the default materials used in the Geant
+    // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
+    // AliITSv11.
+    // In general it is automatically replaced by
+    // the CreatMaterials routine defined in AliITSv?. Should the function
+    // CreateMaterials not exist for the geometry version you are using this
+    // one is used. See the definition found in AliITSv5 or the other routine
+    // for a complete definition.
     // Inputs:
-    //   Double_t zShift  The z shift to be applied to the final volume.
+    //   none.
     // Outputs:
     //   none.
-    // Return:
+    // Return
     //   none.
-    Double_t th = 13.0; //mm, Thickness of Rohacell+carbon fiber
-    Double_t ct=1.5; //mm, Carbon finber thickness
-    Double_t r=15.0; // mm, Radius of curvature.
-    Double_t tc=51.0; // angle of SSD cone [degrees].
-    Double_t sintc=Sind(tc),costc=Cosd(tc),tantc=Tand(tc);
-    Double_t z0=0.0,zcylinder=170.0,zpost=196.0;
-    Double_t Routmax=0.5*985.0,RoutHole=0.5*965.0,Routmin=0.5*945.0;
-    Double_t Rholemax=0.5*890.0,Rholemin=0.5*740.0;
-    Double_t RPostmin=316.0,dRPost=23.0,zpostmax=196.0,phi0post=30.0;
-    Double_t Rinmax=0.5*590.0,Rincylinder=0.5*597.0,RinHole=0.5*575.0,
-            Rinmin=0.5*562.0,dzin=15.0;
-    Int_t nspoaks=12,ninscrews=40,npost=4,nmounts=4;
-    Int_t SSDcf=man0+1; // SSD support cone Carbon Fiber materal number.
-    Int_t SSDfs=mat0+2; // SSD support cone inserto stesalite 4411w.
-    Int_t SSDfo=mat0+3; // SSD support cone foam, Rohacell 50A.
-    Int_t SSDsw=mat0+4; // SSD support cone screw material,Stainless steal
-    Int_t ncse=0; // number of screw ends (copy number)
-    Int_t ncpe=0; // number of pin end (copy number)
-    Int_t ncst=0; // number of screw tops (copy number)
-    Double_t t; // some general angle [degrees].
-    Double_t phi0=0.0,dphi=360.0,x,y,z;
-    Int_t i,j,k,l,n,nz,nrad=0;
 
-    SetScalemm();
-    // Lets start with the upper left outer carbon fiber surface.
-    // Between za[2],rmaxa[2] and za[4],rmaxa[4] there is a curved section
-    // given by rmaxa = rmaxa[2]-r*Sind(t) for 0<=t<=tc and 
-    // za = za[2] + r*Cosd(t) for 0<=t<=tc. Simularly between za[1],rmina[1
-    // and za[3],rmina[3] there is a curve section given by
-    // rmina = rmina[1]-r*Sind(t) for 0<=t<=tc and za = za[1]+r&Sind(t)
-    // for t<=0<=tc. These curves have been replaced by straight lines
-    // between the equivelent points for simplicity.
-    Double_t dza = th/sintc-(Routmax-Routmin)/tantc;
-    if(dza<=0){ // The number or order of the points are in error for a proper
-       // call to pcons!
-       Error("SSDcone","The definition of the points for a call to PCONS is"
-             " in error. abort.");
-       return;
-    } // end if
-    nz = 7;
-    Double_t *za    = new Double_t[nz];
-    Double_t *rmina = new Double_t[nz];
-    Double_t *rmaxa = new Double_t[nz];
-    za[0]    = z0;
-    rmina[0] = Routmin;
-    rmaxa[0] = Routmax;
-    za[1]    = za[0]+13.5-5.0 - dza; // za[2] - dza.
-    rmina[1] = rmina[0];
-    rmaxa[1] =rmaxa[0];
-    za[2]    = za[0]+13.5-5.0; // From Drawing ALR-0767 and ALR-0767/3
-    rmaxa[2] = rmaxa[0];
-    za[3]    = za[1]+rc*sintc;
-    rmina[3] = rmina[1]-rc*sintc;
-    rmina[2] = rmina[1]+(rmina[3]-rmina[1])*(za[2]-za[1])/(za[3]-za[1]);
-    za[4]    = za[2]+rc*sintc;
-    rmaxa[4] = rmaxa[2]-rc*sintc;
-    rmaxa[3] = rmaxa[2]+(rmaxa[4]-rmaxa[2])*(za[3]-za[2])/(za[4]-za[2]);
-    rmina[5] = Rholemax;
-    za[5]    = za[3]+(za[4]-za[3])*(rmina[5]-rmina[3])/(rmina[4]-rmina[3]);
-    rmina[4] = rmina[3]+(rmina[5]-rmina[3])*(za[4]-za[3])/(za[5]-za[3]);
-    za[6]    = th/sinth+za[5];
-    rmina[6] = Rholemax;
-    rmaxa[6] = rmina[6];
-    rmaxa[5] = rmaxa[4]+(rmaxa[6]-rmaxa[4])*(za[5]-za[4])/(za[6]-za[4]);
-    //
-    PolyCone("SCA","SSD Suport cone Carbon Fiber Surface outer left",
-            phi0,dphi,nz,*z,*rmin,*rmax,SSDcf);
-    Pos("SCA",1,moth,trans.x(),trans.y(),trans.z(),0);
-    XMatrix(1,180.0);
-    Pos("SCA",2,moth,trans.x(),trans.y(),-trans.z(),1);
-    Za[0] = 1.; Wa[0] = ; // Hydrogen Content
-    Za[1] = 6.; Wa[1] = ; // Carbon Content
-    MixtureByWeight(SSDcf,"Carbon Fiber for SSD support cone",Z,W,dens,2);
-    //
-    // Now lets define the Inserto Stesalite 4411w material volume.
-    nz = 6;
-    Double_t *zb    = new Double_t[nz];
-    Double_t *rminb = new Double_t[nz];
-    Double_t *rmaxb = new Double_t[nz];
-    zb[0] = z0;
-    rminb[0] = rmina[0]+ct;
-    rmaxb[0] = rmaxa[0]-ct;
-    zb[1] = za[1];
-    rminb[1] = rminb[0];
-    rmaxb[1] = rmaxb[0];
-    zb[2] = za[2];
-    rmaxb[2] = rmaxb[1];
-    zb[3] = za[4] - ct/sintc;
-    rmaxb[3] = rmaxb[2] - (rc-ct)*sintc;
-    zb[4] = za[3]+ct/sintc;
-    rminb[4] = rminb[1]-(rc-ct)*sintc;
-    rminb[2] = rminb[1]+(rminb[4]-rminb[1])*(zb[2]-zb[1])/(zb[4]-zb[1]);
-    rminb[3] = rminb[1]+(rminb[4]-rminb[1])*(zb[3]-zb[1])/(zb[4]-zb[1]);
-    zb[5] = zb[4]+(ct-2.*ct)/sintc;
-    rminb[5] = rminb[4]+(ct-2.*ct)*tantc;
-    rmaxb[5] = rminb[5];
-    rmaxb[4] = rmaxb[3]+(rmaxb[5]-rmaxb[3])*(zb[4]-zb[3])/(zb[5]-zb[3]);
-    PolyCone("SCB","SSD Suport cone Inserto Stesalite left edge",
-            phi0,dphi,nz,*zb,*rminb,*rmaxb,SSDfs);
-    Pos("SCB",1,"SCA",0.0,.0,0.0,0);
-    Za[0] = 1.; Wa[0] = ; // Hydrogen Content
-    Za[1] = 6.; Wa[1] = ; // Carbon Content
-    MixtureByWeight(SSDfs,"Inserto stealite 4411w for SSD support cone",
-                   Z,W,dens,3);
-    //
-    // Now lets define the Rohacell foam material volume.
-    nz = 4;
-    Double_t *zc    = new Double_t[nz];
-    Double_t *rminc = new Double_t[nz];
-    Double_t *rmaxc = new Double_t[nz];
-    zc[0] = zb[4];
-    rminc[0] = rminb[4];
-    rmaxc[0] = rmminc[0];
-    zc[1] = zb[5];
-    rmaxc[1] = rminb[5];
-    zc[2] = za[5] + ct/sintc;
-    rminc[2] = rmina[5]+ct; // leave space for carbon fiber covering hole.
-    rminc[1] = rminc[0] +(rminc[2]-rminc[0])*(zc[1]-zc[0])/(zc[2]-zc[0]);
-    zc[3] = za[6] - ct/sintc;
-    rminc[3] = rmina[6]+ct;
-    rmaxc[3] = rminc[3];
-    rmaxc[2] = rmaxc[1]+(rmaxc[3]-rmaxc[1])*(zc[2]-zc[1])/(zc[3]-zc[1]);
-    PolyCone("SCC","SSD Suport cone Rohacell foam left edge",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfo);
-    Pos("SCC",1,"SCA",0.0,.0,0.0,0);
-    Za[0] = 1.; Wa[0] = ; // Hydrogen Content
-    Za[1] = 6.; Wa[1] = ; // Carbon Content
-    MixtureByWeight(SSDfo,"Foam core (Rohacell 50A) for SSD support cone",
-                   Z,W,dens,3);
-    //
-    // In volume SCB, th Inserto Stesalite 4411w material volume, there
-    // are a number of Stainless steel screw and pin studs which will be
-    // filled with screws/studs.
-    Double_t rmin=0.0,rmax=6.0,dz=0.5*10.0; // mm
-    Tube("SCD","Screw+stud used to mount things to the SSD support cone",
-        rmin,rmax,dz,SSDsw);
-    rmin=0.0;rmax=6.0;dz=0.5*12.0; // mm
-    Tube("SCE","pin used to mount things to the SSD support cone",
-        rmin,rmax,dz,SSDsw);
-    Za[0] =  6.; Wa[0] = ; // Carbon Content
-    Za[1] = 25.; Wa[1] = ; // Iron Content
-    MixtureByWeight(SSDsw,"Stainless steal screw, pin, and stud material",
-                   Z,W,dens,3);
-    k=l=0;
-    for(i=0;i<2;i++){ // position for ITS-TPC mounting brackets
-       for(j=0;j<2;j++){ // 2 screws per bracket
-           ncse++;
-           t = -5.0+10.0*((Double_t)j)+180.*((Double_t)i);
-           x = RoutHole*Sind(t);
-           y = RoutHole*Cosd(t);
-           z = dz;
-           Pos("SCD",ncse,"SCB",x,y,z,0);
-       } // end for j
-       for(j=0;j<3;j++){ // 3 pins per bracket
-           ncpe++;
-           t = -3.0+3.0*((Double_t)j)+180.*((Double_t)i);
-           x = RoutHole*Sind(t);
-           y = RoutHole*Cosd(t);
-           z = dz;
-           Pos("SCE",ncpe,"SCB",x,y,z,0);
-       } // end for j
-    } // end for i
-    for(i=0;i<2;i++){ // position for ITS-rail mounting brackets
-       for(j=0;j<4;j++){ // 4 screws per bracket
-           Double_t a[4]={0.0,2.0,5.0,7.0}; // Relative angles.
-           ncse++;
-           t = 90.0-a[j]+187.*((Double_t)i);
-           x = RoutHole*Sind(t);
-           y = RoutHole*Cosd(t);
-           z = dz;
-           Pos("SCD",kncs,"SCB",x,y,z,0);
-       } // end for j
-       for(j=0;j<2;j++){ // 2 pins per bracket
-           ncpe++;
-           t = 88+7.0*((Double_t)j)+184.*((Double_t)i);
-           x = RoutHole*Sind(t);
-           y = RoutHole*Cosd(t);
-           z = dz;
-           Pos("SCE",ncse,"SCB",x,y,z,0);
-       } // end for j
-    } // end for i
-    for(i=0;i<nmounts;i++){ // mounting holes/screws for beam pipe support
-       // and SPD cone support (dump side,non-dump side has them to).
-       for(j=0;j<2;j++){ // 2 screws per bracket
-           ncse++;
-           t = 180.*20./(RoutHole*TMath::Pi());
-           t = 45.0+((Doulbe_t)(j-1))*t+90.*((Double_t)i);
-           x = RoutHole*Sind(t);
-           y = RoutHole*Cosd(t);
-           z = dz;
-           Pos("SCD",ncse,"SCB",x,y,z,0);
-       } // end for j
-       for(j=0;j<1;j++){ // 1 pins per bracket
-           ncpe++;
-           t = 45.0+90.*((Double_t)i);
-           x = RoutHole*Sind(t);
-           y = RoutHole*Cosd(t);
-           z = dz;
-           Pos("SCE",ncpe,"SCB",x,y,z,0);
-       } // end for j
-    } // end for i
-    //
-    // There is no carbon fiber between this upper left section and the
-    // SSD spoaks. We remove it by replacing it with Rohacell foam.
-    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
-    // carbon fiber thickness uniform in this phi direction. We can only
-    // make it a fixed angular thickness.
-    t *= 180.0/TMath::Pi();
-    dphi = 5.0 - 2.0*t; // degrees
-    phi0 = 12.5+t; // degrees see drawing ALR-0767.
-    nz = 4;
-    Double_t *zf    = new Double_t[nz];
-    Double_t *rminf = new Double_t[nz];
-    Double_t *rmaxf = new Double_t[nz];
-    zf[0] = zc[2];
-    rminf[0] = rminc[3];
-    rmaxf[0] = rminf[0];
-    rminf[1] = rmina[5];
-    rmaxf[1] = rminf[0];
-    zf[1] = zc[0]+(zc[2]-zc[0])*(rminf[1]-rminc[0])/(rminc[2]-rminc[0]);
-    zf[2] = zc[3];
-    rminf[2] = rminf[1];
-    rmaxf[2] = rmaxf[1];
-    zf[3] = zc[1]+(zc[3]-zc[1])*(rmaxf[3]-rmaxc[1])/(rmaxc[3]-rmaxc[1]);
-    rminf[3] = rmina[5];
-    rmaxf[3] = rminf[3];
-    PolyCone("SCF","SSD Suport cone Rohacell foam left edge",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfo);
-    Pos("SCF",1,"SCA",0.0,.0,0.0,0);
-    for(i=1;i<nspoaks;i++){
-       Zmatrix(irot+i,360./((Double_t)nspoaks));
-       Pos("SCG",i+1,"SCA",0.0,.0,0.0,irot+i);
-    } // end for i
-    //=================================================================
-    // Now for the spoak part of the SSD cone.
-    // It is not posible to inclue the radius of curvature between
-    // the spoak part and the upper left part of the SSD cone or lowwer right
-    // part. This would be discribed by the following curves.
-    // R = Rmax - (5mm)*Sin(t) phi = phi0+(5mm*180/(Pi*RoutHole))*Sin(t) 
-    // where 0<=t<=90 For the inner curve a simular equiation holds.
-    phi0 = 12.5; // degrees see drawing ALR-0767.
-    dphi = 5.0; // degrees
-    nz = 4;
-    Double_t *zg    = new Double_t[nz];
-    Double_t *rming = new Double_t[nz];
-    Double_t *rmaxg = new Double_t[nz];
-    zg[0] = zb[5];
-    rming[0] = rmina[5];
-    rmaxg[0] = rming[0];
-    zg[1] = za[6];
-    rming[1] = -thatc*(zg[1]-za[3])+rmina[3];
-    rmaxg[1] = rmaxg[0];
-    rming[2] = Rholemin;
-    zg[2] = za[3]-(rming[2]-rmina[3])/tantc;
-    rmaxg[2] = -thatc*(zg[2]-za[4])+rmaxa[4];
-    rming[3] = rming[2];
-    rmaxg[3] = rming[3];
-    zg[3] = za[4]-(rmaxg[3]-rmaxa[4])/tantc;
-    PolyCone("SCG","SSD spoak carbon fiber surfaces",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDcf);
-    Pos("SCG",i+1,"SCA",0.0,.0,0.0,0);
-    for(i=1;i<nspoaks;i++){
-       Pos("SCG",i+1,"SCA",0.0,.0,0.0,irot+i);
-    } // end for i
-    // For the foam core.
-    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
-    // carbon fiber thickness uniform in this phi direction. We can only
-    // make it a fixed angular thickness.
-    t *= 180.0/TMath::Pi();
-    dphi = 5.0 - 2.0*t; // degrees
-    phi0 = 12.5+t; // degrees see drawing ALR-0767.
-    nz = 4;
-    Double_t *zh    = new Double_t[nz];
-    Double_t *rminh = new Double_t[nz];
-    Double_t *rmaxh = new Double_t[nz];
-    zh[0] = zf[2];
-    rminh[0] = rming[0];
-    rmaxh[0] = rmaxg[0];
-    zh[1] = zf[3];
-    rminh[1] = rming[1]-(ct/sintc-(zg[1]-zh[1]))*tantc;
-    rmaxh[1] = rmaxh[0];
-    zh[2] = zg[2]+ct/tanth;
-    rminh[2] = rming[2];
-    rmaxh[2] = rmaxg[2]-(ct/sintc-(zg[2]-zh[2]))*tantc;
-    zh[3] = zg[3]-ct/sintc;
-    rminh[3] = rminh[2];
-    rmaxh[3] = rminh[3];
-    PolyCone("SCH","SSD spoak foam core",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfo);
-    Pos("SCH",1,"SCG",0.0,.0,0.0,0);
-    //
-    //==================================================================
-    // Now for the Inner most part of the SSD cone.
-    phi0 = 0.0;
-    dphi = 360.0;
-    nz = 8;
-    Double_t *zi = new Double_t[nz];
-    Double_t *rmini = new Double_t[nz];
-    Double_t *rmaxi = new Double_t[nz];
-    Double_t za,rmina,rmaxa; // additional point not needed in call to pcons.
-    zi[0] = zg[2];
-    rmini[0] = rming[2];
-    rmaxi[0] = rmini[0];
-    zi[1] = zg[3];
-    rmini[1] = -tantc*(zi[1]-za[3])+rmina[3];
-    rmaxi[1] = rmaxi[0];
-    rmini[5] = Rinmin;
-    rmaxi[5] = Rinmax+rc*sintc;
-    zi[5] =za[4]+(rmaxa[4]-rmaxi[5])/tantc;
-    zia = zi[5]+rc*costc;
-    rminia = rmini[5];
-    rmaxia = Rinmax;
-    zi[3] = zia-dzin;
-    zi[2] = zi[3] -rc*costc;
-    rmini[2] = -tantc*(zi[2]-za[3])+rmina[3];
-    rmaxi[2] = -tantc*(zi[2]-za[4])+rmaxa[4];
-    rmini[3] = rmini[2] -rc*costc;
-    zi[4] = zi[3];
-    rmini[4] = Rinmin;
-    rmaxi[4] = -tantc*(zi[4]-za[4])+rmaxa[4];
-    rmaxi[3] = rmaxi[4];
-    zi[6] = zcylinder;
-    rmini[6] = Rinmin;
-    rmaxi[6] = rmaxi[5] - (zi[5]-zi[6])*(rmaxi[5]-rmaxa)/(zi[5]-zia);
-    zi[7] = zi[6];
-    rmini[7] = Rincylinder;
-    rmaxi[7] = rmaxi[6];
-    rmini[8] = Rincylinder;
-    rmaxi[8] = Rini[8];
-    zi[8] = zi[5]+(rmaxi[8]-rmaxi[5])*(zia-zi[5])/(rmaxa-rmaxi[5]);
-    PolyCone("SCI","SSD lower/inner right part of SSD cone",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDcf);
-    Pos("SCI",1,mother,0.0,.0,0.0,0);
-    // Now for Inserto volume at the inner most radius.
-    phi0 = 0.0;
-    dphi = 360.0;
-    nz = 7;
-    Double_t *zk = new Double_t[nz];
-    Double_t *rmink = new Double_t[nz];
-    Double_t *rmaxk = new Double_t[nz];
-    zk[1] = zi[3]+ct;
-    zk[0] = zk[1]-(rc+ct)*costc;
-    rmink[0] = rmini[3]+(rc+ct)*sintc;
-    rmaxk[0] = rmink[0];
-    rmink[1] = rmini[3];
-    zk[2] = zk[1];
-    rmink[2] = rmini[6];
-    rmaxk[2] = rmaxk[1];
-    zk[3] = zk[0]+(th+2.0*ct)*costc;
-    rmink[3] = rmini[6];
-    rmaxk[3] = rmaxk[0]+(th+2.0*ct)*sintc;
-    rmaxk[1] = rmaxk[0]+(rmaxk[3]-rmaxk[0])*(zk[1]-zk[0])/(zk[3]-zk[0]);
-    rmink[4] = rmini[6];
-    rmaxk[4] = rmaxi[5]-ct*sintc;
-    zk[4] = zc[1]+(zc3[3]-zc[1])*(rmaxk[4]-rmaxc[1])/(rmaxc[3]-rmaxc[1]);
-    zk[5] = zi[5]-rc*costc-ct;
-    rmink[5] = rmini[6];
-    rmaxk[5] = rmini[8];
-    zk[6] = zi[6];
-    rmink[6] = rmini[6];
-    rmaxk[6] = rmaxi[6];
-    PolyCone("SCK","SSD inner most inserto material",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfs);
-    Pos("SCK",1,"SCI",0.0,.0,0.0,0);
-    // Now for foam core at the inner most radius.
-    phi0 = 0.0;
-    dphi = 360.0;
-    nz = 4;
-    Double_t *zj = new Double_t[nz];
-    Double_t *rminj = new Double_t[nz];
-    Double_t *rmaxj = new Double_t[nz];
-    rminj[0] = rmini[0]-ct;
-    zj[0] = zc[0]+(zc[2]-zc[0])*(rminj[0]-rminc[0])/(rminc[2]-rminc[0]);
-    rmaxj[0] = rminj[0];
-    rmaxj[1] = rmaxj[0];
-    zj[1] = zc[1]+(zc[3]-zc[1])*(rmaxj[1]-rmaxc[1])/(rmaxc[3]-rmaxc[1]);
-    rminj[1] = rminc[0]+(rminc[2]-rminc[0])*(zj[1]-zc[0])/(zc[2]-zc[0]);
-    zj[2] = zk[0];
-    rminj[2] = rkmin[0];
-    rmaxj[2] = rmaxc[1]+(rmaxc[3]-rmaxc[1])*(zj[2]-zc[1])/(zc[3]-zc[1]);
-    zj[3] = zk[3];
-    rminj[3] = rmaxk[3];
-    rmaxj[3] = rminj[3];
-    PolyCone("SCJ","SSD inner most foam core",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfo);
-    Pos("SCJ",1,"SCI",0.0,.0,0.0,0);
-    // Now for foam core at the top of the inner most radius where 
-    // the spoaks are.
-    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
-    // carbon fiber thickness uniform in this phi direction. We can only
-    // make it a fixed angular thickness.
-    t *= 180.0/TMath::Pi();
-    dphi = 5.0 - 2.0*t; // degrees
-    phi0 = 12.5+t; // degrees see drawing ALR-0767.
-    nz = 4;
-    Double_t *zl = new Double_t[nz];
-    Double_t *rminl = new Double_t[nz];
-    Double_t *rmaxl = new Double_t[nz];
-    zl[0] = zh[2];
-    rminl[0] = rmini[0];
-    rmaxl[0] = rminl[0];
-    zl[1] = zj[0];
-    rminl[1] = rminj[1];
-    rmaxl[1] = rmaxi[0];
-    zl[2] = zh[3];
-    rminl[2] = rminl[1];
-    rmaxl[2] = rmaxl[1];
-    zl[3] = zj[1];
-    rminl[3] = rminl[2];
-    rmaxl[3] = rminl[3];
-    PolyCone("SCL","SSD inner most foam core",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfo);
-    Pos("SCL",1,"SCI",0.0,.0,0.0,0);
-    for(i=1;i<nspoaks;i++){
-       Pos("SCG",i+1,"SCA",0.0,.0,0.0,irot+i);
-    } // end for i
-    // Now for the SSD mounting posts
-    dphi = 180.0*dRPost/(RPostmin+0.5*dRPost)/TMath::Pi(); // degrees
-    phi0 = phi0post; //
-    nz = 3;
-    Double_t *zo = new Double_t[nz];
-    Double_t *rmino = new Double_t[nz];
-    Double_t *rmaxo = new Double_t[nz];
-    rmino[0] = RPostmin+dRPost;
-    rmaxo[0] = rmino[0];
-    zo[0] = za[4]+(rmaxa[4]-Rmaxo[0])/tantc;
-    rmino[1] = RPostmin;
-    zo[1] = za[4]+(rmaxa[4]-Rmino[1])/tantc;
-    rmaxo[1] = rmaxo[0];
-    zo[2] = z0+zpostmax;
-    rmino[2] = RPostmin;
-    rmaxo[2] = rmin0[2]+dRPost;
-    PolyCone("SCO","SSD mounting post, carbon fiber",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDcf);
-    Pos("SCO",1,mother,0.0,.0,0.0,0);
-    for(i=1;i<nposts;i++){
-       Zmatrix(irot+i,360./((Double_t)nposts));
-       Pos("SCO",i+1,mother,0.0,.0,0.0,irot+i);
-    } // end for i
-    // Now for the SSD mounting posts
-    t = 180.0*ct/(RPostmin+0.5*dRPost)/TMath::Pi();
-    dphi = dphi-2.0*t; // degrees
-    phi0 = phi0+t; //
-    nz = 3;
-    Double_t *zp = new Double_t[nz];
-    Double_t *rminp = new Double_t[nz];
-    Double_t *rmaxp = new Double_t[nz];
-    rminp[0] = rmino[0]-ct;
-    rmaxp[0] = rminp[0];
-    zp[0] = za[4]+(rmaxa[4]-Rmaxp[0])/tantc;
-    rminp[1] = rmino[0]+ct;
-    rmaxp[1] = rmino[0]-ct;
-    zp[1] = za[4]+(rmaxa[4]-Rminp[1])/tantc;
-    rminp[2] = rminp[1];
-    rmaxp[2] = rmaxp[1];
-    zp[2] = z0-zpostmax;
-    PolyCone("SCP","SSD mounting post, Inserto",
-            phi0,dphi,nz,*zc,*rminc,*rmaxc,SSDfs);
-    Pos("SCP",1,"SCO",0.0,.0,0.0,0);
-    // This insrto continues into the SSD cone displacing the foam
-    // and the carbon fiber surface at those points where the posts are.
-    nz = 4;
-    Double_t *zm = new Double_t[nz];
-    Double_t *rminm = new Double_t[nz];
-    Double_t *rmaxm = new Double_t[nz];
-    Double_t *zn = new Double_t[nz];
-    Double_t *rminn = new Double_t[nz];
-    Double_t *rmaxn = new Double_t[nz];
-    rminm[0] = RPostmin+dRPost-ct;
-    rmaxm[0] = rminm[0];
-    zm[0] = zj[0]+(zj[2]-zj[0])*(rminm[0]-rminj[0])/(rminj[2]-rminj[0]);
-    rmaxm[1] = rmaxm[0];
-    zm[1] = zj[1]+(zj[3]-zj[1])*(rmaxm[1]-rmaxj[1])/(rmaxj[3]-rmaxj[1]);
-    rminm[2] = RPostmin+ct;
-    zm[2] = zj[0]+(zj[2]-zj[0])*(rminm[2]-rminj[0])/(rminj[2]-rminm[0]);
-    rmaxm[2] = rjmax[1]+(rjmax[3]-rmnax[1])*(zm[2]-zj[1])/(zj[3]-zj[1]);
-    rminm[3] = rminm[2];
-    rmaxm[3] = rminm[3];
-    zn[0] = zm[1];
-    rminn[0] = rmaxm[1];
-    rmaxn[0] = rminn[0];
-    rmaxn[1] = rmaxn[0];
-    zn[1] = za4+(rmaxa[4]-rmaxn[1])/tantc;
-    rminn[1] = rmaxj[1]+(rmaxj[3]-rmaxj[1])*(zn[1]-zj[1])/(zj[3]-zj[1]);
-    zn[2] = zm[3];
-    rminn[2] = rminm[3];
-    rmaxn[2] = -tantc*(zn[2]-za[4])+rmaxa[4];
-    rminn[3] = rminn[2];
-    rmaxn[3] = rminn[3];
-    zn]3] = za[4]+(rmaxa[4]-rmaxn[3])/tantc;
-    Pos("SCM",1,"SCJ",0.0,.0,0.0,0);
-    Pos("SCN",1,"SCI",0.0,.0,0.0,0);
-    for(i=1;i<nposts;i++){
-       Pos("SCN",i+1,"SCJ",0.0,.0,0.0,irot+i);
-       Pos("SCM",i+1,"SCI",0.0,.0,0.0,irot+i);
-    } // end for i
-    //
-    //==============================================================
-    delete[] za;delete[] rmina;delete[] rmaxa;
-    delete[] zb;delete[] rminb;delete[] rmaxb;
-    delete[] zc;delete[] rminc;delete[] rmaxc;
-    delete[] zd;delete[] rmind;delete[] rmaxd;
-    delete[] ze;delete[] rmine;delete[] rmaxe;
-    delete[] zf;delete[] rminf;delete[] rmaxf;
-    delete[] zg;delete[] rming;delete[] rmaxg;
-    delete[] zh;delete[] rminh;delete[] rmaxh;
-    delete[] zi;delete[] rmini;delete[] rmaxi;
-    delete[] zj;delete[] rminj;delete[] rmaxj;
-    // Set back to cm default scale before exiting.
-    SetScalecm();
-    return;
-}
-//______________________________________________________________________
-void AliITSv11::CreateGeometry(){
-    ////////////////////////////////////////////////////////////////////////
-    // This routine defines and Creates the geometry for version 11 of the ITS.
-    ////////////////////////////////////////////////////////////////////////
-}
-//______________________________________________________________________
-void AliITSv11::CreateMaterials(){
-////////////////////////////////////////////////////////////////////////
-  //
-  // Create ITS materials
-  //     This function defines the default materials used in the Geant
-  // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
-  // AliITSv11.
-  // In general it is automatically replaced by
-  // the CreatMaterials routine defined in AliITSv?. Should the function
-  // CreateMaterials not exist for the geometry version you are using this
-  // one is used. See the definition found in AliITSv5 or the other routine
-  // for a complete definition.
-  //
+    if(fc==0) fc = new AliITSGeometrySSDCone(new TVector3(0.0,0.0,0.0),"TSV",0);
+
+    fc->CreateG3Materials();
 }
 //______________________________________________________________________
 void AliITSv11::InitAliITSgeom(){
-    //     Based on the geometry tree defined in Geant 3.21, this
+    // Based on the geometry tree defined in Geant 3.21, this
     // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
     // sturture.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Return
+    //   none.
 }
-
 //______________________________________________________________________
 void AliITSv11::Init(){
-    ////////////////////////////////////////////////////////////////////////
-    //     Initialise the ITS after it has been created.
-    ////////////////////////////////////////////////////////////////////////
+    // Initialise the ITS after it has been created.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Return
+    //   none.
 }
 //______________________________________________________________________
 void AliITSv11::SetDefaults(){
     // sets the default segmentation, response, digit and raw cluster classes
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Return
+    //   none.
 }
 //______________________________________________________________________
 void AliITSv11::DrawModule(){
-    ////////////////////////////////////////////////////////////////////////
-    //     Draw a shaded view of the FMD version 11.
-    ////////////////////////////////////////////////////////////////////////
+    // Draw a shaded view of the ITS version 11.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Return
+    //   none.
 }
 //______________________________________________________________________
 void AliITSv11::StepManager(){
-    ////////////////////////////////////////////////////////////////////////
-    //    Called for every step in the ITS, then calles the AliITShit class
+    // Called for every step in the ITS, then calles the AliITShit class
     // creator with the information to be recoreded about that hit.
-    //     The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
+    //  The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
     // printing of information to a file which can be used to create a .det
     // file read in by the routine CreateGeometry(). If set to 0 or any other
     // value except 1, the default behavior, then no such file is created nor
     // it the extra variables and the like used in the printing allocated.
-    ////////////////////////////////////////////////////////////////////////
 }
  
index 47df348cf608e29f0a13f062c1305f8eb84d9ab0..843526fcf6d5d0cd3ff974b260f29eb6b79ab89a 100644 (file)
@@ -12,6 +12,7 @@
 /////////////////////////////////////////////////////////////////////////
  
 #include "AliITS.h"
+class AliITSGeometrySSDCone;
  
 class AliITSv11 : public AliITS {
 
@@ -98,129 +99,6 @@ class AliITSv11 : public AliITS {
                 
  private:
     void InitAliITSgeom();
-    void SetScalecm(){// Sets scale factor for centemeters
-    fScale = 1.0;}
-    void SetScalemm(){// Sets scale factor for milimeters
-    fScale = 0.10;}
-    void SetScalemicrons(){// Sets scale factor for micronsmeters
-    fScale = 1.0E-04;}
-    void SetScale(Double_t s=1.0){// Sets scale factor
-    fScale = s;}
-    Double_t GetScale(){// Returns the scale factor
-    return fScale;}
-    Bool_t IsScalecm(){// Returens kTRUE if scale factor is set of [cm]
-       if(fScale==1.0) return kTRUE; return kFALSE;}
-    // Create a Box
-    void Box(const char gnam[3],const TString &dis,
-            Double_t dx,Double_t dy,Double_t dz,Int_t med);
-    // Greate A Trapizoid with the x dimension varing along z.
-    void Trapezoid1(const char gnam[3],const TString &dis,Double_t dxn,
-                   Double_t dxp,Double_t dy,Double_t dz,Int_t med);
-    // Greate A Trapizoid with the x and y dimension varing along z.
-    void Trapezoid2(const char gnam[3],const TString &dis,Double_t dxn,
-                   Double_t dxp,Double_t dyn,Double_t dyp,Double_t dz,
-                   Int_t med);
-    // General trapazoid.
-    void Trapezoid(const char gnam[3],const TString &dis,Double_t dz,
-                  Double_t thet,Double_t phi,Double_t h1,Double_t bl1,
-                  Double_t tl1,Double_t alp1,Double_t h2,Double_t bl2,
-                  Double_t tl2,Double_t alp2,Int_t med);
-    // Simple Tube.
-    void Tube(const char gnam[3],const TString &dis,Double_t rmin,
-             Double_t rmax,Double_t dz,Int_t med);
-    // Tube segment.
-    void TubeSegment(const char gnam[3],const TString &dis,Double_t rmin,
-                    Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
-                    Int_t med);
-    // Simple Cone.
-    void Cone(const char gnam[3],const TString &dis,Double_t dz,Double_t rmin1,
-             Double_t rmax1,Double_t rmin2,Double_t rmax2,Int_t med);
-    // Segment of a Cone.
-    void ConeSegment(const char gnam[3],const TString &dis,Double_t dz,
-                    Double_t rmin1,Double_t rmax1,Double_t rmin2,
-                    Double_t rmax2,Double_t phi1,Double_t phi2,Int_t med);
-    // Spherical shell segment.
-    void Sphere(const char gnam[3],const TString &dis,Double_t rmin,
-               Double_t rmax,Double_t the1,Double_t the2,Double_t phi1,
-               Double_t phi2,Int_t med);
-    // Parallelepiped.
-    void Parallelepiped(const char gnam[3],const TString &dis,Double_t dx,
-                       Double_t dy,Double_t dz,Double_t alph,Double_t thet,
-                       Double_t phi,Int_t med);
-    // Polygon.
-    void Polygon(const char gnam[3],const TString &dis,Double_t phi1,
-                Double_t dphi,Int_t npdv,Int_t nz,Double_t *z,Double_t *rmin,
-                Double_t *rmax,Int_t med);
-    //Poly-Cone
-    void PolyCone(const char gnam[3],const TString &dis,Double_t phi1,
-                 Double_t dphi,Int_t nz,Double_t *z,Double_t *rmin,
-                 Double_t *rmax,Int_t med);
-    // Ellliptical cross-sectino tube
-    void TubeElliptical(const char gnam[3],const TString &dis,Double_t p1,
-                       Double_t p2,Double_t dz,Int_t med);
-    // Hyperbolic tube
-    void TubeElliptical(const char gnam[3],const TString &dis,Double_t p1,
-                       Double_t p2,Double_t dz,Int_t med);
-    // Twisted genral trapezoid.
-    void TwistedTrapezoid(const char gnam[3],const TString &dis,Double_t dz,
-                         Double_t thet,Double_t phi,Double_t twist,
-                         Double_t h1,Double_t bl1,Double_t tl1,
-                         Double_t apl1,Double_t h2,Double_t bl2,
-                         Double_t tl2,Double_t apl2,Int_t med);
-    // Cut tube.
-    void CutTube(const char gnam[3],const TString &dis,Double_t rmin,
-                Double_t rmax,Double_t dz,Double_t phi1,Double_t phi2,
-                Double_t lx,Double_t ly,Double_t lz,Double_t hx,Double_t hy,
-                Double_t hz,Int_t med);
-    // Position one volume inside another
-    void Pos(const char vol[3],Int_t cn,const char moth[3],Double_t x,
-            Double_t y,Double_t z,Int_t irot);
-    void SetMedArray(){// Sets up the array of media
-       fidmed = fIdtmed->GetArray()-199;}
-    // Define rotation matrix
-    void Matrix(Int_t irot,Double_t thet1,Double_t phi1,Double_t thet2,
-               Double_t phi2,Double_t thet3,Double_t phi3);
-    // Defube ritatuib matrix
-    void Matrix(Int_t irot,Double_t rot[3][3]);
-    // Rotation matrix about axis i (i=0=>x, i=1=>y, i=2=>z).
-    void Matrix(Int_t irot,Int_t axis,Double_t thet);
-    // Rotation matrix about x axis
-    void XMatrix(Int_t irot,Double_t thet){
-       Matrix(irot,0,thet);}
-    // Rotation matrix about y axis
-    void YMatrix(Int_t irot,Double_t thet){
-       Matrix(irot,1,thet);}
-    // Rotation matrix about z axis
-    void ZMatrix(Int_t irot,Double_t thet){
-       Matrix(irot,2,thet);}
-    // Define Element material and medium
-    void Element(Int_t imat,const char *name,Int_t z,Double_t dens,Int_t istd);
-    // Define Material by constituant weights
-    void MixtureByWeight(Int_t imat,const char *name,Int_t *z,Doule_t *w,
-                        Double_t dens,Int_t nelments,Int_t istd);
-    // Define Material by constituant relative number
-    void MixtureByNumber(Int_t imat,const char *name,Int_t *z,Imt_t *i,
-                        Double_t dens,Int_t nelments,Int_t istd);
-    // Returns standard radiation lenghts of elements.
-    Float_t GetRadLength(Int_t z);
-    // Returns natrual abundance atomic mass numbers for a given element
-    Float_t GetA(Int_t z);
-    // Returns ITS standard Theata Max transport cut values
-    Float_t GetStandardThetaMax(Int_t istd);
-    // Returns ITS standard Theata Max transport cut values
-    Float_t GetStandardMaxStepSize(Int_t istd);
-    // Returns ITS standard Theata Max transport cut values
-    Float_t GetStandardEfraction(Int_t istd);
-    // Returns ITS standard Theata Max transport cut values
-    Float_t GetStandardEpsilon(Int_t istd);
-    // Degree Versions of TMath functions (as needed)
-    Double_t Sind(Double_t t){return TMath::Sin(TMath::Pi()*t/180.);}
-    Double_t Cosd(Double_t t){return TMath::Cos(TMath::Pi()*t/180.);}
-    Double_t Tand(Double_t t){return TMath::Tan(TMath::Pi()*t/180.);}
-    Double_t ASind(Double_t t){return 180.0*TMath::ASin(t)/TMath::Pi();}
-    Double_t ACosd(Double_t t){return 180.0*TMath::ACos(t)/TMath::Pi();}
-    Double_t ATand(Double_t t){return 180.0*TMath::ATan(t)/TMath::Pi();}
-    Double_t ATand2(Double_t y,Double_t x){return 180.0*TMath::ATan2(y,x)/TMath::Pi();}
 
     // TString fEuclidGeomtery,fEuclidMaterial defined in AliModule.
     Bool_t fEuclidOut;        // Flag to write geometry in euclid format
@@ -236,12 +114,8 @@ class AliITSv11 : public AliITS {
     Float_t  fChip1;         // thickness of chip in SPD layer 1   
     Float_t  fChip2;         // thickness of chip in SPD layer 2   
     Int_t    fRails;          // flag to switch rails on (=1) and off (=0)
-    Int_t    fFluid;          // flag to switch between water (=1) and freon (=0)
-    Int_t fIDMother;          //! ITS Mother Volume id.
-    //
-    Int_t *fidmed;            //! array of media indexes.
-    Int_t *fidrot;            //! array of rotation matrixies indexes.
-    Double_t fScale;          //! scale factor (=1=>[cm])
+    Int_t    fFluid;          // flag to switch between water(=1) and freon(=0)
+    AliITSGeometrySSDCone *fc;//! ITS SSD Cone geometry. ONLY THING DEFINED.
 
     ClassDef(AliITSv11,1)  //Hits manager for set:ITS version 11 
                                  // PPR detailed Geometry asymmetric