]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv11Geometry.cxx
warnings fixed
[u/mrichter/AliRoot.git] / ITS / AliITSv11Geometry.cxx
index 83a4fea99acabd6d199d9d41b1ae90805df3bf5a..c6e08718c04a6b2e3f301a78c19d71d49123560c 100644 (file)
 #include <TArrow.h>
 #include <TCanvas.h>
 #include <TText.h>
-#include <TObjArray.h>
-#include <TMatrixD.h>
-#include <TArrayD.h>
-#include <TArrayI.h>
 #include <TGeoPcon.h>
 #include <TGeoCone.h>
 #include <TGeoTube.h> // contaings TGeoTubeSeg
 #include <TGeoArb8.h>
+#include <TGeoElement.h>
 #include <TGeoMaterial.h>
 #include <TPolyMarker.h>
 #include <TPolyLine.h>
+#include <AliMagF.h>
+#include <AliRun.h>
 #include "AliITSv11Geometry.h"
 
 ClassImp(AliITSv11Geometry)
@@ -56,175 +55,80 @@ const Double_t AliITSv11Geometry::fgkmm = 0.10;
 const Double_t AliITSv11Geometry::fgkcm = 1.00;
 const Double_t AliITSv11Geometry::fgkDegree = 1.0;
 const Double_t AliITSv11Geometry::fgkRadian = 180./3.14159265358979323846;
-
-//----------------------------------------------------------------------
-TGeoMixture * AliITSv11Geometry::CreateMixtureByVolume(const char* name,
-                                 Int_t nel,const TArrayD *v,
-                                 const TObjArray *mix,Double_t den){
-    // Create a new TGeoMixture object based on a TObject array of
-    // TGeoMixture/TGeoMaterials and their releative weight volume. For 
-    // example, Consider TGeoMixture of 
-    // Inputs:
-    //    const char*     name Name of the new TGeoMixture
-    //          Int_t     nel  The number of enteries
-    //    const TArrayD   *v   Array of releative volume of each mixture
-    //    const TObjArray *mix TObjArray holding the TGeoMixtures or 
-    //                         TGeoMaterials which make up this new mixture.
-    //          Double_t   den The density of this new mixture [g/cm^3].
-    // Output:
-    //    none.
-    // Retrun:
-    //    A pointer to a new instance of a TGeoMixture.
-    Int_t i;
-    TArrayD w(nel);
-
-    for(i=0;i<nel;i++) if(v->At(i)>=0.0){
-        w[i] = v->At(i) * ((TGeoMaterial*)(mix->At(i)))->GetDensity();
-    }else{
-        w[i] = 0.0;
-    } // end if/for i
-    return CreateMixtureByWeight(name,nel,&w,mix,den);
-}
+const Double_t AliITSv11Geometry::fgkgcm3 = 1.0; // assume default is g/cm^3
+const Double_t AliITSv11Geometry::fgkKgm3 = 1.0E+3;// assume Kg/m^3
+const Double_t AliITSv11Geometry::fgkKgdm3 = 1.0; // assume Kg/dm^3
+const Double_t AliITSv11Geometry::fgkCelsius = 1.0; // Assume default is C
+const Double_t AliITSv11Geometry::fgkPascal  = 1.0E-3; // Assume kPascal
+const Double_t AliITSv11Geometry::fgkKPascal = 1.0;    // Asume kPascal
+const Double_t AliITSv11Geometry::fgkeV      = 1.0E-9; // GeV default
+const Double_t AliITSv11Geometry::fgkKeV     = 1.0e-6; // GeV default
+const Double_t AliITSv11Geometry::fgkMeV     = 1.0e-3; // GeV default
+const Double_t AliITSv11Geometry::fgkGeV     = 1.0;    // GeV default
 //______________________________________________________________________
-TGeoMixture * AliITSv11Geometry::CreateMixtureByNumber(const char* name,
-                                 Int_t nel,const TArrayI *w,
-                                 const TObjArray *mix,Double_t den){
-    // Create a new TGeoMixture object based on a TObject array of
-    // TGeoMixture/TGeoMaterials and their releative number. For example,
-    // Consider TGeoMixture of BGO (Bi_2O_3)_2(GeO_2)_3. Assume you have
-    // defined Bismuth Oxide as Bi_2O_3 as one TGeoMixture ("Bi2O3") and 
-    // Germainium Oxide as another ("GeO2"), then BGO is defined at
-    // CreateMixtureByNumber("BGO",2,TArrayI(2,3),
-    // TObjArray(TGeoMixture("Bi2O3"),TGeoMixture("GeO2")));
+void AliITSv11Geometry::IntersectLines(Double_t m, Double_t x0, Double_t y0,
+                                      Double_t n, Double_t x1, Double_t y1,
+                                      Double_t &xi, Double_t &yi)const{
+    // Given the two lines, one passing by (x0,y0) with slope m and
+    // the other passing by (x1,y1) with slope n, returns the coordinates
+    // of the intersecting point (xi,yi)
     // Inputs:
-    //    const char* name     Name of the new TGeoMixture
-    //          Int_t nel      The number of enteries
-    //    const TArrayI *w     Array of releative number of each mixture
-    //    const TObjArray *mix TObjArray holding the TGeoMixtures or 
-    //                         TGeoMaterials which make up this new mixture.
-    //          Double_t   den The density of this new mixture [g/cm^3].
-    // Output:
+    //    Double_t   m     The slope of the first line
+    //    Double_t  x0,y0  The x and y coord. of the first point
+    //    Double_t   n     The slope of the second line
+    //    Double_t  x1,y1  The x and y coord. of the second point
+    // Outputs:
+    //    The coordinates xi and yi of the intersection point
+    // Return:
     //    none.
-    // Retrun:
-    //    A pointer to a new instance of a TGeoMixture.
-    Int_t i,j;
-    Double_t a;
-    TArrayD wa;
-    TGeoMixture *mi;
-    TGeoMaterial *ma;
-
-    wa.Set(nel);
-    wa.Reset();
-    for(i=0;i<nel;i++) if(w->At(i)>0){
-        mi = dynamic_cast<TGeoMixture*>(mix->At(i));
-        if(mi!=0){ // Mixture
-            a = 0.0;
-            for(j=0;j<mi->GetNelements();j++) a+= mi->GetZmixt()[j];
-            wa[i] =  ((Double_t)(w->At(i)))*a/((Double_t)(mi->GetNelements()));
-        }else{ // Material
-            ma = dynamic_cast<TGeoMaterial*>(mix->At(i));
-            if(ma==0) continue; // don't know what this is.
-            wa[i] = ((Double_t)(w->At(i)))*ma->GetA();
-        } // end if
-    } // end if/for i
+    // Created:      14 Dec 2009  Mario Sitta
 
-    return CreateMixtureByWeight(name,nel,&wa,mix,den);
+    if (TMath::Abs(m-n) < 0.000001) {
+      AliError(Form("Lines are parallel: m = %f n = %f\n"));
+      return;
+    }
+
+    xi = (y1 - n*x1 - y0 + m*x0)/(m - n);
+    yi = y0 + m*(xi - x0);
+
+    return;
 }
-//----------------------------------------------------------------------
-TGeoMixture * AliITSv11Geometry::CreateMixtureByWeight(const char* name,
-                                 Int_t nel,const TArrayD *w,
-                                 const TObjArray *mix,Double_t den){
-    // Create a new TGeoMixture object based on a TObject array of
-    // TGeoMixture/TGeoMaterials and their releative weight. For example,
-    // Consider TGeoMixture of "standard shielding blocks" 52% O_2, 32.5% Si,
-    // 6% Ca, 1.5% Na, 2% Fe, and 4% Al.
+//______________________________________________________________________
+Bool_t AliITSv11Geometry::IntersectCircle(Double_t m, Double_t x0, Double_t y0,
+                                         Double_t rr, Double_t xc, Double_t yc,
+                                         Double_t &xi1, Double_t &yi1,
+                                         Double_t &xi2, Double_t &yi2){
+    // Given a lines  passing by (x0,y0) with slope m and a circle with
+    // radius rr and center (xc,yc), returns the coordinates of the
+    // intersecting points (xi1,yi1) and (xi2,yi2) (xi1 > xi2)
     // Inputs:
-    //    const char* name     Name of the new TGeoMixture
-    //          Int_t nel      The number of enteries
-    //    const TArrayD *w     Array of releative Weights of each mixture
-    //    const TObjArray *mix TObjArray holding the TGeoMixtures or 
-    //                         TGeoMaterials which make up this new mixture.
-    //          Double_t   den The density of this new mixture [g/cm^3].
-    // Output:
-    //    none.
-    // Retrun:
-    //    A pointer to a new instance of a TGeoMixture.
-    Int_t i,j,k,n=0;
-    Double_t s=0.0;
-    TArrayD za,aa,wa;
-    TGeoMixture *mi,*mixnew;
-    TGeoMaterial *ma;
-    Bool_t add=kTRUE;
-
-    for(i=0;i<nel;i++) if(w->At(i)>0){
-        mi = dynamic_cast<TGeoMixture*>(mix->At(i));
-        if(mi!=0){
-            for(j=0;j<mi->GetNelements();j++) n++;
-        }else{
-            ma = dynamic_cast<TGeoMaterial*>(mix->At(i));
-            if(ma==0) continue; // don't know what this is.
-            n++;
-        } // end if
-        s += w->At(i);
-    } // end for i
-    if(n<=0) return 0; // No elements found.
-    za.Set(n); za.Reset();
-    aa.Set(n); aa.Reset();
-    wa.Set(n); wa.Reset();
-    TMatrixD wb(n,nel); wb.Zero();
-    //
-    n = 0; // Now use for the number of enteries.
-    for(i=0;i<nel;i++) {
-        for(j=0;j<n;j++) wb(j,i) = 0.0; // zero out array
-        if(w->At(i)>0){
-            mi = dynamic_cast<TGeoMixture*>(mix->At(i));
-            if(mi!=0){
-                for(j=0;j<mi->GetNelements();j++){
-                    for(k=0;k<n;k++){
-                        if(za.At(k)==mi->GetZmixt()[j] && 
-                           aa.At(k)==mi->GetAmixt()[j]){
-                            add = kFALSE;
-                            wb(k,i) = mi->GetWmixt()[j] * w->At(i)/s;
-                            continue;
-                        } // end if
-                        if(add){
-                            za[n]   = mi->GetZmixt()[j];
-                            aa[n]   = mi->GetAmixt()[j];
-                            wb(n,i) = mi->GetWmixt()[j] * w->At(i)/s;
-                            n++;
-                        } // end if
-                        add = kTRUE;
-                    } // end for k
-                } // end for j
-            }else{
-                ma = dynamic_cast<TGeoMaterial*>(mix->At(i));
-                if(ma==0) continue; // don't know what this is.
-                for(k=0;k<n;k++){
-                    if(za.At(k)==ma->GetZ() && aa.At(k)==ma->GetA()){
-                        add = kFALSE;
-                        wb(k,i) = w->At(i)/s;
-                        continue;
-                    } // end if
-                    if(add){
-                        za[n] = ma->GetZ();
-                        aa[n] = ma->GetA();
-                        wb(n,i) = w->At(i)/s;
-                        n++;
-                    } // end if
-                    add = kTRUE;
-                } // end for k
-            } // end if
-        } // end if
-    } // end for i
-    mixnew = new TGeoMixture(name,n,den);
-    k = 0;
-    for(i=0;i<n;i++) {
-        for(j=0;j<nel;j++) wa.AddAt(wb(i,j),i);
-        if(wa.At(i)<=0.0) continue;
-        mixnew->DefineElement(k++,aa.At(i),za.At(i),wa.At(i));
-    } // end for i
-    //
-    return mixnew;
+    //    Double_t   m     The slope of the line
+    //    Double_t  x0,y0  The x and y coord. of the point
+    //    Double_t   rr     The radius of the circle
+    //    Double_t  xc,yc  The x and y coord. of the center of circle
+    // Outputs:
+    //    The coordinates xi and yi of the intersection points
+    // Return:
+    //    kFALSE if the line does not intercept the circle, otherwise kTRUE
+    // Created:      18 Dec 2009  Mario Sitta
+
+    Double_t p = m*x0 - y0;
+    Double_t q = m*m + 1;
+
+    p = p-m*xc+yc;
+
+    Double_t delta = m*m*p*p - q*(p*p - rr*rr);
+
+    if (delta < 0)
+      return kFALSE;
+    else {
+      Double_t root = TMath::Sqrt(delta);
+      xi1 = (m*p + root)/q + xc;
+      xi2 = (m*p - root)/q + xc;
+      yi1 = m*(xi1 - x0) + y0;
+      yi2 = m*(xi2 - x0) + y0;
+      return kTRUE;
+    }
 }
 //______________________________________________________________________
 Double_t AliITSv11Geometry::Yfrom2Points(Double_t x0,Double_t y0,
@@ -628,7 +532,7 @@ void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0,
                                     Double_t x2,Double_t y2,Double_t c,
                                     Double_t &x,Double_t &y)const{
     // Given two intersecting lines defined by the points (x0,y0), (x1,y1) and
-    // (x1,y1), (x1,y2) {intersecting at (x1,y1)} the point (x,y) a distance
+    // (x1,y1), (x2,y2) {intersecting at (x1,y1)} the point (x,y) a distance
     // c away is returned such that two lines a distance c away from the
     // lines defined above intersect at (x,y).
     // Inputs:
@@ -645,6 +549,9 @@ void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0,
     // Return:
     //    none.
     Double_t dx01,dx12,dy01,dy12,r01,r12,m;
+
+    //printf("InsidePoint: x0=% #12.7g y0=% #12.7g x1=% #12.7g y1=% #12.7g "
+    //       "x2=% #12.7g y2=% #12.7g c=% #12.7g ",x0,y0,x1,y2,x2,y2,c);
     dx01 = x0-x1; //cout <<"L410 dx01="<<dx01<<endl;
     dx12 = x1-x2; //cout <<"L411 dx12="<<dx12<<endl;
     dy01 = y0-y1; //cout <<"L412 dy01="<<dy01<<endl;
@@ -656,19 +563,23 @@ void AliITSv11Geometry::InsidePoint(Double_t x0,Double_t y0,
         if(dy01==0.0){ // line are =
             x = x1+c; //cout <<"L419 x="<<x<<endl;
             y = y1; //cout <<"L420 y="<<y<<endl;
+            //printf("dy01==0.0 x=% #12.7g y=% #12.7g\n",x,y);
             return;
         }else if(dx01==0.0){
             x = x1;
             y = y1+c;
+            //printf("dx01==0.0 x=% #12.7g y=% #12.7g\n",x,y);
             return;
         }else{ // dx01!=0 and dy01 !=0.
             x = x1-0.5*c*r01/dy01; //cout <<"L434 x="<<x<<endl;
             y = y1+0.5*c*r01/dx01; //cout <<"L435 y="<<y<<endl;
+            //printf("m*m<DBL_E x=% #12.7g y=% #12.7g\n",x,y);
         } // end if
         return;
     } //
     x = x1+c*(dx12*r01-dx01*r12)/m; //cout <<"L442 x="<<x<<endl;
     y = y1+c*(dy12*r01-dy01*r12)/m; //cout <<"L443 y="<<y<<endl;
+    //printf("          x=% #12.7g y=% #12.7g\n",x,y);
     //cout <<"=============================================="<<endl;
     return;
 }
@@ -771,6 +682,517 @@ void AliITSv11Geometry::PrintBBox(const TGeoBBox *a)const{
     return;
 }
 //---------------------------------------------------------------------
+void AliITSv11Geometry::CreateDefaultMaterials(){
+    // Create ITS materials
+    // Defined media here should correspond to the one defined in galice.cuts
+    // File which is red in (AliMC*) fMCApp::Init() { ReadTransPar(); }
+    // Inputs:
+    //    none.
+    // Outputs:
+    //   none.
+    // Return:
+    //   none.
+    Int_t i;
+    Double_t w;
+
+    // Define some elements
+    TGeoElement *itsH  = new TGeoElement("ITS_H","Hydrogen",1,1.00794);
+    TGeoElement *itsHe = new TGeoElement("ITS_He","Helium",2,4.002602);
+    TGeoElement *itsC  = new TGeoElement("ITS_C","Carbon",6,12.0107);
+    TGeoElement *itsN  = new TGeoElement("ITS_N","Nitrogen",7,14.0067);
+    TGeoElement *itsO  = new TGeoElement("ITS_O","Oxygen",8,15.994);
+    TGeoElement *itsF  = new TGeoElement("ITS_F","Florine",9,18.9984032);
+    TGeoElement *itsNe = new TGeoElement("ITS_Ne","Neon",10,20.1797);
+    TGeoElement *itsMg = new TGeoElement("ITS_Mg","Magnesium",12,24.3050);
+    TGeoElement *itsAl = new TGeoElement("ITS_Al","Aluminum",13,26981538);
+    TGeoElement *itsSi = new TGeoElement("ITS_Si","Silicon",14,28.0855);
+    TGeoElement *itsP  = new TGeoElement("ITS_P" ,"Phosphorous",15,30.973761);
+    TGeoElement *itsS  = new TGeoElement("ITS_S" ,"Sulfur",16,32.065);
+    TGeoElement *itsAr = new TGeoElement("ITS_Ar","Argon",18,39.948);
+    TGeoElement *itsTi = new TGeoElement("ITS_Ti","Titanium",22,47.867);
+    TGeoElement *itsCr = new TGeoElement("ITS_Cr","Chromium",24,51.9961);
+    TGeoElement *itsMn = new TGeoElement("ITS_Mn","Manganese",25,54.938049);
+    TGeoElement *itsFe = new TGeoElement("ITS_Fe","Iron",26,55.845);
+    TGeoElement *itsCo = new TGeoElement("ITS_Co","Cobalt",27,58.933200);
+    TGeoElement *itsNi = new TGeoElement("ITS_Ni","Nickrl",28,56.6930);
+    TGeoElement *itsCu = new TGeoElement("ITS_Cu","Copper",29,63.546);
+    TGeoElement *itsZn = new TGeoElement("ITS_Zn","Zinc",30,65.39);
+    TGeoElement *itsKr = new TGeoElement("ITS_Kr","Krypton",36,83.80);
+    TGeoElement *itsMo = new TGeoElement("ITS_Mo","Molylibdium",42,95.94);
+    TGeoElement *itsXe = new TGeoElement("ITS_Xe","Zeon",54,131.293);
+
+    // Start with the Materials since for any one material there
+    // can be defined more than one Medium.
+    // Air, dry. at 15degree C, 101325Pa at sea-level, % by volume
+    // (% by weight). Density is 351 Kg/m^3
+    // N2 78.084% (75.47%), O2 20.9476% (23.20%), Ar 0.934 (1.28%)%,
+    // C02 0.0314% (0.0590%), Ne 0.001818% (0.0012%, CH4 0.002% (),
+    // He 0.000524% (0.00007%), Kr 0.000114% (0.0003%), H2 0.00005% (3.5E-6%), 
+    // Xe 0.0000087% (0.00004 %), H2O 0.0% (dry) + trace amounts at the ppm
+    // levels.
+    TGeoMixture *itsAir = new TGeoMixture("ITS_Air",9);
+    w = 75.47E-2;
+    itsAir->AddElement(itsN,w);// Nitorgen, atomic
+    w = 23.29E-2 + // O2
+         5.90E-4 * 2.*15.994/(12.0107+2.*15.994);// CO2.
+    itsAir->AddElement(itsO,w);// Oxygen, atomic
+    w = 1.28E-2;
+    itsAir->AddElement(itsAr,w);// Argon, atomic
+    w =  5.90E-4*12.0107/(12.0107+2.*15.994)+  // CO2
+         2.0E-5 *12.0107/(12.0107+4.* 1.00794);  // CH4
+    itsAir->AddElement(itsC,w);// Carbon, atomic
+    w = 1.818E-5;
+    itsAir->AddElement(itsNe,w);// Ne, atomic
+    w = 3.5E-8;
+    itsAir->AddElement(itsHe,w);// Helium, atomic
+    w = 7.0E-7;
+    itsAir->AddElement(itsKr,w);// Krypton, atomic
+    w = 3.0E-6;
+    itsAir->AddElement(itsH,w);// Hydrogen, atomic
+    w = 4.0E-7;
+    itsAir->AddElement(itsXe,w);// Xenon, atomic
+    itsAir->SetDensity(351.0*fgkKgm3); //
+    itsAir->SetPressure(101325*fgkPascal);
+    itsAir->SetTemperature(15.0*fgkCelsius);
+    itsAir->SetState(TGeoMaterial::kMatStateGas);
+    //
+    // Silicone
+    TGeoMaterial *itsSiDet = new TGeoMaterial("ITS_Si",itsSi,2.33*fgkgcm3);
+    itsSiDet->SetTemperature(15.0*fgkCelsius);
+    itsSiDet->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Epoxy C18 H19 O3
+    TGeoMixture *itsEpoxy = new TGeoMixture("ITS_Epoxy",3);
+    itsEpoxy->AddElement(itsC,18);
+    itsEpoxy->AddElement(itsH,19);
+    itsEpoxy->AddElement(itsO,3);
+    itsEpoxy->SetDensity(1.8*fgkgcm3);
+    itsEpoxy->SetTemperature(15.0*fgkCelsius);
+    itsEpoxy->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Carbon Fiber, M55J, 60% fiber by volume. Fiber density
+    // 1.91 g/cm^3. See ToryaCA M55J data sheet.
+    //Begin_Html
+    /*
+       <A HREF="http://torayusa.com/cfa/pdfs/M55JDataSheet.pdf"> Data Sheet
+       </A>
+    */
+    //End_Html
+    TGeoMixture *itsCarbonFiber = new TGeoMixture("ITS_CarbonFiber-M55J",4);
+    // Assume that the epoxy fill in the space between the fibers and so
+    // no change in the total volume. To compute w, assume 1cm^3 total 
+    // volume.
+    w = 1.91/(1.91+(1.-.60)*itsEpoxy->GetDensity());
+    itsCarbonFiber->AddElement(itsC,w);
+    w = (1.-.60)*itsEpoxy->GetDensity()/(1.91+(1.-.06)*itsEpoxy->GetDensity());
+    for(i=0;i<itsEpoxy->GetNelements();i++)
+        itsCarbonFiber->AddElement(itsEpoxy->GetElement(i),
+                                   itsEpoxy->GetWmixt()[i]*w);
+    itsCarbonFiber->SetDensity((1.91+(1.-.60)*itsEpoxy->GetDensity())*fgkgcm3);
+    itsCarbonFiber->SetTemperature(22.0*fgkCelsius);
+    itsCarbonFiber->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // 
+    //
+    // Rohacell 51A  millable foam product.
+    // C9 H13 N1 O2  52Kg/m^3
+    // Elemental composition, Private comunications with
+    // Bjorn S. Nilsen
+    //Begin_Html
+    /*
+      <A HREF="http://www.rohacell.com/en/performanceplastics8344.html">
+       Rohacell-A see Properties
+       </A>
+     */
+    //End_Html
+    TGeoMixture *itsFoam = new TGeoMixture("ITS_Foam",4);
+    itsFoam->AddElement(itsC,9);
+    itsFoam->AddElement(itsH,13);
+    itsFoam->AddElement(itsN,1);
+    itsFoam->AddElement(itsO,2);
+    itsFoam->SetTitle("Rohacell 51 A");
+    itsFoam->SetDensity(52.*fgkKgm3);
+    itsFoam->SetTemperature(22.0*fgkCelsius);
+    itsFoam->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Kapton % by weight, H 2.6362, C69.1133, N 7.3270, O 20.0235
+    // Density 1.42 g/cm^3
+    //Begin_Html
+    /*
+        <A HREF="http://www2.dupont.com/Kapton/en_US/assets/downloads/pdf/summaryofprop.pdf">
+        Kapton. also see </A>
+        <A HREF="http://physics.nist.gov/cgi-bin/Star/compos.pl?matno=179">
+        </A>
+     */
+    //End_Html
+    TGeoMixture *itsKapton = new TGeoMixture("ITS_Kapton",4);
+    itsKapton->AddElement(itsH,0.026362);
+    itsKapton->AddElement(itsC,0.691133);
+    itsKapton->AddElement(itsN,0.073270);
+    itsKapton->AddElement(itsO,0.200235);
+    itsKapton->SetTitle("Kapton ribon and cable base");
+    itsKapton->SetDensity(1.42*fgkgcm3);
+    itsKapton->SetTemperature(22.0*fgkCelsius);
+    itsKapton->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // UPILEX-S C16 H6 O4 N2 polymer (a Kapton like material)
+    // Density 1.47 g/cm^3
+    //Begin_Html
+    /*
+        <A HREF="http://northamerica.ube.com/page.php?pageid=9">
+        UPILEX-S. also see </A>
+        <A HREF="http://northamerica.ube.com/page.php?pageid=81">
+        </A>
+     */
+    //End_Html
+    TGeoMixture *itsUpilex = new TGeoMixture("ITS_Upilex",4);
+    itsUpilex->AddElement(itsC,16);
+    itsUpilex->AddElement(itsH,6);
+    itsUpilex->AddElement(itsN,2);
+    itsUpilex->AddElement(itsO,4);
+    itsUpilex->SetTitle("Upilex ribon, cable, and pcb base");
+    itsUpilex->SetDensity(1.47*fgkgcm3);
+    itsUpilex->SetTemperature(22.0*fgkCelsius);
+    itsUpilex->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Aluminum 6061 (Al used by US groups)
+    // % by weight, Cr 0.04-0.35 range [0.0375 nominal value used]
+    // Cu 0.15-0.4 [0.275], Fe Max 0.7 [0.35], Mg 0.8-1.2 [1.0],
+    // Mn Max 0.15 [0.075] Si 0.4-0.8 [0.6], Ti Max 0.15 [0.075],
+    // Zn Max 0.25 [0.125], Rest Al [97.4625]. Density 2.7 g/cm^3
+    //Begin_Html
+    /*
+      <A HREG="http://www.matweb.com/SpecificMaterial.asp?bassnum=MA6016&group=General">
+      Aluminum 6061 specifications
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsAl6061 = new TGeoMixture("ITS_Al6061",9);
+    itsAl6061->AddElement(itsCr,0.000375);
+    itsAl6061->AddElement(itsCu,0.00275);
+    itsAl6061->AddElement(itsFe,0.0035);
+    itsAl6061->AddElement(itsMg,0.01);
+    itsAl6061->AddElement(itsMn,0.00075);
+    itsAl6061->AddElement(itsSi,0.006);
+    itsAl6061->AddElement(itsTi,0.00075);
+    itsAl6061->AddElement(itsZn,0.00125);
+    itsAl6061->AddElement(itsAl,0.974625);
+    itsAl6061->SetTitle("Aluminum Alloy 6061");
+    itsAl6061->SetDensity(2.7*fgkgcm3);
+    itsAl6061->SetTemperature(22.0*fgkCelsius);
+    itsAl6061->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Aluminum 7075  (Al used by Italian groups)
+    // % by weight, Cr 0.18-0.28 range [0.23 nominal value used]
+    // Cu 1.2-2.0 [1.6], Fe Max 0.5 [0.25], Mg 2.1-2.9 [2.5],
+    // Mn Max 0.3 [0.125] Si Max 0.4 [0.2], Ti Max 0.2 [0.1],
+    // Zn 5.1-6.1 [5.6], Rest Al [89.395]. Density 2.81 g/cm^3
+    //Begin_Html
+    /*
+      <A HREG="http://asm.matweb.com/search/SpecificMaterial.asp?bassnum=MA7075T6">
+      Aluminum 7075 specifications
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsAl7075 = new TGeoMixture("ITS_Al7075",9);
+    itsAl7075->AddElement(itsCr,0.0023);
+    itsAl7075->AddElement(itsCu,0.016);
+    itsAl7075->AddElement(itsFe,0.0025);
+    itsAl7075->AddElement(itsMg,0.025);
+    itsAl7075->AddElement(itsMn,0.00125);
+    itsAl7075->AddElement(itsSi,0.002);
+    itsAl7075->AddElement(itsTi,0.001);
+    itsAl7075->AddElement(itsZn,0.056);
+    itsAl7075->AddElement(itsAl,0.89395);
+    itsAl7075->SetTitle("Aluminum Alloy 7075");
+    itsAl7075->SetDensity(2.81*fgkgcm3);
+    itsAl7075->SetTemperature(22.0*fgkCelsius);
+    itsAl7075->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // "Ruby" spheres, Al2 O3
+    // "Ruby" Sphere posts, Ryton R-4 04
+    //Begin_Html
+    /*
+      <A HREF="">
+      Ruby Sphere Posts
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsRuby = new TGeoMixture("ITS_RubySphere",2);
+    itsRuby->AddElement(itsAl,2);
+    itsRuby->AddElement(itsO,3);
+    itsRuby->SetTitle("Ruby reference sphere");
+    itsRuby->SetDensity(2.81*fgkgcm3);
+    itsRuby->SetTemperature(22.0*fgkCelsius);
+    itsRuby->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    //
+    // Inox, AISI 304L, compoistion % by weight (assumed) 
+    // C Max 0.03 [0.015], Mn Max 2.00 [1.00], Si Max 1.00 [0.50]
+    // P Max 0.045 [0.0225], S Max 0.03 [0.015], Ni 8.0-10.5 [9.25]
+    // Cr 18-20 [19.], Mo 2.-2.5 [2.25], rest Fe: density 7.93 Kg/dm^3
+    //Begin_Html
+    /*
+      <A HREF="http://www.cimap.fr/caracter.pdf">
+      Stainless steal (INOX) AISI 304L composition
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsInox304L = new TGeoMixture("ITS_Inox304L",9);
+    itsInox304L->AddElement(itsC,0.00015);
+    itsInox304L->AddElement(itsMn,0.010);
+    itsInox304L->AddElement(itsSi,0.005);
+    itsInox304L->AddElement(itsP,0.000225);
+    itsInox304L->AddElement(itsS,0.00015);
+    itsInox304L->AddElement(itsNi,0.0925);
+    itsInox304L->AddElement(itsCr,0.1900);
+    itsInox304L->AddElement(itsMo,0.0225);
+    itsInox304L->AddElement(itsFe,0.679475); // Rest Fe
+    itsInox304L->SetTitle("ITS Stainless Steal (Inox) type AISI 304L");
+    itsInox304L->SetDensity(7.93*fgkKgdm3);
+    itsInox304L->SetTemperature(22.0*fgkCelsius);
+    itsInox304L->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Inox, AISI 316L, composition % by weight (assumed)
+    // C Max 0.03 [0.015], Mn Max 2.00 [1.00], Si Max 1.00 [0.50]
+    // P Max 0.045 [0.0225], S Max 0.03 [0.015], Ni 10.0-14. [12.]
+    // Cr 16-18 [17.], Mo 2-3 [2.5]: density 7.97 Kg/dm^3
+    //Begin_Html
+    /*
+      <A HREF="http://www.cimap.fr/caracter.pdf">
+      Stainless steal (INOX) AISI 316L composition
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsInox316L = new TGeoMixture("ITS_Inox316L",9);
+    itsInox316L->AddElement(itsC,0.00015);
+    itsInox316L->AddElement(itsMn,0.010);
+    itsInox316L->AddElement(itsSi,0.005);
+    itsInox316L->AddElement(itsP,0.000225);
+    itsInox316L->AddElement(itsS,0.00015);
+    itsInox316L->AddElement(itsNi,0.12);
+    itsInox316L->AddElement(itsCr,0.17);
+    itsInox316L->AddElement(itsMo,0.025);
+    itsInox316L->AddElement(itsFe,0.66945); // Rest Fe
+    itsInox316L->SetTitle("ITS Stainless Steal (Inox) type AISI 316L");
+    itsInox316L->SetDensity(7.97*fgkKgdm3);
+    itsInox316L->SetTemperature(22.0*fgkCelsius);
+    itsInox316L->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // Inox, Phynox or Elgiloy AMS 5833, composition % by weight
+    // C Max 0.15 [0.15], Mn Max 2.00 [2.00], Be max 0.0001 [none]
+    // Ni 18. [18.], Cr 21.5 [21.5], Mo 7.5 [7.5], Co 42 [42.]: 
+    // density 8.3 Kg/dm^3
+    //Begin_Html
+    /*
+      <A HREF="http://www.freepatentsonline.com/20070032816.html">
+      Compostion of Phynox or Elgiloy AMS 5833, also see
+      </A>
+      <A HREF="http://www.alloywire.com/phynox_alloy.html">
+      under corss reference number [0024].
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsPhynox = new TGeoMixture("ITS_Phynox",7);
+    itsPhynox->AddElement(itsC,0.0015);
+    itsPhynox->AddElement(itsMn,0.020);
+    itsPhynox->AddElement(itsNi,0.18);
+    itsPhynox->AddElement(itsCr,0.215);
+    itsPhynox->AddElement(itsMo,0.075);
+    itsPhynox->AddElement(itsCo,0.42);
+    itsPhynox->AddElement(itsFe,0.885);
+    itsPhynox->SetTitle("ITS Cooling tube alloy");
+    itsPhynox->SetDensity(8.3*fgkgcm3);
+    itsPhynox->SetTemperature(22.0*fgkCelsius);
+    itsPhynox->SetState(TGeoMaterial::kMatStateSolid);
+    //
+    // G10FR4
+    //
+    // Demineralized Water H2O SDD & SSD Cooling liquid
+    TGeoMixture *itsWater = new TGeoMixture("ITS_Water",2);
+    itsWater->AddElement(itsH,2);
+    itsWater->AddElement(itsO,1);
+    itsWater->SetTitle("ITS Cooling Water");
+    itsWater->SetDensity(1.0*fgkgcm3);
+    itsWater->SetTemperature(22.0*fgkCelsius);
+    itsWater->SetState(TGeoMaterial::kMatStateLiquid);
+    //
+    // Freon SPD Cooling liquid PerFluorobuthane C4F10
+    //Begin_Html
+    /*
+      <A HREF=" http://st-support-cooling-electronics.web.cern.ch/st-support-cooling-electronics/default.htm">
+      SPD 2 phase cooling using PerFluorobuthane
+      </A>
+     */
+    //End_Html
+    TGeoMixture *itsFreon = new TGeoMixture("ITS_SPD_Freon",2);
+    itsFreon->AddElement(itsC,4);
+    itsFreon->AddElement(itsF,10);
+    itsFreon->SetTitle("ITS SPD 2 phase Cooling freon");
+    itsFreon->SetDensity(1.52*fgkgcm3);
+    itsFreon->SetTemperature(22.0*fgkCelsius);
+    itsFreon->SetState(TGeoMaterial::kMatStateLiquid);
+    //
+    //    Int_t   ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+    //    Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
+
+    //    Float_t tmaxfd = 0.1;//  1.0;//  Degree
+    //    Float_t stemax = 1.0;//  cm
+    //   Float_t deemax = 0.1;// 30.0;// Fraction of particle's energy 0<deemax<=1
+    //    Float_t epsil  = 1.0E-4;//  1.0;  cm
+    //    Float_t stmin  = 0.0; // cm "Default value used"
+
+    //    Float_t tmaxfdSi = 0.1; // .10000E+01; // Degree
+    //   Float_t stemaxSi = 0.0075; //  .10000E+01; // cm
+    //   Float_t deemaxSi = 0.1; // Fraction of particle's energy 0<deemax<=1
+    //    Float_t epsilSi  = 1.0E-4;// .10000E+01;
+    /*
+    Float_t stminSi  = 0.0; // cm "Default value used"
+
+    Float_t tmaxfdAir = 0.1; // .10000E+01; // Degree
+    Float_t stemaxAir = .10000E+01; // cm
+    Float_t deemaxAir = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
+    Float_t epsilAir  = 1.0E-4;// .10000E+01;
+    Float_t stminAir  = 0.0; // cm "Default value used"
+
+    Float_t tmaxfdServ = 1.0; // 10.0; // Degree
+    Float_t stemaxServ = 1.0; // 0.01; // cm
+    Float_t deemaxServ = 0.5; // 0.1; // Fraction of particle's energy 0<deemax<=1
+    Float_t epsilServ  = 1.0E-3; // 0.003; // cm
+    Float_t stminServ  = 0.0; //0.003; // cm "Default value used"
+
+    // Freon PerFluorobuthane C4F10 see 
+    // http://st-support-cooling-electronics.web.cern.ch/
+    //        st-support-cooling-electronics/default.htm
+    Float_t afre[2]  = { 12.011,18.9984032 };
+    Float_t zfre[2]  = { 6., 9. };
+    Float_t wfre[2]  = { 4.,10. };
+    Float_t densfre  = 1.52;
+
+    //CM55J
+    Float_t aCM55J[4]={12.0107,14.0067,15.9994,1.00794};
+    Float_t zCM55J[4]={6.,7.,8.,1.};
+    Float_t wCM55J[4]={0.908508078,0.010387573,0.055957585,0.025146765};
+    Float_t dCM55J = 1.63;
+
+    //ALCM55J
+    Float_t aALCM55J[5]={12.0107,14.0067,15.9994,1.00794,26.981538};
+    Float_t zALCM55J[5]={6.,7.,8.,1.,13.};
+    Float_t wALCM55J[5]={0.817657902,0.0093488157,0.0503618265,0.0226320885,0.1};
+    Float_t dALCM55J = 1.9866;
+
+    //Si Chips
+    Float_t aSICHIP[6]={12.0107,14.0067,15.9994,1.00794,28.0855,107.8682};
+    Float_t zSICHIP[6]={6.,7.,8.,1.,14., 47.};
+    Float_t wSICHIP[6]={0.039730642,0.001396798,0.01169634,
+                       0.004367771,0.844665,0.09814344903};
+    Float_t dSICHIP = 2.36436;
+
+    //Inox
+    Float_t aINOX[9]={12.0107,54.9380, 28.0855,30.9738,32.066,
+                     58.6928,55.9961,95.94,55.845};
+    Float_t zINOX[9]={6.,25.,14.,15.,16., 28.,24.,42.,26.};
+    Float_t wINOX[9]={0.0003,0.02,0.01,0.00045,0.0003,0.12,0.17,0.025,0.654};
+    Float_t dINOX = 8.03;
+
+    //SDD HV microcable
+    Float_t aHVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
+    Float_t zHVm[5]={6.,1.,7.,8.,13.};
+    Float_t wHVm[5]={0.520088819984,0.01983871336,0.0551367996,0.157399667056, 0.247536};
+    Float_t dHVm = 1.6087;
+
+    //SDD LV+signal cable
+    Float_t aLVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
+    Float_t zLVm[5]={6.,1.,7.,8.,13.};
+    Float_t wLVm[5]={0.21722436468,0.0082859922,0.023028867,0.06574077612, 0.68572};
+    Float_t dLVm = 2.1035;
+
+    //SDD hybrid microcab
+    Float_t aHLVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
+    Float_t zHLVm[5]={6.,1.,7.,8.,13.};
+    Float_t wHLVm[5]={0.24281879711,0.00926228815,0.02574224025,0.07348667449, 0.64869};
+    Float_t dHLVm = 2.0502;
+
+    //SDD anode microcab
+    Float_t aALVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
+    Float_t zALVm[5]={6.,1.,7.,8.,13.};
+    Float_t wALVm[5]={0.392653705471,0.0128595919215,
+                     0.041626868025,0.118832707289, 0.431909};
+    Float_t dALVm = 2.0502;
+
+    //X7R capacitors
+    Float_t aX7R[7]={137.327,47.867,15.9994,58.6928,63.5460,118.710,207.2};
+    Float_t zX7R[7]={56.,22.,8.,28.,29.,50.,82.};
+    Float_t wX7R[7]={0.251639432,0.084755042,0.085975822,
+                    0.038244751,0.009471271,0.321736471,0.2081768};
+    Float_t dX7R = 7.14567;
+
+    // AIR
+    Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+    Float_t zAir[4]={6.,7.,8.,18.};
+    Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+    Float_t dAir = 1.20479E-3;
+
+    // Water
+    Float_t aWater[2]={1.00794,15.9994};
+    Float_t zWater[2]={1.,8.};
+    Float_t wWater[2]={0.111894,0.888106};
+    Float_t dWater   = 1.0;
+
+    // CERAMICS
+    //     94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
+    Float_t acer[5]  = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
+    Float_t zcer[5]  = {       13.,     8.,    14.,     25.,    24. };
+    Float_t wcer[5]  = {.4443408,.5213375,.0130872,.0178135,.003421};
+    Float_t denscer  = 3.6;
+
+    // G10FR4
+    Float_t zG10FR4[14] = {14.00,      20.00,  13.00,  12.00,  5.00,
+                          22.00,       11.00,  19.00,  26.00,  9.00,
+                          8.00,        6.00,   7.00,   1.00};
+    Float_t aG10FR4[14] = {28.0855000,40.0780000,26.9815380,24.3050000,
+                          10.8110000,47.8670000,22.9897700,39.0983000,
+                          55.8450000,18.9984000,15.9994000,12.0107000,
+                          14.0067000,1.0079400};
+    Float_t wG10FR4[14] = {0.15144894,0.08147477,0.04128158,0.00904554,
+                          0.01397570,0.00287685,0.00445114,0.00498089,
+                          0.00209828,0.00420000,0.36043788,0.27529426,
+                          0.01415852,0.03427566};
+    Float_t densG10FR4= 1.8;
+
+    //--- EPOXY  --- C18 H19 O3
+    Float_t aEpoxy[3] = {15.9994, 1.00794, 12.0107} ; 
+    Float_t zEpoxy[3] = {     8.,      1.,      6.} ; 
+    Float_t wEpoxy[3] = {     3.,     19.,     18.} ; 
+    Float_t dEpoxy = 1.8 ;
+
+    // rohacell: C9 H13 N1 O2
+    Float_t arohac[4] = {12.01,  1.01, 14.010, 16.};
+    Float_t zrohac[4] = { 6.,    1.,    7.,     8.};
+    Float_t wrohac[4] = { 9.,   13.,    1.,     2.};
+    Float_t drohac    = 0.05;
+
+    // If he/she means stainless steel (inox) + Aluminium and Zeff=15.3383 then
+    // %Al=81.6164 %inox=100-%Al
+    Float_t aInAl[5] = {27., 55.847,51.9961,58.6934,28.0855 };
+    Float_t zInAl[5] = {13., 26.,24.,28.,14. };
+    Float_t wInAl[5] = {.816164, .131443,.0330906,.0183836,.000919182};
+    Float_t dInAl    = 3.075;
+
+    // Kapton
+    Float_t aKapton[4]={1.00794,12.0107, 14.010,15.9994};
+    Float_t zKapton[4]={1.,6.,7.,8.};
+    Float_t wKapton[4]={0.026362,0.69113,0.07327,0.209235};
+    Float_t dKapton   = 1.42;
+
+    //SDD ruby sph.
+    Float_t aAlOxide[2]  = { 26.981539,15.9994};
+    Float_t zAlOxide[2]  = {       13.,     8.};
+    Float_t wAlOxide[2]  = {0.4707, 0.5293};
+    Float_t dAlOxide     = 3.97;
+    */
+}
+//---------------------------------------------------------------------
 void AliITSv11Geometry::DrawCrossSection(const TGeoPcon *p,
                             Int_t fillc,Int_t fills,
                             Int_t linec,Int_t lines,Int_t linew,