]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv11GeometrySSD.cxx
Fixes for Coverity warnings - removing one unused class
[u/mrichter/AliRoot.git] / ITS / AliITSv11GeometrySSD.cxx
index 50c3904ef02aa4a00fd7704ce448b11e3c83fc57..03e07f32a4b7985f1f73d07b40baaf6a8249a6ee 100644 (file)
@@ -38,7 +38,7 @@
 #include "TGeoPcon.h"
 #include "TRotation.h"
 #include "AliITSv11GeometrySSD.h"
-#include "Riostream.h"
+
 /////////////////////////////////////////////////////////////////////////////////
 // Names of the Sensitive Volumes of Layer 5 and Layer 6
 /////////////////////////////////////////////////////////////////////////////////
@@ -88,26 +88,26 @@ const Double_t AliITSv11GeometrySSD::fgkSSDChipGlueHeight        =   0.030*fgkmm
 /////////////////////////////////////////////////////////////////////////////////
 const Double_t AliITSv11GeometrySSD::fgkSSDStiffenerLength       =  73.000*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDStiffenerWidth        =   6.500*fgkmm;
-//const Double_t AliITSv11GeometrySSD::fgkSSDStiffenerHeight       =   3.315;
-const Double_t AliITSv11GeometrySSD::fgkSSDStiffenerHeight       =   0.315*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkSSDStiffenerHeight       =   0.295*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDStiffenerToChipDist   =   2.500*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor0603CapLength  =  0.900*fgkmm;  // Includes solder
 const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor0603Length   = 1.600*fgkmm; 
 const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor0603Width    =   0.870*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor0603Height   =   0.800*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor1812CapLength  =  0.215*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor1812Length   =   4.600*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor1812Width    =   3.400*fgkmm;
-const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor1812Height   =   0.700*fgkmm; // multiplied by 0.5  
+const Double_t AliITSv11GeometrySSD::fgkSSDCapacitor1812Height   =   1.400*fgkmm;   
 const Double_t AliITSv11GeometrySSD::fgkSSDWireLength            =  30.000*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDWireRadius            =   0.185*fgkmm;
-const Double_t AliITSv11GeometrySSD::fgkSSDConnectorPosition[2]  = 
-                                                                                                          {44.32*fgkmm, 0.33*fgkmm};
+const Double_t AliITSv11GeometrySSD::fgkSSDConnectorPosition[2]  = {44.32*fgkmm, 0.33*fgkmm};
 const Double_t AliITSv11GeometrySSD::fgkSSDConnectorSeparation   =       0.44*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDConnectorLength       =       2.16*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDConnectorWidth        =       3.60*fgkmm;
-const Double_t AliITSv11GeometrySSD::fgkSSDConnectorHeight       = 
-                                                                                                         0.25*fgkSSDStiffenerHeight;
+const Double_t AliITSv11GeometrySSD::fgkSSDConnectorHeight       =   0.25*fgkSSDStiffenerHeight;
 const Double_t AliITSv11GeometrySSD::fgkSSDConnectorAlHeight     =      0.030*fgkmm;
 const Double_t AliITSv11GeometrySSD::fgkSSDConnectorNiHeight     =   0.002*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkSSDConnectorSnHeight     =   0.15*fgkmm;
 /////////////////////////////////////////////////////////////////////////////////
 // Cooling Block (lengths are in mm and angles in degrees)
 /////////////////////////////////////////////////////////////////////////////////
@@ -116,7 +116,7 @@ const Double_t AliITSv11GeometrySSD::fgkSSDCoolingBlockWidth     =   4.000*fgkmm
 const Double_t AliITSv11GeometrySSD::fgkSSDCoolingBlockHeight[3] =  
                                                                                 {1.950*fgkmm, 0.240*fgkmm, 0.300*fgkmm};
 const Double_t AliITSv11GeometrySSD::fgkSSDCoolingBlockHoleRadius[2] = 
-                                                                                                         {1.000*fgkmm, 0.120*fgkmm};
+  {1.025*fgkmm, 0.120*fgkmm};  // Added 50 micron tolerance for thicker wall cooling pipe (March 2010)
 const Double_t AliITSv11GeometrySSD::fgkSSDCoolingBlockHoleLength[2] = 
                                                                                                          {1.900*fgkmm, 0.400*fgkmm};
 const Double_t AliITSv11GeometrySSD::fgkSSDCoolingBlockHoleCenter    =  
@@ -160,6 +160,7 @@ const Double_t AliITSv11GeometrySSD:: fgkSSDEndFlexCompWidth[3] =
 // SSD Ladder Cable (lengths are in mm and angles in degrees)
 /////////////////////////////////////////////////////////////////////////////////
 const Double_t AliITSv11GeometrySSD::fgkSSDLadderCableWidth     =     23.5*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkSSDLadderCableHeight[2] = {  0.030*fgkmm*17.5/23.5,  1.25 * 0.030*fgkmm};   // Al covers ~ 17.5/23.5 of surface, Kapton includes glue+foam   
 /////////////////////////////////////////////////////////////////////////////////
 // SSD Module (lengths are in mm and angles in degrees)
 /////////////////////////////////////////////////////////////////////////////////
@@ -317,7 +318,7 @@ const Double_t AliITSv11GeometrySSD::fgkCoolingTubeSupportToCarbonFiber =
 // Cooling Tube (lengths are in mm and angles in degrees)
 /////////////////////////////////////////////////////////////////////////////////
 const Double_t AliITSv11GeometrySSD::fgkCoolingTubeRmax = fgkCoolingTubeSupportRmin;
-const Double_t AliITSv11GeometrySSD::fgkCoolingTubeRmin =  0.96*fgkmm;
+const Double_t AliITSv11GeometrySSD::fgkCoolingTubeRmin =  1.915*fgkmm/2; // Nominal + 50 micron tolerance; real pipes are closer to 450 micron wall thickness
 const Double_t AliITSv11GeometrySSD::fgkCoolingTubeLength = 
                                                                                                        fgkCarbonFiberJunctionWidth;
 const Double_t AliITSv11GeometrySSD::fgkCoolingTubeSeparation = 
@@ -552,6 +553,7 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD():
   fSSDStiffenerConnectorMedium(),
   fSSDStiffener0603CapacitorMedium(),
   fSSDStiffener1812CapacitorMedium(),
+  fSSDStiffenerCapacitorCapMedium(),
   fSSDStiffenerHybridWireMedium(),
   fSSDKaptonFlexMedium(),
   fSSDAlTraceFlexMedium(),
@@ -571,6 +573,7 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD():
   fSSDRohaCellCone(),
   fSSDAir(),
   fSSDCopper(),
+  fSSDSn(),
   fCreateMaterials(kFALSE),
   fTransformationMatrices(kFALSE),
   fBasicObjects(kFALSE),
@@ -599,6 +602,7 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD():
   fColorPhynox(14),
   fColorSilicon(3),
   fColorAl(38),
+  fColorNiSn(40),
   fColorKapton(6),
   fColorPolyhamide(5),
   fColorStiffener(9),
@@ -609,6 +613,73 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD():
   ////////////////////////
   // Standard constructor
   ////////////////////////
+
+  for (Int_t i=0; i < fgkcarbonfibersupportnumber; i++) {
+    fcarbonfibersupport[i] = 0;
+    fcarbonfibersupportmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkcarbonfiberjunctionumber; i++) {
+    fcarbonfiberjunctionmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkcarbonfiberlowersupportnumber; i++) {
+    fcarbonfiberlowersupport[i] = 0;
+    fcarbonfiberlowersupportrans[0] = 0;
+  }
+  for (Int_t i=0; i < fgkvolumekind; i++) {
+    fssdsensorsupport[i] = 0;
+  }
+  for (Int_t i=0; i < fgkssdsensorsupportnumber; i++) {
+    fssdsensorsupportmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkcoolingtubesupportnumber; i++) {
+    fcoolingtubesupportmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkhybridcompnumber; i++) {
+    fssdhybridcomponent[i] = 0;
+  }
+  for (Int_t i=0; i < fgkcoolingblocknumber; i++) {
+    fcoolingblockmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkflexnumber; i++) {
+    fstiffenerflexmatrix[i] = 0;
+    fendflexmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkendladdercoolingtubenumber; i++) {
+    fendladdercoolingtube[i] = 0;
+    for (Int_t j = 0; j < 2; j++) 
+      fendladdercoolingtubematrix[i][j] = 0;
+  }
+  for (Int_t i=0; i < fgkendlabbercarbonfiberjunctionumber; i++) {
+    fendladdercarbonfiberjunction[i] = 0;
+  }
+  for (Int_t i=0; i < fgkendladdercabonfiberjunctionmatrixnumber; i++) {
+    fendladdercarbonfiberjunctionmatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkendladdercarbonfibermatrixnumber; i++) {
+    fendladdercarbonfibermatrix[i] = 0;
+  }
+  for (Int_t i=0; i < fgkendladdermountingblocknumber; i++) {
+    fendladdermountingblockclipmatrix[i] = 0;
+  }
+  for (Int_t i = 0; i < fgkendladderlowersuppnumber+1; i++) {
+    fendladderlowersupptrans[i] = 0;
+  }
+  for (Int_t i = 0; i < fgkladdercablesnumber; i++) {
+    fladdercablematrix[i] = 0;
+  }
+  for (Int_t i = 0; i < fgkladdersegmentnumber; i++) {
+    fladdersegment[i] = 0;
+  }
+  for (Int_t i = 0; i < fgkladdernumber; i++) {
+    fladder[i] = 0;
+    fladdermatrix[i] = 0;
+    fssdsensormatrix[i] = 0;
+    flayermatrix[i] = 0;
+  }
+  for (Int_t i = 0; i < 2; i++) {
+    fLay5LadderSupport[i] = 0;
+    fLay6LadderSupport[i] = 0;
+  }
 }
 /////////////////////////////////////////////////////////////////////////////////
 AliITSv11GeometrySSD::AliITSv11GeometrySSD(const AliITSv11GeometrySSD &s):
@@ -619,6 +690,7 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD(const AliITSv11GeometrySSD &s):
   fSSDStiffenerConnectorMedium(s.fSSDStiffenerConnectorMedium),
   fSSDStiffener0603CapacitorMedium(s.fSSDStiffener0603CapacitorMedium),
   fSSDStiffener1812CapacitorMedium(s.fSSDStiffener1812CapacitorMedium),
+  fSSDStiffenerCapacitorCapMedium(s.fSSDStiffenerCapacitorCapMedium),
   fSSDStiffenerHybridWireMedium(s.fSSDStiffenerHybridWireMedium),
   fSSDKaptonFlexMedium(s.fSSDKaptonFlexMedium),
   fSSDAlTraceFlexMedium(s.fSSDAlTraceFlexMedium),
@@ -637,7 +709,8 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD(const AliITSv11GeometrySSD &s):
   fSSDMountingBlockMedium(s.fSSDMountingBlockMedium),
   fSSDRohaCellCone(s.fSSDRohaCellCone),
   fSSDAir(s.fSSDAir),
-  fSSDCopper(s.fSSDCopper),
+  fSSDCopper(s.fSSDCopper),  
+  fSSDSn(s.fSSDSn),
   fCreateMaterials(s.fCreateMaterials),
   fTransformationMatrices(s.fTransformationMatrices),
   fBasicObjects(s.fBasicObjects),
@@ -666,6 +739,7 @@ AliITSv11GeometrySSD::AliITSv11GeometrySSD(const AliITSv11GeometrySSD &s):
   fColorPhynox(s.fColorPhynox),
   fColorSilicon(s.fColorSilicon),
   fColorAl(s.fColorAl),
+  fColorNiSn(s.fColorNiSn),
   fColorKapton(s.fColorKapton),
   fColorPolyhamide(s.fColorPolyhamide),
   fColorStiffener(s.fColorStiffener),
@@ -1006,14 +1080,14 @@ void AliITSv11GeometrySSD::CreateTransformationMatrices(){
   localcoolingtubevect[1] = new TVector3( -localcoolingtubevect[0]->X()+fgkCarbonFiberTriangleLength,
                                              localcoolingtubevect[0]->Y(),
                                              localcoolingtubevect[0]->Z());
-       for(Int_t j=0; j<2; j++){
-               localcoolingtubetrans[j] = 
-                       new TGeoTranslation(localcoolingtubevect[j]->X(),
-                                                               localcoolingtubevect[j]->Y(),
-                                                               localcoolingtubevect[j]->Z());
-               fcoolingtubematrix[j] = new TGeoHMatrix((*localcoolingtubetrans[j])
-                                                         *                                     (*localcoolingtuberot));
-       }
+  for(Int_t j=0; j<2; j++){
+    localcoolingtubetrans[j] = 
+       new TGeoTranslation(localcoolingtubevect[j]->X(),
+                           localcoolingtubevect[j]->Y(),
+                           localcoolingtubevect[j]->Z());
+     fcoolingtubematrix[j] = new TGeoHMatrix((*localcoolingtubetrans[j])
+                                            *(*localcoolingtuberot));
+  }
   /////////////////////////////////////////////////////////////
   // SSD End Ladder Cooling Tube Transformations
   /////////////////////////////////////////////////////////////
@@ -1081,19 +1155,12 @@ void AliITSv11GeometrySSD::CreateTransformationMatrices(){
   /////////////////////////////////////////////////////////////
   // SSD Cooling Block Transformations
   /////////////////////////////////////////////////////////////
-  const Int_t kcoolingblockmatrixnumber = 4;    
-  TGeoTranslation* localcoolingblocktrans[kcoolingblockmatrixnumber];
-  localcoolingblocktrans[0] = new TGeoTranslation(-2.*(fgkCoolingTubeSupportRmax
-                            -  fgkCoolingTubeSupportRmin),0.0,
-                               0.5*(fgkSSDCoolingBlockHoleCenter+fgkCoolingTubeRmax));
-  localcoolingblocktrans[1] = new TGeoTranslation(0.5*fgkSSDStiffenerLength
-                            -  0.5*fgkSSDModuleSensorSupportDistance-fgkSSDCoolingBlockLength,
-                               0.0,fgkSSDStiffenerHeight);
-  localcoolingblocktrans[2] = new TGeoTranslation(*localhybridtrans[1]);
-  localcoolingblocktrans[3] = new TGeoTranslation(*localhybridtrans[2]);
-  fcoolingblocksystematrix = new TGeoHMatrix();
-  for(Int_t i=0; i<kcoolingblockmatrixnumber; i++)
-      fcoolingblocksystematrix->MultiplyLeft(localcoolingblocktrans[i]);
+  TGeoTranslation localcoolingblocktrans (fcoolingtubematrix[0]->GetTranslation()[0] 
+                                         - 0.5*fgkSSDCoolingBlockLength,
+                                         fhybridmatrix->GetTranslation()[1]-0.5*fgkSSDStiffenerWidth,
+                                         fhybridmatrix->GetTranslation()[2]+0.5*fgkSSDStiffenerHeight+
+                                         0.5*(fgkSSDCoolingBlockHoleCenter+fgkCoolingTubeRmax));
+  fcoolingblocksystematrix = new TGeoHMatrix(localcoolingblocktrans);
   /////////////////////////////////////////////////////////////
   // SSD Stiffener Flex Transformations
   /////////////////////////////////////////////////////////////
@@ -1426,8 +1493,9 @@ void AliITSv11GeometrySSD::CreateTransformationMatrices(){
                                        beamaxistrans[i][2]*fgkCarbonFiberJunctionWidth,0.);
   }
   for(Int_t i=0; i<fgkladdercablesnumber; i++)
-       for(Int_t j=0; j<klocalladdercombitransnumber-1; j++)
-               fladdercablematrix[i][j]->MultiplyLeft(ladderglobalmatrix[1][i]);
+    for(Int_t j=0; j<klocalladdercombitransnumber-1; j++) 
+      fladdercablematrix[i][j]->MultiplyLeft(ladderglobalmatrix[1][i]);
+  
   ///////////////////////////////////////////
   // Setting Ladder HMatrix
   ///////////////////////////////////////////
@@ -1603,7 +1671,6 @@ void AliITSv11GeometrySSD::CreateTransformationMatrices(){
   }
  delete endladdermountingblockrot;
  for(Int_t i=0; i<khybridmatrixnumber; i++) delete localhybridtrans[i];
- for(Int_t i=0; i<kcoolingblockmatrixnumber; i++) delete localcoolingblocktrans[i];
  for(Int_t i=0; i<fgkflexnumber; i++){
       for(Int_t j=1; j<klocalflexmatrixnumber; j++) 
             delete localflexmatrix[i][j];
@@ -2249,62 +2316,47 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
   // Mother Volumes Containers 
   /////////////////////////////////////////////////////////////
   const Int_t kmothernumber = 2;
-  const Int_t kmothervertexnumber = 12;
+  const Int_t kmothervertexnumber = 8;
   Double_t xmothervertex[kmothernumber][kmothervertexnumber]; 
   Double_t ymothervertex[kmothernumber][kmothervertexnumber]; 
-  ///////////////////////
-  // Setting the vertices 
-  ///////////////////////
-  xmothervertex[0][0]  = -0.5*fgkSSDStiffenerLength;
-  xmothervertex[0][1]  = xmothervertex[0][0]; 
-  xmothervertex[0][2]  = fgkSSDFlexLength[0]-0.5*fgkSSDStiffenerLength;
-  xmothervertex[0][3]  = xmothervertex[0][2];
-  xmothervertex[0][4]  = xmothervertex[0][0];
-  xmothervertex[0][5]  = xmothervertex[0][4];
-  xmothervertex[0][6]  = -xmothervertex[0][0];
-  xmothervertex[0][7]  = xmothervertex[0][6];
-  xmothervertex[0][8]  = -xmothervertex[0][2];
-  xmothervertex[0][9]  = xmothervertex[0][8];
-  xmothervertex[0][10] = xmothervertex[0][7];
-  xmothervertex[0][11] = xmothervertex[0][10];
-  for(Int_t i=0; i<kmothervertexnumber; i++) xmothervertex[1][i] = xmothervertex[0][i];
-  for(Int_t i = 0; i<kmothernumber; i++){
-      ymothervertex[i][0]  = -(fgkSSDChipWidth-(0.5*fgkSSDStiffenerWidth-fgkSSDStiffenerToChipDist)
-                           + ssdchipcablesradius[i]+fgkSSDChipCablesWidth[1]+fgkSSDChipCablesWidth[2]);
-      ymothervertex[i][1]  = ssdstiffenerseparation-0.5*fgkSSDStiffenerWidth-fgkSSDFlexWidth[0];
-      ymothervertex[i][2]  = ymothervertex[i][1];
-      ymothervertex[i][3]  = ssdstiffenerseparation-0.5*fgkSSDStiffenerWidth;
-      ymothervertex[i][4]  = ymothervertex[i][3];
-      ymothervertex[i][5]  = ymothervertex[i][4]+0.5*fgkSSDStiffenerWidth-ymothervertex[i][0];
-      ymothervertex[i][6]  = ymothervertex[i][5];
-      ymothervertex[i][7]  = 0.5*fgkSSDStiffenerWidth+fgkSSDFlexWidth[0];
-      ymothervertex[i][8]  = ymothervertex[i][7];
-      ymothervertex[i][9]  = 0.5*fgkSSDStiffenerWidth;
-      ymothervertex[i][10] = ymothervertex[i][9];
-      ymothervertex[i][11] = ymothervertex[i][0];
-  }
-  TGeoXtru* ssdhybridmothershape[kmothernumber];
-  //TGeoVolume* ssdhybridmother[kmothernumber];
-  TGeoVolumeAssembly* ssdhybridmother[kmothernumber];
+
+  TGeoVolumeAssembly* ssdhybridassembly[kmothernumber];
+  TGeoVolume* ssdhybridmother[kmothernumber][2];
+
+  TGeoRotation hybridmotherrotR(TGeoRotation("",-90.0,0.0,0.0)*TGeoRotation("",0.0,90.0,0.0)*TGeoRotation("",90.,180.,-90));
+  TGeoRotation hybridmotherrotL(TGeoRotation("",180.,0.0,0.0)*hybridmotherrotR);
+  TGeoRotation *hybridmotherrotInv = new TGeoRotation(hybridmotherrotR.Inverse());
+
   const char* ssdhybridmothername[kmothernumber] = {"SSDHybridMother1","SSDHybridMother2"};
   for(Int_t i=0; i<kmothernumber; i++){
-      ssdhybridmothershape[i] = new TGeoXtru(2);
-      ssdhybridmothershape[i]->DefinePolygon(kmothervertexnumber,xmothervertex[i],
-                                          ymothervertex[i]);
-      /*
-      cout << "ssd hybrid mother " << i << " polygon " << endl;
-      for (Int_t lll = 0; lll < kmothervertexnumber; lll++) {
-       cout << "vtx " << lll << ": " << xmothervertex[i][lll] << " " << ymothervertex[i][lll] << endl;
-      }
-      */
-      ssdhybridmothershape[i]->DefineSection(0,-0.5*fgkSSDStiffenerHeight-fgkSSDChipHeight      
-                                               -fgkSSDChipCablesHeight[i+2]);
-      ssdhybridmothershape[i]->DefineSection(1, 0.5*fgkSSDStiffenerHeight);
-      // cout << " sections " << -0.5*fgkSSDStiffenerHeight-fgkSSDChipHeight      
-      //       -fgkSSDChipCablesHeight[i+2] << " " << 0.5*fgkSSDStiffenerHeight << endl;
-      //ssdhybridmother[i] = new TGeoVolume(ssdhybridmothername[i],ssdhybridmothershape[i],
-      //                                    fSSDAir);
-      ssdhybridmother[i] = new TGeoVolumeAssembly(ssdhybridmothername[i]);
+    xmothervertex[i][0] = -0.5*fgkSSDStiffenerWidth;
+    ymothervertex[i][0] = 0.5*fgkSSDStiffenerHeight;
+    xmothervertex[i][1] = -0.5*fgkSSDStiffenerWidth;
+    ymothervertex[i][1] = -0.5*fgkSSDStiffenerHeight-fgkSSDChipHeight      
+      -fgkSSDChipCablesHeight[i+2];
+    
+    xmothervertex[i][2] = 0.5*(fgkSSDSensorLength-ssdstiffenerseparation); //0.5*fgkSSDStiffenerWidth;
+    ymothervertex[i][2] = -0.5*fgkSSDStiffenerHeight-fgkSSDChipHeight -fgkSSDChipCablesHeight[i+2];
+    xmothervertex[i][3] = xmothervertex[i][2];
+    ymothervertex[i][3] = ymothervertex[i][2]+fgkSSDChipCablesHeight[0]+fgkSSDChipCablesHeight[1];
+
+    xmothervertex[i][4] = xmothervertex[i][2]-0.4;  
+    ymothervertex[i][4] = ymothervertex[i][3];
+    xmothervertex[i][5] = xmothervertex[i][4];
+    ymothervertex[i][5] = ymothervertex[i][4]+2*ssdchipcablesradius[i];
+
+    xmothervertex[i][6] = 0.5*fgkSSDStiffenerWidth+ssdchipcablesradius[i]+0.3*fgkmm;
+    ymothervertex[i][6] = ymothervertex[i][5];
+    
+    xmothervertex[i][7] = xmothervertex[i][6];
+    ymothervertex[i][7] = 0.5*fgkSSDStiffenerHeight;
+    TGeoXtru *shape = new TGeoXtru(2);
+    shape->DefinePolygon(8,xmothervertex[i],ymothervertex[i]);
+    shape->DefineSection(0,-0.5*fgkSSDStiffenerLength);
+    shape->DefineSection(1,0.5*fgkSSDStiffenerLength);
+    ssdhybridmother[i][0] = new TGeoVolume(TString(ssdhybridmothername[i])+"L",shape,fSSDAir);
+    ssdhybridmother[i][1] = new TGeoVolume(TString(ssdhybridmothername[i])+"R",shape,fSSDAir);
+    ssdhybridassembly[i] = new TGeoVolumeAssembly(ssdhybridmothername[i]);
    }   
   /////////////////////////////////////////////////////////////
   // SSD Stiffener   
@@ -2316,52 +2368,83 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
   TGeoVolume* ssdstiffener = new TGeoVolume("SSDStiffener",ssdstiffenershape,
                                             fSSDStiffenerMedium);  
   ssdstiffener->SetLineColor(fColorStiffener); 
-  TGeoTranslation* ssdstiffenertrans[kssdstiffenernumber];
-  for(Int_t i=0; i<kssdstiffenernumber; i++) 
-      ssdstiffenertrans[i] = new TGeoTranslation(0.,i*ssdstiffenerseparation,0.);
-  /////////////////////////////////////////////////////////////
-  // SSD Chip System   
-  /////////////////////////////////////////////////////////////
-  TList* ssdchipsystemlist = GetSSDChipSystem(); 
-  Double_t ssdchipseparation = fgkSSDSensorLength
-                             - 2.*fgkSSDModuleStiffenerPosition[1]
-                             - 2.*(fgkSSDStiffenerWidth-fgkSSDStiffenerToChipDist
-                             - 0.5*fgkSSDChipWidth);
-  Double_t ssdchipsystemlength = (fgkSSDChipNumber-1)*(fgkSSDChipLength 
-                              +  fgkSSDChipSeparationLength)+fgkSSDChipCablesLength[1];
-  TGeoTranslation* ssdchipsystemtrans = new TGeoTranslation(0.5*fgkSSDChipCablesLength[1]
-                                      - 0.5*ssdchipsystemlength,
-                                        0.5*(ssdstiffenerseparation-ssdchipseparation),
-                                      - 0.5*(fgkSSDChipHeight+fgkSSDStiffenerHeight));         
+
 ////////////////////////////
 // Capacitor 0603-2200 nF
 ///////////////////////////
   const Int_t knapacitor0603number = 5;
+  TGeoBBox* capacitor0603mothershape =  new TGeoBBox("Capacitor0603MotherShape",
+                                              0.5*fgkSSDCapacitor0603Length + fgkSSDCapacitor0603CapLength,
+                                              0.5*fgkSSDCapacitor0603Width,
+                                              0.5*fgkSSDCapacitor0603Height);
+  TGeoVolume* capacitor0603mother = new TGeoVolume("Capacitor0603Mother",capacitor0603mothershape,
+                                             fSSDAir); 
+
   TGeoBBox* capacitor0603shape =  new TGeoBBox("Capacitor0603Shape",
-                                                                                        0.5*fgkSSDCapacitor0603Length,
-                                                                                        0.5*(fgkSSDCapacitor0603Width),
-                                                                                        0.5*fgkSSDCapacitor0603Height);
+                                              0.5*fgkSSDCapacitor0603Length,
+                                              0.5*fgkSSDCapacitor0603Width,
+                                              0.5*fgkSSDCapacitor0603Height);
   TGeoVolume* capacitor0603 = new TGeoVolume("Capacitor0603",capacitor0603shape,
                                              fSSDStiffener0603CapacitorMedium); 
   capacitor0603->SetLineColor(fColorAl);
+  TGeoTranslation *cap0603trans = new TGeoTranslation(0.,0.,0.);
+  capacitor0603mother->AddNode(capacitor0603,1,cap0603trans);
+
+  TGeoBBox* capacitor0603capshape =  new TGeoBBox("Capacitor0603CapShape",
+                                              0.5*fgkSSDCapacitor0603CapLength,
+                                              0.5*fgkSSDCapacitor0603Width,
+                                              0.5*fgkSSDCapacitor0603Height);
+  TGeoVolume* capacitor0603cap = new TGeoVolume("Capacitor0603Cap",capacitor0603capshape,
+                                             fSSDStiffenerCapacitorCapMedium); 
+  capacitor0603cap->SetLineColor(fColorNiSn);
+  TGeoTranslation *cap0603captrans1 = new TGeoTranslation(- capacitor0603shape->GetDX() - capacitor0603capshape->GetDX(),0.,0.);
+  capacitor0603mother->AddNode(capacitor0603cap,1,cap0603captrans1);
+  TGeoTranslation *cap0603captrans2 = new TGeoTranslation(capacitor0603shape->GetDX() + capacitor0603capshape->GetDX(),0.,0.);
+  capacitor0603mother->AddNode(capacitor0603cap,2,cap0603captrans2);
+
+
+  TGeoVolume* ssdchip = GetSSDChip();
+
+  const Int_t knedges = 5;
+  TGeoVolume *ssdchipcables[2];
+
   for(Int_t i=0; i<kmothernumber; i++){
+    for(Int_t j=0; j<kssdstiffenernumber; j++){
+      ssdhybridmother[i][j]->AddNode(ssdstiffener,1,hybridmotherrotInv);
+      for(Int_t k=1; k<knapacitor0603number+1; k++){
+       ssdhybridmother[i][j]->AddNode(capacitor0603mother,k,
+                                      new TGeoCombiTrans("",
+                                                         -0.5*(fgkSSDStiffenerWidth - fgkSSDCapacitor0603Width),
+                                                         -0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor0603Height),
+                                                         (k-3.)/6*fgkSSDStiffenerLength,
+                                                         hybridmotherrotInv));
+      }
+    }
+    
+    GetSSDChipCables(ssdchipcables[0],ssdchipcables[1],fgkSSDChipCablesHeight[i+2],knedges);
+    for(Int_t k=0; k<fgkSSDChipNumber; k++){
+      TGeoTranslation *chipcabletrans = new TGeoTranslation("",0.5*fgkSSDStiffenerWidth-fgkSSDChipWidth,
+                                                           - 0.5*fgkSSDStiffenerHeight - fgkSSDChipHeight
+                                                           - fgkSSDChipCablesHeight[i+2],
+                                                           (k+0.5-fgkSSDChipNumber/2)*
+                                                           (fgkSSDChipLength + fgkSSDChipSeparationLength));
+      TGeoCombiTrans *chiptrans = new TGeoCombiTrans("",0.5*(fgkSSDStiffenerWidth-fgkSSDChipWidth),
+                                                    - 0.5*(fgkSSDChipHeight+fgkSSDStiffenerHeight),
+                                                    (k+0.5-fgkSSDChipNumber/2)*(fgkSSDChipLength + fgkSSDChipSeparationLength),
+                                                    hybridmotherrotInv);
       for(Int_t j=0; j<kssdstiffenernumber; j++){
-            ssdhybridmother[i]->AddNode(ssdstiffener,j+1,ssdstiffenertrans[j]);
-            for(Int_t k=1; k<knapacitor0603number+1; k++){
-                  ssdhybridmother[i]->AddNode(capacitor0603,knapacitor0603number*j+k,
-                        new TGeoTranslation((k-3.)/6*fgkSSDStiffenerLength,
-                                           j*ssdstiffenerseparation
-                        +                    0.5*((j==0? 1:-1)*fgkSSDStiffenerWidth
-                        +                    (j==0? -1:+1)*fgkSSDCapacitor0603Width),
-                        -                    0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor0603Height)));
-            }
-      } 
-      ssdhybridmother[i]->AddNode((TGeoVolume*)ssdchipsystemlist->At(i),i+1,ssdchipsystemtrans);
-      ssdhybridlist->Add(ssdhybridmother[i]);
+       ssdhybridmother[i][j]->AddNode(ssdchipcables[j],k+1,chipcabletrans);
+       ssdhybridmother[i][j]->AddNode(ssdchip,k+1,chiptrans);
+      }
+    }  
+    // Final placement by assembly
+    ssdhybridassembly[i]->AddNode(ssdhybridmother[i][0],1,new TGeoCombiTrans(TGeoTranslation("",0,0,0),hybridmotherrotL));
+    ssdhybridassembly[i]->AddNode(ssdhybridmother[i][1],1,new TGeoCombiTrans(TGeoTranslation("",0,ssdstiffenerseparation,0),hybridmotherrotR));
+    ssdhybridlist->Add(ssdhybridassembly[i]);
   }    
-/////////////////////////////////////////////////////////////
-// Mother Volume Containing Capacitor Part 
-/////////////////////////////////////////////////////////////
+  /////////////////////////////////////////////////////////////
+  // Mother Volume Containing Capacitor Part 
+  /////////////////////////////////////////////////////////////
   const Int_t kcapacitormothernumber = 8;
   Double_t xcapacitorvertex[kcapacitormothernumber];
   Double_t ycapacitorvertex[kcapacitormothernumber];  
@@ -2395,25 +2478,31 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
 ////////////////////////////
 // Connector 
 ///////////////////////////
-  const Int_t kssdconnectornumber = 2;
-  TGeoBBox* ssdconnectorshape[kssdconnectornumber];
+  const Int_t kssdconnectorlayernumber = 3;
+  TGeoBBox* ssdconnectorshape[kssdconnectorlayernumber];
+  Double_t ssdConnectorThickness[kssdconnectorlayernumber]={fgkSSDConnectorAlHeight,fgkSSDConnectorNiHeight,fgkSSDConnectorSnHeight};
+  /*
   Double_t ssdAlconnectororigin[3] = {0.0,0.0,0.5*(fgkSSDStiffenerHeight+fgkSSDConnectorAlHeight)};    
   Double_t ssdNiconnectororigin[3] = {0.0,0.0,0.5*(fgkSSDStiffenerHeight+fgkSSDConnectorNiHeight)
                                    +  fgkSSDConnectorAlHeight};  
-  const char* ssdconnectorname[kssdconnectornumber] = {"SSDConnectorAl","SSDConnectorNi"};
-  TGeoVolume* ssdconnector[kssdconnectornumber];
-  for(Int_t i=0; i<kssdconnectornumber; i++){
+  */
+  Double_t ssdconnectororigin[3] = {0,0,0.5*fgkSSDStiffenerHeight};
+  const char* ssdconnectorname[kssdconnectorlayernumber] = {"SSDConnectorAl","SSDConnectorNi","SSDConnectorSn"};
+  TGeoMedium *ssdConnectorMedium[kssdconnectorlayernumber]={fSSDAlTraceFlexMedium,fSSDStiffenerConnectorMedium,fSSDSn};
+  TGeoVolume* ssdconnector[kssdconnectorlayernumber];
+  for(Int_t i=0; i<kssdconnectorlayernumber; i++){
+    ssdconnectororigin[2]+= 0.5*ssdConnectorThickness[i];
       ssdconnectorshape[i] = new TGeoBBox(0.5*fgkSSDConnectorLength,
                                           0.5*fgkSSDConnectorWidth,
-                                          0.5*((1-i)*fgkSSDConnectorAlHeight
-                           +              i*fgkSSDConnectorNiHeight),
-                             i==0? ssdAlconnectororigin : ssdNiconnectororigin);
+                                         0.5*ssdConnectorThickness[i],
+                                         ssdconnectororigin);
+      ssdconnectororigin[2]+= 0.5*ssdConnectorThickness[i];
       ssdconnector[i] = new TGeoVolume(ssdconnectorname[i],ssdconnectorshape[i],
-                                       i==0 ? fSSDAlTraceFlexMedium 
-                                            : fSSDStiffenerConnectorMedium);      
-      ssdconnector[i]->SetLineColor(i==0 ? fColorAl : fColorPhynox);
+                                       ssdConnectorMedium[i]);      
+      ssdconnector[i]->SetLineColor(i==0 ? fColorAl : fColorNiSn);
   }
-  TGeoTranslation* ssdconnectortrans[2*kssdconnectornumber];
+  const Int_t kssdconnectornumber = 4;
+  TGeoTranslation* ssdconnectortrans[kssdconnectornumber];
   ssdconnectortrans[0] = new TGeoTranslation(-ssdstiffenershape->GetDX()
                        +  fgkSSDConnectorPosition[0]
                        -  fgkSSDConnectorSeparation
@@ -2441,25 +2530,49 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
                           -(ssdstiffenershape->GetDY()
                        -  fgkSSDConnectorPosition[1]
                        -  ssdconnectorshape[0]->GetDY()),0.0);
-  for(Int_t i=0; i<2*kssdconnectornumber; i++)
-      for(Int_t j=0; j<kssdconnectornumber; j++)
-            ssdhybridcapacitormother->AddNode(ssdconnector[j],i+1,ssdconnectortrans[i]);      
+  for(Int_t i=0; i<kssdconnectornumber; i++) {
+    Int_t nlay = kssdconnectorlayernumber - 1;
+    if (i == 1 || i == 2)
+      nlay++;
+    for(Int_t j=0; j<nlay; j++)
+      ssdhybridcapacitormother->AddNode(ssdconnector[j],i+1,ssdconnectortrans[i]);      
+  }
 ////////////////////////////
 // Capacitor 1812-330 nF
 /////////////////////////// 
-  Double_t ssdcapacitor1812origin[3] = {0.0,0.0,0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor1812Height)};    
+//  Double_t ssdcapacitor1812origin[3] = {0.0,0.0,0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor1812Height)};    
   TGeoBBox* capacitor1812shape =  new TGeoBBox("Capacitor1812Shape",
                                                                                         0.5*fgkSSDCapacitor1812Length,
                                                                                         0.5*fgkSSDCapacitor1812Width,
-                                                                                        0.5*fgkSSDCapacitor1812Height,
-            ssdcapacitor1812origin);
+                                              0.5*fgkSSDCapacitor1812Height);
+  //            ssdcapacitor1812origin);
   TGeoVolume* capacitor1812 = new TGeoVolume("Capacitor1812",capacitor1812shape,
                                              fSSDStiffener1812CapacitorMedium); 
   capacitor1812->SetLineColor(fColorAl);
   TGeoTranslation* capacitor1812trans = new TGeoTranslation(0.0,
                                         0.5*fgkSSDStiffenerWidth+ssdstiffenerseparation
-                                      - capacitor1812shape->GetDY()-fgkSSDConnectorPosition[1],0.0);
+                                      - capacitor1812shape->GetDY()-fgkSSDConnectorPosition[1],0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor1812Height));
   ssdhybridcapacitormother->AddNode(capacitor1812,1,capacitor1812trans);
+
+  TGeoBBox* capacitor1812capshape =  new TGeoBBox("Capacitor1812CapShape",
+    0.5*fgkSSDCapacitor1812CapLength, 0.5*fgkSSDCapacitor1812Width,
+    0.5*fgkSSDCapacitor1812Height);
+  TGeoVolume* capacitor1812cap = new TGeoVolume("Capacitor1812Cap",capacitor1812capshape,
+                                             fSSDStiffenerCapacitorCapMedium);
+  capacitor1812cap->SetLineColor(fColorNiSn);
+  TGeoTranslation* capacitor1812captrans1 = new TGeoTranslation(
+       - capacitor1812shape->GetDX() - capacitor1812capshape->GetDX(),
+        0.5*fgkSSDStiffenerWidth+ssdstiffenerseparation
+        - capacitor1812shape->GetDY() - fgkSSDConnectorPosition[1],
+        0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor1812Height));
+  ssdhybridcapacitormother->AddNode(capacitor1812cap,1,capacitor1812captrans1);
+  TGeoTranslation* capacitor1812captrans2 = new TGeoTranslation(
+       capacitor1812shape->GetDX() + capacitor1812capshape->GetDX(),
+        0.5*fgkSSDStiffenerWidth+ssdstiffenerseparation
+        - capacitor1812shape->GetDY() - fgkSSDConnectorPosition[1],
+        0.5*(fgkSSDStiffenerHeight+fgkSSDCapacitor1812Height));
+  ssdhybridcapacitormother->AddNode(capacitor1812cap,2,capacitor1812captrans2);
+
 ////////////////////////////
 //Hybrid Wire
 ////////////////////////////
@@ -2483,7 +2596,7 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
                    0.5*ssdwireradius-0.5*fgkSSDStiffenerWidth
                                 + fgkSSDConnectorPosition[1]+0.5*fgkSSDConnectorWidth,
                                   ssdstiffenershape->GetDZ()
-                                + fgkSSDWireRadius+fgkSSDConnectorAlHeight+fgkSSDConnectorNiHeight,
+                                + fgkSSDWireRadius+fgkSSDConnectorAlHeight+fgkSSDConnectorNiHeight+fgkSSDConnectorSnHeight,
                    new TGeoRotation("HybridWireRot1",0.,90.,0.));
   hybridwirecombitrans[1] = new TGeoCombiTrans("HybridWireCombiTrans2",
                             0.0,
@@ -2501,7 +2614,6 @@ TList* AliITSv11GeometrySSD::GetSSDHybridParts(){
   /////////////////////////////////////////////////////////////
   delete hybridwirecombitrans[0];
   delete hybridwirecombitrans[1];
-  delete ssdchipsystemlist;
   return ssdhybridlist;
   /////////////////////////////////////////////////////////////
 }
@@ -2516,118 +2628,39 @@ TGeoVolume* AliITSv11GeometrySSD::GetCoolingBlockSystem(){
   localcoolingblockrot->SetAngles(0.,90.,0.);
   TGeoCombiTrans localcoolingblockmatrix(0.,0.5*fgkSSDCoolingBlockWidth,0.,localcoolingblockrot);
   TVector3* coolingblocktransvector;
-  coolingblocktransvector = new TVector3(fgkSSDModuleSensorSupportDistance
-                                                               + fgkSSDCoolingBlockLength,
+  coolingblocktransvector = new TVector3(fgkCoolingTubeSeparation,
                                                                  fgkSSDSensorLength
                                                                - 2.*fgkSSDModuleStiffenerPosition[1]
                                                                - fgkSSDCoolingBlockWidth);
   const Int_t kcoolingblocktransnumber = 2;
   const Int_t kcoolingblocknumber = 4;
   TGeoHMatrix* coolingblockmatrix[kcoolingblocknumber];
-  TGeoHMatrix* coolingtubematrix[kcoolingblocknumber];
   TGeoRotation* localcoolingtuberot = new TGeoRotation();
   localcoolingtuberot->SetAngles(0.0,90.0,0.0);
-  TGeoTranslation* localcoolingtubetrans = new TGeoTranslation();
-  localcoolingtubetrans->SetTranslation(0.5*fgkSSDCoolingBlockLength,
-                                       0.5*fgkSSDCoolingBlockWidth,
-                                       fgkSSDCoolingBlockHoleCenter);
-  TGeoCombiTrans localcoolingtubematrix (*localcoolingtubetrans,*localcoolingtuberot);
-  Double_t coolingtubedistance = fgkCoolingTubeSupportRmax-fgkCoolingTubeSupportRmin;
   for(Int_t i=0; i<kcoolingblocktransnumber; i++){
     for(Int_t j=0; j<kcoolingblocktransnumber; j++){
-      TGeoTranslation localcoolingblocktrans(i*coolingblocktransvector->X()+2*coolingtubedistance,
+      TGeoTranslation localcoolingblocktrans(i*coolingblocktransvector->X(),//+2*coolingtubedistance,
                                             j*coolingblocktransvector->Y(),
                                             - 0.5*(fgkSSDCoolingBlockHoleCenter
                                                    + fgkCoolingTubeRmax));
       coolingblockmatrix[2*i+j] = new TGeoHMatrix(localcoolingblocktrans*localcoolingblockmatrix);
-      coolingtubematrix[2*i+j] = new TGeoHMatrix(localcoolingblocktrans*localcoolingtubematrix);
     }
   }
-  /////////////////////////////////////////////////////////////
-  // Virtual Volume containing CoolingBlock System   
-  /////////////////////////////////////////////////////////////
-  TGeoXtru* coolingsystemothershape = new TGeoXtru(2);
-  const Int_t kmothervertexnumber = 16;  
-  Double_t xmothervertex[kmothervertexnumber];
-  Double_t ymothervertex[kmothervertexnumber];
-  ///////////////////////
-  // Setting the vertices 
-  ///////////////////////fgkCoolingTubeSupportRmax
-  xmothervertex[0] = 0.0,ymothervertex[0] = 0.0;
-  xmothervertex[1] = xmothervertex[0], ymothervertex[1] = coolingblocktransvector->Y()
-                                  + fgkSSDCoolingBlockWidth;
-  xmothervertex[2] = coolingblocktransvector->X()
-                                  + fgkSSDCoolingBlockLength
-                                  + 4*coolingtubedistance;
-  ymothervertex[2] = ymothervertex[1];
-  xmothervertex[3] = xmothervertex[2], ymothervertex[3] = ymothervertex[0];
-  xmothervertex[4] = xmothervertex[3]-2.*coolingtubedistance-fgkSSDCoolingBlockLength;
-  ymothervertex[4] = ymothervertex[0];
-  xmothervertex[5] = xmothervertex[4], ymothervertex[5] = fgkSSDCoolingBlockWidth;
-  xmothervertex[6] = xmothervertex[3]-coolingtubedistance; 
-  ymothervertex[6] = ymothervertex[5]; 
-  xmothervertex[7] = xmothervertex[6], ymothervertex[7] = ymothervertex[2]
-                                  - fgkSSDCoolingBlockWidth; 
-  xmothervertex[8] = xmothervertex[5], ymothervertex[8] = ymothervertex[7];
-  xmothervertex[9] = xmothervertex[8], ymothervertex[9] = ymothervertex[2]
-                                  - coolingtubedistance;
-  xmothervertex[10] = fgkSSDCoolingBlockLength+2.*coolingtubedistance;
-  ymothervertex[10] = ymothervertex[9];
-  xmothervertex[11] = xmothervertex[10], ymothervertex[11] = ymothervertex[8];
-  xmothervertex[12] = coolingtubedistance, ymothervertex[12] = ymothervertex[11];
-  xmothervertex[13] = xmothervertex[12], ymothervertex[13] = fgkSSDCoolingBlockWidth;
-  xmothervertex[14] = 2.*coolingtubedistance+fgkSSDCoolingBlockLength;
-  ymothervertex[14] = ymothervertex[13];
-  xmothervertex[15] = xmothervertex[14], ymothervertex[15] = ymothervertex[0];
-  //////////////////////////////////////////////////////////
-  coolingsystemothershape->DefinePolygon(kmothervertexnumber,
-                                                                       xmothervertex,ymothervertex);
-  coolingsystemothershape->DefineSection(0,-0.5*(fgkSSDCoolingBlockHoleCenter
-                                                                                          + fgkCoolingTubeRmax));
-  coolingsystemothershape->DefineSection(1, 0.5*(fgkSSDCoolingBlockHoleCenter
-                                                                                          + fgkCoolingTubeRmax));
   TGeoVolume* coolingsystemother = new TGeoVolumeAssembly("CoolingBlockSystem");
-//  TGeoVolume* coolingsystemother = new TGeoVolume("CoolingBlockSystem",
-//                                                       coolingsystemothershape,fSSDAir);
-  /////////////////////////////////////////////////////////////
-  // SSD Cooling Tube Part 
-  /////////////////////////////////////////////////////////////
-  /*
-  TGeoTube* coolingtubeshape[fgkcoolingtubenumber];
-  coolingtubeshape[0] = new TGeoTube(fgkCoolingTubeRmin,fgkCoolingTubeRmax,
-                                                                                0.5*(fgkSSDCoolingBlockWidth-fgkSSDTolerance)); 
-  coolingtubeshape[1] = new TGeoTube(0.0,fgkCoolingTubeRmin,
-                                                                        0.5*(fgkSSDCoolingBlockWidth-fgkSSDTolerance));
-  TGeoVolume* coolingtube[fgkcoolingtubenumber];
-  coolingtube[0] = new TGeoVolume("OuterCoolingTube",coolingtubeshape[0],
-                                                                       fSSDCoolingTubePhynox);
-  coolingtube[1] = new TGeoVolume("InnerCoolingTube",coolingtubeshape[1],
-                                                                       fSSDCoolingTubeWater);
-  coolingtube[0]->SetLineColor(fColorPhynox);
-  coolingtube[1]->SetLineColor(fColorWater);
-  */
   TGeoVolume* ssdcoolingblock = GetSSDCoolingBlock(30);
   /////////////////////////////////////////////////////////////
   // Adding Cooling block to mother volume
   /////////////////////////////////////////////////////////////
-   for(Int_t i=0; i<kcoolingblocknumber; i++){ 
-       coolingsystemother->AddNode(ssdcoolingblock,i+1,coolingblockmatrix[i]);
-       //coolingsystemother->AddNode(coolingtube[0],i+1,coolingtubematrix[i]);
-       //coolingsystemother->AddNode(coolingtube[1],i+1,coolingtubematrix[i]);
+  for(Int_t i=0; i<kcoolingblocknumber; i++){ 
+    coolingsystemother->AddNode(ssdcoolingblock,i+1,coolingblockmatrix[i]);
   }
   /////////////////////////////////////////////////////////////
   // Deallocating memory
   /////////////////////////////////////////////////////////////
-       delete coolingblocktransvector;
-       delete localcoolingblockrot;
-       //delete localcoolingtubetrans;
-       //delete localcoolingtuberot;
-  /////////////////////////////////////////////////////////////
-  // Checking overlaps 
-  /////////////////////////////////////////////////////////////
-       //coolingsystemother->CheckOverlaps(0.01);
-  /////////////////////////////////////////////////////////////
-       return coolingsystemother;
+  delete coolingblocktransvector;
+  delete localcoolingblockrot;
+
+  return coolingsystemother;
 }
 /////////////////////////////////////////////////////////////////////////////////
 TGeoVolume* AliITSv11GeometrySSD::GetSSDStiffenerFlex()const{
@@ -3365,7 +3398,7 @@ TGeoVolume* AliITSv11GeometrySSD::GetSSDCoolingBlock(Int_t nedges){
   return ssdcoolingblock;
 }
 /////////////////////////////////////////////////////////////////////////////////
-TGeoVolume* AliITSv11GeometrySSD::GetSSDChipCables(Double_t SSDChipCablesHeight, Int_t nedges){
+void AliITSv11GeometrySSD::GetSSDChipCables(TGeoVolume *&cableL, TGeoVolume *&cableR, Double_t SSDChipCablesHeight, Int_t nedges){
   ///////////////////////////////////////////////////////
   static const Int_t kssdchipcablesnumber    = 2;  // Number of cables: left and right
   static const Int_t kssdchipcableslaynumber = 2;  // Number of layers: Al and Kapton
@@ -3404,12 +3437,10 @@ TGeoVolume* AliITSv11GeometrySSD::GetSSDChipCables(Double_t SSDChipCablesHeight,
   Double_t phi = 180.;
   Double_t deltaphi = 180./nedges;
   Double_t angle = 0.0;
-  Double_t **xvertexpoints = new Double_t*[kssdchipcableslaynumber];
-  Double_t **yvertexpoints = new Double_t*[kssdchipcableslaynumber];
-  for(Int_t i=0; i<kssdchipcableslaynumber;i++){
-       xvertexpoints[i] = new Double_t[kvertexnumber];
-       yvertexpoints[i] = new Double_t[kvertexnumber];
-  }  
+
+  Double_t xvertexpoints[kssdchipcableslaynumber][kvertexnumber];
+  Double_t yvertexpoints[kssdchipcableslaynumber][kvertexnumber];
+
   TVector3* vertex = new TVector3();
   TVector3* transvector[kssdchipcableslaynumber];
   transvector[0] = new TVector3(fgkSSDChipWidth,
@@ -3481,11 +3512,6 @@ TGeoVolume* AliITSv11GeometrySSD::GetSSDChipCables(Double_t SSDChipCablesHeight,
   /////////////////////////////////////////////////////////////
   // Mother Volume definition 
   /////////////////////////////////////////////////////////////
-  Double_t ssdchipseparation = fgkSSDSensorLength
-                                                        - 2.*fgkSSDModuleStiffenerPosition[1]
-                                                        - 2.*(fgkSSDStiffenerWidth-fgkSSDStiffenerToChipDist
-                                                        - 0.5*fgkSSDChipWidth)-fgkSSDChipWidth;
-
   static const Int_t kmothervertexnumber = 8;
   Double_t xmothervertex[kmothervertexnumber];
   Double_t ymothervertex[kmothervertexnumber];
@@ -3510,115 +3536,27 @@ TGeoVolume* AliITSv11GeometrySSD::GetSSDChipCables(Double_t SSDChipCablesHeight,
   ssdchipcablemothershape->DefineSection(0,-0.5*fgkSSDChipCablesLength[1]);
   ssdchipcablemothershape->DefineSection(1,+0.5*fgkSSDChipCablesLength[1]);
 
-  TGeoVolume* ssdchipcablesmother[kssdchipcablesnumber];
-  ssdchipcablesmother[0] = new TGeoVolume("SSDChipCableMotherLeft",ssdchipcablemothershape,fSSDAir);
-  ssdchipcablesmother[1] = new TGeoVolume("SSDChipCableMotherRight",ssdchipcablemothershape,fSSDAir);
+  cableL = new TGeoVolume("SSDChipCableMotherLeft",ssdchipcablemothershape,fSSDAir);
+  cableR = new TGeoVolume("SSDChipCableMotherRight",ssdchipcablemothershape,fSSDAir);
 
-  /////////////////////////////////////////////////////////////
-  // Rotation and Translation Definition for positioning 
-  /////////////////////////////////////////////////////////////
-  TGeoRotation* ssdchipcablesrot[5];
-  ssdchipcablesrot[0] = new TGeoRotation("",90.,180.,-90);
-  ssdchipcablesrot[1] = new TGeoRotation("",0.0,90.0,0.0);
-  ssdchipcablesrot[2] = new TGeoRotation((*ssdchipcablesrot[1])*(*ssdchipcablesrot[0]));
-  ssdchipcablesrot[3] = new TGeoRotation("",180.,0.0,0.0);
-  ssdchipcablesrot[4] = new TGeoRotation((*ssdchipcablesrot[3])*(*ssdchipcablesrot[2]));
-  TGeoCombiTrans* ssdchipcablescombitrans = new TGeoCombiTrans(-ssdchipseparation,0.,0.,ssdchipcablesrot[2]);
-  ssdchipcablesmother[0]->AddNode(ssdchipcable[0],1);
-  ssdchipcablesmother[0]->AddNode(ssdchipcable[1],1);
-  ssdchipcablesmother[1]->AddNode(ssdchipcable[2],1);
-  ssdchipcablesmother[1]->AddNode(ssdchipcable[3],1);  
+  cableL->AddNode(ssdchipcable[0],1);
+  cableL->AddNode(ssdchipcable[1],1);
+  cableR->AddNode(ssdchipcable[2],1);
+  cableR->AddNode(ssdchipcable[3],1);  
 
-  TGeoVolumeAssembly* ssdchipcablesassembly = new TGeoVolumeAssembly("SSDChipCablesAssembly");
-  ssdchipcablesassembly->AddNode(ssdchipcablesmother[0],1,ssdchipcablesrot[4]);
-  ssdchipcablesassembly->AddNode(ssdchipcablesmother[1],1,ssdchipcablescombitrans);
   /////////////////////////////////////////////////////////////
   // Deallocating memory
   /////////////////////////////////////////////////////////////
-  for(Int_t i=0; i<kssdchipcableslaynumber;i++){
-       delete [] xvertexpoints[i];
-       delete [] yvertexpoints[i];
-  }
   for(Int_t i=0; i<kssdchipcableslaynumber; i++) delete [] vertexposition[i];
   for(Int_t i=0; i<kssdchipcableslaynumber; i++) delete transvector[i];
   delete vertex; 
-  delete ssdchipcablesrot[0];
-  delete ssdchipcablesrot[1];
-  delete ssdchipcablesrot[3];
   /////////////////////////////////////////////////////////////
-  return ssdchipcablesassembly;
 }
-///////////////////////////////////////////////////////////////////////////////
-TList* AliITSv11GeometrySSD::GetSSDChipSystem(){
-  /////////////////////////////////////////////////////////////
-  // SSD Chip Assembly
-  /////////////////////////////////////////////////////////////
-  TGeoVolume* ssdchipassembly = GetSSDChips();
-  TList* ssdchipsystemlist = new TList();
-//  const Int_t knedges = 20;
-  const Int_t knedges = 5;
-  const Int_t kchipsystemnumber = 2;
-
-  TGeoVolumeAssembly* chipsystemother[kchipsystemnumber];
-  const char* chipsytemothername[kchipsystemnumber] = 
-                                       {"SSDChipSytemother1","SSDChipSytemother2"};
-  for(Int_t i=0; i<kchipsystemnumber; i++){
-    chipsystemother[i] = new TGeoVolumeAssembly(chipsytemothername[i]);
-  }
-  /////////////////////////////////////////////////////////////
-  // SSD Chip Cables
-  /////////////////////////////////////////////////////////////
-  TGeoVolume* ssdchipcables[kchipsystemnumber];
-  TGeoRotation** ssdchipcablesrot[kchipsystemnumber];
-  TGeoTranslation** ssdchipcablestrans[kchipsystemnumber];
-  TGeoCombiTrans** ssdchipcablescombitrans[kchipsystemnumber];
-  //////////////////
-  for(Int_t i=0; i<kchipsystemnumber; i++){
-               ssdchipcables[i] = 
-               GetSSDChipCables(fgkSSDChipCablesHeight[i+2],knedges);
-               ssdchipcablestrans[i] = new TGeoTranslation*[fgkSSDChipNumber];
-               ssdchipcablesrot[i] = new TGeoRotation*[fgkSSDChipNumber];
-               ssdchipcablescombitrans[i] = new TGeoCombiTrans*[fgkSSDChipNumber];
-  }
-  for(Int_t i=0; i<kchipsystemnumber; i++){
-       for(Int_t j=0; j<fgkSSDChipNumber; j++){
-               ssdchipcablestrans[i][j] = new TGeoTranslation();
-               ssdchipcablesrot[i][j] = new TGeoRotation();
-               ssdchipcablescombitrans[i][j] = new TGeoCombiTrans();
-               ssdchipcablesrot[i][j]->SetAngles(-90.0,0.0,0.0);
-               ssdchipcablestrans[i][j]->SetTranslation(j*(fgkSSDChipLength
-                                                 +                fgkSSDChipSeparationLength),
-                                                                                       0.5*fgkSSDChipWidth,
-                                                 -                                     0.5*fgkSSDChipHeight
-                                                 -                                     fgkSSDChipCablesHeight[i+2]);
-               ssdchipcablescombitrans[i][j]->SetRotation(*ssdchipcablesrot[i][j]);
-               ssdchipcablescombitrans[i][j]->SetTranslation(*ssdchipcablestrans[i][j]);
-               chipsystemother[i]->AddNode(ssdchipcables[i],j+1,ssdchipcablescombitrans[i][j]);
-       }
-       chipsystemother[i]->AddNode(ssdchipassembly,i+1);
-       ssdchipsystemlist->Add(chipsystemother[i]);     
-  }
-  /////////////////////////////////////////////////////////////
-  // Deallocating memory
-  /////////////////////////////////////////////////////////////
-  for(Int_t i=0; i<kchipsystemnumber; i++){
-       for(Int_t j=0; j<fgkSSDChipNumber; j++){
-               delete ssdchipcablesrot[i][j];
-               delete ssdchipcablestrans[i][j];
-       }
-       delete [] ssdchipcablesrot[i];
-       delete [] ssdchipcablestrans[i];
-  }
-  /////////////////////////////////////////////////////////////
-  return ssdchipsystemlist;
-}
-
 //_____________________________________________________________________________
-TGeoVolume* AliITSv11GeometrySSD::GetSSDChips() const{
+TGeoVolume* AliITSv11GeometrySSD::GetSSDChip() const{
   /////////////////////////////////////////////////////////////
   // SSD Chip Assembly Generation    
   /////////////////////////////////////////////////////////////
-  const Int_t kssdchiprownumber = 2;
   TGeoBBox* ssdchipcompshape[2];
   ssdchipcompshape[0] =  new TGeoBBox("SSDChipCompShape",
                                                                                0.5*fgkSSDChipLength,
@@ -3646,54 +3584,7 @@ TGeoVolume* AliITSv11GeometrySSD::GetSSDChips() const{
   TGeoVolume* ssdchip = new TGeoVolume("SSDChip",ssdvirtualchipshape,fSSDAir);
   /////////////////////////////////////////////////////////////
   for(Int_t i=0; i<2; i++) ssdchip->AddNode(ssdchipcomp[i],1,ssdchipcomptrans[i]);
-  Double_t ssdchipseparation[2] = {fgkSSDChipLength+fgkSSDChipSeparationLength,
-                                                 fgkSSDSensorLength-2.*fgkSSDModuleStiffenerPosition[1]
-                                  -  2.*(fgkSSDStiffenerWidth-fgkSSDStiffenerToChipDist
-                                  -  0.5*fgkSSDChipWidth)};
-  /////////////////////////////////////////////////////////////
-  // Virtual Volume containing SSDChipAssembly   
-  /////////////////////////////////////////////////////////////
-  TGeoXtru* ssdchipmothershape = new TGeoXtru(2);
-  const Int_t kssdmothervertexnumber = 2*fgkSSDChipNumber;  
-  Double_t xmothervertex[kssdmothervertexnumber];
-  Double_t ymothervertex[kssdmothervertexnumber];
-  ///////////////////////
-  // Setting the vertices 
-  ///////////////////////
-  xmothervertex[0] = -0.5*fgkSSDChipLength,ymothervertex[0] = -0.5*fgkSSDChipWidth;
-  xmothervertex[1] = xmothervertex[0], ymothervertex[1] = ssdchipseparation[1]
-                                  - ymothervertex[0];
-  xmothervertex[2] = (fgkSSDChipNumber-1)*ssdchipseparation[0]-xmothervertex[0];
-  ymothervertex[2] = ymothervertex[1];
-  xmothervertex[3] = xmothervertex[2], ymothervertex[3] = ymothervertex[0];
-  xmothervertex[4] = ssdchipseparation[0]+xmothervertex[0];
-  ymothervertex[4] = ymothervertex[0];
-  xmothervertex[5] = xmothervertex[4], ymothervertex[5] = -ymothervertex[4];
-  xmothervertex[6] = (fgkSSDChipNumber-1)*ssdchipseparation[0]
-                                  + (0.5*fgkSSDChipLength-fgkSSDChipWidth);
-  ymothervertex[6] = ymothervertex[5];
-  xmothervertex[7] = xmothervertex[6], ymothervertex[7] = ymothervertex[2]
-                                  - fgkSSDChipWidth;
-  xmothervertex[8] = -0.5*fgkSSDChipLength+fgkSSDChipWidth;
-  ymothervertex[8] = ymothervertex[7];
-  xmothervertex[9] = -0.5*fgkSSDChipLength+fgkSSDChipWidth;
-  ymothervertex[9] = ymothervertex[6];
-  xmothervertex[10] = -xmothervertex[0], ymothervertex[10] = ymothervertex[9];
-  xmothervertex[11] = xmothervertex[10], ymothervertex[11] = ymothervertex[0];
-  //////////////////////////////////////////////////////////
-  ssdchipmothershape->DefinePolygon(kssdmothervertexnumber,
-                                                                       xmothervertex,ymothervertex);
-  ssdchipmothershape->DefineSection(0,-0.5*fgkSSDChipHeight);
-  ssdchipmothershape->DefineSection(1, 0.5*fgkSSDChipHeight);
-//  TGeoVolume* ssdchipmother = new TGeoVolume("SSDChipContainer",
-//                                                       ssdchipmothershape,fSSDAir);
-  TGeoVolumeAssembly* ssdchipmother = new TGeoVolumeAssembly("SSDChipContainer");
-   /////////////////////////////////////////////////////////////
-  for(Int_t i=0; i<kssdchiprownumber; i++)
-    for(Int_t j=0; j<fgkSSDChipNumber; j++) 
-               ssdchipmother->AddNode(ssdchip,fgkSSDChipNumber*i+j+1,
-               new TGeoTranslation(j*ssdchipseparation[0],i*ssdchipseparation[1],0.));
-  return ssdchipmother;
+  return ssdchip;
 }
 /////////////////////////////////////////////////////////////////////////////////
 TList* AliITSv11GeometrySSD::GetLadderCableSegment(Double_t ssdendladdercablelength){
@@ -3720,12 +3611,12 @@ TList* AliITSv11GeometrySSD::GetLadderCableSegment(Double_t ssdendladdercablelen
                                                   new TGeoTranslation("LadderCableSegmentBBoxTrans1",
                                                                                           0.5*fgkSSDFlexWidth[0],
                                                                                           0.5*fgkSSDLadderCableWidth,
-                                                                      0.5*fgkSSDFlexHeight[0]),
+                                                                      0.5*fgkSSDLadderCableHeight[0]),
                                                   new TGeoTranslation("LadderCableSegmentBBoxTrans2",
                                                                                           0.5*fgkSSDFlexWidth[0],
                                                                                           0.5*fgkSSDLadderCableWidth,
-                                                                                          fgkSSDFlexHeight[0]
-                                                                                          +0.5*fgkSSDFlexHeight[1])
+                                                                                          fgkSSDLadderCableHeight[0]
+                                                                                          +0.5*fgkSSDLadderCableHeight[1])
                                                                                    };
   static TGeoVolume* laddercablesegmentbboxassembly =                                             new TGeoVolumeAssembly("LadderCableSegmentBBoxAssembly") ;
   static TGeoVolume* laddercablesegmentarbassembly = 
@@ -3740,7 +3631,7 @@ TList* AliITSv11GeometrySSD::GetLadderCableSegment(Double_t ssdendladdercablelen
                                                  new TGeoBBox(laddercablesegmentbboxshapename[i],
                                                                           0.5*fgkSSDFlexWidth[0],
                                                                           0.5*fgkSSDLadderCableWidth,
-                                                                          0.5*fgkSSDFlexHeight[i]); 
+                                                                          0.5*fgkSSDLadderCableHeight[i]); 
 
   for(Int_t i=0; i<kladdercablesegmentnumber; i++){ 
                        laddercablesegmentbbox[i] =
@@ -3822,7 +3713,7 @@ TList* AliITSv11GeometrySSD::GetLadderCableSegment(Double_t ssdendladdercablelen
                                                  new TGeoBBox(ladderendcablesegmentbboxshapename[i],
                                                                           0.5*ssdendladdercablelength,
                                                                           0.5*fgkSSDLadderCableWidth,
-                                                                          0.5*fgkSSDFlexHeight[i]);
+                                                                          0.5*fgkSSDLadderCableHeight[i]);
   const char* ladderendcablesegmentbboxname[kladdercablesegmentnumber] = 
                                                  {"LadderEndCableSegmentBBox1","LadderEndCableSegmentBBox2"};
   TGeoVolume* ladderendcablesegmentbbox[kladdercablesegmentnumber];
@@ -3840,13 +3731,13 @@ TList* AliITSv11GeometrySSD::GetLadderCableSegment(Double_t ssdendladdercablelen
                                                   new TGeoTranslation("LadderEndCableSegmentBBoxTrans0",
                                                                                           0.5*ssdendladdercablelength,
                                                                                           0.5*fgkSSDLadderCableWidth,
-                                                                                          0.5*fgkSSDFlexHeight[0]);
+                                                                                          0.5*fgkSSDLadderCableHeight[0]);
   ladderendcablesegmentbboxtrans[1] = 
                                                   new TGeoTranslation("LadderEndCableSegmentBBoxTrans1",
                                                                                           0.5*ssdendladdercablelength,
                                                                                           0.5*fgkSSDLadderCableWidth,
-                                                                                          fgkSSDFlexHeight[0]
-                                                                                          +0.5*fgkSSDFlexHeight[1]);
+                                                                                          fgkSSDLadderCableHeight[0]
+                                                                                          +0.5*fgkSSDLadderCableHeight[1]);
   TGeoVolume* ladderendcablesegmentbboxassembly = 
                                                   new TGeoVolumeAssembly("LadderEndCableSegmentBBoxAssembly"); 
   for(Int_t i=0; i<kladdercablesegmentnumber; i++)  
@@ -3872,7 +3763,7 @@ TGeoVolume* AliITSv11GeometrySSD::GetLadderCable(Int_t n, Double_t ssdendladderc
         TGeoTranslation* laddercabletrans = new TGeoTranslation(
                                                        i*(fgkCarbonFiberJunctionWidth),
                                                        fgkSSDLadderCableWidth-fgkSSDFlexWidth[0],
-                                                       i*(fgkSSDFlexHeight[0]+fgkSSDFlexHeight[1]));
+                                                       i*(fgkSSDLadderCableHeight[0]+fgkSSDLadderCableHeight[1]));
     laddercable->AddNode((TGeoVolume*)laddercablesegmentlist->At(0),i+1,laddercabletrans);  
     if(i!=n-1) laddercable->AddNode((TGeoVolume*)laddercablesegmentlist->At(1),i+1,laddercabletrans);  
  
@@ -3880,7 +3771,7 @@ TGeoVolume* AliITSv11GeometrySSD::GetLadderCable(Int_t n, Double_t ssdendladderc
   TGeoTranslation* endladdercabletrans = new TGeoTranslation("EndLadderCableTrans",
                                          (n-1)*fgkCarbonFiberJunctionWidth+fgkSSDFlexWidth[0],
                                                             fgkSSDLadderCableWidth-fgkSSDFlexWidth[0],
-                                                            (n-1)*(fgkSSDFlexHeight[0]+fgkSSDFlexHeight[1]));
+                                                            (n-1)*(fgkSSDLadderCableHeight[0]+fgkSSDLadderCableHeight[1]));
   laddercable->AddNode((TGeoVolume*)laddercablesegmentlist->At(2),1,endladdercabletrans);
   return laddercable;
 }
@@ -3890,14 +3781,14 @@ TGeoVolume* AliITSv11GeometrySSD::GetLadderCableAssembly(Int_t n, Double_t ssden
   // Main method generating Ladder Cable bundles containing n cables
   ///////////////////////////////////////////////////////////////////
   Double_t totalLength = ssdendladdercablelength+(n-1)*fgkCarbonFiberJunctionWidth+fgkSSDFlexWidth[0];
-  Double_t cableOrig[3] = {0.5*totalLength,1.5*fgkSSDLadderCableWidth-fgkSSDFlexWidth[0],0.5*n*(fgkSSDFlexHeight[0]+fgkSSDFlexHeight[1])};
-  TGeoBBox *laddercableshape = new TGeoBBox(0.5*totalLength,0.5*fgkSSDLadderCableWidth,0.5*n*(fgkSSDFlexHeight[0]+fgkSSDFlexHeight[1]),cableOrig);
+  Double_t cableOrig[3] = {0.5*totalLength,1.5*fgkSSDLadderCableWidth-fgkSSDFlexWidth[0],0.5*n*(fgkSSDLadderCableHeight[0]+fgkSSDLadderCableHeight[1])};
+  TGeoBBox *laddercableshape = new TGeoBBox(0.5*totalLength,0.5*fgkSSDLadderCableWidth,0.5*n*(fgkSSDLadderCableHeight[0]+fgkSSDLadderCableHeight[1]),cableOrig);
   TGeoVolume* laddercable = new TGeoVolume("LadderCableMother", laddercableshape, fSSDAir);
   char laddercabletransname[100];
   for(Int_t i=0; i<n; i++){ 
-       sprintf(laddercabletransname,"LadderCableTrans%i",i+1);
-       laddercable->AddNode(GetLadderCable(n-i,ssdendladdercablelength),i+1,
-                            new TGeoTranslation(laddercabletransname,i*fgkCarbonFiberJunctionWidth,0,0));
+    snprintf(laddercabletransname,100,"LadderCableTrans%i",i+1);
+    laddercable->AddNode(GetLadderCable(n-i,ssdendladdercablelength),i+1,
+                        new TGeoTranslation(laddercabletransname,i*fgkCarbonFiberJunctionWidth,0,0));
   }
   return laddercable;
 }
@@ -3913,7 +3804,7 @@ TList* AliITSv11GeometrySSD::GetLadderCableAssemblyList(Int_t n, Double_t ssdend
   char laddercableassemblyname[100];
   TList* laddercableassemblylist = new TList();
   for(Int_t i=0; i<kladdercableassemblynumber; i++){ 
-       sprintf(laddercableassemblyname,"LadderCableAssembly%i",i+1);
+    snprintf(laddercableassemblyname,100,"LadderCableAssembly%i",i+1);
        ladderCable[i] = new TGeoVolumeAssembly(laddercableassemblyname);
        ladderCable[i]->AddNode(laddercableassembly,i+1,i==0 ? NULL :
                                         new TGeoCombiTrans((n-1)
@@ -4082,11 +3973,11 @@ void AliITSv11GeometrySSD::SetLadder(){
   // Setting the vertices 
   ///////////////////////
   Double_t laddercablethickness = (fgkSSDLay6SensorsNumber+2)
-                                                               * (fgkSSDFlexHeight[0]+fgkSSDFlexHeight[1]);
+                                                               * (fgkSSDLadderCableHeight[0]+fgkSSDLadderCableHeight[1]);
   xmothervertex[0][0] = -0.5*fgkSSDSensorWidth;
   ymothervertex[0][0] = -0.5*fgkCoolingTubeSupportHeight-fgkSSDModuleCoolingBlockToSensor;
   xmothervertex[0][1] = xmothervertex[0][0];
-  ymothervertex[0][1] = 0.0;
+  ymothervertex[0][1] = -0.5*fgkCoolingTubeSupportHeight; // 0.0; MvL 20-apr-2010
   xmothervertex[0][2] = - 0.5*fgkSSDModuleSensorSupportDistance-2.*fgkCoolingTubeSupportRmax
                                                - laddercablethickness/SinD(2.*fgkSSDFlexAngle);
   ymothervertex[0][2] = ymothervertex[0][1];
@@ -4283,6 +4174,7 @@ void AliITSv11GeometrySSD::SetLadder(){
                                                         - fgkSSDModuleStiffenerPosition[1]
                                                         - fgkSSDStiffenerWidth)
                                                         + fgkEndLadderCarbonFiberLowerJunctionLength[0]-0.000001*kendladdercablecorrection;
+
   TList* laddercableassemblylist[4];
   const Int_t kendladdercablesnumber = 4;
   TGeoRotation *laddercablerot = new TGeoRotation();
@@ -4468,11 +4360,11 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
   char sideladdersupportpiecename[100];
   char centerladdersupportpiecename[100];
   for(Int_t i=0; i<fgklayernumber; i++){ 
-       sprintf(sidemountingblockname,"MountingBlockSupportSideLay%dArc",i+5);
-       sprintf(centermountingblockname,"MountingBlockSupportCenterLay%dArc",i+5);
-       sprintf(sideladdersupportpiecename,"SideLadderSupportPieceLay%d",i+5);
-       sprintf(centerladdersupportpiecename,"CenterLadderSupportPieceLay%d",i+5);
-       sidemountingblocksupportshape[i] = new TGeoXtru(2);
+    snprintf(sidemountingblockname,100,"MountingBlockSupportSideLay%dArc",i+5);
+    snprintf(centermountingblockname,100,"MountingBlockSupportCenterLay%dArc",i+5);
+    snprintf(sideladdersupportpiecename,100,"SideLadderSupportPieceLay%d",i+5);
+    snprintf(centerladdersupportpiecename,100,"CenterLadderSupportPieceLay%d",i+5);
+    sidemountingblocksupportshape[i] = new TGeoXtru(2);
     sidemountingblocksupportshape[i]->DefinePolygon(vertexlist[i]->GetSize()+2,
                                                                                                xsidevertex[i],ysidevertex[i]);
     sidemountingblocksupportshape[i]->DefineSection(0,fgkMountingBlockSupportWidth[1]
@@ -4541,7 +4433,7 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
     // Mounting Block Down Vertex
     ///////////////////////////
        mountingblockpiecedownshape[i] = new TGeoXtru(2);
-    sprintf(mountingblockpiecedownname,"MountingBlockPieceDownLay%d",i+5);
+       snprintf(mountingblockpiecedownname,100,"MountingBlockPieceDownLay%d",i+5);
        mountingblockpiecedownxvertex[i][0] = -0.5*fgkSSDMountingBlockLength[0];        
        mountingblockpiecedownyvertex[i][0] = fgkMountingBlockSupportRadius[i]
                                              + fgkMountingBlockSupportDownHeight 
@@ -4577,7 +4469,7 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
     // Mounting Block Up Vertex
     ///////////////////////////
        mountingblockpieceupshape[i] = new TGeoXtru(2);
-       sprintf(mountingblockpieceupname,"MountingBlockPieceUpLay%d",i+5);
+       snprintf(mountingblockpieceupname,100,"MountingBlockPieceUpLay%d",i+5);
        mountingblockpieceupxvertex[i][0] = -0.5*fgkSSDMountingBlockLength[0];  
        mountingblockpieceupyvertex[i][0] = fgkMountingBlockSupportRadius[i]
                                                                                + fgkMountingBlockSupportUpHeight[i]
@@ -4649,7 +4541,7 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
        mountingblocksupportrapezoidownshape[i]->DefineSection(0,fgkMountingBlockSupportWidth[1]
                                                                                                                        -fgkMountingBlockSupportWidth[0]);
        mountingblocksupportrapezoidownshape[i]->DefineSection(1,fgkMountingBlockSupportWidth[1]);
-       sprintf(mountingblocksupportrapezoidowname,"MountingBlockSuppTrapezoidDownLay%d",i+5);
+       snprintf(mountingblocksupportrapezoidowname,100,"MountingBlockSuppTrapezoidDownLay%d",i+5);
        mountingblocksupportrapezoidown[i] = new TGeoVolume(mountingblocksupportrapezoidowname,
                                                                mountingblocksupportrapezoidownshape[i],fSSDCarbonFiberMedium);
        mountingblocksupportrapezoidown[i]->SetLineColor(9);
@@ -4678,7 +4570,7 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
        mountingblocksupportrapezoidupshape[i]->DefineSection(0,fgkMountingBlockSupportWidth[1]
                                                                                                                        -fgkMountingBlockSupportWidth[0]);
        mountingblocksupportrapezoidupshape[i]->DefineSection(1,fgkMountingBlockSupportWidth[1]);
-       sprintf(mountingblocksupportrapezoidupname,"MountingBlockSuppTrapezoidUpLay%d",i+5);
+       snprintf(mountingblocksupportrapezoidupname,100,"MountingBlockSuppTrapezoidUpLay%d",i+5);
        mountingblocksupportrapezoidup[i] = new TGeoVolume(mountingblocksupportrapezoidupname,
                                                                mountingblocksupportrapezoidupshape[i],fSSDCarbonFiberMedium);
        mountingblocksupportrapezoidup[i]->SetLineColor(9);
@@ -4732,8 +4624,8 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
        xmothervertex[i][7] = xmothervertex[i][6];
        ymothervertex[i][7] = ymothervertex[i][0];
 
-       sprintf(downmotheladdersupportname,"LadderSupportDownLay%d",i+5);
-       sprintf(upmotheladdersupportname,"LadderSupportUpLay%d",i+5);
+       snprintf(downmotheladdersupportname,100,"LadderSupportDownLay%d",i+5);
+       snprintf(upmotheladdersupportname,100,"LadderSupportUpLay%d",i+5);
 
        downmotherladdersupportshape[i] = new TGeoXtru(2);
        downmotherladdersupportshape[i]->DefinePolygon(8,xmothervertex[i],ymothervertex[i]);
@@ -4820,14 +4712,14 @@ void AliITSv11GeometrySSD::Layer6(TGeoVolume* moth){
        // Adding the Volumes to Mother Volume    
        ///////////////////////////////////////
        for(Int_t j=0; j<2; j++){
-               sprintf(mountingblocksupportboxdownname,"MountingBlockSuppDownLay%dBox%d",i+5,j+1);
-               sprintf(mountingblocksupportboxupname,"MountingBlockSuppUpLay%dBox%d",i+5,j+1);
-               mountingblocksupportboxdown[i][j] = new TGeoVolume(mountingblocksupportboxdownname,
-                                                                                 mountingblocksupportboxdownshape[i][j],
-                                                                                 fSSDCarbonFiberMedium);
-               mountingblocksupportboxup[i][j] = new TGeoVolume(mountingblocksupportboxupname,
-                                                                                 mountingblocksupportboxupshape[i][j],
-                                                                                 fSSDCarbonFiberMedium);
+         snprintf(mountingblocksupportboxdownname,100,"MountingBlockSuppDownLay%dBox%d",i+5,j+1);
+         snprintf(mountingblocksupportboxupname,100,"MountingBlockSuppUpLay%dBox%d",i+5,j+1);
+         mountingblocksupportboxdown[i][j] = new TGeoVolume(mountingblocksupportboxdownname,
+                                                            mountingblocksupportboxdownshape[i][j],
+                                                            fSSDCarbonFiberMedium);
+         mountingblocksupportboxup[i][j] = new TGeoVolume(mountingblocksupportboxupname,
+                                                          mountingblocksupportboxupshape[i][j],
+                                                          fSSDCarbonFiberMedium);
                mountingblocksupportboxdown[i][j]->SetLineColor(9);
                mountingblocksupportboxup[i][j]->SetLineColor(9);
                for(Int_t k=0; k<2; k++){
@@ -4999,7 +4891,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
        for(Int_t j=0; j<2; j++) lowerladderpconsupportshape[i]->DefineSection(j,
                                                         lowerladderpconezsection[j],lowerladderpconradiusmin[i],
                                                         lowerladderpconradiusmax[i]);
-       sprintf(lowerladderpconsupportname,"LowerLadderPConSupportNameLay%d",i+5);
+       snprintf(lowerladderpconsupportname,100,"LowerLadderPConSupportNameLay%d",i+5);
        lowerladderpconsupport[i] = new TGeoVolume(lowerladderpconsupportname,lowerladderpconsupportshape[i],fSSDSupportRingAl);
     lowerladderpconsupport[i]->SetLineColor(fColorAl);
        (i==0 ? fLay5LadderSupportRing: fLay6LadderSupportRing)->AddNode(lowerladderpconsupport[i],1);
@@ -5437,6 +5329,10 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   mothercoverplate->AddNode(holecontour[0],2,holecontourtrans);
   mothercoverplate->AddNode(holecontour[1],1);  
   mothercoverplate->AddNode(contour,1);
+  
+  for (Int_t i = 0; i < kendcapcoverplatesmallholenumber[0]; i++) 
+    delete [] endcapcoverplatesmallholetrans[i];
+  delete [] endcapcoverplatesmallholetrans;
   /////////////////////////////////
   return mothercoverplate;     
  }
@@ -5458,30 +5354,30 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   char endcapcoolingwatertubetorusname[100];
   char endcapcoolingwatertubename[100];
   for(Int_t i=0; i<5; i++){
-       sprintf(endcapcoolingtubetorusname,"EndCapCoolingTubeTorus%d",i+1);
-       sprintf(endcapcoolingtubename,"EndCapCoolingTube%d",i+1);
-       sprintf(endcapcoolingwatertubetorusname,"EndCapCoolingWaterTubeTorus%d",i+1);
-       sprintf(endcapcoolingwatertubename,"EndCapCoolingWaterTube%d",i+1);
-       if(i==3){
-               endcapcoolingtubetorushape[i] = new TGeoTorus(fgkEndCapCoolingTubeAxialRadius[0],
-                                                                               fgkEndCapCoolingTubeRadiusMin,
-                                                                               fgkEndCapCoolingTubeRadiusMax,
-                                                                               90.0,fgkEndCapCoolingTubeAngle[3]);
-               endcapcoolingwatertubetorushape[i] = new TGeoTorus(fgkEndCapCoolingTubeAxialRadius[0],
-                                                                               0.,fgkEndCapCoolingTubeRadiusMin,
-                                                                               90.0,fgkEndCapCoolingTubeAngle[3]);
+    snprintf(endcapcoolingtubetorusname,100,"EndCapCoolingTubeTorus%d",i+1);
+    snprintf(endcapcoolingtubename,100,"EndCapCoolingTube%d",i+1);
+    snprintf(endcapcoolingwatertubetorusname,100,"EndCapCoolingWaterTubeTorus%d",i+1);
+    snprintf(endcapcoolingwatertubename,100,"EndCapCoolingWaterTube%d",i+1);
+    if(i==3){
+      endcapcoolingtubetorushape[i] = new TGeoTorus(fgkEndCapCoolingTubeAxialRadius[0],
+                                                   fgkEndCapCoolingTubeRadiusMin,
+                                                   fgkEndCapCoolingTubeRadiusMax,
+                                                   90.0,fgkEndCapCoolingTubeAngle[3]);
+      endcapcoolingwatertubetorushape[i] = new TGeoTorus(fgkEndCapCoolingTubeAxialRadius[0],
+                                                        0.,fgkEndCapCoolingTubeRadiusMin,
+                                                        90.0,fgkEndCapCoolingTubeAngle[3]);
+    }
+    else{
+      endcapcoolingtubetorushape[i] = new TGeoTorus(i!=4?fgkEndCapCoolingTubeAxialRadius[0]
+                                                   :fgkEndCapCoolingTubeAxialRadius[1],
+                                                   fgkEndCapCoolingTubeRadiusMin,
+                                                   fgkEndCapCoolingTubeRadiusMax,
+                                                   0.,fgkEndCapCoolingTubeAngle[i]);
+      endcapcoolingwatertubetorushape[i] = new TGeoTorus(i!=4?fgkEndCapCoolingTubeAxialRadius[0]
+                                                        :fgkEndCapCoolingTubeAxialRadius[1],
+                                                        0.,fgkEndCapCoolingTubeRadiusMin,
+                                                        0.,fgkEndCapCoolingTubeAngle[i]);
     }
-       else{
-               endcapcoolingtubetorushape[i] = new TGeoTorus(i!=4?fgkEndCapCoolingTubeAxialRadius[0]
-                                                                         :fgkEndCapCoolingTubeAxialRadius[1],
-                                                                          fgkEndCapCoolingTubeRadiusMin,
-                                                                          fgkEndCapCoolingTubeRadiusMax,
-                                                                   0.,fgkEndCapCoolingTubeAngle[i]);
-               endcapcoolingwatertubetorushape[i] = new TGeoTorus(i!=4?fgkEndCapCoolingTubeAxialRadius[0]
-                                                                              :fgkEndCapCoolingTubeAxialRadius[1],
-                                                                                0.,fgkEndCapCoolingTubeRadiusMin,
-                                                                        0.,fgkEndCapCoolingTubeAngle[i]);
-       }
        endcapcoolingtubetorus[i] = new TGeoVolume(endcapcoolingtubetorusname,
                                                                                           endcapcoolingtubetorushape[i],
                                                                                           fSSDCoolingTubePhynox);
@@ -5922,7 +5818,8 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
                                                                endcapsidecoverboxtrans[2*(kendcapcoverholenumber[0]-1)+3
                                                                +i*(kendcapcoverholenumber[1]-1)+j]);
        }
-       return endcapsidecovermother;
+  delete [] endcapsidecoverboxtrans;
+  return endcapsidecovermother;
  } 
  ////////////////////////////////////////////////////////////////////////////////
  TGeoVolume** AliITSv11GeometrySSD::GetEndCapCards() const { 
@@ -6978,7 +6875,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   char upendcapsupportname[100]; 
   for(Int_t i=0; i<klayernumber; i++){
    upendcapsupportshape[i] = new TGeoXtru(2);
-   sprintf(upendcapsupportname,"UpEndCapSupportPieceLayer%i",i+5);
+   snprintf(upendcapsupportname,100,"UpEndCapSupportPieceLayer%i",i+5);
    upendcapsupportshape[i]->DefinePolygon(knedges+3,xupvertex[i],yupvertex[i]); 
    upendcapsupportshape[i]->DefineSection(0,0.);
    upendcapsupportshape[i]->DefineSection(1,fgkEndCapSupportHighWidth);
@@ -7015,7 +6912,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   char downendcapsupportname[100]; 
   for(Int_t i=0; i<klayernumber; i++){
        downendcapsupportshape[i] = new TGeoXtru(2);
-    sprintf(downendcapsupportname,"DownEndCapSupportPieceLayer%i",i+5);
+       snprintf(downendcapsupportname,100,"DownEndCapSupportPieceLayer%i",i+5);
        downendcapsupportshape[i] = new TGeoXtru(2);
        downendcapsupportshape[i]->DefinePolygon(2*(knedges+1),xdownvertex[i],ydownvertex[i]); 
     if(i==0){
@@ -7042,7 +6939,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   char endcapsupportmothername[100];
   for(Int_t i=0; i<klayernumber; i++){
        endcapsupportmothershape[i] = new TGeoPgon(0.0,360.0,kssdlayladdernumber[i],2);
-    sprintf(endcapsupportmothername,"EndCapSupportMotherLayer%i",i+5);
+       snprintf(endcapsupportmothername,100,"EndCapSupportMotherLayer%i",i+5);
        endcapsupportmothershape[i]->DefineSection(0,0.,ydownvertex[i][0],yupvertex[i][1]);     
     endcapsupportmothershape[i]->DefineSection(1,fgkEndCapSupportHighWidth,
                                                                                          ydownvertex[i][0],yupvertex[i][1]);
@@ -7094,7 +6991,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   char endcapsupportsystemothername[100];
   for(Int_t i=0; i<klayernumber; i++){
        endcapsupportsystemshape[i] = new TGeoPgon(0.0,360.0,kssdlayladdernumber[i],2);
-    sprintf(endcapsupportsystemothername,"EndCapSupportSystemLayer%i",i+5);
+       snprintf(endcapsupportsystemothername,100,"EndCapSupportSystemLayer%i",i+5);
        endcapsupportsystemshape[i]->DefineSection(0,-(fgkEndCapCoverPlateWidth[1]
                                                                                             - fgkEndCapCoverPlateWidth[0]),*radiusmin[i],
                                                                                          (*radiusmax[i]*CosD(0.5*upedgeangle[i])
@@ -7922,7 +7819,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
   TGeoVolume* ssdcablepatchpanel3RB26pcon = new TGeoVolume("SSDCablePatchPanel3RB26",
                                                                                                ssdcablepatchpanel3RB26pconshape,fSSDCopper);
   ssdcablepatchpanel3RB26pcon->SetLineColor(9);
-  TGeoRotation* ssdcablepatchpanel3B26rot[3];
+  TGeoRotation* ssdcablepatchpanel3B26rot[4];
   for(Int_t i=0; i<4; i++) ssdcablepatchpanel3B26rot[i] = new TGeoRotation();
   ssdcablepatchpanel3B26rot[0]->SetAngles(0.0,0.0,0.0);
   ssdcablepatchpanel3B26rot[1]->SetAngles(fgkSSDCablesPatchPanel2RB26Angle[0]
@@ -8014,7 +7911,7 @@ void AliITSv11GeometrySSD::SetLadderSupport(Int_t nedges){
                                                                                                ssdcablepatchpanel3RB24pconshape,
                                                                                                fSSDCopper);
   ssdcablepatchpanel3RB24pcon->SetLineColor(9);
-  TGeoRotation* ssdcablepatchpanel3B24rot[3];
+  TGeoRotation* ssdcablepatchpanel3B24rot[4];
   for(Int_t i=0; i<4; i++) ssdcablepatchpanel3B24rot[i] = new TGeoRotation();
   ssdcablepatchpanel3B24rot[0]->SetAngles(-6.0,0.0,0.0);
   ssdcablepatchpanel3B24rot[1]->SetAngles(fgkSSDCablesPatchPanel2RB24Angle[0]
@@ -8328,7 +8225,7 @@ TGeoMedium* AliITSv11GeometrySSD::GetMedium(const char* mediumName) {
   // Method returning the Medium type 
   /////////////////////////////////////////////////////////////
   char ch[100];
-  sprintf(ch, "ITS_%s",mediumName);
+  snprintf(ch,100, "ITS_%s",mediumName);
   TGeoMedium* medium =  gGeoManager->GetMedium(ch);
   if (! medium)
     AliError(Form("medium %s not found !\n", mediumName));
@@ -8361,6 +8258,7 @@ void AliITSv11GeometrySSD::CreateMaterials(){
   ////////////////////////////////  
   fSSDStiffener0603CapacitorMedium = GetMedium("SDD ruby sph. Al2O3$");
   fSSDStiffener1812CapacitorMedium = GetMedium("SDD ruby sph. Al2O3$");
+  fSSDStiffenerCapacitorCapMedium = GetMedium("NiSn$");
   ///////////////////////////  
   // Stiffener Hybrid Wire 
   ///////////////////////////  
@@ -8402,6 +8300,7 @@ void AliITSv11GeometrySSD::CreateMaterials(){
   /////////////////////////////////////////////////////////////////////
   fSSDAir = GetMedium("SDD AIR$");
   fSSDCopper = GetMedium("COPPER$");
+  fSSDSn = GetMedium("Sn$");
   fCreateMaterials = kTRUE;
 }
 /////////////////////////////////////////////////////////////////////