]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
ITS new Geometry files. Not yet ready for uses, committed to allow additional
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Mar 2003 23:27:19 +0000 (23:27 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 25 Mar 2003 23:27:19 +0000 (23:27 +0000)
development.

12 files changed:
ITS/AliITSBaseGeometry.cxx
ITS/AliITSBaseGeometry.h
ITS/AliITSGeometryITSV.cxx [new file with mode: 0644]
ITS/AliITSGeometryITSV.h [new file with mode: 0644]
ITS/AliITSGeometrySDDCone.cxx [new file with mode: 0644]
ITS/AliITSGeometrySDDCone.h [new file with mode: 0644]
ITS/AliITSGeometrySSDCone.cxx
ITS/AliITSGeometrySSDCone.h
ITS/AliITSv11.cxx
ITS/AliITSv11.h
ITS/ITSLinkDef.h
ITS/libITS.pkg

index e27d224857ca1f702fa23e1eee88d315a420665c..be5ef2726b52b956ceebd0b43005153c50b4c046 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.1  2003/02/10 17:03:52  nilsen
+New version and structure of ITS V11 geometry. Work still in progress.
+
 
 $Id$
 */
@@ -51,6 +54,15 @@ Created February 2003.
 #include "AliITSBaseGeometry.h"
 
 ClassImp(AliITSBaseGeometry)
+
+Int_t    AliITSBaseGeometry::fNCreates    = 0;
+Int_t*   AliITSBaseGeometry::fidrot       = 0;
+Int_t    AliITSBaseGeometry::fidrotsize   = 0;
+Int_t    AliITSBaseGeometry::fidrotlast   = 0;
+Int_t    AliITSBaseGeometry::fVolNameSize = 0;
+Int_t    AliITSBaseGeometry::fVolNameLast = 0;
+TString* AliITSBaseGeometry::fVolName     = 0;
+
 //______________________________________________________________________
 AliITSBaseGeometry::AliITSBaseGeometry(){
     // Default construtor for the ITS Base Geometry class.
@@ -63,6 +75,8 @@ AliITSBaseGeometry::AliITSBaseGeometry(){
 
     fScale = 1.0; // Default value.
     fits = 0; // zero pointers.
+    if(fNCreates==0){ // only for very first init
+    } // end if
     fNCreates++; // incrament this creation counter.
 }
 //______________________________________________________________________
@@ -77,6 +91,11 @@ AliITSBaseGeometry::AliITSBaseGeometry(AliModule *its,Int_t iflag){
 
     fScale = 1.0; // Default value.
     fits = its; // get a copy of the pointer to the ITS.
+    if(fNCreates==0){ // only for very first init
+       fidrotsize = ITSG3VnameToIndex("TSV")+1;
+       fidrot = new Int_t[fidrotsize];
+       fidrotlast = 0;
+    } // end if
     fNCreates++; // incrament this creation counter.
 }
 //______________________________________________________________________
@@ -91,7 +110,6 @@ AliITSBaseGeometry::~AliITSBaseGeometry(){
 
     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;
@@ -121,12 +139,13 @@ Int_t AliITSBaseGeometry::AddVolName(const TString name){
     Int_t i;
 
     if(fVolName==0){ // must create array.
-       fVolNameSize = 1000;
+       fVolNameSize = 38624;
        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);
+       Error("AddVolName","Volume name already exists for volume %d name %s",
+             i,name.Data());
        return -1;
     } // end for i
     if(fVolNameSize==fVolNameLast-1){ // Array is full must expand.
@@ -137,7 +156,8 @@ Int_t AliITSBaseGeometry::AddVolName(const TString name){
        delete[] old;
        fVolNameSize = size;
     } // end if
-    if(strcmp(ITSIndexToITSG3name(fVolNameLast),"ITSV")==0){
+    i=ITSIndexToITSG3name(fVolNameLast);
+    if(strcmp((char*)(&i),"ITSV")==0){
        // Special Reserved Geant 3 volumen name. Skip it
        // fill it with explination for conveniance.
        fVolName[fVolNameLast] = "ITS Master Mother Volume";
@@ -148,7 +168,7 @@ Int_t AliITSBaseGeometry::AddVolName(const TString name){
     return fVolNameLast-1; // return the index
 }
 //______________________________________________________________________
-char* AliITSBaseGeometry::ITSIndexToITSG3name(const Int_t i){
+Int_t 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
@@ -164,22 +184,24 @@ char* AliITSBaseGeometry::ITSIndexToITSG3name(const Int_t i){
     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 k;
+    Byte_t *a = (Byte_t*) &k;
     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;
+    k = 0;
+    a[0] = (Byte_t)('I');
+    a[1] = (Byte_t)('0'+j/(range*range));
+    if(a[1]>'9') a[1] += 'A'-'9'-1;//if it is a letter add in gap for simples.
+    j -= range*range*((Int_t)(j/(range*range)));
+    a[2] = (Byte_t)('0'+j/range);
+    if(a[2]>'9') a[2] += 'A'-'9'-1;//if it is a letter add in gap for simples.
+    j -= range*((Int_t)(j/range));
+    a[3] = (Byte_t)('0'+j);
+    if(a[3]>'9') a[3] += 'A'-'9'-1;//if it is a letter add in gap for simples.
+    return k;
 }
 //______________________________________________________________________
-Int_t AliITSBaseGeometry::ITSG3VnameToIndex(const char name[3])const{
+Int_t AliITSBaseGeometry::ITSG3VnameToIndex(const char *name)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
@@ -192,20 +214,19 @@ Int_t AliITSBaseGeometry::ITSG3VnameToIndex(const char name[3])const{
     //    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
+    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 + A-Z.
+    Int_t i=0,j,k;
+
+    k = strlen(name)-1;
+    for(j=k;j>k-3;j--) if(isdigit(name[j])) // number
+       i += (Int_t)((name[j]-'0')*TMath::Power((Double_t)range,
+                                               (Double_t)(k-j)));
+    else
+       i += (Int_t)((name[j]-'A'+rangen)*TMath::Power((Double_t)range,
+                                                      (Double_t)(k-j)));
     return i;
 }
 //______________________________________________________________________
@@ -244,13 +265,13 @@ Int_t AliITSBaseGeometry::GetVolumeIndex(const TString &a){
     return -1;
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Box(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Box(const char *gnam,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"
+    //    const char *gnam  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.
@@ -262,26 +283,24 @@ void AliITSBaseGeometry::Box(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"BOX ",GetMed(med),param,3);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid1(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Trapezoid1(const char *gnam,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"
+    //    const char *gnam  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.
@@ -296,27 +315,25 @@ void AliITSBaseGeometry::Trapezoid1(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"TRD1",GetMed(med),param,4);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid2(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Trapezoid2(const char *gnam,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"
+    //    const char *gnam  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.
@@ -334,21 +351,19 @@ void AliITSBaseGeometry::Trapezoid2(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"TRD2",GetMed(med),param,5);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Trapezoid(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Trapezoid(const char *gnam,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,
@@ -356,13 +371,13 @@ void AliITSBaseGeometry::Trapezoid(const char gnam[3],const TString &dis,
     // 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].
+    // 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"
+    //    const char *gnam  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.
@@ -378,28 +393,27 @@ void AliITSBaseGeometry::Trapezoid(const char gnam[3],const TString &dis,
     //                        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 
+    //    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 
+    //    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];
+    char name[5];
     Float_t param[11];
 
-    if(fidmed==0) SetMedArray();
     param[0] = fScale*dz;
     param[1] = thet;
     param[2] = phi;
@@ -411,19 +425,18 @@ void AliITSBaseGeometry::Trapezoid(const char gnam[3],const TString &dis,
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"TRAP",GetMed(med),param,11);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Tube(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Tube(const char *gnam,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"
+    //    const char *gnam  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.
@@ -435,27 +448,51 @@ void AliITSBaseGeometry::Tube(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"TUBE",GetMed(med),param,3);
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Tube(AliITSTubeData &d,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:
+    //    AliITSTubeData     Structure with the tube parameters
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[5];
+    Float_t param[3];
+    Int_t i,k;
+    char *j = (char *) &k;
+
+    param[0] = fScale*d.Rmin();
+    param[1] = fScale*d.Rmax();
+    param[2] = fScale*d.DzAt();
+    d.SetVid(AddVolName((d.GetName())->Data()));
+    k = ITSIndexToITSG3name(d.GetVid());
+    for(i=0;i<4;i++) name[i] = j[i];
+    name[4] = '\0';
+    gMC->Gsvolu(name,"TUBE",GetMed(med),param,3);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::TubeSegment(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::TubeSegment(const char *gnam,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() 
+    // 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"
+    //    const char *gnam  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.
@@ -469,28 +506,26 @@ void AliITSBaseGeometry::TubeSegment(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"TUBS",GetMed(med),param,5);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Cone(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Cone(const char *gnam,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"
+    //    const char *gnam  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.
@@ -504,32 +539,31 @@ void AliITSBaseGeometry::Cone(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"CONS",GetMed(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){
+void AliITSBaseGeometry::ConeSegment(const char *gnam,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 
+    // 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.
+    //    const char *gnam  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.
@@ -543,10 +577,9 @@ void AliITSBaseGeometry::ConeSegment(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     Float_t param[7];
 
-    if(fidmed==0) SetMedArray();
     param[0] = fScale*dz;
     param[1] = fScale*rmin1;
     param[2] = fScale*rmax1;
@@ -554,12 +587,11 @@ void AliITSBaseGeometry::ConeSegment(const char gnam[3],const TString &dis,
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"CONS",GetMed(med),param,7);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Sphere(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Sphere(const char *gnam,const TString &dis,
                                Double_t rmin,Double_t rmax,Double_t the1,
                                Double_t the2,Double_t phi1,Double_t phi2,
                                Int_t med){
@@ -567,7 +599,7 @@ void AliITSBaseGeometry::Sphere(const char gnam[3],const TString &dis,
     // 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"
+    //    const char *gnam  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.
@@ -582,22 +614,20 @@ void AliITSBaseGeometry::Sphere(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"SPHE",GetMed(med),param,6);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Parallelepiped(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::Parallelepiped(const char *gnam,const TString &dis,
                                        Double_t dx,Double_t dy,Double_t dz,
                                        Double_t alpha,Double_t thet,
                                        Double_t phi,Int_t med){
@@ -605,7 +635,7 @@ void AliITSBaseGeometry::Parallelepiped(const char gnam[3],const TString &dis,
     // 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"
+    //    const char *gnam  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.
@@ -617,37 +647,35 @@ void AliITSBaseGeometry::Parallelepiped(const char gnam[3],const TString &dis,
     //                        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].
+    //    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];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"PARA",GetMed(med),param,6);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::Polygon(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::PolyGon(const char *gnam,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].
+    // parameters or more. See SetScale() for units. Default units are geant
+    // [cm].
     // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //    const char *gnam  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.
@@ -655,8 +683,8 @@ void AliITSBaseGeometry::Polygon(const char gnam[3],const TString &dis,
     //                        (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 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 
@@ -673,11 +701,10 @@ void AliITSBaseGeometry::Polygon(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     Float_t *param;
     Int_t n,i;
 
-    if(fidmed==0) SetMedArray();
     n = 4+3*nz;
     param = new Float_t[n];
     param[0] = phi1;
@@ -685,26 +712,61 @@ void AliITSBaseGeometry::Polygon(const char gnam[3],const TString &dis,
     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];
+       param[4+3*i] = fScale*z[i];
+       param[5+3*i] = fScale*rmin[i];
+       param[6+3*i] = fScale*rmax[i];
+    } // end for i
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"PGON",GetMed(med),param,n);
+
+    delete[] param;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::PolyGon(AliITSPGonData &d,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:
+    //    AliITSPGonData &d  Object with poly cone data stored in it.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[5];
+    Float_t *param;
+    Int_t n,i,k;
+    char *j = (char *) &k;
+
+    n = 4+3*d.Nz();
+    param = new Float_t[n];
+    param[0] = d.Phi0();
+    param[1] = d.DPhi();
+    param[2] = (Float_t) d.NPhi();
+    param[3] = (Float_t) d.Nz();
+    for(i=0;i<d.Nz();i++){
+       param[4+3*i] = fScale*d.ZAt(i);
+       param[5+3*i] = fScale*d.Rmin(i);
+       param[6+3*i] = fScale*d.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);
+    d.SetVid(AddVolName((d.GetName())->Data()));
+    k = ITSIndexToITSG3name(d.GetVid());
+    for(i=0;i<4;i++) name[i] = j[i];
+    name[4] = '\0';
+    gMC->Gsvolu(name,"PGON",GetMed(med),param,n);
 
     delete[] param;
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::PolyCone(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::PolyCone(const char *gnam,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].
+    // parameters or more. See SetScale() for units. Default units are geant
+    // [cm].
     // Inputs:
-    //    const char gnam[3]  3 character geant volume name. The letter "I"
+    //    const char *gnam  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.
@@ -726,36 +788,69 @@ void AliITSBaseGeometry::PolyCone(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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];
+       param[3+3*i] = fScale*z[i];
+       param[4+3*i] = fScale*rmin[i];
+       param[5+3*i] = fScale*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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"PCON",GetMed(med),param,n);
 
     delete[] param;
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::TubeElliptical(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::PolyCone(AliITSPConeData &d,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:
+    //    AliITSPConeData &d  Object with poly cone data stored in it.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    char name[5];
+    Float_t *param;
+    Int_t n,i,k;
+    char *j = (char *) &k;
+
+    n = 3+3*d.Nz();
+    param = new Float_t[n];
+    param[0] = d.Phi0();
+    param[1] = d.DPhi();
+    param[2] = (Float_t) d.Nz();
+    for(i=0;i<d.Nz();i++){
+       param[3+3*i] = fScale*d.ZAt(i);
+       param[4+3*i] = fScale*d.Rmin(i);
+       param[5+3*i] = fScale*d.Rmax(i);
+    } // end for if
+    d.SetVid(AddVolName((d.GetName())->Data()));
+    k = ITSIndexToITSG3name(d.GetVid());
+    for(i=0;i<4;i++) name[i] = j[i];
+    name[4] = '\0';
+    gMC->Gsvolu(name,"PCON",GetMed(med),param,n);
+
+    delete[] param;
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::TubeElliptical(const char *gnam,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"
+    //    const char *gnam  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.
@@ -767,29 +862,27 @@ void AliITSBaseGeometry::TubeElliptical(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"ELTU",GetMed(med),param,3);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::HyperbolicTube(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::HyperbolicTube(const char *gnam,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 
+    // 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"
+    //    const char *gnam  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.
@@ -803,20 +896,18 @@ void AliITSBaseGeometry::HyperbolicTube(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"HYPE",GetMed(med),param,4);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::TwistedTrapezoid(const char gnam[3],
+void AliITSBaseGeometry::TwistedTrapezoid(const char *gnam,
                                          const TString &dis,
                                 Double_t dz,Double_t thet,Double_t phi,
                                 Double_t twist,Double_t h1,Double_t bl1,
@@ -827,24 +918,25 @@ void AliITSBaseGeometry::TwistedTrapezoid(const char gnam[3],
     // 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.
+    // 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 
@@ -878,7 +970,7 @@ void AliITSBaseGeometry::TwistedTrapezoid(const char gnam[3],
     // 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"
+    //    const char *gnam  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.
@@ -906,18 +998,18 @@ void AliITSBaseGeometry::TwistedTrapezoid(const char gnam[3],
     //                        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].
+    //    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];
+    char name[5];
     Float_t param[12];
 
-    if(fidmed==0) SetMedArray();
     param[0] = fScale*dz;
     param[1] = thet;
     param[2] = phi;
@@ -930,23 +1022,22 @@ void AliITSBaseGeometry::TwistedTrapezoid(const char gnam[3],
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"GTRA",GetMed(med),param,12);
 }
 //______________________________________________________________________
-void AliITSBaseGeometry::CutTube(const char gnam[3],const TString &dis,
+void AliITSBaseGeometry::CutTube(const char *gnam,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.
+    // Interface to TMC->Gsvolu() for ITS CTUB geometries. Cut tube. A tube 
+    // cut at the extremities with planes not necessarily perpendicular to 
+    // the 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"
+    //    const char *gnam  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.
@@ -973,10 +1064,9 @@ void AliITSBaseGeometry::CutTube(const char gnam[3],const TString &dis,
     //    none.
     // Return.
     //    none.
-    char name[4];
+    char name[5];
     Float_t param[11];
 
-    if(fidmed==0) SetMedArray();
     param[0] = fScale*rmin;
     param[1] = fScale*rmax;
     param[2] = fScale*dz;
@@ -988,23 +1078,23 @@ void AliITSBaseGeometry::CutTube(const char gnam[3],const TString &dis,
     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);
+    G3name(gnam,name);
+    gMC->Gsvolu(name,"CTUB",GetMed(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){
+void AliITSBaseGeometry::Pos(AliITSBaseVolParams &v,Int_t cn,
+                            AliITSBaseVolParams &m,
+                            TVector3 &t,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.
+    //   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 
@@ -1017,19 +1107,57 @@ void AliITSBaseGeometry::Pos(const char vol[3],Int_t cn,const char moth[3],
     //    none.
     // Return:
     //    none.
-    char name[4],mother[4];
+    char name[5],mother[5];
     Float_t param[3];
     Int_t r=0,i;
+    char *n = (char*)&r;
 
-    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");
+    param[0] = fScale*t.X();
+    param[1] = fScale*t.Y();
+    param[2] = fScale*t.Z();
+    r = ITSIndexToITSG3name(v.GetVid());
+    for(i=0;i<4;i++) name[i] = n[i]; name[4] ='\0';
+    r = ITSIndexToITSG3name(m.GetVid());
+    for(i=0;i<4;i++) mother[i] = n[i]; mother[4] ='\0';
+    if(irot>0) r = fidrot[irot]; else r=0;
+    gMC->Gspos(name,cn,mother,param[0],param[1],param[2],r,"ONLY");
+}
+//______________________________________________________________________
+void AliITSBaseGeometry::Pos(const char *vol,Int_t cn,const char *moth,
+                            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[5],mother[5];
+    Float_t param[3];
+    Int_t r=0;
+
+    param[0] = fScale*x;
+    param[1] = fScale*y;
+    param[2] = fScale*z;
+    G3name(vol,name);
+    G3name(moth,mother);
+    if(irot>0) r = fidrot[irot];
+    gMC->Gspos(name,cn,mother,param[0],param[1],param[2],r,"ONLY");
 }
 //______________________________________________________________________
 void AliITSBaseGeometry::Matrix(Int_t irot,Double_t thet1,Double_t phi1,
@@ -1054,7 +1182,9 @@ void AliITSBaseGeometry::Matrix(Int_t irot,Double_t thet1,Double_t phi1,
     //    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){
+    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;
@@ -1085,15 +1215,17 @@ void AliITSBaseGeometry::Matrix(Int_t irot,Int_t axis,Double_t thet){
     if(thet==0.0){
        fidrot[irot] = 0; // Unit matrix
     }else{
-       switch (irot) {
+       switch (axis) {
        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);
+           fits->AliMatrix(fidrot[irot],360.-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);
+           fits->AliMatrix(fidrot[irot],90.0,thet,90.0,360.-thet-90.0,
+                           0.0,0.0);
            break;
        default:
            Error("Matrix","axis must be either 0, 1, or 2. for matrix=%d",
@@ -1154,25 +1286,26 @@ Float_t AliITSBaseGeometry::GetA(Int_t z){
     //    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};
+    const Float_t A[]={
+         1.00794 ,  4.0026902,  6.941   ,  9.012182 , 10.811   , // H-B
+         12.01007 , 14.00674  , 15.9994  , 18.9984032, 20.1797  , // C-Ne
+         22.98970 , 24.3050   , 26.981538, 28.0855   , 30.973761, // Na-P
+        32.066   , 35.4527   , 39.948   , 39.0983   , 40.078   , // S-Ca
+        44.95591 , 47.867    , 50.9415  , 51.9961   , 54.938049, // Sc-Mn
+        55.845   , 58.933200 , 58.6934  , 63.546    , 65.39    , // Fe-Zn
+        69.723   , 72.61     , 74.92160 , 78.96     , 79.904   , // Ga-Br
+        83.80    , 85.4678   , 87.62    , 88.9085   , 91.224   , // Kr-Zr
+        92.90638 , 95.94     , 97.907215, 101.07    ,102.90550 , // Nb-Rh
+       106.42    ,107.8682   ,112.411   ,114.818    ,118.710   , // Pd-Sn
+       121.760   ,127.60     ,126.90447 ,131.29     ,132.90545 , // Sb-Cs
+       137.327   ,138.9055   ,140.116   ,140.90765  ,144.24    , // La-Nd
+       144.912746,150.36     ,151.964   ,157.25     ,158.92534 , // Pm-Tb
+       162.50    ,164.93032  ,167.26    ,168.93421  ,173.04    , // Dy-Yb
+       174.967   ,178.49     ,180.9479 ,183.84      ,186.207   , // Lu-Re
+       190.23    ,192.217    ,195.078  ,196.96655   ,200.59    , // Os-Hg
+       204.3833  ,207.2      ,208.98038,208.982415  ,209.987131, // Tl-At
+       222.017570,223.019731 ,226.025402,227.027747 ,232.0381  , // Rn-Th
+        231.03588 ,238.0289   }; // Pa,U
 
     if(z<1||z>92){
        Error("GetA","z must be 0<z<93. z=%d",z);
@@ -1228,6 +1361,7 @@ Float_t AliITSBaseGeometry::GetStandardEfraction(Int_t istd){
     };
     return t[istd];
 }
+//______________________________________________________________________
 Float_t AliITSBaseGeometry::GetStandardEpsilon(Int_t istd){
     // Returns one of the standard Epsilon valuse
     // Inputs:
@@ -1309,7 +1443,7 @@ void AliITSBaseGeometry::MixtureByWeight(Int_t imat,const char* name,Int_t *z,
     A = new Float_t[n];
     W = new Float_t[n];
 
-    len = strlen(name)+1;
+    len = strlen(name)+2;
     name2 = new char[len];
     strncpy(name2,name,len-1);
     name2[len-1] = '\0';
@@ -1425,3 +1559,284 @@ Double_t AliITSBaseGeometry::RadLength(Int_t iz,Double_t a){
     xz = 1.0/r;
     return xz; // [gm/cm^2]
 }
+//======================================================================
+ClassImp(AliITSPConeData)
+//______________________________________________________________________
+void AliITSPConeData::Print(ostream *os){
+    // Prints out the data kept in this class
+    // Inputs:
+    //    ostream *os The output stream pointer
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+    Int_t i;
+
+#if defined __GNUC__
+#if __GNUC__ > 2
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+#if defined __ICC || defined __ECC
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#endif
+
+    *os << "Volume "<< GetVid() << " Name: " << *GetName() << endl;
+    *os << "fNz=" << fNz << " fPhi0=" << fPhi0 << " fdPhi=" << fDphi << endl;
+    *os <<"       Z        ,      Rmin      ,      Rmax      " << endl;
+    fmt = os->setf(ios::scientific);  // set scientific floating point output
+    for(i=0;i<fNz;i++){
+       *os << setprecision(16) << fZ[i] <<" ";
+       *os << setprecision(16) << fRmin[i] << " ";
+       *os << setprecision(16) << fRmax[i] << endl;
+    } // end for i
+    os->flags(fmt); // reset back to old formating.
+    return;
+}
+//______________________________________________________________________
+void AliITSPConeData::Read(istream *is){
+    // Read in data kept in this class
+    // Inputs:
+    //   istream *is  the input stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+    Int_t i;
+    char s[50];
+    TString t;
+
+    is->get(s,7);
+    *is >> i; SetVid(i);
+    is->get(s,7);
+    *is >> t; SetName(t.Data());
+    is->get(s,4);
+    *is >> fNz;
+    is->get(s,6);
+    *is >> fPhi0;
+    is->get(s,6);
+    *is >> fDphi;
+    is->getline(s,49);
+    Size(fNz);
+    for(i=0;i<fNz;i++){
+       *is >> fZ[i] >> fRmin[i] >> fRmax[i];
+    } // end for i
+}
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSPConeData &p){
+    // Operator << for C++ like output
+    // Inputs:
+    //    ostream &os        The output stream
+    //    AliITSPConeData &p The class to be outputed
+    // Output:
+    //    none.
+    // Return:
+    //    ostream &os        The output stream
+
+    p.Print(&os);
+    return os;
+}
+//______________________________________________________________________
+istream &operator>>(istream &is,AliITSPConeData &r){
+    // Operator << for C++ like output
+    // Inputs:
+    //    istream &is        The input stream
+    //    AliITSPConeData &r The class to be read in
+    // Output:
+    //    none.
+    // Return:
+    //    istream &is        The input stream
+
+    r.Read(&is);
+    return is;
+}
+//======================================================================
+ClassImp(AliITSPGonData)
+//______________________________________________________________________
+void AliITSPGonData::Print(ostream *os){
+    // Prints out the data kept in this class
+    // Inputs:
+    //    ostream *os The output stream pointer
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+    Int_t i;
+
+#if defined __GNUC__
+#if __GNUC__ > 2
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+#if defined __ICC || defined __ECC
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#endif
+
+    *os << "Volume "<< GetVid() << " Name: " << *GetName() << endl;
+    *os << "fNz=" << fNz << " fNphi=" << fNphi << " fPhi0=" << fPhi0;
+    *os << " fdPhi=" << fDphi << endl;
+    *os <<"       Z        ,      Rmin      ,      Rmax      " << endl;
+    fmt = os->setf(ios::scientific);  // set scientific floating point output
+    for(i=0;i<fNz;i++){
+       *os << setprecision(16) << fZ[i] <<" ";
+       *os << setprecision(16) << fRmin[i] << " ";
+       *os << setprecision(16) << fRmax[i] << endl;
+    } // end for i
+    os->flags(fmt); // reset back to old formating.
+    return;
+}
+//______________________________________________________________________
+void AliITSPGonData::Read(istream *is){
+    // Read in data kept in this class
+    // Inputs:
+    //   istream *is  the input stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+    Int_t i;
+    char s[50];
+    TString t;
+
+    is->get(s,7);
+    *is >> i;SetVid(i);
+    is->get(s,7);
+    *is >> t; SetName(t.Data());
+    
+    is->get(s,4);
+    *is >> fNz;
+    is->get(s,6);
+    *is >> fNphi;
+    is->get(s,6);
+    *is >> fPhi0;
+    is->get(s,6);
+    *is >> fDphi;
+    is->getline(s,49);
+
+    Size(fNz);
+    for(i=0;i<fNz;i++){
+       *is >> fZ[i] >> fRmin[i] >> fRmax[i];
+    } // end for i
+}
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSPGonData &p){
+    // Operator << for C++ like output
+    // Inputs:
+    //    ostream &os       The output stream
+    //    AliITSPGonData &p The class to be outputed
+    // Output:
+    //    none.
+    // Return:
+    //    ostream &os        The output stream
+
+    p.Print(&os);
+    return os;
+}
+//______________________________________________________________________
+istream &operator>>(istream &is,AliITSPGonData &r){
+    // Operator << for C++ like output
+    // Inputs:
+    //    istream &is       The input stream
+    //    AliITSPGonData &r The class to be read in
+    // Output:
+    //    none.
+    // Return:
+    //    istream &is        The input stream
+
+    r.Read(&is);
+    return is;
+}
+//======================================================================
+ClassImp(AliITSTubeData)
+//______________________________________________________________________
+void AliITSTubeData::Print(ostream *os){
+    // Prints out the data kept in this class
+    // Inputs:
+    //    ostream *os The output stream pointer
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+#if defined __GNUC__
+#if __GNUC__ > 2
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#else
+#if defined __ICC || defined __ECC
+    ios::fmtflags fmt;
+#else
+    Int_t fmt;
+#endif
+#endif
+
+    *os << "Volume "<< GetVid() << " Name: " << *GetName() << endl;
+    *os <<"       Z        ,      Rmin      ,      Rmax      " << endl;
+    fmt = os->setf(ios::scientific);  // set scientific floating point output
+    *os << setprecision(16) << fDz <<" ";
+    *os << setprecision(16) << fRmin << " ";
+    *os << setprecision(16) << fRmax << endl;
+    os->flags(fmt); // reset back to old formating.
+    return;
+}
+//______________________________________________________________________
+void AliITSTubeData::Read(istream *is){
+    // Read in data kept in this class
+    // Inputs:
+    //   istream *is  the input stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+    Int_t i;
+    char s[50];
+    TString t;
+
+    is->get(s,7);
+    *is >> i;SetVid(i);
+    is->get(s,7);
+    *is >> t; SetName(t.Data());
+    
+    is->getline(s,49);
+       *is >> fDz >> fRmin >> fRmax;
+}
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSTubeData &p){
+    // Operator << for C++ like output
+    // Inputs:
+    //    ostream &os       The output stream
+    //    AliITSTubeData &p The class to be outputed
+    // Output:
+    //    none.
+    // Return:
+    //    ostream &os        The output stream
+
+    p.Print(&os);
+    return os;
+}
+//______________________________________________________________________
+istream &operator>>(istream &is,AliITSTubeData &r){
+    // Operator << for C++ like output
+    // Inputs:
+    //    istream &is       The input stream
+    //    AliITSTubeData &r The class to be read in
+    // Output:
+    //    none.
+    // Return:
+    //    istream &is        The input stream
+
+    r.Read(&is);
+    return is;
+}
index e837b7fc5693163a914e3f102bb9bbcb2c67cf2d..2a06e64fe5c9f76cb2c9f39fb6405f5c0be5e241 100644 (file)
@@ -1,3 +1,264 @@
+#ifndef ALIITSBASEVOLPARAMS_H
+#define ALIITSBASEVOLPARAMS_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/////////////////////////////////////////////////////////////////////////
+//  Geant 3 base class for volume parameters
+/////////////////////////////////////////////////////////////////////////
+#include <TObject.h>
+class TString;
+
+class AliITSBaseVolParams : public TObject {
+ public:
+    AliITSBaseVolParams(){fVol=-1;} // Default constructor
+    virtual ~AliITSBaseVolParams(){} // Destructor
+    virtual void SetVid(Int_t i){fVol = i;}// Sets the volume id from the next
+                                          // available one
+    virtual Int_t GetVid(){return fVol;} // Returns volume id
+    virtual void SetName(const char *c){fName=c;}//Sets name of this volume
+    virtual TString* GetName(){return &fName;} // Returns volume name
+    virtual void Print(ostream *os){} // Prints output content of this class
+    virtual void Read(istream *is){} // Reads output created by Print above.
+ private:
+    Int_t   fVol;  // Volume index number
+    TString fName; // Volume name
+
+    ClassDef(AliITSBaseVolParams,1) // Basic ITS volume parameters class
+};
+
+#endif
+
+
+#ifndef ALIITSTUBEDATA_H
+#define ALIITSTUBEDATA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/////////////////////////////////////////////////////////////////////////
+//  Geant 3 Poly-Cone data structure.
+/////////////////////////////////////////////////////////////////////////
+#include <math.h> // for the definision of NAN.
+class TString;
+
+class AliITSTubeData : public AliITSBaseVolParams {
+ public:
+    AliITSTubeData() : AliITSBaseVolParams() // Default constructor
+       {fDz=0;fRmin=0;fRmax=0;}
+    virtual ~AliITSTubeData(){} // Standard destructor
+    // Getters
+    Double_t DzAt() // Return fDz coordiante
+       {return fDz;}
+    Double_t Rmin() {return fRmin;} // Returm arrau of rmin values
+    Double_t Rmax() {return fRmax;} // Returm arrau of rmax values
+    Double_t& Z()// Returns address of fDz
+       {return fDz;}
+    Double_t& Rn()// Returns address of fRmin
+       {return fRmin;}
+    Double_t& Rx()// Returns address of fRmax
+       {return fRmax;}
+    void Print(ostream *os); // Prints output content of this class
+    void Read(istream *is); // Reads output created by Print above.
+ private:
+    Double_t fRmin; // Inner Radius
+    Double_t fRmax; // Outer Radius
+    Double_t fDz;   // Z half length.
+
+    ClassDef(AliITSTubeData,1) // Poly Cone data class
+};
+// Input and output function for standard C++ input/output.
+ostream &operator<<(ostream &os,AliITSTubeData &source);
+istream &operator>>(istream &os,AliITSTubeData &source);
+
+
+#endif
+   
+#ifndef ALIITSPCONEDATA_H
+#define ALIITSPCONEDATA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/////////////////////////////////////////////////////////////////////////
+//  Geant 3 Poly-Cone data structure.
+/////////////////////////////////////////////////////////////////////////
+#include <math.h> // for the definision of NAN.
+class TString;
+
+class AliITSPConeData : public AliITSBaseVolParams {
+ public:
+    AliITSPConeData() : AliITSBaseVolParams() // Default constructor
+       {fNz=0;fPhi0=0.0;fDphi=0.0;fZ=0;fRmin=0;fRmax=0;}
+    AliITSPConeData(Int_t n) : AliITSBaseVolParams() // Standard constructor
+       {fNz=n;fPhi0=0.0;fDphi=360.0;fZ=new Double_t[n];
+       fRmin=new Double_t[n];fRmax=new Double_t[n];}
+    AliITSPConeData(AliITSPConeData &source) // Copy constructor
+       { *this = source;}
+    virtual ~AliITSPConeData() // Standard destructor
+       {delete[] fZ;delete[] fRmin;delete[] fRmax;fNz=0;}
+    AliITSPConeData& operator=(AliITSPConeData &source) // Equals operator
+       {this->SetVid(source.GetVid());
+       this->SetName((source.GetName())->Data());
+       this->fNz = source.fNz;this->fPhi0=source.fPhi0;
+       this->fDphi=source.fDphi;
+       if(this->fZ!=0) delete[] this->fZ;
+       if(this->fRmin!=0) delete[] this->fRmin;
+       if(this->fRmax!=0) delete[] this->fRmax;
+       this->fZ=0;this->fRmin=0;this->fRmax=0;if(this->fNz<=0) return *this;
+       this->fZ=new Double_t[this->fNz];this->fRmin=new Double_t[this->fNz];
+       this->fRmax=new Double_t[this->fNz];for(Int_t i=0;i<this->fNz;i++){
+           this->fZ[i]=source.fZ[i];this->fRmin[i]=source.fRmin[i];
+           fRmax[i]=source.fRmax[i];}return *this;}
+    void Size(Int_t n)// Sets the number of Z,Rmin,Rmax parameters
+       {if(fZ!=0) delete fZ;if(fRmin!=0) delete fRmin;
+       if(fRmax!=0) delete fRmax; fNz=n;fPhi0=0.0;fDphi=360.0;
+       fZ=new Double_t[n];fRmin=new Double_t[n];fRmax=new Double_t[n];}
+    void Size(Int_t n,const char *c){//Sets the number of Z,Rmin, and Rmax
+       // parameters as well as the volume name.
+       Size(n);SetName(c);}
+    // Getters
+    Int_t Nz() {return fNz;} // Returns fNz
+    Double_t Phi0(){return fPhi0;}// Return starting phi value
+    Double_t DPhi(){return fDphi;}// Return delta phi value
+    Double_t ZAt(Int_t i) // Return Z coordiante
+       {if(i<0||i>=fNz) return NAN;else return fZ[i];}
+    Double_t *Z(){return fZ;} // Returns array of z values
+    Double_t *Rmin() {return fRmin;} // Returm arrau of rmin values
+    Double_t *Rmax() {return fRmax;} // Returm arrau of rmax values
+    Double_t Rmin(Int_t i) // Return Inner radius value
+       {if(i<0||i>=fNz) return NAN;else return fRmin[i];}
+    Double_t Rmax(Int_t i) // Return Outer radius value
+       {if(i<0||i>=fNz) return NAN;else return fRmax[i];}
+    // Setters
+    Double_t& P0() // Returns the address of fPhi0
+       {return fPhi0;}
+    Double_t& dP() // Returns the address of fDphi
+       {return fDphi;}
+    Double_t& Z(Int_t i)// Returns address of fZ
+       {/*if(i<0||i>=fNz) return 0;*/return fZ[i];}
+    Double_t& Rn(Int_t i)// Returns address of fRmin
+       {/*if(i<0||i>=fNz) return 0;*/return fRmin[i];}
+    Double_t& Rx(Int_t i)// Returns address of fRmax
+       {/*if(i<0||i>=fNz) return 0;*/return fRmax[i];}
+    void Print(ostream *os); // Prints output content of this class
+    void Read(istream *is); // Reads output created by Print above.
+ private:
+    Int_t fNz; // Number of z sections
+    Double_t fPhi0,fDphi; // Starting phi angle and delta phi [degrees]
+    Double_t *fZ;    //[n] Z coordiantes
+    Double_t *fRmin; //[n] Inner radius
+    Double_t *fRmax; //[n] Outer radius
+
+    ClassDef(AliITSPConeData,1) // Poly Cone data class
+};
+// Input and output function for standard C++ input/output.
+ostream &operator<<(ostream &os,AliITSPConeData &source);
+istream &operator>>(istream &os,AliITSPConeData &source);
+
+
+#endif
+   
+
+#ifndef ALIITSPGONDATA_H
+#define ALIITSPGONDATA_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/////////////////////////////////////////////////////////////////////////
+//  Geant 3 Poly-Gon data structure.
+/////////////////////////////////////////////////////////////////////////
+#include <math.h> // for the definision of NAN.
+class TString;
+
+class AliITSPGonData : public AliITSBaseVolParams {
+ public:
+    AliITSPGonData() : AliITSBaseVolParams() // Default constructor
+       {fNz=0;fNphi=0;fPhi0=0.0;fDphi=0.0;fZ=0;fRmin=0;fRmax=0;}
+    AliITSPGonData(Int_t n) : AliITSBaseVolParams() // Standard constructor
+       {fNz=n;fNphi=0;fPhi0=0.0;fDphi=360.0;fZ=new Double_t[n];
+       fRmin=new Double_t[n];fRmax=new Double_t[n];}
+    AliITSPGonData(AliITSPGonData &source) // Copy constructor
+       { *this = source;}
+    virtual ~AliITSPGonData() // Standard destructor
+       {delete[] fZ;delete[] fRmin;delete[] fRmax;fNz=0;}
+    AliITSPGonData& operator=(AliITSPGonData &source) // Equals operator
+       {this->SetVid(source.GetVid());
+       this->SetName((source.GetName())->Data());
+       this->fNz = source.fNz;this->fNphi=source.fNphi;
+       this->fPhi0=source.fPhi0;this->fDphi=source.fDphi;
+       if(this->fZ!=0) delete[] this->fZ;
+       if(this->fRmin!=0) delete[] this->fRmin;
+       if(this->fRmax!=0) delete[] this->fRmax;
+       this->fZ=0;this->fRmin=0;this->fRmax=0;if(this->fNz<=0) return *this;
+       this->fZ=new Double_t[this->fNz];this->fRmin=new Double_t[this->fNz];
+       this->fRmax=new Double_t[this->fNz];for(Int_t i=0;i<this->fNz;i++){
+           this->fZ[i]=source.fZ[i];this->fRmin[i]=source.fRmin[i];
+           fRmax[i]=source.fRmax[i];}return *this;}
+    void Size(Int_t n)// Sets the number of Z,Rmin,Rmax parameters
+       {if(fZ!=0) delete fZ;if(fRmin!=0) delete fRmin;
+       if(fRmax!=0) delete fRmax; fNz=n;fPhi0=0.0;fDphi=360.0;
+       fZ=new Double_t[n];fRmin=new Double_t[n];fRmax=new Double_t[n];}
+    void Size(Int_t n,const char *c){//Sets the number of Z,Rmin, and Rmax
+       // parameters as well as the volume name.
+       Size(n);SetName(c);}
+    // Getters
+    Int_t NPhi() {return fNz;} // Returns fNphi
+    Int_t Nz() {return fNz;} // Returns fNz
+    Double_t Phi0(){return fPhi0;}// Return starting phi value
+    Double_t DPhi(){return fDphi;}// Return delta phi value
+    Double_t *Z(){return fZ;} // Returns array of z values
+    Double_t *Rmin() {return fRmin;} // Returm arrau of rmin values
+    Double_t *Rmax() {return fRmax;} // Returm arrau of rmax values
+    Double_t ZAt(Int_t i) // Return Z coordiante
+       {if(i<0||i>=fNz) return NAN;else return fZ[i];}
+    Double_t Rmin(Int_t i) // Return Inner radius value
+       {if(i<0||i>=fNz) return NAN;else return fRmin[i];}
+    Double_t Rmax(Int_t i) // Return Outer radius value
+       {if(i<0||i>=fNz) return NAN;else return fRmax[i];}
+    // Setters
+    void Nphi(Int_t i) {fNphi = i;} // Sets fNphi
+    Double_t& P0() // Returns the address of fPhi0
+       {return fPhi0;}
+    Double_t& dP() // Returns the address of fDphi
+       {return fDphi;}
+    Double_t& Z(Int_t i)// Returns address of fZ
+       {/*if(i<0||i>=fNz) return 0;*/return fZ[i];}
+    Double_t& Rn(Int_t i)// Returns address of fRmin
+       {/*if(i<0||i>=fNz) return 0;*/return fRmin[i];}
+    Double_t& Rx(Int_t i)// Returns address of fRmax
+       {/*if(i<0||i>=fNz) return 0;*/return fRmax[i];}
+    void Print(ostream *os); // Prints output content of this class
+    void Read(istream *is); // Reads output created by Print above.
+ private:
+    Int_t fNphi;  // Number of sections in phi.
+    Int_t fNz;    // Number of Z sections
+    Double_t fPhi0,fDphi; // Starting phi angle and delta phi [degrees]
+    Double_t *fZ;    //[n] Z coordiantes
+    Double_t *fRmin; //[n] Inner radius
+    Double_t *fRmax; //[n] Outer radius
+
+    ClassDef(AliITSPGonData,1) // Poly Gon Data Class
+};
+// Input and output function for standard C++ input/output.
+ostream &operator<<(ostream &os,AliITSPGonData &source);
+istream &operator>>(istream &os,AliITSPGonData &source);
+
+#endif
 #ifndef ALIITSBASEGEOMETRY_H
 #define ALIITSBASEGEOMETRY_H
 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 /////////////////////////////////////////////////////////////////////////
 //  A basic geometry class for the ITS simulation geometry stucture
 /////////////////////////////////////////////////////////////////////////
-
 #include <TObject.h>
-#include <TArrayI.h>
 #include "AliModule.h"
 class TString;
+class TVector3;
 
 class AliITSBaseGeometry : public TObject {
  public:
@@ -23,12 +283,13 @@ class AliITSBaseGeometry : public TObject {
     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
+     // Calls Geant3 interface geometry routines
+    virtual void CreateG3Geometry(){};
+    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
+    // Get Index for Geant3 v name
+    Int_t ITSG3VnameToIndex(const char name[3])const; 
+    Int_t 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);
@@ -40,72 +301,90 @@ class AliITSBaseGeometry : public TObject {
     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,
+    virtual void Box(const char *gnam,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,
+    virtual void Trapezoid1(const char *gnam,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,
+    virtual void Trapezoid2(const char *gnam,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,
+    virtual void Trapezoid(const char *gnam,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,
+    virtual void Tube(const char *gnam,const TString &dis,Double_t rmin,
               Double_t rmax,Double_t dz,Int_t med);
+    virtual void Tube(AliITSTubeData &d,Int_t med);
     // Tube segment.
-    void TubeSegment(const char gnam[3],const TString &dis,Double_t rmin,
+    virtual void TubeSegment(const char *gnam,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);
+    virtual void Cone(const char *gnam,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,
+    virtual void ConeSegment(const char *gnam,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,
+    virtual void Sphere(const char *gnam,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);
+    virtual void Parallelepiped(const char *gnam,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,
+    virtual void PolyGon(const char *gnam,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);
+    virtual void PolyGon(const char *gnam,const TString &dis,AliITSPGonData &d,
+                 Int_t med){PolyGon(gnam,dis,d.Phi0(),d.DPhi(),d.NPhi(),
+                                     d.Nz(),d.Z(),d.Rmin(),d.Rmax(),med);}
+    virtual void PolyGon(AliITSPGonData &d,Int_t med);
     //Poly-Cone
-    void PolyCone(const char gnam[3],const TString &dis,Double_t phi1,
+    virtual void PolyCone(const char *gnam,const TString &dis,Double_t phi1,
                   Double_t dphi,Int_t nz,Double_t *z,Double_t *rmin,
                   Double_t *rmax,Int_t med);
+    virtual void PolyCone(const char *gnam,const TString &dis,
+                         AliITSPConeData &d,
+                         Int_t med){PolyCone(gnam,dis,d.Phi0(),
+                                             d.DPhi(),d.Nz(),d.Z(),
+                                             d.Rmin(),d.Rmax(),med);}
+    virtual void PolyCone(AliITSPConeData &d,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);
+    virtual void TubeElliptical(const char *gnam,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);
+    virtual void HyperbolicTube(const char *gnam,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);
+    virtual void TwistedTrapezoid(const char *gnam,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,
+    virtual void CutTube(const char *gnam,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,
+    virtual void Pos(const char *vol,Int_t cn,const char *moth,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
+    // Position one volume inside another
+    virtual void Pos(AliITSBaseVolParams &v,Int_t cn,
+            AliITSBaseVolParams &m,TVector3 &t,Int_t irot);
+    Int_t GetMed(Int_t med){return (fits->GetIdtmed())->At(med);}
+    // 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
@@ -119,7 +398,7 @@ class AliITSBaseGeometry : public TObject {
     // 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);
+    void Element(Int_t imat,const char *name,Int_t z,Double_t den,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);
@@ -150,10 +429,15 @@ class AliITSBaseGeometry : public TObject {
     Double_t RadLength(Int_t iz,Double_t a); // Computes radiation length
                                              // for an element
  private:
+    void G3name(const char *gname,char *name)//Add's I to name and ending null
+       {for(Int_t i=0;i<3;i++) name[i+1] = gname[i];
+       name[0]='I';name[4]='\0';}
+    //
+ protected:
     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 fRe = 2.81794028e-13; //![cm]classical elect. radius
     static const Double_t fNa = 6.02214199e+23; //! [#/mole] Avogadro's number
     static Int_t *fidrot;
     static Int_t fidrotsize;
@@ -162,10 +446,10 @@ class AliITSBaseGeometry : public TObject {
     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/AliITSGeometryITSV.cxx b/ITS/AliITSGeometryITSV.cxx
new file mode 100644 (file)
index 0000000..a72ae1e
--- /dev/null
@@ -0,0 +1,261 @@
+/**************************************************************************
+ * 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 <AliRun.h>
+#include <AliITS.h>
+
+#include "AliITSGeometryITSV.h"
+
+ClassImp(AliITSGeometryITSV)
+
+//______________________________________________________________________
+AliITSGeometryITSV::AliITSGeometryITSV() : AliITSBaseGeometry(){
+    //Default Constructor for SSD Cone geometry
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+
+    SetScalemm();
+}
+//______________________________________________________________________
+AliITSGeometryITSV::AliITSGeometryITSV(AliITS *its,const char *moth):
+    AliITSBaseGeometry(its,0){
+    //Standard Constructor for SSD Cone geometry
+    // Inputs:
+    //   const char *moth, The volume name into which the ITS mother volume
+    //                     will reside.
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+
+    fAir = 5; // Air material number.
+
+    fA.Size(16,"ITS Mother Volume");
+    fA.SetVid(ITSG3VnameToIndex("ITSV")); // ITSV is a special name.
+    Double_t rlim  = 50.;
+    Double_t zmax  = 74.;
+    Double_t ztpc = 284.;
+    //
+    fA.P0() = 0.;
+    fA.dP() = 360.;
+    //
+    fA.Z(0)  = -ztpc-5.0-0.1;
+    fA.Rn(0) = 46.0;   
+    fA.Rx(0) = 85.0;
+    //
+    fA.Z(1) = -ztpc;
+    fA.Rn(1) = 46;   
+    fA.Rx(1) = 85.;
+    //
+    fA.Z(2) = -ztpc;
+    fA.Rn(2) = 46;  
+    fA.Rx(2) = rlim+6;
+    //
+    fA.Z(3) = -97.5;
+    fA.Rn(3) = 46;  
+    fA.Rx(3) = rlim+6;
+    //
+    fA.Z(4) = -zmax;
+    fA.Rn(4) = 46;  
+    fA.Rx(4) = rlim+6;
+    //
+    fA.Z(5) = -48;   
+    fA.Rn(5) = 6;
+    fA.Rx(5) = rlim+6;
+    //
+    fA.Z(6) = -28.6;   
+    fA.Rn(6) = 6;
+    fA.Rx(6) = rlim+6;
+    //
+    fA.Z(7) = -27.6;  
+    fA.Rn(7) = 3.295;
+    fA.Rx(7) = rlim+6; 
+    //
+    fA.Z(8) = 27.6;
+    fA.Rn(8) = 3.295;
+    fA.Rx(8) = rlim+6;
+    //
+    fA.Z(9) = 28.6;
+    fA.Rn(9) = 6;
+    fA.Rx(9) = rlim+6;
+    //
+    fA.Z(10) = 48;   
+    fA.Rn(10) = 6;
+    fA.Rx(10) = rlim+6;
+    //
+    fA.Z(11) = zmax;
+    fA.Rn(11) = 46;
+    fA.Rx(11) = rlim+6;
+    //
+    fA.Z(12) = 97.5;
+    fA.Rn(12) = 46;  
+    fA.Rx(12) = rlim+6;
+    //
+    fA.Z(13) = ztpc;
+    fA.Rn(13) = 62;     
+    fA.Rx(13) = 62+4.;
+    //
+    fA.Z(14) = ztpc;
+    fA.Rn(14) = 62;     
+    fA.Rx(14) = 85.;
+    //
+    fA.Z(15) = ztpc+4.+0.1;
+    fA.Rn(15) = 62.4;
+    fA.Rx(15) = 85.;
+}
+//______________________________________________________________________
+void AliITSGeometryITSV::CreateG3Geometry(){
+    // Calls Geant 3 geometry inilization routines with the information
+    // stored in this class.
+    // Inputs:
+    //    none.
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    PolyCone(fA,fAir);
+    return;
+}
+//______________________________________________________________________
+void AliITSGeometryITSV::PositionGeometry(const char *moth,Int_t cn,
+                                         TVector3 &t,Int_t irot){
+    // Positions the ITSV geometry in the way needed by Geant3.
+    // Inputs:
+    //   const char *moth, The volume name into which the ITS mother volume
+    //                     will reside.
+    //   Int_t copy        copy number.
+    //   TVector &t        Translection vector
+    //   Int_t   irot      Rotation matrix index number
+    // Outputs:
+    //    none.
+    // Return:
+    //    none.
+
+    gMC->Gspos("ITSV",1,moth,t.X(),t.Y(),t.Z(),irot,"ONLY");
+    return;
+}
+//______________________________________________________________________
+void AliITSGeometryITSV::CreateG3Materials(){
+    // Fills the Geant 3 banks with Material and Medium definisions.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Returns:
+    //   none.
+
+    // Dry Air = 78.084% N2, 20.946% O2, 0.934% Ar, 0.033% CO2 by Volume
+    // "Handbook of Chemistry and Physics" 60th eddition, CRC-Press (1980)
+    // page F-211. Others components <0.003% and measured in parts per 
+    // million.
+    Int_t i;
+    Int_t    Z[4]={6,7,8,18}; //C, N, O, Ar
+    Double_t W[4],f[4]={0.00033,0.78084,0.20946,0.00934};//C02,N2,O2,Ar by vol
+    Double_t T = 293.15; // 20 degrees C.
+    Double_t P = 760.0; // mm of Hg.
+    // op. cite, page  F-9.
+    Double_t dens = 1.2929*(273.13/T)*(P/760.0); // Density in grams/leter
+
+    dens *= 1.0E-3; // Convert 1 leter = 1E3 cm^3.
+    // Covert fraction of compounds by volume to graction of atoms by weight.
+    W[0] = GetA(Z[0])*f[0]; // C
+    W[1] = GetA(Z[1])*2.0*f[1]; // N
+    W[2] = GetA(Z[2])*2.0*(f[0]+f[2]); // O
+    W[3] = GetA(Z[3])*f[3];
+    // Renormilize the weights.
+    f[0] = 0.0;
+    for(i=0;i<4;i++) f[0] += W[i];
+    for(i=0;i<4;i++) W[i] /= f[0];
+    MixtureByWeight(fAir,"Dry Standard ITS Air",Z,W,dens,4,0);
+}
+//______________________________________________________________________
+void AliITSGeometryITSV::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.
+}
+
+//______________________________________________________________________
+void AliITSGeometryITSV::PolyCone(AliITSPConeData &d,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:
+    //    AliITSPConeData &d  Object with poly cone data stored in it.
+    //    Int_t    med        media index number.
+    // Output:
+    //    none.
+    // Return.
+    //    none.
+    Float_t *param;
+    Int_t n,i;
+
+    n = 3+3*d.Nz();
+    param = new Float_t[n];
+    param[0] = d.Phi0();
+    param[1] = d.DPhi();
+    param[2] = (Float_t) d.Nz();
+    for(i=0;i<d.Nz();i++){
+       param[3+3*i] = fScale*d.ZAt(i);
+       param[4+3*i] = fScale*d.Rmin(i);
+       param[5+3*i] = fScale*d.Rmax(i);
+    } // end for if
+    if(fVolName==0){ // must create array.
+       fVolNameSize = 38624;
+       fVolName = new TString[fVolNameSize];
+       fVolNameLast = 0;
+    } // end if
+    d.SetVid(ITSG3VnameToIndex("ITSV"));
+    fVolName[d.GetVid()] = (d.GetName())->Data();
+    gMC->Gsvolu("ITSV","PCON",GetMed(med),param,n);
+
+    delete[] param;
+}
+
diff --git a/ITS/AliITSGeometryITSV.h b/ITS/AliITSGeometryITSV.h
new file mode 100644 (file)
index 0000000..a113d5c
--- /dev/null
@@ -0,0 +1,38 @@
+#ifndef ALIITSGEOMETRYITSV_H
+#define ALIITSGEOMETRYITSV_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/*
+  ITS Mother volume for ITS Geometry v11.
+*/
+#include "AliITSBaseGeometry.h"
+class TVector3;
+class AliITS;
+class  AliITSGeometryITSV : public AliITSBaseGeometry {
+ public:
+    AliITSGeometryITSV();
+    AliITSGeometryITSV(AliITS *its,const char *moth);
+    virtual ~AliITSGeometryITSV(){};
+    void CreateG3Geometry();
+    void PositionGeometry(const char *moth,Int_t copy,TVector3 &t,
+                         Int_t irot=0);
+    void CreateG3Materials();
+    void BuildDisplayGeometry();
+    AliITSBaseVolParams& GetParams(){return fA;}// Returns parameters of
+    // this logical volume.
+    void PolyCone(AliITSPConeData &d,Int_t med); // Special version for this
+ private:
+    AliITSPConeData fA; // Poly-cone Volume A.
+    Int_t fAir; // ITS mother volume material number.
+
+    ClassDef(AliITSGeometryITSV,1)// ITS Mother Volume for Geometry v11.
+};
+#endif
+
diff --git a/ITS/AliITSGeometrySDDCone.cxx b/ITS/AliITSGeometrySDDCone.cxx
new file mode 100644 (file)
index 0000000..6bfb8bb
--- /dev/null
@@ -0,0 +1,119 @@
+/**************************************************************************
+ * 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 <AliITS.h>
+
+#include "AliITSGeometrySDDCone.h"
+
+ClassImp(AliITSGeometrySDDCone)
+
+//______________________________________________________________________
+AliITSGeometrySDDCone::AliITSGeometrySDDCone(){
+    //Default Constructor for SDD Cone geometry
+
+    SetScalemm();
+}
+//______________________________________________________________________
+AliITSGeometrySDDCone::AliITSGeometrySDDCone(AliITS *its,TVector3 *&tran,
+                                            const char moth[3],Int_t mat0):
+    AliITSBaseGeometry(its,0){
+    //Standard Constructor for SDD Cone geometry
+    // Inputs:
+    //   Double_t z0  Z-axis shift of this volume
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+}
+//______________________________________________________________________
+void AliITSGeometrySDDCone::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.
+
+    return;
+}
+//______________________________________________________________________
+void AliITSGeometrySDDCone::CreateG3Materials(){
+    // Fills the Geant 3 banks with Material and Medium definisions.
+    // Inputs:
+    //   none.
+    // Outputs:
+    //   none.
+    // Returns:
+    //   none.
+    Int_t Z[5];
+    Double_t W[5],dens;
+
+    Z[0] = 1; W[0] = 0.5; // Hydrogen Content
+    Z[1] = 6; W[1] = 0.5; // Carbon Content
+    MixtureByWeight(fSDDcf,"Carbon Fiber for SDD support cone",Z,W,dens,2,0);
+    Z[0] = 1; W[0] = 0.5; // Hydrogen Content
+    Z[1] = 6; W[1] = 0.5; // Carbon Content
+    MixtureByWeight(fSDDfs,"Inserto stealite 4411w for SDD support cone",
+                   Z,W,dens,2,0);
+    Z[0] = 1; W[0] = 0.5; // Hydrogen Content
+    Z[1] = 6; W[1] = 0.5; // Carbon Content
+    MixtureByWeight(fSDDfo,"Foam core (Rohacell 50A) for SDD support cone",
+                   Z,W,dens,2,0);
+    Z[0] =  6; W[0] = 0.5; // Carbon Content
+    Z[1] = 25; W[1] = 0.5; // Iron Content
+    MixtureByWeight(fSDDsw,"Stainless steal screw, pin, and stud material",
+                   Z,W,dens,2,0);
+}
+//______________________________________________________________________
+void AliITSGeometrySDDCone::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/AliITSGeometrySDDCone.h b/ITS/AliITSGeometrySDDCone.h
new file mode 100644 (file)
index 0000000..361cf1d
--- /dev/null
@@ -0,0 +1,80 @@
+#ifndef ALIITSGEOMETRYSDDCONE_H
+#define ALIITSGEOMETRYSDDCONE_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+/*
+  $Id$
+ */
+
+/*
+  ITS SDD Cone Geometry. Version 11
+*/
+#include "AliITSBaseGeometry.h"
+class TVector3;
+class AliITS;
+class  AliITSGeometrySDDCone : public AliITSBaseGeometry {
+ public:
+    AliITSGeometrySDDCone();
+    AliITSGeometrySDDCone(AliITS *its,TVector3 *&tran,const char moth[3],Int_t mat0);
+    virtual ~AliITSGeometrySDDCone(){};
+    void CreateG3Geometry(const char moth[3],TVector3 &trans);
+    void CreateG3Materials();
+    void BuildDisplayGeometry();
+ private:
+    Double_t fThickness; //mm, Thickness of Rohacell+carbon fiber
+    Double_t fCthick; //mm, Carbon finber thickness
+    Double_t fRcurv; // mm, Radius of curvature.
+    Double_t fTc; // angle of SSD cone [degrees].
+    Double_t fSintc,fCostc,fTantc;
+    Double_t fZ0,fZouterMilled,fZcylinder,fZposts;
+    Double_t fRoutMax,fRoutHole,fRoutMin;
+    Double_t fRholeMax,fRholeMin;
+    Double_t fRpostMin,fdRpost,fZpostMax,fPhi0Post;
+    Double_t fRinMax,fRinCylinder,fRinHole,fRinMin,fdZin;
+    // Screws mounting SSD-SDD thermal/machanical cylinder
+    Double_t fPhi0Screws,fRcylinderScrews,fDscrewHead;
+    Double_t fDscrewShaft,fThScrewHeadHole;
+    // The SDD mounting bracket SSD part of it.
+    Int_t fNssdSupports;
+    Double_t fPhi0SDDsupports;
+    Double_t fRsddSupportPlate,fThSDDsupportPlate,fWsddSupportPlate;
+    Int_t fNspoaks,fNinScrews,fNposts,fNmounts;
+    Int_t fSDDcf; // SSD support cone Carbon Fiber materal number.
+    Int_t fSDDfs; // SSD support cone inserto stesalite 4411w.
+    Int_t fSDDfo; // SSD support cone foam, Rohacell 50A.
+    Int_t fSDDsw; // SSD support cone screw material,Stainless steal
+    Int_t fNcse; // number of screw ends (copy number)
+    Int_t fNcpe; // number of pin end (copy number)
+    Int_t fNcst; // number of screw tops (copy number)
+    AliITSPConeData fA;//Poly-cone Volume A.
+    AliITSPConeData fB; // Poly-cone Volume B.
+    AliITSPConeData fC; // Poly-cone Volume C.
+    Double_t fDdZ,fDRmin,fDRmax; // Tube Volume D.
+    Double_t fEdZ,fERmin,fERmax; // Tube Volume E.
+    AliITSPConeData fF;//Poly-cone Volume F.
+    // SSD support cone Spoaks.
+    AliITSPConeData fG; // Poly-cone Volume G.
+    AliITSPConeData fH; // Poly-cone Volume H.
+    AliITSPConeData fI; // Poly-cone Volume I.
+    AliITSPConeData fJ; // Poly-cone Volume J.
+    AliITSPConeData fK; // Poly-cone Volume K.
+    AliITSPConeData fL; // Poly-cone Volume L.
+    AliITSPConeData fM; // Poly-cone Volume M.
+    AliITSPConeData fN; // Poly-cone Volume N.
+    AliITSPConeData fO; // Poly-cone Volume O.
+    AliITSPConeData fP; // Poly-cone Volume P.
+    AliITSPConeData fQ; // Poly-cone Volume Q.
+    Double_t fRdZ,fRRmin,fRRmax; // Tube Volume R
+    Double_t fSdZ,fSRmin,fSRmax; // Tube Volume S
+    AliITSPConeData fT; // Poly-cone Volume T.
+    AliITSPConeData fU; // Poly-cone Volume U.
+    
+
+    ClassDef(AliITSGeometrySDDCone,1) // ITS SDD support cone geometry
+                                     // version 1
+};
+#endif
+
index e6f5c355a321f772afc0d0edd1db787df2f923fd..d9190be7339ebc27f7282518df97b5eee78aaafb 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.1  2003/02/10 17:03:52  nilsen
+New version and structure of ITS V11 geometry. Work still in progress.
+
 $Id$
 */
 
@@ -36,20 +39,23 @@ $Id$
 #include <TBRIK.h>
 #include <TSystem.h>
 #include <TVector3.h>
+#include <AliRun.h>
+#include <AliITS.h>
 
 #include "AliITSGeometrySSDCone.h"
 
 ClassImp(AliITSGeometrySSDCone)
 
 //______________________________________________________________________
-AliITSGeometrySSDCone::AliITSGeometrySSDCone(){
+AliITSGeometrySSDCone::AliITSGeometrySSDCone() : AliITSBaseGeometry(){
     //Default Constructor for SSD Cone geometry
 
     SetScalemm();
 }
 //______________________________________________________________________
-AliITSGeometrySSDCone::AliITSGeometrySSDCone(TVector3 *&tran,
-                                            const char moth[3],Int_t mat0){
+AliITSGeometrySSDCone::AliITSGeometrySSDCone(AliITS *its,TVector3 &tran,
+                                            const char *moth,Int_t mat0):
+    AliITSBaseGeometry(its,0){
     //Standard Constructor for SSD Cone geometry
     // Inputs:
     //   Double_t z0  Z-axis shift of this volume
@@ -58,322 +64,407 @@ AliITSGeometrySSDCone::AliITSGeometrySSDCone(TVector3 *&tran,
     // Return:
     //   none.
     Double_t t; // some general angle and coordinates [degrees].
+    Double_t Z,Rmin,Rmax; // additional point not needed in call to pcons.
 
-    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)
+    fThickness = 13.0; //mm, Thickness of Rohacell+carbon fiber
+    fCthick=1.5; //mm, Carbon finber thickness
+    fRcurv=15.0; // mm, Radius of curvature.
+    fTc=51.0; // angle of SSD cone [degrees].
+    fSintc=Sind(fTc);fCostc=Cosd(fTc);fTantc=Tand(fTc);
+    fZ0=0.0;fZouterMilled=13.5-5.0;fZcylinder=170.0;fZposts=196.0;
+    fNspoaks=12;fNposts=4;fNmounts=4;
+    fRoutMax=0.5*985.0;fRoutHole=0.5*965.0;fRoutMin=0.5*945.0;
+    fRholeMax=0.5*890.0;fRholeMin=0.5*740.0;
+    fRpostMin=316.0;fdRpost=23.0;fZpostMax=196.0;fPhi0Post=30.0;
+    fRinMax=0.5*590.0;fRinCylinder=0.5*597.0;fRinHole=0.5*575.0;
+    fRinMin=0.5*562.0;fdZin=15.0;
+    // SSD-SDD Thermal/Mechanical cylinder mounts
+    fNinScrews=40;
+    fPhi0Screws=0.5*360.0/((Double_t)fNinScrews);fRcylinderScrews= 0.5*570.0;
+    fDscrewHead=8.0;fDscrewShaft=4.6;fThScrewHeadHole=8.5;
+    // SDD mounting bracket, SSD part
+    fNssdSupports=3;fPhi0SDDsupports=90.0;
+    fRsddSupportPlate = 0.5*585.0;fThSDDsupportPlate=4.0;
+    fWsddSupportPlate = 70.0;
+    fSSDcf=26; // SSD support cone Carbon Fiber materal number.
+    fSSDfs=25; // SSD support cone inserto stesalite 4411w.
+    fSSDfo=68; // SSD support cone foam, Rohacell 50A.
+    fSSDsw=14; // SSD support cone screw material,Stainless steal
+    fNcD=0; // number of screw ends (copy number)
+    fNcE=0; // number of pin end (copy number)
 
     SetScalemm();
+    // Poly-cone Volume A. Top part of SSD cone Carbon Fiber.
+    fA.Size(7,"SSD Suport cone Carbon Fiber Surface outer left");
+     // Poly-cone Volume B. Stesalite inside volume A.
+    fB.Size(6,"SSD Suport cone Inserto Stesalite left edge");
+    // Poly-cone Volume C. Foam inside volume A.
+    fC.Size(4,"SSD Suport cone Rohacell foam left edge");
+    fD.SetName("Screw+stud used to mount things to the SSD support cone");
+    fE.SetName("pin used to mount things to the SSD support cone");
+    // Poly-cone Volume F. Foam in spoak reagion, inside volume A.
+    fF.Size(4,"SSD Top Suport cone Rohacell foam Spoak");
+    fG.Size(4,"SSD spoak carbon fiber surfaces"); // Poly-cone Volume G.
+    fH.Size(4,"SSD support cone Rohacell foam Spoak"); // Poly-cone Volume H.
+    fI.Size(9,"SSD lower/inner right part of SSD cone"); //Poly-cone Volume I.
+    fJ.Size(4,"SSD inner most foam core"); // Poly-cone Volume J.
+    fK.Size(7,"SSD inner most inserto material"); // Poly-cone Volume K.
+    fL.Size(4,"SSD Bottom cone Rohacell foam Spoak"); // Poly-cone Volume L.
+    fM.Size(4,"SSD mounting post foam substitute, Inserto");//Poly-cone Vol. M
+    fN.Size(4,"SSD mounting post CF subsititute, Inserto");//Poly-cone Vol. N
+    fO.Size(3,"SSD mounting post, carbon fiber"); // Poly-cone Volume O.
+    fP.Size(3,"SSD mounting post, Inserto"); // Poly-cone Volume P.
+    fQ.Size(4,"SSD Thermal sheal stainless steel bolts");//Poly-cone Volume Q.
+    fR.SetName("Air in front of bolt (in stasolit)");
+    fS.SetName("Air in front of Stainless Steal Screw end, N6");
+    fT.Size(2,"SSD-SDD mounting bracket Inserto-> Al."); //Poly-cone Volume T.
+    fU.Size(4,"SSD-SDD mounting bracket CF->Al."); // Poly-cone Volume U.
     // 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
+    // given by rmaxa = rmaxa[2]-r*Sind(t) for 0<=t<=fTc and 
+    // za = za[2] + r*Cosd(t) for 0<=t<=fTc. 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
+    // rmina = rmina[1]-r*Sind(t) for 0<=t<=fTc and za = za[1]+r&Sind(t)
+    // for t<=0<=fTc. These curves have been replaced by straight lines
     // between the equivelent points for simplicity.
-    Double_t dza = th/sintc-(Routmax-Routmin)/tantc;
+    Double_t dza = fThickness/fSintc-(fRoutMax-fRoutMin)/fTantc;
     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]);
+    fA.P0() = 0.0;
+    fA.dP() = 360.0;
+    fA.Z(0) = fZ0;
+    fA.Rn(0) = fRoutMin;
+    fA.Rx(0) = fRoutMax;
+    fA.Z(1)  = fA.ZAt(0)+fZouterMilled - dza; // za[2] - dza.
+    fA.Rn(1) = fA.Rmin(0);
+    fA.Rx(1) = fA.Rmax(0);
+    fA.Z(2)  = fA.ZAt(0)+fZouterMilled; //From Drawing ALR-0767 and ALR-0767/3
+    fA.Rx(2) = fA.Rmax(0);
+    RadiusOfCurvature(fRcurv,0.0,fA.ZAt(1),fA.Rmin(1),fTc,fA.Z(3),fA.Rn(3));
+    fA.Rn(2) = RminFrom2Points(fA,3,1,fA.ZAt(2));
+    RadiusOfCurvature(fRcurv,0.0,fA.ZAt(2),fA.Rmax(2),fTc,fA.Z(4),fA.Rx(4));
+    fA.Rn(4) = RminFromZSSDcone(fA.ZAt(4));
+    fA.Rx(3) = RmaxFrom2Points(fA,4,2,fA.ZAt(3));
+    fA.Rn(5) = fRholeMax;
+    fA.Z(5)  = Zfrom2MinPoints(fA,4,3,fA.Rmin(5));
+    fA.Rx(5) = RmaxFromZSSDcone(fA.ZAt(5));
+    fA.Rn(6) = fRholeMax;
+    fA.Rx(6) = fA.Rmin(6);
+    fA.Z(6)  = ZFromRmaxSSDcone(fA.Rmax(6));
     //
     // 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]);
+    fB.P0() = 0.0;
+    fB.dP() = 360.0;
+    fB.Z(0) = fA.ZAt(0);
+    fB.Rn(0) = fA.Rmin(0)+fCthick;
+    fB.Rx(0) = fA.Rmax(0)-fCthick;
+    fB.Z(1)  = fA.ZAt(1);
+    fB.Rn(1) = fB.Rmin(0);
+    fB.Rx(1) = fB.Rmax(0);
+    fB.Z(2)  = fA.ZAt(2);
+    fB.Rx(2) = fB.Rmax(1);
+    RadiusOfCurvature(fRcurv-fCthick,0.,fB.ZAt(2),fB.Rmax(2),
+                                   fTc,fB.Z(3),fB.Rx(3));
+    RadiusOfCurvature(fRcurv+fCthick,0.,fB.ZAt(1),fB.Rmin(1),
+                                   fTc,fB.Z(4),fB.Rn(4));
+    fB.Rn(2) = RminFrom2Points(fB,4,1,fB.ZAt(2));
+    fB.Rn(3) = RminFrom2Points(fB,4,1,fB.ZAt(3));
+    fB.Z(5)  = fB.ZAt(4)+(fThickness-2.0*fCthick)/fSintc;
+    fB.Rn(5) = RmaxFromZSSDcone(fB.ZAt(5),-fCthick);
+    fB.Rx(5) = fB.Rmin(5);
+    fB.Rx(4) = RmaxFrom2Points(fB,5,3,fB.ZAt(4));
     //
     // 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]);
+    fC.P0() = 0.0;
+    fC.dP() = 360.0;
+    fC.Z(0) = fB.ZAt(4);
+    fC.Rn(0) = fB.Rmin(4);
+    fC.Rx(0) = fC.Rmin(0);
+    fC.Z(1)  = fB.ZAt(5);
+    fC.Rx(1) = fB.Rmin(5);
+    fC.Rn(2) = fA.Rmin(5)+fCthick;//leave space for carbon fiber covering hole
+    fC.Z(2)  = ZFromRminSSDcone(fC.Rn(2),+fCthick);
+    fC.Rn(1) = RminFrom2Points(fC,2,0,fC.ZAt(1));
+    fC.Rx(3) = fA.Rmin(6)+fCthick;
+    fC.Rn(3) = fC.Rmax(3);
+    fC.Z(3)  = ZFromRmaxSSDcone(fC.Rx(3),-fCthick);
+    fC.Rx(2) = RmaxFrom2Points(fC,3,1,fC.ZAt(2));
     //
     // 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
+    fD.Rn()=0.0,fD.Rx()=6.0,fD.Z()=0.5*10.0; // mm
+    fE.Rn()=0.0;fE.Rx()=6.0;fE.Z()=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
+    t = fCthick/(0.5*(fRholeMax+fRholeMin));// 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];
+    fF.P0()  = 12.5+t; // degrees see drawing ALR-0767.
+    fF.dP()  = 5.0 - 2.0*t; // degrees
+    fF.Z(0)  = fC.ZAt(2);
+    fF.Rn(0) = fC.Rmin(3);
+    fF.Rx(0) = fF.Rmin(0);
+    fF.Rn(1) = fA.Rmin(5);
+    fF.Rx(1) = fF.Rmin(0);
+    fF.Z(1)  = RminFromZSSDcone(fF.ZAt(1),+fCthick);
+    fF.Z(2)  = fC.ZAt(3);
+    fF.Rn(2) = fF.Rmin(1);
+    fF.Rx(2) = fF.Rmax(1);
+    fF.Rn(3) = fA.Rmin(6);
+    fF.Rx(3) = fF.Rmin(3);
+    fF.Z(3)  = ZFromRmaxSSDcone(fF.Rmax(3),-fCthick);
     //=================================================================
     // 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) 
+    // R = Rmax - (5mm)*Sin(t) phi = phi0+(5mm*180/(Pi*fRoutHole))*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;
+    fG.P0()  = 12.5; // degrees see drawing ALR-0767.
+    fG.dP()  = 5.0; // degrees
+    fG.Z(0)  = fA.ZAt(5);
+    fG.Rn(0) = fA.Rmin(5);
+    fG.Rx(0) = fG.Rn(0);
+    fG.Z(1)  = fA.ZAt(6);
+    fG.Rn(1) = RminFromZSSDcone(fG.ZAt(1));
+    fG.Rx(1) = fG.Rmax(0);
+    fG.Rn(2) = fRholeMin;
+    fG.Z(2)  = ZFromRminSSDcone(fG.Rmin(2));
+    fG.Rx(2) = RmaxFromZSSDcone(fG.ZAt(2));
+    fG.Rn(3) = fG.Rmin(2);
+    fG.Rx(3) = fG.Rmin(3);
+    fG.Z(3)  = ZFromRmaxSSDcone(fG.Rmax(3));
     // For the foam core.
-    t = ct/(0.5*(Rholemax+Rholemin));// It is not posible to get the
+    t = fCthick/(0.5*(fRholeMax+fRholeMin));// 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];
+    fH.P0()  = 5.0 - 2.0*t; // degrees
+    fH.dP()  = 12.5+t; // degrees see drawing ALR-0767.
+    fH.Z(0)  = fF.ZAt(1);
+    fH.Rn(0) = fG.Rmin(0);
+    fH.Rx(0) = fH.Rmin(0);
+    fH.Z(1)  = fF.ZAt(3);
+    fH.Rn(1) = RminFromZSSDcone(fH.Z(1),-fCthick);
+    fH.Rx(1) = fH.Rmax(0);
+    fH.Z(2)  = ZFromRminSSDcone(fG.Rmin(2),+fCthick);
+    fH.Rn(2) = fG.Rmin(2);
+    fH.Rx(2) = RmaxFromZSSDcone(fH.Z(2),-fCthick);
+    fH.Z(3)  = ZFromRmaxSSDcone(fG.Rmin(3),-fCthick);
+    fH.Rn(3) = fG.Rmin(3);
+    fH.Rx(3) = fH.Rn(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]);
+    fI.P0()  = 0.0;
+    fI.dP()  = 360.0;
+    fI.Z(0)  = fG.ZAt(2);
+    fI.Rn(0) = fG.Rmin(2);
+    fI.Rx(0) = fI.Rmin(0);
+    fI.Z(1)  = fG.ZAt(3);
+    fI.Rn(1) = RminFromZSSDcone(fI.ZAt(1));
+    fI.Rx(1) = fI.Rmax(0);
+    fI.Rn(4) = fRinMin;
+    fI.Rn(5) = fRinMin;
+    RadiusOfCurvature(fRcurv,90.0,0.0,fRinMin,90.0-fTc,Z,fI.Rx(5)); // z dummy
+    fI.Z(5)  = ZFromRmaxSSDcone(fI.Rx(5));
+    fI.Z(6)  = fZcylinder;
+    fI.Rn(6) = fRinMin;
+    fI.Z(7)  = fI.Z(6);
+    fI.Rn(7) = fRinCylinder;
+    fI.Rn(8) = fRinCylinder;
+    fI.Rx(8) = fI.Rmin(8);
+    Rmin = fI.Rmin(5);
+    RadiusOfCurvature(fRcurv,90.0-fTc,fI.Z(5),fI.Rmax(5),90.0,Z,Rmax);
+    Rmax = fRinMax;
+    fI.Z(8)  = Z+(fI.ZAt(5)-Z)*(fI.Rmax(8)-Rmax)/(fI.Rmax(7)-Rmax);
+    fI.Rx(6) = RmaxFrom2Points(fI,8,5,fI.ZAt(6));
+    fI.Rx(7) = fI.Rmax(6);
+    fI.Z(3)  = Z-fdZin;
+    fI.Z(4)  = fI.ZAt(3);
+    fI.Rx(3) = RmaxFromZSSDcone(fI.ZAt(3));
+    fI.Rx(4) = fI.Rx(3);
+    //rmin dummy
+    RadiusOfCurvature(fRcurv,90.,fI.ZAt(3),0.,90.-fTc,fI.Z(2),Rmin);
+    fI.Rn(2) = RminFromZSSDcone(fI.ZAt(2));
+    fI.Rx(2) = RmaxFromZSSDcone(fI.ZAt(2));
+    // z dummy
+    RadiusOfCurvature(fRcurv,90.-fTc,0.0,fI.Rmin(2),90.0,Z,fI.Rn(3)); 
     // 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];
+    fK.P0()  = 0.0;
+    fK.dP()  = 360.0;
+    fK.Z(1)  = fI.ZAt(3)+fCthick;
+    fK.Rn(1) = fI.Rmin(3);
+    fK.Z(2)  = fK.ZAt(1);
+    fK.Rn(2) = fI.Rmin(4);
+    fK.Rn(3) = fK.Rmin(2);
+    fK.Rn(4) = fK.Rmin(2);
+    fK.Rn(5) = fK.Rmin(2);
+    fK.Rx(5) = fI.Rmin(8);
+    fK.Z(6)  = fI.ZAt(6);
+    fK.Rn(6) = fI.Rmin(6);
+    fK.Rx(6) = fI.Rmin(7);
+    RadiusOfCurvature(fRcurv+fCthick,90.0,fK.ZAt(1),fK.Rmin(1),
+                               90.0-fTc,fK.Z(0),fK.Rn(0));
+    fK.Rx(0) = fK.Rmin(0);
+    fK.Z(3)  = fK.ZAt(0)+(fThickness+2.0*fCthick)*fCostc;;
+    fK.Rx(3) = fK.Rmax(0)+(fThickness+2.0*fCthick)*fSintc;
+    fK.Rx(1) = RmaxFrom2Points(fK,3,0,fK.ZAt(1));
+    fK.Rx(2) = fK.Rmax(1);
+    fK.Rx(4) = fI.Rmax(5)-fCthick*fSintc;
+    fK.Z(4)  = ZFromRmaxSSDcone(fK.Rmax(4),-fCthick);
+    fK.Z(5)  = fI.ZAt(5)-fRcurv*fCostc-fCthick;
     // 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];
+    fJ.P0() = 0.0;
+    fJ.dP() = 360.0;
+    fJ.Rn(0) = fI.Rmin(0)-fCthick;
+    fJ.Z(0)  = ZFromRminSSDcone(fJ.Rmin(0),+fCthick);
+    fJ.Rx(0) = fJ.Rmin(0);
+    fJ.Rx(1) = fJ.Rmax(0);
+    fJ.Z(1)  = ZFromRmaxSSDcone(fJ.Rmax(1),-fCthick);
+    fJ.Rn(1) = RminFromZSSDcone(fJ.ZAt(1),-fCthick);
+    fJ.Z(2)  = fK.ZAt(0);
+    fJ.Rn(2) = fK.Rmin(0);
+    fJ.Rx(2) = RmaxFromZSSDcone(fJ.ZAt(2),-fCthick);
+    fJ.Z(3)  = fK.ZAt(3);
+    fJ.Rn(3) = fK.Rmax(3);
+    fJ.Rx(3) = fJ.Rmin(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
+    t = fCthick/(0.5*(fRholeMax+fRholeMin));// 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];
+    fL.P0() = 5.0 - 2.0*t; // degrees
+    fL.dP() = 12.5+t; // degrees see drawing ALR-0767.
+    fL.Z(0) = fH.ZAt(2);
+    fL.Rn(0) = fI.Rmin(0);
+    fL.Rx(0) = fL.Rmin(0);
+    fL.Z(1)  = fJ.ZAt(0);
+    fL.Rn(1) = fJ.Rmin(1);
+    fL.Rx(1) = fI.Rmax(1);
+    fL.Z(2)  = fH.ZAt(3);
+    fL.Rn(2) = fL.Rmin(1);
+    fL.Rx(2) = fL.Rmax(1);
+    fL.Z(3)  = fJ.ZAt(1);
+    fL.Rn(3) = fL.Rmin(2);
+    fL.Rx(3) = fL.Rmin(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;
+    fO.P0()  = 180.0*fdRpost/(fRpostMin+0.5*fdRpost)/TMath::Pi(); // degrees
+    fO.dP()  = fPhi0Post; //
+    fO.Rn(0) = fRpostMin+fdRpost;
+    fO.Rx(0) = fO.Rmin(0);
+    fO.Z(0)  = ZFromRmaxSSDcone(fO.Rmax(0));
+    fO.Rn(1) = fRpostMin;
+    fO.Z(1)  = ZFromRmaxSSDcone(fO.Rmin(1));
+    fO.Rx(1) = fO.Rmax(0);
+    fO.Z(2)  = fZ0+fZpostMax;
+    fO.Rn(2) = fRpostMin;
+    fO.Rx(2) = fO.Rmin(2)+fdRpost;
     // 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;
+    t = 180.0*fCthick/(fRpostMin+0.5*fdRpost)/TMath::Pi();
+    fP.dP()  = fO.DPhi()-2.0*t; // degrees
+    fP.P0()  = fO.Phi0()+t; //
+    fP.Rn(0) = fO.Rmin(0)-fCthick;
+    fP.Rx(0) = fP.Rmin(0);
+    fP.Z(0)  = ZFromRmaxSSDcone(fP.Rmax(0));
+    fP.Rn(1) = fO.Rmin(0)+fCthick;
+    fP.Rx(1) = fO.Rmin(0)-fCthick;
+    fP.Z(1)  = ZFromRminSSDcone(fP.Rmin(1));
+    fP.Rn(2) = fP.Rmin(1);
+    fP.Rx(2) = fP.Rmax(1);
+    fP.Z(2)  = fZ0+fZpostMax;
     // 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;
+    fM.P0()  = fP.Phi0();
+    fM.dP()  = fP.DPhi();
+    fM.Rn(0) = fRpostMin+fdRpost-fCthick;
+    fM.Rx(0) = fM.Rmin(0);
+    fM.Z(0)  = ZFromRminSSDcone(fM.Rmin(0),+fCthick);
+    fM.Rx(1) = fM.Rmax(0);
+    fM.Z(1)  = ZFromRmaxSSDcone(fM.Rmax(1),-fCthick);
+    fM.Rn(1) = RminFromZSSDcone(fM.ZAt(1),+fCthick);
+    fM.Rn(2) = fRpostMin+fCthick;
+    fM.Z(2)  = ZFromRminSSDcone(fM.Rmin(2),+fCthick);
+    fM.Rx(2) = RmaxFromZSSDcone(fM.ZAt(2),-fCthick);
+    fM.Rn(3) = fM.Rmin(2);
+    fM.Rx(3) = fM.Rmin(3);
+    fM.Z(3)  = ZFromRmaxSSDcone(fM.Rmax(3),-fCthick);
+    //
+    fN.P0()  = fP.Phi0();
+    fN.dP()  = fP.DPhi();
+    fN.Z(0)  = fM.ZAt(1);
+    fN.Rn(0) = fM.Rmax(1);
+    fN.Rx(0) = fN.Rmin(0);
+    fN.Rx(1) = fN.Rmax(0);
+    fN.Z(1)  = ZFromRmaxSSDcone(fN.Rmax(1));
+    fN.Rn(1) = RminFromZSSDcone(fN.ZAt(1),-fCthick);
+    fN.Z(2)  = fM.ZAt(3);
+    fN.Rn(2) = fM.Rmin(3);
+    fN.Rx(2) = RmaxFromZSSDcone(fN.ZAt(2));
+    fN.Rn(3) = fN.Rmin(2);
+    fN.Rx(3) = fN.Rmin(3);
+    fN.Z(3)  = ZFromRmaxSSDcone(fN.Rmax(3));
+    // Bolt heads holding the SSD-SDD tube to the SSD cone.
+    // Bolt -- PolyCone
+    fQ.P0()  = 0.0;
+    fQ.dP()  = 360.0;
+    fQ.Z(0)  = fI.ZAt(4)-fThSDDsupportPlate;
+    fQ.Rn(0) = 0.0;
+    fQ.Rx(0) = 0.5*fDscrewHead;
+    fQ.Z(1)  = fI.ZAt(4)-fThScrewHeadHole;
+    fQ.Rn(1) = 0.0;
+    fQ.Rx(1) = 0.5*fDscrewHead;
+    fQ.Z(2)  = fQ.ZAt(1);
+    fQ.Rn(2) = 0.0;
+    fQ.Rx(2) = 0.5*fDscrewShaft;
+    fQ.Z(3)  = fQ.ZAt(2);
+    fQ.Rn(3) = 0.0;
+    fQ.Rx(3) = fQ.Rmax(2);
+    // air infront of bolt (stasolit Volume K) -- Tube
+    fR.Z() = 0.5*(fThickness-fThScrewHeadHole);
+    fR.Rn() = 0.0;
+    fR.Rx() = 0.5*fDscrewHead;
+    // air infront of bolt (carbon fiber volume I) -- Tube
+    fS.Z() = 0.5*fThickness;
+    fS.Rn() = 0.0;
+    fS.Rx() = fR.Rmax();
+    // SDD support plate, SSD side.
+    fT.dP()  = 180.0*fWsddSupportPlate/(fRsddSupportPlate*TMath::Pi());
+    fT.P0()  = fPhi0SDDsupports=90.0;
+    fT.Z(0)  = fK.ZAt(2);
+    fT.Rn(0) = fI.Rmin(4);
+    fT.Rx(0) = fRsddSupportPlate;
+    fT.Z(1)  = fI.ZAt(4) - fThSDDsupportPlate;
+    fT.Rn(1) = fT.Rmin(0);
+    fT.Rx(1) = fT.Rmax(0);
+    //
+    fU.dP() = fT.DPhi();
+    fU.P0() = fT.Phi0();
+    fU.Z(2) = fI.ZAt(4);
+    fU.Rn(2) = fT.Rmin(0);
+    fU.Rx(2) = fT.Rmax(0);
+    fU.Z(3)  = fT.ZAt(0);
+    fU.Rn(3) = fU.Rmin(2);
+    fU.Rx(3) = fU.Rmax(2);
+    fU.Z(1)  = fU.ZAt(2);
+    fU.Rn(1) = fI.Rmin(3);
+    fU.Rx(1) = fU.Rmax(3);
+    fU.Rx(0) = fT.Rmax(0);
+    fU.Rn(0) = fU.Rmax(0);
+    fU.Z(0)  = Zfrom2MinPoints(fI,2,3,fU.Rmax(0));
+    // Debuging
+    Print(&cout);
 }
 //______________________________________________________________________
-void AliITSGeometrySSDCone::CreateG3Geometry(const char moth[3],
+void AliITSGeometrySSDCone::CreateG3Geometry(const char *moth,
                                             TVector3 &trans){
     // Calls Geant 3 geometry inilization routines with the information
     // stored in this class.
@@ -384,130 +475,155 @@ void AliITSGeometrySSDCone::CreateG3Geometry(const char moth[3],
     // 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);
+    PolyCone(fA,fSSDcf);
+    PolyCone(fB,fSSDfs);
+    PolyCone(fC,fSSDfo);
+    Tube(fD,fSSDsw);
+    Tube(fE,fSSDsw);
+    PolyCone(fF,fSSDfo);
+    PolyCone(fG,fSSDcf);
+    PolyCone(fH,fSSDfo);
+    PolyCone(fI,fSSDcf);
+    PolyCone(fJ,fSSDfo);
+    PolyCone(fK,fSSDfs);
+    PolyCone(fL,fSSDfo);
+    PolyCone(fM,fSSDfo);
+    PolyCone(fN,fSSDfo);
+    PolyCone(fO,fSSDcf);
+    PolyCone(fP,fSSDfs);
+    PolyCone(fQ,fSSDfo);
+    Tube(fR,fSSDsw);
+    Tube(fS,fSSDsw);
+    PolyCone(fT,fSSDfo);
+    PolyCone(fU,fSSDfo);
+    return;
+}
+//______________________________________________________________________
+void AliITSGeometrySSDCone::PositionG3Geometry(AliITSBaseVolParams &moth,
+                                              Int_t cn,TVector3 &trans,
+                                              Int_t irot){
+    // Positions ths whole object at t with rotatin irot coply number cn
+    // into volume moth.
+    // Inputs:
+    //   const AliITSBaseVolParams *moth   Mother volume where this object 
+    //                                     is to be placed.
+    //   Int_t      cn      Copy number.
+    //   TVector3   &t      Translation vector for this whole volume
+    //   Int_t      irot    rotation matrix number to be applyed to this
+    //                      volume.
+    // Output:
+    //   none.
+    // Return:
+    //   none.
+    Int_t i,j,k,l,irotSpoaks,irotPost;
+    Double_t t;
+    Bool_t init=kFALSE;
+    TVector3 zero(0.0,0.0,0.0),v(0.0,0.0,0.0);
+
+    if(cn<=0) return;
+    if(cn==1) init=kTRUE;
+    Pos(fA,cn,moth,trans,0);
+    Pos(fI,cn,moth,trans,0);
+    Pos(fG,fNspoaks*(cn-1)+1,fA,trans,0);
+    irotSpoaks = irot;
+    j = 0;
+    for(i=fNspoaks*(cn-1)+2;i<fNspoaks*cn+1;i++){
+       ZMatrix(++irot,((Double_t)j)*360./((Double_t)fNspoaks));
+       Pos(fG,i,fA,trans,irot);
+       j++;
+    } // end for i
+    Pos(fO,fNposts*(cn-1)+1,moth,trans,0);
+    irotPost = irot;
+    j = 0;
+    for(i=fNposts*(cn-1)+2;i<fNposts*cn+1;i++){
+       ZMatrix(++irot,((Double_t)j)*360./((Double_t)fNposts));
+       Pos(fO,i,moth,trans,irot);
+       j++;
+    } // end for
+    if(!init) return;
+    // Inside volume A.
+    Pos(fB,1,fA,zero,0);
+    Pos(fC,1,fA,zero,0);
+    // Inside Volume B
     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++;
+           fNcD++;
            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);
+           v.SetX(fRoutHole*Sind(t));
+           v.SetY(fRoutHole*Cosd(t));
+           v.SetZ(fD.DzAt());
+           Pos(fD,fNcD,fB,v,0);
        } // end for j
        for(j=0;j<3;j++){ // 3 pins per bracket
-           ncpe++;
+           fNcE++;
            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);
+           v.SetX(fRoutHole*Sind(t));
+           v.SetY(fRoutHole*Cosd(t));
+           v.SetZ(fE.DzAt());
+           Pos(fE,fNcE,fB,v,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++;
+           Double_t a[4]={0.0,2.0,5.0,7.0}; // Relative angles.
+           fNcD++;
            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);
+           v.SetX(fRoutHole*Sind(t));
+           v.SetY(fRoutHole*Cosd(t));
+           v.SetZ(fD.DzAt());
+           Pos(fD,fNcD,fB,v,0);
        } // end for j
        for(j=0;j<2;j++){ // 2 pins per bracket
-           ncpe++;
+           fNcE++;
            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);
+           v.SetX(fRoutHole*Sind(t));
+           v.SetY(fRoutHole*Cosd(t));
+           v.SetZ(fE.DzAt());
+           Pos(fE,fNcE,fB,v,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(i=0;i<fNmounts;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);
+           fNcD++;
+           t = 180.*20./(fRoutHole*TMath::Pi());
+           t = 45.0+((Double_t)(j-1))*t+90.*((Double_t)i);
+           v.SetX(fRoutHole*Sind(t));
+           v.SetY(fRoutHole*Cosd(t));
+           v.SetZ(fD.DzAt());
+           Pos(fD,fNcD,fB,v,0);
        } // end for j
        for(j=0;j<1;j++){ // 1 pins per bracket
-           ncpe++;
+           fNcE++;
            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);
+           v.SetX(fRoutHole*Sind(t));
+           v.SetY(fRoutHole*Cosd(t));
+           v.SetZ(fE.DzAt());
+           Pos(fE,fNcE,fB,v,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);
+    Pos(fF,1,fA,zero,0);
+    Pos(fL,1,fI,zero,0);
+    for(i=1;i<fNspoaks;i++){
+       Pos(fF,i+1,fA,zero,irotSpoaks+i);
+       Pos(fL,i+1,fA,zero,irotSpoaks+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);
+    Pos(fH,1,fG,zero,0);
+    Pos(fK,1,fI,zero,0);
+    Pos(fJ,1,fI,zero,0);
+    Pos(fP,1,fO,zero,0);
+    Pos(fM,1,fJ,zero,0);
+    Pos(fN,1,fI,zero,0);
+    for(i=1;i<fNposts;i++){
+       Pos(fN,i+1,fJ,zero,irotPost+i);
+       Pos(fM,i+1,fI,zero,irotPost+i);
     } // end for i
     return;
 }
 //______________________________________________________________________
-void CreateG3Materials(){
+void AliITSGeometrySSDCone::CreateG3Materials(){
     // Fills the Geant 3 banks with Material and Medium definisions.
     // Inputs:
     //   none.
@@ -515,23 +631,61 @@ void CreateG3Materials(){
     //   none.
     // Returns:
     //   none.
-    Double_t Z[5],W[5],dens;
+    Int_t i;
+    Int_t Z[5],N[5];
+    Double_t 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);
+    // epoxy
+    dens = 10.*GetA(1)+13.*GetA(6)+3.*GetA(8);
+    Z[0] = 1; W[0] = 10.*GetA(Z[0])/dens; // Hydrogen Content
+    Z[1] = 6; W[1] = 13.*GetA(Z[1])/dens; // Carbon Content
+    Z[2] = 8; W[2] =  3.*GetA(Z[2])/dens; // Oxegen
+    // Carbon fiber is about 64% carbon fiber and 36% epoxy by volume.
+    // Now need to add in the carbon fiber
+    W[0] *= 0.36*GetA(Z[0]);
+    W[1]  = 0.36*W[1]*dens*GetA(Z[1]) + 0.64*GetA(Z[1]);
+    W[2] *= 0.36*GetA(Z[2]);
+    // Renormilize the weights
+    dens = 0.0;
+    for(i=0;i<3;i++){dens += W[i];}
+    for(i=0;i<3;i++){W[i] /= dens;}
+    dens = 1.7; // grams/cm^3 taken as density of G10 PDG book.
+    MixtureByWeight(fSSDcf,"Carbon Fiber for SSD support cone",Z,W,dens,3,0);
+    // epoxy 
+    dens = 10.*GetA(1)+13.*GetA(6)+3.*GetA(8);
+    Z[0] = 1; W[0] = 10.*GetA(Z[0])/dens; // Hydrogen Content
+    Z[1] = 6; W[1] = 13.*GetA(Z[1])/dens; // Carbon Content
+    Z[2] = 8; W[2] =  3.*GetA(Z[2])/dens; // Oxegen
+    Z[3] = 14;W[3] = 0.0; // no Silicon in epoxy.
+    // glass fiber is about 64% carbon fiber and 36% epoxy by volume.
+    // Now need to add in the glass fiber
+    W[0] *= 0.36*GetA(Z[0]);
+    W[1] *= 0.36*GetA(Z[1]);
+    W[2]  = 0.36*W[2]*dens*GetA(Z[2]) + 0.64*2.0*GetA(Z[2]);
+    W[3]  = 0.64*GetA(Z[3]); // Si
+    // Renormilize the weights
+    dens = 0.0;
+    for(i=0;i<4;i++){dens += W[i];}
+    for(i=0;i<4;i++){W[i] /= dens;}
+    dens = 1.7; // grams/cm^3 taken as density of G10 PDG book.
+    MixtureByWeight(fSSDfs,"Inserto stealite 4411w for SSD support cone",
+                   Z,W,dens,4,0);
+    // Rohacell 51 C14 H10 N2 O6 from Flavio Tosello
+    // http://cesweb.grantadesign.com/demo/index.do
+    Z[0] = 1; N[0] = 10; // Hydrogen Content
+    Z[1] = 6; N[1] = 14; // Carbon Content
+    Z[2] = 7; N[2] =  2; // Nitrogen Content
+    Z[3] = 8; N[3] =  6; // Oxigen Content
+    dens = 0.0513; // grams/cm^3 From Flavio Tosello 
+    //  http://www.emkayplatics.co.uk/roh51.html
+    MixtureByNumber(fSSDfo,"Foam core (Rohacell 51) for SSD support cone",
+                   Z,N,dens,4,0);
+    // Stainless steel. Temperary values.
+    Z[0] =  6; W[0] = 0.5; // Carbon Content
+    Z[1] = 25; W[1] = 0.5; // Iron Content
+    dens = 7.87; // Grams/cm^3  density of iron used.
+    MixtureByWeight(fSSDsw,"Stainless steal screw, pin, and stud material",
+                   Z,W,dens,2,0);
 }
 //______________________________________________________________________
 void AliITSGeometrySSDCone::BuildDisplayGeometry(){
@@ -546,3 +700,121 @@ void AliITSGeometrySSDCone::BuildDisplayGeometry(){
 
     // No need to display ITS cones.
 }
+//______________________________________________________________________
+void AliITSGeometrySSDCone::Print(ostream *os){
+    // Prints out the data kept in this class
+    // Inputs:
+    //   ostream *os pointer to the output stream
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+
+    *os << "Object AliITSGeometrySSDCone" << endl;
+    *os << " Object fA" << endl << fA << endl;
+    *os << " Object fB" << endl << fB << endl;
+    *os << " Object fC" << endl << fC << endl;
+    *os << " Object fD" << endl << fD << endl;
+    *os << " Object fE" << endl << fE << endl;
+    *os << " Object fF" << endl << fF << endl;
+    *os << " Object fG" << endl << fG << endl;
+    *os << " Object fH" << endl << fH << endl;
+    *os << " Object fI" << endl << fI << endl;
+    *os << " Object fJ" << endl << fJ << endl;
+    *os << " Object fK" << endl << fK << endl;
+    *os << " Object fL" << endl << fL << endl;
+    *os << " Object fM" << endl << fM << endl;
+    *os << " Object fN" << endl << fN << endl;
+    *os << " Object fO" << endl << fO << endl;
+    *os << " Object fP" << endl << fP << endl;
+    *os << " Object fQ" << endl << fQ << endl;
+    *os << " Object fR" << endl << fR << endl;
+    *os << " Object fS" << endl << fS << endl;
+    *os << " Object fT" << endl << fT << endl;
+    *os << " Object fU" << endl << fU << endl;
+    return;
+}
+//______________________________________________________________________
+void AliITSGeometrySSDCone::Read(istream *is){
+    // Read in data written with Print above.
+    // Inputs:
+    //   istream *is Input stream pointer
+    // Output:
+    //   none.
+    // Return:
+    //   none.
+    char s[50];
+
+    is->getline(s,49);
+    is->getline(s,49);
+    *is >> fA;
+    is->getline(s,49);
+    *is >> fB;
+    is->getline(s,49);
+    *is >> fC;
+    is->getline(s,49);
+    *is >> fD;
+    is->getline(s,49);
+    *is >> fE;
+    is->getline(s,49);
+    *is >> fF;
+    is->getline(s,49);
+    *is >> fG;
+    is->getline(s,49);
+    *is >> fH;
+    is->getline(s,49);
+    *is >> fI;
+    is->getline(s,49);
+    *is >> fJ;
+    is->getline(s,49);
+    *is >> fK;
+    is->getline(s,49);
+    *is >> fL;
+    is->getline(s,49);
+    *is >> fM;
+    is->getline(s,49);
+    *is >> fN;
+    is->getline(s,49);
+    *is >> fO;
+    is->getline(s,49);
+    *is >> fP;
+    is->getline(s,49);
+    *is >> fQ;
+    is->getline(s,49);
+    *is >> fR;
+    is->getline(s,49);
+    *is >> fS;
+    is->getline(s,49);
+    *is >> fT;
+    is->getline(s,49);
+    *is >> fU;
+    return;
+}
+//______________________________________________________________________
+ostream &operator<<(ostream &os,AliITSGeometrySSDCone &s){
+    // Operator << for C++ like output of AliITSGeometrySSDCone class.
+    // Inputs:
+    //   ostream &os              The output stream
+    //   AliITSGeometrySSDCone &s The class to be outputed
+    // Outputs:
+    //   none.
+    // Return:
+    //  ostream &os  The address of the output stream
+
+    s.Print(&os);
+    return os;
+}
+//______________________________________________________________________
+istream &operator>>(istream &is,AliITSGeometrySSDCone &s){
+    // Operator >> for C++ like input of AliITSGeometrySSDCone class.
+    // Inputs:
+    //   istream &is              The input stream
+    //   AliITSGeometrySSDCone &s The class to be inputed
+    // Outputs:
+    //   none.
+    // Return:
+    //  istream &is  The address of the input stream
+
+    s.Read(&is);
+    return is;
+}
index fc2e807f056497228702bb35abcc8703aecc3857..2f5394cec115c69d0ec7e97c8a74e362970f1167 100644 (file)
 */
 #include "AliITSBaseGeometry.h"
 class TVector3;
+class AliITS;
+
 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);
+    AliITSGeometrySSDCone(AliITS *its,TVector3 &tran,const char *moth,
+                         Int_t mat0);
+    virtual ~AliITSGeometrySSDCone(){};
+    void CreateG3Geometry(const char *moth,TVector3 &trans);
+    void PositionG3Geometry(AliITSBaseVolParams &moth,Int_t cn,
+                           TVector3 &t,Int_t irot);
     void CreateG3Materials();
     void BuildDisplayGeometry();
+    void Print(ostream *os); // Prints out the contenes of this class
+    void Read(istream *is); // Reads in the contenst of this class
+    // mother volume.
+ private: // functions Require at parts of Volume A to be already defined.
+    // Retruns the value of Rmax corresponding to point z alone the line
+    // defined by the two points p.Rmax(i1),p.ZAt(i1) and p.Rmax(i2),
+    // p.ZAt(i2).
+    Double_t RmaxFrom2Points(AliITSPConeData &p,Int_t i1,Int_t i2,Double_t z)
+       {return p.Rmax(i2)+(p.Rmax(i1)-p.Rmax(i2))*(z-p.ZAt(i2))/
+            (p.ZAt(i1)-p.ZAt(i2));}
+    // Retruns the value of Rmin corresponding to point z alone the line
+    // defined by the two points p.Rmin(i1),p.ZAt(i1) and p.Rmin(i2),
+    // p.ZAt(i2).
+    Double_t RminFrom2Points(AliITSPConeData &p,Int_t i1,Int_t i2,Double_t z)
+       {return p.Rmin(i2)+(p.Rmin(i1)-p.Rmin(i2))*(z-p.ZAt(i2))/
+
+            (p.ZAt(i1)-p.ZAt(i2));}
+    // Retruns the value of Z corresponding to point R alone the line
+    // defined by the two points p.Rmin(i1),p.ZAt(i1) and p.Rmin(i2),p.ZAt(i2)
+    Double_t Zfrom2MinPoints(AliITSPConeData &p,Int_t i1,Int_t i2,Double_t r)
+       {return p.ZAt(i2)+(p.ZAt(i1)-p.ZAt(i2))*(r-p.Rmin(i2))/
+            (p.Rmin(i1)-p.Rmin(i2));}
+    // Retruns the value of Z corresponding to point R alone the line
+    // defined by the two points p.Rmax(i1),p.ZAt(i1) and p.Rmax(i2),p.ZAt(i2)
+    Double_t Zfrom2MaxPoints(AliITSPConeData &p,Int_t i1,Int_t i2,Double_t r)
+       {return p.ZAt(i2)+(p.ZAt(i1)-p.ZAt(i2))*(r-p.Rmax(i2))/
+            (p.Rmax(i1)-p.Rmax(i2));}
+    // General SSD Outer Cone surface equation Rmax.
+    Double_t RmaxFromZpCone(AliITSPConeData &p,Double_t z,Double_t th=0.0)
+       {return -fTantc*(z-p.ZAt(4))+p.Rmax(4)+th/fCostc;}
+    // General SSD Inner Cone surface equation Rmin.
+    Double_t RminFromZpCone(AliITSPConeData &p,Double_t z,Double_t th=0.0)
+       {return -fTantc*(z-p.ZAt(3))+p.Rmin(3)+th/fCostc;}
+    // Outer SSD cone surface
+    Double_t RmaxFromZSSDcone(Double_t z,Double_t th=0.0) 
+       {return RmaxFromZpCone(fA,z,th);}
+    // Inner SSD cone surface
+    Double_t RminFromZSSDcone(Double_t z,Double_t th=0.0) 
+       {return RminFromZpCone(fA,z,th);}
+    // General SSD Outer cone Surface equation for z.
+    Double_t ZFromRmaxpCone(AliITSPConeData &p,Double_t r,Double_t th=0.0)
+       {return p.ZAt(4)+(p.Rmax(4)+th/fCostc-r)/fTantc;}
+    // General SSD Inner cone Surface equation for z.
+    Double_t ZFromRminpCone(AliITSPConeData &p,Double_t r,Double_t th=0.0)
+       {return p.ZAt(3)+(p.Rmax(3)+th/fCostc-r)/fTantc;}
+    Double_t ZFromRmaxSSDcone(Double_t r,Double_t th=0.0)
+       {return ZFromRmaxpCone(fA,r,th);}
+    Double_t ZFromRminSSDcone(Double_t r,Double_t th=0.0)
+       {return ZFromRminpCone(fA,r,th);}
+    // Given a initial point z0,r0, the initial angle theta0, and the radius
+    // of curvature, returns the point z1, r1 at the angle theta1. Theta
+    // measured from the r axis in the clock wise direction [degrees].
+    void RadiusOfCurvature(Double_t rc,Double_t theta0,Double_t z0,
+                          Double_t r0,Double_t theta1,Double_t &z1,
+                          Double_t &r1)
+       {z1=rc*(Sind(theta1)-Sind(theta0))+z0;
+        r1=rc*(Cosd(theta1)-Cosd(theta0))+r0; return;}
  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];
+    Double_t fThickness; //mm, Thickness of Rohacell+carbon fiber
+    Double_t fCthick; //mm, Carbon finber thickness
+    Double_t fRcurv; // mm, Radius of curvature.
+    Double_t fTc; // angle of SSD cone [degrees].
+    Double_t fSintc,fCostc,fTantc;
+    Double_t fZ0,fZouterMilled,fZcylinder,fZposts;
+    Double_t fRoutMax,fRoutHole,fRoutMin;
+    Double_t fRholeMax,fRholeMin;
+    Double_t fRpostMin,fdRpost,fZpostMax,fPhi0Post;
+    Double_t fRinMax,fRinCylinder,fRinHole,fRinMin,fdZin;
+    // Screws mounting SSD-SDD thermal/machanical cylinder
+    Double_t fPhi0Screws,fRcylinderScrews,fDscrewHead;
+    Double_t fDscrewShaft,fThScrewHeadHole;
+    // The SDD mounting bracket SSD part of it.
+    Int_t fNssdSupports;
+    Double_t fPhi0SDDsupports;
+    Double_t fRsddSupportPlate,fThSDDsupportPlate,fWsddSupportPlate;
+    Int_t fNspoaks,fNinScrews,fNposts,fNmounts;
+    Int_t fSSDcf; // SSD support cone Carbon Fiber materal number.
+    Int_t fSSDfs; // SSD support cone inserto stesalite 4411w.
+    Int_t fSSDfo; // SSD support cone foam, Rohacell 50A.
+    Int_t fSSDsw; // SSD support cone screw material,Stainless steal
+    Int_t fNcD; // number of screw ends (copy number) Volume D
+    Int_t fNcE; // number of pin end (copy number) Volume E
+    AliITSPConeData fA;//Poly-cone Volume A. Top part of SSD cone Carbon Fiber
+    AliITSPConeData fB; // Poly-cone Volume B. Stesalite inside volume A.
+    AliITSPConeData fC; // Poly-cone Volume C. Foam inside volume A.
+    AliITSTubeData  fD; // Bolt holes willed with bolt
+    AliITSTubeData  fE; // Pin holes willed with pin.
+    AliITSPConeData fF;//Poly-cone Volume F. Foam in spoak reagion, inside A.
+    // SSD support cone Spoaks.
+    AliITSPConeData fG; // Poly-cone Volume G.
+    AliITSPConeData fH; // Poly-cone Volume H.
+    AliITSPConeData fI; // Poly-cone Volume I.
+    AliITSPConeData fJ; // Poly-cone Volume J.
+    AliITSPConeData fK; // Poly-cone Volume K.
+    AliITSPConeData fL; // Poly-cone Volume L.
+    AliITSPConeData fM; // Poly-cone Volume M.
+    AliITSPConeData fN; // Poly-cone Volume N.
+    AliITSPConeData fO; // Poly-cone Volume O.
+    AliITSPConeData fP; // Poly-cone Volume P.
+    AliITSPConeData fQ; // Poly-cone Volume Q.
+    AliITSTubeData  fR; // Bolt holes willed with bolt
+    AliITSTubeData  fS; // Pin holes willed with pin.
+    AliITSPConeData fT; // Poly-cone Volume T.
+    AliITSPConeData fU; // Poly-cone Volume U.
 
-    ClassDef(AliITSGeometrySSDCone,1)// ITS SSD support cone geometry version 1
+    ClassDef(AliITSGeometrySSDCone,1) // ITS SSD support cone geometry
+                                     // version 11
 };
+// Input and Output functions for standard C++ input/output/
+ostream &operator<<(ostream &os,AliITSGeometrySSDCone &source);
+istream &operator>>(istream &is,AliITSGeometrySSDCone &source);
+
 #endif
+
index e973399698b1cb5f32124ab4b91a1d34df6d98d2..f1a264426545c8b3088a5a50e4bb71a783cf727c 100644 (file)
@@ -15,6 +15,9 @@
 
 /*
 $Log$
+Revision 1.6  2003/02/10 17:03:52  nilsen
+New version and structure of ITS V11 geometry. Work still in progress.
+
 Revision 1.5  2003/02/01 14:02:20  nilsen
 Work continues.
 
@@ -26,7 +29,8 @@ Work continuing.
 
 Revision 1.2  2003/01/26 14:35:15  nilsen
 Some more geometry interface functions added and a start at the SSD support
-cone geometry. Committed to allow easy updates of partical work between authors.
+cone geometry. Committed to allow easy updates of partical work between 
+authors.
 
 Revision 1.1  2003/01/20 23:32:49  nilsen
 New ITS geometry. Only a Skeleton for now.
@@ -54,13 +58,7 @@ $Id$
 #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>
@@ -74,7 +72,6 @@ $Id$
 #include "AliConst.h"
 #include "AliITSGeant3Geometry.h"
 #include "AliITShit.h"
-#include "AliITS.h"
 #include "AliITSv11.h"
 #include "AliITSgeom.h"
 #include "AliITSgeomSPD.h"
@@ -94,8 +91,9 @@ $Id$
 #include "AliITSClusterFinderSDD.h"
 #include "AliITSClusterFinderSSD.h"
 //
+#include "AliITSGeometryITSV.h"
 #include "AliITSGeometrySSDCone.h"
-
+#include "AliITSGeometrySDDCone.h"
 
 ClassImp(AliITSv11)
 
@@ -109,19 +107,23 @@ AliITSv11::AliITSv11() : AliITS() {
     // Return
     //   A default constructed AliITSv11 class.
 
-    fc = 0;
+    fITSV = 0;
+    fcS = 0;
+//   fcD = 0;
 }
 //______________________________________________________________________
 AliITSv11::AliITSv11(const char *title) : AliITS("ITS", title){
     // Standard constructor for the ITS version 11.
     // Inputs:
-    //   none.
+    //   const char *title  The title of for this geometry.
     // Outputs:
     //   none.
     // Return
     //   A Standard constructed AliITSv11 class.
 
-    fc = 0;
+    fITSV = 0;
+    fcS = 0;
+//    fcD = 0;
 }
 //______________________________________________________________________
 AliITSv11::~AliITSv11() {
@@ -133,65 +135,315 @@ AliITSv11::~AliITSv11() {
     // Return
     //   none.
 
-    if(fc!=0) delete fc;
+    if(fITSV!=0) delete fITSV;
+    if(fcS!=0) delete fcS;
+//    if(fcD!=0) delete fcD;
+}
+//______________________________________________________________________
+AliITSv11::AliITSv11(const AliITSv11 &source){
+    //     Copy Constructor for ITS version 11.
+    // Inputs:
+    //   AliITSv11 &source  class to be copied from.
+    // Outputs:
+    //   none.
+    // Return
+    //   none.
+
+    if(&source == this) return;
+    Error("Copy Constructor","Not allowed to copy AliITSv11");
+    return;
+}
+//______________________________________________________________________
+AliITSv11& AliITSv11::operator=(const AliITSv11 &source){
+    //    Assignment operator for the ITS version 11.
+    // Inputs:
+    //   AliITSv11 &source  class to be copied from.
+    // Outputs:
+    //   none.
+    // Return
+    //   none.
+
+    if(&source == this) return *this;
+    Error("= operator","Not allowed to copy AliITSv11");
+    return *this;
 }
 //______________________________________________________________________
 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.
+    // 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:
     //   none.
     // Outputs:
     //   none.
     // Return
     //   none.
+    TVector3 t(0.0,0.0,0.0);
 
-    if(fc==0) fc = new AliITSGeometrySSDCone(new TVector3(0.0,0.0,0.0),"TSV",0);
+    if(fITSV==0) fITSV = new AliITSGeometryITSV(this,"ALIC");
+    if(fcS==0) fcS = new AliITSGeometrySSDCone(this,t,"TSV",1);
 
-    fc->BuildDisplayGeometry();
+    fcS->BuildDisplayGeometry();
 }
 //______________________________________________________________________
 void AliITSv11::CreateGeometry(){
-    // This routine defines and Creates the geometry for version 11 of the ITS.
+    // This routine defines and Creates the geometry for version 11 of 
+    // the ITS. The geometry is used by the particle trasport routines,
+    // and therefore, is very detailed.
     // Inputs:
     //   none.
     // Outputs:
     //   none.
     // Return
     //   none.
-
-    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);
+
+    if(fITSV==0) fITSV = new AliITSGeometryITSV(this,"ALIC");
+    if(fcS==0) fcS = new AliITSGeometrySSDCone(this,t,"TSV",1);
+    //
+    fITSV->CreateG3Geometry();
+    fcS->CreateG3Geometry("TSV",t);
+    //
+    fITSV->PositionGeometry("ALIC",1,t,0);
+    fcS->PositionG3Geometry(fITSV->GetParams(),1,t,0);
 }
 //______________________________________________________________________
 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.
+    // Monte Carlo simulations for the geometries 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:
     //   none.
     // Outputs:
     //   none.
     // Return
     //   none.
+/*
+    TVector3 t(0.0,0.0,0.0);
+
+    if(fITSV==0) fITSV = new AliITSGeometryITSV(this,"ALIC");
+    if(fcS==0) fcS = new AliITSGeometrySSDCone(this,t,"TSV",1);
+
+    fITSV->CreateG3Materials();
+    fcS->CreateG3Materials();
+*/
+
+
+  Int_t   ifield = gAlice->Field()->Integ();
+  Float_t fieldm = gAlice->Field()->Max();
+
+  Float_t tmaxfd = 0.1; // 1.0; // Degree
+  Float_t stemax = 1.0; // cm
+  Float_t deemax = 0.1; // 30.0; // Fraction of particle's energy 0<deemax<=1
+  Float_t epsil  = 1.0E-4; // 1.0; // cm
+  Float_t stmin  = 0.0; // cm "Default value used"
+
+  Float_t tmaxfdSi = 0.1; // .10000E+01; // Degree
+  Float_t stemaxSi = 0.0075; //  .10000E+01; // cm
+  Float_t deemaxSi = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
+  Float_t epsilSi  = 1.0E-4;// .10000E+01;
+  Float_t stminSi  = 0.0; // cm "Default value used"
+
+  Float_t tmaxfdAir = 0.1; // .10000E+01; // Degree
+  Float_t stemaxAir = .10000E+01; // cm
+  Float_t deemaxAir = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
+  Float_t epsilAir  = 1.0E-4;// .10000E+01;
+  Float_t stminAir  = 0.0; // cm "Default value used"
+
+  Float_t tmaxfdServ = 1.0; // 10.0; // Degree
+  Float_t stemaxServ = 1.0; // 0.01; // cm
+  Float_t deemaxServ = 0.5; // 0.1; // Fraction of particle's energy 0<deemax<=1
+  Float_t epsilServ  = 1.0E-3; // 0.003; // cm
+  Float_t stminServ  = 0.0; //0.003; // cm "Default value used"
+
+  // Freon
+  Float_t afre[2]  = { 12.011,18.9984032 };
+  Float_t zfre[2]  = { 6., 9. };
+  Float_t wfre[2]  = { 5.,12. };
+  Float_t densfre  = 1.5;
+
+  // --- Define the various materials and media for GEANT --- 
+  // AliMaterial(Int_t imat, const char* name, Float_t a, Float_t z,
+  //              Float_t dens, Float_t radl, Float_t absl,
+  //              Float_t *buf=0, Int_t nwbuf=0)
+  //AliMedium(Int_t numed, const char *name, Int_t nmat,
+  //          Int_t isvol, Int_t ifield, Float_t fieldm,
+  //          Float_t tmaxfd, Float_t stemax, Float_t deemax,
+  //          Float_t epsil, Float_t stmin, Float_t *ubuf=0, Int_t nbuf=0)
+  AliMaterial(1,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(1,"SI$",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(2,"SPD SI CHIP$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(2,"SPD SI CHIP$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(3,"SPD SI BUS$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(3,"SPD SI BUS$",3,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(4,"C (M55J)$",0.12011E+02,0.60000E+01,0.1930E+01,0.22100E+02,0.99900E+03);
+  AliMedium(4,"C (M55J)$",4,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(5,"AIR$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
+  AliMedium(5,"AIR$",5,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
+
+  AliMaterial(6,"GEN AIR$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
+  AliMedium(6,"GEN AIR$",6,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
+
+  AliMaterial(7,"SDD SI CHIP$",0.374952E+02,0.178184E+02,0.24485E+01,0.76931E+01,0.99900E+03);
+  AliMedium(7,"SDD SI CHIP$",7,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(9,"SDD C (M55J)$",0.123565E+02,0.64561E+01,0.18097E+01,0.229570E+02,0.99900E+03);
+  AliMedium(9,"SDD C (M55J)$",9,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(10,"SDD AIR$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
+  AliMedium(10,"SDD AIR$",10,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
+
+  AliMaterial(11,"AL$",0.26982E+02,0.13000E+02,0.26989E+01,0.89000E+01,0.99900E+03);
+  AliMedium(11,"AL$",11,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(12,"WATER$",0.14322E+02,0.72167E+01,0.10000E+01,0.35759E+02,0.94951E+02);
+  AliMedium(12,"WATER$",12,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMixture(13,"Freon$",afre,zfre,densfre,-2,wfre);
+  AliMedium(13,"Freon$",13,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(14,"COPPER$",0.63546E+02,0.29000E+02,0.89600E+01,0.14300E+01,0.99900E+03);
+  AliMedium(14,"COPPER$",14,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(15,"CERAMICS$",0.22314E+02,0.10856E+02,0.36000E+01,0.76200E+01,0.31901E+02);
+  AliMedium(15,"CERAMICS$",15,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(20,"SSD C (M55J)$",0.12011E+02,0.60000E+01,0.1930E+01,0.22100E+02,0.99900E+03);
+  AliMedium(20,"SSD C (M55J)$",20,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(21,"SSD AIR$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
+  AliMedium(21,"SSD AIR$",21,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
+
+  AliMaterial(25,"G10FR4$",0.17749E+02,0.88750E+01,0.18000E+01,0.21822E+02,0.99900E+03);
+  AliMedium(25,"G10FR4$",25,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(26,"GEN C (M55J)$",0.12011E+02,0.60000E+01,0.1930E+01,0.22100E+02,0.99900E+03);
+  AliMedium(26,"GEN C (M55J)$",26,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(27,"GEN Air$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
+  AliMedium(27,"GEN Air$",27,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
+
+  AliMaterial(51,"SPD SI$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(51,"SPD SI$",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(52,"SPD SI CHIP$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(52,"SPD SI CHIP$",52,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(53,"SPD SI BUS$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(53,"SPD SI BUS$",53,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(54,"SPD C (M55J)$",0.12011E+02,0.60000E+01,0.1930E+01,0.22100E+02,0.99900E+03);
+  AliMedium(54,"SPD C (M55J)$",54,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(55,"SPD AIR$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
+  AliMedium(55,"SPD AIR$",55,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
+
+  AliMaterial(56,"SPD KAPTON(POLYCH2)$",0.14000E+02,0.71770E+01,0.13000E+01,0.31270E+02,0.99900E+03);
+  AliMedium(56,"SPD KAPTON(POLYCH2)$",56,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(61,"EPOXY$",0.17749E+02,0.88750E+01,0.18000E+01,0.21822E+02,0.99900E+03);
+  AliMedium(61,"EPOXY$",61,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(62,"SILICON$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(62,"SILICON$",62,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
+
+  AliMaterial(63,"KAPTONH(POLYCH2)$",0.14000E+02,0.71770E+01,0.13000E+01,0.31270E+02,0.99900E+03);
+  AliMedium(63,"KAPTONH(POLYCH2)$",63,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(64,"ALUMINUM$",0.26982E+02,0.13000E+02,0.26989E+01,0.89000E+01,0.99900E+03);
+  AliMedium(64,"ALUMINUM$",64,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(65,"INOX$",0.55098E+02,0.2572E+02,0.7900E+01,0.17800E+01,0.99900E+03);
+  AliMedium(65,"INOX$",65,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(68,"ROHACELL$",0.123974E+02,0.62363E+01,0.500E-01,0.80986E+03,0.99900E+03);
+  AliMedium(68,"ROHACELL$",68,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(69,"SDD C AL (M55J)$",0.138802E+02,0.71315E+01,0.19837E+01,0.176542E+02,0.99900E+03);
+  AliMedium(69,"SDD C AL (M55J)$",69,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(70,"SDDKAPTON (POLYCH2)$",0.14000E+02,0.71770E+01,0.13000E+01,0.31270E+02,0.99900E+03);
+  AliMedium(70,"SDDKAPTON (POLYCH2)$",70,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(71,"ITS SANDW A$",0.12011E+02,0.60000E+01,0.2115E+00,0.17479E+03,0.99900E+03);
+  AliMedium(71,"ITS SANDW A$",71,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(72,"ITS SANDW B$",0.12011E+02,0.60000E+01,0.27000E+00,0.18956E+03,0.99900E+03);
+  AliMedium(72,"ITS SANDW B$",72,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(73,"ITS SANDW C$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03);
+  AliMedium(73,"ITS SANDW C$",73,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(74,"HEAT COND GLUE$",0.12011E+02,0.60000E+01,0.1930E+01,0.22100E+02,0.99900E+03);
+  AliMedium(74,"HEAT COND GLUE$",74,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(75,"ELASTO SIL$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(75,"ELASTO SIL$",75,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(76,"SPDBUS(AL+KPT+EPOX)$",0.19509E+02,0.96502E+01,0.19060E+01,0.15413E+02,0.99900E+03);
+  AliMedium(76,"SPDBUS(AL+KPT+EPOX)$",76,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+               
+  AliMaterial(77,"SDD X7R capacitors$",0.1157516E+03,0.477056E+02,0.67200E+01,0.14236E+01,0.99900E+03);
+  AliMedium(77,"SDD X7R capacitors$",77,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(78,"SDD ruby sph. Al2O3$",0.218101E+02,0.106467E+02,0.39700E+01,0.48539E+01,0.99900E+03);
+  AliMedium(78,"SDD ruby sph. Al2O3$",78,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(79,"SDD SI insensitive$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
+  AliMedium(79,"SDD SI insensitive$",79,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(80,"SDD HV microcable$",0.159379E+02,0.78598E+01,0.16087E+01,0.217906E+02,0.99900E+03);
+  AliMedium(80,"SDD HV microcable$",80,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(81,"SDD LV+signal cable$",0.223689E+02,0.108531+02,0.21035E+01,0.13440E+02,0.99900E+03);
+  AliMedium(81,"SDD LV+signal cable$",81,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(82,"SDD hybrid microcab$",0.218254E+02,0.106001E+02,0.20502E+01,0.137308E+02,0.99900E+03);
+  AliMedium(82,"SDD hybrid microcab$",82,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(83,"SDD anode microcab$",0.186438E+02,0.91193E+01,0.17854E+01,0.176451E+02,0.99900E+03);
+  AliMedium(83,"SDD anode microcab$",83,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(84,"SDD/SSD rings$",0.123565E+02,0.64561E+01,0.18097E+01,0.229570E+02,0.99900E+03);
+  AliMedium(84,"SDD/SSD rings$",84,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+  AliMaterial(85,"inox/alum$",0.321502E+02,0.153383E+02,0.30705E+01,0.69197E+01,0.99900E+03);
+  AliMedium(85,"inox/alum$",85,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
+
+
+  // Special media
+
+  AliMaterial(90,"SPD shield$", 12.011, 6., 1.93/10. , 22.1*10., 999);
+  AliMedium(90,"SPD shield$",90,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
+
+  AliMaterial(91, "SPD End ladder$", 47.0447, 21.7963, 3.6374, 4.4711, 999); 
+  AliMedium(91,"SPD End ladder$",91,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
+
+  AliMaterial(92, "SPD cone$",28.0855, 14., 2.33, 9.36, 999);    
+  AliMedium(92,"SPD cone$",92,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
+
+  AliMaterial(93, "SDD End ladder$", 69.9298, 29.8246, 0.3824, 36.5103, 999); 
+  AliMedium(93,"SDD End ladder$",93,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
 
-    if(fc==0) fc = new AliITSGeometrySSDCone(new TVector3(0.0,0.0,0.0),"TSV",0);
+  AliMaterial(94, "SDD cone$",63.546, 29., 1.15, 1.265, 999);
+  AliMedium(94,"SDD cone$",94,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
 
-    fc->CreateG3Materials();
+  AliMaterial(95, "SSD End ladder$", 32.0988, 15.4021, 0.68, 35.3238, 999); 
+  AliMedium(95,"SSD End ladder$",95,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
+  
+  AliMaterial(96, "SSD cone$",63.546, 29., 1.15, 1.265, 999);
+  AliMedium(96,"SSD cone$",96,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
 }
 //______________________________________________________________________
 void AliITSv11::InitAliITSgeom(){
     // Based on the geometry tree defined in Geant 3.21, this
-    // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS geometry
-    // sturture.
+    // routine initilizes the Class AliITSgeom from the Geant 3.21 ITS 
+    // geometry sturture.
     // Inputs:
     //   none.
     // Outputs:
@@ -211,7 +463,10 @@ void AliITSv11::Init(){
 }
 //______________________________________________________________________
 void AliITSv11::SetDefaults(){
-    // sets the default segmentation, response, digit and raw cluster classes
+    // Sets the default segmentation, response, digit and raw cluster 
+    // classes to be used. These defaults can be overwritten in the
+    // macros that do these later steps. Defaults are give hear for the
+    // general user.
     // Inputs:
     //   none.
     // Outputs:
@@ -221,7 +476,7 @@ void AliITSv11::SetDefaults(){
 }
 //______________________________________________________________________
 void AliITSv11::DrawModule(){
-    // Draw a shaded view of the ITS version 11.
+    // Draw a standard set of shaded view of the ITS version 11.
     // Inputs:
     //   none.
     // Outputs:
@@ -237,6 +492,6 @@ void AliITSv11::StepManager(){
     // 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.
+    // is the extra variables and the like used in the printing allocated.
 }
  
index 843526fcf6d5d0cd3ff974b260f29eb6b79ab89a..5abcd0d64092af37d73947c0b964d2c1e9c3ab32 100644 (file)
@@ -12,7 +12,9 @@
 /////////////////////////////////////////////////////////////////////////
  
 #include "AliITS.h"
+class AliITSGeometryITSV;
 class AliITSGeometrySSDCone;
+//class AliITSGeometrySDDCone;
  
 class AliITSv11 : public AliITS {
 
@@ -21,12 +23,11 @@ class AliITSv11 : public AliITS {
     AliITSv11(const char *title);
     AliITSv11(const AliITSv11 &source); // copy constructor
     AliITSv11& operator=(const AliITSv11 &source); // assignment operator
-    virtual       ~AliITSv11() ;
+    virtual       ~AliITSv11();
     virtual void   BuildGeometry();
     virtual void   CreateGeometry();
     virtual void   CreateMaterials();
-    virtual Int_t  IsVersion() const {// returns the ITS version number 
-                                      return 11;} 
+    virtual Int_t  IsVersion() const {return 11;} // ITS version number
     virtual void   Init(); 
     virtual void   SetDefaults();
     virtual void   DrawModule();
@@ -34,16 +35,16 @@ class AliITSv11 : public AliITS {
     virtual void   SetWriteDet(Bool_t det=kTRUE){ // set .det write
                                                 fGeomDetOut = det;}
     virtual void   SetWriteDet(const char *f){ // set write file
-                                    strncpy(fWrite,f,60);fGeomDetOut = kTRUE;}
+                                strncpy(fWrite,f,60);fGeomDetOut = kTRUE;}
     virtual void   SetReadDet(Bool_t det=kTRUE){ //set .det read
                                                fGeomDetIn = det;}
     virtual void   SetReadDet(const char *f){ // set read file
-                                      strncpy(fRead,f,60);fGeomDetIn = kTRUE;}
+                                  strncpy(fRead,f,60);fGeomDetIn = kTRUE;}
     virtual void   SetEUCLID(Bool_t euclid=kTRUE){ // set write Euclid file
                                                  fEuclidOut = euclid;}
     virtual void   SetEUCLIDFileName(const char *f){ // set write file
                             fEuclidGeometry=f;fEuclidOut = kTRUE;}
-    virtual void   SetMinorVersion(Int_t v=22){ // Choose between existing minor versions
+    virtual void   SetMinorVersion(Int_t v=00){ // Set minor version
        fMinorVersion = v;}
     virtual void   SetThicknessDet1(Float_t v=200.){ 
         // Set detector thickness in layer 1
@@ -63,7 +64,7 @@ class AliITSv11 : public AliITS {
     virtual void   SetCoolingFluid(Int_t v=1){ 
         // Set flag for cooling fluid
         fFluid = v;}            
-    virtual Bool_t GetEUCLID(){return fEuclidOut;}// returns value Euclid flag.
+    virtual Bool_t GetEUCLID(){return fEuclidOut;}// returns value Euclid flag
     virtual const char  *GetEULIIDFileName() const{ // return .euc file name
                                       return fEuclidGeometry.Data();}
     virtual Bool_t GetWriteDet() { // returns value GeomDetOut flag.
@@ -71,9 +72,9 @@ class AliITSv11 : public AliITS {
     virtual Bool_t GetReadDet() { // returns value GeomDetIn flag.
                                 return fGeomDetIn;}
     virtual char  *GetReadDetFileName(){ // return .det read file name
-                 if(fRead[0]!='\0') return fRead; else return fEuclidGeomDet;}
+       if(fRead[0]!='\0') return fRead; else return fEuclidGeomDet;}
     virtual char  *GetWriteDetFileName(){ // return .det write file name
-               if(fWrite[0]!='\0') return fWrite; else return fEuclidGeomDet;}
+       if(fWrite[0]!='\0') return fWrite; else return fEuclidGeomDet;}
     virtual Int_t GetMajorVersion(){// return Major Version Number
        return fMajorVersion;}
     virtual Int_t GetMinorVersion(){// return Major Version Number
@@ -113,12 +114,14 @@ class AliITSv11 : public AliITS {
     Float_t  fDet2;          // thickness of detector in SPD layer 2
     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)
-    AliITSGeometrySSDCone *fc;//! ITS SSD Cone geometry. ONLY THING DEFINED.
+    Int_t    fRails;          // switch rails on (=1) and off (=0)
+    Int_t    fFluid;          // switch between water(=1) and freon(=0)
+    //
+    AliITSGeometryITSV    *fITSV;  //! ITS Mother Volume.
+    AliITSGeometrySSDCone *fcS;    //! ITS SSD Cone geometry.
+//    AliITSGeometrySDDCone *fcD;    //! ITS SDD Cone geometry.
 
-    ClassDef(AliITSv11,1)  //Hits manager for set:ITS version 11 
-                                 // PPR detailed Geometry asymmetric
+    ClassDef(AliITSv11,1)  //Hits manager for set:ITS version 11
 };
  
 #endif
index ac79d11c0d05f778805b89c7a159901f3d16cd5c..9246a53102da9e541f289f923673a68f2b32b331 100644 (file)
 #pragma link C++ class  AliITSvPPRsymm+;
 #pragma link C++ class  AliITSvPPRasymmFMD+;
 #pragma link C++ class  AliITSvSPD02+;
+#pragma link C++ class  AliITSv11+;
+//
+#pragma link C++ class  AliITSBaseGeometry+;
+#pragma link C++ class  AliITSBaseVolParams+;
+#pragma link C++ class  AliITSTubeData+;
+#pragma link C++ class  AliITSPConeData+;
+#pragma link C++ class  AliITSPGonData+;
+#pragma link C++ class  AliITSGeometryITSV+;
+#pragma link C++ class  AliITSGeometrySSDCone+;
+#pragma link C++ class  AliITSGeometrySDDCone+;
+//
 #pragma link C++ class  AliITShit+;
 #pragma link C++ class  AliITSdigit+;
 #pragma link C++ class  AliITSdigitSPD+;
index e00e86ad5c791ef66cbb68925683fc7c69721247..ae331349cb1d614a49fa12b6b233f507da4cb2dd 100644 (file)
@@ -2,6 +2,8 @@ SRCS          = AliITS.cxx AliITSv1.cxx AliITSv5.cxx AliITSvSPD02.cxx \
                AliITSv5symm.cxx AliITSv5asymm.cxx \
                AliITSvPPRcoarseasymm.cxx AliITSvPPRcoarsesymm.cxx\
                AliITSvPPRasymm.cxx AliITSvPPRsymm.cxx AliITSvPPRasymmFMD.cxx\
+               AliITSv11.cxx AliITSBaseGeometry.cxx AliITSGeometryITSV.cxx \
+               AliITSGeometrySSDCone.cxx AliITSGeometrySDDCone.cxx \
                AliITShit.cxx AliITSDetType.cxx \
                AliITSgeom.cxx AliITSgeomMatrix.cxx \
                AliITSgeomSPD.cxx AliITSgeomSDD.cxx \
@@ -41,7 +43,8 @@ SRCS          = AliITS.cxx AliITSv1.cxx AliITSv5.cxx AliITSvSPD02.cxx \
                AliITSreconstruction.cxx \
                AliITSFindClustersV2.cxx \
                AliITSRiemannFit.cxx \
-               AliITSFDigitizer.cxx AliITSDDLRawData.cxx
+               AliITSFDigitizer.cxx \
+               AliITSDDLRawData.cxx
 #              AliITSAlignmentTrack.cxx AliITSAlignmentModule.cxx \
 
 HDRS:=  $(SRCS:.cxx=.h)