]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSvPPRcoarseasymm.cxx
Coverity fix
[u/mrichter/AliRoot.git] / ITS / AliITSvPPRcoarseasymm.cxx
index 42fca9ed0f1b5c5c2784128819006239d8d69ce8..69101c2961b76743c53a7315fc6d6cecc3880871 100644 (file)
@@ -1,4 +1,4 @@
-/**************************************************************************
+ /**************************************************************************
  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
  *                                                                        *
  * Author: The ALICE Off-line Project.                                    *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
 
-/*
-$Log$
-Revision 1.19  2001/03/13 18:13:30  barbera
-Some mother volumes sligthly modified to eliminate an overlap with the absorber
-
-Revision 1.18  2001/02/19 09:44:16  barbera
-Copy no.2 of volume ICO2 re-inserted
-
-Revision 1.17  2001/02/09 00:05:31  nilsen
-Added fMajor/MinorVersion variables and made other changes to better make
-use of the new code changes in AliITSgeom related classes.
-
-Revision 1.16  2001/01/30 09:23:13  hristov
-Streamers removed (R.Brun)
-
-Revision 1.15  2001/01/17 07:41:29  barbera
-Some media parameters modified
-
-Revision 1.14  2001/01/15 13:13:53  barbera
-Some comments added
-
-Revision 1.13  2000/12/10 16:00:45  barbera
-Added last definition of special media like end-ladder boxes and cones
-
-Revision 1.12  2000/11/02 15:44:23  barbera
-Services on the opposite side w.r.t the absorber modified to make room for rails
-
-Revision 1.10  2000/10/27 17:19:50  barbera
-Position of rails w.r.t. the interaction point corrected.
-
-Revision 1.9  2000/10/27 13:31:29  barbera
-Rails between ITS and TPC added.
-
-Revision 1.8  2000/10/27 13:03:08  barbera
-Small changes in the SPD volumes and materials
-
-Revision 1.6  2000/10/16 14:45:37  barbera
-Mother volume ITSD modified to avoid some overlaps
-
-Revision 1.5  2000/10/16 13:49:15  barbera
-Services volumes slightly modified and material added following Pierluigi Barberis' information
-
-Revision 1.4  2000/10/07 15:33:07  barbera
-Small corrections to the ITSV mother volume
-
-Revision 1.3  2000/10/07 13:06:50  barbera
-Some new materials and media defined
-
-Revision 1.2  2000/10/07 10:58:15  barbera
-Mother volume ITSV corrected
-
-Revision 1.1  2000/10/06 23:09:24  barbera
-New coarse geometry (asymmetric services
-
-Revision 1.20  2000/10/02 21:28:08  fca
-Removal of useless dependecies via forward declarations
-
-Revision 1.19  2000/07/10 16:07:19  fca
-Release version of ITS code
-
-Revision 1.14.2.2  2000/05/19 10:09:21  nilsen
-fix for bug with HP and Sun unix + fix for event display in ITS-working branch
-
-Revision 1.14.2.1  2000/03/04 23:45:19  nilsen
-Fixed up the comments/documentation.
-
-Revision 1.14  1999/11/25 06:52:56  fca
-Correct value of drca
-
-Revision 1.13.2.1  1999/11/25 06:52:21  fca
-Correct value of drca
-
-Revision 1.13  1999/10/27 11:16:26  fca
-Correction of problem in geometry
-
-Revision 1.12  1999/10/22 08:25:25  fca
-remove double definition of destructors
-
-Revision 1.11  1999/10/22 08:16:49  fca
-Correct destructors, thanks to I.Hrivnacova
-
-Revision 1.10  1999/10/06 19:56:50  fca
-Add destructor
-
-Revision 1.9  1999/10/05 08:05:09  fca
-Minor corrections for uninitialised variables.
-
-Revision 1.8  1999/09/29 09:24:20  fca
-Introduction of the Copyright and cvs Log
-
-*/
+/* $Id$ */
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
@@ -120,32 +30,32 @@ Introduction of the Copyright and cvs Log
 // strongly encouraged to uses AliITSv5.
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
-#include <iostream.h> 
+#include <Riostream.h> 
+#include <TGeoGlobalMagField.h>
+#include <TGeoManager.h>
 #include <TMath.h>
+#include <TObjArray.h>
 #include <TRandom.h>
 #include <TVector.h>
-#include <TGeometry.h>
-#include <TNode.h>
-#include <TTUBE.h>
-#include <TFile.h>    // only required for Tracking function?
-#include <TCanvas.h>
-#include <TObjArray.h>
-#include <TClonesArray.h>
+#include <TVirtualMC.h>
 
-
-#include "AliMC.h"
 #include "AliMagF.h"
 #include "AliConst.h"
-
 #include "AliITShit.h"
 #include "AliITSvPPRcoarseasymm.h"
+#include "AliMagF.h"
 #include "AliRun.h"
 
-
 ClassImp(AliITSvPPRcoarseasymm)
  
 //_____________________________________________________________________________
-AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm() {
+AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm():
+AliITS(),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fRails(0),
+fSuppMat(0),
+fIgm(kvPPRcourseasymm) {
 ////////////////////////////////////////////////////////////////////////
 //    Standard default constructor for the ITS version 6.
 ////////////////////////////////////////////////////////////////////////
@@ -153,11 +63,15 @@ AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm() {
     fIdN = 0;
     fIdName = 0;
     fIdSens    = 0;
-    fMajorVersion = 9;
-    fMinorVersion = 0;
 }
 //_____________________________________________________________________________
-AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title) : AliITS(name, title){
+AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title) : 
+AliITS(name, title),
+fMajorVersion(IsVersion()),
+fMinorVersion(0),
+fRails(0),
+fSuppMat(0),
+fIgm(kvPPRcourseasymm) {
 ////////////////////////////////////////////////////////////////////////
 //    Standard constructor for the ITS version 6.
 ////////////////////////////////////////////////////////////////////////
@@ -172,26 +86,6 @@ AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const char *name, const char *title
     fIdName[5] = "ITS6";
     fIdSens    = new Int_t[fIdN];
     for (Int_t i=0;i<fIdN;i++) fIdSens[i]=0;
-    fMajorVersion = 9;
-    fMinorVersion = 0;
-}
-//____________________________________________________________________________
-AliITSvPPRcoarseasymm::AliITSvPPRcoarseasymm(const AliITSvPPRcoarseasymm &source){
-////////////////////////////////////////////////////////////////////////
-//     Copy Constructor for ITS version 6.
-////////////////////////////////////////////////////////////////////////
-    if(&source == this) return;
-    Warning("Copy Constructor","Not allowed to copy AliITSvPPRcoarseasymm");
-    return;
-}
-//_____________________________________________________________________________
-AliITSvPPRcoarseasymm& AliITSvPPRcoarseasymm::operator=(const AliITSvPPRcoarseasymm &source){
-////////////////////////////////////////////////////////////////////////
-//    Assignment operator for the ITS version 6.
-////////////////////////////////////////////////////////////////////////
-  if(&source == this) return *this;
-    Warning("= operator","Not allowed to copy AliITSvPPRcoarseasymm");
-  return *this;
 }
 //_____________________________________________________________________________
 AliITSvPPRcoarseasymm::~AliITSvPPRcoarseasymm() {
@@ -200,171 +94,163 @@ AliITSvPPRcoarseasymm::~AliITSvPPRcoarseasymm() {
 ////////////////////////////////////////////////////////////////////////
 }
 
-//__________________________________________________________________________
-void AliITSvPPRcoarseasymm::BuildGeometry(){
-////////////////////////////////////////////////////////////////////////
-//    Geometry builder for the ITS version 6.
-////////////////////////////////////////////////////////////////////////
-    TNode *node, *top;
-    const int kColorITS=kYellow;
-    //
-    top = gAlice->GetGeometry()->GetNode("alice");
-
-    new TTUBE("S_layer1","Layer1 of ITS","void",3.95,3.95+0.05475,12.25);
-    top->cd();
-    node = new TNode("Layer1","Layer1","S_layer1",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer2","Layer2 of ITS","void",7.,7.+0.05475,16.3);
-    top->cd();
-    node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer3","Layer3 of ITS","void",15.,15.+0.05288,21.1);
-    top->cd();
-    node = new TNode("Layer3","Layer3","S_layer3",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer4","Layer4 of ITS","void",24,24+0.05288,29.6);
-    top->cd();
-    node = new TNode("Layer4","Layer4","S_layer4",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer5","Layer5 of ITS","void",40,40+0.05382,45.1);
-    top->cd();
-    node = new TNode("Layer5","Layer5","S_layer5",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-
-    new TTUBE("S_layer6","Layer6 of ITS","void",45,45+0.05382,50.4);
-    top->cd();
-    node = new TNode("Layer6","Layer6","S_layer6",0,0,0,"");
-    node->SetLineColor(kColorITS);
-    fNodes->Add(node);
-}
 //_____________________________________________________________________________
 void AliITSvPPRcoarseasymm::CreateGeometry(){
-////////////////////////////////////////////////////////////////////////
-//    This routine defines and Creates the geometry for version 6 of the ITS.
-////////////////////////////////////////////////////////////////////////
-  
-  //INNER RADII OF THE SILICON LAYERS 
-  Float_t rl[6]    = { 3.8095,7.,15.,24.,38.1,43.5765 };   
-  //THICKNESSES OF LAYERS (in % radiation length)
-  Float_t drl[6]   = { 1.03,1.03,0.94,0.95,0.91,0.87 };   
-  //HALF LENGTHS OF LAYERS  
-  Float_t dzl[6]   = { 14.35,14.35,25.1,32.1,49.405,55.27 };
-  //LENGTHS OF END-LADDER BOXES (ALL INCLUDED)
-  Float_t dzb[6]   = { 12.4,12.4,13.5,15.,7.5,7.5 };   
-  //THICKNESSES OF END-LADDER BOXES (ALL INCLUDED)
-  Float_t drb[6]   = { rl[1]-rl[0],0.2,5.,5.,4.,4. };        
+    ////////////////////////////////////////////////////////////////////////
+    // This routine defines and Creates the geometry for version 6 of the ITS.
+    ////////////////////////////////////////////////////////////////////////
+  
+    //INNER RADII OF THE SILICON LAYERS 
+    Float_t rl[6]    = { 3.8095,7.,15.,24.,38.5,43.5765 };   
+    //THICKNESSES OF LAYERS (in % radiation length)
+    Float_t drl[6]   = { 1.03,1.03,0.94,0.95,0.91,0.87 };   
+    //HALF LENGTHS OF LAYERS  
+    Float_t dzl[6]   = { 14.35,14.35,25.1,32.1,49.405,55.27 };
+    //LENGTHS OF END-LADDER BOXES (ALL INCLUDED)
+    Float_t dzb[6]   = { 12.4,12.4,13.5,15.,7.5,7.5 };   
+    //THICKNESSES OF END-LADDER BOXES (ALL INCLUDED)
+    Float_t drb[6]   = { rl[1]-rl[0],0.2,5.,5.,4.,4. };        
 
  
-  Float_t dits[3], rlim, zmax;
-  Float_t zpos;
-  Float_t pcits[100], ztpc;
-  Int_t idrotm[1999], i;
-  Float_t dgh[100];
-  
-
-  Int_t rails = 1;       // flag for rails (1 --> rails in; 0 --> rails out)
-  
-  rails = GetRails();
-  
-  if(rails != 0 && rails != 1) {
-     cout << "WARNING: the switch for rails is not set neither to 0 (rails out) nor to 1 (rails in)." 
-     " The default value of 1 (rails in) will be used." << endl;
-       
-  }  
-  
-  if(rails == 0 ) {
-     cout << "Rails are out." << endl; 
-  } else {
-     cout << "Rails are in." << endl;
-  }      
-    
-
-  Int_t *idtmed = fIdtmed->GetArray()-199;
-  
-  //     CONVERT INTO CM (RL(SI)=9.36 CM) 
-  for (i = 0; i < 6; ++i) {
-    drl[i] = drl[i] / 100. * 9.36;
-  }
+    Float_t dits[3], rlim, zmax;
+    Float_t zpos;
+    Float_t pcits[100], ztpc;
+    Int_t idrotm[1999], i;
+    Float_t dgh[100];
+  
+    Int_t rails = 1;       // flag for rails (1 --> rails in; 0 --> rails out)
+    Int_t suppmat = 0;     // flag to change the material of the services
+                           // supports (=0 copper, =1 aluminum, =2 carbon)
+    // These constant character strings are set by cvs during commit
+    // do not change them unless you know what you are doing!
+    const Char_t *cvsDate="$Date$";
+    const Char_t *cvsRevision="$Revision$";
+    rails = GetRails();
+  
+    if(rails != 0 && rails != 1) {
+        cout << "ITS - WARNING: the switch for rails is not set "
+            "neither to 0 (rails out) nor to 1 (rails in)." 
+            " The default value of 1 (rails in) will be used." << endl;
+    }  // end if
+  
+    if (rails == 0 ) {
+        cout << "ITS: Rails are out." << endl; 
+    } else {
+        cout << "ITS: Rails are in." << endl;
+    } // end if 
+    suppmat = GetSupportMaterial();   
+  
+    if (suppmat != 0 && suppmat != 1 && suppmat != 2) {
+        cout << "ITS - WARNING: the flag for the material of "
+            "services supports is not set neither to 0 (copper) "
+            "nor to 1 (aluminum) nor to 2 (carbon)." 
+            " The default value of 0 (copper) will be used." << endl;
+    }   // end if
+  
+    if (suppmat == 0) {
+        cout << "ITS: The material of the services supports is copper." 
+             << endl; 
+    } else if (suppmat == 1){
+        cout << "ITS: The material of the services supports is aluminum." 
+             << endl;
+    } else {
+        cout << "ITS: The material of the services supports is carbon." 
+             << endl;
+    } // end if
+      
+
+    Int_t *idtmed = fIdtmed->GetArray()-199;
+  
+    //     CONVERT INTO CM (RL(SI)=9.36 CM) 
+    for (i = 0; i < 6; ++i) {
+        drl[i] = drl[i] / 100. * 9.36;
+    } // end if
     
-  //     FIELD CAGE HALF LENGTH 
-  
-  rlim  = 56.;
-  zmax  = 74.;
-  ztpc = 284.;
-  
-  // --- Define ghost volume containing the whole ITS (including services) 
-  //     and fill it with air 
-  
-  dgh[0] = 0.;
-  dgh[1] = 360.;
-  dgh[2] = 16.;
-  dgh[3] = -ztpc-5.-0.1;
-  dgh[4] = 46;   
-  dgh[5] = 85.;
-  dgh[6] = -ztpc;
-  dgh[7] = 46;   
-  dgh[8] = 85.;
-  dgh[9] = -ztpc;
-  dgh[10] = 46;  
-  dgh[11] = rlim+0.1;
-  dgh[12] = -97.5;
-  dgh[13] = 46;  
-  dgh[14] = rlim+0.1;
-  dgh[15] = -zmax;
-  dgh[16] = 46;  
-  dgh[17] = rlim+0.1;
-  dgh[18] = -48;   
-  dgh[19] = 6;
-  dgh[20] = rlim+0.1;
-  dgh[21] = -28.6;   
-  dgh[22] = 6;
-  dgh[23] = rlim+0.1;    
-  dgh[24] = -27.6;  
-  dgh[25] = 3.295;
-  dgh[26] = rlim+0.1; 
-  dgh[27] = 27.6;   
-  dgh[28] = 3.295;
-  dgh[29] = rlim+0.1;
-  dgh[30] = 28.6;   
-  dgh[31] = 6;
-  dgh[32] = rlim+0.1;
-  dgh[33] = 48;   
-  dgh[34] = 6;
-  dgh[35] = rlim+0.1;  
-  dgh[36] = zmax;
-  dgh[37] = 46;
-  dgh[38] = rlim+0.1;
-  dgh[39] = 97.5;
-  dgh[40] = 46;  
-  dgh[41] = rlim+0.1;
-  dgh[42] = ztpc;
-  dgh[43] = 62;     
-  dgh[44] = 62+4.;  
-  dgh[45] = ztpc;
-  dgh[46] = 62;     
-  dgh[47] = 85.;
-  dgh[48] = ztpc+4.+0.1;
-  dgh[49] = 62.4;
-  dgh[50] = 85.;
-  gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 51);
-  
-  // --- Place the ghost volume in its mother volume (ALIC) and make it 
-  //     invisible 
-  
-  gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
-  //gMC->Gsatt("ITSV", "SEEN", 0); 
-
-
-  // --- Define ghost volume containing the six layers and fill it with air 
+    //     FIELD CAGE HALF LENGTH 
+  
+    rlim  = 50.;
+    zmax  = 74.;
+    ztpc = 284.;
+  
+    // --- Define ghost volume containing the whole ITS (including services) 
+    //     and fill it with air 
+    /*
+    dgh[0] = 0.;
+    dgh[1] = 360.;
+    dgh[2] = 16.;
+    dgh[3] = -ztpc-5.-0.1;
+    dgh[4] = 46;   
+    dgh[5] = 85.;
+    dgh[6] = -ztpc;
+    dgh[7] = 46;   
+    dgh[8] = 85.;
+    dgh[9] = -ztpc;
+    dgh[10] = 46;  
+    dgh[11] = rlim+6;
+    dgh[12] = -97.5;
+    dgh[13] = 46;  
+    dgh[14] = rlim+6;
+    dgh[15] = -zmax;
+    dgh[16] = 46;  
+    dgh[17] = rlim+6;
+    dgh[18] = -48;   
+    dgh[19] = 6;
+    dgh[20] = rlim+6;
+    dgh[21] = -28.6;   
+    dgh[22] = 6;
+    dgh[23] = rlim+6;    
+    dgh[24] = -27.6;  
+    dgh[25] = 3.295;
+    dgh[26] = rlim+6; 
+    dgh[27] = 27.6;   
+    dgh[28] = 3.295;
+    dgh[29] = rlim+6;
+    dgh[30] = 28.6;   
+    dgh[31] = 6;
+    dgh[32] = rlim+6;
+    dgh[33] = 48;   
+    dgh[34] = 6;
+    dgh[35] = rlim+6;  
+    dgh[36] = zmax;
+    dgh[37] = 46;
+    dgh[38] = rlim+6;
+    dgh[39] = 97.5;
+    dgh[40] = 46;  
+    dgh[41] = rlim+6;
+    dgh[42] = ztpc;
+    dgh[43] = 62;     
+    dgh[44] = 62+4.;  
+    dgh[45] = ztpc;
+    dgh[46] = 62;     
+    dgh[47] = 85.;
+    dgh[48] = ztpc+4.+0.1;
+    dgh[49] = 62.4;
+    dgh[50] = 85.;
+    gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 51);
+  
+    // --- Place the ghost volume in its mother volume (ALIC) and make it 
+    //     invisible 
+  
+    gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
+    //gMC->Gsatt("ITSV", "SEEN", 0);
+    */
+    TGeoVolumeAssembly *itsV = gGeoManager->MakeVolumeAssembly("ITSV");
+    const Int_t length=100;
+    Char_t vstrng[length];
+    if(fIgm.WriteVersionString(vstrng,length,(AliITSVersion_t)IsVersion(),
+                               fMinorVersion,cvsDate,cvsRevision))
+        itsV->SetTitle(vstrng);
+
+    TGeoVolume *alic = gGeoManager->GetVolume("ALIC");
+    if(alic==0) {
+        Error("CreateGeometry","alic=0");
+        return;
+    } // end if
+    // See idrotm[199] for angle definitions.
+    //alic->AddNode(itsV,1,new TGeoRotation("", 90.,180., 90.,90., 180.,0.));
+    alic->AddNode(itsV,1,0);
+
+    // --- Define ghost volume containing the six layers and fill it with air 
   
   dgh[0] = 0.;
   dgh[1] = 360.;
@@ -537,35 +423,98 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
 
   
   // --- DEFINE CABLES AT THE END OF THE ITS CONES - COPPER PART
+  //     UPPER PART
   
   dgh[0] = 46.;    
   dgh[1] = 46.+1.0;  
   dgh[2] = 9.5;
+  dgh[3] = 12.;
+  dgh[4] = 168.;
+  
+  if (suppmat == 0) {
+     gMC->Gsvolu("I1CU", "TUBS", idtmed[279], dgh, 5);    // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("I1CU", "TUBS", idtmed[285], dgh, 5);    // aluminum
+  } else {
+     gMC->Gsvolu("I1CU", "TUBS", idtmed[274], dgh, 5);    // carbon
+  }     
+  gMC->Gspos("I1CU", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
+  gMC->Gspos("I1CU", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");
+  
+  // --- DEFINE CABLES AT THE END OF THE ITS CONES - COPPER PART
+  //     LOWER PART
   
-  gMC->Gsvolu("ICCU", "TUBE", idtmed[279], dgh, 3);  
-  gMC->Gspos("ICCU", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
-  gMC->Gspos("ICCU", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");
+  dgh[0] = 46.;    
+  dgh[1] = 46.+1.0;  
+  dgh[2] = 9.5;
+  dgh[3] = 192.;
+  dgh[4] = 348.;
   
+  if (suppmat == 0) {
+     gMC->Gsvolu("I2CU", "TUBS", idtmed[279], dgh, 5);    // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("I2CU", "TUBS", idtmed[285], dgh, 5);    // aluminum
+  } else {
+     gMC->Gsvolu("I2CU", "TUBS", idtmed[274], dgh, 5);    // carbon
+  }     
+  gMC->Gspos("I2CU", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
+  gMC->Gspos("I2CU", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");
+
+
   // --- DEFINE CABLES AT THE END OF THE ITS CONES - CARBON PART
+  //     UPPER PART
   
   dgh[0] = 46.+1.0;  
   dgh[1] = 46.+1.0+1.5;   
   dgh[2] = 9.5;
+  dgh[3] = 12.;
+  dgh[4] = 168.;
   
-  gMC->Gsvolu("ICCC", "TUBE", idtmed[274], dgh, 3);  
-  gMC->Gspos("ICCC", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
-  gMC->Gspos("ICCC", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");  
+  gMC->Gsvolu("I1CC", "TUBS", idtmed[274], dgh, 5);  
+  gMC->Gspos("I1CC", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
+  gMC->Gspos("I1CC", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");  
   
-  // --- DEFINE PATCH PANELS AT THE END OF THE ITS CONES
+  // --- DEFINE CABLES AT THE END OF THE ITS CONES - CARBON PART
+  //     LOWER PART
+  
+  dgh[0] = 46.+1.0;  
+  dgh[1] = 46.+1.0+1.5;   
+  dgh[2] = 9.5;
+  dgh[3] = 192.;
+  dgh[4] = 348.;
   
+  gMC->Gsvolu("I2CC", "TUBS", idtmed[274], dgh, 5);  
+  gMC->Gspos("I2CC", 1, "ITSV", 0., 0., 83.5, 0, "ONLY");
+  gMC->Gspos("I2CC", 2, "ITSV", 0., 0., -83.5, idrotm[200], "ONLY");  
+
+  // --- DEFINE PATCH PANELS AT THE END OF THE ITS CONES
+  //    UPPER PART
+    
   dgh[0] = 46.;  
   dgh[1] = 56.;
   dgh[2] = 2.25;
+  dgh[3] = 12.;
+  dgh[4] = 168.;
   
-  gMC->Gsvolu("IPAN", "TUBE", idtmed[285], dgh, 3);  
-  gMC->Gspos("IPAN", 1, "ITSV", 0., 0., 95.25, 0, "ONLY");  
-  gMC->Gspos("IPAN", 2, "ITSV", 0., 0., -95.25, idrotm[200], "ONLY"); 
+  gMC->Gsvolu("IPA1", "TUBS", idtmed[285], dgh, 5);  
+  gMC->Gspos("IPA1", 1, "ITSV", 0., 0., 95.25, 0, "ONLY");  
+  gMC->Gspos("IPA1", 2, "ITSV", 0., 0., -95.25, idrotm[200], "ONLY"); 
+
+
+  // --- DEFINE PATCH PANELS AT THE END OF THE ITS CONES
+  //     LOWER PART
+    
+  dgh[0] = 46.;  
+  dgh[1] = 56.;
+  dgh[2] = 2.25;
+  dgh[3] = 192.;
+  dgh[4] = 348.;
   
+  gMC->Gsvolu("IPA2", "TUBS", idtmed[285], dgh, 5);  
+  gMC->Gspos("IPA2", 1, "ITSV", 0., 0., 95.25, 0, "ONLY");  
+  gMC->Gspos("IPA2", 2, "ITSV", 0., 0., -95.25, idrotm[200], "ONLY"); 
+
+
   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE ABSORBER SIDE - COPPER PART
   //     UPPER PART
   
@@ -576,7 +525,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[4] = 62.3+1.0;   
   dgh[5] = 12.;    
   dgh[6] = 168.;
-  gMC->Gsvolu("ICU1", "CONS", idtmed[279], dgh, 7);    
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU1", "CONS", idtmed[279], dgh, 7);    // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU1", "CONS", idtmed[285], dgh, 7);    // aluminum  
+  } else {
+     gMC->Gsvolu("ICU1", "CONS", idtmed[274], dgh, 7);    // carbon
+  }
   gMC->Gspos("ICU1", 1, "ITSV", 0., 0., 97.5+dgh[0], 0, "ONLY");   
   
   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE ABSORBER SIDE - COPPER PART
@@ -589,7 +544,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[4] = 62.3+1.0;  
   dgh[5] = 192.;    
   dgh[6] = 348.;
-  gMC->Gsvolu("ICU2", "CONS", idtmed[279], dgh, 7);    
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU2", "CONS", idtmed[279], dgh, 7);    // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU2", "CONS", idtmed[285], dgh, 7);    // aluminum  
+  } else {
+     gMC->Gsvolu("ICU2", "CONS", idtmed[274], dgh, 7);    // carbon
+  }
   gMC->Gspos("ICU2", 1, "ITSV", 0., 0., 97.5+dgh[0], 0, "ONLY");  
 
 
@@ -627,7 +588,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[2] = 0.5;
   dgh[3] = 12.;
   dgh[4] = 168.;
-  gMC->Gsvolu("ICU3", "TUBS", idtmed[279], dgh, 5);    
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU3", "TUBS", idtmed[279], dgh, 5);    // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU3", "TUBS", idtmed[285], dgh, 5);    // aluminum
+  } else {
+     gMC->Gsvolu("ICU3", "TUBS", idtmed[274], dgh, 5);    // carbon
+    }
   gMC->Gspos("ICU3", 1, "ITSV", 0., 0., ztpc+1.5+dgh[2], 0, "ONLY");  
 
   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON THE ABSORBER SIDE - COPPER PART
@@ -638,7 +605,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[2] = 0.5;
   dgh[3] = 192.;
   dgh[4] = 348.;
-  gMC->Gsvolu("ICU4", "TUBS", idtmed[279], dgh, 5);    
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU4", "TUBS", idtmed[279], dgh, 5);    // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU4", "TUBS", idtmed[285], dgh, 5);    // aluminum
+  } else {
+     gMC->Gsvolu("ICU4", "TUBS", idtmed[274], dgh, 5);    // carbon
+  }
   gMC->Gspos("ICU4", 1, "ITSV", 0., 0., ztpc+1.5+dgh[2], 0, "ONLY");     
      
   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON THE ABSORBER SIDE - CARBON PART
@@ -671,7 +644,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[2] = (ztpc-97.5+1.5)/2.;
   dgh[3] = 12.;
   dgh[4] = 168.;
-  gMC->Gsvolu("ICU5", "TUBS", idtmed[279], dgh, 5);   
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU5", "TUBS", idtmed[279], dgh, 5);   // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU5", "TUBS", idtmed[285], dgh, 5);   // aluminum
+  } else {
+     gMC->Gsvolu("ICU5", "TUBS", idtmed[274], dgh, 5);   // carbon
+  }
   gMC->Gspos("ICU5", 1, "ITSV", 0., 0., -97.5-dgh[2], 0, "ONLY");  
   
   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE OTHER SIDE W.R.T.
@@ -682,7 +661,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[2] = (ztpc-97.5+1.5)/2.;
   dgh[3] = 192.;
   dgh[4] = 348.;  
-  gMC->Gsvolu("ICU6", "TUBS", idtmed[279], dgh, 5);   
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU6", "TUBS", idtmed[279], dgh, 5);   // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU6", "TUBS", idtmed[285], dgh, 5);   // aluminum
+  } else {
+     gMC->Gsvolu("ICU6", "TUBS", idtmed[274], dgh, 5);   // carbon
+  }
   gMC->Gspos("ICU6", 1, "ITSV", 0., 0., -97.5-dgh[2], 0, "ONLY");    
   
   // --- DEFINE CABLES/COOLING BELOW THE TPC ON THE OTHER SIDE W.R.T.
@@ -715,7 +700,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[2] = 0.5;
   dgh[3] = 12.;
   dgh[4] = 168.;  
-  gMC->Gsvolu("ICU7", "TUBS", idtmed[279], dgh, 5);   
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU7", "TUBS", idtmed[279], dgh, 5);   // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU7", "TUBS", idtmed[285], dgh, 5);   // aluminum
+  } else {
+     gMC->Gsvolu("ICU7", "TUBS", idtmed[274], dgh, 5);   // carbon
+  }
   gMC->Gspos("ICU7", 1, "ITSV", 0., 0., -(ztpc+1.5+dgh[2]), 0, "ONLY");  
   
   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON OTHER SIDE W.R.T. THE ABSORBER
@@ -726,7 +717,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[2] = 0.5;
   dgh[3] = 192.;
   dgh[4] = 348.;   
-  gMC->Gsvolu("ICU8", "TUBS", idtmed[279], dgh, 5);   
+  if (suppmat == 0) {
+     gMC->Gsvolu("ICU8", "TUBS", idtmed[279], dgh, 5);   // copper
+  } else if (suppmat == 1) {
+     gMC->Gsvolu("ICU8", "TUBS", idtmed[285], dgh, 5);   // aluminum
+  } else {
+     gMC->Gsvolu("ICU8", "TUBS", idtmed[274], dgh, 5);   // carbon
+  }
   gMC->Gspos("ICU8", 1, "ITSV", 0., 0., -(ztpc+1.5+dgh[2]), 0, "ONLY");      
     
   // --- DEFINE CABLES/COOLING BEHIND THE TPC ON OTHER SIDE W.R.T. THE ABSORBER
@@ -778,13 +775,13 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
      dgh[0] = 2.;          
      dgh[1] = 8.;           
      dgh[2] = 190.;         
-     gMC->Gsvolu("IRA1", "BOX ", idtmed[285], dgh, 3);
+     gMC->Gsvolu("IRA1", "BOX ", idtmed[239], dgh, 3);
      gMC->Gspos("IRA1", 1, "ITSV", 53.5, 0., -69.5, 0, "ONLY");   
-     gMC->Gsvolu("IRA2", "BOX ", idtmed[285], dgh, 3);    
+     gMC->Gsvolu("IRA2", "BOX ", idtmed[239], dgh, 3);    
      gMC->Gspos("IRA2", 1, "ITSV", -53.5, 0., -69.5, 0, "ONLY");    
 
-     dgh[0] = 2.-0.5531;    // 0.5531 was determined in such a way that the aluminum area is 20.9 cm^2      
-     dgh[1] = 8.-0.5531;    // 0.5531 was determined in such a way that the aluminum area is 20.9 cm^2       
+     dgh[0] = 2.-0.5;    // 0.5 was determined in such a way that the aluminum area is 20.9 cm^2      
+     dgh[1] = 8.-0.5;    // 0.5 was determined in such a way that the aluminum area is 20.9 cm^2       
      dgh[2] = 190.;         
      gMC->Gsvolu("IRA3", "BOX ", idtmed[275], dgh, 3);   
      gMC->Gspos("IRA3", 1, "IRA1", 0., 0., 0., 0, "ONLY");   
@@ -799,8 +796,8 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[1] = 59.;
   dgh[2] = 0.6;    
   gMC->Gsvolu("ICYL", "TUBE", idtmed[285], dgh, 3);   
-  gMC->Gspos("ICYL", 1, "ALIC", 0., 0., 73.4, 0, "ONLY");       
-  gMC->Gspos("ICYL", 2, "ALIC", 0., 0., -73.4, idrotm[200], "ONLY");  
+  gMC->Gspos("ICYL", 1, "ALIC", 0., 0., 74.1, 0, "ONLY");       
+  gMC->Gspos("ICYL", 2, "ALIC", 0., 0., -74.1, idrotm[200], "ONLY");  
 
   // --- DEFINE SUPPORTS FOR RAILS ATTACHED TO THE CYLINDERS
 
@@ -808,14 +805,14 @@ void AliITSvPPRcoarseasymm::CreateGeometry(){
   dgh[1] = 3.;         
   dgh[2] = 5.;  // 5. comes from the fact that the volume has to be 567.6/2 cm^3       
   gMC->Gsvolu("ISR1", "TUBE", idtmed[286], dgh, 3);   
-  gMC->Gspos("ISR1", 1, "ALIC", 54.9, 11., 79.5, 0, "ONLY");   
-  gMC->Gspos("ISR1", 2, "ALIC", 54.9, -11., 79.5, 0, "ONLY");   
-  gMC->Gspos("ISR1", 3, "ALIC", -54.9, 11., 79.5, 0, "ONLY"); 
-  gMC->Gspos("ISR1", 4, "ALIC", -54.9, -11., 79.5, 0, "ONLY");  
-  gMC->Gspos("ISR1", 5, "ALIC", 54.9, 11., -79.5, 0, "ONLY");   
-  gMC->Gspos("ISR1", 6, "ALIC", 54.9, -11., -79.5, 0, "ONLY");   
-  gMC->Gspos("ISR1", 7, "ALIC", -54.9, 11., -79.5, 0, "ONLY"); 
-  gMC->Gspos("ISR1", 8, "ALIC", -54.9, -11., -79.5, 0, "ONLY");         
+  gMC->Gspos("ISR1", 1, "ITSV", 53.4292, 10.7053, 79.75, 0, "ONLY");    
+  gMC->Gspos("ISR1", 2, "ITSV", 53.4292, -10.7053, 79.75, 0, "ONLY");   
+  gMC->Gspos("ISR1", 3, "ITSV", -53.4292, 10.7053, 79.75, 0, "ONLY"); 
+  gMC->Gspos("ISR1", 4, "ITSV", -53.4292, -10.7053, 79.75, 0, "ONLY");  
+  gMC->Gspos("ISR1", 5, "ITSV", 53.4292, 10.7053, -79.75, 0, "ONLY");   
+  gMC->Gspos("ISR1", 6, "ITSV", 53.4292, -10.7053, -79.75, 0, "ONLY");   
+  gMC->Gspos("ISR1", 7, "ITSV", -53.4292, 10.7053, -79.75, 0, "ONLY"); 
+  gMC->Gspos("ISR1", 8, "ITSV", -53.4292, -10.7053, -79.75, 0, "ONLY");         
   
   // --- DEFINE SUPPORTS FOR RAILS ATTACHED TO THE ABSORBER
 
@@ -861,7 +858,7 @@ void AliITSvPPRcoarseasymm::CreateMaterials(){
   // Monte Carlo simulations for the geometries AliITSv1, AliITSv3,
   // AliITSvPPRcoarseasymm.
   // In general it is automatically replaced by
-  // the CreatMaterials routine defined in AliITSv?. Should the function
+  // the CreateMaterials routine defined in AliITSv?. Should the function
   // CreateMaterials not exist for the geometry version you are using this
   // one is used. See the definition found in AliITSv5 or the other routine
   // for a complete definition.
@@ -903,8 +900,8 @@ void AliITSvPPRcoarseasymm::CreateMaterials(){
   Float_t wsteel[4] = { .715,.18,.1,.005 };
   
   
-  Int_t  isxfld  = gAlice->Field()->Integ();
-  Float_t sxmgmx = gAlice->Field()->Max();
+  Int_t  isxfld  = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
+  Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
   
   
   // --- Define the various materials for GEANT --- 
@@ -962,7 +959,8 @@ void AliITSvPPRcoarseasymm::CreateMaterials(){
   AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
   AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
   AliMaterial(38, "SDD End ladder$", 69.9298, 29.8246, 0.3824, 36.5103, 999.); 
-  AliMaterial(39, "SDD cone$",63.546, 29., 1.15, 1.265, 999.);       
+  AliMaterial(39, "SDD cone$",63.546, 29., 1.15, 1.265, 999.);   
+  AliMaterial(40, "SDD M55J$",12.3565, 6.4561, 1.8097, 22.9570, 999.);         
   //AliMaterial(38, "SDD End ladder$", 69.9298, 29.8246, -0.3824, -36.5103, 999.); 
   //AliMaterial(39, "SDD cone$",63.546, 29., -1.15, -1.265, 999.);       
 
@@ -983,7 +981,7 @@ void AliITSvPPRcoarseasymm::CreateMaterials(){
   AliMedium(37, "SDD Kapton$",    37, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
   AliMedium(38, "SDD End ladder$",38, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
   AliMedium(39, "SDD cone$",      39, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
-  
+  AliMedium(40, "SDD M55J$",      40, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);  
   //  250-274 --> Silicon Strip Detectors (detectors, chips, buses, cooling,..)
   
   AliMaterial(50, "SSD Si$",      28.0855, 14., 2.33, 9.36, 999.);
@@ -1090,7 +1088,7 @@ void AliITSvPPRcoarseasymm::Init(){
 }  
  
 //_____________________________________________________________________________
-void AliITSvPPRcoarseasymm::DrawModule(){
+void AliITSvPPRcoarseasymm::DrawModule() const {
 ////////////////////////////////////////////////////////////////////////
 //     Draw a shaded view of the FMD version 6.
 ////////////////////////////////////////////////////////////////////////
@@ -1213,7 +1211,7 @@ void AliITSvPPRcoarseasymm::StepManager(){
     hits[5]=momentum[2];
     hits[6]=gMC->Edep();
     hits[7]=gMC->TrackTime();
-//    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
+//    new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->GetMCApp()->GetCurrentTrackNumber(),vol,hits);
 //
 // no hits for this coarse asymmetric version.
 //