Continue to add and fix new geometry.
authornilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Dec 2004 14:47:41 +0000 (14:47 +0000)
committernilsen <nilsen@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 8 Dec 2004 14:47:41 +0000 (14:47 +0000)
ITS/AliITSv11Geometry.cxx
ITS/AliITSv11Geometry.h
ITS/AliITSv11GeometrySPD.cxx
ITS/AliITSv11GeometrySPD.h
ITS/AliITSv11GeometrySupport.cxx

index 83a4fea..f2763f7 100644 (file)
 #include <TArrow.h>
 #include <TCanvas.h>
 #include <TText.h>
-#include <TObjArray.h>
-#include <TMatrixD.h>
-#include <TArrayD.h>
-#include <TArrayI.h>
 #include <TGeoPcon.h>
 #include <TGeoCone.h>
 #include <TGeoTube.h> // contaings TGeoTubeSeg
 #include <TGeoArb8.h>
-#include <TGeoMaterial.h>
 #include <TPolyMarker.h>
 #include <TPolyLine.h>
 #include "AliITSv11Geometry.h"
@@ -57,175 +52,6 @@ const Double_t AliITSv11Geometry::fgkcm = 1.00;
 const Double_t AliITSv11Geometry::fgkDegree = 1.0;
 const Double_t AliITSv11Geometry::fgkRadian = 180./3.14159265358979323846;
 
-//----------------------------------------------------------------------
-TGeoMixture * AliITSv11Geometry::CreateMixtureByVolume(const char* name,
-                                 Int_t nel,const TArrayD *v,
-                                 const TObjArray *mix,Double_t den){
-    // Create a new TGeoMixture object based on a TObject array of
-    // TGeoMixture/TGeoMaterials and their releative weight volume. For 
-    // example, Consider TGeoMixture of 
-    // Inputs:
-    //    const char*     name Name of the new TGeoMixture
-    //          Int_t     nel  The number of enteries
-    //    const TArrayD   *v   Array of releative volume of each mixture
-    //    const TObjArray *mix TObjArray holding the TGeoMixtures or 
-    //                         TGeoMaterials which make up this new mixture.
-    //          Double_t   den The density of this new mixture [g/cm^3].
-    // Output:
-    //    none.
-    // Retrun:
-    //    A pointer to a new instance of a TGeoMixture.
-    Int_t i;
-    TArrayD w(nel);
-
-    for(i=0;i<nel;i++) if(v->At(i)>=0.0){
-        w[i] = v->At(i) * ((TGeoMaterial*)(mix->At(i)))->GetDensity();
-    }else{
-        w[i] = 0.0;
-    } // end if/for i
-    return CreateMixtureByWeight(name,nel,&w,mix,den);
-}
-//______________________________________________________________________
-TGeoMixture * AliITSv11Geometry::CreateMixtureByNumber(const char* name,
-                                 Int_t nel,const TArrayI *w,
-                                 const TObjArray *mix,Double_t den){
-    // Create a new TGeoMixture object based on a TObject array of
-    // TGeoMixture/TGeoMaterials and their releative number. For example,
-    // Consider TGeoMixture of BGO (Bi_2O_3)_2(GeO_2)_3. Assume you have
-    // defined Bismuth Oxide as Bi_2O_3 as one TGeoMixture ("Bi2O3") and 
-    // Germainium Oxide as another ("GeO2"), then BGO is defined at
-    // CreateMixtureByNumber("BGO",2,TArrayI(2,3),
-    // TObjArray(TGeoMixture("Bi2O3"),TGeoMixture("GeO2")));
-    // Inputs:
-    //    const char* name     Name of the new TGeoMixture
-    //          Int_t nel      The number of enteries
-    //    const TArrayI *w     Array of releative number of each mixture
-    //    const TObjArray *mix TObjArray holding the TGeoMixtures or 
-    //                         TGeoMaterials which make up this new mixture.
-    //          Double_t   den The density of this new mixture [g/cm^3].
-    // Output:
-    //    none.
-    // Retrun:
-    //    A pointer to a new instance of a TGeoMixture.
-    Int_t i,j;
-    Double_t a;
-    TArrayD wa;
-    TGeoMixture *mi;
-    TGeoMaterial *ma;
-
-    wa.Set(nel);
-    wa.Reset();
-    for(i=0;i<nel;i++) if(w->At(i)>0){
-        mi = dynamic_cast<TGeoMixture*>(mix->At(i));
-        if(mi!=0){ // Mixture
-            a = 0.0;
-            for(j=0;j<mi->GetNelements();j++) a+= mi->GetZmixt()[j];
-            wa[i] =  ((Double_t)(w->At(i)))*a/((Double_t)(mi->GetNelements()));
-        }else{ // Material
-            ma = dynamic_cast<TGeoMaterial*>(mix->At(i));
-            if(ma==0) continue; // don't know what this is.
-            wa[i] = ((Double_t)(w->At(i)))*ma->GetA();
-        } // end if
-    } // end if/for i
-
-    return CreateMixtureByWeight(name,nel,&wa,mix,den);
-}
-//----------------------------------------------------------------------
-TGeoMixture * AliITSv11Geometry::CreateMixtureByWeight(const char* name,
-                                 Int_t nel,const TArrayD *w,
-                                 const TObjArray *mix,Double_t den){
-    // Create a new TGeoMixture object based on a TObject array of
-    // TGeoMixture/TGeoMaterials and their releative weight. For example,
-    // Consider TGeoMixture of "standard shielding blocks" 52% O_2, 32.5% Si,
-    // 6% Ca, 1.5% Na, 2% Fe, and 4% Al.
-    // Inputs:
-    //    const char* name     Name of the new TGeoMixture
-    //          Int_t nel      The number of enteries
-    //    const TArrayD *w     Array of releative Weights of each mixture
-    //    const TObjArray *mix TObjArray holding the TGeoMixtures or 
-    //                         TGeoMaterials which make up this new mixture.
-    //          Double_t   den The density of this new mixture [g/cm^3].
-    // Output:
-    //    none.
-    // Retrun:
-    //    A pointer to a new instance of a TGeoMixture.
-    Int_t i,j,k,n=0;
-    Double_t s=0.0;
-    TArrayD za,aa,wa;
-    TGeoMixture *mi,*mixnew;
-    TGeoMaterial *ma;
-    Bool_t add=kTRUE;
-
-    for(i=0;i<nel;i++) if(w->At(i)>0){
-        mi = dynamic_cast<TGeoMixture*>(mix->At(i));
-        if(mi!=0){
-            for(j=0;j<mi->GetNelements();j++) n++;
-        }else{
-            ma = dynamic_cast<TGeoMaterial*>(mix->At(i));
-            if(ma==0) continue; // don't know what this is.
-            n++;
-        } // end if
-        s += w->At(i);
-    } // end for i
-    if(n<=0) return 0; // No elements found.
-    za.Set(n); za.Reset();
-    aa.Set(n); aa.Reset();
-    wa.Set(n); wa.Reset();
-    TMatrixD wb(n,nel); wb.Zero();
-    //
-    n = 0; // Now use for the number of enteries.
-    for(i=0;i<nel;i++) {
-        for(j=0;j<n;j++) wb(j,i) = 0.0; // zero out array
-        if(w->At(i)>0){
-            mi = dynamic_cast<TGeoMixture*>(mix->At(i));
-            if(mi!=0){
-                for(j=0;j<mi->GetNelements();j++){
-                    for(k=0;k<n;k++){
-                        if(za.At(k)==mi->GetZmixt()[j] && 
-                           aa.At(k)==mi->GetAmixt()[j]){
-                            add = kFALSE;
-                            wb(k,i) = mi->GetWmixt()[j] * w->At(i)/s;
-                            continue;
-                        } // end if
-                        if(add){
-                            za[n]   = mi->GetZmixt()[j];
-                            aa[n]   = mi->GetAmixt()[j];
-                            wb(n,i) = mi->GetWmixt()[j] * w->At(i)/s;
-                            n++;
-                        } // end if
-                        add = kTRUE;
-                    } // end for k
-                } // end for j
-            }else{
-                ma = dynamic_cast<TGeoMaterial*>(mix->At(i));
-                if(ma==0) continue; // don't know what this is.
-                for(k=0;k<n;k++){
-                    if(za.At(k)==ma->GetZ() && aa.At(k)==ma->GetA()){
-                        add = kFALSE;
-                        wb(k,i) = w->At(i)/s;
-                        continue;
-                    } // end if
-                    if(add){
-                        za[n] = ma->GetZ();
-                        aa[n] = ma->GetA();
-                        wb(n,i) = w->At(i)/s;
-                        n++;
-                    } // end if
-                    add = kTRUE;
-                } // end for k
-            } // end if
-        } // end if
-    } // end for i
-    mixnew = new TGeoMixture(name,n,den);
-    k = 0;
-    for(i=0;i<n;i++) {
-        for(j=0;j<nel;j++) wa.AddAt(wb(i,j),i);
-        if(wa.At(i)<=0.0) continue;
-        mixnew->DefineElement(k++,aa.At(i),za.At(i),wa.At(i));
-    } // end for i
-    //
-    return mixnew;
-}
 //______________________________________________________________________
 Double_t AliITSv11Geometry::Yfrom2Points(Double_t x0,Double_t y0,
                                          Double_t x1,Double_t y1,
index b8782ff..94a2a6f 100644 (file)
@@ -17,30 +17,13 @@ class TGeoTube;
 class TGeoTubeSeg;
 class TGeoConeSeg;
 class TGeoBBox;
-class TGeoMixture;
-class TArrayD;
-class TArrayI;
-class TObjArray;
 
 class AliITSv11Geometry : public TObject {
   public:
-    AliITSv11Geometry(){fDebug=0;};
-    AliITSv11Geometry(Int_t debug){fDebug=debug;};
+    AliITSv11Geometry(){fDebug=kTRUE;};
+    AliITSv11Geometry(Bool_t debug){fDebug=debug;};
     virtual ~AliITSv11Geometry(){};
     //
-    virtual TGeoMixture *CreateMixtureByNumber(const char* name,Int_t nel,
-                                               const TArrayI *w,
-                                               const TObjArray *mix,
-                                               Double_t den);
-    virtual TGeoMixture *CreateMixtureByVolume(const char* name,Int_t nel,
-                                               const TArrayD *v,
-                                               const TObjArray *mix,
-                                               Double_t den);
-    virtual TGeoMixture *CreateMixtureByWeight(const char* name,Int_t nel,
-                                               const TArrayD *w,
-                                               const TObjArray *mix,
-                                               Double_t den);
-    //
     // Sets the debug flag for debugging output
     void SetDebug(Int_t level=5){fDebug=level;}
     // Clears the debug flag so no debugging output will be generated
index 663e109..b9b6d66 100644 (file)
@@ -27,7 +27,6 @@
 #include <TMath.h>
 #include <TLatex.h>
 #include <TCanvas.h>
-#include <TView.h>
 #include <TPolyLine.h>
 // Root Geometry includes
 #include <TGeoManager.h>
@@ -40,6 +39,9 @@
 #include <TGeoXtru.h>
 #include <TGeoCompositeShape.h>
 #include <TGeoMatrix.h>
+//#include <TGeoRotation.h>
+//#include <TGeoCombiTrans.h>
+//#include <TGeoTranslation.h>
 #include "AliITSv11GeometrySPD.h"
 
 ClassImp(AliITSv11GeometrySPD)
@@ -47,104 +49,7 @@ ClassImp(AliITSv11GeometrySPD)
 #define SQ(A) (A)*(A)
 
 //______________________________________________________________________
-AliITSv11GeometrySPD::AliITSv11GeometrySPD() : 
-AliITSv11Geometry(),
-fSPDSensitiveVolumeName("ITSSPDDetectorSensitiveVolume"),
-fThickDetector(0.0),
-fThickChip(0.0){
-    // Default Constructor for the AliITSv11GeometrySPD
-    // Inputs:
-    //   none.
-    // Outputs:
-    //   none.
-    // Return:
-    //   One Default Constructed AliITSv11GeometrySPD class
-
-    fThickDetector = fkLadDetectorThick;
-    fThickChip     = fkLadChipHight;
-}
-//______________________________________________________________________
-AliITSv11GeometrySPD::AliITSv11GeometrySPD(Int_t debug) : 
-AliITSv11Geometry(debug),
-fSPDSensitiveVolumeName("ITSSPDDetectorSensitiveVolume"),
-fThickDetector(0.0),
-fThickChip(0.0),
-fkGrdFoilThick(0.05*fgkmm),
-fkGrdFoilWidthA(15.95*fgkmm),
-fkGrdFoilWidthC(4.4*fgkmm),
-fkGrdFoilLngA(139.89*fgkmm),
-fkGrdFoilLngB(11.55*fgkmm),
-fkGrdFoilLngC(82.0*fgkmm),
-fkGrdFoilNholesAB(5),
-fkGrdFoilHoleCenterAB(7.8*fgkmm),
-fkGrdFoilHoleLengthAB(12.0*fgkmm),
-fkGrdFoilHoleWidthAB(7.5*fgkmm),
-fkGrdFoilHoleSpacingAB(14.0*fgkmm),
-fkGrdFoilHoleStartA(1.36*fgkmm),
-fkGrdFoilHoleStartB(73.08*fgkmm),
- // Ladder
-fkLadNChips(5),
-fkLadChipWidth(15950.0*fgkmicron),
-fkLadChipHight(150.0*fgkmicron),
-fkLadChipLength(13490.0*fgkmicron),
-fkLadGlue0Thick(0.100*fgkmm),
-fkLadBumpBondThick(30.0*fgkmicron),
-fkLadDetectorWidth(13700.0*fgkmicron),
-fkLadDetectorThick(200.0*fgkmicron),
-fkLadDetectorLength(70710.0*fgkmicron),
-fkLadSensDetWidth(12800.0*fgkmicron),
-fkLadSensDetThick(200.0*fgkmicron),
-fkLadSensDetLength(69490.0*fgkmicron),
-fkLadChipSpacing0(610.0*fgkmicron),
-fkLadChipSpacing1((fkLadDetectorLength-(2.*fkLadChipSpacing0+
-        ((Double_t)fkLadNChips)*fkLadChipLength))/((Double_t)(fkLadNChips-1)))
-{
-    // Default Constructor for the AliITSv11GeometrySPD
-    // Inputs:
-    //   none.
-    // Outputs:
-    //   none.
-    // Return:
-    //   One Default Constructed AliITSv11GeometrySPD class
-
-    fThickDetector = fkLadDetectorThick;
-    fThickChip     = fkLadChipHight;
-}
-//______________________________________________________________________
-TGeoVolume* AliITSv11GeometrySPD::CenteralSPD(TGeoVolume *moth){
-    // Define The Centeral part of the SPD detector.
-    // Inputs:
-    //   TGeoVolume* moth
-    // Outputs:
-    //  none.
-    // Return:
-    //  TGeoVolume * moth
-    Int_t i=2;
-    TGeoVolume *vHSGF,*vLad,*vMoth;
-    TGeoTube *tube;
-
-    tube = new TGeoTube("ITSSPD Temp SPD Mother voluem",0.0,7.0,17.0);
-    vMoth = new TGeoVolume("ITSSPDTempSPDMotherVolume",tube,0);
-
-    moth->AddNode(vMoth,1,0);
-    switch(i){
-    case 0:
-        CarbonFiberSector(vMoth);
-        break;
-    case 1:
-        vHSGF = CreateHalfStaveGroundFoil();
-        vMoth->AddNode(vHSGF,1,0);
-        break;
-    case 2:
-        vLad  = CreateSPDLadder();
-        vMoth->AddNode(vLad,1,0);
-        break;
-    } // end sithch
-
-    return moth;
-}
-//______________________________________________________________________
-TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
+void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     // Define the detail SPD Carbon fiber support Sector geometry.
     // Based on the drawings ALICE-Pixel "Construzione Profilo Modulo"
     // March 25 2004 and ALICE-SUPPORTO "construzione Profilo Modulo"
@@ -152,12 +57,11 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     // center of the arc is outside of the object.
     // February 16 2004.
     // Inputs:
-    //   TGeoVolume* moth   The mother volume which this object is to be
-    //                      placed in
+    //   none.
     // Outputs:
     //  none.
     // Return:
-    //  TGeoVolume*
+    //  none.
     TGeoManager *mgr = gGeoManager;
     TGeoMedium *medSPDcf  = 0; // SPD support cone Carbon Fiber materal number.
     //TGeoMedium *medSPDfs  = 0; // SPD support cone inserto stesalite 4411w.
@@ -186,7 +90,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecX1   = -13.187*fgkmm;
     const Double_t ksecY1   = -19.964*fgkmm;
     const Double_t ksecR1   = +0.6*fgkmm; // Inside
-    //const Double_t ksecDip0 = 5.9*fgkmm;
+    const Double_t ksecDip0 = 5.9*fgkmm;
     //
     const Double_t ksecX2   = -3.883*fgkmm;
     const Double_t ksecY2   = -17.805*fgkmm;
@@ -194,7 +98,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecX3   = -3.123*fgkmm;
     const Double_t ksecY3   = -14.618*fgkmm;
     const Double_t ksecR3   = -0.6*fgkmm; // Outside
-    //const Double_t ksecDip1 = 8.035*fgkmm;
+    const Double_t ksecDip1 = 8.035*fgkmm;
     //
     const Double_t ksecX4   = +11.280*fgkmm;
     const Double_t ksecY4   = -14.473*fgkmm;
@@ -202,7 +106,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecX5   = +19.544*fgkmm;
     const Double_t ksecY5   = +10.961*fgkmm;
     const Double_t ksecR5   = +0.8*fgkmm; // Inside
-    //const Double_t ksecDip2 = 4.553*fgkmm;
+    const Double_t ksecDip2 = 4.553*fgkmm;
     //
     const Double_t ksecX6   = +10.830*fgkmm;
     const Double_t ksecY6   = +16.858*fgkmm;
@@ -210,7 +114,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecX7   = +11.581*fgkmm;
     const Double_t ksecY7   = +13.317*fgkmm;
     const Double_t ksecR7   = -0.6*fgkmm; // Outside
-    //const Double_t ksecDip3 = 6.978*fgkmm;
+    const Double_t ksecDip3 = 6.978*fgkmm;
     //
     const Double_t ksecX8   = -0.733*fgkmm;
     const Double_t ksecY8   = +17.486*fgkmm;
@@ -218,7 +122,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecX9   = +0.562*fgkmm;
     const Double_t ksecY9   = +14.486*fgkmm;
     const Double_t ksecR9   = -0.6*fgkmm; // Outside
-    //const Double_t ksecDip4 = 6.978*fgkmm;
+    const Double_t ksecDip4 = 6.978*fgkmm;
     //
     const Double_t ksecX10  = -12.252*fgkmm;
     const Double_t ksecY10  = +16.298*fgkmm;
@@ -226,7 +130,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecX11  = -10.445*fgkmm;
     const Double_t ksecY11  = +13.162*fgkmm;
     const Double_t ksecR11  = -0.6*fgkmm; // Outside
-    //const Double_t ksecDip5 = 6.978*fgkmm;
+    const Double_t ksecDip5 = 6.978*fgkmm;
     //
     const Double_t ksecX12  = -22.276*fgkmm;
     const Double_t ksecY12  = +12.948*fgkmm;
@@ -236,7 +140,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecR13  = -0.8*fgkmm; // Outside
     const Double_t ksecAngleSide13 = 36.0*fgkDegree;
     //
-    const Int_t ksecNRadii = 20;
+    const Int_t ksecNRadii = 14;
     const Int_t ksecNPointsPerRadii = 4;
     const Int_t ksecNCoolingTubeDips = 6;
     // Since the Rounded parts are aproximated by a regular polygon and
@@ -248,10 +152,10 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     //const Double_t ksecZFlangLen= 45.00*fgkmm;
     const Double_t ksecTl       = 0.860*fgkmm;
     const Double_t ksecCthick2  = 0.600*fgkmm;
-    //const Double_t ksecCthick3  = 1.800*fgkmm;
-    //const Double_t ksecSidelen  = 22.00*fgkmm;
-    //const Double_t ksecSideD5   = 3.679*fgkmm;
-    //const Double_t ksecSideD12  = 7.066*fgkmm;
+    const Double_t ksecCthick3  = 1.800*fgkmm;
+    const Double_t ksecSidelen  = 22.00*fgkmm;
+    const Double_t ksecSideD5   = 3.679*fgkmm;
+    const Double_t ksecSideD12  = 7.066*fgkmm;
     const Double_t ksecRCoolOut = 2.400*fgkmm;
     const Double_t ksecRCoolIn  = 2.000*fgkmm;
     const Double_t ksecDl1      = 5.900*fgkmm;
@@ -260,117 +164,79 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     const Double_t ksecDl4      = 6.978*fgkmm;
     const Double_t ksecDl5      = 6.978*fgkmm;
     const Double_t ksecDl6      = 6.978*fgkmm;
-    const Double_t ksecCoolTubeThick  = 0.04*fgkmm;
-    const Double_t ksecCoolTubeROuter = 2.6*fgkmm;
-    const Double_t ksecCoolTubeFlatX  = 3.696*fgkmm;
-    const Double_t ksecCoolTubeFlatY  = 0.68*fgkmm;
-    //const Double_t ksecBeamX0   = 0.0*fgkmm; // guess
-    //const Double_t ksecBeamY0   = (15.223+40.)*fgkmm; // guess
+    const Double_t ksecCoolTubeThick = 10.0*fgkmicron;
     //
-    const Int_t ksecNPoints = (ksecNPointsPerRadii+1)*ksecNRadii + 8;
-    Double_t secX[ksecNRadii] = {ksecX0,ksecX1,-1000.0,ksecX2 ,ksecX3 ,-1000.0,
-                                 ksecX4,ksecX5,-1000.0,ksecX6 ,ksecX7 ,-1000.0,
-                                 ksecX8,ksecX9,-1000.0,ksecX10,ksecX11,-1000.0,
+    const Int_t ksecNPoints = (ksecNPointsPerRadii+1)*(ksecNRadii+
+                               ksecNCoolingTubeDips) + 8;
+    Double_t secX[ksecNRadii] = {ksecX0,ksecX1,ksecX2,ksecX3,ksecX4,ksecX5,
+                                 ksecX6,ksecX7,ksecX8,ksecX9,ksecX10,ksecX11,
                                  ksecX12,-1000.0};
-    Double_t secY[ksecNRadii] = {ksecY0,ksecY1,-1000.0,ksecY2 ,ksecY3 ,-1000.0,
-                                 ksecY4,ksecY5,-1000.0,ksecY6 ,ksecY7 ,-1000.0,
-                                 ksecY8,ksecY9,-1000.0,ksecY10,ksecY11,-1000.0,
+    Double_t secY[ksecNRadii] = {ksecY0,ksecY1,ksecY2,ksecY3,ksecY4,ksecY5,
+                                 ksecY6,ksecY7,ksecY8,ksecY9,ksecY10,ksecY11,
                                  ksecY12,-1000.0};
-    Double_t secR[ksecNRadii] ={ksecR0 ,ksecR1 ,-.5*ksecDipLength-ksecDipRadii,
-                                ksecR2 ,ksecR3 ,-.5*ksecDipLength-ksecDipRadii,
-                                ksecR4 ,ksecR5 ,-.5*ksecDipLength-ksecDipRadii,
-                                ksecR6 ,ksecR7 ,-.5*ksecDipLength-ksecDipRadii,
-                                ksecR8 ,ksecR9 ,-.5*ksecDipLength-ksecDipRadii,
-                                ksecR10,ksecR11,-.5*ksecDipLength-ksecDipRadii,
-                                ksecR12,ksecR13};/*
-    Double_t secDip[ksecNRadii]={0.0,0.0,ksecDip0,0.0,0.0,ksecDip1,
-                                 0.0,0.0,ksecDip2,0.0,0.0,ksecDip3,
-                                 0.0,0.0,ksecDip4,0.0,0.0,ksecDip5,
-                                 0.0,0.0};*/
-    Double_t secX2[ksecNRadii];
-    Double_t secY2[ksecNRadii];
-    Double_t secR2[ksecNRadii] = {
+    Double_t secR[ksecNRadii] = {ksecR0,ksecR1,ksecR2,ksecR3,ksecR4,ksecR5,
+                                 ksecR6,ksecR7,ksecR8,ksecR9,ksecR10,ksecR11,
+                                 ksecR12,ksecR13};
+    Double_t secDip[ksecNRadii]={0.0,ksecDip0,0.0,ksecDip1,0.0,ksecDip2,0.0,
+                                 ksecDip3,0.0,ksecDip4,0.0,ksecDip5,0.0,0.0};
+    Double_t secX2[ksecNRadii+ksecNCoolingTubeDips] = {
+        ksecX0,ksecX1,-1000.,ksecX2,ksecX3,-1000.,ksecX4,ksecX5,
+        -1000.,ksecX6,ksecX7,-1000.,ksecX8,ksecX9,-1000.,
+        ksecX10,ksecX11,-1000.,ksecX12,-1000.0};
+    Double_t secY2[ksecNRadii+ksecNCoolingTubeDips] = {
+        ksecY0,ksecY1,-1000.,ksecY2,ksecY3,-1000.,ksecY4,ksecY5,
+        -1000.,ksecY6,ksecY7,-1000.,ksecY8,ksecY9,-1000.,
+        ksecY10,ksecY11,-1000.,ksecY12,-1000.0};
+    Double_t secR2[ksecNRadii+ksecNCoolingTubeDips] = {
         ksecR0,ksecR1,ksecRCoolOut,ksecR2,ksecR3,ksecRCoolOut,ksecR4,ksecR5,
         ksecRCoolOut,ksecR6,ksecR7,ksecRCoolOut,ksecR8,ksecR9,ksecRCoolOut,
         ksecR10,ksecR11,ksecRCoolOut,ksecR12,ksecR13};
-    Double_t secDip2[ksecNCoolingTubeDips]={ksecDl1,ksecDl2,ksecDl3,
-                                            ksecDl4,ksecDl5,ksecDl6};
-    Double_t secX3[ksecNRadii];
-    Double_t secY3[ksecNRadii];
+    Double_t secDip2[ksecNRadii]={0.0,ksecDl1,0.0,ksecDl2,0.0,ksecDl3,0.0,
+                                 ksecDl4,0.0,ksecDl5,0.0,ksecDl6,0.0,0.0};
     const Int_t ksecDipIndex[ksecNCoolingTubeDips] = {2,5,8,11,14,17};
     Double_t secAngleStart[ksecNRadii];
     Double_t secAngleEnd[ksecNRadii];
-    Double_t secAngleStart2[ksecNRadii];
-    Double_t secAngleEnd2[ksecNRadii];
-    Double_t secAngleTurbo[ksecNCoolingTubeDips] = {0.0,0.0,0.0,0.0,0.0,0.0};
-    //Double_t secAngleStart3[ksecNRadii];
-    //Double_t secAngleEnd3[ksecNRadii];
-    Double_t xpp[ksecNPoints],ypp[ksecNPoints];
-    Double_t xpp2[ksecNPoints],ypp2[ksecNPoints];
-    Double_t *xp[ksecNRadii],*xp2[ksecNRadii];
-    Double_t *yp[ksecNRadii],*yp2[ksecNRadii];
+    Double_t secAngleStart2[ksecNRadii+ksecNCoolingTubeDips];
+    Double_t secAngleEnd2[ksecNRadii+ksecNCoolingTubeDips];
+    Double_t secAngleStart3[ksecNRadii+ksecNCoolingTubeDips];
+    Double_t secAngleEnd3[ksecNRadii+ksecNCoolingTubeDips];
+    Double_t xp[ksecNPoints],yp[ksecNPoints];
     TGeoXtru *sA0,*sA1,*sB0,*sB1;
     TGeoEltu *sTA0,*sTA1;
-    TGeoTube *sTB0,*sTB1,*sM0;
+    TGeoTube *sTB0,*sTB1;
     TGeoRotation    *rot;
     TGeoTranslation *trans;
     TGeoCombiTrans  *rotrans;
     Double_t t,t0,t1,a,b,x0,y0,x1,y1;
-    Int_t i,j,k,m;
-    Bool_t tst;
+    Int_t i,j,k;
 
     if(moth==0){
         Error("CarbonFiberSector","moth=%p",moth);
-        return moth;
+        return;
     } // end if moth==0
-    //SetDebug(3);
-    for(i=0;i<ksecNRadii;i++){
-        xp[i]  = &(xpp[i*(ksecNPointsPerRadii+1)]);
-        yp[i]  = &(ypp[i*(ksecNPointsPerRadii+1)]);
-        xp2[i] = &(xpp2[i*(ksecNPointsPerRadii+1)]);
-        yp2[i] = &(ypp2[i*(ksecNPointsPerRadii+1)]);
-        secX2[i] = secX[i];
-        secY2[i] = secY[i];
-        secX3[i] = secX[i];
-        secY3[i] = secY[i];
-    } // end for i
+    SetDebug(3);
 
-    // Find starting and ending angles for all but cooling tube sections
     secAngleStart[0] = 0.5*ksecAngleSide13;
     for(i=0;i<ksecNRadii-2;i++){
-        tst = kFALSE;
-        for(j=0;j<ksecNCoolingTubeDips;j++) tst = tst||i==ksecDipIndex[j];
-        if(tst) continue;
-        tst = kFALSE;
-        for(j=0;j<ksecNCoolingTubeDips;j++) tst = tst||(i+1)==ksecDipIndex[j];
-        if(tst) j = i+2;
-        else j = i+1;
         AnglesForRoundedCorners(secX[i],secY[i],secR[i],
-                                secX[j],secY[j],secR[j],t0,t1);
-        secAngleEnd[i]   = t0;
-        secAngleStart[j] = t1;
-        if(secR[i]>0.0&&secR[j]>0.0)if(secAngleStart[i]>secAngleEnd[i])
+                                secX[i+1],secY[i+1],secR[i+1],t0,t1);
+        secAngleEnd[i]     = t0;
+        if(secR[i]>0.0&&secR[i+1]>0.0)if(secAngleStart[i]>secAngleEnd[i])
             secAngleEnd[i] += 360.0;
-        secAngleStart2[i] = secAngleStart[i];
-        secAngleEnd2[i]   = secAngleEnd[i];
+        secAngleStart[i+1] = t1;
     } // end for i
     secAngleEnd[ksecNRadii-2]   = secAngleStart[ksecNRadii-2] + 
-                                     (secAngleEnd[ksecNRadii-5]-
-                                      secAngleStart[ksecNRadii-5]);
+                                     (secAngleEnd[10]-secAngleStart[10]);
     if(secAngleEnd[ksecNRadii-2]<0.0) secAngleEnd[ksecNRadii-2] += 360.0;
     secAngleStart[ksecNRadii-1] = secAngleEnd[ksecNRadii-2] - 180.0;
     secAngleEnd[ksecNRadii-1]   = secAngleStart[0];
-    secAngleStart2[ksecNRadii-2] = secAngleStart[ksecNRadii-2];
-    secAngleEnd2[ksecNRadii-2]   = secAngleEnd[ksecNRadii-2];
-    secAngleStart2[ksecNRadii-1] = secAngleStart[ksecNRadii-1];
-    secAngleEnd2[ksecNRadii-1]   = secAngleEnd[ksecNRadii-1];
-    // Find location of circle last rounded corner.
+    //
     i = 0;
     j = ksecNRadii-2;
     t0 = TanD(secAngleStart[i]-90.);
     t1 = TanD(secAngleEnd[j]-90.);
     t  = secY[i] - secY[j];
-    // Note, secR[i=0] <0; secR[j=18]>0; and secR[j+1=19] <0
+    // Note, secR[i=0] <0; secR[j=12]>0; and secR[j+1=13] <0
     t += (-secR[i]+secR[j+1])*SinD(secAngleStart[i]);
     t -= (secR[j]-secR[j+1])*SinD(secAngleEnd[j]);
     t += t1*secX[j] - t0*secX[i];
@@ -379,179 +245,448 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     secX[ksecNRadii-1] = t/(t1-t0);
     secY[ksecNRadii-1] = TanD(90.+0.5*ksecAngleSide13)*
                           (secX[ksecNRadii-1]-secX[0]) + secY[0];
-    secX2[ksecNRadii-1] = secX[ksecNRadii-1];
-    secY2[ksecNRadii-1] = secY[ksecNRadii-1];
-    secX3[ksecNRadii-1] = secX[ksecNRadii-1];
-    secY3[ksecNRadii-1] = secY[ksecNRadii-1];
-    // find location of cooling tube centers
-    for(i=0;i<ksecNCoolingTubeDips;i++){
-        j = ksecDipIndex[i];
-        x0 = secX[j-1] + TMath::Abs(secR[j-1])*CosD(secAngleEnd[j-1]);
-        y0 = secY[j-1] + TMath::Abs(secR[j-1])*SinD(secAngleEnd[j-1]);
-        x1 = secX[j+1] + TMath::Abs(secR[j+1])*CosD(secAngleStart[j+1]);
-        y1 = secY[j+1] + TMath::Abs(secR[j+1])*SinD(secAngleStart[j+1]);
-        t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
-        t  = secDip2[i]/t0;
-        a  = x0+(x1-x0)*t;
-        b  = y0+(y1-y0)*t;
-        if(a+b*(a-x0)/(b-y0)>0.0){
-            secX[j] = a + TMath::Abs(y1-y0)*2.0*ksecDipRadii/t0;
-            secY[j] = b - TMath::Sign(2.0*ksecDipRadii,y1-y0)*(x1-x0)/t0;
-            secX2[j] = a + TMath::Abs(y1-y0)*ksecTl/t0;
-            secY2[j] = b - TMath::Sign(ksecTl,y1-y0)*(x1-x0)/t0;
-            secX3[j] = a + TMath::Abs(y1-y0)*(2.0*ksecDipRadii-
-                                              0.5*ksecCoolTubeFlatY)/t0;
-            secY3[j] = b - TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
-                                       y1-y0)*(x1-x0)/t0;
-        }else{
-            secX[j] = a - TMath::Abs(y1-y0)*2.0*ksecDipRadii/t0;
-            secY[j] = b + TMath::Sign(2.0*ksecDipRadii,y1-y0)*(x1-x0)/t0;
-            secX2[j] = a - TMath::Abs(y1-y0)*ksecTl/t0;
-            secY2[j] = b + TMath::Sign(ksecTl,y1-y0)*(x1-x0)/t0;
-            secX3[j] = a - TMath::Abs(y1-y0)*(2.0*ksecDipRadii-
-                                              0.5*ksecCoolTubeFlatY)/t0;
-            secY3[j] = b + TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
-                                       y1-y0)*(x1-x0)/t0;
-        } // end if
-        // Set up Start and End angles to correspond to start/end of dips.
-        t1 = (secDip2[i]-TMath::Abs(secR[j]))/t0;
-        secAngleStart[j] = TMath::RadToDeg()*TMath::ATan2(
-                               y0+(y1-y0)*t1-secY[j],x0+(x1-x0)*t1-secX[j]);
-        if(secAngleStart[j]<0.0) secAngleStart[j] += 360.0;
-        secAngleStart2[j] = secAngleStart[j];
-        t1 = (secDip2[i]+TMath::Abs(secR[j]))/t0;
-        secAngleEnd[j] = TMath::RadToDeg()*TMath::ATan2(
-                               y0+(y1-y0)*t1-secY[j],x0+(x1-x0)*t1-secX[j]);
-        if(secAngleEnd[j]<0.0) secAngleEnd[j] += 360.0;
-        secAngleEnd2[j]   = secAngleEnd[j];
-        if(secAngleEnd[j]>secAngleStart[j]) secAngleEnd[j] -= 360.0;
-        secR[j] = TMath::Sqrt(secR[j]*secR[j]+4.0*ksecDipRadii*ksecDipRadii);
-    } // end if
-    // Spcial cases
-    secAngleStart2[8] -= 360.;
-    secAngleStart2[11] -= 360.;
     //
-    SPDsectorShape(ksecNRadii,secX,secY,secR,secAngleStart,secAngleEnd,
-                   ksecNPointsPerRadii,m,xp,yp);
-    //  Fix up dips to be square.
-    for(i=0;i<ksecNCoolingTubeDips;i++){
-        j = ksecDipIndex[i];
-        t = 0.5*ksecDipLength+ksecDipRadii;
-        t0 = TMath::RadToDeg()*TMath::ATan(2.0*ksecDipRadii/t);
-        t1 = secAngleEnd[j] + t0;
-        t0 = secAngleStart[j] - t0;
-        x0 = xp[j][1] = secX[j] + t*CosD(t0);
-        y0 = yp[j][1] = secY[j] + t*SinD(t0);
-        x1 = xp[j][ksecNPointsPerRadii-1] = secX[j] + t*CosD(t1);
-        y1 = yp[j][ksecNPointsPerRadii-1] = secY[j] + t*SinD(t1);
-        t0 = 1./((Double_t)(ksecNPointsPerRadii-2));
-        for(k=2;k<ksecNPointsPerRadii-1;k++){// extra points spread them out.
-            t = ((Double_t)(k-1))*t0;
-            xp[j][k] = x0+(x1-x0)*t;
-            yp[j][k] = y0+(y1-y0)*t;
+    if(GetDebug(2)){
+        cout <<"    X    \t  Y  \t  R  \t  S  \t  E"<<endl;
+        for(i=0;i<ksecNRadii;i++){
+            cout <<"{"<< secX[i] <<",";
+            cout << secY[i] <<",";
+            cout << secR[i] <<",";
+            cout << secAngleStart[i] <<",";
+            cout << secAngleEnd[i] <<"},"<< endl;
+        } // end for i
+    } // end if GetDebug
+    //
+    if(GetDebug(3)) cout <<"Double_t sA0[][";
+    if(GetDebug(4)) cout <<"3]{";
+    else if(GetDebug(3)) cout <<"2]{";
+    j = -1;
+    t0 = (Double_t)ksecNPointsPerRadii;
+    for(i=0;i<ksecNRadii;i++){
+        t1 = (secAngleEnd[i]-secAngleStart[i])/t0;
+        if(GetDebug(5)) cout<<"t1="<< t1<<endl;
+        for(k=0;k<=ksecNPointsPerRadii;k++){
+            t=secAngleStart[i]+((Double_t)k)*t1;
+            j++;
+            xp[j] = TMath::Abs(secR[i])*CosD(t)+secX[i];
+            yp[j] = TMath::Abs(secR[i])*SinD(t)+secY[i];
+            if(GetDebug(3)){
+                cout << "{"<<xp[j]<<","<<yp[j];
+                if(GetDebug(4)) cout <<","<<t;
+                cout <<"},";
+            } // end if GetDebug
         } // end for k
-        secAngleTurbo[i] = -TMath::RadToDeg()*TMath::ATan2(y1-y0,x1-x0);
-        if(GetDebug(3)){ 
-            Info("CarbonFiberSector","i=%d angle=%f x0,y0{%f,%f} "
-                 "x1y1={%f,%f,}",i,secAngleTurbo[i],x0,0,x1,y1);
-        } // end if
-    } // end for i
+        if(GetDebug(3)) cout << endl;
+        t = secAngleEnd[i];
+        a = ksecDipLength+2.0*(ksecDipRadii);
+        b = secDip[i]-0.5*a;
+        switch (i){
+        case 1: case 5: // Dip0,2
+            j++;
+            xp[j] = xp[j-1]-b*CosD(t-90.);
+            yp[j] = yp[j-1]-b*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]-(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]-(2.0*ksecDipRadii)*SinD(t);
+            j++;
+            xp[j] = xp[j-1]-a*CosD(t-90.);
+            yp[j] = yp[j-1]-a*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]+(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]+(2.0*ksecDipRadii)*SinD(t);
+            if(GetDebug(3))for(k=-3;k<=0;k++){
+                cout << "{"<<xp[j+k]<<","<<yp[j+k];
+                if(GetDebug(4)) cout <<","<<0.0;
+                cout <<"},";
+            } // end if GetDebug
+            if(GetDebug(3)) cout << endl;
+            break;
+        case 3: case 7: case 9: case 11:// Dip 1,3,4,5
+            j++;
+            xp[j] = xp[j-1]+b*CosD(t-90.);
+            yp[j] = yp[j-1]+b*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]+(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]+(2.0*ksecDipRadii)*SinD(t);
+            j++;
+            xp[j] = xp[j-1]+a*CosD(t-90.);
+            yp[j] = yp[j-1]+a*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]-(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]-(2.0*ksecDipRadii)*SinD(t);
+            if(GetDebug(3))for(k=-3;k<=0;k++){
+                cout << "{"<<xp[j+k]<<","<<yp[j+k];
+                if(GetDebug(4)) cout <<","<<0.0;
+                cout <<"},";
+            } // end if GetDebug
+            if(GetDebug(3)) cout << endl;
+            break;
+        default:
+            break;
+        } // end switch
+    } // end of i
+    if(GetDebug(3)) cout<<"{"<<xp[0]<<","<<yp[0];
+    if(GetDebug(4)) cout<<","<< secAngleStart[0];
+    if(GetDebug(3)) cout<<"}} j="<<j<<endl;
     sA0 = new TGeoXtru(2);
     sA0->SetName("ITS SPD Carbon fiber support Sector A0");
-    sA0->DefinePolygon(m,xpp,ypp);
+    sA0->DefinePolygon(j+1,xp,yp);
     sA0->DefineSection(0,-ksecDz);
     sA0->DefineSection(1,ksecDz);
     //
-    InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],
-                ksecCthick,xpp2[0],ypp2[0]);
-    for(i=1;i<m-1;i++){
-        j = i/(ksecNPointsPerRadii+1);
-        InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],
-                    ksecCthick,xpp2[i],ypp2[i]);
-    } // end for i
-    InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
-                ksecCthick,xpp2[m-1],ypp2[m-1]);
-    // Fix center value of cooling tube dip.
-    // find location of cooling tube centers
-    for(i=0;i<ksecNCoolingTubeDips;i++){
-        j = ksecDipIndex[i];
-        x0 = xp2[j][1];
-        y0 = yp2[j][1];
-        x1 = xp2[j][ksecNPointsPerRadii-1];
-        y1 = yp2[j][ksecNPointsPerRadii-1];
-        t0 = TMath::Sqrt((x0-x1)*(x0-x1)+(y0-y1)*(y0-y1));
-        t  = secDip2[i]/t0;
-        for(k=2;k<ksecNPointsPerRadii-1;k++){// extra points spread them out.
-            t = ((Double_t)(k-1))*t0;
-            xp2[j][k] = x0+(x1-x0)*t;
-            yp2[j][k] = y0+(y1-y0)*t;
-        } // end for k
-    } // end for i
+    if(GetDebug(3)) cout <<"Double_t sA1[][{";
+    if(GetDebug(4)) cout <<"3]{";
+    else if(GetDebug(3)) cout <<"2]{";
+    j = -1;
+    t0 = (Double_t)ksecNPointsPerRadii;
+    for(i=0;i<ksecNRadii;i++){
+        t1 = (secAngleEnd[i]-secAngleStart[i])/t0;
+        if(GetDebug(5)) cout<<"t1="<< t1<<endl;
+        for(k=0;k<=ksecNPointsPerRadii;k++){
+            t=secAngleStart[i]+((Double_t)k)*t1;
+            j++;
+            xp[j] = TMath::Abs(secR[i]-ksecCthick)*CosD(t)+secX[i];
+            yp[j] = TMath::Abs(secR[i]-ksecCthick)*SinD(t)+secY[i];
+            if(GetDebug(3)){
+                cout << "{"<<xp[j]<<","<<yp[j];
+                if(GetDebug(4)) cout <<","<<t;
+                cout <<"},";
+            } // end if GetDebug
+        } // end for t
+        if(GetDebug(3)) cout << endl;
+        t = secAngleEnd[i];
+        a = ksecDipLength+2.0*(ksecDipRadii+ksecCthick);
+        b = secDip[i]-0.5*a;
+        switch (i){
+        case 1: case 5: // Dip0,2
+            j++;
+            xp[j] = xp[j-1]-b*CosD(t-90.);
+            yp[j] = yp[j-1]-b*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]-(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]-(2.0*ksecDipRadii)*SinD(t);
+            j++;
+            xp[j] = xp[j-1]-a*CosD(t-90.);
+            yp[j] = yp[j-1]-a*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]+(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]+(2.0*ksecDipRadii)*SinD(t);
+            if(GetDebug(3))for(k=-3;k<=0;k++){
+                cout << "{"<<xp[j+k]<<","<<yp[j+k];
+                if(GetDebug(4)) cout <<",t="<<0.0;
+                cout <<"},";
+            } // end if GetDebug
+            if(GetDebug(3)) cout << endl;
+            break;
+        case 3: case 7: case 9: case 11:// Dip 1,3,4,5
+            j++;
+            xp[j] = xp[j-1]+b*CosD(t-90.);
+            yp[j] = yp[j-1]+b*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]+(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]+(2.0*ksecDipRadii)*SinD(t);
+            j++;
+            xp[j] = xp[j-1]+a*CosD(t-90.);
+            yp[j] = yp[j-1]+a*SinD(t-90.);
+            j++;
+            xp[j] = xp[j-1]-(2.0*ksecDipRadii)*CosD(t);
+            yp[j] = yp[j-1]-(2.0*ksecDipRadii)*SinD(t);
+            if(GetDebug(3))for(k=-3;k<=0;k++){
+                cout << "{"<<xp[j+k]<<","<<yp[j+k];
+                if(GetDebug(4)) cout <<",t="<<0.0;
+                cout <<"},";
+            } // end if GetDebug
+            if(GetDebug(3)) cout << endl;
+            break;
+        default:
+            break;
+        } // end switch
+    } // end of i
+    if(GetDebug(3)) cout<<"{"<<xp[0]<<","<<yp[0];
+    if(GetDebug(4)) cout<<","<< secAngleStart[0];
+    if(GetDebug(3)) cout<<"}} j="<<j<<endl;
     sA1 = new TGeoXtru(2);
     sA1->SetName("ITS SPD Carbon fiber support Sector Air A1");
-    sA1->DefinePolygon(m,xpp2,ypp2);
+    sA1->DefinePolygon(j+1,xp,yp);
     sA1->DefineSection(0,-ksecDz);
     sA1->DefineSection(1,ksecDz);
     //
-    // Error in TGeoEltu. Semi-axis X must be < Semi-axis Y (?).
     sTA0 = new TGeoEltu("ITS SPD Cooling Tube TA0",
-                      0.5* ksecCoolTubeFlatY, 0.5* ksecCoolTubeFlatX,ksecDz);
+                       ksecDipRadii,0.5*ksecDipLength,ksecDz);
     sTA1 = new TGeoEltu("ITS SPD Cooling Tube coolant TA1",
                         sTA0->GetA()-ksecCoolTubeThick,
                         sTA0->GetB()-ksecCoolTubeThick,ksecDz);
     //
-    SPDsectorShape(ksecNRadii,secX2,secY2,secR2,secAngleStart2,secAngleEnd2,
-                   ksecNPointsPerRadii,m,xp,yp);
+    j = 0;
+    for(i=0;i<ksecNRadii;i++){
+        secAngleStart2[j] = secAngleStart[i];
+        secAngleEnd2[j]   = secAngleEnd[i];
+        secAngleStart3[j] = secAngleStart2[j];
+        secAngleEnd3[j]   = secAngleEnd2[j];
+        secX2[j]          = secX[i];
+        secY2[j]          = secY[i];
+        secR2[j]          = secR[i];
+        j++;
+        t = secAngleEnd[i];
+        switch (i){
+        case 1: case 5: // Tube 0,2
+            x0 = secX[i] + TMath::Abs(secR[i])*CosD(t); // last point of turn
+            y0 = secY[i] + TMath::Abs(secR[i])*SinD(t);
+            x1 = x0-secDip2[i]*CosD(t-90.);  // center point of dip 
+            y1 = y0-secDip2[i]*SinD(t-90.);  // along line
+            secX2[j] = x1-ksecTl*CosD(t);  // location of circle center.
+            secY2[j] = y1-ksecTl*SinD(t);
+            x1 = secX[i+1]+TMath::Abs(secR[i+1])*CosD(secAngleStart2[i+1]);
+            y1 = secY[i+1]+TMath::Abs(secR[i+1])*SinD(secAngleStart2[i+1]);
+            //Find starting and ending angles, break if error.
+            if(!AngleOfIntersectionWithLine(x0,y0,x1,y1,secX2[j],secY2[j],
+            secR2[j],secAngleStart2[j],secAngleEnd2[j]))break;
+            // thicknes of Carbon fiber over the cooling tubes.
+            a  = ksecRCoolOut-ksecRCoolIn;
+            // last point of turn
+            x0 = secX[i]+(TMath::Abs(secR[i])-ksecCthick2)*CosD(t);
+            y0 = secY[i]+(TMath::Abs(secR[i])-ksecCthick2)*SinD(t);
+            x1 = secX[i+1]+(TMath::Abs(secR[i+1])-ksecCthick2)*CosD(secAngleStart3[i+1]);
+            y1 = secY[i+1]+(TMath::Abs(secR[i+1])-ksecCthick2)*SinD(secAngleStart3[i+1]);
+            //Find starting and ending angles, break if error.
+            if(!AngleOfIntersectionWithLine(x0,y0,x1,y1,secX2[j],secY2[j],
+            secR2[j]-a,secAngleStart3[j],secAngleEnd3[j]))break;
+            if(i==1) { // Fix odd case.
+                x0 = secAngleStart3[j];
+                secAngleStart3[j] = secAngleEnd3[j] - 360.0;
+                secAngleEnd3[j] = x0;
+            } // end if i==1
+            if(i==5) { // Fix odd case.
+                x0 = secAngleStart2[j];
+                secAngleStart2[j] = secAngleEnd2[j] - 360.0;
+                secAngleEnd2[j] = x0;
+                x0 = secAngleStart3[j];
+                secAngleStart3[j] = secAngleEnd3[j] - 360.0;
+                secAngleEnd3[j] = x0;
+            } // end if i==5
+            // Because a polygon is replacing the rounded surface, the
+            // radius of the polygon must be larger to make room for the
+            // cooling tube of the same size. The radio of the radii of
+            // a circle fitting the inside/outside of a regualr polygon
+            // is given by Cos(180/n) where n is the number of sides of the
+            // regurla polygon. In this case, it is scalled for the partical
+            // circles involved.
+            secR2[j] = secR2[j]/CosD(0.5*(secAngleEnd[j]-secAngleStart[j])/
+                                     ((Double_t)ksecNPointsPerRadii));
+            j++;
+            break;
+        case 3: case 7: case 9: case 11:// Tube 1,2,4,5,6
+            x0 = secX[i] + TMath::Abs(secR[i])*CosD(t); // last point of turn
+            y0 = secY[i] + TMath::Abs(secR[i])*SinD(t);
+            x1 = x0+secDip2[i]*CosD(t-90.);  // center point of dip 
+            y1 = y0+secDip2[i]*SinD(t-90.);  // along line
+            secX2[j] = x1+ksecTl*CosD(t);  // location of circle center.
+            secY2[j] = y1+ksecTl*SinD(t);
+            x1 = secX[i+1]+TMath::Abs(secR[i+1])*CosD(secAngleStart2[i+1]);
+            y1 = secY[i+1]+TMath::Abs(secR[i+1])*SinD(secAngleStart2[i+1]);
+            if(!AngleOfIntersectionWithLine(x0,y0,x1,y1,secX2[j],secY2[j],
+            secR2[j],secAngleStart2[j],secAngleEnd2[j]))break;//don't intersect
+            // thicknes of Carbon fiber over the cooling tubes.
+            a  = ksecRCoolOut-ksecRCoolIn;
+            // last point of turn
+            x0 = secX[i] + (TMath::Abs(secR[i])+ksecCthick2)*CosD(t);
+            y0 = secY[i] + (TMath::Abs(secR[i])+ksecCthick2)*SinD(t);
+            x1 = secX[i+1]+(TMath::Abs(secR[i+1])-ksecCthick2)*CosD(secAngleStart3[i+1]);
+            y1 = secY[i+1]+(TMath::Abs(secR[i+1])-ksecCthick2)*SinD(secAngleStart3[i+1]);
+            //Find starting and ending angles, break if error.
+            if(!AngleOfIntersectionWithLine(x0,y0,x1,y1,secX2[j],secY2[j],
+            secR2[j]-a,secAngleStart3[j],secAngleEnd3[j]))break;
+            if(i==7) { // Fix odd case
+                x0 = secAngleStart2[j];
+                secAngleStart2[j] = secAngleEnd2[j] - 360.0;
+                secAngleEnd2[j] = x0;
+                x0 = secAngleStart3[j];
+                secAngleStart3[j] = secAngleEnd3[j] - 360.0;
+                secAngleEnd3[j] = x0;
+            } // end if i==7
+            if(i==9) { // Fix odd case
+                x0 = secAngleStart3[j];
+                secAngleStart3[j] = secAngleEnd3[j] - 360.0;
+                secAngleEnd3[j] = x0;
+            } // end if i==7
+            // Because a polygon is replacing the rounded surface, the
+            // radius of the polygon must be larger to make room for the
+            // cooling tube of the same size. The radio of the radii of
+            // a circle fitting the inside/outside of a regualr polygon
+            // is given by Cos(180/n) where n is the number of sides of the
+            // regurla polygon. In this case, it is scalled for the partical
+            // circles involved.
+            secR2[j] = secR2[j]/CosD(0.5*(secAngleEnd[j]-secAngleStart[j])/
+                                     ((Double_t)ksecNPointsPerRadii));
+            j++;
+            break;
+        }// end switch
+    } // end for i
     //
+    if(GetDebug(2)){
+        cout <<"    X2   \t  Y2 \t  R2 \t  S2 \t  E2"<<endl;
+        for(i=0;i<j;i++){
+            cout <<"{"<< secX2[i] <<",";
+            cout << secY2[i] <<",";
+            cout << secR2[i] <<",";
+            cout << secAngleStart2[i] <<",";
+            cout << secAngleEnd2[i] <<"}," <<  endl;
+        } // end for i
+    } // end if GetDebug
+    if(GetDebug(2)){
+        cout <<"    X2   \t  Y2 \t  R2 \t  S3 \t  E3"<<endl;
+        for(i=0;i<j;i++){
+            cout <<"{"<< secX2[i] <<",";
+            cout << secY2[i] <<",";
+            cout << secR2[i] <<",";
+            cout << secAngleStart3[i] <<",";
+            cout << secAngleEnd3[i] <<"}," <<  endl;
+        } // end for i
+    } // end if GetDebug
+    if(GetDebug(3)) cout <<"Double_t sB0[][";
+    if(GetDebug(4)) cout <<"3]{";
+    else if(GetDebug(3)) cout <<"2]{";
+    j = -1;
+    t0 = (Double_t)ksecNPointsPerRadii;
+    for(i=0;i<ksecNRadii+ksecNCoolingTubeDips;i++){
+        t1 = (secAngleEnd2[i]-secAngleStart2[i])/t0;
+        if(GetDebug(5)) cout<<"t1="<< t1<<endl;
+        for(k=0;k<=ksecNPointsPerRadii;k++){
+            t=secAngleStart2[i]+((Double_t)k)*t1;
+            j++;
+            xp[j] = TMath::Abs(secR2[i])*CosD(t)+secX2[i];
+            yp[j] = TMath::Abs(secR2[i])*SinD(t)+secY2[i];
+            if(GetDebug(3)){
+                cout << "{"<<xp[j]<<","<<yp[j];
+                if(GetDebug(4)) cout <<","<<t;
+                cout <<"},";
+            } // end if GetDebug
+        } // end for k
+        if(GetDebug(3)) cout << endl;
+        if(i==6) { // add thicker side
+            b = CosD(0.5*ksecAngleSide13);
+            a = SinD(0.5*ksecAngleSide13);
+            x1 = xp[j];
+            y1 = yp[j];
+            x0 = a*a*ksecX5 + b*b*x1 - (y1-ksecY5)*a*b;
+            y0 = a*a*y1 + b*b*ksecY5 - (x1-ksecX5)*a*b;
+            j++;
+            xp[j+3] = x0 - ksecSideD5*a;
+            yp[j+3] = y0 - ksecSideD5*b;
+            xp[j+2] = xp[j+3] + (ksecCthick3-ksecCthick2)*b;
+            yp[j+2] = yp[j+3] - (ksecCthick3-ksecCthick2)*a;
+            xp[j+1] = xp[j+2] - ksecSidelen*a;
+            yp[j+1] = yp[j+2] - ksecSidelen*b;
+            xp[j]   = xp[j+1] - (ksecCthick3-ksecCthick2)*b;
+            yp[j]   = yp[j+1] + (ksecCthick3-ksecCthick2)*a;
+            j += 3;
+            if(GetDebug(3))for(k=-3;k<=0;k++){
+                cout << "{"<<xp[j+k]<<","<<yp[j+k];
+                if(GetDebug(4)) cout <<",t="<<0.0;
+                cout <<"},";
+            } // end if GetDebug
+            if(GetDebug(3)) cout << endl;
+        } // end if i==6
+        if(i==19) { // add thicker side
+            // first propogate referece point 12 to -18 degree edge
+            b = CosD(0.5*ksecAngleSide13);
+            a = SinD(0.5*ksecAngleSide13);
+            x1 = secX[0]+TMath::Abs(secR[0])*CosD(secAngleStart[0]);
+            y1 = secY[0]+TMath::Abs(secR[0])*SinD(secAngleStart[0]);
+            x0 = a*b*(y1-secY[ksecNRadii-2]) +
+                     a*a*secX[ksecNRadii-2] + b*b*x1;
+            y0 = a*b*(x1-secX[ksecNRadii-2]) +
+                b*b*secY[ksecNRadii-2] + a*a*y1;
+            j++;
+            xp[j] = x0 + ksecSideD12*a;
+            yp[j] = y0 - ksecSideD12*b;
+            j++;
+            xp[j] = xp[j-1] - (ksecCthick3-ksecCthick2)*b;
+            yp[j] = yp[j-1] - (ksecCthick3-ksecCthick2)*a;
+            j++;
+            xp[j] = xp[j-1] + ksecSidelen*a;
+            yp[j] = yp[j-1] - ksecSidelen*b;
+            j++;
+            xp[j] = xp[j-1] + (ksecCthick3-ksecCthick2)*b;
+            yp[j] = yp[j-1] + (ksecCthick3-ksecCthick2)*a;
+            if(GetDebug(3))for(k=-3;k<=0;k++){
+                cout << "{"<<xp[j+k]<<","<<yp[j+k];
+                if(GetDebug(4)) cout <<",t="<<0.0;
+                cout <<"},";
+            } // end if GetDebug
+            if(GetDebug(3)) cout << endl;
+        } // end if i==19
+    } // end for i
+    if(GetDebug(3)) cout<<"{"<<xp[0]<<","<<yp[0];
+    if(GetDebug(4)) cout<<","<< secAngleStart2[0];
+    if(GetDebug(3)) cout<<"}} j="<<j<<endl;
     sB0 = new TGeoXtru(2);
     sB0->SetName("ITS SPD Carbon fiber support Sector End B0");
-    sB0->DefinePolygon(m,xpp,ypp);
+    sB0->DefinePolygon(j+1,xp,yp);
     sB0->DefineSection(0,ksecDz);
     sB0->DefineSection(1,ksecDz+ksecZEndLen);
     //
-    InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],
-                ksecCthick2,xpp2[0],ypp2[0]);
-    for(i=1;i<m-1;i++){
-        t = ksecCthick2;
-        for(k=0;k<ksecNCoolingTubeDips;k++)
-            if((i/(ksecNPointsPerRadii+1))==ksecDipIndex[k]) 
-                if(!(ksecDipIndex[k]*(ksecNPointsPerRadii+1)==i || 
-                     ksecDipIndex[k]*(ksecNPointsPerRadii+1)+
-                     ksecNPointsPerRadii==i   )) 
-                    t = ksecRCoolOut-ksecRCoolIn;
-        InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],
-                    t,xpp2[i],ypp2[i]);
+    if(GetDebug(3)) cout <<"Double_t sB1[][{";
+    if(GetDebug(4)) cout <<"3]{";
+    else if(GetDebug(3)) cout <<"2]{";
+    j = -1;
+    t0 = (Double_t)ksecNPointsPerRadii;
+    for(i=0;i<ksecNRadii+ksecNCoolingTubeDips;i++){
+        t1 = (secAngleEnd3[i]-secAngleStart3[i])/t0;
+        if(GetDebug(5)) cout<<"t1="<< t1<<endl;
+        for(k=0;k<=ksecNPointsPerRadii;k++){
+            t=secAngleStart3[i]+((Double_t)k)*t1;
+            j++;
+            x0 = TMath::Abs(secR2[i]-ksecCthick2);
+            if(i==2||i==5||i==8||i==11||i==14||i==17){
+                x0 = TMath::Abs(secR2[i]-ksecRCoolOut+ksecRCoolIn);/*
+                if(k==0){// compute change in start and end angles to
+                    // compensate for thickness of carbon fiber
+                    y0 = (ksecCthick2-ksecRCoolOut*SinD(t))/
+                        ksecRCoolIn; // sin th'
+                    if(GetDebug(5))cout <<" k=0 t="<<t<<" y0="<<y0<<endl;
+                    y1 = TMath::Sqrt(1-y0*y0);     // cos th'
+                    t -= 180.*TMath::ASin(SinD(t)*y1-CosD(t)*y0)/TMath::Pi(); 
+                }else if(k==ksecNPointsPerRadii) {
+                    y0 = (ksecCthick2-ksecRCoolOut*SinD(t))/
+                        ksecRCoolIn; // sin th'
+                    if(GetDebug(5))cout <<" k="<<k<<" t="<<t<<" y0="<<y0<<endl;
+                    y1 = TMath::Sqrt(1-y0*y0);     // cos th'
+                    t += 180.*TMath::ASin(SinD(t)*y1-CosD(t)*y0)/TMath::Pi();
+                } // end if
+            */} // end if
+            xp[j] = x0*CosD(t)+secX2[i];
+            yp[j] = x0*SinD(t)+secY2[i];
+            if(GetDebug(3)){
+                cout << "{"<<xp[j]<<","<<yp[j];
+                if(GetDebug(4)) cout <<","<<t;
+                cout <<"},";
+            } // end if GetDebug
+        } // end for k
+        if(GetDebug(3)) cout << endl;
     } // end for i
-    InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
-                ksecCthick2,xpp2[m-1],ypp2[m-1]);
+    if(GetDebug(3)) cout<<"{"<<xp[0]<<","<<yp[0];
+    if(GetDebug(4)) cout<<","<< secAngleStart2[0];
+    if(GetDebug(3)) cout<<"}} j="<<j<<endl;
     sB1 = new TGeoXtru(2);
     sB1->SetName("ITS SPD Carbon fiber support Sector Air End B1");
-    sB1->DefinePolygon(m,xpp2,ypp2);
+    sB1->DefinePolygon(j+1,xp,yp);
     sB1->DefineSection(0,ksecDz);
     sB1->DefineSection(1,ksecDz+ksecLen);
     sTB0 = new TGeoTube("ITS SPD Cooling Tube End TB0",0.0,
-                       0.5*ksecCoolTubeROuter,0.5*ksecLen);
+                       ksecRCoolIn,0.5*ksecLen);
     sTB1 = new TGeoTube("ITS SPD Cooling Tube End coolant TB0",0.0,
                        sTB0->GetRmax()-ksecCoolTubeThick,0.5*ksecLen);
     //
-    sM0 = new TGeoTube("ITS SPD Sensitive Virutual Volume M0",0.0,8.0,
-                       sA0->GetZ(1)+sB0->GetZ(1));
-    //
     if(GetDebug()){
-        sM0->InspectShape();
         sA0->InspectShape();
         sA1->InspectShape();
         sB0->InspectShape();
         sB1->InspectShape();
     } // end if GetDebug
     //
-    TGeoVolume *vM0,*vA0,*vA1,*vTA0,*vTA1,*vB0,*vB1,*vTB0,*vTB1;
-    vM0 = new TGeoVolume("ITSSPDSensitiveVirtualvolumeM0",sM0,medSPDair);
-    vM0->SetVisibility(kTRUE);
-    vM0->SetLineColor(7); // light Blue
-    vM0->SetLineWidth(1);
-    vM0->SetFillColor(vM0->GetLineColor());
-    vM0->SetFillStyle(4090); // 90% transparent
+    TGeoVolume *vM,*vA0,*vA1,*vTA0,*vTA1,*vB0,*vB1,*vTB0,*vTB1;
+    vM = moth;
     vA0 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorA0",sA0,medSPDcf);
     vA0->SetVisibility(kTRUE);
     vA0->SetLineColor(4); // Blue
@@ -582,8 +717,7 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     vB0->SetLineWidth(1);
     vB0->SetFillColor(vB0->GetLineColor());
     vB0->SetFillStyle(4010); // 10% transparent
-    vB1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB1",
-                         sB1,medSPDair);
+    vB1 = new TGeoVolume("ITSSPDCarbonFiberSupportSectorEndAirB1",sB1,medSPDair);
     vB1->SetVisibility(kTRUE);
     vB1->SetLineColor(7); // light Blue
     vB1->SetLineWidth(1);
@@ -602,352 +736,46 @@ TGeoVolume* AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth){
     vTB1->SetFillColor(vTB1->GetLineColor());
     vTB1->SetFillStyle(4000); // 0% transparent
     //
-    moth->AddNode(vM0,1,0); // Add virtual volume to mother
     vA0->AddNode(vA1,1,0); // Put air inside carbon fiber.
     vB0->AddNode(vB1,1,0); // Put air inside carbon fiber.
     vTA0->AddNode(vTA1,1,0); // Put air inside carbon fiber.
     vTB0->AddNode(vTB1,1,0); // Put air inside carbon fiber.
     for(i=0;i<ksecNCoolingTubeDips;i++){
-        x0 = secX3[ksecDipIndex[i]];
-        y0 = secY3[ksecDipIndex[i]];
-        t = 90.0-secAngleTurbo[i];
-        trans = new TGeoTranslation("",x0,y0,0.5*(sB1->GetZ(0)+sB1->GetZ(1)));
+        x0 = secX2[ksecDipIndex[i]];
+        y0 = secY2[ksecDipIndex[i]];
+        trans = new TGeoTranslation("",x0,y0,0.0);
         vB1->AddNode(vTB0,i+1,trans);
-        rot = new TGeoRotation("",0.0,0.0,t);
-        rotrans = new TGeoCombiTrans("",x0,y0,0.0,rot);
-        vM0->AddNode(vTA0,i+1,rotrans);
-        delete rot; // rot owned by AliITSv11GeometerySPD::CarbonFiberSector
+        rot = new TGeoRotation("",0.0,0.0,
+                               TMath::RadToDeg()*TMath::ATan2(y0,x0));
+        rotrans = new TGeoCombiTrans(*trans,*rot);
+        vM->AddNode(vTA0,i+1,rotrans);
+        delete rot;
     } // end for i
-    vM0->AddNode(vA0,1,0);
-    vM0->AddNode(vB0,1,0);
-    // Reflection.
-    vM0->AddNode(vB0,2,new TGeoRotation("",90.,0.,90.,90.,180.,0.));
+    vM->AddNode(vA0,1,0);
+    vM->AddNode(vB0,1,0);
+    vM->AddNode(vB0,2,new TGeoScale(1.0,1.0,-1.0)); // Reflection.
     if(GetDebug()){
-        vM0->PrintNodes();
         vA0->PrintNodes();
         vA1->PrintNodes();
         vB0->PrintNodes();
         vB1->PrintNodes();
     } // end if GetDebug
     //
-    return moth;
-}
-//----------------------------------------------------------------------
-void AliITSv11GeometrySPD::SPDsectorShape(Int_t n,const Double_t *xc,
-const Double_t *yc,const Double_t *r,const Double_t *ths,const Double_t *the,
-                               Int_t npr,Int_t &m,Double_t **xp,Double_t **yp){
-    // Code to compute the points that make up the shape of the SPD
-    // Carbon fiber support sections
-    // Inputs:
-    //    Int_t    n       Size of arrays xc,yc, and r.
-    //    Double_t *xc     Array of x values for radii centers.
-    //    Double_t *yc     Array of y values for radii centers.
-    //    Double_t *r      Array of signed radii values.
-    //    Double_t *ths    Array of starting angles [degrees].
-    //    Double_t *the    Array of ending angles [degrees].
-    //    Int_t    npr     The number of lines segments to aproximate the arc.
-    // Outputs:
-    //    Int_t    m       The number of enetries in the arrays *xp[npr+1] 
-    //                     and *yp[npr+1].
-    //    Double_t **xp    Array of x coordinate values of the line segments
-    //                     which make up the SPD support sector shape.
-    //    Double_t **yp    Array of y coordinate values of the line segments
-    //                     which make up the SPD support sector shape.
-    // Return:
-    //    none.
-    Int_t i,k;
-    Double_t t,t0,t1;
-
-    m = n*(npr+1);
-    if(GetDebug(2)){
-        Info("SPDsectorShape","    X    \t  Y  \t  R  \t  S  \t  E%d", m);
-        for(i=0;i<n;i++){
-            Info("SPDsectorShape","{%f,%f,%f,%f,%f}",
-                 xc[i],yc[i],r[i],ths[i],the[i]);
-        } // end for i
-    } // end if GetDebug
-    //
-    if(GetDebug(3)) cout <<"Double_t sA0 = ["<< n*(npr+1)+1<<"][";
-    if(GetDebug(4)) cout <<"3]{";
-    else if(GetDebug(3)) cout <<"2]{";
-    t0 = (Double_t)npr;
-    for(i=0;i<n;i++){
-        t1 = (the[i]-ths[i])/t0;
-        if(GetDebug(5)) cout<<"t1="<< t1<<endl;
-        for(k=0;k<=npr;k++){
-            t=ths[i]+((Double_t)k)*t1;
-            xp[i][k] = TMath::Abs(r[i])*CosD(t)+xc[i];
-            yp[i][k] = TMath::Abs(r[i])*SinD(t)+yc[i];
-            if(GetDebug(3)){
-                cout << "{"<<xp[i][k]<<","<<yp[i][k];
-                if(GetDebug(4)) cout <<","<<t;
-                cout <<"},";
-            } // end if GetDebug
-        } // end for k
-        if(GetDebug(3)) cout << endl;
-    } // end of i
-    if(GetDebug(3)) cout<<"{"<<xp[0][0]<<","<<yp[0][0];
-    if(GetDebug(4)) cout<<","<< ths[0];
-    if(GetDebug(3)) cout<<"}}"<<endl;
-    //
-    return;
 }
 //______________________________________________________________________
-TGeoVolume* AliITSv11GeometrySPD::CreateHalfStaveGroundFoil(){
+void AliITSv11GeometrySPD::HalfStave(TGeoVolume *moth){
     // Define the detail SPD Half Stave geometry.
     // Inputs:
     //   none.
     // Outputs:
     //  none.
     // Return:
-    //  TGeoVolume* The volume containing the half stave grounding foil.
-
-    TGeoManager *mgr = gGeoManager;
-    TGeoMedium *medSPDair = 0; // SPD Air
-    TGeoMedium *medSPDCu  = 0; // SPD Copper conductor
-    TGeoMedium *medSPDSiNs  = 0; // SPD Silicon non-sensitive material
-    TGeoMedium *medSPDSiSv  = 0; // SPD Silicon Sensitive material
-    TGeoMedium *medSPDStaveGlue = 0; // SPD Glue used on Half Staves
-
-    medSPDair       = mgr->GetMedium("ITSspdAir");
-    medSPDCu        = mgr->GetMedium("ITSspdCopper");
-    medSPDSiNs      = mgr->GetMedium("ITSspdSiliconNonSensitive");
-    medSPDSiSv      = mgr->GetMedium("ITSspdSiliconSensitive");
-    medSPDStaveGlue = mgr->GetMedium("ITSspdStaveGlue");
-    //
-    Double_t origin[3] = {0.0,0.0,0.0};
-    TGeoBBox *sA0,*sA1,*sA3,*sB2;
-    TGeoArb8 *sA2;
-    TGeoTubeSeg *sB1;
-
-    sA0 = new TGeoBBox("ITS SPD Half Stave Grounding Foil A0",
-                       0.5*fkGrdFoilWidthA,0.5*fkGrdFoilThick,0.5*(
-                fkGrdFoilLngA+fkGrdFoilLngB+fkGrdFoilLngC),origin);
-    origin[2] = 0.5*fkGrdFoilLngA;
-    sA1 = new TGeoBBox("ITS SPD Half Stave Gounding Foil Copper A1",
-            0.5*fkGrdFoilWidthA,0.5*fkGrdFoilThick,0.5*fkGrdFoilLngA,origin);
-    origin[0] = 0.5*(fkGrdFoilWidthA-fkGrdFoilWidthC);
-    origin[2] = -(fkGrdFoilLngA+fkGrdFoilLngB+0.5*fkGrdFoilLngC);
-    sA3 = new TGeoBBox("ITS SPD Half Stave Gounding Foil copper A3",
-            0.5*fkGrdFoilWidthC,0.5*fkGrdFoilThick,0.5*fkGrdFoilLngC,origin);
-    sA2 = new TGeoArb8("ITS SPD Half Stave Gounding Foil Copper A2",
-                       0.5*fkGrdFoilLngB);
-    sA2->SetVertex(0,-sA1->GetDX(),+sA1->GetDY());
-    sA2->SetVertex(1,+sA1->GetDX(),+sA1->GetDY());
-    sA2->SetVertex(2,+sA1->GetDX(),-sA1->GetDY());
-    sA2->SetVertex(3,-sA1->GetDX(),-sA1->GetDY());
-    sA2->SetVertex(4,origin[0]-sA3->GetDX(),+sA3->GetDY());
-    sA2->SetVertex(5,origin[0]+sA3->GetDX(),+sA3->GetDY());
-    sA2->SetVertex(6,origin[0]+sA3->GetDX(),-sA3->GetDY());
-    sA2->SetVertex(7,origin[0]-sA3->GetDX(),-sA3->GetDY());
-    sB1 = new TGeoTubeSeg("ITS SPD Half Stave Ground Foil Hole B1",
-                          0.0,0.5*fkGrdFoilHoleWidthAB,sA1->GetDY(),0.,180.);
-    sB2 = new TGeoBBox("ITS SPD Half Stave Ground Foil Hole B2",
-                       0.5*fkGrdFoilHoleWidthAB,sA1->GetDY(),
-                       0.5*(fkGrdFoilHoleLengthAB-fkGrdFoilHoleWidthAB),0);
-    //
-    TGeoVolume *vA0,*vA1,*vA2,*vA3,*vB1,*vB2;
-    vA0 = new TGeoVolume("ITSSPDHalfStaveGroundFoilA0",sA0,medSPDair);
-    vA0->SetVisibility(kTRUE);
-    vA0->SetLineColor(7); // light Blue
-    vA0->SetLineWidth(1);
-    vA0->SetFillColor(vA0->GetLineColor());
-    vA0->SetFillStyle(4090); // 90% transparent
-    vB1 = new TGeoVolume("ITSSPDHalfStaveGoundFoilHoleB1",sB1,medSPDair);
-    vB1->SetVisibility(kTRUE);
-    vB1->SetLineColor(7); // light Blue
-    vB1->SetLineWidth(1);
-    vB1->SetFillColor(vB1->GetLineColor());
-    vB1->SetFillStyle(4090); // 90% transparent
-    vB2 = new TGeoVolume("ITSSPDHalfStaveGoundFoilHoleB2",sB2,medSPDair);
-    vB2->SetVisibility(kTRUE);
-    vB2->SetLineColor(7); // light Blue
-    vB2->SetLineWidth(1);
-    vB2->SetFillColor(vB2->GetLineColor());
-    vB2->SetFillStyle(4090); // 90% transparent
-    vA1 = new TGeoVolume("ITSSPDHalfStaveGoundFoilCopperA1",sA1,medSPDCu);
-    vA1->SetVisibility(kTRUE);
-    vA1->SetLineColor(2); // red
-    vA1->SetLineWidth(1);
-    vA1->SetFillColor(vA1->GetLineColor());
-    vA1->SetFillStyle(4000); // 00% transparent
-    vA2 = new TGeoVolume("ITSSPDHalfStaveGoundFoilCopperA2",sA2,medSPDCu);
-    vA2->SetVisibility(kTRUE);
-    vA2->SetLineColor(2); // red
-    vA2->SetLineWidth(1);
-    vA2->SetFillColor(vA2->GetLineColor());
-    vA2->SetFillStyle(4000); // 00% transparent
-    vA3 = new TGeoVolume("ITSSPDHalfStaveGoundFoilCopperA3",sA3,medSPDCu);
-    vA3->SetVisibility(kTRUE);
-    vA3->SetLineColor(2); // red
-    vA3->SetLineWidth(1);
-    vA3->SetFillColor(vA3->GetLineColor());
-    vA3->SetFillStyle(4000); // 00% transparent
-    //
-    vA0->AddNode(vA1,1,0);
-    vA0->AddNode(vA2,1,new TGeoTranslation(0.0,0.0,
-                                           2.0*sA1->GetDZ()+sA2->GetDz()));
-    vA0->AddNode(vA3,1,0);
-    TGeoRotation left("",-90.0,0.0,0.0), right("",90.0,0.0,0.0);
-    Int_t i,ncopyB1=1,ncopyB2=1;
-    for(i=0;i<fkGrdFoilNholesAB;i++){
-        origin[0] = 0.0;
-        origin[1] = 0.0;
-        origin[2] = fkGrdFoilHoleStartA+((Double_t)i)*fkGrdFoilHoleSpacingAB;
-        vA1->AddNode(vB1,ncopyB1,0); // double check
-        vA1->AddNode(vB2,ncopyB2,new TGeoTranslation(0.0,0.0,
-                                        origin[2]+0.5*fkGrdFoilHoleLengthAB));
-        vA1->AddNode(vB1,ncopyB1,0); // double check
-    } // end for i
-    for(i=0;i<fkGrdFoilNholesAB;i++){
-        origin[0] = 0.0;
-        origin[1] = 0.0;
-        origin[2] = fkGrdFoilHoleStartB+((Double_t)i)*fkGrdFoilHoleSpacingAB;
-        new TGeoTranslation(0.0,0.0,origin[2]+sB1->GetRmax());
-        vA1->AddNode(vB1,ncopyB1,0); // double check
-        vA1->AddNode(vB2,ncopyB2,new TGeoTranslation(0.0,0.0,
-                                      origin[2]+0.5*fkGrdFoilHoleLengthAB));
-        new TGeoTranslation(0.0,0.0,origin[2]+sB1->GetRmax()+2.0*sB2->GetDZ());
-        vA1->AddNode(vB1,ncopyB1,0); // double check
-    } // end for i
-    return vA0;
-}
-//______________________________________________________________________
-TGeoVolume* AliITSv11GeometrySPD::CreateSPDLadder(){
-    // Define the detail SPD Half Stave geometry.
-    // Inputs:
-    //   none.
-    // Outputs:
     //  none.
-    // Return:
-    //  TGeoVolume* of the volume containing the SPD Ladder.
-    TGeoMedium *medSPDair       = 0; // SPD Air
-    TGeoMedium *medSPDCu        = 0; // SPD Copper conductor
-    TGeoMedium *medSPDSiNs      = 0; // SPD Silicon non-sensitive material
-    TGeoMedium *medSPDSiSv      = 0; // SPD Silicon Sensitive material
-    TGeoMedium *medSPDStaveGlue = 0; // SPD Glue used on Half Staves
-    TGeoMedium *medSPDLadGlue   = 0; // SPD Glue used on Half Staves
-    TGeoMedium *medSPDBumpBonds = 0; // SPD Bump bond material
-    TGeoBBox *sM0,*sGlue0,*sChip,*sBB,*sDet,*sSenDet,*sGlue1;
-    Double_t x,y,z;
 
-    TGeoManager *mgr = gGeoManager;
-    medSPDair       = mgr->GetMedium("ITSspdAir");
-    medSPDCu        = mgr->GetMedium("ITSspdCopper");
-    medSPDSiNs      = mgr->GetMedium("ITSspdSiliconNonSensitive");
-    medSPDSiSv      = mgr->GetMedium("ITSspdSiliconSensitive");
-    medSPDStaveGlue = mgr->GetMedium("ITSspdStaveGlue");
-    medSPDLadGlue   = mgr->GetMedium("ITSspdLadderGlue");
-    medSPDBumpBonds = mgr->GetMedium("ITSspdBumpBond");
-    //
-    sChip   = new TGeoBBox("ITS SPD Chip",0.5*fkLadChipWidth,0.5*fThickChip,
-                           0.5*fkLadChipLength);
-    sGlue0  = new TGeoBBox("ITS SPD Ladder bottom Glue0",sChip->GetDX(),
-                           0.5*fkLadGlue0Thick,sChip->GetDZ());
-    sDet    = new TGeoBBox("ITS SPD Detector Det",0.5*fkLadDetectorWidth,
-                           0.5*fThickDetector,0.5*fkLadDetectorLength);
-    sBB     = new TGeoBBox("ITS SPD BumpBond BB",sDet->GetDX(),
-                           0.5*fkLadBumpBondThick,sChip->GetDZ());
-    sSenDet = new TGeoBBox(CreateSensitivevolumeName("_shape"),
-                  0.5*fkLadSensDetWidth,sDet->GetDY(),0.5*fkLadSensDetLength);
-    sGlue1  = new TGeoBBox("ITS SPD Ladder Top Glue1",
-                           sDet->GetDX(),0.5*fkLadGlue0Thick,sDet->GetDZ());
-    x = TMath::Max(sChip->GetDX(),sDet->GetDX());
-    y = sGlue0->GetDY()+sChip->GetDY()+sBB->GetDY()+sDet->GetDY()+
-        sGlue1->GetDY();
-    z = ((Double_t) fkLadNChips)*sChip->GetDZ()+2.*0.5*fkLadChipSpacing0 +
-        ((Double_t) fkLadNChips-1)*0.5*fkLadChipSpacing1;
-    z = TMath::Max(z,sDet->GetDZ());
-    sM0 = new TGeoBBox("ITS SPD Ladder M0",x,y,z);
-    if(GetDebug()){
-        sGlue0->InspectShape();
-        sChip->InspectShape();
-        sBB->InspectShape();
-        sDet->InspectShape();
-        sSenDet->InspectShape();
-        sGlue1->InspectShape();
-        sM0->InspectShape();
-    } // end if GetDebug
-    //
-    TGeoVolume *vM0,*vGlue0,*vChip,*vBB,*vDet,*vSenDet,*vGlue1;
-    vM0 = new TGeoVolume("ITSSPDLadderM0",sM0,medSPDair);
-    vM0->SetVisibility(kFALSE);
-    vM0->SetLineColor(8); // White
-    vM0->SetLineWidth(1);
-    vM0->SetFillColor(vM0->GetLineColor());
-    vM0->SetFillStyle(4000); // 100% transparent
-    vGlue0 = new TGeoVolume("ITSSPDLadderGlue0",sGlue0,medSPDLadGlue);
-    vGlue0->SetVisibility(kTRUE);
-    vGlue0->SetLineColor(5); // Yellow
-    vGlue0->SetLineWidth(1);
-    vGlue0->SetFillColor(vGlue0->GetLineColor());
-    vGlue0->SetFillStyle(4050); // 50% transparent
-    vGlue1 = new TGeoVolume("ITSSPDLadderGlue1",sGlue1,medSPDLadGlue);
-    vGlue1->SetVisibility(kTRUE);
-    vGlue1->SetLineColor(5); // Yellow
-    vGlue1->SetLineWidth(1);
-    vGlue1->SetFillColor(vGlue1->GetLineColor());
-    vGlue1->SetFillStyle(4050); // 50% transparent
-    vChip = new TGeoVolume("ITSSPDLadderChip",sChip,medSPDSiNs);
-    vChip->SetVisibility(kTRUE);
-    vChip->SetLineColor(4); // blue
-    vChip->SetLineWidth(1);
-    vChip->SetFillColor(vChip->GetLineColor());
-    vChip->SetFillStyle(4100); // 0% transparent
-    vBB = new TGeoVolume("ITSSPDLadderBumpBond",sBB,medSPDBumpBonds);
-    vBB->SetVisibility(kTRUE);
-    vBB->SetLineColor(1); // black
-    vBB->SetLineWidth(1);
-    vBB->SetFillColor(vBB->GetLineColor());
-    vBB->SetFillStyle(4100); // 0% transparent
-    vDet = new TGeoVolume("ITSSPDLadderDet",sDet,medSPDSiNs);
-    vDet->SetVisibility(kTRUE);
-    vDet->SetLineColor(4); // blue
-    vDet->SetLineWidth(1);
-    vDet->SetFillColor(vDet->GetLineColor());
-    vDet->SetFillStyle(4100); // 0% transparent
-    vSenDet =new TGeoVolume(GetSensitivevolumeName(),sSenDet,medSPDSiSv);
-    vSenDet->SetVisibility(kTRUE);
-    vSenDet->SetLineColor(4); // blue
-    vSenDet->SetLineWidth(1);
-    vSenDet->SetFillColor(vSenDet->GetLineColor());
-    vSenDet->SetFillStyle(4100); // 0% transparent
-    //
-    vDet->AddNode(vSenDet,1,0); // Put sensitive volume inside detector
-    TGeoTranslation *tran;
-    Int_t i,nCopyGlue0=1,nCopyChip=1,nCopyBB=1;
-    Double_t xb,yg0,yc,yb,yd,yg1;
-    x   = 0.0;
-    xb  = -sM0->GetDX() + sDet->GetDX();
-    yg0 = -sM0->GetDY()+sGlue0->GetDY();
-    yc  = yg0 + sGlue0->GetDY() + sChip->GetDY();
-    yb  = yc  + sChip->GetDY()  + sBB->GetDY();
-    yd  = yb  + sBB->GetDY()    + sDet->GetDY();
-    yg1 = yd  + sDet->GetDY()   + sGlue1->GetDY();
-    z   = -sM0->GetDZ() + fkLadChipSpacing0 + sChip->GetDZ();
-    for(i=0;i<fkLadNChips;i++){
-        tran = new TGeoTranslation(x,yg0,z);
-        vM0->AddNode(vGlue0,nCopyGlue0++,tran);
-        tran = new TGeoTranslation(x,yc,z);
-        vM0->AddNode(vChip,nCopyChip++,tran);
-        tran = new TGeoTranslation(xb,yb,z);
-        vM0->AddNode(vBB,nCopyBB++,tran);
-        z += fkLadChipSpacing1 + 2.0*sChip->GetDZ();
-    } // end for i
-    tran = new TGeoTranslation(xb,yd,0.0);
-    vM0->AddNode(vDet,1,tran);
-    tran = new TGeoTranslation(xb,yg1,0.0);
-    vM0->AddNode(vGlue1,1,tran);
-    if(GetDebug()){
-        vGlue0->PrintNodes();
-        vChip->PrintNodes();
-        vBB->PrintNodes();
-        vDet->PrintNodes();
-        vSenDet->PrintNodes();
-        vGlue1->PrintNodes();
-        vM0->PrintNodes();
-    } // end if GetDebug
-    return vM0;
+    if(moth==0){
+        Error("HalfStave","moth=%p",moth);
+        return;
+    } // end if moth==0
 }
 //----------------------------------------------------------------------
 void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
@@ -968,20 +796,15 @@ void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
     TPolyLine plA0,plA1,plB0,plB1;
     TCanvas *canvas;
     TLatex txt;
-    Double_t x=0.0,y=0.0;
-    Int_t i,kNRadii=6;
+    Double_t x,y;
 
-    if(strcmp(filepath,"")){
-        Error("CreateFigure0","filepath=%s type=%s",filepath,type);
-    } // end if
-    //
-    sA0 = (TGeoXtru*) gGeoManager->GetVolume(
+    sA0 = (TGeoXtru*) gGeomManager->GetVolume(
         "ITSSPDCarbonFiberSupportSectorA0_1")->GetShape();
-    sA1 = (TGeoXtru*) gGeoManager->GetVolume(
+    sA1 = (TGeoXtru*) gGeomManager->GetVolume(
         "ITSSPDCarbonFiberSupportSectorAirA1_1")->GetShape();
-    sB0 = (TGeoXtru*) gGeoManager->GetVolume(
+    sB0 = (TGeoXtru*) gGeomManager->GetVolume(
         "ITSSPDCarbonFiberSupportSectorEndB0_1")->GetShape();
-    sB1 = (TGeoXtru*) gGeoManager->GetVolume(
+    sB1 = (TGeoXtru*) gGeomManager->GetVolume(
         "ITSSPDCarbonFiberSupportSectorEndAirB1_1")->GetShape();
     //pmA = new TPolyMarker();
     //pmA.SetMarkerStyle(2); // +
@@ -989,13 +812,13 @@ void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
     //pmB = new TPolyMarker();
     //pmB.SetMarkerStyle(5); // X
     //pmB.SetMarkerColor(6); // purple
-    plA0.SetPolyLine(sA0->GetNvert());
+    plA0.SetPolyline(sA0->GetNvert());
     plA0.SetLineColor(1); // black
     plA0.SetLineStyle(1);
-    plA1.SetPolyLine(sA1->GetNvert());
+    plA1.SetPolyline(sA1->GetNvert());
     plA1.SetLineColor(2); // red
     plA1.SetLineStyle(1);
-    plB0.SetPolyLine(sB0->GetNvert());
+    plB0.SetPolyLine(sB0.GetNvert());
     plB0.SetLineColor(3); // Green
     plB0.SetLineStyle(2);
     plB1.SetPolyLine(sB1->GetNvert());
@@ -1008,17 +831,17 @@ void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
     for(i=0;i<sB0->GetNvert();i++) plB0.SetPoint(i,sB0->GetX(i),sB0->GetY(i));
     for(i=0;i<sB1->GetNvert();i++) plB1.SetPoint(i,sB1->GetX(i),sB1->GetY(i));
     canvas = new TCanvas("AliITSv11GeometrySPDFig0","",1000,1000);
-    canvas->Range(-3.,-3.,3.,3.);
-    txt.SetTextSize(0.05);
+    canvas.Range(-3.,-3.,3.,3.);
+    txt.SetTextsize(0.05);
     txt.SetTextAlign(33);
     txt.SetTextColor(1);
-    txt.DrawLatex(2.9,2.9,"Section A-A outer Carbon Fiber surface");
+    txt.Draw(2.9,2.9,"Section A-A outer Carbon Fiber surface");
     txt.SetTextColor(2);
-    txt.DrawLatex(2.9,2.5,"Section A-A Inner Carbon Fiber surface");
+    txt.Draw(2.9,2.5,"Section A-A Inner Carbon Fiber surface");
     txt.SetTextColor(3);
-    txt.DrawLatex(2.9,2.1,"Section E-E outer Carbon Fiber surface");
+    txt.Draw(2.9,2.1,"Section E-E outer Carbon Fiber surface");
     txt.SetTextColor(4);
-    txt.DrawLatex(2.9,1.7,"Section E-E Inner Carbon Fiber surface");
+    txt.Draw(2.9,1.7,"Section E-E Inner Carbon Fiber surface");
     plA0.Draw();
     plA1.Draw();
     plB0.Draw();
@@ -1026,17 +849,15 @@ void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
     //pmA.Draw();
     //pmB.Draw();
     //
-    x = 1.0;
-    y = -2.5;
     Char_t chr[3];
     for(i=0;i<kNRadii;i++){
         sprintf(chr,"%2d",i);txt.DrawLatex(x-0.1,y,chr);
-        sprintf(chr,"%8.4",5.000);txt.DrawLatex(x,y,chr);
-        sprintf(chr,"%8.4",5.000);txt.DrawLatex(x+0.5,y,chr);
-        sprintf(chr,"%8.4",5.000);txt.DrawLatex(x+1.0,y,chr);
-        sprintf(chr,"%8.4",5.000);txt.DrawLatex(x+1.5,y,chr);
-        sprintf(chr,"%8.4",5.000);txt.DrawLatex(x+2.0,y,chr);
-        if(kTRUE) txt.DrawLatex(x+2.5,y,"A-A/E-E");
+        sprintf(chr,"%8.4",);txt.DrawLatex(x,y,chr);
+        sprintf(chr,"%8.4",);txt.DrawLatex(x+0.5,y,chr);
+        sprintf(chr,"%8.4",);txt.DrawLatex(x+1.0,y,chr);
+        sprintf(chr,"%8.4",);txt.DrawLatex(x+1.5,y,chr);
+        sprintf(chr,"%8.4",);txt.DrawLatex(x+2.0,y,chr);
+        if() txt.DrawLatex(x+2.5,y,"A-A/E-E");
         else txt.DrawLatex(x+2.5,y,"E-E");
     } // end for i
     txt.DrawLatex(x,y,"x_{c} mm");
@@ -1047,48 +868,3 @@ void AliITSv11GeometrySPD::CreateFigure0(const Char_t *filepath,
     txt.DrawLatex(x+2.5,y,"Section");
     //
 }
-//----------------------------------------------------------------------
-void AliITSv11GeometrySPD::CreateFigureLadder(const Char_t *filepath,
-                                         const Char_t *type){
-    // Creates Figure 0 for the documentation of this class. In this
-    // specific case, it creates the X,Y cross section of the SPD suport
-    // section, center and ends. The output is written to a standard
-    // file name to the path specificed.
-    // Inputs:
-    //   const Char_t *filepath  Path where the figure is to be drawn
-    //   const Char_t *type      The type of file, default is gif.
-    // Output:
-    //   none.
-    // Return:
-    //   none.
-    TGeoVolume *vLad;
-    TCanvas *canvas;
-    TLatex txt;
-    TGeoManager *mgr = gGeoManager;
-
-    if((vLad = mgr->GetVolume("ITSSPDLadderM0"))==0){
-        printf("file=%s type=%s\n",filepath,type);
-        vLad = CreateSPDLadder();
-    } // end if
-    //
-    canvas = new TCanvas("canvas","ITS SPD Ladder",900,450);
-    //canvas->Divide(2,1);
-    //canvas->cd(1);
-    //TVirtualPad *pad1 = canvas->GetPad(1);
-    //TView *view1 = pad1->GetView();
-    //if(view1){
-    //    view1->FrontView(pad1);
-    //}
-    vLad->Draw();
-    //pad1->Update();
-    //
-/*    canvas->cd(2);
-    TVirtualPad *pad2 = canvas->GetPad(2);
-    TView *view2 = pad2->GetView();
-    if(view2){
-        view2->TopView(pad2);
-    }
-    vLad->Draw();
-*/    //pad2->Update();
-    canvas->Update();
-}
index a274908..644e24d 100644 (file)
@@ -11,75 +11,18 @@ class TGeoVolume;
 
 class AliITSv11GeometrySPD : public AliITSv11Geometry {
   public:
-    AliITSv11GeometrySPD();
-    AliITSv11GeometrySPD(Int_t debug);
+    AliITSv11GeometrySPD(){};
+    AliITSv11GeometrySPD(Bool_t debug):AliITSv11Geometry(debug){};
     virtual ~AliITSv11GeometrySPD(){};
     //
-    virtual TGeoVolume* CenteralSPD(TGeoVolume *moth);
+    virtual void CarbonFiberSector(TGeoVolume *Moth);
+    virtual void HalfStave(TGeoVolume *Moth);
     //
     // Create figures for the documentation of this class
-    virtual void CreateFigure0(const Char_t *filepath="",
-                               const Char_t *type="gif");
-    virtual void CreateFigureLadder(const Char_t*filepath="",
-                                    const Char_t* type="gif");
-    //
-    virtual const char* GetSensitivevolumeName() const{
-        //Get Sensitive volume name
-        return fSPDSensitiveVolumeName.Data();}
-    virtual void SetSensitivevolumeName(const Char_t 
-                *n="ITSSPDDetectorSensitiveVolume"){//Set Sensitive volume name
-                fSPDSensitiveVolumeName=n;}
-  private:
-    void SPDsectorShape(Int_t n,const Double_t *xc,const Double_t *yc,
-          const Double_t *r,const Double_t *ths,const Double_t *the,Int_t npr,
-                        Int_t &m,Double_t **xp,Double_t **yp);
-    const char* CreateSensitivevolumeName(const char* app) const{
-        //Get Sensitive volume name
-        char *a = new char[fSPDSensitiveVolumeName.Length()+strlen(app)+1]; 
-        strcpy(a,fSPDSensitiveVolumeName.Data());return strcat(a,app);}
-    //
-    TGeoVolume* CarbonFiberSector(TGeoVolume *moth);
-    TGeoVolume* CreateHalfStaveGroundFoil();
-    TGeoVolume* CreateSPDLadder();
+    virtual void CreateFigre0(const Char_t *filepath="",
+                              const Chat_t *type="gif");
 
   private:
-    // Posible Variables
-    TString fSPDSensitiveVolumeName; // ITS SPD sensitive volume name
-    Double_t fThickDetector; // Detector thickness
-    Double_t fThickChip;     // Read out Chip thickness
-    // Stave
-    // Grounding Foil
-    const Double_t fkGrdFoilThick        ;//!  0.05*fgkmm;
-    const Double_t fkGrdFoilWidthA       ;//! 15.95*fgkmm;
-    const Double_t fkGrdFoilWidthC       ;//!  4.4*fgkmm;
-    const Double_t fkGrdFoilLngA         ;//!139.89*fgkmm;
-    const Double_t fkGrdFoilLngB         ;//! 11.55*fgkmm;
-    const Double_t fkGrdFoilLngC         ;//! 82.0*fgkmm;
-    const Int_t    fkGrdFoilNholesAB     ;//!5;
-    const Double_t fkGrdFoilHoleCenterAB ;//!  7.8*fgkmm;
-    const Double_t fkGrdFoilHoleLengthAB ;//! 12.0*fgkmm;
-    const Double_t fkGrdFoilHoleWidthAB  ;//!  7.5*fgkmm;
-    const Double_t fkGrdFoilHoleSpacingAB;//! 14.0*fgkmm;
-    const Double_t fkGrdFoilHoleStartA   ;//!  1.36*fgkmm;
-    const Double_t fkGrdFoilHoleStartB   ;//! 73.08*fgkmm;
-    // Ladder
-    const Int_t    fkLadNChips        ;//!5;
-    const Double_t fkLadChipWidth     ;//!15950.0*fgkmicron;
-    const Double_t fkLadChipHight     ;//!  150.0*fgkmicron;
-    const Double_t fkLadChipLength    ;//!13490.0*fgkmicron;
-    const Double_t fkLadGlue0Thick    ;//!    0.100*fgkmm;
-    const Double_t fkLadBumpBondThick ;//!   30.0*fgkmicron;
-    const Double_t fkLadDetectorWidth ;//!13700.0*fgkmicron;
-    const Double_t fkLadDetectorThick ;//!  200.0*fgkmicron;
-    const Double_t fkLadDetectorLength;//!70710.0*fgkmicron;
-    const Double_t fkLadSensDetWidth  ;//! 1280.0*fgkmicron;
-    const Double_t fkLadSensDetThick  ;//!  200.0*fgkmicron;
-    const Double_t fkLadSensDetLength ;//!69490.0*fgkmicron;
-    const Double_t fkLadChipSpacing0  ;//!  610.0*fgkmicron;
-    const Double_t fkLadChipSpacing1  ;//! (2.*fkLadChipSpacing0+
-    //    ((Double_t)fkLadNChips)*fkLadChipLength)/((Double_t)(fkLadNChips-1));
-    //
-
     ClassDef(AliITSv11GeometrySPD,1) // ITS v11 Centeral SPD geometry
 };
 
index f61e5f6..0d75161 100644 (file)
@@ -558,7 +558,7 @@ void AliITSv11GeometrySupport::SPDThermalSheald(TGeoVolume *moth){
     TGeoVolume *vB1,*vB2,*vB3,*vBh1,*vBh2,*vBh3;
     TGeoVolume *vC1,*vC2,*vC3,*vCh1,*vCh2,*vCh3;
     TGeoVolume *vD,*vDs,*vDw,*vDws,*vM;
-    vM = new TGeoVolume("ITSspdThermalShealdMotherM",sM,medSPDair);
+    vM = new TGeoVolume("ITSspdThermalShealdMother",sM,medSPDair);
     vM->SetVisibility(kTRUE);
     vM->SetLineColor(7); // light Blue
     vM->SetLineWidth(1);