LCOV - code coverage report
Current view: top level - ITS/ITSsim - AliITSv11.cxx (source / functions) Hit Total Coverage
Test: coverage.info Lines: 883 928 95.2 %
Date: 2016-06-14 17:26:59 Functions: 15 17 88.2 %

          Line data    Source code
       1             : /**************************************************************************
       2             :  * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
       3             :  *                                                                        *
       4             :  * Author: The ALICE Off-line Project.                                    *
       5             :  * Contributors are mentioned in the code where appropriate.              *
       6             :  *                                                                        *
       7             :  * Permission to use, copy, modify and distribute this software and its   *
       8             :  * documentation strictly for non-commercial purposes is hereby granted   *
       9             :  * without fee, provided that the above copyright notice appears in all   *
      10             :  * copies and that both the copyright notice and this permission notice   *
      11             :  * appear in the supporting documentation. The authors make no claims     *
      12             :  * about the suitability of this software for any purpose. It is          *
      13             :  * provided "as is" without express or implied warranty.                  *
      14             :  **************************************************************************/
      15             : 
      16             : 
      17             : /* $Id: */
      18             : 
      19             : 
      20             : //========================================================================
      21             : //
      22             : //            Geometry of the Inner Tracking System
      23             : //           ---------------------------------------
      24             : //  This geometry is fully described in TGeo geometry (v11)
      25             : // 
      26             : // Ludovic Gaudichet  (gaudichet@to.infn.it)
      27             : // Mario Sitta (sitta@to.infn.it)
      28             : //
      29             : //========================================================================
      30             : 
      31             : 
      32             : // $Log$
      33             : // Revision 1.1  2011/06/10 14:48:24  masera
      34             : // First version from v11Hybrid to v11 (M. Sitta)
      35             : //
      36             : 
      37             : 
      38             : #include <TClonesArray.h>
      39             : #include <TGeoGlobalMagField.h>
      40             : #include <TGeoManager.h>
      41             : #include <TGeoMatrix.h>
      42             : #include <TGeoPhysicalNode.h>
      43             : #include <TGeoVolume.h>
      44             : #include <TGeoXtru.h>
      45             : #include <TLorentzVector.h>
      46             : #include <TString.h>
      47             : #include <TVirtualMC.h>
      48             : 
      49             : #include "AliITS.h"
      50             : #include "AliITSDetTypeSim.h"
      51             : #include "AliITShit.h"
      52             : #include "AliITSCalibrationSDD.h"
      53             : #include "AliITSsegmentationSDD.h"
      54             : #include "AliITSsegmentationSPD.h"
      55             : #include "AliITSsegmentationSSD.h"
      56             : #include "AliITSv11.h"
      57             : #include "AliLog.h"
      58             : #include "AliMC.h"
      59             : #include "AliMagF.h"
      60             : #include "AliRun.h"
      61             : #include "AliTrackReference.h"
      62             : #include "AliITSv11GeometrySPD.h"
      63             : #include "AliITSv11GeometrySDD.h"
      64             : #include "AliITSv11GeometrySSD.h"
      65             : #include "AliITSv11GeometrySupport.h"
      66             : #include "AliGeomManager.h"
      67             : 
      68             : 
      69         116 : ClassImp(AliITSv11)
      70             : 
      71             : //______________________________________________________________________
      72          12 : AliITSv11::AliITSv11():
      73          12 :   fByThick(kTRUE),
      74          12 :   fIDMother(0),
      75          12 :   fInitGeom(kv11),
      76          12 :   fSPDgeom(0),
      77          12 :   fSDDgeom(0),
      78          12 :   fSSDgeom(0),
      79          12 :   fSupgeom(0)
      80          60 :  {
      81             :     //    Standard default constructor
      82             :     // Inputs:
      83             :     //   none.
      84             :     // Outputs:
      85             :     //   none.
      86             :     // Return:
      87             :     //   none.
      88          24 : }
      89             : 
      90             : //______________________________________________________________________
      91             : AliITSv11::AliITSv11(const char *title) 
      92           0 :   : AliITS("ITS", title),
      93           0 :     fByThick(kTRUE),
      94           0 :     fIDMother(0),
      95           0 :     fInitGeom(kv11),
      96           0 :     fSPDgeom(0),
      97           0 :     fSDDgeom(0),
      98           0 :     fSSDgeom(0),
      99           0 :     fSupgeom(0)
     100           0 : {
     101             :     //    Standard constructor for the v11 geometry.
     102             :     // Inputs:
     103             :     //   const char * title  Arbitrary title
     104             :     // Outputs:
     105             :     //   none.
     106             :     // Return:
     107             :     //   none.
     108             :   Int_t i;
     109             :   
     110           0 :   fSPDgeom = new AliITSv11GeometrySPD();
     111           0 :   fSDDgeom = new AliITSv11GeometrySDD(0);
     112           0 :   fSSDgeom = new AliITSv11GeometrySSD();
     113           0 :   fSupgeom = new AliITSv11GeometrySupport();
     114             : 
     115           0 :   fIdN = 6;
     116           0 :   fIdName = new TString[fIdN];
     117             : 
     118           0 :   fIdName[0] = fSPDgeom->GetSenstiveVolumeName1();
     119           0 :   fIdName[1] = fSPDgeom->GetSenstiveVolumeName2();
     120             : 
     121           0 :   fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
     122           0 :   fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
     123             :   
     124           0 :   fIdName[4] = fSSDgeom->GetSenstiveVolumeName5();
     125           0 :   fIdName[5] = fSSDgeom->GetSenstiveVolumeName6();
     126             : 
     127           0 :   fIdSens    = new Int_t[fIdN];
     128           0 :   for(i=0;i<fIdN;i++) fIdSens[i] = 0;
     129             : 
     130           0 :   SetDensityServicesByThickness();
     131             :   
     132           0 : }
     133             : 
     134             : //______________________________________________________________________
     135             : AliITSv11::AliITSv11(const char *name, const char *title) 
     136           1 :   : AliITS("ITS", title),
     137           1 :     fByThick(kTRUE),
     138           1 :     fIDMother(0),
     139           1 :     fInitGeom(kv11),
     140           1 :     fSPDgeom(0),
     141           1 :     fSDDgeom(0),
     142           1 :     fSSDgeom(0),
     143           1 :     fSupgeom(0)
     144           5 : {
     145             :     //    Standard constructor for the v11 geometry.
     146             :     // Inputs:
     147             :     //   const char * name   Ignored, set to "ITS"
     148             :     //   const char * title  Arbitrary title
     149             :     // Outputs:
     150             :     //   none.
     151             :     // Return:
     152             :     //   none.
     153             :   Int_t i;
     154             :   
     155           3 :   fSPDgeom = new AliITSv11GeometrySPD();
     156           3 :   fSDDgeom = new AliITSv11GeometrySDD(0);
     157           3 :   fSSDgeom = new AliITSv11GeometrySSD();
     158           3 :   fSupgeom = new AliITSv11GeometrySupport();
     159             : 
     160           1 :   fIdN = 6;
     161          16 :   fIdName = new TString[fIdN];
     162             : 
     163             :   (void) name; // removes warning message
     164             : 
     165           2 :   fIdName[0] = fSPDgeom->GetSenstiveVolumeName1();
     166           2 :   fIdName[1] = fSPDgeom->GetSenstiveVolumeName2();
     167             : 
     168           1 :   fIdName[2] = fSDDgeom->GetSenstiveVolumeName3();
     169           1 :   fIdName[3] = fSDDgeom->GetSenstiveVolumeName4();
     170             : 
     171           1 :   fIdName[4] = fSSDgeom->GetSenstiveVolumeName5();
     172           1 :   fIdName[5] = fSSDgeom->GetSenstiveVolumeName6();
     173             : 
     174           2 :   fIdSens    = new Int_t[fIdN];
     175          14 :   for(i=0;i<fIdN;i++) fIdSens[i] = 0;
     176             : 
     177           1 :   SetDensityServicesByThickness();
     178             :   
     179           2 : }
     180             : 
     181             : //______________________________________________________________________
     182          78 : AliITSv11::~AliITSv11() {
     183             :     //    Standard destructor
     184             :     // Inputs:
     185             :     //   none.
     186             :     // Outputs:
     187             :     //   none.
     188             :     // Return:
     189             :     //   none.
     190          14 :   delete fSPDgeom;
     191          14 :   delete fSDDgeom;
     192          14 :   delete fSSDgeom;
     193          14 :   delete fSupgeom;
     194          39 : }
     195             : 
     196             : //______________________________________________________________________
     197             : void AliITSv11::SetT2Lmatrix(Int_t uid, Double_t yShift, 
     198             :                              Bool_t yFlip, Bool_t yRot180) const
     199             : {
     200             : 
     201             :   //
     202             :   // Creates the TGeo Local to Tracking transformation matrix
     203             :   // and sends it to the corresponding TGeoPNEntry 
     204             :   //
     205             :   // This function is used in AddAlignableVolumes()
     206             : 
     207        2198 :   TGeoPNEntry *alignableEntry = gGeoManager->GetAlignableEntryByUID(uid);
     208        2198 :   TGeoHMatrix* globMatrix = alignableEntry->GetGlobalOrig();
     209             : 
     210        2198 :   Double_t *gtrans = globMatrix->GetTranslation(), rotMatrix[9];
     211        2198 :   memcpy(&rotMatrix[0], globMatrix->GetRotationMatrix(), 9*sizeof(Double_t));
     212        2198 :   Double_t al = TMath::ATan2(rotMatrix[1],rotMatrix[0]);
     213        2198 :   if (yRot180) {
     214         210 :     al = TMath::ATan2(rotMatrix[1],-rotMatrix[0]);
     215         210 :   }
     216        2198 :   Double_t xShift = gtrans[0]*TMath::Cos(al)+gtrans[1]*TMath::Sin(al);
     217        2198 :   Double_t zShift = -gtrans[2];
     218             : 
     219        2198 :   TGeoHMatrix *matLtoT = new TGeoHMatrix;
     220        2198 :   matLtoT->SetDx( xShift ); // translation
     221        2198 :   matLtoT->SetDy( yShift );
     222        2198 :   matLtoT->SetDz( zShift );
     223        2198 :   rotMatrix[0]= 0;  rotMatrix[1]= 1;  rotMatrix[2]= 0; // + rotation
     224        2198 :   rotMatrix[3]= 1;  rotMatrix[4]= 0;  rotMatrix[5]= 0;
     225        2198 :   rotMatrix[6]= 0;  rotMatrix[7]= 0;  rotMatrix[8]=-1;
     226        2278 :   if (yFlip) rotMatrix[3] = -1;  // flipping in y  (for SPD1)
     227        2278 :   if (yFlip) rotMatrix[1] = -1;  // flipping in y  (for SPD1)
     228             : 
     229        2198 :   if (yRot180) { // rotation of pi around the axis perpendicular to the wafer
     230         290 :     if (yFlip) matLtoT->SetDx( -xShift ); // flipping in y  (for SPD1)
     231         210 :     matLtoT->SetDy( -yShift );
     232         210 :     matLtoT->SetDz( -zShift );
     233         210 :     rotMatrix[8]=1;
     234         210 :     rotMatrix[3] = -1;
     235         290 :     if (yFlip) rotMatrix[3] = 1;  // flipping in y  (for SPD1)
     236             :   }
     237             : 
     238        2198 :   TGeoRotation rot;
     239        2198 :   rot.SetMatrix(rotMatrix);
     240        2198 :   matLtoT->MultiplyLeft(&rot);
     241        6594 :   TGeoHMatrix *matTtoL = new TGeoHMatrix(matLtoT->Inverse());
     242        4396 :   delete matLtoT;
     243        2198 :   alignableEntry->SetMatrix(matTtoL);
     244        2198 : }
     245             : 
     246             : //______________________________________________________________________
     247             : void AliITSv11::AddAlignableVolumes() const
     248             : {
     249             :   // Creates entries for alignable volumes associating the symbolic volume
     250             :   // name with the corresponding volume path.
     251             :   // 
     252             :   // Records in the alignable entries the transformation matrices converting
     253             :   // TGeo local coordinates (in the RS of alignable volumes) to the tracking
     254             :   // system
     255             :   // For this, this function has to run before the misalignment because we
     256             :   // are using the ideal positions in the AliITSgeom object.
     257             :   // Inputs:
     258             :   //   none.
     259             :   // Outputs:
     260             :   //   none.
     261             :   // Return:
     262             :   //   none.
     263             : 
     264           2 :   AliInfo("Add ITS alignable volumes");
     265             : 
     266           1 :   if (!gGeoManager) {
     267           0 :     AliFatal("TGeoManager doesn't exist !");
     268           0 :     return;
     269             :   }
     270             : 
     271             :   AliGeomManager::ELayerID layerId;
     272             :   Int_t modUID, modnum;
     273             : 
     274           1 :   if( !gGeoManager->SetAlignableEntry("ITS","ALIC_1/ITSV_1") )
     275           0 :     AliFatal(Form("Unable to set alignable entry ! %s :: %s",
     276             :                   "ITS","ALIC_1/ITSV_1"));    
     277             : 
     278           1 :   TString strSPD = "ITS/SPD";
     279           1 :   TString strSDD = "ITS/SDD";
     280           1 :   TString strSSD = "ITS/SSD";
     281           1 :   TString strStave = "/Stave";
     282           1 :   TString strHalfStave = "/HalfStave";
     283           1 :   TString strLadder = "/Ladder";
     284           1 :   TString strSector = "/Sector";
     285           1 :   TString strSensor = "/Sensor";
     286           1 :   TString strEntryName1;
     287           1 :   TString strEntryName2;
     288           1 :   TString strEntryName3;
     289           1 :   TString strEntryName4;
     290             : 
     291           1 :   TString str0;
     292           1 :   TString str1;
     293           1 :   TString str2;
     294             : 
     295           1 :   TString ladder;
     296             : 
     297             :   //===== SPD layers =====
     298             :   
     299           1 :   str0 = "ALIC_1/ITSV_1/ITSSPD_1/ITSSPDCarbonFiberSectorV_";
     300           1 :   str1 = "/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay1-Stave_";
     301             : 
     302           1 :   TString str1Bis = "/ITSSPDhalf-Stave";
     303           1 :   TString str1Tierce = "_1";
     304             : 
     305           1 :   str2 = "/ITSSPDlay1-Ladder_";
     306             :   
     307           1 :   TString sector;
     308           1 :   TString stave;
     309           1 :   TString halfStave;
     310           1 :   TString module;
     311             : 
     312             :   layerId = AliGeomManager::kSPD1;
     313             :   modnum = 0;
     314             :     
     315          22 :   for(Int_t cSect = 0; cSect<10; cSect++) {
     316             : 
     317          10 :     sector = str0;
     318          10 :     sector += cSect+1; // this is one full sector
     319          10 :     strEntryName1 = strSPD;
     320          10 :     strEntryName1 += 0;
     321          10 :     strEntryName1 += strSector;
     322          10 :     strEntryName1 += cSect;
     323          40 :     if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),sector.Data()))
     324           0 :       AliFatal(Form("New lay 1: Unable to set alignable entry 1! %s::%s",
     325             :                strEntryName1.Data(),sector.Data()));
     326             : 
     327          60 :     for(Int_t cStave=0; cStave<2; cStave++) {
     328             :         
     329          20 :       stave = sector;
     330          20 :       stave += str1;
     331          20 :       stave += cStave+1;
     332          20 :       strEntryName2 = strEntryName1;
     333          20 :       strEntryName2 += strStave;
     334          20 :       strEntryName2 += cStave;
     335             : 
     336         120 :       for(Int_t cHS=0; cHS<2; cHS++) {
     337             : 
     338          40 :         halfStave = stave;
     339          40 :         halfStave += str1Bis;
     340          40 :         halfStave += cHS;
     341          40 :         halfStave += str1Tierce;
     342          40 :         strEntryName3 = strEntryName2;
     343          40 :         strEntryName3 += strHalfStave;
     344          40 :         strEntryName3 += cHS;
     345             : 
     346         120 :         if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(),
     347          40 :                                            halfStave.Data()))
     348           0 :           AliFatal(Form("New lay 1: Unable to set alignable entry 3! %s::%s",
     349             :                         strEntryName3.Data(),halfStave.Data()));    
     350             : 
     351         240 :         for(Int_t cLad=0; cLad<2; cLad++) {
     352             :           
     353         160 :           modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
     354          80 :           module = halfStave;
     355          80 :           module += str2;
     356          80 :           module += cLad+cHS*2+1;
     357          80 :           strEntryName4 = strEntryName3;
     358          80 :           strEntryName4 += strLadder;
     359          80 :           strEntryName4 += cLad+cHS*2;
     360         320 :           if(!gGeoManager->SetAlignableEntry(strEntryName4.Data(),module.Data(),modUID))
     361           0 :             AliFatal(Form("New lay 1: Unable to set alignable entry 4! %s::%s",
     362             :                           strEntryName4.Data(),module.Data()));
     363             : 
     364          80 :           SetT2Lmatrix(modUID, 0.0081, kTRUE, kTRUE);
     365             :           // 0.0081 is the shift between the centers of alignable 
     366             :           // and sensitive volumes. It is directly extracted from 
     367             :           // the new SPD geometry
     368             :         } // end for cLad
     369             :       } // end for cHS
     370             :     } // end for cStave
     371             :   } // end for cSect
     372             : 
     373             :   layerId = AliGeomManager::kSPD2;
     374             :   modnum = 0;
     375           1 :   str1 = "/ITSSPDSensitiveVirtualvolumeM0_1/ITSSPDlay2-Stave_";
     376           1 :   str2 = "/ITSSPDlay2-Ladder_";
     377             : 
     378          22 :   for(Int_t cSect = 0; cSect<10; cSect++) {
     379             : 
     380          10 :     sector = str0;
     381          10 :     sector += cSect+1; // this is one full sector
     382          10 :     strEntryName1 = strSPD;
     383          10 :     strEntryName1 += 1;
     384          10 :     strEntryName1 += strSector;
     385          10 :     strEntryName1 += cSect;
     386             :       
     387         100 :     for(Int_t cStave=0; cStave<4; cStave++) {
     388             :         
     389          40 :       stave = sector;
     390          40 :       stave += str1;
     391          40 :       stave += cStave+1;
     392          40 :       strEntryName2 = strEntryName1;
     393          40 :       strEntryName2 += strStave;
     394          40 :       strEntryName2 += cStave;
     395             : 
     396         240 :       for(Int_t cHS=0; cHS<2; cHS++) {
     397             : 
     398          80 :         halfStave = stave;
     399          80 :         halfStave += str1Bis;
     400          80 :         halfStave += cHS;
     401          80 :         halfStave += str1Tierce;
     402          80 :         strEntryName3 = strEntryName2;
     403          80 :         strEntryName3 += strHalfStave;
     404          80 :         strEntryName3 += cHS;
     405             : 
     406         240 :         if(!gGeoManager->SetAlignableEntry(strEntryName3.Data(),
     407          80 :                                            halfStave.Data()))
     408           0 :           AliFatal(Form("New lay 2: Unable to set alignable entry 3! %s::%s",
     409             :                         strEntryName3.Data(),halfStave.Data()));    
     410             : 
     411         480 :         for(Int_t cLad=0; cLad<2; cLad++) {
     412             : 
     413         320 :           modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
     414         160 :           module = halfStave;
     415         160 :           module += str2;
     416         160 :           module += cLad+cHS*2 +1;
     417         160 :           strEntryName4 = strEntryName3;
     418         160 :           strEntryName4 += strLadder;
     419         160 :           strEntryName4 += cLad+cHS*2;
     420         640 :           if(!gGeoManager->SetAlignableEntry(strEntryName4.Data(),module.Data(),modUID))
     421           0 :             AliFatal(Form("New lay 2: Unable to set alignable entry 4! %s::%s",
     422             :                           strEntryName4.Data(),module.Data()));
     423             : 
     424         160 :           SetT2Lmatrix(modUID, -0.0081, kFALSE);
     425             :         } // end for cLad
     426             :       } // end for cHS
     427             :     } // end for cStave
     428             :   } // cSect
     429             : 
     430             :   //===== SDD layers =====
     431             : 
     432             :   layerId = AliGeomManager::kSDD1;
     433             :   modnum = 0;
     434             : 
     435           1 :   str0 = "/ALIC_1/ITSV_1/ITSsddLayer3_1/ITSsddLadd_"; // SDD layer1
     436           1 :   str1 = "/ITSsddSensor3_";
     437             : 
     438           1 :   TString sensor;
     439             : 
     440          30 :   for(Int_t c1 = 0; c1<14; c1++) {
     441             : 
     442          14 :     ladder = str0;
     443          14 :     ladder += c1; // the set of wafers from one ladder
     444          14 :     strEntryName1 = strSDD;
     445          14 :     strEntryName1 += 2;
     446          14 :     strEntryName1 +=strLadder;
     447          14 :     strEntryName1 += c1;
     448             :     //printf("%s    ==    %s\n",strEntryName1.Data(),ladder.Data());
     449          56 :     if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
     450           0 :       AliFatal(Form("Unable to set alignable entry 1! %s :: %s",
     451             :                     strEntryName1.Data(),ladder.Data()));
     452             : 
     453         196 :     for(Int_t c2 =0; c2<6; c2++) {
     454             : 
     455         168 :       modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
     456          84 :       sensor = ladder;
     457          84 :       sensor += str1;
     458          84 :       sensor += c2;
     459          84 :       strEntryName2 = strEntryName1;
     460          84 :       strEntryName2 += strSensor;
     461          84 :       strEntryName2 += c2;
     462             :       //printf("%s    ==    %s\n",strEntryName2.Data(),wafer.Data());
     463         336 :       if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),sensor.Data(),modUID))
     464           0 :         AliFatal(Form("Unable to set alignable entry 2! %s :: %s",
     465             :                       strEntryName2.Data(),sensor.Data()));
     466             : 
     467          84 :       SetT2Lmatrix(modUID, 0, kFALSE, c2>=3);
     468             :     }
     469             :   }
     470             : 
     471             :   layerId = AliGeomManager::kSDD2;
     472             :   modnum = 0;
     473           1 :   str0 = "/ALIC_1/ITSV_1/ITSsddLayer4_1/ITSsddLadd_"; // SDD layer2
     474           1 :   str1 = "/ITSsddSensor4_";
     475             :     
     476          46 :   for(Int_t c1 = 0; c1<22; c1++) {
     477             : 
     478          22 :     ladder = str0;
     479          22 :     ladder += c1; // the set of wafers from one ladder
     480          22 :     strEntryName1 = strSDD;
     481          22 :     strEntryName1 += 3;
     482          22 :     strEntryName1 += strLadder;
     483          22 :     strEntryName1 += c1;
     484             :     //printf("%s    ==    %s\n",strEntryName1.Data(),ladder.Data());
     485          88 :     if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
     486           0 :       AliFatal(Form("Unable to set alignable entry 1! %s :: %s",
     487             :                     strEntryName1.Data(),ladder.Data()));
     488             : 
     489         396 :     for(Int_t c2 =0; c2<8; c2++) {
     490             : 
     491         352 :       modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
     492         176 :       sensor = ladder;
     493         176 :       sensor += str1;
     494         176 :       sensor += c2;
     495         176 :       strEntryName2 = strEntryName1;
     496         176 :       strEntryName2 += strSensor;
     497         176 :       strEntryName2 += c2;
     498             :       //printf("%s    ==    %s\n",strEntryName2.Data(),wafer.Data());
     499         704 :       if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),sensor.Data(),modUID))
     500           0 :         AliFatal(Form("Unable to set alignable entry 2! %s :: %s",
     501             :                       strEntryName2.Data(),sensor.Data()));
     502             : 
     503         176 :       SetT2Lmatrix(modUID, 0, kFALSE, c2>=4);
     504             :     }
     505             :   }
     506             : 
     507             :   //===== SSD layers =====
     508             : 
     509             :   layerId = AliGeomManager::kSSD1;
     510             :   modnum = 0;
     511             : 
     512           1 :   str0 = "/ALIC_1/ITSV_1/ITSssdLayer5_1/ITSssdLay5Ladd_";//SSD layer1
     513           1 :   str1 = "/ITSssdSensor5_";
     514           1 :   str2 = "";
     515             : 
     516           1 :   TString wafer;
     517             : 
     518          70 :   for(Int_t c1 = 0; c1<34; c1++) {
     519             : 
     520          34 :     ladder = str0;
     521          34 :     ladder += c1; // the set of wafers from one ladder
     522          34 :     strEntryName1 = strSSD;
     523          34 :     strEntryName1 += 4;
     524          34 :     strEntryName1 += strLadder;
     525          34 :     strEntryName1 += c1;
     526             :     //printf("%s    ==    %s\n",strEntryName1.Data(),ladder.Data());
     527         136 :     if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
     528           0 :       AliFatal(Form("Unable to set alignable entry 1! %s :: %s",
     529             :                     strEntryName1.Data(),ladder.Data()));
     530             : 
     531        1564 :     for(Int_t c2 =0; c2<22; c2++) {
     532             : 
     533        1496 :       modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
     534         748 :       wafer = ladder;
     535         748 :       wafer += str1;
     536         748 :       wafer += c2;
     537             :       //wafer += str2;    // one wafer
     538         748 :       strEntryName2 = strEntryName1;
     539         748 :       strEntryName2 += strSensor;
     540         748 :       strEntryName2 += c2;
     541             :       //printf("%s    ==    %s\n",strEntryName2.Data(),wafer.Data());
     542        2992 :       if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID))
     543           0 :         AliFatal(Form("Unable to set alignable entry 2! %s :: %s",
     544             :                       strEntryName2.Data(),wafer.Data()));
     545             : 
     546         748 :       SetT2Lmatrix(modUID, 0, kFALSE, kFALSE);
     547             :     }
     548             :   }
     549             : 
     550             :   layerId = AliGeomManager::kSSD2;
     551             :   modnum = 0;
     552           1 :   str0 = "/ALIC_1/ITSV_1/ITSssdLayer6_1/ITSssdLay6Ladd_"; // SSD layer2
     553           1 :   str1 = "/ITSssdSensor6_";
     554           1 :   str2 = "";
     555             :   
     556          78 :   for(Int_t c1 = 0; c1<38; c1++) {
     557             : 
     558          38 :     ladder = str0;
     559          38 :     ladder += c1; // the set of wafers from one ladder
     560          38 :     strEntryName1 = strSSD;
     561          38 :     strEntryName1 += 5;
     562          38 :     strEntryName1 += strLadder;
     563          38 :     strEntryName1 += c1;
     564             :     //printf("%s    ==    %s\n",strEntryName1.Data(),ladder.Data());
     565         152 :     if(!gGeoManager->SetAlignableEntry(strEntryName1.Data(),ladder.Data()))
     566           0 :       AliFatal(Form("Unable to set alignable entry 1! %s :: %s",
     567             :                     strEntryName1.Data(),ladder.Data()));
     568             : 
     569        1976 :     for(Int_t c2 =0; c2<25; c2++) {
     570             : 
     571        1900 :       modUID = AliGeomManager::LayerToVolUID(layerId,modnum++);
     572         950 :       wafer = ladder;
     573         950 :       wafer += str1;
     574         950 :       wafer += c2;
     575             :       //wafer += str2;    // one wafer
     576         950 :       strEntryName2 = strEntryName1;
     577         950 :       strEntryName2 += strSensor;
     578         950 :       strEntryName2 += c2;
     579             :       //printf("%s    ==    %s\n",strEntryName2.Data(),wafer.Data());
     580        3800 :       if(!gGeoManager->SetAlignableEntry(strEntryName2.Data(),wafer.Data(),modUID))
     581           0 :         AliFatal(Form("Unable to set alignable entry 2! %s :: %s",
     582             :                       strEntryName2.Data(),wafer.Data()));
     583             : 
     584         950 :       SetT2Lmatrix(modUID, 0, kFALSE, kFALSE);
     585             :     }
     586             :   }
     587             :     
     588           2 : }
     589             : 
     590             : //______________________________________________________________________
     591             : void AliITSv11::CreateGeometry()
     592             : {
     593             :   // Create the geometry and insert it in ALIC
     594             : 
     595           2 :   TGeoManager *geoManager = gGeoManager;
     596             : 
     597           1 :   TGeoVolume *vALIC = geoManager->GetVolume("ALIC");
     598             : 
     599             :   // This part is really ugly, needs to be redone
     600           1 :   new TGeoVolumeAssembly("ITSV");
     601           1 :   new TGeoVolumeAssembly("ITSS");
     602             : 
     603           1 :   TGeoVolume *vITSV = geoManager->GetVolume("ITSV");
     604           1 :   TGeoVolume *vITSS = geoManager->GetVolume("ITSS");
     605             : 
     606           1 :   vALIC->AddNode(vITSV, 1, 0);
     607           1 :   vALIC->AddNode(vITSS, 1, 0);
     608             : 
     609             :   //
     610             :   const Int_t kLength=100;
     611           1 :   Char_t vstrng[kLength];
     612           1 :   if(fInitGeom.WriteVersionString(vstrng,kLength,(AliITSVersion_t)IsVersion())){
     613           1 :     vITSV->SetTitle(vstrng);
     614           1 :     vITSS->SetTitle(vstrng);
     615           1 :   }
     616             : 
     617           1 :   fSPDgeom->SPDSector(vITSV);
     618             : 
     619           1 :   fSDDgeom->Layer3(vITSV);
     620           1 :   fSDDgeom->Layer4(vITSV);
     621           1 :   fSDDgeom->ForwardLayer3(vITSV);
     622           1 :   fSDDgeom->ForwardLayer4(vITSV);
     623             : 
     624           1 :   fSSDgeom->Layer5(vITSV);
     625           1 :   fSSDgeom->Layer6(vITSV);
     626           1 :   fSSDgeom->LadderSupportLayer5(vITSV);
     627           1 :   fSSDgeom->LadderSupportLayer6(vITSV);
     628           1 :   fSSDgeom->EndCapSupportSystemLayer6(vITSV);
     629           1 :   fSSDgeom->EndCapSupportSystemLayer5(vITSV);
     630             : 
     631           1 :   fSupgeom->SPDCone(vITSV);
     632           1 :   fSupgeom->SDDCone(vITSV);
     633           1 :   fSupgeom->SSDCone(vITSV);
     634             : 
     635           1 :   fSDDgeom->SDDCables(vITSV);
     636           1 :   fSSDgeom->SSDCables(vITSV);
     637           1 :   fSupgeom->ServicesCableSupport(vITSS);
     638             : 
     639           1 :   fSupgeom->ITSTPCSupports(vITSS);
     640             : 
     641           1 : }
     642             : 
     643             : //______________________________________________________________________
     644             : void AliITSv11::CreateMaterials()
     645             : {
     646             :     // Create ITS materials
     647             :     //     This function defines the default materials used in the Geant
     648             :     // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
     649             :     // AliITSv11.
     650             :     // In general it is automatically replaced by
     651             :     // the CreateMaterials routine defined in AliITSv?. Should the function
     652             :     // CreateMaterials not exist for the geometry version you are using this
     653             :     // one is used. See the definition found in AliITSv5 or the other routine
     654             :     // for a complete definition.
     655             :     // Inputs:
     656             :     //   none.
     657             :     // Outputs:
     658             :     //   none.
     659             :     // Return:
     660             :     //   none.
     661             : 
     662           2 :     Int_t   ifield = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
     663           1 :     Float_t fieldm = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
     664             : 
     665             :     Float_t tmaxfd = 0.1; // 1.0; // Degree
     666             :     Float_t stemax = 1.0; // cm
     667             :     Float_t deemax = 0.1; // 30.0; // Fraction of particle's energy 0<deemax<=1
     668             :     Float_t epsil  = 1.0E-4; // 1.0; // cm
     669             :     Float_t stmin  = 0.0; // cm "Default value used"
     670             : 
     671             :     Float_t tmaxfdSi = 0.1; // .10000E+01; // Degree
     672             :     Float_t stemaxSi = 0.0075; //  .10000E+01; // cm
     673             :     Float_t deemaxSi = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
     674             :     Float_t epsilSi  = 1.0E-4;// .10000E+01;
     675             :     Float_t stminSi  = 0.0; // cm "Default value used"
     676             : 
     677             :     Float_t tmaxfdAir = 0.1; // .10000E+01; // Degree
     678             :     Float_t stemaxAir = .10000E+01; // cm
     679             :     Float_t deemaxAir = 0.1; // 0.30000E-02; // Fraction of particle's energy 0<deemax<=1
     680             :     Float_t epsilAir  = 1.0E-4;// .10000E+01;
     681             :     Float_t stminAir  = 0.0; // cm "Default value used"
     682             : 
     683             :     Float_t tmaxfdServ = 1.0; // 10.0; // Degree
     684             :     Float_t stemaxServ = 1.0; // 0.01; // cm
     685             :     Float_t deemaxServ = 0.5; // 0.1; // Fraction of particle's energy 0<deemax<=1
     686             :     Float_t epsilServ  = 1.0E-3; // 0.003; // cm
     687             :     Float_t stminServ  = 0.0; //0.003; // cm "Default value used"
     688             : 
     689             :     // Freon PerFluorobuthane C4F10 see 
     690             :     // http://st-support-cooling-electronics.web.cern.ch/
     691             :     //        st-support-cooling-electronics/default.htm
     692           1 :     Float_t afre[2]  = { 12.011,18.9984032 };
     693           1 :     Float_t zfre[2]  = { 6., 9. };
     694           1 :     Float_t wfre[2]  = { 4.,10. };
     695             :     Float_t densfre  = 1.52;
     696             : 
     697             : 
     698             :     //CM55J
     699             : 
     700           1 :     Float_t aCM55J[4]={12.0107,14.0067,15.9994,1.00794};
     701           1 :     Float_t zCM55J[4]={6.,7.,8.,1.};
     702           1 :     Float_t wCM55J[4]={0.908508078,0.010387573,0.055957585,0.025146765};
     703             :     Float_t dCM55J = 1.8;
     704             : 
     705             :     //ALCM55J
     706             : 
     707           1 :     Float_t aALCM55J[5]={12.0107,14.0067,15.9994,1.00794,26.981538};
     708           1 :     Float_t zALCM55J[5]={6.,7.,8.,1.,13.};
     709           1 :     Float_t wALCM55J[5]={0.817657902,0.0093488157,0.0503618265,0.0226320885,0.1};
     710             :     Float_t dALCM55J = 1.9866;
     711             : 
     712             :     //Si Chips
     713             : 
     714           1 :     Float_t aSICHIP[6]={12.0107,14.0067,15.9994,1.00794,28.0855,107.8682};
     715           1 :     Float_t zSICHIP[6]={6.,7.,8.,1.,14., 47.};
     716           1 :     Float_t wSICHIP[6]={0.039730642,0.001396798,0.01169634,0.004367771,0.844665,0.09814344903};
     717             :     Float_t dSICHIP = 2.36436;
     718             : 
     719             :     //Inox
     720             :     
     721           1 :     Float_t aINOX[9]={12.0107,54.9380, 28.0855,30.9738,32.066,58.6928,51.9961,95.94,55.845};
     722           1 :     Float_t zINOX[9]={6.,25.,14.,15.,16., 28.,24.,42.,26.};
     723           1 :     Float_t wINOX[9]={0.0003,0.02,0.01,0.00045,0.0003,0.12,0.17,0.025,0.654};
     724             :     Float_t dINOX = 8.03;
     725             : 
     726             :     //AISI 304 L (from F.Tosello's web page - M.S. 18 Oct 10)
     727             :     
     728           1 :     Float_t a304L[8]={12.0107,54.9380, 28.0855,30.9738,32.066,58.6928,51.9961,55.845};
     729           1 :     Float_t z304L[8]={6.,25.,14.,15.,16., 28.,24.,26.};
     730           1 :     Float_t w304L[8]={0.0003,0.02,0.01,0.00045,0.003,0.0925,0.19,0.6865};
     731             :     Float_t d304L = 8.03;
     732             : 
     733             :     //SDD HV microcable
     734             : 
     735           1 :     Float_t aHVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
     736           1 :     Float_t zHVm[5]={6.,1.,7.,8.,13.};
     737           1 :     Float_t wHVm[5]={0.520088819984,0.01983871336,0.0551367996,0.157399667056, 0.247536};
     738             :     Float_t dHVm = 1.6087;
     739             : 
     740             :     //SDD LV+signal cable
     741             : 
     742           1 :     Float_t aLVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
     743           1 :     Float_t zLVm[5]={6.,1.,7.,8.,13.};
     744           1 :     Float_t wLVm[5]={0.21722436468,0.0082859922,0.023028867,0.06574077612, 0.68572};
     745             :     Float_t dLVm = 2.1035;
     746             : 
     747             :     //SDD hybrid microcab
     748             : 
     749           1 :     Float_t aHLVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
     750           1 :     Float_t zHLVm[5]={6.,1.,7.,8.,13.};
     751           1 :     Float_t wHLVm[5]={0.24281879711,0.00926228815,0.02574224025,0.07348667449, 0.64869};
     752             :     Float_t dHLVm = 2.0502;
     753             : 
     754             :     //SDD anode microcab
     755             : 
     756           1 :     Float_t aALVm[5]={12.0107,1.00794,14.0067,15.9994,26.981538};
     757           1 :     Float_t zALVm[5]={6.,1.,7.,8.,13.};
     758           1 :     Float_t wALVm[5]={0.392653705471,0.0128595919215,0.041626868025,0.118832707289, 0.431909};
     759             :     Float_t dALVm = 2.0502;
     760             : 
     761             :     //X7R capacitors - updated from F.Tosello's web page - M.S. 18 Oct 10
     762             : 
     763           1 :     Float_t aX7R[6]={137.327,47.867,15.9994,58.6928,63.5460,118.710};
     764           1 :     Float_t zX7R[6]={56.,22.,8.,28.,29.,50.};
     765           1 :     Float_t wX7R[6]={0.524732,0.176736,0.179282,0.079750,0.019750,0.019750};
     766             :     Float_t dX7R = 6.07914;
     767             : 
     768             :     //X7R weld, i.e. Sn 60% Pb 40% (from F.Tosello's web page - M.S. 15 Oct 10)
     769             : 
     770           1 :     Float_t aX7Rweld[2]={118.71 , 207.20};
     771           1 :     Float_t zX7Rweld[2]={ 50.   ,  82.  };
     772           1 :     Float_t wX7Rweld[2]={  0.60 ,   0.40};
     773             :     Float_t dX7Rweld   = 8.52358;
     774             : 
     775             :     // AIR
     776             : 
     777           1 :     Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
     778           1 :     Float_t zAir[4]={6.,7.,8.,18.};
     779           1 :     Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
     780             :     Float_t dAir = 1.20479E-3;
     781             : 
     782             :     // Water
     783             : 
     784           1 :     Float_t aWater[2]={1.00794,15.9994};
     785           1 :     Float_t zWater[2]={1.,8.};
     786           1 :     Float_t wWater[2]={0.111894,0.888106};
     787             :     Float_t dWater   = 1.0;
     788             : 
     789             :     // CERAMICS
     790             :   //     94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3
     791           1 :     Float_t acer[5]  = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
     792           1 :     Float_t zcer[5]  = {       13.,     8.,    14.,     25.,    24. };
     793           1 :     Float_t wcer[5]  = {.4443408,.5213375,.0130872,.0178135,.003421};
     794             :     Float_t denscer  = 3.6;
     795             : 
     796             :     //G10FR4
     797             : 
     798           1 :     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};
     799           1 :     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};
     800           1 :     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};
     801             :     Float_t densG10FR4= 1.8;
     802             :     
     803             :      //--- EPOXY  --- C18 H19 O3
     804           1 :       Float_t aEpoxy[3] = {15.9994, 1.00794, 12.0107} ; 
     805           1 :       Float_t zEpoxy[3] = {     8.,      1.,      6.} ; 
     806           1 :       Float_t wEpoxy[3] = {     3.,     19.,     18.} ; 
     807             :       Float_t dEpoxy = 1.8 ;
     808             : 
     809             :       // rohacell: C9 H13 N1 O2
     810           1 :     Float_t arohac[4] = {12.01,  1.01, 14.010, 16.};
     811           1 :     Float_t zrohac[4] = { 6.,    1.,    7.,     8.};
     812           1 :     Float_t wrohac[4] = { 14.,   10.,    2.,     6.};
     813             :     Float_t drohac    = 0.058;
     814             : 
     815             :     // If he/she means stainless steel (inox) + Aluminium and Zeff=15.3383 then
     816             : //
     817             : // %Al=81.6164 %inox=100-%Al
     818             : 
     819           1 :     Float_t aInAl[5] = {27., 55.847,51.9961,58.6934,28.0855 };
     820           1 :     Float_t zInAl[5] = {13., 26.,24.,28.,14. };
     821           1 :     Float_t wInAl[5] = {.816164, .131443,.0330906,.0183836,.000919182};
     822             :     Float_t dInAl    = 3.075;
     823             : 
     824             :     // Aluminum alloy with 12% Copper - 21 Oct 10
     825             : 
     826           1 :     Float_t aAlCu12[2] = {26.9815, 63.546};
     827           1 :     Float_t zAlCu12[2] = {13.    , 29.   };
     828           1 :     Float_t wAlCu12[2] = { 0.88  ,  0.12 };
     829             :     Float_t dAlCu12    = 2.96;
     830             : 
     831             :     // Kapton
     832             : 
     833           1 :     Float_t aKapton[4]={1.00794,12.0107, 14.010,15.9994};
     834           1 :     Float_t zKapton[4]={1.,6.,7.,8.};
     835           1 :     Float_t wKapton[4]={0.026362,0.69113,0.07327,0.209235};
     836             :     Float_t dKapton   = 1.42;
     837             :     
     838             :     // Kapton + Cu (for Pixel Bus)
     839             : 
     840           1 :     Float_t aKaptonCu[5]={1.00794, 12.0107, 14.010, 15.9994, 63.5460};
     841           1 :     Float_t zKaptonCu[5]={1., 6., 7., 8., 29.};
     842           1 :     Float_t wKaptonCuBus[5];
     843             :     
     844             :     // Kapton + Cu (for Pixel MCM)
     845             : 
     846           1 :     Float_t wKaptonCuMCM[5];
     847             :     
     848             :     // Kapton + Cu (mix of two above)
     849             : 
     850           1 :     Float_t wKaptonCuMix[5];
     851             : 
     852             :     //SDD ruby sph.
     853           1 :     Float_t aAlOxide[2]  = { 26.981539,15.9994};
     854           1 :     Float_t zAlOxide[2]  = {       13.,     8.};
     855           1 :     Float_t wAlOxide[2]  = {0.4707, 0.5293};
     856             :     Float_t dAlOxide     = 3.97;
     857             : 
     858             :     // Silica for optical fibers: Si O2
     859           1 :     Float_t aoptfib[2] = { 28.0855, 15.9994};
     860           1 :     Float_t zoptfib[2] = { 14.,      8.    };
     861           1 :     Float_t woptfib[2] = {  1.,      2.    };
     862             :     Float_t doptfib    = 2.55;
     863             : 
     864             :     // Tetrafluorethylene-Perfluorpropylene (FEP) - 08 Mar 10
     865           1 :     Float_t aFEP[2] = { 12.0107, 18.9984};
     866           1 :     Float_t zFEP[2] = {  6.    ,  9.    };
     867           1 :     Float_t wFEP[2] = {  1.    ,  2.    };
     868             :     Float_t dFEP    = 2.15;
     869             : 
     870             :     // PVC (C2H3Cl)n - 08 Jul 10
     871           1 :     Float_t aPVC[3] = { 12.0107, 1.00794, 35.4527};
     872           1 :     Float_t zPVC[3] = {  6.    , 1.     , 35.   };
     873           1 :     Float_t wPVC[3] = {  2.    , 3.     ,  1.   };
     874             :     Float_t dPVC    = 1.3;
     875             : 
     876             :     // PBT (Polybutylene terephthalate = C12-H12-O4) - 01 Sep 10
     877           1 :     Float_t aPBT[3] = { 12.0107, 1.00794, 15.9994};
     878           1 :     Float_t zPBT[3] = {  6.    , 1.     ,  8.   };
     879           1 :     Float_t wPBT[3] = { 12.    ,12.     ,  4.   };
     880             :     Float_t dPBT    = 1.31;
     881             : 
     882             :     // POLYAX (POLYAX = C37-H24-O6-N2) - 03 Sep 10
     883           1 :     Float_t aPOLYAX[4] = { 12.0107, 1.00794, 15.9994, 14.00674};
     884           1 :     Float_t zPOLYAX[4] = {  6.    , 1.     ,  8.    ,  7.     };
     885           1 :     Float_t wPOLYAX[4] = { 37.    ,24.     ,  6.    ,  2.     };
     886             :     Float_t dPOLYAX    = 1.27;
     887             : 
     888             :     // PPS (PPS = C6-H4-S) - 05 Sep 10
     889           1 :     Float_t aPPS[3] = { 12.0107, 1.00794, 32.066};
     890           1 :     Float_t zPPS[3] = {  6.    , 1.     , 16.   };
     891           1 :     Float_t wPPS[3] = {  6.    , 4.     ,  1.   };
     892             :     Float_t dPPS    = 1.35;
     893             : 
     894             :     // Megolon (Polyolefin = (C-H2)n) - 20 Oct 10
     895           1 :     Float_t aMegolon[2] = { 12.0107, 1.00794};
     896           1 :     Float_t zMegolon[2] = {  6.    , 1.     };
     897           1 :     Float_t wMegolon[2] = {  1.    , 2.     };
     898             :     Float_t dMegolon    = 1.51; // Mean of various types
     899             : 
     900             :     // Standard glass (from glassproperties.com/glasses - M.S. 21 Oct 10)
     901           1 :     Float_t aStdGlass[7] = {15.9994  ,28.0855  ,22.98977 ,40.078   ,
     902             :                             24.305   ,26.981539,39.0983  };
     903           1 :     Float_t zStdGlass[7] = { 8.      ,14.      ,11.      ,20.      ,
     904             :                             12.      ,13.      ,19.      };
     905           1 :     Float_t wStdGlass[7] = { 0.468377, 0.348239, 0.096441, 0.071469,
     906             :                              0.006030, 0.005293, 0.004151};
     907             :     Float_t dStdGlass    = 2.53;
     908             : 
     909             :     // Glass Fiber (from F.Tosello's web page - M.S. 15 Oct 10)
     910           1 :     Float_t aGlass[11] = {15.9994  ,28.0855  ,40.078   ,26.981539,10.811   ,
     911             :                 24.305   ,39.0983  ,22.98977 ,18.9984  ,47.867   ,55.845};
     912           1 :     Float_t zGlass[11] = { 8.      ,14.      ,20       ,13       , 5       ,
     913             :                 12.      ,19       ,11       , 9       ,22       ,26    };
     914           1 :     Float_t wGlass[11] = { 0.473610, 0.252415, 0.135791, 0.068803, 0.023293,
     915             :                  0.015076, 0.008301, 0.007419, 0.007000, 0.004795, 0.003497};
     916             :     Float_t dGlass = 2.61;
     917             : 
     918             :     // Ryton R-4 04 (from F.Tosello's web page - M.S. 15 Oct 10)
     919           1 :     Float_t aRyton[14] = {15.9994  ,28.0855  ,40.078   ,26.981539,10.811   ,
     920             :                           24.305   ,39.0983  ,22.98977 ,18.9984  ,47.867   ,
     921             :                           55.845   ,12.0107  , 1.00794 ,32.066   };
     922           1 :     Float_t zRyton[14] = { 8.      ,14.      ,20.      ,13.      , 5.      ,
     923             :                           12.      ,19.      ,11.      , 9.      ,22.      ,
     924             :                           26.      , 6.      , 1.      ,16.      };
     925           1 :     Float_t wRyton[14] = { 0.189445, 0.100966, 0.054316, 0.027521, 0.009317,
     926             :                            0.006030, 0.003320, 0.002968, 0.002800, 0.001918,
     927             :                            0.001399, 0.399760, 0.022365, 0.177875};
     928             :     Float_t dRyton = 1.65;
     929             : 
     930             :     // Plexiglas (Poly(methyl methacrylate) (C5O2H8)n - M.S. 05 nov 10)
     931           1 :     Float_t aPlexy[3] = { 12.0107, 15.9994,  1.00794};
     932           1 :     Float_t zPlexy[3] = {  6.    , 8.     ,  1.   };
     933           1 :     Float_t wPlexy[3] = {  5.    , 2.     ,  8.   };
     934             :     Float_t dPlexy    = 1.18;
     935             : 
     936             :     //SSD NiSn capacitor ends
     937           1 :     Float_t aNiSn[2]  = { 56.6934,118.710};
     938           1 :     Float_t zNiSn[2]  = {     28.,     50.};
     939           1 :     Float_t wNiSn[2]  = {0.33, 0.67};
     940           1 :     Float_t dNiSn     = wNiSn[0]*8.908 + wNiSn[1]*7.310;
     941             : 
     942             :     // SPD cooling capillaries (Phynox)
     943           1 :     Float_t aPhynox[5] = { 55.8450, 58.9332, 51.9961, 58.6934, 95.94 };
     944           1 :     Float_t zPhynox[5] = { 26.    , 27.    , 24.    , 28.    , 42.   };
     945           1 :     Float_t wPhynox[5] = { 0.17   , 0.40   , 0.20   , 0.16   , 0.07  };
     946             :     Float_t dPhynox    = 8.3;
     947             : 
     948           1 :     AliMaterial(1,"SI$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
     949           1 :     AliMedium(1,"SI$",1,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
     950             : 
     951           1 :     AliMaterial(2,"SPD SI CHIP$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
     952           1 :     AliMedium(2,"SPD SI CHIP$",2,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
     953             : 
     954           1 :     AliMaterial(3,"SPD SI BUS$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
     955           1 :     AliMedium(3,"SPD SI BUS$",3,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
     956             : 
     957           1 :     AliMixture(4,"C (M55J)$",aCM55J,zCM55J,dCM55J,4,wCM55J);
     958           1 :     AliMedium(4,"C (M55J)$",4,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     959             : 
     960           1 :     AliMixture(5,"AIR$",aAir,zAir,dAir,4,wAir);
     961           1 :     AliMedium(5,"AIR$",5,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
     962             : 
     963           1 :     AliMixture(6,"GEN AIR$",aAir,zAir,dAir,4,wAir);
     964           1 :     AliMedium(6,"GEN AIR$",6,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
     965             : 
     966           1 :     AliMixture(7,"SDD SI CHIP$",aSICHIP,zSICHIP,dSICHIP,6,wSICHIP);
     967           1 :     AliMedium(7,"SDD SI CHIP$",7,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
     968             : 
     969           1 :     AliMixture(8,"PHYNOX$",aPhynox,zPhynox,dPhynox,5,wPhynox);
     970           1 :     AliMedium(8,"PHYNOX$",8,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     971             : 
     972           1 :     AliMixture(9,"SDD C (M55J)$",aCM55J,zCM55J,dCM55J,4,wCM55J);
     973           1 :     AliMedium(9,"SDD C (M55J)$",9,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     974             : 
     975           1 :     AliMixture(10,"SDD AIR$",aAir,zAir,dAir,4,wAir);
     976           1 :     AliMedium(10,"SDD AIR$",10,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
     977             : 
     978           1 :     AliMaterial(11,"AL$",0.26982E+02,0.13000E+02,0.26989E+01,0.89000E+01,0.99900E+03);
     979           1 :     AliMedium(11,"AL$",11,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     980             : 
     981           1 :     AliMixture(12, "Water$",aWater,zWater,dWater,2,wWater);
     982           1 :     AliMedium(12,"WATER$",12,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     983             : 
     984           1 :     AliMixture(13,"Freon$",afre,zfre,densfre,-2,wfre);
     985           1 :     AliMedium(13,"Freon$",13,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     986             : 
     987           1 :     AliMaterial(14,"COPPER$",0.63546E+02,0.29000E+02,0.89600E+01,0.14300E+01,0.99900E+03);
     988           1 :     AliMedium(14,"COPPER$",14,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     989           1 :     AliMixture(15,"CERAMICS$",acer,zcer,denscer,5,wcer);
     990           1 :     AliMedium(15,"CERAMICS$",15,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     991             : 
     992           1 :     AliMixture(20,"SSD C (M55J)$",aCM55J,zCM55J,dCM55J,4,wCM55J);
     993           1 :     AliMedium(20,"SSD C (M55J)$",20,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
     994             : 
     995           1 :     AliMixture(21,"SSD AIR$",aAir,zAir,dAir,4,wAir);
     996           1 :     AliMedium(21,"SSD AIR$",21,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
     997             : 
     998           1 :     AliMixture(25,"G10FR4$",aG10FR4,zG10FR4,densG10FR4,14,wG10FR4);
     999           1 :     AliMedium(25,"G10FR4$",25,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1000             : 
    1001           1 :      AliMixture(26,"GEN C (M55J)$",aCM55J,zCM55J,dCM55J,4,wCM55J);
    1002           1 :     AliMedium(26,"GEN C (M55J)$",26,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1003             : 
    1004           1 :     AliMixture(27,"GEN Air$",aAir,zAir,dAir,4,wAir);
    1005           1 :     AliMedium(27,"GEN Air$",27,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
    1006             : 
    1007           1 :     AliMixture(35,"PLEXYGLAS$",aPlexy,zPlexy,dPlexy,-3,wPlexy);
    1008           1 :     AliMedium(35,"PLEXYGLAS$",35,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1009             : 
    1010           1 :     AliMixture(36,"STDGLASS$",aStdGlass,zStdGlass,dStdGlass,7,wStdGlass);
    1011           1 :     AliMedium(36,"STDGLASS$",36,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1012             : 
    1013           1 :     AliMixture(37,"ALCU12$",aAlCu12,zAlCu12,dAlCu12,2,wAlCu12);
    1014           1 :     AliMedium(37,"ALCU12$",37,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1015             : 
    1016           1 :     AliMixture(38,"MEGOLON$",aMegolon,zMegolon,dMegolon,-2,wMegolon);
    1017           1 :     AliMedium(38,"MEGOLON$",38,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1018             : 
    1019           1 :     AliMixture(39,"RYTON$",aRyton,zRyton,dRyton,14,wRyton);
    1020           1 :     AliMedium(39,"RYTON$",39,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1021             : 
    1022           1 :     AliMixture(40,"GLASS FIBER$",aGlass,zGlass,dGlass,11,wGlass);
    1023           1 :     AliMedium(40,"GLASS FIBER$",40,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1024             : 
    1025           1 :     AliMixture(41,"AISI304L$",a304L,z304L,d304L,8,w304L);
    1026           1 :     AliMedium(41,"AISI304L$",41,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1027             : 
    1028           1 :     AliMaterial(42,"NICKEL$",0.58693E+02,0.28000E+02,0.89080E+01,0.14200E+01,0.99900E+03);
    1029           1 :     AliMedium(42,"NICKEL$",42,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1030             :                
    1031           1 :     AliMixture(43,"SDD X7R weld$",aX7Rweld,zX7Rweld,dX7Rweld,2,wX7Rweld);
    1032           1 :     AliMedium(43,"SDD X7R weld$",43,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1033             : 
    1034           1 :     AliMixture(44,"PPS$",aPPS,zPPS,dPPS,-3,wPPS);
    1035           1 :     AliMedium(44,"PPS$",44,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1036             : 
    1037           1 :     AliMixture(45,"POLYAX$",aPOLYAX,zPOLYAX,dPOLYAX,-4,wPOLYAX);
    1038           1 :     AliMedium(45,"POLYAX$",45,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1039             : 
    1040           1 :     AliMixture(46,"PBT$",aPBT,zPBT,dPBT,-3,wPBT);
    1041           1 :     AliMedium(46,"PBT$",46,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1042             : 
    1043           1 :     AliMixture(47,"PVC$",aPVC,zPVC,dPVC,-3,wPVC);
    1044           1 :     AliMedium(47,"PVC$",47,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1045             : 
    1046             :     Double_t cuFrac = 0.56;
    1047             :     Double_t kFrac  = 1.0 - cuFrac;
    1048             :     Double_t cuDens = 8.96;
    1049             :     Float_t dKaptonCuBus   = cuFrac * cuDens + kFrac * dKapton;
    1050          10 :     for (Int_t j=0; j<4; j++)
    1051           4 :       wKaptonCuBus[j] = wKapton[j]*kFrac;
    1052           1 :     wKaptonCuBus[4] = cuFrac;
    1053           1 :     AliMixture(48, "SPD-BUS CU KAPTON", aKaptonCu, zKaptonCu, dKaptonCuBus, 5, wKaptonCuBus);
    1054           1 :     AliMedium(48,"SPD-BUS CU KAPTON$",48,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1055             :     
    1056             :     cuFrac = 0.5;
    1057             :     kFrac  = 1.0 - cuFrac;
    1058             :     Float_t dKaptonCuMCM   = cuFrac * cuDens + kFrac * dKapton;
    1059          10 :     for (Int_t j=0; j<4; j++)
    1060           4 :       wKaptonCuMCM[j] = wKapton[j]*kFrac;
    1061           1 :     wKaptonCuMCM[4] = cuFrac;
    1062           1 :     AliMixture(49, "SPD-MCM CU KAPTON", aKaptonCu, zKaptonCu, dKaptonCuMCM, 5, wKaptonCuMCM);
    1063           1 :     AliMedium(49,"SPD-MCM CU KAPTON$",49,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1064             :     
    1065             :     cuFrac = (0.56 + 0.5) / 2.0;
    1066             :     kFrac  = 1.0 - cuFrac;
    1067             :     Float_t dKaptonCuMix   = cuFrac * cuDens + kFrac * dKapton;
    1068          10 :     for (Int_t j=0; j<4; j++)
    1069           4 :       wKaptonCuMix[j] = wKapton[j]*kFrac;
    1070           1 :     wKaptonCuMix[4] = cuFrac;
    1071           1 :     AliMixture(50, "SPD-MIX CU KAPTON", aKaptonCu, zKaptonCu, dKaptonCuMix, 5, wKaptonCuMix);
    1072           1 :     AliMedium(50,"SPD-MIX CU KAPTON$",50,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1073             : 
    1074           1 :     AliMaterial(51,"SPD SI$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
    1075           1 :     AliMedium(51,"SPD SI$",51,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
    1076             : 
    1077           1 :     AliMaterial(52,"SPD SI CHIP$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
    1078           1 :     AliMedium(52,"SPD SI CHIP$",52,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
    1079             : 
    1080           1 :     AliMaterial(53,"SPD SI BUS$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
    1081           1 :     AliMedium(53,"SPD SI BUS$",53,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
    1082             : 
    1083           1 :     AliMixture(54,"SPD C (M55J)$",aCM55J,zCM55J,dCM55J,4,wCM55J);
    1084           1 :     AliMedium(54,"SPD C (M55J)$",54,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1085             : 
    1086           1 :     AliMixture(55,"SPD AIR$",aAir,zAir,dAir,4,wAir);
    1087           1 :     AliMedium(55,"SPD AIR$",55,0,ifield,fieldm,tmaxfdAir,stemaxAir,deemaxAir,epsilAir,stminAir);
    1088             : 
    1089           1 :     AliMixture(56, "SPD KAPTON(POLYCH2)", aKapton, zKapton, dKapton, 4, wKapton);
    1090           1 :     AliMedium(56,"SPD KAPTON(POLYCH2)$",56,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1091             : 
    1092             :     // Gaseous Freon has same chemical composition but air density at 1.7 atm
    1093           1 :     AliMixture(59,"GASEOUS FREON$",afre,zfre,1.7*dAir,-2,wfre);
    1094           1 :     AliMedium(59,"GASEOUS FREON$",59,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1095             : 
    1096           1 :     AliMixture(61,"EPOXY$",aEpoxy,zEpoxy,dEpoxy,-3,wEpoxy);
    1097           1 :     AliMedium(61,"EPOXY$",61,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1098             : 
    1099           1 :     AliMaterial(62,"SILICON$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
    1100           1 :     AliMedium(62,"SILICON$",62,0,ifield,fieldm,tmaxfdSi,stemaxSi,deemaxSi,epsilSi,stminSi);
    1101             : 
    1102           1 :     AliMixture(63, "KAPTONH(POLYCH2)", aKapton, zKapton, dKapton, 4, wKapton);
    1103           1 :     AliMedium(63,"KAPTONH(POLYCH2)$",63,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1104             : 
    1105           1 :     AliMaterial(64,"ALUMINUM$",0.26982E+02,0.13000E+02,0.26989E+01,0.89000E+01,0.99900E+03);
    1106           1 :     AliMedium(64,"ALUMINUM$",64,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1107             : 
    1108           1 :     AliMixture(65,"INOX$",aINOX,zINOX,dINOX,9,wINOX);
    1109           1 :     AliMedium(65,"INOX$",65,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1110             : 
    1111           1 :     AliMixture(66,"NiSn$",aNiSn,zNiSn,dNiSn,2,wNiSn);
    1112           1 :     AliMedium(66,"NiSn$",66,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1113             : 
    1114           1 :     AliMaterial(67,"Sn$", 118.710, 50., 7.310, 1.206, 999.);
    1115           1 :     AliMedium(67,"Sn$",67,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1116             : 
    1117           1 :     AliMixture(68,"ROHACELL$",arohac,zrohac,drohac,-4,wrohac);
    1118           1 :     AliMedium(68,"ROHACELL$",68,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1119             : 
    1120           1 :      AliMixture(69,"SDD C AL (M55J)$",aALCM55J,zALCM55J,dALCM55J,5,wALCM55J);
    1121           1 :     AliMedium(69,"SDD C AL (M55J)$",69,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1122             :   
    1123           1 :     AliMixture(70, "SDDKAPTON (POLYCH2)", aKapton, zKapton, dKapton, 4, wKapton);
    1124           1 :     AliMedium(70,"SDDKAPTON (POLYCH2)$",70,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1125             : 
    1126           1 :      AliMaterial(71,"ITS SANDW A$",0.12011E+02,0.60000E+01,0.2115E+00,0.17479E+03,0.99900E+03);
    1127           1 :     AliMedium(71,"ITS SANDW A$",71,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1128             : 
    1129           1 :     AliMaterial(72,"ITS SANDW B$",0.12011E+02,0.60000E+01,0.27000E+00,0.18956E+03,0.99900E+03);
    1130           1 :     AliMedium(72,"ITS SANDW B$",72,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1131             : 
    1132           1 :     AliMaterial(73,"ITS SANDW C$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03);
    1133           1 :     AliMedium(73,"ITS SANDW C$",73,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1134             : 
    1135           1 :     AliMaterial(74,"HEAT COND GLUE$",0.12011E+02,0.60000E+01,0.1930E+01,0.22100E+02,0.99900E+03);
    1136           1 :     AliMedium(74,"HEAT COND GLUE$",74,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1137             : 
    1138           1 :     AliMaterial(75,"ELASTO SIL$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
    1139           1 :     AliMedium(75,"ELASTO SIL$",75,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1140             : 
    1141             :     // SPD bus (data from Petra Riedler)
    1142           1 :     Float_t aSPDbus[5] = {1.00794,12.0107,14.01,15.9994,26.982 };
    1143           1 :     Float_t zSPDbus[5] = {1.,6.,7.,8.,13.};
    1144           1 :     Float_t wSPDbus[5] = {0.023523,0.318053,0.009776,0.078057,0.570591};
    1145             :     Float_t dSPDbus    = 2.128505;
    1146             : 
    1147             :     //   AliMaterial(76,"SPDBUS(AL+KPT+EPOX)$",0.19509E+02,0.96502E+01,0.19060E+01,0.15413E+02,0.99900E+03);
    1148           1 :     AliMixture(76,"SPDBUS(AL+KPT+EPOX)$",aSPDbus,zSPDbus,dSPDbus,5,wSPDbus);
    1149           1 :     AliMedium(76,"SPDBUS(AL+KPT+EPOX)$",76,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1150             :                
    1151           1 :     AliMixture(77,"SDD X7R capacitors$",aX7R,zX7R,dX7R,6,wX7R);
    1152           1 :     AliMedium(77,"SDD X7R capacitors$",77,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1153             : 
    1154           1 :     AliMixture(78,"SDD ruby sph. Al2O3$",aAlOxide,zAlOxide,dAlOxide,2,wAlOxide);
    1155           1 :     AliMedium(78,"SDD ruby sph. Al2O3$",78,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1156             : 
    1157           1 :     AliMaterial(79,"SDD SI insensitive$",0.28086E+02,0.14000E+02,0.23300E+01,0.93600E+01,0.99900E+03);
    1158           1 :     AliMedium(79,"SDD SI insensitive$",79,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1159             : 
    1160           1 :     AliMixture(80,"SDD HV microcable$",aHVm,zHVm,dHVm,5,wHVm);
    1161           1 :     AliMedium(80,"SDD HV microcable$",80,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1162             : 
    1163           1 :     AliMixture(81,"SDD LV+signal cable$",aLVm,zLVm,dLVm,5,wLVm);
    1164           1 :     AliMedium(81,"SDD LV+signal cable$",81,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1165             : 
    1166           1 :     AliMixture(82,"SDD hybrid microcab$",aHLVm, zHLVm,dHLVm,5,wHLVm);
    1167           1 :     AliMedium(82,"SDD hybrid microcab$",82,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1168             : 
    1169           1 :     AliMixture(83,"SDD anode microcab$",aALVm,zALVm,dALVm,5,wALVm);
    1170           1 :     AliMedium(83,"SDD anode microcab$",83,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1171           1 :     Float_t aDSring[4]={12.0107,      1.00794,     14.0067,      15.9994};
    1172           1 :     Float_t zDSring[4]={ 6.,          1.,           7.,           8.};
    1173           1 :     Float_t wDSring[4]={ 0.854323888, 0.026408778,  0.023050265,  0.096217069};
    1174             :     Float_t dDSring = 0.2875;
    1175           1 :     AliMixture(84,"SDD/SSD rings$",aDSring,zDSring,dDSring,4,wDSring);
    1176           1 :     AliMedium(84,"SDD/SSD rings$",84,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1177             : 
    1178           1 :     AliMixture(85,"inox/alum$",aInAl,zInAl,dInAl,5,wInAl);
    1179           1 :     AliMedium(85,"inox/alum$",85,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1180             : 
    1181             :     // special media to take into account services in the SDD and SSD 
    1182             :     // cones for the FMD
    1183             :     //Begin_Html
    1184             :     /*
    1185             :       <A HREF="http://www.Physics.ohio-state.edu/~nilsen/ITS/ITS_MatBudget_4B.xls">
    1186             :       </pre>
    1187             :       <br clear=left>
    1188             :       <font size=+2 color=blue>
    1189             :       <p> The Exel spread sheet from which these density number come from.
    1190             :       </font></A>
    1191             :     */
    1192             :     //End_Html
    1193             : 
    1194             :     //  AliMaterial(86,"AIRFMDSDD$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
    1195           1 :     Float_t aA[13],zZ[13],wW[13],den;
    1196             :     // From Pierluigi Barberis calculations of 2SPD+1SDD October 2 2002.
    1197           1 :     zZ[0] = 1.0; aA[0] = 1.00794; // Hydrogen
    1198           1 :     zZ[1] = 6.0; aA[1] = 12.011; // Carbon
    1199           1 :     zZ[2] = 7.0; aA[2] = 14.00674; // Nitrogen
    1200           1 :     zZ[3] = 8.0; aA[3] = 15.9994; // Oxigen
    1201           1 :     zZ[4] = 14.0; aA[4] = 28.0855; // Silicon
    1202           1 :     zZ[5] = 24.0; aA[5] = 51.9961; //Cromium
    1203           1 :     zZ[6] = 25.0; aA[6] = 54.938049; // Manganese
    1204           1 :     zZ[7] = 26.0; aA[7] = 55.845; // Iron
    1205           1 :     zZ[8] = 28.0; aA[8] = 58.6934; // Nickle
    1206           1 :     zZ[9] = 29.0; aA[9] = 63.546; // Copper
    1207           1 :     zZ[10] = 13.0; aA[10] = 26.981539; // Alulminum
    1208           1 :     zZ[11] = 47.0; aA[11] = 107.8682; // Silver
    1209           1 :     zZ[12] = 27.0; aA[12] = 58.9332; // Cobolt
    1210           1 :     wW[0] = 0.019965;
    1211           1 :     wW[1] = 0.340961;
    1212           1 :     wW[2] = 0.041225;
    1213           1 :     wW[3] = 0.200352;
    1214           1 :     wW[4] = 0.000386;
    1215           1 :     wW[5] = 0.001467;
    1216           1 :     wW[6] = 0.000155;
    1217           1 :     wW[7] = 0.005113;
    1218           1 :     wW[8] = 0.000993;
    1219           1 :     wW[9] = 0.381262;
    1220           1 :     wW[10] = 0.008121;
    1221           1 :     wW[11] = 0.000000;
    1222           1 :     wW[12] = 0.000000;
    1223           1 :     if(fByThick){// New values seeITS_MatBudget_4B.xls
    1224             :         den = 1.5253276; // g/cm^3  Cell O370
    1225           1 :     }else{
    1226             :         den = 2.58423412; // g/cm^3 Cell L370
    1227             :     } // end if fByThick
    1228             :     //den = 6161.7/(3671.58978);//g/cm^3 Volume does not exclude holes
    1229           1 :     AliMixture(86,"AIRFMDSDD$",aA,zZ,den,+11,wW);
    1230           1 :     AliMedium(86,"AIRFMDSDD$",86,0,ifield,fieldm,tmaxfdAir,stemaxAir,
    1231             :               deemaxAir,epsilAir,stminAir);
    1232             : 
    1233             :     //AliMaterial(87,"AIRFMDSSD$",0.14610E+02,0.73000E+01,0.12050E-02,0.30423E+05,0.99900E+03);
    1234             :     // From Pierluigi Barberis calculations of SSD October 2 2002.
    1235           1 :     wW[0] = 0.019777;
    1236           1 :     wW[1] = 0.325901;
    1237           1 :     wW[2] = 0.031848;
    1238           1 :     wW[3] = 0.147668;
    1239           1 :     wW[4] = 0.030609;
    1240           1 :     wW[5] = 0.013993;
    1241           1 :     wW[6] = 0.001479;
    1242           1 :     wW[7] = 0.048792;
    1243           1 :     wW[8] = 0.009477;
    1244           1 :     wW[9] = 0.350697;
    1245           1 :     wW[10] = 0.014546;
    1246           1 :     wW[11] = 0.005213;
    1247           1 :     wW[12] = 0.000000;
    1248           1 :     if(fByThick){// New values seeITS_MatBudget_4B.xls
    1249             :         den = 1.2464275; // g/cm^3   Cell O403
    1250           1 :     }else{
    1251             :         den = 1.28134409; // g/cm^3  Cell L403
    1252             :     } // end if fByThick
    1253             :     //den = 7666.3/(9753.553259); // volume does not exclude holes
    1254           1 :     AliMixture(87,"AIRFMDSSD$",aA,zZ,den,+12,wW); 
    1255           1 :     AliMedium(87,"AIRFMDSSD$",87,0,ifield,fieldm,tmaxfdAir,stemaxAir,
    1256             :               deemaxAir,epsilAir,stminAir);
    1257             : 
    1258             :     //AliMaterial(88,"ITS SANDW CFMDSDD$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03);
    1259             :     // From Pierluigi Barberis calculations of 1SDD+Carbon fiber October 2 2002
    1260           1 :     wW[0] = 0.016302;
    1261           1 :     wW[1] = 0.461870;
    1262           1 :     wW[2] = 0.033662;
    1263           1 :     wW[3] = 0.163595;
    1264           1 :     wW[4] = 0.000315;
    1265           1 :     wW[5] = 0.001197;
    1266           1 :     wW[6] = 0.000127;
    1267           1 :     wW[7] = 0.004175;
    1268           1 :     wW[8] = 0.000811;
    1269           1 :     wW[9] = 0.311315;
    1270           1 :     wW[10] = 0.006631;
    1271           1 :     wW[11] = 0.000000;
    1272           1 :     wW[12] = 0.000000;
    1273           1 :     if(fByThick){// New values seeITS_MatBudget_4B.xls
    1274             :         den = 1.9353276; // g/cm^3  Cell N370
    1275           1 :     }else{
    1276             :         den = 3.2788626; // g/cm^3 Cell F370
    1277             :     } // end if fByThick
    1278             :     //den = 7667.1/(3671.58978); // Volume does not excludeholes
    1279           1 :     AliMixture(88,"ITS SANDW CFMDSDD$",aA,zZ,den,+11,wW); 
    1280           1 :     AliMedium(88,"ITS SANDW CFMDSDD$",88,0,ifield,fieldm,tmaxfd,stemax,
    1281             :               deemax,epsil,stmin);
    1282             : 
    1283             :     //AliMaterial(89,"ITS SANDW CFMDSSD$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03);
    1284             :     // From Pierluigi Barberis calculations of SSD+Carbon fiber October 2 2002.
    1285           1 :     wW[0] = 0.014065;
    1286           1 :     wW[1] = 0.520598;
    1287           1 :     wW[2] = 0.022650;
    1288           1 :     wW[3] = 0.105018;
    1289           1 :     wW[4] = 0.021768;
    1290           1 :     wW[5] = 0.009952;
    1291           1 :     wW[6] = 0.001051;
    1292           1 :     wW[7] = 0.034700;
    1293           1 :     wW[8] = 0.006740;
    1294           1 :     wW[9] = 0.249406;
    1295           1 :     wW[10] = 0.010345;
    1296           1 :     wW[11] = 0.0003707;
    1297           1 :     wW[12] = 0.000000;
    1298           1 :     if(fByThick){// New values seeITS_MatBudget_4B.xls
    1299             :         den = 1.6564275; // g/cm^3  Cell N304
    1300           1 :     }else{
    1301             :         den = 1.7028296; // g/cm^3  Cell F304
    1302             :     } // end if fByThick
    1303             :     //den = 1166.5/(3671.58978); // Volume does not exclude holes
    1304           1 :     AliMixture(89,"ITS SANDW CFMDSSD$",aA,zZ,den,+12,wW); 
    1305           1 :     AliMedium(89,"ITS SANDW CFMDSSD$",89,0,ifield,fieldm,tmaxfd,stemax,
    1306             :               deemax,epsil,stmin);
    1307             : 
    1308             :     //AliMaterial(97,"SPD SERVICES$",0.12011E+02,0.60000E+01,0.41000E+00,0.90868E+02,0.99900E+03);
    1309             :     // From Pierluigi Barberis calculations of 1SPD October 2 2002.
    1310           1 :     wW[0] = 0.005970;
    1311           1 :     wW[1] = 0.304704;
    1312           1 :     wW[2] = 0.042510;
    1313           1 :     wW[3] = 0.121715;
    1314           1 :     wW[4] = 0.001118;
    1315           1 :     wW[5] = 0.030948;
    1316           1 :     wW[6] = 0.003270;
    1317           1 :     wW[7] = 0.107910;
    1318           1 :     wW[8] = 0.020960;
    1319           1 :     wW[9] = 0.360895;
    1320           1 :     wW[10] = 0.000000;
    1321           1 :     wW[11] = 0.000000;
    1322           1 :     wW[12] = 0.000000;
    1323           1 :     if(fByThick){// New values seeITS_MatBudget_4B.xls
    1324             :         den = 80.31136576; // g/cm^3 Cell H329
    1325           1 :     }else{
    1326             :         den = 87.13062; // g/cm^3  Cell G329
    1327             :     } // end if fByThick
    1328             :     //den = 1251.3/(0.05*2.0*TMath::Pi()*(7.75*7.75 - 3.7*3.7)); // g/cm^3
    1329           1 :     AliMixture(97,"SPD SERVICES$",aA,zZ,den,+10,wW); 
    1330           1 :     AliMedium(97,"SPD SERVICES$",97,0,ifield,fieldm,tmaxfd,stemax,
    1331             :               deemax,epsil,stmin);
    1332             : 
    1333             : 
    1334             :     // Special media
    1335             : 
    1336           1 :     AliMaterial(90,"SPD shield$", 12.011, 6., 1.93 , 22.36, 999);
    1337           1 :     AliMedium(90,"SPD shield$",90,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1338             : 
    1339             :     // SPD End Ladder (data from Petra Riedler)
    1340           1 :     Float_t aSPDel[5] = {1.00794,12.0107,14.01,15.9994,63.54 };
    1341           1 :     Float_t zSPDel[5] = {1.,6.,7.,8.,29.};
    1342           1 :     Float_t wSPDel[5] = {0.004092,0.107274,0.011438,0.032476,0.844719};
    1343             :     Float_t dSPDel    = 3.903403;
    1344             : 
    1345             :     //   AliMaterial(91, "SPD End ladder$", 47.0447, 21.7963, 3.6374, 4.4711, 999); 
    1346           1 :     AliMixture(91,"SPD End ladder$",aSPDel,zSPDel,dSPDel,5,wSPDel);
    1347           1 :     AliMedium(91,"SPD End ladder$",91,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1348             : 
    1349           1 :     AliMaterial(92, "SPD cone$",28.0855, 14., 2.33, 9.36, 999);    
    1350           1 :     AliMedium(92,"SPD cone$",92,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1351             :     /*  Material with fractional Z not actually used
    1352             :     AliMaterial(93, "SDD End ladder$", 69.9298, 29.8246, 0.3824, 36.5103, 999);
    1353             :     AliMedium(93,"SDD End ladder$",93,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1354             :     */
    1355           1 :     AliMaterial(94, "SDD cone$",63.546, 29., 1.15, 1.265, 999);
    1356           1 :     AliMedium(94,"SDD cone$",94,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1357             :     /* Material with fractional Z not actually used
    1358             :     AliMaterial(95, "SSD End ladder$", 32.0988, 15.4021, 0.68, 35.3238, 999); 
    1359             :     AliMedium(95,"SSD End ladder$",95,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1360             :     */
    1361           1 :     AliMaterial(96, "SSD cone$",63.546, 29., 1.15, 1.265, 999);
    1362           1 :     AliMedium(96,"SSD cone$",96,0,ifield,fieldm,tmaxfdServ,stemaxServ,deemaxServ,epsilServ,stminServ);
    1363             : 
    1364           1 :     AliMixture(98,"SDD OPTICFIB$",aoptfib,zoptfib,doptfib,-2,woptfib);
    1365           1 :     AliMedium(98,"SDD OPTICFIB$",98,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1366             : 
    1367           1 :     AliMixture(95,"SSD FEP$",aFEP,zFEP,dFEP,-2,wFEP);
    1368           1 :     AliMedium(95,"SSD FEP$",95,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1369             : 
    1370             :     // Mean material for low-voltage cables on SPD trays Side A
    1371             :     // (Copper + PolyEthylene (C2-H4)) (D.Elia for cable number and
    1372             :     // cross-section area, M.Sitta for elemental computation) - 26 Feb 10
    1373           1 :     wW[0] = 0.323024;//H
    1374           1 :     wW[2] = 0.515464;//Cu
    1375           1 :     wW[1] = 0.161512;//C
    1376           1 :     wW[3] = 0.000000;//O
    1377           1 :     wW[4] = 0.000000;//S
    1378           1 :     wW[5] = 0.000000;//F
    1379           1 :     wW[6] = 0.000000;//Sn
    1380           1 :     wW[7] = 0.000000;//Pb
    1381           1 :     wW[8] = 0.000000;//Cr
    1382           1 :     wW[9] = 0.000000;//Si
    1383           1 :     wW[10] = 0.000000;//Ni
    1384           1 :     wW[11] = 0.000000;//Ca
    1385             : 
    1386             :     den = 5.078866;
    1387           1 :     AliMixture(60,"SPD_LOWCABLES$",aA,zZ,den,+3,wW);
    1388           1 :     AliMedium(60,"SPD_LOWCABLES$",60,0,ifield,fieldm,tmaxfd,stemax,
    1389             :               deemax,epsil,stmin);
    1390             : 
    1391             :     // Mean material for high-voltage cables on SPD trays Side A & C
    1392             :     // (Copper + HD PolyEthylene (C2-H2)) (D.Elia for cable number and
    1393             :     // cross-section area, M.Sitta for elemental computation) - 10 Jun 10
    1394           1 :     wW[0] = 0.083766;//H
    1395           1 :     wW[2] = 0.417136;//Cu
    1396           1 :     wW[1] = 0.499098;//C
    1397           1 :     wW[3] = 0.000000;//O
    1398           1 :     wW[4] = 0.000000;//S
    1399           1 :     wW[5] = 0.000000;//F
    1400           1 :     wW[6] = 0.000000;//Sn
    1401           1 :     wW[7] = 0.000000;//Pb
    1402           1 :     wW[8] = 0.000000;//Cr
    1403           1 :     wW[9] = 0.000000;//Si
    1404           1 :     wW[10] = 0.000000;//Ni
    1405           1 :     wW[11] = 0.000000;//Ca
    1406             : 
    1407             :     den = 1.514930;
    1408           1 :     AliMixture(58,"SPD_HICABLES$",aA,zZ,den,+3,wW);
    1409           1 :     AliMedium(58,"SPD_HICABLES$",58,0,ifield,fieldm,tmaxfd,stemax,
    1410             :               deemax,epsil,stmin);
    1411             : 
    1412             :     // PolyUrethane [C25-H42-N2-O6] - 07 Mar 10
    1413           1 :     zZ[2] =  7.0; aA[2] =  14.0067; // Nitrogen - From Root TGeoElementTable
    1414             : 
    1415           1 :     wW[0] = 0.090724;//H
    1416           1 :     wW[2] = 0.060035;//N
    1417           1 :     wW[1] = 0.643513;//C
    1418           1 :     wW[3] = 0.205728;//O
    1419           1 :     wW[4] = 0.000000;//S
    1420           1 :     wW[5] = 0.000000;//F
    1421           1 :     wW[6] = 0.000000;//Sn
    1422           1 :     wW[7] = 0.000000;//Pb
    1423           1 :     wW[8] = 0.000000;//Cr
    1424           1 :     wW[9] = 0.000000;//Si
    1425           1 :     wW[10] = 0.000000;//Ni
    1426           1 :     wW[11] = 0.000000;//Ca
    1427             : 
    1428             :     den = 1.158910;
    1429           1 :     AliMixture(67,"POLYURETHANE$",aA,zZ,den,+4,wW);
    1430           1 :     AliMedium(67,"POLYURETHANE$",67,0,ifield,fieldm,tmaxfd,stemax,
    1431             :               deemax,epsil,stmin);
    1432             : 
    1433             :     //  POM (Polyoxymethylene = (CH2O)n ) - 02 May 10
    1434           1 :     zZ[2] =  8.0; aA[2] =  15.9994; // Oxigen
    1435             : 
    1436           1 :     wW[0] = 0.067137;//H
    1437           1 :     wW[1] = 0.400016;//C
    1438           1 :     wW[2] = 0.532847;//O
    1439           1 :     wW[3] = 0.000000;//O
    1440           1 :     wW[4] = 0.000000;//S
    1441           1 :     wW[5] = 0.000000;//F
    1442           1 :     wW[6] = 0.000000;//Sn
    1443           1 :     wW[7] = 0.000000;//Pb
    1444           1 :     wW[8] = 0.000000;//Cr
    1445           1 :     wW[9] = 0.000000;//Si
    1446           1 :     wW[10] = 0.000000;//Ni
    1447           1 :     wW[11] = 0.000000;//Ca
    1448             : 
    1449             :     den = 1.4200;
    1450           1 :     AliMixture(57,"POLYOXYMETHYLENE$",aA,zZ,den,+3,wW);
    1451           1 :     AliMedium(57,"POLYOXYMETHYLENE$",57,0,ifield,fieldm,tmaxfd,stemax,
    1452             :               deemax,epsil,stmin);
    1453             : 
    1454             : 
    1455             :     // Anticorodal (Aliminum alloy) - 08 nov 10
    1456             :     // A,Z from Root TGeoElementTable, W from Web sites
    1457           1 :     zZ[0] = 13.0; aA[0] =  26.9815; // Aluminium
    1458           1 :     zZ[1] = 29.0; aA[1] =  63.546 ; // Copper
    1459           1 :     zZ[2] = 26.0; aA[2] =  55.845 ; // Iron
    1460           1 :     zZ[3] = 25.0; aA[3] =  54.938 ; // Manganese
    1461           1 :     zZ[4] = 12.0; aA[4] =  24.305 ; // Magnesium
    1462           1 :     zZ[5] = 14.0; aA[5] =  28.0855; // Silicon
    1463           1 :     zZ[6] = 30.0; aA[6] =  65.39  ; // Zinc
    1464           1 :     zZ[7] = 24.0; aA[7] =  51.9961; // Chromium
    1465           1 :     zZ[8] = 22.0; aA[8] =  47.867 ; // Titanium
    1466             : 
    1467           1 :     wW[1] = 0.001000;//Cu
    1468           1 :     wW[2] = 0.005000;//Fe
    1469           1 :     wW[3] = 0.007000;//Mn - mean value
    1470           1 :     wW[4] = 0.009000;//Mg - mean value
    1471           1 :     wW[5] = 0.001000;//Si - mean value
    1472           1 :     wW[6] = 0.002000;//Zn
    1473           1 :     wW[7] = 0.002500;//Cr
    1474           1 :     wW[8] = 0.001000;//Ti
    1475             : 
    1476             :     Double_t totFrac = 0;
    1477          18 :     for (Int_t j=1; j<9; j++)
    1478           8 :       totFrac += wW[j];
    1479           1 :     wW[0] = 1. - totFrac;//Al - the remainder
    1480             : 
    1481             :     den = 2.69;
    1482           1 :     AliMixture(93,"ANTICORODAL$",aA,zZ,den,+9,wW);
    1483           1 :     AliMedium(93,"ANTICORODAL$",93,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1484             : 
    1485             :     // Hokotol (another Aluminium alloy) - 08 nov 10
    1486             :     // A,Z from Root TGeoElementTable, W from Web sites
    1487           1 :     zZ[0] = 13.0; aA[0] =  26.9815; // Aluminium
    1488           1 :     zZ[1] = 29.0; aA[1] =  63.546 ; // Copper
    1489           1 :     zZ[2] = 26.0; aA[2] =  55.845 ; // Iron
    1490           1 :     zZ[3] = 25.0; aA[3] =  54.938 ; // Manganese
    1491           1 :     zZ[4] = 12.0; aA[4] =  24.305 ; // Magnesium
    1492           1 :     zZ[5] = 14.0; aA[5] =  28.0855; // Silicon
    1493           1 :     zZ[6] = 30.0; aA[6] =  65.39  ; // Zinc
    1494           1 :     zZ[7] = 24.0; aA[7] =  51.9961; // Chromium
    1495           1 :     zZ[8] = 22.0; aA[8] =  47.867 ; // Titanium
    1496           1 :     zZ[9] = 40.0; aA[9] =  91.224 ; // Zirconium
    1497             : 
    1498           1 :     wW[1] = 0.020500;//Cu - mean value
    1499           1 :     wW[2] = 0.000300;//Fe
    1500           1 :     wW[3] = 0.022000;//Mn - mean value
    1501           1 :     wW[4] = 0.001000;//Mg - mean value
    1502           1 :     wW[5] = 0.002000;//Si - mean value
    1503           1 :     wW[6] = 0.066500;//Zn
    1504           1 :     wW[7] = 0.005000;//Cr
    1505           1 :     wW[8] = 0.000600;//Ti
    1506           1 :     wW[9] = 0.001650;//Zr - mean value
    1507             : 
    1508             :     totFrac = 0;
    1509          20 :     for (Int_t j=1; j<10; j++)
    1510           9 :       totFrac += wW[j];
    1511           1 :     wW[0] = 1. - totFrac;//Al - the remainder
    1512             : 
    1513             :     den = 2.69;
    1514           1 :     AliMixture(34,"HOKOTOL$",aA,zZ,den,+10,wW);
    1515           1 :     AliMedium(34,"HOKOTOL$",34,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1516             :     
    1517             :     // Ergal (7075) (yet another Aluminium alloy) - 09 nov 10
    1518             :     // A,Z from Root TGeoElementTable, W from Web sites
    1519           1 :     zZ[0] = 13.0; aA[0] =  26.9815; // Aluminium
    1520           1 :     zZ[1] = 29.0; aA[1] =  63.546 ; // Copper
    1521           1 :     zZ[2] = 26.0; aA[2] =  55.845 ; // Iron
    1522           1 :     zZ[3] = 25.0; aA[3] =  54.938 ; // Manganese
    1523           1 :     zZ[4] = 12.0; aA[4] =  24.305 ; // Magnesium
    1524           1 :     zZ[5] = 14.0; aA[5] =  28.0855; // Silicon
    1525           1 :     zZ[6] = 30.0; aA[6] =  65.39  ; // Zinc
    1526           1 :     zZ[7] = 24.0; aA[7] =  51.9961; // Chromium
    1527           1 :     zZ[8] = 22.0; aA[8] =  47.867 ; // Titanium
    1528             : 
    1529           1 :     wW[1] = 0.016000;//Cu - mean value
    1530           1 :     wW[2] = 0.005000;//Fe
    1531           1 :     wW[3] = 0.003000;//Mn
    1532           1 :     wW[4] = 0.025000;//Mg - mean value
    1533           1 :     wW[5] = 0.004000;//Si
    1534           1 :     wW[6] = 0.056000;//Zn - mean value
    1535           1 :     wW[7] = 0.002300;//Cr - mean value
    1536           1 :     wW[8] = 0.002000;//Ti
    1537             : 
    1538             :     totFrac = 0;
    1539          18 :     for (Int_t j=1; j<9; j++)
    1540           8 :       totFrac += wW[j];
    1541           1 :     wW[0] = 1. - totFrac;//Al - the remainder
    1542             : 
    1543             :     den = 2.69;
    1544           1 :     AliMixture(33,"ERGAL$",aA,zZ,den,+9,wW);
    1545           1 :     AliMedium(33,"ERGAL$",33,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1546             :     
    1547             :     // Alcoa (2024) (yet another Aluminium alloy) - 11 sep 14
    1548             :     // A,Z from Root TGeoElementTable, W from Web sites
    1549           1 :     zZ[0] = 13.0; aA[0] =  26.9815; // Aluminium
    1550           1 :     zZ[1] = 29.0; aA[1] =  63.546 ; // Copper
    1551           1 :     zZ[2] = 26.0; aA[2] =  55.845 ; // Iron
    1552           1 :     zZ[3] = 25.0; aA[3] =  54.938 ; // Manganese
    1553           1 :     zZ[4] = 12.0; aA[4] =  24.305 ; // Magnesium
    1554           1 :     zZ[5] = 14.0; aA[5] =  28.0855; // Silicon
    1555           1 :     zZ[6] = 30.0; aA[6] =  65.39  ; // Zinc
    1556           1 :     zZ[7] = 24.0; aA[7] =  51.9961; // Chromium
    1557           1 :     zZ[8] = 22.0; aA[8] =  47.867 ; // Titanium
    1558             : 
    1559           1 :     wW[1] = 0.044000;//Cu - mean value
    1560           1 :     wW[2] = 0.005000;//Fe
    1561           1 :     wW[3] = 0.006000;//Mn - mean value
    1562           1 :     wW[4] = 0.015000;//Mg - mean value
    1563           1 :     wW[5] = 0.005000;//Si
    1564           1 :     wW[6] = 0.002500;//Zn
    1565           1 :     wW[7] = 0.001000;//Cr
    1566           1 :     wW[8] = 0.001500;//Ti
    1567             : 
    1568             :     totFrac = 0;
    1569          18 :     for (Int_t j=1; j<9; j++)
    1570           8 :       totFrac += wW[j];
    1571           1 :     wW[0] = 1. - totFrac;//Al - the remainder
    1572             : 
    1573             :     den = 2.69;
    1574           1 :     AliMixture(32,"ALCOAAL$",aA,zZ,den,+9,wW);
    1575           1 :     AliMedium(32,"ALCOAAL$",32,0,ifield,fieldm,tmaxfd,stemax,deemax,epsil,stmin);
    1576             : 
    1577           1 : }
    1578             : 
    1579             : //______________________________________________________________________
    1580             : void AliITSv11::Init()
    1581             : {
    1582             :     //     Initialise the ITS after it has been created.
    1583             :     // Inputs:
    1584             :     //   none.
    1585             :     // Outputs:
    1586             :     //   none.
    1587             :     // Return:
    1588             :     //   none.
    1589             : 
    1590           2 :     UpdateInternalGeometry();
    1591           1 :     AliITS::Init();
    1592             : 
    1593           1 :     fIDMother = TVirtualMC::GetMC()->VolId("ITSV"); // ITS Mother Volume ID.
    1594           1 : }
    1595             : 
    1596             : //______________________________________________________________________
    1597             : void AliITSv11::SetDefaults()
    1598             : {
    1599             :     // sets the default segmentation, response, digit and raw cluster classes
    1600             :     // Inputs:
    1601             :     //   none.
    1602             :     // Outputs:
    1603             :     //   none.
    1604             :     // Return:
    1605             :     //   none.
    1606             : 
    1607          10 :     if(!fDetTypeSim){
    1608           0 :         Warning("SetDefaults","Error fDetTypeSim not defined");
    1609           0 :         return;
    1610             :     }
    1611             : 
    1612           5 :     fDetTypeSim->SetDefaults();
    1613             :     
    1614             : 
    1615             :     if(fgkNTYPES>3){
    1616             :         Warning("SetDefaults",
    1617             :                 "Only the four basic detector types are initialised!");
    1618             :     }// end if
    1619           5 :     return;
    1620           5 : }
    1621             : 
    1622             : //______________________________________________________________________
    1623             : void AliITSv11::StepManager()
    1624             : {
    1625             :     //    Called for every step in the ITS, then calles the AliITShit class
    1626             :     // creator with the information to be recoreded about that hit.
    1627             :     //     The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
    1628             :     // printing of information to a file which can be used to create a .det
    1629             :     // file read in by the routine CreateGeometry(). If set to 0 or any other
    1630             :     // value except 1, the default behavior, then no such file is created nor
    1631             :     // it the extra variables and the like used in the printing allocated.
    1632             :     // Inputs:
    1633             :     //   none.
    1634             :     // Outputs:
    1635             :     //   none.
    1636             :     // Return:
    1637             :     //   none.
    1638             : 
    1639      172980 :     if(!(this->IsActive())) return;
    1640       86490 :     if(!(TVirtualMC::GetMC()->TrackCharge())) return;
    1641             : 
    1642       72163 :     Int_t copy, lay = 0;
    1643       72163 :     Int_t id = TVirtualMC::GetMC()->CurrentVolID(copy);
    1644             : 
    1645             :     Bool_t notSens = kFALSE;
    1646     1433367 :     while ((lay<fIdN)  && (notSens = id != fIdSens[lay])) ++lay;
    1647      142969 :     if (notSens) return;
    1648             : 
    1649        1357 :     if(TVirtualMC::GetMC()->IsTrackExiting()) {
    1650         391 :         AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kITS);
    1651         391 :     } // if Outer ITS mother Volume
    1652             : 
    1653        2720 :     static TLorentzVector position, momentum; // Saves on calls to construtors
    1654        1360 :     static AliITShit hit;// Saves on calls to constructors
    1655             : 
    1656        1357 :     TClonesArray &lhits = *(Hits());
    1657        1357 :     Int_t   cpn0, cpn1, mod, status = 0;
    1658             :     //
    1659             :     // Track status
    1660        1847 :     if(TVirtualMC::GetMC()->IsTrackInside())      status +=  1;
    1661        1833 :     if(TVirtualMC::GetMC()->IsTrackEntering())    status +=  2;
    1662        1748 :     if(TVirtualMC::GetMC()->IsTrackExiting())     status +=  4;
    1663        1357 :     if(TVirtualMC::GetMC()->IsTrackOut())         status +=  8;
    1664        1357 :     if(TVirtualMC::GetMC()->IsTrackDisappeared()) status += 16;
    1665        1442 :     if(TVirtualMC::GetMC()->IsTrackStop())        status += 32;
    1666        2629 :     if(TVirtualMC::GetMC()->IsTrackAlive())       status += 64;
    1667             : 
    1668             :     //
    1669             :     // retrieve the indices with the volume path
    1670             :     //
    1671        1357 :     switch (lay) {
    1672             :     case 0:case 1: // SPD
    1673         220 :       TVirtualMC::GetMC()->CurrentVolOffID(1,copy); // ladder
    1674         220 :       TVirtualMC::GetMC()->CurrentVolOffID(3,cpn1); // stave
    1675         220 :       TVirtualMC::GetMC()->CurrentVolOffID(5,cpn0); // sector
    1676         220 :       break;
    1677             :     case 2:case 3: // SDD
    1678         450 :       copy = 1;
    1679         450 :       TVirtualMC::GetMC()->CurrentVolOffID(2,cpn1);
    1680         450 :       TVirtualMC::GetMC()->CurrentVolOffID(3,cpn0);
    1681         450 :       break;
    1682             :     case 4:case 5: // SSD
    1683         687 :       copy = 1;
    1684         687 :       TVirtualMC::GetMC()->CurrentVolOffID(1,cpn1);
    1685         687 :       TVirtualMC::GetMC()->CurrentVolOffID(2,cpn0);
    1686         687 :       break;
    1687             :     default:
    1688           0 :       AliError(Form("Invalid value: lay= %d . Not an ITS sensitive volume",lay));
    1689           0 :       return; // not an ITS sensitive volume.
    1690             :     } //
    1691             : 
    1692        1357 :     fInitGeom.DecodeDetector(mod,lay+1,cpn0,cpn1,copy);
    1693             :     // We should not need to pass by the switch !
    1694             :     // This is time consuming...
    1695             :     // therefore DecodeDetectorv11(...) shouldn't be private !
    1696             :     // and we should be able to use instead :
    1697             :     //fInitGeom.DecodeDetectorv11(mod,lay+1,cpn0,cpn1,copy);
    1698             : 
    1699             :     //
    1700             :     // Fill hit structure.
    1701             :     //
    1702        1357 :     hit.SetModule(mod);
    1703        1357 :     hit.SetTrack(gAlice->GetMCApp()->GetCurrentTrackNumber());
    1704        1357 :     TVirtualMC::GetMC()->TrackPosition(position);
    1705        1357 :     TVirtualMC::GetMC()->TrackMomentum(momentum);
    1706        1357 :     hit.SetPosition(position);
    1707        1357 :     hit.SetTime(TVirtualMC::GetMC()->TrackTime());
    1708        1357 :     hit.SetMomentum(momentum);
    1709        1357 :     hit.SetStatus(status);
    1710        1357 :     hit.SetEdep(TVirtualMC::GetMC()->Edep());
    1711        1357 :     hit.SetShunt(GetIshunt());
    1712        1357 :     if(TVirtualMC::GetMC()->IsTrackEntering()){
    1713         476 :         hit.SetStartPosition(position);
    1714         476 :         hit.SetStartTime(TVirtualMC::GetMC()->TrackTime());
    1715         476 :         hit.SetStartStatus(status);
    1716         476 :         return; // don't save entering hit.
    1717             :     } // end if IsEntering
    1718             :     // Fill hit structure with this new hit.
    1719             :     //Info("StepManager","Calling Copy Constructor");
    1720         881 :     new(lhits[fNhits++]) AliITShit(hit); // Use Copy Construtor.
    1721             :     // Save old position... for next hit.
    1722         881 :     hit.SetStartPosition(position);
    1723         881 :     hit.SetStartTime(TVirtualMC::GetMC()->TrackTime());
    1724         881 :     hit.SetStartStatus(status);
    1725             : 
    1726         881 :     return;
    1727      160010 : }

Generated by: LCOV version 1.11