]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv11GeometrySPD.cxx
1. SetDefaultOutputs(kTRUE) used by default. This will automatically archive the...
[u/mrichter/AliRoot.git] / ITS / AliITSv11GeometrySPD.cxx
index 2f511b764c7e1c512c4ba46b443ac2184fb9d40c..ef2b3e01cf02f581e22476bbce250adda59b46f6 100644 (file)
@@ -14,7 +14,7 @@
  **************************************************************************/
 //
 // This class Defines the Geometry for the ITS services and support cones
-// outside of the central volume (except for the Central support 
+// outside of the central volume (except for the Central support
 // cylinders). Other classes define the rest of the ITS, specifically the
 // SSD support cone, the SSD Support central cylinder, the SDD support cone,
 // the SDD support central cylinder, the SPD Thermal Shield, The supports
@@ -88,9 +88,9 @@
 #include "AliITSv11GeometrySPD.h"
 
 // Constant definistions
-const Double_t AliITSv11GeometrySPD::fgkGapLadder    = 
+const Double_t AliITSv11GeometrySPD::fgkGapLadder    =
                       AliITSv11Geometry::fgkmicron*75.; //  75 microns
-const Double_t AliITSv11GeometrySPD::fgkGapHalfStave = 
+const Double_t AliITSv11GeometrySPD::fgkGapHalfStave =
                      AliITSv11Geometry::fgkmicron*120.; // 120 microns
 
 ClassImp(AliITSv11GeometrySPD)
@@ -103,11 +103,11 @@ fSPDsectorX0(0),    // X of first edge of sector plane for stave
 fSPDsectorY0(0),    // Y of first edge of sector plane for stave
 fSPDsectorX1(0),    // X of second edge of sector plane for stave
 fSPDsectorY1(0),    // Y of second edge of sector plane for stave
-fTubeEndSector()    // coordinate of cooling tube ends 
+fTubeEndSector()    // coordinate of cooling tube ends
 {
     //
     // Default constructor.
-    // This does not initialize anything and is provided just for 
+    // This does not initialize anything and is provided just for
     // completeness. It is recommended to use the other one.
     // The alignment gap is specified as argument (default = 0.0075 cm).
     // Inputs:
@@ -134,7 +134,7 @@ fSPDsectorX0(0),    // X of first edge of sector plane for stave
 fSPDsectorY0(0),    // Y of first edge of sector plane for stave
 fSPDsectorX1(0),    // X of second edge of sector plane for stave
 fSPDsectorY1(0),    // Y of second edge of sector plane for stave
-fTubeEndSector()    // coordinate of cooling tube ends 
+fTubeEndSector()    // coordinate of cooling tube ends
 {
     //
     // Constructor with debug setting argument
@@ -184,7 +184,7 @@ fSPDsectorY1(s.fSPDsectorY1)     // Y of second edge of sector plane for stave
     } // end for i,j
 }
 //______________________________________________________________________
-AliITSv11GeometrySPD& AliITSv11GeometrySPD::operator=(const 
+AliITSv11GeometrySPD& AliITSv11GeometrySPD::operator=(const
                                                AliITSv11GeometrySPD &s)
 {
     //
@@ -215,9 +215,9 @@ TGeoMedium* AliITSv11GeometrySPD::GetMedium(const char* mediumName,
                                             TGeoManager *mgr) const
 {
     //
-    // This function is used to recovery any medium 
-    // used to build the geometry volumes. 
-    // If the required medium does not exists, 
+    // This function is used to recovery any medium
+    // used to build the geometry volumes.
+    // If the required medium does not exists,
     // a NULL pointer is returned, and an error message is written.
     //
      Char_t itsMediumName[30];
@@ -235,7 +235,7 @@ Int_t AliITSv11GeometrySPD::CreateSPDCentralMaterials(Int_t &medOffset,
     //
     // Define the specific materials used for the ITS SPD central detectors.
     // ---
-    // NOTE: These are the same old names. 
+    // NOTE: These are the same old names.
     //       By the ALICE naming conventions, they start with "ITS SPD ...."
     //       Data taken from ** AliITSvPPRasymmFMD::CreateMaterials() **.
     // ---
@@ -292,25 +292,25 @@ Int_t AliITSv11GeometrySPD::CreateSPDCentralMaterials(Int_t &medOffset,
     // For better readability, it is simply set to zero.
     // Then the writing "0.0 * fgkPascal" is replaced by "0."
     // (Alberto)
-    
+
     // silicon definition for ITS (overall)
     mat = new TGeoMaterial("ITS_SI", 28.086, 14.0, 2.33 * fgkgcm3,
                            TGeoMaterial::kMatStateSolid, 25.0*fgkCelsius, 0.);
     mat->SetIndex(matindex);
     med = new TGeoMedium("SI", medindex++, mat, params);
-    
+
     // silicon for ladder chips
     mat = new TGeoMaterial("SPD SI CHIP", 28.086, 14.0, 2.33 * fgkgcm3,
                            TGeoMaterial::kMatStateSolid, 25.0*fgkCelsius, 0.);
     mat->SetIndex(matindex);
     med = new TGeoMedium("SPD SI CHIP", medindex++, mat, params);
-    
+
     // silicon for pixel bus
     mat = new TGeoMaterial("SPD SI BUS", 28.086, 14.0, 2.33 * fgkgcm3,
                            TGeoMaterial::kMatStateSolid, 25.0*fgkCelsius, 0.);
     mat->SetIndex(matindex);
     med = new TGeoMedium("SPD SI BUS", medindex++, mat, params);
-    
+
     // carbon fiber material is defined as a mix of C-O-N-H
     // defined in terms of fractional weights according to 'C (M55J)'
     // it is used for the support and clips
@@ -330,7 +330,7 @@ Int_t AliITSv11GeometrySPD::CreateSPDCentralMaterials(Int_t &medOffset,
     params[7] = kstmin;
     med = new TGeoMedium("ITSspdCarbonFiber", medindex++, mix, params);
 
-    // air defined as a mixture of C-N-O-Ar: 
+    // air defined as a mixture of C-N-O-Ar:
     // it is used to fill all containers
     mix = new TGeoMixture("Air", 4, 1.20479E-3 * fgkgcm3);
     mix->SetIndex(matindex);
@@ -391,89 +391,17 @@ Int_t AliITSv11GeometrySPD::CreateSPDCentralMaterials(Int_t &medOffset,
     matOffset = matindex;
     return matOffset;
 }
-//______________________________________________________________________
-void AliITSv11GeometrySPD::InitSPDCentral(Int_t offset, TVirtualMC *vmc) const
-{
-     //
-     // Do all SPD Central detector initializations (e.g.: transport cuts).
-     // ---
-     // Here follow some GEANT3 physics switches, which are interesting 
-     // for these settings to be defined:
-     // - "MULTS" (MULtiple Scattering):
-     //   the variable IMULS controls this process. See [PHYS320/325/328]
-     //   0 - No multiple scattering.
-     //   1 - (DEFAULT) Multiple scattering according to Moliere theory.
-     //   2 - Same as 1. Kept for backward compatibility.
-     //   3 - Pure Gaussian scattering according to the Rossi formula.
-     // - "DRAY" (Delta RAY production)
-     //   The variable IDRAY controls this process. See [PHYS430]
-     //   0 - No delta rays production.
-     //   1 - (DEFAULT) Delta rays production with generation of.
-     //   2 - Delta rays production without generation of.
-     // - "LOSS" (continuous energy loss)
-     //   The variable ILOSS controls this process.
-     //   0 - No continuous energy loss, IDRAY is set to 0.
-     //   1 - Continuous energy loss with generation of delta rays above 
-     //       DCUTE (common/GCUTS/) and restricted Landau fluctuations 
-     //        below DCUTE.
-     //   2 - (DEFAULT) Continuous energy loss without generation of 
-     //       delta rays 
-     //       and full Landau-Vavilov-Gauss fluctuations.
-     //       In this case the variable IDRAY is forced to 0 to avoid
-     //       double counting of fluctuations.
-     //   3 - Same as 1, kept for backward compatibility.
-     //   4 - Energy loss without fluctuation.
-     //       The value obtained from the tables is used directly.
-     // ---
-     // Arguments:
-     //    Int_t offset    --> the material/medium index offset
-     //    TVirtualMC *vmc --> pointer to the virtual Monte Carlo default gMC
-     //
-
-     Int_t i, n = 4;
-     
-     for(i=0;i<n;i++) {
-          vmc->Gstpar(i+offset, "CUTGAM", 30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "CUTELE", 30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "CUTNEU", 30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "CUTHAD", 30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "CUTMUO", 30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "BCUTE",  30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "BCUTM",  30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "DCUTE",  30.0 * fgkKeV);
-          vmc->Gstpar(i+offset, "DCUTM",  30.0 * fgkKeV);
-          //vmc->Gstpar(i+offset, "PPCUTM", );
-          //vmc->Gstpar(i+offset, "PAIR", );
-          //vmc->Gstpar(i+offset, "COMPT", );
-          //vmc->Gstpar(i+offset, "PHOT", );
-          //vmc->Gstpar(i+offset, "PFIS", );
-          vmc->Gstpar(i+offset, "DRAY", 1);
-          //vmc->Gstpar(i+offset, "ANNI", );
-          //vmc->Gstpar(i+offset, "BREM", );
-          //vmc->Gstpar(i+offset, "HADR", );
-          //vmc->Gstpar(i+offset, "MUNU", );
-          //vmc->Gstpar(i+offset, "DCAY", );
-          vmc->Gstpar(i+offset, "LOSS", 1);
-          //vmc->Gstpar(i+offset, "MULS", );
-          //vmc->Gstpar(i+offset, "GHCOR1", );
-          //vmc->Gstpar(i+offset, "BIRK1", );
-          //vmc->Gstpar(i+offset, "BRIK2", );
-          //vmc->Gstpar(i+offset, "BRIK3", );
-          //vmc->Gstpar(i+offset, "LABS", );
-          //vmc->Gstpar(i+offset, "SYNC", );
-          //vmc->Gstpar(i+offset, "STRA", );
-     }
-}
+
 //______________________________________________________________________
 void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
 {
     //
-    // Creates a single SPD carbon fiber sector and places it 
+    // Creates a single SPD carbon fiber sector and places it
     // in a container volume passed as first argument ('moth').
     // Second argument points to the TGeoManager which coordinates
     // the overall volume creation.
-    // The position of the sector is based on distance of 
-    // closest point of SPD stave to beam pipe 
+    // The position of the sector is based on distance of
+    // closest point of SPD stave to beam pipe
     // (figures all-sections-modules.ps) of 7.22mm at section A-A.
     //
 
@@ -481,7 +409,7 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
     /*
      <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.ps"
      title="SPD     Sector    drawing   with all  cross     sections  defined">
-     <p>The    SPD  Sector    definition.    In   
+     <p>The    SPD  Sector    definition.    In
      <a   href="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly.hpgl">HPGL</a>    format.
      <img src="http://alice.pd.infn.it/latestdr/Geometric-Revision/assembly-10-modules.ps"
      titile="SPD    All  Sectors   end  view with thermal   sheald">
@@ -518,7 +446,7 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
     // Return:
     //    none.
     // Updated values for kSPDclossesStaveAA, kBeamPipeRadius, and
-    // staveThicknessAA are taken from 
+    // staveThicknessAA are taken from
     // http://physics.mps.ohio-state.edu/~nilsen/ITSfigures/Sezione_layerAA.pdf
     //
     const Double_t kSPDclossesStaveAA   =   7.25* fgkmm;
@@ -528,14 +456,14 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
     const Double_t kBeamPipeRadius      =   0.5 * 59.6 * fgkmm; // diam. = 59.6 mm
   //const Double_t staveThicknessAA     =   0.9 *fgkmm;         // nominal thickness
     const Double_t staveThicknessAA     =   1.02 * fgkmm;       // get from stave geometry.
-    
+
     Int_t i, j, k;
     Double_t angle, radiusSector, xAAtubeCenter0, yAAtubeCenter0;
     TGeoCombiTrans *secRot = new TGeoCombiTrans(), *comrot;
     TGeoVolume *vCarbonFiberSector;
     TGeoMedium *medSPDcf;
 
-    // Define an assembly and fill it with the support of 
+    // Define an assembly and fill it with the support of
     // a single carbon fiber sector and staves in it
     medSPDcf = GetMedium("SPD C (M55J)$", mgr);
     vCarbonFiberSector = new TGeoVolumeAssembly("ITSSPDCarbonFiberSectorV");
@@ -549,13 +477,13 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
   //radiusSector *= radiusSector; // squaring;
   //radiusSector -= xAAtubeCenter0 * xAAtubeCenter0;
   //radiusSector  = -yAAtubeCenter0 + TMath::Sqrt(radiusSector);
-    
+
     AliDebug(1, Form("SPDSector : radiusSector=%f\n",radiusSector));
     i = 1;
     AliDebug(1, Form("i= %d x0=%f y0=%f x1=%f y1=%f\n", i,
                      fSPDsectorX0.At(i), fSPDsectorY0.At(i),
                      fSPDsectorX1.At(i),fSPDsectorY1.At(i)));
-    
+
     // add 10 single sectors, by replicating the virtual sector defined above
     // and placing at different angles
     Double_t shiftX, shiftY, tub[2][6][3];
@@ -567,7 +495,7 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
     for(i = 0; i < kNSectorsTotal; i++) {
         shiftX = -radiusSector * TMath::Sin(angle/fgkRadian);
         shiftY =  radiusSector * TMath::Cos(angle/fgkRadian);
-        //cout << "ANGLE = " << angle << endl; 
+        //cout << "ANGLE = " << angle << endl;
         shiftX += 0.1094 * TMath::Cos((angle + 196.)/fgkRadian);
         shiftY += 0.1094 * TMath::Sin((angle + 196.)/fgkRadian);
         //shiftX -= 0.105;
@@ -590,7 +518,7 @@ void AliITSv11GeometrySPD::SPDSector(TGeoVolume *moth, TGeoManager *mgr)
     } // end for i
     if(GetDebug(3)) moth->PrintNodes();
     delete secRot;
-    
+
     CreateCones(moth);
 }
 //______________________________________________________________________
@@ -627,7 +555,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     // center of the #0 detector and the beam pipe.
     // Measurements are taken at cross section A-A.
     //
-     
+
     //TGeoMedium *medSPDfs      = 0;//SPD support cone inserto stesalite 4411w
     //TGeoMedium *medSPDfo      = 0;//SPD support cone foam, Rohacell 50A.
     //TGeoMedium *medSPDal      = 0;//SPD support cone SDD mounting bracket Al
@@ -650,10 +578,10 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     // 1) the (ksecX, ksecY) points are plotted
     //    and circles of the specified radii are drawn around them.
     // 2) each pair of consecutive circles is connected by a line
-    //    tangent to them, in accordance with the radii being "internal" 
-    //    or "external" with respect to the closed shape which describes 
+    //    tangent to them, in accordance with the radii being "internal"
+    //    or "external" with respect to the closed shape which describes
     //    the sector itself.
-    // The resulting connected shape is the section 
+    // The resulting connected shape is the section
     // of the SPD sector surface in the transverse plane (XY).
     //
     const Double_t ksecX0   = -10.725 * fgkmm;
@@ -682,7 +610,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     const Double_t ksecY5   = +10.961 * fgkmm;
     const Double_t ksecR5   =  +0.8   * fgkmm; // internal
     //const Double_t ksecDip2 = 4.553 * fgkmm;
-    // 
+    //
     const Double_t ksecX6   = +10.830 * fgkmm;
     const Double_t ksecY6   = +16.858 * fgkmm;
     const Double_t ksecR6   =  +0.6   * fgkmm; // internal
@@ -767,7 +695,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         ksecY10, ksecY11, -1000.0,
         ksecY12, -1000.0
     };
-    Double_t secR[ksecNRadii] = { 
+    Double_t secR[ksecNRadii] = {
         ksecR0,  ksecR1,  -.5 * ksecDipLength - ksecDipRadii,
         ksecR2,  ksecR3,  -.5 * ksecDipLength - ksecDipRadii,
         ksecR4,  ksecR5,  -.5 * ksecDipLength - ksecDipRadii,
@@ -795,9 +723,9 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         ksecR10, ksecR11, ksecRCoolOut,
         ksecR12, ksecR13
     };
-    Double_t secDip2[ksecNCoolingTubeDips] = { 
-        ksecDl1, ksecDl2, ksecDl3, 
-        ksecDl4, ksecDl5, ksecDl6 
+    Double_t secDip2[ksecNCoolingTubeDips] = {
+        ksecDl1, ksecDl2, ksecDl3,
+        ksecDl4, ksecDl5, ksecDl6
     };
     Double_t secX3[ksecNRadii];
     Double_t secY3[ksecNRadii];
@@ -887,7 +815,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     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];
@@ -899,7 +827,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         t  = secDip2[i] / t0;
         a  = x0+(x1-x0) * t;
         b  = y0+(y1-y0) * t;
-        if(i == 0) { 
+        if(i == 0) {
             // get location of tube center->Surface for locating
             // this sector around the beam pipe.
             // This needs to be double checked, but I need my notes for that.
@@ -912,7 +840,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
             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) * 
+            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;
@@ -926,7 +854,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
             secY3[j] = b + TMath::Sign(2.0*ksecDipRadii-0.5*ksecCoolTubeFlatY,
                                        y1-y0)*(x1-x0)/t0;
         } // end if(a+b*(a-x0)/(b-y0)>0.0)
-          
+
           // 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],
@@ -941,7 +869,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         if (secAngleEnd[j]>secAngleStart[j]) secAngleEnd[j] -= 360.0;
         secR[j] = TMath::Sqrt(secR[j]*secR[j]+4.0*ksecDipRadii*ksecDipRadii);
     } // end for i
-     
+
     // Special cases
     secAngleStart2[8] -= 360.;
     secAngleStart2[11] -= 360.;
@@ -968,7 +896,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
             yp[j][k] = y0+(y1-y0) * t;
         } // end for k
         secAngleTurbo[i] = -TMath::RadToDeg() * TMath::ATan2(y1-y0, x1-x0);
-        if(GetDebug(3)) { 
+        if(GetDebug(3)) {
             AliInfo(
                 Form("i=%d -- angle=%f -- x0,y0=(%f, %f) -- x1,y1=(%f, %f)",
                      i, secAngleTurbo[i], x0, y0, x1, y1));
@@ -979,7 +907,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     sA0->DefinePolygon(m, xpp, ypp);
     sA0->DefineSection(0, -ksecDz);
     sA0->DefineSection(1,  ksecDz);
-     
+
     // store the edges of each XY segment which defines
     // one of the plane zones where staves will have to be placed
     fSPDsectorX0.Set(ksecNCoolingTubeDips);
@@ -991,7 +919,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         // Find index in xpp[] and ypp[] corresponding to where the
         // SPD ladders are to be attached. Order them according to
         // the ALICE numbering schema. Using array of indexes (+-1 for
-        // cooling tubes. For any "bend/dip/edge, there are 
+        // cooling tubes. For any "bend/dip/edge, there are
         // ksecNPointsPerRadii+1 points involved.
         if(i == 0) j = 1;
         else if (i == 1) j = 0;
@@ -1004,7 +932,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         fSPDsectorX1[i] = sA0->GetX(ixy1);
         fSPDsectorY1[i] = sA0->GetY(ixy1);
     } // end for i
-     
+
     //printf("SectorA#%d ",0);
     InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],ksecCthick,
                 xpp2[0],ypp2[0]);
@@ -1043,7 +971,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     // 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);
-    sTA1 = new TGeoEltu("ITS SPD Cooling Tube coolant TA1", 
+    sTA1 = new TGeoEltu("ITS SPD Cooling Tube coolant TA1",
                         sTA0->GetA() - ksecCoolTubeThick,
                         sTA0->GetB()-ksecCoolTubeThick,ksecDz);
     SPDsectorShape(ksecNRadii,secX2,secY2,secR2,secAngleStart2,secAngleEnd2,
@@ -1055,8 +983,12 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     sB0->DefineSection(1, ksecDz + ksecZEndLen);
 
     //printf("SectorB#%d ",0);
+  // Points around the most sharpened tips have to be avoided - M.S. 24 feb 09
+    const Int_t nSpecialPoints = 5;
+    const Int_t kSpecialPoints[nSpecialPoints] = {7, 17, 47, 62, 77};
+    Int_t i2 = 0;
     InsidePoint(xpp[m-1],ypp[m-1],xpp[0],ypp[0],xpp[1],ypp[1],
-                ksecCthick2,xpp2[0],ypp2[0]);
+                ksecCthick2,xpp2[i2],ypp2[i2]);
     for(i = 1; i < m - 1; i++) {
         t = ksecCthick2;
         for(k = 0; k < ksecNCoolingTubeDips; k++)
@@ -1066,15 +998,23 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
                      ksecNPointsPerRadii == i))
                     t = ksecRCoolOut-ksecRCoolIn;
         //printf("SectorB#%d ",i);
-        InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],t,
-                    xpp2[i],ypp2[i]);
+       Bool_t useThisPoint = kTRUE;
+       for(Int_t ii = 0; ii < nSpecialPoints; ii++)
+         if ( (i == kSpecialPoints[ii] - 1) ||
+              (i == kSpecialPoints[ii] + 1)   ) useThisPoint = kFALSE;
+       if (useThisPoint) {
+         i2++;
+         InsidePoint(xpp[i-1],ypp[i-1],xpp[i],ypp[i],xpp[i+1],ypp[i+1],t,
+                     xpp2[i2],ypp2[i2]);
+       }
     }// end for i
     //printf("SectorB#%d ",m);
+    i2++;
     InsidePoint(xpp[m-2],ypp[m-2],xpp[m-1],ypp[m-1],xpp[0],ypp[0],
-                ksecCthick2,xpp2[m-1],ypp2[m-1]);
+                ksecCthick2,xpp2[i2],ypp2[i2]);
     sB1 = new TGeoXtru(2);
     sB1->SetName("ITS SPD Carbon fiber support Sector Air End B1");
-    sB1->DefinePolygon(m, xpp2, ypp2);
+    sB1->DefinePolygon(i2+1, xpp2, ypp2);
     sB1->DefineSection(0,sB0->GetZ(0));
     sB1->DefineSection(1,sB0->GetZ(1)-ksecCthick2);
     const Double_t kspdEndHoleRadius1=5.698*fgkmm;
@@ -1124,7 +1064,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
         sB1->InspectShape();
         sB2->InspectShape();
     } // end if(GetDebug(3))
-     
+
     // create the assembly of the support and place staves on it
     TGeoVolumeAssembly *vM0 = new TGeoVolumeAssembly(
                                          "ITSSPDSensitiveVirtualvolumeM0");
@@ -1198,7 +1138,7 @@ void AliITSv11GeometrySPD::CarbonFiberSector(TGeoVolume *moth,
     vTB1->SetLineWidth(1);
     vTB1->SetFillColor(vTB1->GetLineColor());
     vTB1->SetFillStyle(4050); // 0% transparent
-     
+
     // add volumes to mother container passed as argument of this method
     moth->AddNode(vM0,1,0); // Add virtual volume to mother
     vA0->AddNode(vA1,1,0); // Put air inside carbon fiber.
@@ -1360,7 +1300,7 @@ Bool_t AliITSv11GeometrySPD::GetSectorMountingPoints(Int_t index,Double_t &x0,
     // ---
     // Returns kTRUE if no problems encountered.
     // Returns kFALSE if a problem was encountered (e.g.: shape not found).
-    // 
+    //
     Int_t isize = fSPDsectorX0.GetSize();
 
     x0 = x1 = y0 = y1 = 0.0;
@@ -1375,9 +1315,9 @@ Bool_t AliITSv11GeometrySPD::GetSectorMountingPoints(Int_t index,Double_t &x0,
     return kTRUE;
 }
 //______________________________________________________________________
-void AliITSv11GeometrySPD::SPDsectorShape(Int_t n,const Double_t *xc, 
+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, 
+                              const Double_t *ths, const Double_t *the,
                       Int_t npr, Int_t &m, Double_t **xp, Double_t **yp) const
 {
     //
@@ -1392,7 +1332,7 @@ void AliITSv11GeometrySPD::SPDsectorShape(Int_t n,const Double_t *xc,
     //   Double_t *the  array of ending angles [degrees].
     //   Int_t     npr  the number of lines segments to aproximate the arc.
     // Outputs (arguments passed by reference):
-    //   Int_t       m    the number of enetries in the arrays *xp[npr+1] 
+    //   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.
@@ -1458,11 +1398,11 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     //      dimensions related to this object:
     //      size[0] = 'thickness' (the smallest dimension)
     //      size[1] = 'length' (the direction along the ALICE Z axis)
-    //      size[2] = 'width' (extension in the direction perp. to the 
+    //      size[2] = 'width' (extension in the direction perp. to the
     //                         above ones)
     //  3 - the used TGeoManager
 
-    // ** CRITICAL CHECK **    
+    // ** CRITICAL CHECK **
     // layer number can be ONLY 1 or 2
     if (layer != 1 && layer != 2) AliFatal("Layer number MUST be 1 or 2");
 
@@ -1471,8 +1411,8 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     TGeoMedium *medSPDSiChip = GetMedium("SPD SI CHIP$",mgr); // SPD SI CHIP
     TGeoMedium *medSi        = GetMedium("SI$",mgr);
     TGeoMedium *medBumpBond  = GetMedium("COPPER$",mgr);  // ??? BumpBond
-    
-    // ** SIZES **    
+
+    // ** SIZES **
     Double_t chipThickness  = fgkmm *  0.150;
     Double_t chipWidth      = fgkmm * 15.950;
     Double_t chipLength     = fgkmm * 13.600;
@@ -1480,7 +1420,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     Double_t sensThickness  = fgkmm *  0.200;
     Double_t sensLength     = fgkmm * 69.600;
     Double_t sensWidth      = fgkmm * 12.800;
-    Double_t guardRingWidth = fgkmm *  0.560; // a border of this thickness 
+    Double_t guardRingWidth = fgkmm *  0.560; // a border of this thickness
                                               // all around the sensor
     Double_t bbLength       = fgkmm * 0.042;
     Double_t bbWidth        = sensWidth;
@@ -1502,9 +1442,9 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     // While creating this volume, since it is a sensitive volume,
     // we must respect some standard criteria for its local reference frame.
     // Local X must correspond to x coordinate of the sensitive volume:
-    // this means that we are going to create the container with a local 
+    // this means that we are going to create the container with a local
     // reference system that is **not** in the middle of the box.
-    // This is accomplished by calling the shape constructor with an 
+    // This is accomplished by calling the shape constructor with an
     // additional option ('originShift'):
     Double_t xSens = 0.5 * (width - sensWidth - 2.0*guardRingWidth);
     Double_t originShift[3] = {-xSens, 0., 0.};
@@ -1519,7 +1459,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     // the sensor as well
     TGeoVolume *volSens = mgr->MakeBox(GetSenstiveVolumeName(layer),medSi,
                              0.5*sensWidth,0.5*sensThickness,0.5*sensLength);
-    // the guard ring shape is the subtraction of two boxes with the 
+    // the guard ring shape is the subtraction of two boxes with the
     // same center.
     TGeoBBox  *shIn = new TGeoBBox(0.5*sensWidth,sensThickness,0.5*sensLength);
     TGeoBBox  *shOut = new TGeoBBox(0.5*sensWidth+guardRingWidth,
@@ -1542,7 +1482,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     // sensor is translated along thickness (X) and width (Y)
     Double_t ySens = 0.5 * (thickness - sensThickness);
     Double_t zSens = 0.0;
-    // we want that the x of the ladder is the same as the one of 
+    // we want that the x of the ladder is the same as the one of
     // its sensitive volume
     TGeoTranslation *trSens = new TGeoTranslation(0.0, ySens, zSens);
     // bump bonds are translated along all axes:
@@ -1568,11 +1508,11 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder(Int_t layer,TArrayD &sizes,
     y = 0.5 * (chipThickness - thickness);
     z = 0.0;
     for (i = 0; i < 5; i++) {
-        z = -0.5*length + guardRingWidth 
+        z = -0.5*length + guardRingWidth
             + (Double_t)i*chipSpacing + ((Double_t)(i) + 0.5)*chipLength;
         trChip[i] = new TGeoTranslation(x, y, z);
     } // end ofr i
-    
+
     // add nodes to container
     container->AddNode(volSens, 1, trSens);
     container->AddNode(volBorder, 1, trSens);
@@ -1604,7 +1544,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
     //      dimensions related to this object:
     //      size[0] = 'thickness' (the smallest dimension)
     //      size[1] = 'length' (the direction along the ALICE Z axis)
-    //      size[2] = 'width' (extension in the direction perp. to the 
+    //      size[2] = 'width' (extension in the direction perp. to the
     //                         above ones)
     //  3 - the used TGeoManager
 
@@ -1613,14 +1553,14 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
     if (layer != 1 && layer != 2) AliFatal("Layer number MUST be 1 or 2");
 
     // ** MEDIA ***************************************************************
-    
+
     TGeoMedium *medAir       = GetMedium("AIR$",mgr);
     TGeoMedium *medSPDSiChip = GetMedium("SPD SI CHIP$",mgr); // SPD SI CHIP
     TGeoMedium *medSi        = GetMedium("SI$",mgr);
     TGeoMedium *medBumpBond  = GetMedium("COPPER$",mgr);  // ??? BumpBond
 
     // ** SIZES ***************************************************************
-        
+
     Double_t chipThickness  = fgkmm *  0.150;
     Double_t chipWidth      = fgkmm * 15.950;
     Double_t chipLength     = fgkmm * 13.600;
@@ -1633,7 +1573,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
     Double_t bbWidth        = sensWidth;
     Double_t bbThickness    = fgkmm * 0.012;
     Double_t bbPos          = 0.080;          // Z position w.r. to left pixel edge
-    
+
     // the three dimensions of the box which contains the ladder
     // are returned in the 'sizes' argument, and are used for volumes positionement
     // for readability purpose, they are linked by reference to a more meaningful name
@@ -1647,29 +1587,29 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
     thickness = sensThickness + chipThickness + bbThickness;
 
     // ** VOLUMES *************************************************************
-    
+
     // This is a sensitive volume.
     // Local X must correspond to x coordinate of the sensitive volume:
-    // to respect this, the origin of the local reference system 
-    // must be shifted from the middle of the box, using 
+    // to respect this, the origin of the local reference system
+    // must be shifted from the middle of the box, using
     // an additional option ('originShift') when creating the container shape:
     Double_t xSens = 0.5 * (width - sensWidth - 2.0*guardRingWidth);
     Double_t originShift[3] = {-xSens, 0., 0.};
-    
+
     // now the container is a TGeoBBox with this shift,
     // and the volume is made of air (it does not exist in reality)
     TGeoBBox *shLadder = new TGeoBBox(0.5*width, 0.5*thickness, 0.5*length, originShift);
     TGeoVolume *vLadder = new TGeoVolume(Form("ITSSPDlay%d-Ladder", layer), shLadder, medAir);
-    
+
     // the chip is a common box
-    TGeoVolume *vChip = mgr->MakeBox("ITSSPDchip", medSPDSiChip, 
+    TGeoVolume *vChip = mgr->MakeBox("ITSSPDchip", medSPDSiChip,
                                      0.5*chipWidth, 0.5*chipThickness, 0.5*chipLength);
-    
+
     // to build the sensor with its guard ring, we create a TGeoBBox with the size
-    // of the sensor + guard ring, and we insert the true sensor into it as an 
+    // of the sensor + guard ring, and we insert the true sensor into it as an
     // internal node: this simplifies the implementation with the same result
     TGeoVolume *vSensGuard = mgr->MakeBox(Form("%s-guardRing", GetSenstiveVolumeName(layer)),
-                                          medSi, 
+                                          medSi,
                                           0.5*sensWidth + guardRingWidth,
                                           0.5*sensThickness,
                                           0.5*sensLength + guardRingWidth);
@@ -1677,11 +1617,11 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
                                      0.5*sensWidth,0.5*sensThickness,0.5*sensLength);
     vSensGuard->AddNode(vSens, 0);
     vSensGuard->SetTransparency(50);
-    
+
     // bump bond is a common box for one whole column
     TGeoVolume *vBB = mgr->MakeBox("ITSSPDbb", medBumpBond,
                                    0.5*bbWidth, 0.5*bbThickness, 0.5*bbLength);
-    
+
     // set colors of all objects for visualization
     vLadder->SetLineColor(kRed);
     vSens->SetLineColor(kYellow + 1);
@@ -1693,7 +1633,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
     // sensor is translated along thickness (Y) and width (X)
     Double_t ySens = 0.5 * (thickness - sensThickness);
     Double_t zSens = 0.0;
-    // we want that the x of the ladder is the same as the one of 
+    // we want that the x of the ladder is the same as the one of
     // its sensitive volume
     TGeoTranslation *trSens = new TGeoTranslation(0.0, ySens, zSens);
     // bump bonds are translated along all axes:
@@ -1719,11 +1659,11 @@ TGeoVolume* AliITSv11GeometrySPD::CreateLadder
     y = 0.5 * (chipThickness - thickness);
     z = 0.0;
     for (i = 0; i < 5; i++) {
-        z = -0.5*length + guardRingWidth 
+        z = -0.5*length + guardRingWidth
                 + (Double_t)i*chipSpacing + ((Double_t)(i) + 0.5)*chipLength;
         trChip[i] = new TGeoTranslation(x, y, z);
     } // end ofr i
-    
+
     // add nodes to container
     vLadder->AddNode(vSensGuard, 1, trSens);
     //vLadderAddNode(volBorder, 1, trSens);
@@ -1743,16 +1683,16 @@ TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
     // They have a complicated shape which is approximated by a TGeoXtru
     // Implementation of a single clip over an half-stave.
     // It has a complicated shape which is approximated to a section like this:
-    //   
+    //
     //     6
     //     /\   .
     //  7 //\\  5
     //    / 1\\___________________4
     //   0    \___________________
     //        2                   3
-    // with a finite thickness for all the shape 
+    // with a finite thickness for all the shape
     // Its local reference frame is such that point A corresponds to origin.
-    // 
+    //
     Double_t fullLength      = fgkmm * 12.6;    // = x4 - x0
     Double_t flatLength      = fgkmm *  5.4;    // = x4 - x3
     Double_t inclLongLength  = fgkmm *  5.0;    // = 5-6
@@ -1760,22 +1700,22 @@ TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
     Double_t fullHeight      = fgkmm *  2.8;    // = y6 - y3
     Double_t thickness       = fgkmm *  0.18;    // thickness
     Double_t totalLength     = fgkmm * 52.0;    // total length in Z
-    Double_t holeSize        = fgkmm *  5.0;    // dimension of cubic 
+    Double_t holeSize        = fgkmm *  5.0;    // dimension of cubic
                                                 // hole inserted for pt1000
     Double_t angle1          = 27.0;            // supplementary of angle DCB
     Double_t angle2;                            // angle DCB
     Double_t angle3;                            // angle of GH with vertical
+
     angle2 = 0.5 * (180.0 - angle1);
-    angle3 = 90.0 - TMath::ACos(fullLength - flatLength - 
-                                inclLongLength*TMath::Cos(angle1)) * 
+    angle3 = 90.0 - TMath::ACos(fullLength - flatLength -
+                                inclLongLength*TMath::Cos(angle1)) *
                                 TMath::RadToDeg();
     angle1 *= TMath::DegToRad();
     angle2 *= TMath::DegToRad();
     angle3 *= TMath::DegToRad();
 
     Double_t x[8], y[8];
+
     x[0] =  0.0;
     x[1] = x[0] + fullLength - flatLength - inclLongLength*TMath::Cos(angle1);
     x[2] = x[0] + fullLength - flatLength;
@@ -1784,7 +1724,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
     x[5] = x[4] - flatLength + thickness * TMath::Cos(angle2);
     x[6] = x[1];
     x[7] = x[0];
+
     y[0] = 0.0;
     y[1] = y[0] + inclShortLength * TMath::Cos(angle3);
     y[2] = y[1] - inclLongLength * TMath::Sin(angle1);
@@ -1793,7 +1733,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
     y[5] = y[4];
     y[6] = y[1] + thickness;
     y[7] = y[0] + thickness;
+
     sizes.Set(7);
     sizes[0] = totalLength;
     sizes[1] = fullHeight;
@@ -1813,7 +1753,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateClip(TArrayD &sizes,Bool_t isDummy,
     shClip->DefinePolygon(8, x, y);
     shClip->DefineSection(0, -0.5*totalLength, 0., 0., 1.0);
     shClip->DefineSection(1,  0.5*totalLength, 0., 0., 1.0);
+
     TGeoBBox *shHole = new TGeoBBox("ITSSPDSHClipHole",0.5*holeSize,
                                     0.5*holeSize,0.5*holeSize);
     TGeoTranslation *tr1 = new TGeoTranslation("ITSSPDTRClipHole1",x[2],0.0,
@@ -1845,8 +1785,8 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
                         Double_t thickness,TArrayD &sizes)
 {
     //
-    // Creates the typical composite shape of the grounding foil: 
-    // 
+    // Creates the typical composite shape of the grounding foil:
+    //
     //  +---------------------------------------------------------+
     //  |                         5           6      9            |
     //  |                         +-----------+      +------------+ 10
@@ -1858,38 +1798,38 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
     //       0
     //       Z                                                    + 11
     //
-    // This shape is used 4 times: two layers of glue, one in kapton 
-    // and one in aluminum, taking into account that the aliminum 
+    // This shape is used 4 times: two layers of glue, one in kapton
+    // and one in aluminum, taking into account that the aliminum
     // layer has small differences in the size of some parts.
     // ---
-    // In order to overcome problems apparently due to a large number 
-    // of points, the shape creation is done according the following 
+    // In order to overcome problems apparently due to a large number
+    // of points, the shape creation is done according the following
     // steps:
-    //    1) a TGeoBBox is created with a size right enough to contain 
+    //    1) a TGeoBBox is created with a size right enough to contain
     //       the whole shape (0-1-X-13)
-    //    2) holes are defined as other TGeoBBox which are subtracted 
+    //    2) holes are defined as other TGeoBBox which are subtracted
     //       from the main shape
-    //    3) a TGeoXtru is defined connecting the points (0-->11-->0) 
+    //    3) a TGeoXtru is defined connecting the points (0-->11-->0)
     //       and is also subtracted from the main shape
     // ---
-    // The argument ("type") is used to choose between all these 
+    // The argument ("type") is used to choose between all these
     // possibilities:
     //   - type = 0 --> kapton layer
     //   - type = 1 --> aluminum layer
     //   - type = 2 --> glue layer between support and GF
     //   - type = 3 --> glue layer between GF and ladders
-    // Returns: a TGeoCompositeShape which will then be used to shape 
-    // several volumes. Since TGeoXtru is used, the local reference 
+    // Returns: a TGeoCompositeShape which will then be used to shape
+    // several volumes. Since TGeoXtru is used, the local reference
     // frame of this object has X horizontal and Y vertical w.r to
     // the shape drawn above, and Z axis going perpendicularly to the screen.
-    // This is not the correct reference for the half stave, for which 
-    // the "long" dimension is Z and the "short" is X, while Y goes in 
-    // the direction of thickness. This will imply some rotations when 
+    // This is not the correct reference for the half stave, for which
+    // the "long" dimension is Z and the "short" is X, while Y goes in
+    // the direction of thickness. This will imply some rotations when
     // using the volumes created with this shape.
-    
+
     // suffix to differentiate names
     Char_t type[10];
-    
+
     // size of the virtual box containing exactly this volume
     length = fgkmm * 243.18;
     width  = fgkmm *  15.95;
@@ -1911,8 +1851,8 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
         sprintf(type,"Glue2");
         break;
     }
-    // we divide the shape in several slices along the horizontal 
-    // direction (local X) here we define define the length of all 
+    // we divide the shape in several slices along the horizontal
+    // direction (local X) here we define define the length of all
     // sectors (from leftmost to rightmost)
     Int_t i;
     Double_t sliceLength[] = { 140.71,  2.48,  26.78,   4.00,
@@ -1924,8 +1864,8 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
         sliceLength[5] += fgkmm * 0.4;
         sliceLength[6] -= fgkmm * 0.4;
     } // end if itype ==1
-    
-    // as shown in the drawing, we have four different widths 
+
+    // as shown in the drawing, we have four different widths
     // (along local Y) in this shape:
     Double_t widthMax  = fgkmm * 15.95;
     Double_t widthMed1 = fgkmm * 15.00;
@@ -1937,20 +1877,20 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
         widthMed2 -= fgkmm * 0.4;
         widthMin  -= fgkmm * 0.4;
     } // end if itype==1
-    
+
     // create the main shape
     TGeoBBox *shGroundFull = 0;
     shGroundFull = new TGeoBBox(Form("ITSSPDSHgFoil%sFull", type),
                                 0.5*length,0.5*width, 0.5*thickness);
-    
-    // create the polygonal shape to be subtracted to give the correct 
-    // shape to the borders its vertices are defined in sugh a way that 
-    // this polygonal will be placed in the correct place considered 
-    // that the origin of the local reference frame is in the center 
-    // of the main box: we fix the starting point at the lower-left 
-    // edge of the shape (point 12), and add all points in order, 
+
+    // create the polygonal shape to be subtracted to give the correct
+    // shape to the borders its vertices are defined in sugh a way that
+    // this polygonal will be placed in the correct place considered
+    // that the origin of the local reference frame is in the center
+    // of the main box: we fix the starting point at the lower-left
+    // edge of the shape (point 12), and add all points in order,
     // following a clockwise rotation
-    
+
     Double_t x[13], y[13];
     x[ 0] = -0.5 * length + sliceLength[0];
     y[ 0] = -0.5 * widthMax;
@@ -1997,22 +1937,22 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
     shGroundXtru->DefinePolygon(13, x, y);
     shGroundXtru->DefineSection(0, -thickness, 0., 0., 1.0);
     shGroundXtru->DefineSection(1,  thickness, 0., 0., 1.0);
-    
+
     // define a string which will express the algebric operations among volumes
     // and add the subtraction of this shape from the main one
     TString strComposite(Form("ITSSPDSHgFoil%sFull-(%s+", type,
                               shGroundXtru->GetName()));
-    
+
     // define the holes according to size information coming from drawings:
     Double_t holeLength = fgkmm * 10.00;
     Double_t holeWidth  = fgkmm *  7.50;
-    Double_t holeSepX0  = fgkmm *  7.05;  // separation between center 
+    Double_t holeSepX0  = fgkmm *  7.05;  // separation between center
                                           // of first hole and left border
-    Double_t holeSepXC  = fgkmm * 14.00;  // separation between the centers 
+    Double_t holeSepXC  = fgkmm * 14.00;  // separation between the centers
                                           // of two consecutive holes
-    Double_t holeSepX1  = fgkmm * 15.42;  // separation between centers of 
+    Double_t holeSepX1  = fgkmm * 15.42;  // separation between centers of
                                           // 5th and 6th hole
-    Double_t holeSepX2  = fgkmm * 22.00;  // separation between centers of 
+    Double_t holeSepX2  = fgkmm * 22.00;  // separation between centers of
                                           // 10th and 11th hole
     if (itype == 1) {
         holeSepX0  -= fgkmm * 0.2;
@@ -2027,19 +1967,19 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
     sizes[4] = holeSepX1;
     sizes[5] = holeSepX2;
     sizes[6] = fgkmm * 4.40;
-    
+
     // X position of hole center (will change for each hole)
     Double_t holeX = -0.5*length;
     // Y position of center of all holes (= 4.4 mm from upper border)
     Double_t holeY = 0.5*(width - holeWidth) - widthMin;
-    
+
     // create a shape for the holes (common)
     TGeoBBox *shHole = 0;
     shHole = new TGeoBBox(Form("ITSSPD%sGfoilHole", type),0.5*holeLength,
                           0.5*holeWidth, thickness);
-    
+
     // insert the holes in the XTRU shape:
-    // starting from the first value of X, they are simply 
+    // starting from the first value of X, they are simply
     // shifted along this axis
     char name[200];
     TGeoTranslation *transHole[11];
@@ -2063,7 +2003,7 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
         strComposite.Append(Form("ITSSPD%sGfoilHole:%s", type, name));
         if (i < 10) strComposite.Append("+"); else strComposite.Append(")");
     } // end for i
-    
+
     // create composite shape
     TGeoCompositeShape *shGround = new TGeoCompositeShape(
         Form("ITSSPDSHgFoil%s", type), strComposite.Data());
@@ -2071,12 +2011,12 @@ TGeoCompositeShape* AliITSv11GeometrySPD::CreateGroundingFoilShape
     return shGround;
 }
 //______________________________________________________________________
-TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
+TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
                                    TArrayD &sizes, TGeoManager *mgr)
 {
     //
-    // Create a volume containing all parts of the grounding foil a 
-    // for a half-stave. 
+    // Create a volume containing all parts of the grounding foil a
+    // for a half-stave.
     // It consists of 4 layers with the same shape but different thickness:
     // 1) a layer of glue
     // 2) the aluminum layer
@@ -2084,34 +2024,34 @@ TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
     // 4) another layer of glue
     // ---
     // Arguments:
-    //  1: a boolean value to know if it is the grounding foir for 
+    //  1: a boolean value to know if it is the grounding foir for
     //     the right or left side
     //  2: a TArrayD which will contain the dimension of the container box:
     //       - size[0] = length along Z (the beam line direction)
-    //       - size[1] = the 'width' of the stave, which defines, together 
+    //       - size[1] = the 'width' of the stave, which defines, together
     //                   with Z, the plane of the carbon fiber support
-    //       - size[2] = 'thickness' (= the direction along which all 
+    //       - size[2] = 'thickness' (= the direction along which all
     //                    stave components are superimposed)
     //  3: the TGeoManager
     // ---
-    // The return value is a TGeoBBox volume containing all grounding 
+    // The return value is a TGeoBBox volume containing all grounding
     // foil components.
     // to avoid strange behaviour of the geometry manager,
     // create a suffix to be used in the names of all shapes
     //
     char suf[5];
     if (isRight) strcpy(suf, "R"); else strcpy(suf, "L");
-    // this volume will be created in order to ease its placement in 
-    // the half-stave; then, it is added here the small distance of 
-    // the "central" edge of each volume from the Z=0 plane in the stave 
+    // this volume will be created in order to ease its placement in
+    // the half-stave; then, it is added here the small distance of
+    // the "central" edge of each volume from the Z=0 plane in the stave
     // reference (which coincides with ALICE one)
     Double_t dist = fgkmm * 0.71;
-    
+
     // define materials
     TGeoMedium *medKap  = GetMedium("SPD KAPTON(POLYCH2)$", mgr);
     TGeoMedium *medAlu  = GetMedium("AL$", mgr);
     TGeoMedium *medGlue = GetMedium("EPOXY$", mgr); //??? GLUE_GF_SUPPORT
-    
+
     // compute the volume shapes (thicknesses change from one to the other)
     Double_t kpLength, kpWidth, alLength, alWidth;
     TArrayD  kpSize, alSize, glSize;
@@ -2130,8 +2070,8 @@ TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
                                                           g0Thickness, glSize);
     TGeoCompositeShape *g1Shape = CreateGroundingFoilShape(3,kpLength,kpWidth,
                                                           g1Thickness, glSize);
-    // create the component volumes and register their sizes in the 
-    // passed arrays for readability reasons, some reference variables 
+    // create the component volumes and register their sizes in the
+    // passed arrays for readability reasons, some reference variables
     // explicit the meaning of the array slots
     TGeoVolume *kpVol = new TGeoVolume(Form("ITSSPDgFoilKap%s",suf),
                                        kpShape, medKap);
@@ -2151,22 +2091,23 @@ TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
     Double_t &fullThickness = sizes[0];
     Double_t &fullLength = sizes[1];
     Double_t &fullWidth = sizes[2];
-    // kapton leads the larger dimensions of the foil 
+    // kapton leads the larger dimensions of the foil
     // (including the cited small distance from Z=0 stave reference plane)
     // the thickness is the sum of the ones of all components
     fullLength    = kpLength + dist;
     fullWidth     = kpWidth;
     fullThickness = kpThickness + alThickness + g0Thickness + g1Thickness;
     // create the container
-    TGeoMedium *air = GetMedium("AIR$", mgr);
-    TGeoVolume *container = mgr->MakeBox(Form("ITSSPDgFOIL-%s",suf),
-                 air, 0.5*fullThickness, 0.5*fullWidth, 0.5*fullLength);
-    // create the common correction rotation (which depends of what side 
+//    TGeoMedium *air = GetMedium("AIR$", mgr);
+    TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form("ITSSPDgFOIL-%s",suf));
+//    TGeoVolume *container = mgr->MakeBox(Form("ITSSPDgFOIL-%s",suf),
+//                 air, 0.5*fullThickness, 0.5*fullWidth, 0.5*fullLength);
+    // create the common correction rotation (which depends of what side
     // we are building)
     TGeoRotation *rotCorr = new TGeoRotation(*gGeoIdentity);
     if (isRight) rotCorr->RotateY(90.0);
-    else rotCorr->RotateY(-90.0);        
-    // compute the translations, which are in the length and 
+    else rotCorr->RotateY(-90.0);
+    // compute the translations, which are in the length and
     // thickness directions
     Double_t x, y, z, shift = 0.0;
     if (isRight) shift = dist;
@@ -2185,7 +2126,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
     x += 0.5*(alThickness + g1Thickness);
     z  = 0.5*(fullLength - kpLength) - shift;
     TGeoCombiTrans *glTrans1 = new TGeoCombiTrans(x, 0.0, z, rotCorr);
-    
+
     //cout << fgkGapHalfStave << endl;
     //cout << g0Thickness << endl;
     //cout << kpThickness << endl;
@@ -2197,8 +2138,8 @@ TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
     container->AddNode(kpVol, 1, kpTrans);
     container->AddNode(alVol, 1, alTrans);
     container->AddNode(g0Vol, 1, glTrans0);
-    container->AddNode(g1Vol, 2, glTrans1);    
-    // to add the grease we remember the sizes of the holes, stored as 
+    container->AddNode(g1Vol, 2, glTrans1);
+    // to add the grease we remember the sizes of the holes, stored as
     // additional parameters in the kapton layer size:
     //   - sizes[3] = hole length
     //   - sizes[4] = hole width
@@ -2206,7 +2147,7 @@ TGeoVolume* AliITSv11GeometrySPD::CreateGroundingFoil(Bool_t isRight,
     //   - sizes[6] = standard separation between holes
     //   - sizes[7] = separation between 5th and 6th hole
     //   - sizes[8] = separation between 10th and 11th hole
-    //   - sizes[9] = separation between the upper hole border and 
+    //   - sizes[9] = separation between the upper hole border and
     //                the foil border
     Double_t holeLength      = kpSize[0];
     Double_t holeWidth       = kpSize[1];
@@ -2254,20 +2195,20 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     //  - the MCM chips (specifications from EDMS)
     //  - the cap which covers the zone where chips are bound to MCM
     // ---
-    // The local reference frame of this assembly is defined in such a way 
-    // that all volumes are contained in a virtual box whose center 
-    // is placed exactly in the middle of the occupied space w.r to all 
-    // directions. This will ease the positioning of this object in the 
-    // half-stave. The sizes of this virtual box are stored in 
+    // The local reference frame of this assembly is defined in such a way
+    // that all volumes are contained in a virtual box whose center
+    // is placed exactly in the middle of the occupied space w.r to all
+    // directions. This will ease the positioning of this object in the
+    // half-stave. The sizes of this virtual box are stored in
     // the array passed by reference.
     // ---
     // Arguments:
-    //  - a boolean flag to know if this is the "left" or "right" MCM, when 
-    //    looking at the stave from above (i.e. the direction from which 
-    //    one sees bus over ladders over grounding foil) and keeping the 
-    //    continuous border in the upper part, one sees the thicker part 
+    //  - a boolean flag to know if this is the "left" or "right" MCM, when
+    //    looking at the stave from above (i.e. the direction from which
+    //    one sees bus over ladders over grounding foil) and keeping the
+    //    continuous border in the upper part, one sees the thicker part
     //    on the left or right.
-    //  - an array passed by reference which will contain the size of 
+    //  - an array passed by reference which will contain the size of
     //    the virtual container.
     //  - a pointer to the used TGeoManager.
     //
@@ -2281,10 +2222,10 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     TGeoMedium *medChip = GetMedium("SPD SI CHIP$",mgr);
     TGeoMedium *medCap  = GetMedium("AL$",mgr);
 
-    // The shape of the MCM is divided into 3 sectors with different 
+    // The shape of the MCM is divided into 3 sectors with different
     // widths (Y) and lengths (X), like in this sketch:
     //
-    //   0                      1                                   2 
+    //   0                      1                                   2
     //    +---------------------+-----------------------------------+
     //    |                                    4       sect 2       |
     //    |                    6      sect 1    /-------------------+
@@ -2295,7 +2236,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     // the inclination of all oblique borders (6-7, 4-5) is always 45 degrees.
     // From drawings we can parametrize the dimensions of all these sectors,
     // then the shape of this part of the MCM is implemented as a
-    // TGeoXtru centerd in the virtual XY space. 
+    // TGeoXtru centerd in the virtual XY space.
     // The first step is definig the relevant sizes of this shape:
     Int_t i, j;
     Double_t mcmThickness  = fgkmm * 0.35;
@@ -2332,9 +2273,9 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     width = sizeYsector[0];
     thickness = mcmThickness + capHeight;
 
-    // define all the relevant vertices of the polygon 
+    // define all the relevant vertices of the polygon
     // which defines the transverse shape of the MCM.
-    // These values are used to several purposes, and 
+    // These values are used to several purposes, and
     // for each one, some points must be excluded
     Double_t xRef[9], yRef[9];
     xRef[0] = -0.5*sizeXtot;
@@ -2356,12 +2297,12 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     xRef[8] =  xRef[0];
     yRef[8] = -yRef[0];
 
-    // the above points are defined for the "right" MCM (if ve view the 
-    // stave from above) in order to change to the "left" one, we must 
+    // the above points are defined for the "right" MCM (if ve view the
+    // stave from above) in order to change to the "left" one, we must
     // change the sign to all X values:
     if (isRight) for (i = 0; i < 9; i++) xRef[i] = -xRef[i];
-    
-    // the shape of the MCM and glue layer are done excluding point 1, 
+
+    // the shape of the MCM and glue layer are done excluding point 1,
     // which is not necessary and cause the geometry builder to get confused
     j = 0;
     Double_t xBase[8], yBase[8];
@@ -2381,7 +2322,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
         j++;
     } // end for i
 
-    // define positions of chips, 
+    // define positions of chips,
     // which must be added to the bottom-left corner of MCM
     // and divided by 1E4;
     Double_t chipX[5], chipY[5];
@@ -2423,7 +2364,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
         chipThickness[i] *= fgkmm;
     } // end for i
 
-    // create shapes for MCM 
+    // create shapes for MCM
     Double_t z1, z2;
     TGeoXtru *shBase = new TGeoXtru(2);
     z1 = -0.5*thickness;
@@ -2436,8 +2377,8 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     TGeoVolume *volBase = new TGeoVolume("ITSSPDbase", shBase, medBase);
     volBase->SetLineColor(kRed);
 
-    // to create the border of the MCM cover, it is required the 
-    // subtraction of two shapes the outer is created using the 
+    // to create the border of the MCM cover, it is required the
+    // subtraction of two shapes the outer is created using the
     // reference points defined here
     TGeoXtru *shCapOut = new TGeoXtru(2);
     shCapOut->SetName(Form("ITSSPDshCAPOUT%s", suf));
@@ -2487,15 +2428,15 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     shCapIn->DefineSection(1, z2 + 0.01, 0., 0., 1.0);
     // compose shapes
     TGeoCompositeShape *shCapBorder = new TGeoCompositeShape(
-                            Form("ITSSPDshBORDER%s", suf), 
+                            Form("ITSSPDshBORDER%s", suf),
                             Form("%s-%s", shCapOut->GetName(),
                                  shCapIn->GetName()));
     // create volume
     TGeoVolume *volCapBorder = new TGeoVolume("ITSSPDcapBoarder",
                                               shCapBorder,medCap);
     volCapBorder->SetLineColor(kGreen);
-    // finally, we create the top of the cover, which has the same 
-    // shape of outer border and a thickness equal of the one othe 
+    // finally, we create the top of the cover, which has the same
+    // shape of outer border and a thickness equal of the one othe
     // cover border one
     TGeoXtru *shCapTop = new TGeoXtru(2);
     z1 = z2;
@@ -2524,7 +2465,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateMCM(Bool_t isRight,
     // add cap border
     mcmAssembly->AddNode(volCapBorder, 1, gGeoIdentity);
     // add cap top
-    mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);    
+    mcmAssembly->AddNode(volCapTop, 1, gGeoIdentity);
 
     return mcmAssembly;
 }
@@ -2535,19 +2476,19 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
 (Bool_t isRight, TArrayD &sizes, TGeoManager *mgr) const
 {
     //
-    // The pixel bus is implemented as a TGeoBBox with some objects on it, 
+    // The pixel bus is implemented as a TGeoBBox with some objects on it,
     // which could affect the particle energy loss.
     // ---
-    // In order to avoid confusion, the bus is directly displaced 
+    // In order to avoid confusion, the bus is directly displaced
     // according to the axis orientations which are used in the final stave:
     // X --> thickness direction
     // Y --> width direction
     // Z --> length direction
     //
-  
-    
+
+
     // ** MEDIA **
-    
+
     //PIXEL BUS
     TGeoMedium *medBus     = GetMedium("SPDBUS(AL+KPT+EPOX)$",mgr);
     TGeoMedium *medPt1000  = GetMedium("CERAMICS$",mgr); // ??? PT1000
@@ -2569,20 +2510,20 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
     Double_t capWidth           = fgkmm * 1.50;
     Double_t capThickness       = fgkmm * 1.35;
     Double_t capY[2], capZ[2];
-    
+
     Double_t resLength          = fgkmm * 2.20;
     Double_t resWidth           = fgkmm * 0.80;
     Double_t resThickness       = fgkmm * 0.35;
     Double_t resY[2], resZ[2];
-    
+
     Double_t extThickness       = fgkmm * 0.25;
     Double_t ext1Length         = fgkmm * (26.7 - 10.0);
     Double_t ext2Length         = fgkmm * (285.0 - ext1Length + extThickness);
     Double_t extWidth           = fgkmm * 11.0;
     Double_t extHeight          = fgkmm * 2.5;
-    
-            
-    // position of pt1000, resistors and capacitors depends on the 
+
+
+    // position of pt1000, resistors and capacitors depends on the
     // bus if it's left or right one
     if (!isRight) {
         pt1000Y    =   64400.;
@@ -2595,7 +2536,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
         pt1000Z[6] =  916200.;
         pt1000Z[7] = 1056200.;
         pt1000Z[8] = 1196200.;
-        pt1000Z[9] = 1336200.;    
+        pt1000Z[9] = 1336200.;
         resZ[0]    = 1397500.;
         resY[0]    =   26900.;
         resZ[1]    =  682500.;
@@ -2615,7 +2556,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
         pt1000Z[6] = 1169700.;
         pt1000Z[7] = 1309700.;
         pt1000Z[8] = 1449700.;
-        pt1000Z[9] = 1589700.;    
+        pt1000Z[9] = 1589700.;
         capY[0]    =   44500.;
         capZ[0]    =  266700.;
         capY[1]    =   44300.;
@@ -2636,14 +2577,14 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
             resY[i] *= 1E-4 * fgkmm;
         }  // end if iM2
     } // end for i
-    
+
     Double_t &fullLength = sizes[1];
     Double_t &fullWidth = sizes[2];
     Double_t &fullThickness = sizes[0];
     fullLength = busLength;
     fullWidth = busWidth;
     // add the thickness of the thickest component on bus (capacity)
-    fullThickness = busThickness + capThickness; 
+    fullThickness = busThickness + capThickness;
     // ** VOLUMES **
     TGeoVolumeAssembly *container = new TGeoVolumeAssembly("PixelBus");
     TGeoVolume *bus = mgr->MakeBox("Bus", medBus, 0.5*busThickness, 0.5*busWidth, 0.5*busLength);
@@ -2660,10 +2601,10 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
     ext1->SetLineColor(kGray);
     ext2->SetLineColor(kGray);
     ext3->SetLineColor(kGray);
-    
+
     // ** MOVEMENTS AND POSITIONEMENT **
     // bus
-    TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness - 
+    TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
                                                         fullThickness), 0.0, 0.0);
     container->AddNode(bus, 0, trBus);
     Double_t zRef, yRef, x, y, z;
@@ -2729,12 +2670,12 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
     container->AddNode(ext1, 0, trExt1);
     container->AddNode(ext2, 0, trExt2);
     container->AddNode(ext3, 0, trExt3);
-    
-    
+
+
     sizes[3] = yRef + pt1000Y;
     sizes[4] = zRef + pt1000Z[2];
     sizes[5] = zRef + pt1000Z[7];
-    
+
     return container;
 }
 */
@@ -2744,16 +2685,16 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
 (Bool_t isRight, Int_t ilayer, TArrayD &sizes, TGeoManager *mgr) const
 {
     //
-    // The pixel bus is implemented as a TGeoBBox with some objects on it, 
+    // The pixel bus is implemented as a TGeoBBox with some objects on it,
     // which could affect the particle energy loss.
     // ---
-    // In order to avoid confusion, the bus is directly displaced 
+    // In order to avoid confusion, the bus is directly displaced
     // according to the axis orientations which are used in the final stave:
     // X --> thickness direction
     // Y --> width direction
     // Z --> length direction
     //
-    
+
     // ** CRITICAL CHECK ******************************************************
     // layer number can be ONLY 1 or 2
     if (ilayer != 1 && ilayer != 2) AliFatal("Layer number MUST be 1 or 2");
@@ -2765,7 +2706,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
     // Capacity
     TGeoMedium *medCap     = GetMedium("SDD X7R capacitors$",mgr);
     // ??? Resistance
-    //TGeoMedium *medRes     = GetMedium("SDD X7R capacitors$",mgr); 
+    //TGeoMedium *medRes     = GetMedium("SDD X7R capacitors$",mgr);
     TGeoMedium *medRes     = GetMedium("ALUMINUM$",mgr);
     TGeoMedium *medExt     = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
     // ** SIZES & POSITIONS **
@@ -2780,19 +2721,19 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
     Double_t capWidth           = fgkmm * 1.50;
     Double_t capThickness       = fgkmm * 1.35;
     Double_t capY[2], capZ[2];
-     
+
     Double_t resLength          = fgkmm * 2.20;
     Double_t resWidth           = fgkmm * 0.80;
     Double_t resThickness       = fgkmm * 0.35;
     Double_t resY[2], resZ[2];
-    
+
     Double_t extThickness       = fgkmm * 0.25;
     Double_t ext1Length         = fgkmm * (26.7 - 10.0);
-    Double_t ext2Length         = fgkmm * (284.0 - ext1Length + extThickness);
+    Double_t ext2Length         = fgkmm * 284.0 - ext1Length + extThickness;
     Double_t extWidth           = fgkmm * 11.0;
     Double_t extHeight          = fgkmm * 2.5;
-               
-    // position of pt1000, resistors and capacitors depends on the 
+
+    // position of pt1000, resistors and capacitors depends on the
     // bus if it's left or right one
     if (!isRight) {
         pt1000Y    =   64400.;
@@ -2805,7 +2746,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
         pt1000Z[6] =  916200.;
         pt1000Z[7] = 1056200.;
         pt1000Z[8] = 1196200.;
-        pt1000Z[9] = 1336200.;   
+        pt1000Z[9] = 1336200.;
         resZ[0]    = 1397500.;
         resY[0]    =   26900.;
         resZ[1]    =  682500.;
@@ -2825,7 +2766,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
         pt1000Z[6] = 1169700.;
         pt1000Z[7] = 1309700.;
         pt1000Z[8] = 1449700.;
-        pt1000Z[9] = 1589700.;   
+        pt1000Z[9] = 1589700.;
         capY[0]    =   44500.;
         capZ[0]    =  266700.;
         capY[1]    =   44300.;
@@ -2846,18 +2787,18 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
             resY[i] *= 1E-4 * fgkmm;
         }  // end if iM2
     } // end for i
-     
+
     Double_t &fullLength = sizes[1];
     Double_t &fullWidth = sizes[2];
     Double_t &fullThickness = sizes[0];
     fullLength = busLength;
     fullWidth = busWidth;
     // add the thickness of the thickest component on bus (capacity)
-    fullThickness = busThickness + capThickness; 
+    fullThickness = busThickness + capThickness;
 
     // ** VOLUMES **
     TGeoVolumeAssembly *container = new TGeoVolumeAssembly("ITSSPDpixelBus");
-    TGeoVolume *bus = mgr->MakeBox("ITSSPDbus", medBus, 0.5*busThickness, 
+    TGeoVolume *bus = mgr->MakeBox("ITSSPDbus", medBus, 0.5*busThickness,
                                    0.5*busWidth, 0.5*busLength);
     TGeoVolume *pt1000 = mgr->MakeBox("ITSSPDpt1000",medPt1000,
                         0.5*pt1000Thickness,0.5*pt1000Width, 0.5*pt1000Length);
@@ -2865,7 +2806,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
                                    0.5*resWidth, 0.5*resLength);
     TGeoVolume *cap = mgr->MakeBox("ITSSPDcapacitor", medCap, 0.5*capThickness,
                                    0.5*capWidth, 0.5*capLength);
-                                   
+
     TGeoVolume *ext1 = mgr->MakeBox("Extender1", medExt, 0.5*extThickness, 0.5*extWidth, 0.5*ext1Length);
     TGeoVolume *ext2 = mgr->MakeBox("Extender2", medExt, 0.5*extHeight - 2.*extThickness, 0.5*extWidth, 0.5*extThickness);
     TGeoVolume *ext3 = mgr->MakeBox("Extender3", medExt, 0.5*extThickness, 0.5*(extWidth-0.8*fgkmm), 0.5*ext2Length + extThickness); // Hardcode fix of a small overlap
@@ -2879,7 +2820,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
 
     // ** MOVEMENTS AND POSITIONEMENT **
     // bus
-    TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness - 
+    TGeoTranslation *trBus = new TGeoTranslation(0.5 * (busThickness -
                                                    fullThickness), 0.0, 0.0);
     container->AddNode(bus, 1, trBus);
     Double_t zRef, yRef, x, y, z;
@@ -2914,7 +2855,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
         TGeoTranslation *tr = new TGeoTranslation(x, y, z);
         container->AddNode(res, i+1, tr);
     } // end for i
-    
+
     // extender
         if (ilayer == 2) {
        if (isRight) {
@@ -2958,169 +2899,314 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBus
     container->AddNode(ext1, 0, trExt1);
     container->AddNode(ext2, 0, trExt2);
     container->AddNode(ext3, 0, trExt3);
-    
+
     sizes[3] = yRef + pt1000Y;
     sizes[4] = zRef + pt1000Z[2];
     sizes[5] = zRef + pt1000Z[7];
-    
+
     return container;
 }
 
 //______________________________________________________________________
-TList* AliITSv11GeometrySPD::CreateConeModule(TGeoManager *mgr) const
+TList* AliITSv11GeometrySPD::CreateConeModule(const Double_t angrot,
+                                             TGeoManager *mgr) const
 {
+    //
+    // Creates all services modules and places them in a TList
+    // angrot is the rotation angle (passed as an argument to avoid
+    // defining the same quantity in two different places)
+    //
+    // Created:      ?? ??? 2008  Alberto Pulvirenti
+    // Updated:      03 May 2010  Mario Sitta
+    //
+
     TGeoMedium *medInox  = GetMedium("INOX$",mgr);
     TGeoMedium *medExt   = GetMedium("SDDKAPTON (POLYCH2)$", mgr);
     TGeoMedium *medPlate = GetMedium("SPD C (M55J)$", mgr);
-    
+    TGeoMedium *medFreon = GetMedium("Freon$", mgr);
+    TGeoMedium *medGas   = GetMedium("GASEOUS FREON$", mgr);
+
     Double_t extThickness = fgkmm * 0.25;
     Double_t ext1Length   = fgkmm * (26.7 - 10.0);
-    Double_t ext2Length   = fgkmm * (285.0 - ext1Length + extThickness);
-    
-    Double_t cableThickness = 1.5 * fgkmm;
-    Double_t cableL1 = 350.0 * fgkmm - extThickness - ext1Length - ext2Length;
-    Double_t cableL2 = 340.0 * fgkmm;
+//    Double_t ext2Length   = fgkmm * (285.0 - ext1Length + extThickness);
+    Double_t ext2Length   = fgkmm * 285.0 - ext1Length + extThickness;
+
+    const Double_t kCableThickness  =   1.5  *fgkmm;
+    Double_t cableL1 = 340.0 * fgkmm - extThickness - ext1Length - ext2Length;
+    Double_t cableL2 = 300.0 * fgkmm;
     //Double_t cableL3 = 570.0 * fgkmm;
     Double_t cableL3 = 57.0 * fgkmm;
     Double_t cableW1 =  11.0 * fgkmm;
     Double_t cableW2 =  30.0 * fgkmm;
     Double_t cableW3 =  50.0 * fgkmm;
-    
-    Double_t mcmThickness = 1.2 *fgkmm;
-    Double_t mcmLength = cableL1 + cableL2 + cableL3;
-    Double_t mcmWidth = cableW1;
-    
-    Double_t plateLength    = 200.0 * fgkmm;
-    Double_t plateWidth     =  50.0 * fgkmm;
-    Double_t plateThickness =   5.0 * fgkmm;
-    
+
+    const Double_t kMCMLength       =   cableL1 + cableL2 + cableL3;
+    const Double_t kMCMWidth        =   cableW1;
+    const Double_t kMCMThickness    =   1.2  *fgkmm;
+
+    const Double_t kPlateLength     = 200.0  *fgkmm;
+    const Double_t kPlateWidth      =  50.0  *fgkmm;
+    const Double_t kPlateThickness  =   5.0  *fgkmm;
+
+    const Double_t kConeTubeRmin    =   5.0  *fgkmm;
+    const Double_t kConeTubeRmax    =   6.0  *fgkmm;
+
+    const Double_t kHorizTubeLen    = 150.0  *fgkmm; //!!!TO BE CHECKED!!!
+    const Double_t kYtoHalfStave    =   6.8  *fgkmm; //!!!TO BE CHECKED!!!
+
     Double_t x[12], y[12];
-    
-    x[0] = 7.5;
+    Double_t xloc, yloc, zloc;
+
+    Int_t kPurple = 6; // Purple (Root does not define it)
+
+    TGeoVolumeAssembly* container[3];
+    container[0] = new TGeoVolumeAssembly("ITSSPDConeModule");
+    container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideA");
+    container[2] = new TGeoVolumeAssembly("ITSSPDCoolingModuleSideC");
+
+    // The extender on the cone as a Xtru
+    x[0] = 0.0;
     y[0] = 0.0 + 0.5 * cableW1;
-    
+
     x[1] = x[0] + cableL1 - 0.5*(cableW2 - cableW1);
     y[1] = y[0];
-    
-    x[2] = x[0] + cableL1; 
+
+    x[2] = x[0] + cableL1;
     y[2] = y[1] + 0.5*(cableW2 - cableW1);
-    
+
     x[3] = x[2] + cableL2;
     y[3] = y[2];
-    
+
     x[4] = x[3] + 0.5*(cableW3 - cableW2);
     y[4] = y[3] + 0.5*(cableW3 - cableW2);
-    
+
     x[5] = x[4] + cableL3 - 0.5*(cableW3 - cableW2);
     y[5] = y[4];
-    
+
     for (Int_t i = 6; i < 12; i++) {
         x[i] =  x[11 - i];
         y[i] = -y[11 - i];
     }
-    
-    TGeoVolumeAssembly* container[2];
-    container[0] = new TGeoVolumeAssembly("ITSSPDConeModule");
-    container[1] = new TGeoVolumeAssembly("ITSSPDCoolingModule");
-    
+
     TGeoXtru *shCable = new TGeoXtru(2);
     shCable->DefinePolygon(12, x, y);
-    shCable->DefineSection(0, 0., 0., 0., 1.0);
-    shCable->DefineSection(1, cableThickness, 0., 0., 1.0);
-    
+    shCable->DefineSection(0, 0.0);
+    shCable->DefineSection(1, kCableThickness);
+
     TGeoVolume *volCable = new TGeoVolume("ITSSPDExtender", shCable, medExt);
     volCable->SetLineColor(kGreen);
-    
-    TGeoVolume *volTube = gGeoManager->MakeTube("ITSSPDCoolingTubeCone", medInox, 5.*fgkmm, 6.*fgkmm, 0.5*(x[5] - x[0]));
-    volTube->SetLineColor(kGray);
-    
-    Double_t thickness = cableThickness + mcmThickness;
-    TGeoBBox *shOut = new TGeoBBox("ITSSPD_shape_plateout", 0.5*plateThickness, 0.5*plateLength, 0.5*plateWidth);
-    TGeoBBox *shIn = new TGeoBBox("ITSSPD_shape_platein", 0.5*thickness, 0.52*plateLength, 0.5*cableW2);
+
+    // The MCM extender on the cone as a Xtru
+    TGeoBBox *shMCMExt = new TGeoBBox(0.5*kMCMLength,
+                                     0.5*kMCMWidth,
+                                     0.5*kMCMThickness);
+
+    TGeoVolume *volMCMExt = new TGeoVolume("ITSSPDExtenderMCM",
+                                          shMCMExt, medExt);
+    volMCMExt->SetLineColor(kGreen+3);
+
+    // The support plate on the cone as a composite shape
+    Double_t thickness = kCableThickness + kMCMThickness;
+    TGeoBBox *shOut = new TGeoBBox("ITSSPD_shape_plateout",
+                                  0.5*kPlateLength,
+                                  0.5*kPlateWidth,
+                                  0.5*kPlateThickness);
+    TGeoBBox *shIn  = new TGeoBBox("ITSSPD_shape_platein" ,
+                                  0.5*kPlateLength,
+                                  0.5*cableW2,
+                                  0.5*thickness);
     Char_t string[255];
     sprintf(string, "%s-%s", shOut->GetName(), shIn->GetName());
-    TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape", string);
-    TGeoVolume *volPlate = new TGeoVolume("ITSSPDPlate", shPlate, medPlate);
+    TGeoCompositeShape *shPlate = new TGeoCompositeShape("ITSSPDPlate_shape",
+                                string);
+
+    TGeoVolume *volPlate = new TGeoVolume("ITSSPDPlate",
+                                         shPlate, medPlate);
     volPlate->SetLineColor(kRed);
-    
-    TGeoVolume *volMCMExt = gGeoManager->MakeBox("ITSSPDextenderMCM", medExt, 0.5*mcmThickness, 0.5*mcmLength, 0.5*mcmWidth);
-    volMCMExt->SetLineColor(kGreen+3);
-    
-    TGeoRotation *rot = new TGeoRotation(*gGeoIdentity);
-    rot->RotateX(90.0);
-    rot->RotateZ(90.0);
-    container[0]->AddNode(volCable, 0, rot);
-    
-    TGeoTranslation *combi = new TGeoTranslation(cableThickness + 0.5*mcmThickness, x[0] + 0.5*mcmLength, 0.0);
-    container[0]->AddNode(volMCMExt, 0, combi);
-    
-    TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
-    rot1->RotateX(87.5);
-    TGeoCombiTrans *tr = new TGeoCombiTrans(1.15, x[0] + 0.5*(x[5] - x[0]), -2.95, rot1);
-    container[1]->AddNode(volTube, 0, tr);
-    
-    TGeoTranslation *tr1 = new TGeoTranslation(0.5*plateThickness - 0.5*(plateThickness-thickness), x[3] - x[0] - 0.52*plateLength, 0.0);
-    container[0]->AddNode(volPlate, 0, tr1);
-    
-    TList* conemodulelist = new TList();
 
+    // The cooling tube on the cone as a Ctub
+    Double_t tubeLength = shCable->GetX(5) - shCable->GetX(0) + kYtoHalfStave;
+    TGeoCtub *shTube = new TGeoCtub(0, kConeTubeRmax, 0.5*tubeLength, 0, 360,
+                                   0, SinD(angrot/2), -CosD(angrot/2),
+                                   0,              0,              1);
+
+    TGeoVolume *volTubeA = new TGeoVolume("ITSSPDCoolingTubeOnConeA",
+                                         shTube, medInox);
+    volTubeA->SetLineColor(kGray);
+
+    TGeoVolume *volTubeC = new TGeoVolume("ITSSPDCoolingTubeOnConeC",
+                                         shTube, medInox);
+    volTubeC->SetLineColor(kGray);
+
+    // The freon in the cooling tubes on the cone as a Ctub
+    TGeoCtub *shFreon = new TGeoCtub(0, kConeTubeRmin, 0.5*tubeLength, 0, 360,
+                                    0, SinD(angrot/2), -CosD(angrot/2),
+                                    0,              0,              1);
+
+    TGeoVolume *volFreon = new TGeoVolume("ITSSPDCoolingFreonOnCone",
+                                         shFreon, medFreon);
+    volFreon->SetLineColor(kPurple);
+
+    TGeoVolume *volGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCone",
+                                         shFreon, medGas);
+    volGasFr->SetLineColor(kPurple);
+
+    // The cooling tube inside the cylinder as a Ctub
+    TGeoCtub *shCylTub = new TGeoCtub(0, kConeTubeRmax,
+                                     0.5*kHorizTubeLen, 0, 360,
+                                     0,            0,           -1,
+                                     0, SinD(angrot/2), CosD(angrot/2));
+
+    TGeoVolume *volCylTubA = new TGeoVolume("ITSSPDCoolingTubeOnCylA",
+                                           shCylTub, medInox);
+    volCylTubA->SetLineColor(kGray);
+
+    TGeoVolume *volCylTubC = new TGeoVolume("ITSSPDCoolingTubeOnCylC",
+                                           shCylTub, medInox);
+    volCylTubC->SetLineColor(kGray);
+
+    // The freon in the cooling tubes in the cylinder as a Ctub
+    TGeoCtub *shCylFr = new TGeoCtub(0, kConeTubeRmin,
+                                    0.5*kHorizTubeLen, 0, 360,
+                                    0,            0,           -1,
+                                    0, SinD(angrot/2), CosD(angrot/2));
+
+    TGeoVolume *volCylFr = new TGeoVolume("ITSSPDCoolingFreonOnCyl",
+                                         shCylFr, medFreon);
+    volCylFr->SetLineColor(kPurple);
+
+    TGeoVolume *volCylGasFr = new TGeoVolume("ITSSPDCoolingFreonGasOnCyl",
+                                            shCylFr, medGas);
+    volCylGasFr->SetLineColor(kPurple);
+
+    // Now place everything in the containers
+    volTubeA->AddNode(volGasFr, 1, 0);
+    volTubeC->AddNode(volFreon, 1, 0);
+
+    volCylTubA->AddNode(volCylGasFr, 1, 0);
+    volCylTubC->AddNode(volCylFr   , 1, 0);
+
+    container[0]->AddNode(volCable, 1, 0);
+
+    xloc = shMCMExt->GetDX();
+    zloc = shMCMExt->GetDZ();
+    container[0]->AddNode(volMCMExt, 1,
+                         new TGeoTranslation( xloc, 0.,-zloc));
+
+    xloc = shMCMExt->GetDX();
+    zloc = shCable->GetZ(1)/2 - shMCMExt->GetDZ();
+    container[0]->AddNode(volPlate, 1,
+                         new TGeoTranslation( xloc, 0., zloc));
+
+    xloc = shTube->GetRmax();
+    yloc = shTube->GetRmax();
+    zloc = shTube->GetDz() - shTube->GetRmax() - kYtoHalfStave;
+    container[1]->AddNode(volTubeA, 1,
+                         new TGeoTranslation(-xloc, -yloc, zloc));
+    container[2]->AddNode(volTubeC, 1,
+                         new TGeoTranslation(-xloc, -yloc, zloc));
+
+    xloc = shTube->GetRmax();
+    yloc = (shCylTub->GetDz())*SinD(angrot) - shTube->GetRmax();
+    zloc = (shCylTub->GetDz())*CosD(angrot) + shTube->GetRmax() +kYtoHalfStave;
+    container[1]->AddNode(volCylTubA, 1,
+                         new TGeoCombiTrans(-xloc, yloc,-zloc,
+                                    new TGeoRotation("",0.,angrot,0.)));
+    container[2]->AddNode(volCylTubC, 1,
+                         new TGeoCombiTrans(-xloc, yloc,-zloc,
+                                    new TGeoRotation("",0.,angrot,0.)));
+
+    // Finally create the list of assemblies and return it to the caller
+    TList* conemodulelist = new TList();
     conemodulelist->Add(container[0]);
     conemodulelist->Add(container[1]);
-    
+    conemodulelist->Add(container[2]);
+
     return conemodulelist;
 }
 
 //______________________________________________________________________
 void AliITSv11GeometrySPD::CreateCones(TGeoVolume *moth) const
 {
-    
-    TList* modulelist = CreateConeModule(gGeoManager);
+    //
+    // Places all services modules in the mother reference system
+    //
+    // Created:      ?? ??? 2008  Alberto Pulvirenti
+    // Updated:      03 May 2010  Mario Sitta
+    //
+
+    const Int_t kNumberOfModules    =  10;
+
+    const Double_t kInnerRadius     =  80.775*fgkmm;
+    const Double_t kZTrans          = 452.000*fgkmm;
+    const Double_t kAlphaRot        =  46.500*fgkDegree;
+    const Double_t kAlphaSpaceCool  =   8.500*fgkDegree;
+
+    TList* modulelist = CreateConeModule(90-kAlphaRot);
     TGeoVolumeAssembly* module;
+
+    Double_t xloc, yloc, zloc;
+
     //Double_t angle[10] = {18., 54., 90., 126., 162., -18., -54., -90., -126., -162.};
     // angleNm for cone modules (cables), angleNc for cooling tubes
-    Double_t angle1m[10] = {18., 54., 90., 129., 165., 201.0, 237.0, 273.0, 309.0, 345.0};
-    Double_t angle2m[10] = {18., 53., 90., 126., 162., 198.0, 233.0, 270.0, 309.0, 342.0};
-    Double_t angle1c[10] = {18., 54., 90., 124., 165., 201.0, 237.0, 273.0, 304.0, 345.0};
-    Double_t angle2c[10] = {18., 44., 90., 126., 162., 198.0, 223.0, 270.0, 309.0, 342.0};
+    Double_t anglem[10] = {18., 54., 90., 126., 162., 198., 234., 270., 306., 342.};
+//    Double_t angle1m[10] = {23., 53., 90., 127., 157., 203.0, 233.0, 270.0, 307.0, 337.0};
+//    Double_t angle2m[10] = {18., 53., 90., 126., 162., 198.0, 233.0, 270.0, 309.0, 342.0};
+//    Double_t angle1c[10] = {23., 53., 90., 124., 157., 203.0, 233.0, 270.0, 304.0, 337.0};
+//    Double_t angle2c[10] = {18., 44., 90., 126., 162., 198.0, 223.0, 270.0, 309.0, 342.0};
 
     // First add the cables
     module = (TGeoVolumeAssembly*)modulelist->At(0);
-    for (Int_t i = 0; i < 10; i++) {
+    for (Int_t i = 0; i < kNumberOfModules; i++) {
         TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
-        rot1->RotateY(-90.0);
-        rot1->RotateX(45.0);
-       angle1m[i] -= 1.5;
-        rot1->RotateZ(90.0 - angle1m[i]);
-        TGeoCombiTrans *tr1 = new TGeoCombiTrans(0.0, 0.0, 38.5, rot1);
-        moth->AddNode(module, 2*i, tr1);
+       rot1->RotateY(-kAlphaRot);
+       rot1->RotateZ(anglem[i]);
+        xloc = kInnerRadius*CosD(anglem[i]);
+        yloc = kInnerRadius*SinD(anglem[i]);
+       zloc = kZTrans;
+        moth->AddNode(module, 2*i,
+                     new TGeoCombiTrans( xloc, yloc, zloc, rot1));
+
         TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
-        rot2->RotateY(90.0);
-        rot2->RotateX(-45.0);
-       angle2m[i] -= 1.5;
-        rot2->RotateZ(90.0 - angle2m[i]);
-        TGeoCombiTrans *tr2 = new TGeoCombiTrans(0.0, 0.0, -38.4, rot2);
-        moth->AddNode(module, 2*i+1, tr2);
+       rot2->RotateY(180.-kAlphaRot);
+       rot2->RotateZ(anglem[i]);
+        xloc = kInnerRadius*CosD(anglem[i]);
+        yloc = kInnerRadius*SinD(anglem[i]);
+       zloc = kZTrans;
+        moth->AddNode(module, 2*i+1,
+                     new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
     }
 
-    // Then the cooling tubes
+    // Then the cooling tubes on Side A
     module = (TGeoVolumeAssembly*)modulelist->At(1);
-    for (Int_t i = 0; i < 10; i++) {
+    Double_t anglec;
+    for (Int_t i = 0; i < kNumberOfModules; i++) {
+        anglec = anglem[i] + kAlphaSpaceCool;
         TGeoRotation *rot1 = new TGeoRotation(*gGeoIdentity);
-        rot1->RotateY(-90.0);
-        rot1->RotateX(45.0);
-       angle1c[i] -= 1.5;
-        rot1->RotateZ(90.0 - angle1c[i]);
-        TGeoCombiTrans *tr1 = new TGeoCombiTrans(0.0, 0.0, 38.5, rot1);
-        moth->AddNode(module, 2*i, tr1);
+        rot1->RotateX(-90.0+kAlphaRot);
+       rot1->RotateZ(-90+anglec);
+        xloc = kInnerRadius*CosD(anglec);
+        yloc = kInnerRadius*SinD(anglec);
+       zloc = kZTrans;
+        moth->AddNode(module, 2*i, 
+                     new TGeoCombiTrans( xloc, yloc, zloc, rot1));
+    }
+
+    // Finally the cooling tubes on Side C
+    module = (TGeoVolumeAssembly*)modulelist->At(2);
+    for (Int_t i = 0; i < kNumberOfModules; i++) {
+        anglec = anglem[i] - kAlphaSpaceCool;
         TGeoRotation *rot2 = new TGeoRotation(*gGeoIdentity);
-        rot2->RotateY(90.0);
-        rot2->RotateX(-45.0);
-       angle2c[i] -= 1.5;
-        rot2->RotateZ(90.0 - angle2c[i]);
-        TGeoCombiTrans *tr2 = new TGeoCombiTrans(0.0, 0.0, -38.4, rot2);
-        moth->AddNode(module, 2*i+1, tr2);
+        rot2->RotateX(-90.0+kAlphaRot);
+       rot2->RotateY(180.);
+       rot2->RotateZ(90.+anglec);
+        xloc = kInnerRadius*CosD(anglec);
+        yloc = kInnerRadius*SinD(anglec);
+       zloc = kZTrans;
+        moth->AddNode(module, 2*i+1,
+                     new TGeoCombiTrans(-xloc,-yloc,-zloc, rot2));
     }
+
 }
 
 //______________________________________________________________________
@@ -3133,8 +3219,8 @@ TGeoVolume* AliITSv11GeometrySPD::CreateExtender(
     //
     // This function creates the following picture (in plane xOy)
     // Should be useful for the definition of the pixel bus and MCM extenders
-    // The origin corresponds to point 0 on the picture, at half-width 
-    // in Z direction 
+    // The origin corresponds to point 0 on the picture, at half-width
+    // in Z direction
     //
     //   Y                         7     6                      5
     //   ^                           +---+---------------------+
@@ -3161,21 +3247,21 @@ TGeoVolume* AliITSv11GeometrySPD::CreateExtender(
     //   |--> par 4 : outer length [3-4] / [6-5]
     //   |--> par 5 : width in local Z direction
     //
-    Double_t slopeDeltaX = (extenderParams[3] - extenderParams[1] 
-                            * TMath::Cos(extenderParams[2])) / 
+    Double_t slopeDeltaX = (extenderParams[3] - extenderParams[1]
+                            * TMath::Cos(extenderParams[2])) /
                             TMath::Tan(extenderParams[2]);
     Double_t extenderXtruX[10] = {
         0 ,
         extenderParams[0] ,
-        extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2]) , 
+        extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2]) ,
         extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
                                                               slopeDeltaX ,
         extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
-                                           slopeDeltaX + extenderParams[4], 
+                                           slopeDeltaX + extenderParams[4],
         extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
-                                           slopeDeltaX + extenderParams[4], 
+                                           slopeDeltaX + extenderParams[4],
         extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
-                                                              slopeDeltaX , 
+                                                              slopeDeltaX ,
         extenderParams[0]+extenderParams[1]*TMath::Sin(extenderParams[2])+
           slopeDeltaX - extenderParams[1] * TMath::Sin(extenderParams[2]) ,
         extenderParams[0] ,
@@ -3221,7 +3307,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     // Creates an assembly which contains the pixel bus and its extension
     // and the extension of the MCM.
     // By: Renaud Vernet
-    // NOTE: to be defined its material and its extension in the outside 
+    // NOTE: to be defined its material and its extension in the outside
     // direction
     //
     // ====   constants   =====
@@ -3269,10 +3355,10 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //        2*pixelBusThickness*TMath::Sin(pixelBusContactPhi)*
     //        TMath::Tan(pixelBusContactPhi);
     //   const Double_t pbExtenderDeltaZ      = pbExtenderTopZ-pbExtenderBaseZ;
-    //   const Double_t pbExtenderEndPointX   = 2*deltaZOrigin - 
+    //   const Double_t pbExtenderEndPointX   = 2*deltaZOrigin -
     //    groundingWidthX - 2*pixelBusThickness*TMath::Sin(pixelBusContactPhi);
     //   const Double_t pbExtenderXtru3L   = 1.5 * fgkmm; //arbitrary ?
-    //   const Double_t pbExtenderXtru4L   = (pbExtenderDeltaZ + 
+    //   const Double_t pbExtenderXtru4L   = (pbExtenderDeltaZ +
     //             pixelBusThickness*(TMath::Cos(extenderSlope)-2))/
     //                                      TMath::Sin(extenderSlope);
     //   const Double_t kMcmExtenderEndPointX  = deltaZOrigin - 48.2 * fgkmm;
@@ -3288,14 +3374,14 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
                                      kPbExtenderHeight,       //3
                                      kPbExtenderOuterLength,  //4
                                      kPbExtenderWidthY};      //5
-    
+
     Double_t mcmExtenderParams[6] = {kMcmExtenderInnerLength, //0
                                      kMcmExtenderThickness,   //1
                                      kMcmExtenderSlopeAngle,  //2
                                      kMcmExtenderHeight,      //3
                                      kMcmExtenderOuterLength, //4
                                      kMcmExtenderWidthY};     //5
-    
+
     TArrayD sizes(3);
     TGeoVolume* pbExtender  = CreateExtender(pbExtenderParams,medPBExtender,
                                              sizes);
@@ -3310,7 +3396,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //                     pixelBusContactPhi,    //2
     //                     pixelBusRaiseLength,   //3
     //                     pixelBusWidthY};      //4
-    
+
     //   Double_t pbExtenderValues[8]  = {pixelBusRaiseLength,   //0
     //                     pixelBusContactPhi,     //1
     //                     pbExtenderXtru3L,       //2
@@ -3319,7 +3405,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //                     pbExtenderXtru4L,      //5
     //                     pbExtenderEndPointX,   //6
     //                     kPbExtenderWidthY};    //7
-    
+
     //   Double_t mcmExtenderValues[6] = {mcmExtenderXtru3L,     //0
     //                     mcmExtenderThickness,  //1
     //                     extenderSlope,     //2
@@ -3327,7 +3413,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //                     mcmExtenderEndPointX,  //4
     //                     mcmExtenderWidthY};    //5
     //   TGeoVolumeAssembly *pixelBus=new TGeoVolumeAssembly("ITSSPDpixelBus");
-    //   CreatePixelBus(pixelBus,pixelBusValues,medPixelBus); 
+    //   CreatePixelBus(pixelBus,pixelBusValues,medPixelBus);
     //   TGeoVolumeAssembly *pbExtender = new TGeoVolumeAssembly(
     //                                              "ITSSPDpixelBusExtender");
     //   CreatePixelBusExtender(pbExtender,pbExtenderValues,medPBExtender);
@@ -3339,14 +3425,14 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //   commonRot->MultiplyBy(new TGeoRotation("rot",-90,0,0));
     //   TGeoTranslation * pixelBusTrans   = new TGeoTranslation(
     //                      pixelBusThickness/2. - deltaXOrigin + 0.52*fgkmm ,
-    //                                   -pixelBusWidthY/2.   + deltaYOrigin , 
+    //                                   -pixelBusWidthY/2.   + deltaYOrigin ,
     //                                   -groundingWidthX/2.  + deltaZOrigin);
     //   TGeoRotation    *pixelBusRot     = new TGeoRotation(*commonRot);
     //   TGeoTranslation *pbExtenderTrans =new TGeoTranslation(*pixelBusTrans);
     //   TGeoRotation    *pbExtenderRot   = new TGeoRotation(*pixelBusRot);
     //   pbExtenderTrans->SetDz(*(pbExtenderTrans->GetTranslation()+2) -
     //                          pixelBusWidthX/2. - 2*pixelBusThickness*
-    //                                    TMath::Sin(pixelBusContactPhi));  
+    //                                    TMath::Sin(pixelBusContactPhi));
     //   if (!zpos) {
     //     pbExtenderTrans->SetDy(*(pbExtenderTrans->GetTranslation()+1) -
     //                               (pixelBusWidthY - kPbExtenderWidthY)/2.);
@@ -3365,7 +3451,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //   TGeoRotation    * mcmExtenderRot   = new TGeoRotation(*pbExtenderRot);
     //   // add pt1000 components
     //   Double_t pt1000Z = fgkmm * 64400. * 1E-4;
-    //   //Double_t pt1000X[10] = {319700.,  459700.,  599700.,  739700., 
+    //   //Double_t pt1000X[10] = {319700.,  459700.,  599700.,  739700.,
     //                             879700., 1029700., 1169700., 1309700.,
     //                            1449700., 1589700.};
     //   Double_t pt1000X[10] ={66160., 206200.,  346200.,  486200.,  626200.,
@@ -3385,7 +3471,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     //                                            pt1000Z -0.5*pixelBusWidthY);
     //     pixelBus->AddNode(pt1000, i+1, tr);
     //   }
-    
+
     //CREATE FINAL VOLUME ASSEMBLY AND ROTATE IT
     TGeoVolumeAssembly *assembly = new TGeoVolumeAssembly("ITSSPDextenders");
     //   assembly->AddNode((TGeoVolume*)pixelBus,1,
@@ -3398,7 +3484,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreatePixelBusAndExtensions
     assembly->AddNode(pbExtender,1);
     assembly->AddNode(mcmExtender,1);
     //   assembly->SetTransparency(50);
-    
+
     return assembly;
 }
 //______________________________________________________________________
@@ -3406,10 +3492,10 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateHalfStave(Bool_t isRight,
 Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
 {
     //
-    // Implementation of an half-stave, which depends on the side where 
-    // we are on the stave. The convention for "left" and "right" is the 
-    // same as for the MCM. The return value is a TGeoAssembly which is 
-    // structured in such a way that the origin of its local reference 
+    // Implementation of an half-stave, which depends on the side where
+    // we are on the stave. The convention for "left" and "right" is the
+    // same as for the MCM. The return value is a TGeoAssembly which is
+    // structured in such a way that the origin of its local reference
     // frame coincides with the origin of the whole stave.
     // The TArrayD passed by reference will contain details of the shape:
     //  - sizes[0] = thickness
@@ -3435,11 +3521,11 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
 
     // define the separations along Z direction between the objects
     Double_t sepLadderLadder = fgkmm * 0.2; // sep. btw the 2 ladders
-    Double_t sepLadderCenter = fgkmm * 0.4; // sep. btw the "central" ladder 
+    Double_t sepLadderCenter = fgkmm * 0.4; // sep. btw the "central" ladder
                                             // and the Z=0 plane in stave ref.
     Double_t sepLadderMCM    = fgkmm * 0.3; // sep. btw the "external" ladder
                                             // and MCM
-    Double_t sepBusCenter    = fgkmm * 0.3; // sep. btw the bus central edge 
+    Double_t sepBusCenter    = fgkmm * 0.3; // sep. btw the bus central edge
                                             // and the Z=0 plane in stave ref.
 
     // ** VOLUMES **
@@ -3464,7 +3550,7 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
     Double_t mcmThickness = mcmSize[0];
     Double_t mcmLength = mcmSize[1];
     Double_t mcmWidth = mcmSize[2];
-    
+
     // bus
     TArrayD busSize(6);
     TGeoVolumeAssembly *bus = CreatePixelBus(isRight, layer, busSize, mgr);
@@ -3484,7 +3570,7 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
     Double_t &fullThickness = sizes[0];
     Double_t &fullLength = sizes[1];
     Double_t &fullWidth = sizes[2];
-    
+
     // compute the full size of the container
     fullLength    = sepLadderCenter+2.0*ladderLength+sepLadderMCM+
                        sepLadderLadder+mcmLength;
@@ -3501,13 +3587,13 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
     TGeoTranslation *grndTrans = new TGeoTranslation(xGrnd, 0.0, zGrnd);
 
     // ladders (translations along thickness and length)
-    // layers must be sorted going from the one at largest Z to the 
+    // layers must be sorted going from the one at largest Z to the
     // one at smallest Z:
     // -|Zmax| ------> |Zmax|
     //      3   2   1   0
-    // then, for layer 1 ladders they must be placed exactly this way, 
-    // and in layer 2 at the opposite. In order to remember the placements, 
-    // we define as "inner" and "outer" ladder respectively the one close 
+    // then, for layer 1 ladders they must be placed exactly this way,
+    // and in layer 2 at the opposite. In order to remember the placements,
+    // we define as "inner" and "outer" ladder respectively the one close
     // to barrel center, and the one closer to MCM, respectively.
     Double_t xLad, zLadIn, zLadOut;
     xLad    = xGrnd + 0.5*(grndThickness + ladderThickness) +
@@ -3530,15 +3616,15 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
     TGeoCombiTrans *trLadOut = new TGeoCombiTrans(xLad,ladderShift,zLadOut,
                                                   rotLad);
 
-    // MCM (length and thickness direction, placing at same level as the 
-    // ladder, which implies to recompute the position of center, because 
-    // ladder and MCM have NOT the same thickness) the two copies of the 
+    // MCM (length and thickness direction, placing at same level as the
+    // ladder, which implies to recompute the position of center, because
+    // ladder and MCM have NOT the same thickness) the two copies of the
     // MCM are placed at the same distance from the center, on both sides
-    Double_t xMCM = xGrnd + 0.5*grndThickness + 0.5*mcmThickness + 
+    Double_t xMCM = xGrnd + 0.5*grndThickness + 0.5*mcmThickness +
                     0.01175 - fgkGapLadder;
     Double_t yMCM = 0.5*(fullWidth - mcmWidth);
     Double_t zMCM = zLadOut - 0.5*ladderLength - 0.5*mcmLength - sepLadderMCM;
-    if (!isRight) zMCM = zLadOut + 0.5*ladderLength + 0.5*mcmLength + 
+    if (!isRight) zMCM = zLadOut + 0.5*ladderLength + 0.5*mcmLength +
                          sepLadderMCM;
 
     // create the correction rotations
@@ -3547,7 +3633,7 @@ Int_t layer,Int_t idxCentral,Int_t idxSide,TArrayD &sizes,TGeoManager *mgr)
     TGeoCombiTrans *trMCM = new TGeoCombiTrans(xMCM, yMCM, zMCM, rotMCM);
 
     // glue between ladders and pixel bus
-    Double_t xLadGlue = xLad + 0.5*ladderThickness + 0.01175 - 
+    Double_t xLadGlue = xLad + 0.5*ladderThickness + 0.01175 -
                         fgkGapLadder + 0.5*ladGlueThickness;
 
     // bus (length and thickness direction)
@@ -3605,18 +3691,18 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
     // when put on the sector.
     // This assembly contains, going from bottom to top in the thickness
     // direction:
-    //   - the complete grounding foil, defined by the "CreateGroundingFoil" 
-    //     method which already joins some glue and real groudning foil 
+    //   - the complete grounding foil, defined by the "CreateGroundingFoil"
+    //     method which already joins some glue and real groudning foil
     //     layers for the whole stave (left + right);
-    //   - 4 ladders, which are sorted according to the ALICE numbering 
+    //   - 4 ladders, which are sorted according to the ALICE numbering
     //     scheme, which depends on the layer we are building this stave for;
     //   - 2 MCMs (a left and a right one);
     //   - 2 pixel buses (a left and a right one);
     // ---
     // Arguments:
-    //   - the layer number, which determines the displacement and naming 
+    //   - the layer number, which determines the displacement and naming
     //     of sensitive volumes
-    //   - a TArrayD passed by reference which will contain the size 
+    //   - a TArrayD passed by reference which will contain the size
     //     of virtual box containing the stave
     //   - the TGeoManager
     //
@@ -3625,13 +3711,13 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
     TGeoVolumeAssembly *container = new TGeoVolumeAssembly(Form(
                                                  "ITSSPDlay%d-Stave",layer));
     // define the indexes of the ladders in order to have the correct order
-    // keeping in mind that the staves will be inserted as they are on layer 
-    // 2, while they are rotated around their local Y axis when inserted 
-    // on layer 1, so in this case they must be put in the "wrong" order 
-    // to turn out to be right at the end. The convention is:    
+    // keeping in mind that the staves will be inserted as they are on layer
+    // 2, while they are rotated around their local Y axis when inserted
+    // on layer 1, so in this case they must be put in the "wrong" order
+    // to turn out to be right at the end. The convention is:
     //   -|Zmax| ------> |Zmax|
     //      3   2   1   0
-    // with respect to the "native" stave reference frame, "left" is in 
+    // with respect to the "native" stave reference frame, "left" is in
     // the positive Z this leads the definition of these indexes:
     Int_t idxCentralL, idxSideL, idxCentralR, idxSideR;
 
@@ -3646,7 +3732,7 @@ TGeoVolumeAssembly* AliITSv11GeometrySPD::CreateStave(Int_t layer,
         idxCentralR = 2;
         idxSideR = 3;
     } // end if layer ==1
-    
+
      // create the two half-staves
     TArrayD sizeL, sizeR;
     TGeoVolumeAssembly *hstaveL = CreateHalfStave(kFALSE, layer, idxCentralL,
@@ -3676,9 +3762,9 @@ void AliITSv11GeometrySPD::SetAddStave(Bool_t *mask)
 {
     //
     // Define a mask which states qhich staves must be placed.
-    // It is a string which must contain '0' or '1' depending if 
+    // It is a string which must contain '0' or '1' depending if
     // a stave must be placed or not.
-    // Each place is referred to one of the staves, so the first 
+    // Each place is referred to one of the staves, so the first
     // six characters of the string will be checked.
     //
      Int_t i;
@@ -3699,7 +3785,7 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
     // but it inserts in the mother volume (argument 'moth') all the stuff
     // which composes the complete SPD sector.
     // ---
-    // In the following, the stave numbering order used for arrays is the 
+    // In the following, the stave numbering order used for arrays is the
     // same as defined in the GetSectorMountingPoints():
     //                         /5
     //                        /\/4
@@ -3709,9 +3795,9 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
     // Arguments: see description of "CarbonFiberSector" method.
     //
 
-    Double_t shift[6];  // shift from the innermost position in the 
-                        // sector placement plane (where the stave 
-                        // edge is in the point where the rounded 
+    Double_t shift[6];  // shift from the innermost position in the
+                        // sector placement plane (where the stave
+                        // edge is in the point where the rounded
                         // corner begins)
 
     shift[0] = fgkmm * -0.691;
@@ -3720,37 +3806,37 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
     shift[3] = fgkmm * -0.610;
     shift[4] = fgkmm * -0.610;
     shift[5] = fgkmm * -0.610;
-    
+
     // corrections after interaction with Andrea and CAD
     Double_t corrX[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
     Double_t corrY[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-    
+
     corrX[0] =  0.0046;
     corrX[1] = -0.0041;
     corrX[2] = corrX[3] = corrX[4] = corrX[5] = -0.0016;
-    
+
     corrY[0] = -0.0007;
     corrY[1] = -0.0009;
     corrY[2] = corrY[3] = corrY[4] = corrY[5] = -0.0003;
-    
+
     corrX[0] +=  0.00026;
     corrY[0] += -0.00080;
-    
+
     corrX[1] +=  0.00018;
     corrY[1] += -0.00086;
-    
+
     corrX[2] +=  0.00020;
     corrY[2] += -0.00062;
-    
+
     corrX[3] +=  0.00017;
     corrY[3] += -0.00076;
-    
+
     corrX[4] +=  0.00016;
     corrY[4] += -0.00096;
-    
+
     corrX[5] +=  0.00018;
     corrY[5] += -0.00107;
-    
+
     // create stave volumes (different for layer 1 and 2)
     TArrayD staveSizes1(9), staveSizes2(9), clipSize(5);
     Double_t &staveHeight = staveSizes1[2], &staveThickness = staveSizes1[0];
@@ -3764,13 +3850,13 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
     Double_t dx, dy;      // (xL - xR) and (yL - yR)
     Double_t widthLR;     // width of the segment L-R
     Double_t angle;       // stave rotation angle in degrees
-    Double_t diffWidth;   // difference between mounting plane width and 
+    Double_t diffWidth;   // difference between mounting plane width and
                           // stave width (smaller)
     Double_t xPos, yPos;  // final translation of the stave
     Double_t parMovement; // translation in the LR plane direction
-    
+
     staveThickness += fgkGapHalfStave;
-    
+
     // loop on staves
     Int_t i, iclip = 1;
     for (i = 0; i < 6; i++) {
@@ -3789,20 +3875,20 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
         // by an amount equal to the width difference
         // and then the fixed shift must also be added
         parMovement = diffWidth + shift[i];
-        // due to stave thickness, another movement must be done 
+        // due to stave thickness, another movement must be done
         // in the direction normal to the mounting plane
-        // which is computed using an internal method, in a reference 
-        // frame where the LR segment has its middle point in the origin 
+        // which is computed using an internal method, in a reference
+        // frame where the LR segment has its middle point in the origin
         // and axes parallel to the master reference frame
         if (i == 0) {
-            ParallelPosition(-0.5*staveThickness, -parMovement, angle, 
+            ParallelPosition(-0.5*staveThickness, -parMovement, angle,
                                   xPos, yPos);
         } // end if i==0
         if (i == 1) {
-            ParallelPosition( 0.5*staveThickness, -parMovement, angle, 
+            ParallelPosition( 0.5*staveThickness, -parMovement, angle,
                                   xPos, yPos);
         }else {
-            ParallelPosition( 0.5*staveThickness,  parMovement, angle, 
+            ParallelPosition( 0.5*staveThickness,  parMovement, angle,
                                   xPos, yPos);
         } // end if i==1
         // then we go into the true reference frame
@@ -3810,7 +3896,7 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
         yPos += yM;
         xPos += corrX[i];
         yPos += corrY[i];
-        // using the parameters found here, compute the 
+        // using the parameters found here, compute the
         // translation and rotation of this stave:
         TGeoRotation *rot = new TGeoRotation(*gGeoIdentity);
         if (i == 0 || i == 1) rot->RotateX(180.0);
@@ -3830,7 +3916,7 @@ void AliITSv11GeometrySPD::StavesInSector(TGeoVolume *moth, TGeoManager *mgr)
                 rotClip->RotateX(180.0);
                 Double_t x = staveSizes2[3] + fgkGapHalfStave;
                 Double_t y = staveSizes2[4];
-                Double_t z[4] = { staveSizes2[5], staveSizes2[6], 
+                Double_t z[4] = { staveSizes2[5], staveSizes2[6],
                                   staveSizes2[7], staveSizes2[8] };
                 for (j = 0; j < 4; j++) {
                     TGeoCombiTrans *trClip = new TGeoCombiTrans(x, y, z[j],
@@ -3848,16 +3934,16 @@ void AliITSv11GeometrySPD::ParallelPosition(Double_t dist1, Double_t dist2,
 {
     //
     // Performs the following steps:
-    // 1 - finds a straight line parallel to the one passing through 
+    // 1 - finds a straight line parallel to the one passing through
     //     the origin and with angle 'phi' with X axis(phi in RADIANS);
-    // 2 - finds another line parallel to the previous one, with a 
+    // 2 - finds another line parallel to the previous one, with a
     //     distance 'dist1' from it
-    // 3 - takes a reference point in the second line in the intersection 
+    // 3 - takes a reference point in the second line in the intersection
     //     between the normal to both lines  passing through the origin
-    // 4 - finds a point whith has distance 'dist2' from this reference, 
+    // 4 - finds a point whith has distance 'dist2' from this reference,
     //     in the second line (point 2)
     // ----
-    // According to the signs given to dist1 and dist2, the point is 
+    // According to the signs given to dist1 and dist2, the point is
     // found in different position w.r. to the origin
     // compute the point
     //
@@ -4046,9 +4132,9 @@ void AliITSv11GeometrySPD::PrintAscii(ostream *os) const
     for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorX1.GetAt(i) << " ";
     for(i=0;i<fSPDsectorX1.GetSize();i++) *os<< fSPDsectorY1.GetAt(i) << " ";
     *os<<10<<" "<< 2 <<" " << 6 << " "<< 3 <<" ";
-    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++) 
+    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
         *os<<fTubeEndSector[k][0][i][j]<<" ";
-    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++) 
+    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
         *os<<fTubeEndSector[k][1][i][j]<<" ";
     os->flags(fmt); // reset back to old Formating.
     return;
@@ -4090,9 +4176,9 @@ void AliITSv11GeometrySPD::ReadAscii(istream* is)
                 "found [%d][%d][%d]",i,j,n);
         return;
     } // end if
-    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++) 
+    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
         *is>>fTubeEndSector[k][0][i][j];
-    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++) 
+    for(k=0;k<10;k++)for(i=0;i<6;i++)for(j=0;j<3;j++)
         *is>>fTubeEndSector[k][1][i][j];
     return;
 }
@@ -4167,7 +4253,7 @@ Bool_t AliITSv11GeometrySPD::Make2DCrossSections(TPolyLine &a0,TPolyLine &a1,
     a0S = dynamic_cast<TGeoXtru*>(a0V->GetShape());
     n0 = a0S->GetNvert();
     a0.SetPolyLine(n0+1);
-    //for(i=0;i<fSPDsectorPoints0.GetSize();i++) 
+    //for(i=0;i<fSPDsectorPoints0.GetSize();i++)
     //  printf("%d %d %d\n",i,fSPDsectorPoints0[i],fSPDsectorPoints1[i]);
     for(i=0;i<n0;i++){
         x = a0S->GetX(i);