]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSv3.cxx
More exact rounding function, but also much slower.
[u/mrichter/AliRoot.git] / ITS / AliITSv3.cxx
index 853b10522bfa084830bd5ae95875a9ea77bb9e55..0900313a5632f2e2abbfe35098ab914442f27058 100644 (file)
-///////////////////////////////////////////////////////////////////////////////
-//                                                                           //
-//  Inner Traking System version 3                                           //
-//                                                                           //
-//Begin_Html
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
 /*
-<img src="picts/AliITSv3Class.gif">
-</pre>
-<br clear=left>
-<font size=+2 color=red>
-<p>The responsible person for this module is
-<a href="mailto:roberto.barbera@ct.infn.it">Roberto Barbera</a>.
-</font>
-<pre>
+$Log$
+Revision 1.21  2000/11/30 11:13:11  barbera
+ Added changes suggested by Federico Carminati on nov, 30, 2000
+
+Revision 1.20  2000/10/07 17:29:51  nilsen
+Blank Line added at end of file to remove a warning for hp compilers
+(Give me a Break!).
+
+Revision 1.19  2000/10/05 20:49:59  nilsen
+Now using root generated streamers.
+
+Revision 1.11.4.10  2000/07/31 13:50:51  barbera
+Updated from the release
+
+Revision 1.17  2000/07/10 16:07:19  fca
+Release version of ITS code
+
+Revision 1.11.4.4  2000/05/19 10:09:51  nilsen
+fix for bug with HP and Sun unix + fix for event display in ITS-working branch
+
+Revision 1.11.4.3  2000/04/04 14:18:03  nilsen
+Fixed volume error with vomule SFR5. Loop positioning this volume is now from
+<=23 (was <=24). This may not be the final version.
+
+Revision 1.11.4.2  2000/03/04 23:46:02  nilsen
+Fixed up the comments/documentation.
+
+Revision 1.11.4.1  2000/01/12 19:03:33  nilsen
+This is the version of the files after the merging done in December 1999.
+See the ReadMe110100.txt file for details
+
+Revision 1.11  1999/10/22 08:25:25  fca
+remove double definition of destructors
+
+Revision 1.10  1999/10/22 08:16:49  fca
+Correct destructors, thanks to I.Hrivnacova
+
+Revision 1.9  1999/10/06 19:56:50  fca
+Add destructor
+
+Revision 1.8  1999/10/05 08:05:09  fca
+Minor corrections for uninitialised variables.
+
+Revision 1.7  1999/09/29 09:24:20  fca
+Introduction of the Copyright and cvs Log
+
 */
-//End_Html
-//                                                                           //
+
 ///////////////////////////////////////////////////////////////////////////////
+//
+//  Inner Traking System version 3
+//  This class contains the base procedures for the Inner Tracking System
+//
+// Authors: R. Barbera, A. Morsch.
+// version 3.
+// Created  1998.
+//
+//  NOTE: THIS IS THE OLD detailed TP-like geometry of the ITS. THIS WILL NOT 
+// WORK with the geometry or module classes or any analysis classes. You are 
+// strongly encouraged to uses AliITSv5.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+// See AliITSv3::StepManager().
+#define ALIITSPRINTGEOM 0 // default. don't print out gemetry information
+//#define ALIITSPRINTGEOM 1 // print out geometry information
+
 #include <TMath.h>
 #include <TRandom.h>
 #include <TVector.h>
-#include "AliITSv3.h"
-#include "AliRun.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 <TObjString.h>
+#include <TClonesArray.h>
+#include <TLorentzVector.h>
+#include <TMath.h>
+
 
 #include "AliMC.h"
 #include "AliConst.h"
+#include "AliMagF.h"
+
+#include "AliITShit.h"
+#include "AliITSv3.h"
+#include "AliRun.h"
 
 ClassImp(AliITSv3)
  
 //_____________________________________________________________________________
-AliITSv3::AliITSv3() : AliITS() 
-{
-  //
-  // Default constructor for ITS
-  //
-  fMinorVersion=1;
+AliITSv3::AliITSv3() {
+////////////////////////////////////////////////////////////////////////
+//    Standard default constructor for the ITS version 3.
+////////////////////////////////////////////////////////////////////////
+
+    fIdN    = 0;
+    fIdName = 0;
+    fIdSens = 0;
+    fMajorVersion = 3;
+    fMinorVersion = -1;
+}
+//____________________________________________________________________________
+AliITSv3::AliITSv3(const AliITSv3 &source){
+////////////////////////////////////////////////////////////////////////
+//     Copy Constructor for ITS version 3.
+////////////////////////////////////////////////////////////////////////
+    if(&source == this) return;
+    printf("Not allowed to copy AliITSv3\n");
+    return;
 }
 //_____________________________________________________________________________
-AliITSv3::AliITSv3(const char *name, const char *title)
-  : AliITS(name, title)
-{
-  //
-  // Standard constructor for ITS
-  // 
-  fMinorVersion=1;
+AliITSv3& AliITSv3::operator=(const AliITSv3 &source){
+////////////////////////////////////////////////////////////////////////
+//    Assignment operator for the ITS version 3.
+////////////////////////////////////////////////////////////////////////
+    if(&source == this) return *this;
+    printf("Not allowed to copy AliITSv3\n");
+    return *this;
 }
 //_____________________________________________________________________________
-void AliITSv3::CreateGeometry()
-{
-  //
-  // Create ITS geometry for version 3
-  //
-  //Begin_Html
-  /*
-    <img src="picts/AliITSv3Tree.gif">
-  */
-  //End_Html
-  //Begin_Html
-  /*
-    <img src="picts/AliITSv3.gif">
-  */
-  //End_Html
+AliITSv3::~AliITSv3() {
+////////////////////////////////////////////////////////////////////////
+//    Standard destructor for the ITS version 3.
+////////////////////////////////////////////////////////////////////////
+}
+//_____________________________________________________________________________
+AliITSv3::AliITSv3(const char *name, const char *title) : AliITS(name, title){
+////////////////////////////////////////////////////////////////////////
+//    Standard constructor for the ITS version 3.
+////////////////////////////////////////////////////////////////////////
+
+    fIdN    = 6;
+/*
+//  TObjArray of TObjStrings
+    fIdName = new TObjArray(fIdN);
+    fIdName->AddAt(new TObjString("ITS1"),0);
+    fIdName->AddAt(new TObjString("ITS2"),1);
+    fIdName->AddAt(new TObjString("ITS3"),2);
+    fIdName->AddAt(new TObjString("ITS4"),3);
+    fIdName->AddAt(new TObjString("ITS5"),4);
+    fIdName->AddAt(new TObjString("ITS6"),5);
+*/
+//  Array of TStrings.
+    fIdName    = new TString[fIdN];
+    fIdName[0] = "ITS1";
+    fIdName[1] = "ITS2";
+    fIdName[2] = "ITS3";
+    fIdName[3] = "ITS4";
+    fIdName[4] = "ITS5";
+    fIdName[5] = "ITS6";
+    fIdSens    = new Int_t[fIdN];
+    for (Int_t i=0;i<fIdN;i++) fIdSens[i] = 0;
+    fMajorVersion = 3;
+    fMinorVersion = 1;
+}//__________________________________________________________________________
+void AliITSv3::BuildGeometry(){
+////////////////////////////////////////////////////////////////////////
+//    Geometry builder for the ITS version 3.
+////////////////////////////////////////////////////////////////////////
+    TNode *node, *top;
+    const int kColorITS=kYellow;
+    //
+    top = gAlice->GetGeometry()->GetNode("alice");
+
+    new TTUBE("S_layer1","Layer1 of ITS","void",3.9,3.9+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.6,7.6+0.05475,16.3);
+    top->cd();
+    node = new TNode("Layer2","Layer2","S_layer2",0,0,0,"");
+    node->SetLineColor(kColorITS);
+    fNodes->Add(node);
 
-  AliMC* pMC = AliMC::GetMC();
-  
-  const Float_t xx[14] = { 0.,0.,-14.002,-6.288,-25.212,-16.292,-35.713,-26.401,
-                          -45.34,-36.772,-18.74,-12.814,-14.358,0. };
-  const Float_t yy[14] = { 0.,27.056,31.408,
-                          25.019,27.768,22.664,22.42,18.727,15.479,13.68,-9.984,-6.175,-3.775,0. };
-  const Float_t xbeg[13] = { 0.,-.352,-12.055,-8.755,-23.035,-19.085,-33.362,
-                            -28.859,-42.774,-36.644,-18.352,-13.085,-13.426 };
-  const Float_t ybeg[13] = { .386,27.165,29.795,
-                            25.377,26.48,22.632,21.487,18.305,14.94,13.509,-9.735,-5.755,-3.53 };
-  const Float_t xend[13] = { 0.,-11.588,-8.208,-22.709,-18.738,-33.184,-28.719,
-                            -42.756,-37.027,-19.002,-13.235,-13.837,-.373 };
-  const Float_t yend[13] = { 26.688,30.658,26.609,
-                            27.405,23.935,22.452,19.646,15.922,13.733,-9.639,-6.446,-4.585,-.098 };
-  const Float_t xarc[13] = { -.5,-13.248,-13.505,-18.622,-37.171,-42.671,-28.977,
-                            -33.178,-19.094,-22.781,-8.655,-11.736,-.5 };
-  const Float_t yarc[13] = { .5,-4.093,-5.911,
-                            -9.2,13.162,15.543,19.109,22.066,23.446,27.024,26.184,30.294,26.802 };
-  const Float_t rarc[13] = { .5,.7,.5,.5,.7,.5,.7,.5,.7,.5,.7,.5,.5 };
-  const Float_t rr    = 4.064516;
-  const Float_t tteta = 63.;
-  const Float_t pphi  = -35.;
-  const Float_t gteta = 87.78;
-  const Double_t degrad = kPI/180.;
-  const Double_t raddeg = 180./kPI;
-  const Double_t twopi = 2*kPI;
+    new TTUBE("S_layer3","Layer3 of ITS","void",14,14+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 AliITSv3::CreateGeometry(){
+////////////////////////////////////////////////////////////////////////
+//    This routine creates and defines the version 3 geometry of the ITS.
+////////////////////////////////////////////////////////////////////////
+  
+  const Float_t kxx[14] = {  0.000,  0.000,-14.002, -6.288,-25.212,-16.292,
+                          -35.713,-26.401,-45.340,-36.772,-18.740,-12.814,
+                          -14.358,  0.000};
+  const Float_t kyy[14] = {  0.000, 27.056, 31.408, 25.019, 27.768, 22.664,
+                           22.420, 18.727, 15.479, 13.680, -9.984, -6.175,
+                           -3.775, 0.000 };
+  const Float_t kxbeg[13] = {  0.000, -0.352,-12.055, -8.755,-23.035,-19.085,
+                            -33.362,-28.859,-42.774,-36.644,-18.352,-13.085,
+                            -13.426 };
+  const Float_t kybeg[13] = {  0.386, 27.165, 29.795, 25.377, 26.480, 22.632,
+                             21.487, 18.305, 14.940, 13.509, -9.735, -5.755,
+                             -3.53 };
+  const Float_t kxend[13] = {  0.000,-11.588, -8.208,-22.709,-18.738,-33.184,
+                            -28.719,-42.756,-37.027,-19.002,-13.235,-13.837,
+                              -.373 };
+  const Float_t kyend[13] = { 26.688, 30.658, 26.609, 27.405, 23.935, 22.452,
+                             19.646, 15.922, 13.733, -9.639, -6.446, -4.585,
+                              -.098 };
+  const Float_t kxarc[13] = { -0.500,-13.248,-13.505,-18.622,-37.171,-42.671,
+                            -28.977,-33.178,-19.094,-22.781, -8.655,-11.736,
+                             -0.500 };
+  const Float_t kyarc[13] = {  0.500, -4.093, -5.911, -9.200, 13.162, 15.543,
+                             19.109, 22.066, 23.446, 27.024, 26.184, 30.294,
+                             26.802 };
+  const Float_t krarc[13] = { 0.5,0.7,0.5,0.5,0.7,0.5,0.7,
+                             0.5,0.7,0.5,0.7,0.5,0.5 };
+  const Float_t  krr     =   4.064516;
+  const Float_t  ktteta  =  63.00;
+  const Float_t  kpphi   = -35.00;
+  const Float_t  kgteta  =  87.78;
+  const Double_t kdegrad = kPI/180.;
+  const Double_t kraddeg = 180./kPI;
+  const Double_t ktwopi  = 2*kPI;
   
   Double_t biga, bigb;
-  Float_t dcei[3], dela[3], dchi[3], dpcb[3], darc[5], dfra[10], dcer[3], dkap[3], dpla[3],
-    xccc, yccc, aphi, dcop[3], dtra[3], dsil[3], atheta1011, dbus[3], dtub[3], dwat[3],
-    depx[3], dits[3], atheta1314, atheta1213, atheta1112, dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
+  Float_t  dcei[3], dela[3], dchi[3], dpcb[3], darc[5], 
+           dfra[10], dcer[3], dkap[3], dpla[3],
+           xccc, yccc, aphi, dcop[3], dtra[3], dsil[3], 
+           atheta1011, dbus[3], dtub[3], dwat[3],
+           depx[3], dits[3], atheta1314, atheta1213, atheta1112, 
+           dsup[3], xtra[8], ytra[8], ztra[8], dsrv[3];
   Double_t biga1, bigb1;
-  Float_t runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, dtra1[3], dtra2[3], dtra3[3],
-    dtra4[3], dbox1[3], dbox2[3];
-  Int_t jbox1, jbox2;
-  Float_t xtra1[6], ytra1[6], ztra1[6];
-  Int_t i;
-  Float_t xpos1, ypos1;
-  Int_t j;
-  Float_t angle, dcone[5], dtube[3], dpgon[10];
-  Float_t rzero, xzero, yzero;
+  Float_t  runo, xpos, ypos, zpos, rtwo, aphi1, aphi2, 
+           dtra1[3], dtra2[3], dtra3[3],
+           dtra4[3], dbox1[3], dbox2[3];
+  Int_t    jbox1, jbox2;
+  Float_t  xtra1[6], ytra1[6], ztra1[6];
+  Int_t    i;
+  Float_t  xpos1, ypos1;
+  Int_t    j;
+  Float_t  angle, dcone[5], dtube[3], dpgon[10];
+  Float_t  rzero, xzero, yzero;
   Double_t coeffa, coeffb, coeffc;
-  Int_t idrotm[5250];
-  Float_t atheta, offset;
-  Float_t offset1, offset2, dgh[15];
-  Float_t xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56, 
-    atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
-  //Float_t yos;
-  Float_t r1, r2, r3;
+  Int_t    idrotm[5250];
+  Float_t  atheta, offset;
+  Float_t  offset1, offset2, dgh[15];
+  Float_t  xcc, ycc, sep, atheta12, atheta23, atheta34, atheta45, atheta56, 
+           atheta67, atheta78, atheta89, xxm, dal1[3], dal2[3];
+  //Float_t  yos;
+  Float_t  r1, r2, r3;
   Double_t xcc1, ycc1, xcc2, ycc2;
-  Float_t atheta910;
-  const char natra[][5] = 
-  { "TR01","TR02","TR03","TR04","TR05","TR06","TR07","TR08"};
-  const char natra1[][5] =
-  {"TR11","TR12","TR13","TR14","TR15","TR16","TR17","TR18",
-   "TR19","TR20","TR21","TR22","TR23","TR24","TR25","TR26"};
-  const char natra2[][5] = 
-  {"TR31","TR32","TR33","TR34","TR35","TR36"};
-  const char natra3[][5] = 
-  {"TR41","TR42","TR43","TR44","TR45","TR46"};
-  const char natra4[][5] = 
-  {"TR51","TR52","TR53","TR54","TR55","TR56","TR57","TR58",
-   "TR59","TR60","TR61","TR62","TR63","TR64","TR65","TR66"};
-  
-  Int_t *idtmed = gAlice->Idtmed();
+  Float_t  atheta910;
+  const char knatra[][5] ={ "TR01","TR02","TR03","TR04",
+                           "TR05","TR06","TR07","TR08"};
+  const char knatra1[][5] ={"TR11","TR12","TR13","TR14",
+                           "TR15","TR16","TR17","TR18",
+                           "TR19","TR20","TR21","TR22",
+                           "TR23","TR24","TR25","TR26"};
+  const char knatra2[][5] ={"TR31","TR32","TR33","TR34","TR35","TR36"};
+  const char knatra3[][5] ={"TR41","TR42","TR43","TR44","TR45","TR46"};
+  const char knatra4[][5] ={"TR51","TR52","TR53","TR54","TR55","TR56",
+                           "TR57","TR58","TR59","TR60","TR61","TR62",
+                           "TR63","TR64","TR65","TR66"};
+  
+  Int_t *idtmed = fIdtmed->GetArray()-199;
   
   // --- Define a ghost volume containing the whole ITS and fill it with air
   //     or vacuum 
   
-  dgh[0] 0;
-  dgh[1] = 360;
-  dgh[2] = 4;
-  dgh[3] = -70;
-  dgh[4] = 49.999;
-  dgh[5] = 49.999;
-  dgh[6] = -25;
-  dgh[7] = 3;
-  dgh[8] = 49.999;
-  dgh[9] = 25;
-  dgh[10] = 3;
+  dgh[0]  = 0.0;
+  dgh[1]  = 360.0;
+  dgh[2]  = 4.0;
+  dgh[3]  = -70.0;
+  dgh[4]  = 49.999;
+  dgh[5]  = 49.999;
+  dgh[6]  = -25.0;
+  dgh[7]  = 3.0;
+  dgh[8]  = 49.999;
+  dgh[9]  = 25.0;
+  dgh[10] = 3.0;
   dgh[11] = 49.999;
-  dgh[12] = 70;
+  dgh[12] = 70.0;
   dgh[13] = 49.999;
   dgh[14] = 49.999;
-  pMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
+  gMC->Gsvolu("ITSV", "PCON", idtmed[275], dgh, 15);
   
   // --- Place the ghost volume in its mother volume (ALIC) and make it 
   //     invisible 
   
-  pMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
-  pMC->Gsatt("ITSV", "SEEN", 0);
+  gMC->Gspos("ITSV", 1, "ALIC", 0., 0., 0., 0, "ONLY");
+  gMC->Gsatt("ITSV", "SEEN", 0);
   
   //************************************************************************
   //*                                                                      *
@@ -168,29 +337,29 @@ void AliITSv3::CreateGeometry()
   // --- Define a ghost volume containing the Silicon Pixel Detectors 
   //     (layer #1 and #2) and fill it with air or vacuum 
   
-  xxm    = (49.999-3)/(70-25);
-  dgh[0] = 0.;
-  dgh[1] = 360;
-  dgh[2] = 4;
-  dgh[3] = -25.-(9.-3.01)/xxm;
-  dgh[4] = 9;
-  dgh[5] = 9;
-  dgh[6] = -25;
-  dgh[7] = 3.01;
-  dgh[8] = 9;
-  dgh[9] = 25;
+  xxm     = (49.999-3)/(70-25);
+  dgh[0]  = 0.0;
+  dgh[1]  = 360.0;
+  dgh[2]  = 4.0;
+  dgh[3]  = -25.-(9.-3.01)/xxm;
+  dgh[4]  = 9.0;
+  dgh[5]  = 9.0;
+  dgh[6]  = -25.0;
+  dgh[7]  = 3.01;
+  dgh[8]  = 9.0;
+  dgh[9]  = 25.0;
   dgh[10] = 3.01;
-  dgh[11] = 9;
+  dgh[11] = 9.0;
   dgh[12] = 25+(9-3.01)/xxm;
-  dgh[13] = 9;
-  dgh[14] = 9;
-  pMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
+  dgh[13] = 9.0;
+  dgh[14] = 9.0;
+  gMC->Gsvolu("IT12", "PCON", idtmed[275], dgh, 15);
   
   // --- Place the ghost volume in its mother volume (ITSV) and make it 
   //     invisible 
   
-  pMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
-  pMC->Gsatt("IT12", "SEEN", 0);
+  gMC->Gspos("IT12", 1, "ITSV", 0., 0., 0., 0, "ONLY");
+  gMC->Gsatt("IT12", "SEEN", 0);
   
   // --- Define a ghost volume containing a single element of layer #1 
   //     and fill it with air or vacuum 
@@ -198,133 +367,133 @@ void AliITSv3::CreateGeometry()
   dbox1[0] = 0.005+0.01+0.0075;
   dbox1[1] = .79;
   dbox1[2] = 12.67;
-  pMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
-  
-  //--- Divide each element of layer #1 in three ladders along the beam direction
+  gMC->Gsvolu("IPV1", "BOX ", idtmed[203], dbox1, 3);
   
-  pMC->Gsdvn("IPB1", "IPV1", 3, 3);
+  //--Divide each element of layer #1 in three ladders along the beam direction
+
+  gMC->Gsdvn("IPB1", "IPV1", 3, 3);
   
   // --- Make the ghost volumes invisible 
   
-  pMC->Gsatt("IPV1", "SEEN", 0);
-  pMC->Gsatt("IPB1", "SEEN", 0);
-  
-  // --- Define a volume containing the chip of pixels (silicon, layer #1) 
+  gMC->Gsatt("IPV1", "SEEN", 0);
+  gMC->Gsatt("IPB1", "SEEN", 0);
   
-  dchi[0] = .005;
-  dchi[1] = .79;
+  // --- Define a volume containing the chip of pixels (silicon, layer #1)
+
+  dchi[0] = 0.005;
+  dchi[1] = 0.79;
   dchi[2] = dbox1[2] / 3.;
-  pMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
+  gMC->Gsvolu("ICH1", "BOX ", idtmed[200], dchi, 3);
   
   // --- Define a volume containing the bus of pixels (silicon, layer #1) 
   
-  dbus[0] = .01;
-  dbus[1] = .64;
+  dbus[0] = 0.01;
+  dbus[1] = 0.64;
   dbus[2] = 4.19;
-  pMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
+  gMC->Gsvolu("IBU1", "BOX ", idtmed[201], dbus, 3);
   
   // --- Define a volume containing the sensitive part of pixels 
   //     (silicon, layer #1) 
   
-  dits[0] = .0075;
-  dits[1] = .64;
+  dits[0] = 0.0075;
+  dits[1] = 0.64;
   dits[2] = 4.19;
-  pMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
-  
+  gMC->Gsvolu("ITS1", "BOX ", idtmed[199], dits, 3);
+
   // --- Place the chip into its mother (IPB1) 
   
   xpos = dbox1[0] - dchi[0];
-  ypos = 0.;
-  zpos = 0.;
-  pMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
+  ypos = 0.0;
+  zpos = 0.0;
+  gMC->Gspos("ICH1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the sensitive volume into its mother (IPB1) 
   
   xpos = dbox1[0] - dchi[0] * 2. - dits[0];
   ypos = dchi[1] - dits[1];
   zpos = -(dchi[2] - dits[2]);
-  pMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("ITS1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the bus into its mother (IPB1) 
   
   xpos = dbox1[0] - dchi[0] * 2. - dits[0] * 2. - dbus[0];
   ypos = dchi[1] - dbus[1];
   zpos = -(dchi[2] - dbus[2]);
-  pMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IBU1", 1, "IPB1", xpos, ypos, zpos, 0, "ONLY");
 
   // --- Define a ghost volume containing a single element of layer #2 
   //     and fill it with air or vacuum 
   
   dbox2[0] = 0.005+0.01+0.0075;
-  dbox2[1] = .79;
+  dbox2[1] = 0.79;
   dbox2[2] = 16.91;
-  pMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
-  
-  //--Divide each element of layer #2 in four ladders along the beam direction
+  gMC->Gsvolu("IPV2", "BOX ", idtmed[203], dbox2, 3);
+
+  //--Divide each element of layer #2 in four ladders along the beam direction
   
-  pMC->Gsdvn("IPB2", "IPV2", 4, 3);
+  gMC->Gsdvn("IPB2", "IPV2", 4, 3);
   
   // --- Make the ghost volumes invisible 
   
-  pMC->Gsatt("IPV2", "SEEN", 0);
-  pMC->Gsatt("IPB2", "SEEN", 0);
+  gMC->Gsatt("IPV2", "SEEN", 0);
+  gMC->Gsatt("IPB2", "SEEN", 0);
   
   // --- Define a volume containing the chip of pixels (silicon, layer #2) 
   
-  dchi[0] = .005;
-  dchi[1] = .79;
+  dchi[0] = 0.005;
+  dchi[1] = 0.79;
   dchi[2] = dbox2[2] / 4.;
-  pMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
-  
+  gMC->Gsvolu("ICH2", "BOX ", idtmed[200], dchi, 3);
+
   // --- Define a volume containing the bus of pixels (silicon, layer #2) 
   
-  dbus[0] = .01;
-  dbus[1] = .64;
+  dbus[0] = 0.01;
+  dbus[1] = 0.64;
   dbus[2] = 4.19;
-  pMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
-  
+  gMC->Gsvolu("IBU2", "BOX ", idtmed[201], dbus, 3);
+
   // --- Define a volume containing the sensitive part of pixels 
   //     (silicon, layer #2) 
   
-  dits[0] = .0075;
-  dits[1] = .64;
+  dits[0] = 0.0075;
+  dits[1] = 0.64;
   dits[2] = 4.19;
-  pMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
-  
+  gMC->Gsvolu("ITS2", "BOX ", idtmed[199], dits, 3);
+
   // --- Place the chip into its mother (IPB2) 
   
   xpos = dbox1[0] - dbus[0] * 2. - dits[0] * 2. - dchi[0];
-  ypos = 0.;
-  zpos = 0.;
-  pMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
+  ypos = 0.0;
+  zpos = 0.0;
+  gMC->Gspos("ICH2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the sensitive volume into its mother (IPB2) 
   
   xpos = dbox1[0] - dbus[0] * 2. - dits[0];
   ypos = -(dchi[1] - dits[1]);
   zpos = -(dchi[2] - dits[2]);
-  pMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("ITS2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the bus into its mother (IPB2) 
   
   xpos = dbox1[0] - dbus[0];
   ypos = -(dchi[1] - dbus[1]);
   zpos = -(dchi[2] - dbus[2]);
-  pMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IBU2", 1, "IPB2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Define a generic segment of an element of the mechanical support 
   
-  dsup[0] = 0.;
-  dsup[1] = 0.;
-  dsup[2] = 0.;
-  pMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
+  dsup[0] = 0.0;
+  dsup[1] = 0.0;
+  dsup[2] = 0.0;
+  gMC->Gsvolu("SPIX", "BOX ", idtmed[202], dsup, 0);
   
   // --- Define a generic arc of an element of the mechanical support 
   
-  darc[0] = 0.;
-  darc[1] = 0.;
-  darc[2] = 0.;
-  pMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
+  darc[0] = 0.0;
+  darc[1] = 0.0;
+  darc[2] = 0.0;
+  gMC->Gsvolu("SARC", "TUBS", idtmed[202], darc, 0);
   
   // --- Define the mechanical supports of layers #1 and #2 and place the 
   //     elements of the layers in it 
@@ -341,421 +510,490 @@ void AliITSv3::CreateGeometry()
     // number of carbon fiber supports (see sketch) 
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[0] - xbeg[0]) * (xend[0] - xbeg[0]) + (yend[0] - ybeg[0]) * (yend[0] - ybeg[0])) / 20.;
-    dsup[2] = 25.;
-    xcc     = (xx[0] + xx[1]) / 20.;
-    ycc     = (yy[0] + yy[1]) / 20.;
-    xccc    = (xbeg[0] + xend[0]) / 20.;
-    yccc    = (ybeg[0] + yend[0]) / 20.;
-    if (xx[0] == xx[1]) {
+    dsup[1] = TMath::Sqrt((kxend[0] - kxbeg[0]) * (kxend[0] - kxbeg[0]) + 
+                          (kyend[0] - kybeg[0]) * (kyend[0] - kybeg[0])   ) / 20.;
+    dsup[2] = 25.0;
+    xcc     = (  kxx[0] +   kxx[1]) / 20.;
+    ycc     = (  kyy[0] +   kyy[1]) / 20.;
+    xccc    = (kxbeg[0] + kxend[0]) / 20.;
+    yccc    = (kybeg[0] + kyend[0]) / 20.;
+    if (kxx[0] == kxx[1]) {
       offset2 = 0.;
     } else {
-      r1 = yy[1] - yy[0];
-      r2 = xx[1] - xx[0];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
-    }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos  = 0.;
-    atheta12 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90., atheta12 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
-    
+      r1 = kyy[1] - kyy[0];
+      r2 = kxx[1] - kxx[0];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
+    } // end if kxx[0] == kxx[1]
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) +
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos  = 0.0;
+    atheta12 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1100], 90., atheta12, 90.,
+                                             atheta12 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos,
+                         idrotm[(i-1) * 13 + 1100], "ONLY", dsup, 3);
+
     // --- Place part # 2-3 (see sketch) 
     
-    offset1 = -35.;
-    dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[1] - xbeg[1]) * (xend[1] - xbeg[1]) + (yend[1] - ybeg[1]) * (yend[1] - ybeg[1])) / 20.;
-    dsup[2] = 25.;
-    xcc     = (xx[1] + xx[2]) / 20.;
-    ycc     = (yy[1] + yy[2]) / 20.;
-    xccc    = (xbeg[1] + xend[1]) / 20.;
-    yccc    = (ybeg[1] + yend[1]) / 20.;
-    if (xx[1] == xx[2]) {
+    offset1 = -35.0;
+    dsup[0] = 0.01;
+    dsup[1] = TMath::Sqrt((kxend[1] - kxbeg[1]) * (kxend[1] - kxbeg[1]) + 
+                          (kyend[1] - kybeg[1]) * (kyend[1] - kybeg[1])) / 20.;
+    dsup[2] = 25.0;
+    xcc     = (  kxx[1] +   kxx[2]) / 20.;
+    ycc     = (  kyy[1] +   kyy[2]) / 20.;
+    xccc    = (kxbeg[1] + kxend[1]) / 20.;
+    yccc    = (kybeg[1] + kyend[1]) / 20.;
+    if (kxx[1] == kxx[2]) {
       offset2 = 0.;
     } else {
-      r1 = yy[2] - yy[1];
-      r2 = xx[2] - xx[1];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
-    }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos  = 0.;
-    atheta23 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90., atheta23 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
-    
-    // --- Place an element of layer #2 
-    
-    biga   = (yy[2] - yy[1]) / (xx[2] - xx[1]);
-    bigb   = (xx[2] * yy[1] - xx[1] * yy[2]) / (xx[2] - xx[1]) / 10.;
+      r1 = kyy[2] - kyy[1];
+      r2 = kxx[2] - kxx[1];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
+    } // end if kxx[1] == kxx[2]
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta * kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos  = 0.0;
+    atheta23 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1101], 90., atheta23, 90.,
+                                             atheta23 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos,
+               idrotm[(i-1) * 13 + 1101], "ONLY", dsup, 3);
+
+    // --- Place an element of layer #2
+
+    biga   = (kyy[2] - kyy[1]) / (kxx[2] - kxx[1]);
+    bigb   = (kxx[2] * kyy[1] - kxx[1] * kyy[2]) / (kxx[2] - kxx[1]) / 10.;
     coeffa = biga * biga + 1.;
     coeffb = biga * bigb - biga * ycc - xcc;
-    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - 0.08964*0.08964;
-    xcc1   = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + 
+            bigb * bigb - 0.08964*0.08964;
+    xcc1   = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) /
+                                                                   coeffa;
     ycc1   = biga * xcc1 + bigb;
     biga1  = -1. / biga;
     bigb1  = xcc1 / biga + ycc1;
     coeffa = biga1 * biga1 + 1.;
     coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
-    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
-    xcc2   = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
-    ycc2   = biga1 * xcc2 + bigb1;
-    xpos1  = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
-    ypos1  = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
-    xpos   = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos   = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos  = 0.;
+    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + 
+            bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+    xcc2   = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                    coeffa;
+    ycc2   =  biga1 * xcc2 + bigb1;
+    xpos1  =   xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+    ypos1  =   xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+    xpos   =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+              ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos   = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+              ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos  = 0.0;
     ++jbox2;
-    pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY");
-    
-    // --- Place part # 3-4 (see sketch) 
-    
-    offset1 = -35.;
-    dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[2] - xbeg[2]) * (xend[2] - xbeg[2]) + (yend[2] - ybeg[2]) * (yend[2] - ybeg[2])) / 20.;
+    gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, 
+                         idrotm[(i-1) * 13 + 1101], "ONLY");
+
+    // --- Place part # 3-4 (see sketch)
+
+    offset1 = -35.0;
+    dsup[0] = 0.01;
+    dsup[1] = TMath::Sqrt((kxend[2] - kxbeg[2]) * (kxend[2] - kxbeg[2]) + 
+                          (kyend[2] - kybeg[2]) * (kyend[2] - kybeg[2])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[1] + xx[2]) / 20.;
-    ycc     = (yy[1] + yy[2]) / 20.;
-    xccc    = (xbeg[2] + xend[2]) / 20.;
-    yccc    = (ybeg[2] + yend[2]) / 20.;
-    if (xx[2] == xx[3]) {
+    xcc     = (kxx[1] + kxx[2]) / 20.;
+    ycc     = (kyy[1] + kyy[2]) / 20.;
+    xccc    = (kxbeg[2] + kxend[2]) / 20.;
+    yccc    = (kybeg[2] + kyend[2]) / 20.;
+    if (kxx[2] == kxx[3]) {
       offset2 = 0.;
     } else {
-      r1 = yy[3] - yy[2];
-      r2 = xx[3] - xx[2];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
-    }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos  = 0.;
-    atheta34 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., atheta34 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
-    
-    // --- Place part # 4-5 (see sketch) 
-    
-    offset1 = -35.;
-    dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[3] - xbeg[3]) * (xend[3] - xbeg[3]) + (yend[3] - ybeg[3]) * (yend[3] - ybeg[3])) / 20.;
-    dsup[2] = 25.;
-    xcc     = (xx[3] + xx[4]) / 20.;
-    ycc     = (yy[3] + yy[4]) / 20.;
-    xccc    = (xbeg[3] + xend[3]) / 20.;
-    yccc    = (ybeg[3] + yend[3]) / 20.;
-    if (xx[3] == xx[4]) {
+      r1 = kyy[3] - kyy[2];
+      r2 = kxx[3] - kxx[2];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
+    } // end if kxx[2] == kxx[3]
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos  = 0.0;
+    atheta34 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1102], 90., atheta34, 90., 
+                                             atheta34 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, 
+                         idrotm[(i-1) * 13 + 1102], "ONLY", dsup, 3);
+
+    // --- Place part # 4-5 (see sketch)
+
+    offset1 = -35.0;
+    dsup[0] = 0.01;
+    dsup[1] = TMath::Sqrt((kxend[3] - kxbeg[3]) * (kxend[3] - kxbeg[3]) + 
+                          (kyend[3] - kybeg[3]) * (kyend[3] - kybeg[3])) / 20.;
+    dsup[2] = 25.0;
+    xcc     = (  kxx[3] +   kxx[4]) / 20.;
+    ycc     = (  kyy[3] +   kyy[4]) / 20.;
+    xccc    = (kxbeg[3] + kxend[3]) / 20.;
+    yccc    = (kybeg[3] + kyend[3]) / 20.;
+    if (kxx[3] == kxx[4]) {
       offset2 = 0.;
     } else {
-      r1 = yy[4] - yy[3];
-      r2 = xx[4] - xx[3];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
-    }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos  = 0.;
-    atheta45 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., atheta45 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
-    
-    // --- Place an element of layer #2 
-    
-    biga   = (yy[4] - yy[3]) / (xx[4] - xx[3]);
-    bigb   = (xx[4] * yy[3] - xx[3] * yy[4]) / (xx[4] - xx[3]) / 10.;
+      r1 = kyy[4] - kyy[3];
+      r2 = kxx[4] - kxx[3];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
+    } // end if kxx[3] == kxx[4]
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos  = 0.0;
+    atheta45 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1103], 90., atheta45, 90., 
+                                        atheta45 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, 
+                        idrotm[(i-1) * 13 + 1103], "ONLY", dsup, 3);
+
+    // --- Place an element of layer #2
+
+    biga   = (kyy[4] - kyy[3]) / (kxx[4] - kxx[3]);
+    bigb   = (kxx[4] * kyy[3] - kxx[3] * kyy[4]) / (kxx[4] - kxx[3]) / 10.;
     coeffa = biga * biga + 1.;
     coeffb = biga * bigb - biga * ycc - xcc;
-    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
-    xcc1   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + 
+            bigb * bigb - .014285030400000001;
+    xcc1   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                      coeffa;
     ycc1   = biga * xcc1 + bigb;
     biga1  = -1. / biga;
     bigb1  = xcc1 / biga + ycc1;
     coeffa = biga1 * biga1 + 1.;
     coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
-    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
-    xcc2   = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
-    ycc2   = biga1 * xcc2 + bigb1;
-    xpos1  = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
-    ypos1  = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
-    xpos   = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos   = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos   = 0.;
+    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + 
+            bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+    xcc2   = (-coeffb + TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                     coeffa;
+    ycc2   =  biga1 * xcc2 + bigb1;
+    xpos1  =   xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+    ypos1  =   xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+    xpos   =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+              ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos   = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+              ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos   = 0.0;
     ++jbox2;
-    pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY");
-    
+    gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, 
+                           idrotm[(i-1) * 13 + 1103], "ONLY");
+
     // --- Place part # 5-6 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[4] - xbeg[4]) * (xend[4] - xbeg[4]) + (yend[4] - ybeg[4]) * (yend[4] - ybeg[4])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[4] - kxbeg[4]) * (kxend[4] - kxbeg[4]) + 
+                          (kyend[4] - kybeg[4]) * (kyend[4] - kybeg[4])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[4] + xx[5]) / 20.;
-    ycc     = (yy[4] + yy[5]) / 20.;
-    xccc    = (xbeg[4] + xend[4]) / 20.;
-    yccc    = (ybeg[4] + yend[4]) / 20.;
-    if (xx[4] == xx[5]) {
+    xcc     = (kxx[4] + kxx[5]) / 20.;
+    ycc     = (kyy[4] + kyy[5]) / 20.;
+    xccc    = (kxbeg[4] + kxend[4]) / 20.;
+    yccc    = (kybeg[4] + kyend[4]) / 20.;
+    if (kxx[4] == kxx[5]) {
       offset2 = 0.;
     } else {
-      r1 = yy[5] - yy[4];
-      r2 = xx[5] - xx[4];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[5] - kyy[4];
+      r2 = kxx[5] - kxx[4];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta56 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., atheta56 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
-    
+    atheta56 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1104], 90., atheta56, 90., 
+                                              atheta56 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos,
+                          idrotm[(i-1) * 13 + 1104], "ONLY", dsup, 3);
+
     // --- Place part # 6-7 (see sketch) 
     
-    offset1 = -35.;
-    dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[5] - xbeg[5]) * (xend[5] - xbeg[5]) + (yend[5] - ybeg[5]) * (yend[5] - ybeg[5])) / 20.;
-    dsup[2] = 25.;
-    xcc     = (xx[5] + xx[6]) / 20.;
-    ycc     = (yy[5] + yy[6]) / 20.;
-    xccc    = (xbeg[5] + xend[5]) / 20.;
-    yccc    = (ybeg[5] + yend[5]) / 20.;
-    if (xx[5] == xx[6]) {
+    offset1 = -35.0;
+    dsup[0] = 0.01;
+    dsup[1] = TMath::Sqrt((kxend[5] - kxbeg[5]) * (kxend[5] - kxbeg[5]) + 
+                          (kyend[5] - kybeg[5]) * (kyend[5] - kybeg[5])) / 20.;
+    dsup[2] = 25.0;
+    xcc     = (kxx[5] + kxx[6]) / 20.;
+    ycc     = (kyy[5] + kyy[6]) / 20.;
+    xccc    = (kxbeg[5] + kxend[5]) / 20.;
+    yccc    = (kybeg[5] + kyend[5]) / 20.;
+    if (kxx[5] == kxx[6]) {
       offset2 = 0.;
     } else {
-      r1 = yy[6] - yy[5];
-      r2 = xx[6] - xx[5];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
-    }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+      r1 = kyy[6] - kyy[5];
+      r2 = kxx[6] - kxx[5];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
+    } // end if kxx[5] == kxx[6]
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta67 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., atheta67 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
-    
+    atheta67 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1105], 90., atheta67, 90., 
+                                             atheta67 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, 
+                         idrotm[(i-1) * 13 + 1105], "ONLY", dsup, 3);
+
     // --- Place an element of layer #2 
     
-    biga   = (yy[6] - yy[5]) / (xx[6] - xx[5]);
-    bigb   = (xx[6] * yy[5] - xx[5] * yy[6]) / (xx[6] - xx[5]) / 10.;
+    biga   = (kyy[6] - kyy[5]) / (kxx[6] - kxx[5]);
+    bigb   = (kxx[6] * kyy[5] - kxx[5] * kyy[6]) / (kxx[6] - kxx[5]) / 10.;
     coeffa = biga * biga + 1.;
     coeffb = biga * bigb - biga * ycc - xcc;
-    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
-    xcc1   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + 
+            bigb * bigb - .014285030400000001;
+    xcc1   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                      coeffa;
     ycc1   = biga * xcc1 + bigb;
     biga1  = -1. / biga;
     bigb1  = xcc1 / biga + ycc1;
     coeffa = biga1 * biga1 + 1.;
     coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
-    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
-    xcc2   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
-    ycc2   = biga1 * xcc2 + bigb1;
-    xpos1  = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
-    ypos1  = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
-    xpos   = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos   = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos   = 0.;
+    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 +
+            bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+    xcc2   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                   coeffa;
+    ycc2   =  biga1 * xcc2 + bigb1;
+    xpos1  =   xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+    ypos1  =   xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+    xpos   =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+              ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos   = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+              ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos   = 0.0;
     ++jbox2;
-    pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY");
+    gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos,
+                       idrotm[(i-1) * 13 + 1105], "ONLY");
     
     // --- Place part # 7-8 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[6] - xbeg[6]) * (xend[6] - xbeg[6]) + (yend[6] - ybeg[6]) * (yend[6] - ybeg[6])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[6] - kxbeg[6]) * (kxend[6] - kxbeg[6]) +
+                          (kyend[6] - kybeg[6]) * (kyend[6] - kybeg[6])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[6] + xx[7]) / 20.;
-    ycc     = (yy[6] + yy[7]) / 20.;
-    xccc    = (xbeg[6] + xend[6]) / 20.;
-    yccc    = (ybeg[6] + yend[6]) / 20.;
-    if (xx[6] == xx[7]) {
+    xcc     = (kxx[6] + kxx[7]) / 20.;
+    ycc     = (kyy[6] + kyy[7]) / 20.;
+    xccc    = (kxbeg[6] + kxend[6]) / 20.;
+    yccc    = (kybeg[6] + kyend[6]) / 20.;
+    if (kxx[6] == kxx[7]) {
       offset2 = 0.;
     } else {
-      r1 = yy[7] - yy[6];
-      r2 = xx[7] - xx[6];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
-    }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+      r1 = kyy[7] - kyy[6];
+      r2 = kxx[7] - kxx[6];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
+    } // end if
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta78 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., atheta78 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
+    atheta78 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1106], 90., atheta78, 90., 
+                                             atheta78 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, 
+                           idrotm[(i-1) * 13 + 1106], "ONLY", dsup, 3);
     
     // --- Place part # 8-9 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[7] - xbeg[7]) * (xend[7] - xbeg[7]) + (yend[7] - ybeg[7]) * (yend[7] - ybeg[7])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[7] - kxbeg[7]) * (kxend[7] - kxbeg[7]) + 
+                          (kyend[7] - kybeg[7]) * (kyend[7] - kybeg[7])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[7] + xx[8]) / 20.;
-    ycc     = (yy[7] + yy[8]) / 20.;
-    xccc    = (xbeg[7] + xend[7]) / 20.;
-    yccc    = (ybeg[7] + yend[7]) / 20.;
-    if (xx[1] == xx[2]) {
+    xcc     = (kxx[7] + kxx[8]) / 20.;
+    ycc     = (kyy[7] + kyy[8]) / 20.;
+    xccc    = (kxbeg[7] + kxend[7]) / 20.;
+    yccc    = (kybeg[7] + kyend[7]) / 20.;
+    if (kxx[1] == kxx[2]) {
       offset2 = 0.;
     } else {
-      r1 = yy[8] - yy[7];
-      r2 = xx[8] - xx[7];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[8] - kyy[7];
+      r2 = kxx[8] - kxx[7];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
-    xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
-    ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero =     krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero =     krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
+    xpos1 =   xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
+    ypos1 =   xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
+    xpos  =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+             ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+             ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta89 = (i-1) * 36. + offset1 + offset2 - gteta;
-    AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., atheta89 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
+    atheta89 = (i-1) * 36. + offset1 + offset2 - kgteta;
+    AliMatrix(idrotm[(i-1) * 13 + 1107], 90., atheta89, 90., 
+                                             atheta89 + 90., 0., 0.);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, 
+                         idrotm[(i-1) * 13 + 1107], "ONLY", dsup, 3);
     
     // --- Place an element of layer #2 
     
-    biga   = (yy[8] - yy[7]) / (xx[8] - xx[7]);
-    bigb   = (xx[8] * yy[7] - xx[7] * yy[8]) / (xx[8] - xx[7]) / 10.;
+    biga   = (kyy[8] - kyy[7]) / (kxx[8] - kxx[7]);
+    bigb   = (kxx[8] * kyy[7] - kxx[7] * kyy[8]) / (kxx[8] - kxx[7]) / 10.;
     coeffa = biga * biga + 1.;
     coeffb = biga * bigb - biga * ycc - xcc;
-    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .014285030400000001;
-    xcc1   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
+    coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb +
+            bigb * bigb - .014285030400000001;
+    xcc1   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                   coeffa;
     ycc1   = biga * xcc1 + bigb;
     biga1  = -1. / biga;
     bigb1  = xcc1 / biga + ycc1;
     coeffa = biga1 * biga1 + 1.;
     coeffb = biga1 * bigb1 - biga1 * ycc1 - xcc1;
-    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
-    xcc2   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / coeffa;
-    ycc2   = biga1 * xcc2 + bigb1;
-    xpos1  = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
-    ypos1  = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
-    xpos   = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos   = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
-    zpos   = 0.;
+    coeffc = xcc1 * xcc1 + ycc1 * ycc1 - ycc1 * 2. * bigb1 + 
+            bigb1 * bigb1 - (dsup[0] + dbox2[0]) * (dsup[0] + dbox2[0]);
+    xcc2   = (-coeffb - TMath::Sqrt(coeffb * coeffb - coeffa * coeffc)) / 
+                                                                    coeffa;
+    ycc2   =  biga1 * xcc2 + bigb1;
+    xpos1  =   xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
+    ypos1  =   xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
+    xpos   =  xpos1 * TMath::Cos(kgteta * kdegrad) + 
+              ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos   = -xpos1 * TMath::Sin(kgteta * kdegrad) + 
+              ypos1 * TMath::Cos(kgteta * kdegrad);
+    zpos   = 0.0;
     ++jbox2;
-    pMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY");
-    
+    gMC->Gspos("IPV2", jbox2, "IT12", xpos, ypos, zpos, 
+                      idrotm[(i-1) * 13 + 1107], "ONLY");
+
     // --- Place part # 9-10 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[8] - xbeg[8]) * (xend[8] - xbeg[8]) + (yend[8] - ybeg[8]) * (yend[8] - ybeg[8])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[8] - kxbeg[8]) * (kxend[8] - kxbeg[8]) +
+                          (kyend[8] - kybeg[8]) * (kyend[8] - kybeg[8])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[8] + xx[9]) / 20.;
-    ycc     = (yy[8] + yy[9]) / 20.;
-    xccc    = (xbeg[8] + xend[8]) / 20.;
-    yccc    = (ybeg[8] + yend[8]) / 20.;
-    if (xx[8] == xx[9]) {
+    xcc     = (kxx[8] + kxx[9]) / 20.;
+    ycc     = (kyy[8] + kyy[9]) / 20.;
+    xccc    = (kxbeg[8] + kxend[8]) / 20.;
+    yccc    = (kybeg[8] + kyend[8]) / 20.;
+    if (kxx[8] == kxx[9]) {
       offset2 = 0.;
     } else {
-      r1 = yy[9] - yy[8];
-      r2 = xx[9] - xx[8];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[9] - kyy[8];
+      r2 = kxx[9] - kxx[8];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
     ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos  = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta910 = (i-1) * 36. + offset1 + offset2 - gteta;
+    atheta910 = (i-1) * 36. + offset1 + offset2 - kgteta;
     AliMatrix(idrotm[(i-1) * 13 + 1108], 90., atheta910, 90., atheta910 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", dsup, 3);
     
     // --- Place part # 10-11 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[9] - xbeg[9]) * (xend[9] - xbeg[9]) + (yend[9] - ybeg[9]) * (yend[9] - ybeg[9])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[9] - kxbeg[9]) * (kxend[9] - kxbeg[9]) + (kyend[9] - kybeg[9]) * (kyend[9] - kybeg[9])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[9] + xx[10]) / 20.;
-    ycc     = (yy[9] + yy[10]) / 20.;
-    xccc    = (xbeg[9] + xend[9]) / 20.;
-    yccc    = (ybeg[9] + yend[9]) / 20.;
-    if (xx[9] == xx[10]) {
+    xcc     = (kxx[9] + kxx[10]) / 20.;
+    ycc     = (kyy[9] + kyy[10]) / 20.;
+    xccc    = (kxbeg[9] + kxend[9]) / 20.;
+    yccc    = (kybeg[9] + kyend[9]) / 20.;
+    if (kxx[9] == kxx[10]) {
       offset2 = 0.;
     } else {
-      r1 = yy[10] - yy[9];
-      r2 = xx[10] - xx[9];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[10] - kyy[9];
+      r2 = kxx[10] - kxx[9];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
     ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos  = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta1011 = (i-1) * 36. + offset1 + offset2 - gteta;
+    atheta1011 = (i-1) * 36. + offset1 + offset2 - kgteta;
     AliMatrix(idrotm[(i-1) * 13 + 1109], 90., atheta1011, 90.,atheta1011 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", dsup, 3);
     
     // --- Place part # 13-14 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[12] - xbeg[12]) * (xend[12] - xbeg[12]) + (yend[12] - ybeg[12]) * (yend[12] - ybeg[12])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[12] - kxbeg[12]) * (kxend[12] - kxbeg[12]) + (kyend[12] - kybeg[12]) * (kyend[12] - kybeg[12])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[12] + xx[13]) / 20.;
-    ycc     = (yy[12] + yy[13]) / 20.;
-    xccc    = (xbeg[12] + xend[12]) / 20.;
-    yccc    = (ybeg[12] + yend[12]) / 20.;
-    if (xx[12] == xx[13]) {
+    xcc     = (kxx[12] + kxx[13]) / 20.;
+    ycc     = (kyy[12] + kyy[13]) / 20.;
+    xccc    = (kxbeg[12] + kxend[12]) / 20.;
+    yccc    = (kybeg[12] + kyend[12]) / 20.;
+    if (kxx[12] == kxx[13]) {
       offset2 = 0.;
     } else {
-      r1 = yy[12] - yy[13];
-      r2 = xx[12] - xx[13];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[12] - kyy[13];
+      r2 = kxx[12] - kxx[13];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
     ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos  = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta1314 = (i-1) * 36. + offset1 + offset2 - gteta;
+    atheta1314 = (i-1) * 36. + offset1 + offset2 - kgteta;
     AliMatrix(idrotm[(i-1) * 13 + 1112], 90., atheta1314, 90.,atheta1314 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", dsup, 3);
     
     // --- Place an element of layer #1 
     
-    biga   = (yy[13] - yy[12]) / (xx[13] - xx[12]);
-    bigb   = (xx[13] * yy[12] - xx[12] * yy[13]) / (xx[13] - xx[12]) / 10.;
+    biga   = (kyy[13] - kyy[12]) / (kxx[13] - kxx[12]);
+    bigb   = (kxx[13] * kyy[12] - kxx[12] * kyy[13]) / (kxx[13] - kxx[12]) / 10.;
     coeffa = biga * biga + 1.;
     coeffb = biga * bigb - biga * ycc - xcc;
     coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .050216328100000006;
@@ -770,74 +1008,74 @@ void AliITSv3::CreateGeometry()
     ycc2   = biga1 * xcc2 + bigb1;
     xpos1  = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
     ypos1  = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
-    xpos   = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos   = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos   = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos   = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos   = 0.;
     ++jbox1;
-    pMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
+    gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY");
     
     // --- Place part # 12-13 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[11] - xbeg[11]) * (xend[11] - xbeg[11]) + (yend[11] - ybeg[11]) * (yend[11] - ybeg[11])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[11] - kxbeg[11]) * (kxend[11] - kxbeg[11]) + (kyend[11] - kybeg[11]) * (kyend[11] - kybeg[11])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[11] + xx[12]) / 20.;
-    ycc     = (yy[11] + yy[12]) / 20.;
-    xccc    = (xbeg[11] + xend[11]) / 20.;
-    yccc    = (ybeg[11] + yend[11]) / 20.;
-    if (xx[11] == xx[12]) {
+    xcc     = (kxx[11] + kxx[12]) / 20.;
+    ycc     = (kyy[11] + kyy[12]) / 20.;
+    xccc    = (kxbeg[11] + kxend[11]) / 20.;
+    yccc    = (kybeg[11] + kyend[11]) / 20.;
+    if (kxx[11] == kxx[12]) {
       offset2 = 0.;
     } else {
-      r1 = yy[12] - yy[11];
-      r2 = xx[12] - xx[11];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[12] - kyy[11];
+      r2 = kxx[12] - kxx[11];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
     ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos  = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta1213 = (i-1) * 36. + offset1 + offset2 - gteta;
+    atheta1213 = (i-1) * 36. + offset1 + offset2 - kgteta;
     AliMatrix(idrotm[(i-1) * 13 + 1111], 90., atheta1213, 90.,atheta1213 + 90., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", dsup, 3);
     
     // --- Place part # 11-12 (see sketch) 
     
     offset1 = -35.;
     dsup[0] = .01;
-    dsup[1] = TMath::Sqrt((xend[10] - xbeg[10]) * (xend[10] - xbeg[10]) + (yend[10] - ybeg[10]) * (yend[10] - ybeg[10])) / 20.;
+    dsup[1] = TMath::Sqrt((kxend[10] - kxbeg[10]) * (kxend[10] - kxbeg[10]) + (kyend[10] - kybeg[10]) * (kyend[10] - kybeg[10])) / 20.;
     dsup[2] = 25.;
-    xcc     = (xx[10] + xx[11]) / 20.;
-    ycc     = (yy[10] + yy[11]) / 20.;
-    xccc    = (xbeg[10] + xend[10]) / 20.;
-    yccc    = (ybeg[10] + yend[10]) / 20.;
-    if (xx[10] == xx[11]) {
+    xcc     = (kxx[10] + kxx[11]) / 20.;
+    ycc     = (kyy[10] + kyy[11]) / 20.;
+    xccc    = (kxbeg[10] + kxend[10]) / 20.;
+    yccc    = (kybeg[10] + kyend[10]) / 20.;
+    if (kxx[10] == kxx[11]) {
       offset2 = 0.;
     } else {
-      r1 = yy[11] - yy[10];
-      r2 = xx[11] - xx[10];
-      offset2 = TMath::ATan2(r1, r2) * raddeg - 90.;
+      r1 = kyy[11] - kyy[10];
+      r2 = kxx[11] - kxx[10];
+      offset2 = TMath::ATan2(r1, r2) * kraddeg - 90.;
     }
-    aphi  = (pphi + (i-1) * 36.) * degrad;
-    xzero = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    aphi  = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1 = xccc * TMath::Cos(aphi) - yccc * TMath::Sin(aphi) + xzero;
     ypos1 = xccc * TMath::Sin(aphi) + yccc * TMath::Cos(aphi) + yzero;
-    xpos  = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos  = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos  = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos  = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos  = 0.;
-    atheta1112 = (i-1) * 36. + offset1 + offset2 - gteta;
+    atheta1112 = (i-1) * 36. + offset1 + offset2 - kgteta;
     AliMatrix(idrotm[(i-1) * 13 + 1110], 270., atheta1112, 90., atheta1112 + 270., 0., 0.);
-    pMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
+    gMC->Gsposp("SPIX", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", dsup, 3);
 
     // --- Place an element of layer #1 
     
-    biga   = (yy[11] - yy[10]) / (xx[11] - xx[10]);
-    bigb   = (xx[11] * yy[10] - xx[10] * yy[11]) / (xx[11] - xx[10]) / 10.;
+    biga   = (kyy[11] - kyy[10]) / (kxx[11] - kxx[10]);
+    bigb   = (kxx[11] * kyy[10] - kxx[10] * kyy[11]) / (kxx[11] - kxx[10]) / 10.;
     coeffa = biga * biga + 1.;
     coeffb = biga * bigb - biga * ycc - xcc;
     coeffc = xcc * xcc + ycc * ycc - ycc * 2. * bigb + bigb * bigb - .0035712576000000002;
@@ -852,263 +1090,263 @@ void AliITSv3::CreateGeometry()
     ycc2   = biga1 * xcc2 + bigb1;
     xpos1  = xcc2 * TMath::Cos(aphi) - ycc2 * TMath::Sin(aphi) + xzero;
     ypos1  = xcc2 * TMath::Sin(aphi) + ycc2 * TMath::Cos(aphi) + yzero;
-    xpos   = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos   = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos   = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos   = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos   = 0.;
     ++jbox1;
-    pMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
+    gMC->Gspos("IPV1", jbox1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY");
     
     // --- Place arc # 13 (between part 1-2 and part 2-3) (see sketch) 
     
-    darc[0] = rarc[12] / 10. - .02;
-    darc[1] = rarc[12] / 10.;
+    darc[0] = krarc[12] / 10. - .02;
+    darc[1] = krarc[12] / 10.;
     darc[2] = 25.;
     darc[3] = atheta12 - (i-1) * 36.;
     darc[4] = atheta23 - (i-1) * 36.;
-    xcc     = xarc[12] / 10.;
-    ycc     = yarc[12] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[12] / 10.;
+    ycc     = kyarc[12] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 13, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1112], "ONLY", darc, 5);
     
     // --- Place arc # 12 (between part 2-3 and part 3-4) (see sketch) 
     
-    darc[0] = rarc[11] / 10. - .02;
-    darc[1] = rarc[11] / 10.;
+    darc[0] = krarc[11] / 10. - .02;
+    darc[1] = krarc[11] / 10.;
     darc[2] = 25.;
     darc[3] = atheta23 + 90. - (i-1) * 36.;
     darc[4] = atheta34 + 90. - (i-1) * 36.;
-    xcc     = xarc[11] / 10.;
-    ycc     = yarc[11] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[11] / 10.;
+    ycc     = kyarc[11] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 12, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1111], "ONLY", darc, 5);
     
     // --- Place arc # 11 (between part 3-4 and part 4-5) (see sketch) 
     
-    darc[0] = rarc[10] / 10. - .02;
-    darc[1] = rarc[10] / 10.;
+    darc[0] = krarc[10] / 10. - .02;
+    darc[1] = krarc[10] / 10.;
     darc[2] = 25.;
     darc[3] = atheta45 + 180. - (i-1) * 36.;
     darc[4] = atheta34 + 180. - (i-1) * 36.;
-    xcc     = xarc[10] / 10.;
-    ycc     = yarc[10] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[10] / 10.;
+    ycc     = kyarc[10] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 11, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1110], "ONLY", darc, 5);
     
     // --- Place arc # 10 (between part 4-5 and part 5-6) (see sketch) 
     
-    darc[0] = rarc[9] / 10. - .02;
-    darc[1] = rarc[9] / 10.;
+    darc[0] = krarc[9] / 10. - .02;
+    darc[1] = krarc[9] / 10.;
     darc[2] = 25.;
     darc[3] = atheta45 - 90. - (i-1) * 36.;
     darc[4] = atheta56 - 90. - (i-1) * 36.;
-    xcc     = xarc[9] / 10.;
-    ycc     = yarc[9] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[9] / 10.;
+    ycc     = kyarc[9] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 10, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1109], "ONLY", darc, 5);
     
     // --- Place arc # 9 (between part 5-6 and part) (see sketch) 
     
-    darc[0] = rarc[8] / 10. - .02;
-    darc[1] = rarc[8] / 10.;
+    darc[0] = krarc[8] / 10. - .02;
+    darc[1] = krarc[8] / 10.;
     darc[2] = 25.;
     darc[3] = atheta67 + 45. - (i-1) * 36.;
     darc[4] = atheta56 + 45. - (i-1) * 36.;
-    xcc     = xarc[8] / 10.;
-    ycc     = yarc[8] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[8] / 10.;
+    ycc     = kyarc[8] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 9, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1108], "ONLY", darc, 5);
     
     // --- Place arc # 8 (between part 6-7 and part 7-8) (see sketch) 
     
-    darc[0] = rarc[7] / 10. - .02;
-    darc[1] = rarc[7] / 10.;
+    darc[0] = krarc[7] / 10. - .02;
+    darc[1] = krarc[7] / 10.;
     darc[2] = 25.;
     darc[3] = atheta67 - (i-1) * 36.;
     darc[4] = atheta78 - (i-1) * 36.;
-    xcc     = xarc[7] / 10.;
-    ycc     = yarc[7] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[7] / 10.;
+    ycc     = kyarc[7] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 8, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1107], "ONLY", darc, 5);
     
     // --- Place arc # 7 (between part 7-8 and part 8-9) (see sketch) 
     
-    darc[0] = rarc[6] / 10. - .02;
-    darc[1] = rarc[6] / 10.;
+    darc[0] = krarc[6] / 10. - .02;
+    darc[1] = krarc[6] / 10.;
     darc[2] = 25.;
     darc[3] = atheta89 + 45. - (i-1) * 36.;
     darc[4] = atheta78 + 45. - (i-1) * 36.;
-    xcc     = xarc[6] / 10.;
-    ycc     = yarc[6] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[6] / 10.;
+    ycc     = kyarc[6] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 7, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1106], "ONLY", darc, 5);
     
     // --- Place arc # 6 (between part 8-9 and part 9-10) (see sketch) 
     
-    darc[0] = rarc[5] / 10. - .02;
-    darc[1] = rarc[5] / 10.;
+    darc[0] = krarc[5] / 10. - .02;
+    darc[1] = krarc[5] / 10.;
     darc[2] = 25.;
     darc[3] = atheta89 + 45. - (i-1) * 36.;
     darc[4] = atheta910 + 45. - (i-1) * 36.;
-    xcc     = xarc[5] / 10.;
-    ycc     = yarc[5] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[5] / 10.;
+    ycc     = kyarc[5] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 6, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1105], "ONLY", darc, 5);
     
     // --- Place arc # 5 (between part 9-10 and part 10-11) 
     //     (see sketch) 
     
-    darc[0] = rarc[4] / 10. - .02;
-    darc[1] = rarc[4] / 10.;
+    darc[0] = krarc[4] / 10. - .02;
+    darc[1] = krarc[4] / 10.;
     darc[2] = 25.;
     darc[3] = atheta1011 + 45. - (i-1) * 36.;
     darc[4] = atheta910 + 45. - (i-1) * 36.;
-    xcc     = xarc[4] / 10.;
-    ycc     = yarc[4] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[4] / 10.;
+    ycc     = kyarc[4] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 5, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1104], "ONLY", darc, 5);
     
     // --- Place arc # 4 (between part 10-11 and part 11-12) 
     //     (see sketch) 
     
-    darc[0] = rarc[3] / 10. - .02;
-    darc[1] = rarc[3] / 10.;
+    darc[0] = krarc[3] / 10. - .02;
+    darc[1] = krarc[3] / 10.;
     darc[2] = 25.;
     darc[3] = atheta1112 - 45. - (i-1) * 36.;
     darc[4] = atheta1011 - 225. - (i-1) * 36.;
-    xcc     = xarc[3] / 10.;
-    ycc     = yarc[3] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[3] / 10.;
+    ycc     = kyarc[3] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 4, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1103], "ONLY", darc, 5);
     
     // --- Place arc # 3 (between part 11-12 and part 12-13) 
     //     (see sketch) 
     
-    darc[0] = rarc[2] / 10. - .02;
-    darc[1] = rarc[2] / 10.;
+    darc[0] = krarc[2] / 10. - .02;
+    darc[1] = krarc[2] / 10.;
     darc[2] = 25.;
     darc[3] = atheta1112 - 90. - (i-1) * 36.;
     darc[4] = atheta1213 - 90. - (i-1) * 36.;
-    xcc     = xarc[2] / 10.;
-    ycc     = yarc[2] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[2] / 10.;
+    ycc     = kyarc[2] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 3, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1102], "ONLY", darc, 5);
     
     // --- Place arc # 2 (between part 12-13 and part 13-14) 
     //     (see sketch) 
     
-    darc[0] = rarc[1] / 10. - .02;
-    darc[1] = rarc[1] / 10.;
+    darc[0] = krarc[1] / 10. - .02;
+    darc[1] = krarc[1] / 10.;
     darc[2] = 25.;
     darc[3] = atheta1213 + 135. - (i-1) * 36.;
     darc[4] = atheta1314 + 165. - (i-1) * 36.;
-    xcc     = xarc[1] / 10.;
-    ycc     = yarc[1] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[1] / 10.;
+    ycc     = kyarc[1] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 2, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1101], "ONLY", darc, 5);
     
     // --- Place arc # 1 (between part 13-14 and part 1-2) 
     //     (see sketch) 
     
-    darc[0] = rarc[0] / 10. - .02;
-    darc[1] = rarc[0] / 10.;
+    darc[0] = krarc[0] / 10. - .02;
+    darc[1] = krarc[0] / 10.;
     darc[2] = 25.;
     darc[3] = atheta12 + 45. - (i-1) * 36.;
     darc[4] = atheta1314 - (i-1) * 36.;
-    xcc     = xarc[0] / 10.;
-    ycc     = yarc[0] / 10.;
-    aphi    = (pphi + (i-1) * 36.) * degrad;
-    xzero   = rr * TMath::Cos((tteta + (i-1) * 36.) * degrad);
-    yzero   = rr * TMath::Sin((tteta + (i-1) * 36.) * degrad);
+    xcc     = kxarc[0] / 10.;
+    ycc     = kyarc[0] / 10.;
+    aphi    = (kpphi + (i-1) * 36.) * kdegrad;
+    xzero   = krr * TMath::Cos((ktteta + (i-1) * 36.) * kdegrad);
+    yzero   = krr * TMath::Sin((ktteta + (i-1) * 36.) * kdegrad);
     xpos1   = xcc * TMath::Cos(aphi) - ycc * TMath::Sin(aphi) + xzero;
     ypos1   = xcc * TMath::Sin(aphi) + ycc * TMath::Cos(aphi) + yzero;
-    xpos    = xpos1 * TMath::Cos(gteta * degrad) + ypos1 * TMath::Sin(gteta *degrad);
-    ypos    = -xpos1 * TMath::Sin(gteta * degrad) + ypos1 * TMath::Cos(gteta * degrad);
+    xpos    = xpos1 * TMath::Cos(kgteta * kdegrad) + ypos1 * TMath::Sin(kgteta *kdegrad);
+    ypos    = -xpos1 * TMath::Sin(kgteta * kdegrad) + ypos1 * TMath::Cos(kgteta * kdegrad);
     zpos    = 0.;
-    pMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
+    gMC->Gsposp("SARC", (i-1) * 13 + 1, "IT12", xpos, ypos, zpos, idrotm[(i-1) * 13 + 1100], "ONLY", darc, 5);
     
   }
   //************************************************************************
@@ -1137,13 +1375,13 @@ void AliITSv3::CreateGeometry()
   dgh[12] = 25.+(9.-3.01)/xxm+(9.01-9.)/xxm+(27.-9.01)/xxm;
   dgh[13] = 27.;
   dgh[14] = 27.;
-  pMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
+  gMC->Gsvolu("IT34", "PCON", idtmed[275], dgh, 15);
   
   // --- Place the ghost volume in its mother volume (ITSV) and make it 
   //     invisible 
   
-  pMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
-  pMC->Gsatt("IT34", "SEEN", 0);
+  gMC->Gspos("IT34", 1, "ITSV", 0., 0., 0., 0, "ONLY");
+  gMC->Gsatt("IT34", "SEEN", 0);
   
   // --- Layer #3 
   
@@ -1157,11 +1395,11 @@ void AliITSv3::CreateGeometry()
   // the widest element is the sensitive element 
   dbox1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
+  gMC->Gsvolu("IDV1", "BOX ", idtmed[228], dbox1, 3);
   
   // --- Make the ghost volume invisible 
   
-  pMC->Gsatt("IDV1", "SEEN", 0);
+  gMC->Gsatt("IDV1", "SEEN", 0);
   
   // --- Define a volume containing the sensitive part of drifts 
   //     (silicon, layer #3) 
@@ -1170,7 +1408,7 @@ void AliITSv3::CreateGeometry()
   // see material budget report by G. Feofilov 
   dits[1] = 3.85;
   dits[2] = 4.35;
-  pMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
+  gMC->Gsvolu("ITS3", "BOX ", idtmed[224], dits, 3);
   
   //--- Define the part of the (smaller) rib between two sensitive parts made of
   //     carbon (layer #3) 
@@ -1179,7 +1417,7 @@ void AliITSv3::CreateGeometry()
   dsup[1] = .01;
   dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
+  gMC->Gsvolu("IR11", "BOX ", idtmed[227], dsup, 3);
   
   //--- Define the first part of the (smaller) rib between two sensitive parts
   //     made of aluminum (layer #3) 
@@ -1188,7 +1426,7 @@ void AliITSv3::CreateGeometry()
   dal1[1] = 0.00096/2.;
   dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
+  gMC->Gsvolu("IR12", "BOX ", idtmed[230], dal1, 3);
   
   //--- Define the part of the (smaller) rib between two sensitive parts made of
   //     kapton (layer #3) 
@@ -1197,7 +1435,7 @@ void AliITSv3::CreateGeometry()
   dkap[1] = .01585;
   dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
+  gMC->Gsvolu("IR13", "BOX ", idtmed[236], dkap, 3);
   
   //--- Define the second part of the (smaller) rib between two sensitive parts
   //     made of aluminum (layer #3) 
@@ -1206,7 +1444,7 @@ void AliITSv3::CreateGeometry()
   dal2[1] = 0.0027/2.;
   dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
+  gMC->Gsvolu("IR14", "BOX ", idtmed[230], dal2, 3);
   
   // --- Define the part of the (smaller) rib between two sensitive parts 
   //     made of silicon (the electronics) (layer #3) 
@@ -1215,7 +1453,7 @@ void AliITSv3::CreateGeometry()
   dchi[1] = 0.0071/2.;
   dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
+  gMC->Gsvolu("IR15", "BOX ", idtmed[225], dal2, 3);
   
   // --- Define the part of the (smaller) rib between two sensitive parts 
   //     made of water (the cooler) (layer #3) 
@@ -1224,7 +1462,7 @@ void AliITSv3::CreateGeometry()
   dwat[1] = 0.0093/2.;
   dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
+  gMC->Gsvolu("IR16", "BOX ", idtmed[231], dwat, 3);
   
   //--- Define the third part of the (smaller) rib between two sensitive parts
   //     made of aluminum (the cooling tubes) (layer #3) 
@@ -1233,7 +1471,7 @@ void AliITSv3::CreateGeometry()
   dtub[1] = 0.00134/2.;
   dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
+  gMC->Gsvolu("IR17", "BOX ", idtmed[230], dtub, 3);
   
   // --- Define the part of the end-ladder stuff made of PCB (layer #3) 
   
@@ -1241,7 +1479,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dpcb[1] = 3.5;
   dpcb[2] = 7.5;
-  pMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
+  gMC->Gsvolu("IEL1", "BOX ", idtmed[233], dpcb, 3);
   
   // --- Define the part of the end-ladder stuff made of copper (layer #3) 
   
@@ -1249,7 +1487,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dcop[1] = 3.5;
   dcop[2] = 7.5;
-  pMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
+  gMC->Gsvolu("IEL2", "BOX ", idtmed[234], dcop, 3);
   
   // --- Define the part of the end-ladder stuff made of ceramics (layer #3)
   
@@ -1257,7 +1495,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dcer[1] = 3.5;
   dcer[2] = 7.5;
-  pMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
+  gMC->Gsvolu("IEL3", "BOX ", idtmed[235], dcer, 3);
   
   // --- Define the part of the end-ladder stuff made of silicon (layer #3) 
   
@@ -1265,7 +1503,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dsil[1] = 3.5;
   dsil[2] = 7.5;
-  pMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
+  gMC->Gsvolu("IEL4", "BOX ", idtmed[226], dsil, 3);
   
   //--- Place the sensitive part of the drifts (smaller ribs) into its mother
   //     (IDV1) 
@@ -1289,7 +1527,7 @@ void AliITSv3::CreateGeometry()
       xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
       zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
     }
-    pMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ITS3", j, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   }
   
   // --- Place the smaller ribs into their mother (IDV1) 
@@ -1302,76 +1540,76 @@ void AliITSv3::CreateGeometry()
   // --- Carbon 
   
   ypos = 2.81;
-  pMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR11", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = dsup[1] + 2.81 + dal1[1];
-  pMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR12", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
-  pMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR13", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
 
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
-  pMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR14", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
-  pMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR15", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
-  pMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR16", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. 
     + dtub[1];
-  pMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR17", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Right ribs (just a matter of convention) 
   
   // --- Carbon 
   
   ypos = -2.81;
-  pMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR11", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = -(dsup[1] + 2.81 + dal1[1]);
-  pMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR12", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
-  pMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR13", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
-  pMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR14", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
-  pMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR15", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
-  pMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR16", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
-  pMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR17", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the end-ladder stuff into its mother (IDV1) 
   
@@ -1384,22 +1622,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox1[0] - dpcb[0];
-  pMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL1", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL2", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL3", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL4", 1, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Positive-Z end-ladder 
   
@@ -1409,22 +1647,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox1[0] - dpcb[0];
-  pMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL1", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
 
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL2", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL3", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL4", 2, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   //--- Define a ghost volume containing a single ladder of layer #3 (with the
   //     larger lenght of ribs) and fill it with air or vacuum 
@@ -1434,11 +1672,11 @@ void AliITSv3::CreateGeometry()
   // the widest element is the sensitive element 
   dbox2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
+  gMC->Gsvolu("IDV2", "BOX ", idtmed[228], dbox2, 3);
   
   // --- Make the ghost volume invisible 
   
-  pMC->Gsatt("IDV2", "SEEN", 0);
+  gMC->Gsatt("IDV2", "SEEN", 0);
   
   //--- Define the part of the (larger) rib between two sensitive parts madeof
   //     carbon (layer #3) 
@@ -1447,7 +1685,7 @@ void AliITSv3::CreateGeometry()
   dsup[1] = .01;
   dsup[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
+  gMC->Gsvolu("IR21", "BOX ", idtmed[227], dsup, 3);
   
   //--- Define the first part of the (larger) rib between two sensitive parts
   //     made of aluminum (layer #3) 
@@ -1456,7 +1694,7 @@ void AliITSv3::CreateGeometry()
   dal1[1] = 0.00096/2.;
   dal1[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
+  gMC->Gsvolu("IR22", "BOX ", idtmed[230], dal1, 3);
   
   //--- Define the part of the (larger) rib between two sensitive parts madeof
   //     kapton (layer #3) 
@@ -1465,7 +1703,7 @@ void AliITSv3::CreateGeometry()
   dkap[1] = 0.0317/2.;
   dkap[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
+  gMC->Gsvolu("IR23", "BOX ", idtmed[236], dkap, 3);
   
   //--- Define the second part of the (larger) rib between two sensitive parts
   //     made of aluminum (layer #3) 
@@ -1474,7 +1712,7 @@ void AliITSv3::CreateGeometry()
   dal2[1] = 0.0027/2.;
   dal2[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
+  gMC->Gsvolu("IR24", "BOX ", idtmed[230], dal2, 3);
   
   // --- Define the part of the (larger) rib between two sensitive parts 
   //     made of silicon (the electronics) (layer #3) 
@@ -1483,7 +1721,7 @@ void AliITSv3::CreateGeometry()
   dchi[1] = 0.0071/2.;
   dchi[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
+  gMC->Gsvolu("IR25", "BOX ", idtmed[225], dal2, 3);
   
   // --- Define the part of the (larger) rib between two sensitive parts 
   //     made of water (the cooler) (layer #3) 
@@ -1492,7 +1730,7 @@ void AliITSv3::CreateGeometry()
   dwat[1] = 0.0093/2.;
   dwat[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
+  gMC->Gsvolu("IR26", "BOX ", idtmed[231], dwat, 3);
   
   //--- Define the third part of the (larger) rib between two sensitive parts
   //     made of aluminum (the cooling tubes) (layer #3) 
@@ -1501,7 +1739,7 @@ void AliITSv3::CreateGeometry()
   dtub[1] = 0.00134/2.;
   dtub[2] = (8.7*5.-2.*1.+2.*0.1)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
+  gMC->Gsvolu("IR27", "BOX ", idtmed[230], dtub, 3);
   
   //--- Place the sensitive part of the drifts (smaller ribs) into its mother
   //     (IDV2) 
@@ -1525,7 +1763,7 @@ void AliITSv3::CreateGeometry()
       xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
       zpos = dits[2] + 0. - 1. + dits[2] * 2. + .1 + dits[2];
     }
-    pMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ITS3", j, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   }
   
   // --- Place the larger ribs into their mother (IDV2) 
@@ -1539,74 +1777,74 @@ void AliITSv3::CreateGeometry()
   // --- Carbon 
   
   ypos = 2.81;
-  pMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR21", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = dsup[1] + 2.81 + dal1[1];
-  pMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR22", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
-  pMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR23", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
-  pMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR24", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
-  pMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR25", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
-  pMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR26", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1];
-  pMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR27", 1, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Right ribs (just a matter of convention) 
   
   // --- Carbon 
   
   ypos = -2.81;
-  pMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR21", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = -(dsup[1] + 2.81 + dal1[1]);
-  pMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR22", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
-  pMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR23", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1]);
-  pMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR24", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1]);
-  pMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR25", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
-  pMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR26", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
-  pMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR27", 2, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the end-ladder stuff into its mother (IDV1) 
   
@@ -1619,22 +1857,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox2[0] - dpcb[0];
-  pMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL1", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL2", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL3", 3, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL4", 3, "IDV1", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Positive-Z end-ladder 
   
@@ -1644,22 +1882,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox2[0] - dpcb[0];
-  pMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL1", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL2", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL3", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL4", 4, "IDV2", xpos, ypos, zpos, 0, "ONLY");
   
   //--- Place the ghost volumes containing the drift ladders of layer #3 in their
   //     mother volume (IT34) 
@@ -1670,16 +1908,16 @@ void AliITSv3::CreateGeometry()
     AliMatrix(idrotm[i+1299], 90., atheta, 90., atheta + 90., 0.,0.);
     if (i % 2 == 0) {
       rzero = 14.;
-      xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
       zpos = 0.;
-      pMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
+      gMC->Gspos("IDV1", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
     } else {
       rzero = 13.85;
-      xpos = rzero * TMath::Cos((i-1) * twopi / 12.);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 12.);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 12.);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 12.);
       zpos = 0.;
-      pMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
+      gMC->Gspos("IDV2", i, "IT34", xpos, ypos, zpos, idrotm[i+1299], "ONLY");
     }
   }
   
@@ -1696,11 +1934,11 @@ void AliITSv3::CreateGeometry()
   // the widest element is the end-ladder stuff 
   dbox1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
+  gMC->Gsvolu("IDV3", "BOX ", idtmed[228], dbox1, 3);
   
   // --- Make the ghost volume invisible 
   
-  pMC->Gsatt("IDV3", "SEEN", 0);
+  gMC->Gsatt("IDV3", "SEEN", 0);
   
   // --- Define a volume containing the sensitive part of drifts 
   //     (silicon, layer #4) 
@@ -1709,7 +1947,7 @@ void AliITSv3::CreateGeometry()
   // see material budget report by G. Feofilov 
   dits[1] = 3.125;
   dits[2] = 4.35;
-  pMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
+  gMC->Gsvolu("ITS4", "BOX ", idtmed[224], dits, 3);
   
   //--- Define the part of the (smaller) rib between two sensitive parts made of
   //     carbon (layer #4) 
@@ -1718,7 +1956,7 @@ void AliITSv3::CreateGeometry()
   dsup[1] = .01;
   dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
+  gMC->Gsvolu("IR31", "BOX ", idtmed[227], dsup, 3);
   
   //--- Define the first part of the (smaller) rib between two sensitive parts
   //     made of aluminum (layer #4) 
@@ -1727,7 +1965,7 @@ void AliITSv3::CreateGeometry()
   dal1[1] = 0.00096/2.;
   dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
+  gMC->Gsvolu("IR32", "BOX ", idtmed[230], dal1, 3);
   
   //--- Define the part of the (smaller) rib between two sensitive parts made of
   //     kapton (layer #4) 
@@ -1736,7 +1974,7 @@ void AliITSv3::CreateGeometry()
   dkap[1] = 0.0317/2.;
   dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
+  gMC->Gsvolu("IR33", "BOX ", idtmed[236], dkap, 3);
   
   //--- Define the second part of the (smaller) rib between two sensitive parts
   //     made of aluminum (layer #4) 
@@ -1745,7 +1983,7 @@ void AliITSv3::CreateGeometry()
   dal2[1] = 0.0027/2.;
   dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
+  gMC->Gsvolu("IR34", "BOX ", idtmed[230], dal2, 3);
   
   // --- Define the part of the (smaller) rib between two sensitive parts 
   //     made of silicon (the electronics) (layer #4) 
@@ -1754,7 +1992,7 @@ void AliITSv3::CreateGeometry()
   dchi[1] = 0.0071/2.;
   dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
+  gMC->Gsvolu("IR35", "BOX ", idtmed[225], dal2, 3);
   
   // --- Define the part of the (smaller) rib between two sensitive parts 
   //     made of water (the cooler) (layer #4) 
@@ -1763,7 +2001,7 @@ void AliITSv3::CreateGeometry()
   dwat[1] = 0.0093/2.;
   dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
+  gMC->Gsvolu("IR36", "BOX ", idtmed[231], dwat, 3);
   
   //--- Define the third part of the (smaller) rib between two sensitive parts
   //     made of aluminum (the cooling tubes) (layer #4) 
@@ -1772,7 +2010,7 @@ void AliITSv3::CreateGeometry()
   dtub[1] = 0.00134/2.;
   dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
+  gMC->Gsvolu("IR37", "BOX ", idtmed[230], dtub, 3);
   
   // --- Define the part of the end-ladder stuff made of PCB (layer #4) 
   
@@ -1780,7 +2018,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dpcb[1] = 3.5;
   dpcb[2] = 7.5;
-  pMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
+  gMC->Gsvolu("IEL5", "BOX ", idtmed[233], dpcb, 3);
   
   // --- Define the part of the end-ladder stuff made of copper (layer #4) 
   
@@ -1788,7 +2026,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dcop[1] = 3.5;
   dcop[2] = 7.5;
-  pMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
+  gMC->Gsvolu("IEL6", "BOX ", idtmed[234], dcop, 3);
   
   // --- Define the part of the end-ladder stuff made of ceramics (layer #4)
   
@@ -1796,7 +2034,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dcer[1] = 3.5;
   dcer[2] = 7.5;
-  pMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
+  gMC->Gsvolu("IEL7", "BOX ", idtmed[235], dcer, 3);
   
   // --- Define the part of the end-ladder stuff made of silicon (layer #4) 
   
@@ -1804,7 +2042,7 @@ void AliITSv3::CreateGeometry()
   // twice the foreseen thickness 
   dsil[1] = 3.5;
   dsil[2] = 7.5;
-  pMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
+  gMC->Gsvolu("IEL8", "BOX ", idtmed[226], dsil, 3);
   
   //--- Place the sensitive part of the drifts (smaller ribs) into its mother
   //     (IDV3) 
@@ -1834,7 +2072,7 @@ void AliITSv3::CreateGeometry()
       xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
       zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
     }
-    pMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ITS4", j, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   }
   
   // --- Place the smaller ribs into their mother (IDV3) 
@@ -1847,80 +2085,80 @@ void AliITSv3::CreateGeometry()
   // --- Carbon 
   
   ypos = 2.81;
-  pMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR31", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = dsup[1] + 2.81 + dal1[1];
-  pMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR32", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
 
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
-  pMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR33", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
-  pMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR34", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
-  pMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR35", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
-  pMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR36", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. 
     + dtub[1];
-  pMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR37", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Right ribs (just a matter of convention) 
   
   // --- Carbon 
   
   ypos = -2.81;
-  pMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR31", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = -(dsup[1] + 2.81 + dal1[1]);
-  pMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR32", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
-  pMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR33", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1]);
-  pMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR34", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1]);
-  pMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR35", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
-  pMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR36", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 
           2. + dtub[1]);
-  pMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR37", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the end-ladder stuff into its mother (IDV1) 
   
@@ -1933,22 +2171,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox1[0] - dpcb[0];
-  pMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL5", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL6", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL7", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL8", 1, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Positive-Z end-ladder 
   
@@ -1958,22 +2196,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox1[0] - dpcb[0];
-  pMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL5", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL6", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL7", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox1[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL8", 2, "IDV3", xpos, ypos, zpos, 0, "ONLY");
   
   //--- Define a ghost volume containing a single ladder of layer #4 (with the
   //     larger lenght of ribs) and fill it with air or vacuum 
@@ -1983,11 +2221,11 @@ void AliITSv3::CreateGeometry()
   // the widest element is the end-ladder stuff 
   dbox2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lenght 
-  pMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
+  gMC->Gsvolu("IDV4", "BOX ", idtmed[228], dbox2, 3);
   
   // --- Make the ghost volume invisible 
   
-  pMC->Gsatt("IDV4", "SEEN", 0);
+  gMC->Gsatt("IDV4", "SEEN", 0);
   
   //--- Define the part of the (larger) rib between two sensitive parts madeof
   //     carbon (layer #4) 
@@ -1996,7 +2234,7 @@ void AliITSv3::CreateGeometry()
   dsup[1] = .01;
   dsup[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
+  gMC->Gsvolu("IR41", "BOX ", idtmed[227], dsup, 3);
   
   //--- Define the first part of the (larger) rib between two sensitive parts
   //     made of aluminum (layer #4) 
@@ -2005,7 +2243,7 @@ void AliITSv3::CreateGeometry()
   dal1[1] = 0.00096/2.;
   dal1[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
+  gMC->Gsvolu("IR42", "BOX ", idtmed[230], dal1, 3);
   
   //--- Define the part of the (larger) rib between two sensitive parts madeof
   //     kapton (layer #4) 
@@ -2014,7 +2252,7 @@ void AliITSv3::CreateGeometry()
   dkap[1] = 0.0317/2.;
   dkap[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
+  gMC->Gsvolu("IR43", "BOX ", idtmed[236], dkap, 3);
   
   //--- Define the second part of the (larger) rib between two sensitive parts
   //     made of aluminum (layer #4) 
@@ -2023,7 +2261,7 @@ void AliITSv3::CreateGeometry()
   dal2[1] = 0.0027/2.;
   dal2[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
+  gMC->Gsvolu("IR44", "BOX ", idtmed[230], dal2, 3);
   
   // --- Define the part of the (larger) rib between two sensitive parts 
   //     made of silicon (the electronics) (layer #4) 
@@ -2032,7 +2270,7 @@ void AliITSv3::CreateGeometry()
   dchi[1] = 0.0071/2.;
   dchi[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
+  gMC->Gsvolu("IR45", "BOX ", idtmed[225], dal2, 3);
   
   // --- Define the part of the (larger) rib between two sensitive parts 
   //     made of water (the cooler) (layer #4) 
@@ -2041,7 +2279,7 @@ void AliITSv3::CreateGeometry()
   dwat[1] = 0.0093/2.;
   dwat[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
+  gMC->Gsvolu("IR46", "BOX ", idtmed[231], dwat, 3);
   
   //--- Define the third part of the (larger) rib between two sensitive parts
   //     made of aluminum (the cooling tubes) (layer #4) 
@@ -2050,7 +2288,7 @@ void AliITSv3::CreateGeometry()
   dtub[1] = 0.00134/2.;
   dtub[2] = (8.7*7.-2.*0.7-2.*1.3)/2.+2.*7.5;
   // 7.5 cm is the lengh 
-  pMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
+  gMC->Gsvolu("IR47", "BOX ", idtmed[230], dtub, 3);
   
   //--- Place the sensitive part of the drifts (smaller ribs) into its mother
   //     (IDV4) 
@@ -2080,7 +2318,7 @@ void AliITSv3::CreateGeometry()
       xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0] * 2. - dits[0];
       zpos = dits[2] + 0. - .7 + dits[2] * 2. + 0. + dits[2] * 2. - 1.3 + dits[2];
     }
-    pMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ITS4", j, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   }
   
   // --- Place the larger ribs into their mother (IDV4) 
@@ -2094,79 +2332,79 @@ void AliITSv3::CreateGeometry()
   // --- Carbon 
   
   ypos = 2.81;
-  pMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR41", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = dsup[1] + 2.81 + dal1[1];
-  pMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR42", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1];
-  pMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR43", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1];
-  pMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR44", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1];
-  pMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR45", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1];
-  pMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR46", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. 
     + dtub[1];
-  pMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR47", 1, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Right ribs (just a matter of convention) 
   
   // --- Carbon 
   
   ypos = -2.81;
-  pMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR41", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #1 
   
   ypos = -(dsup[1] + 2.81 + dal1[1]);
-  pMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR42", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Kapton 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1]);
-  pMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR43", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #2 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1]);
-  pMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR44", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (chip) 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1]);
-  pMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR45", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Water 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1]);
-  pMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR46", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Aluminum #3 
   
   ypos = -(dsup[1] + 2.81 + dal1[1] * 2. + dkap[1] * 
           2. + dal2[1] * 2. + dchi[1] * 2. + dwat[1] * 2. + dtub[1]);
-  pMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IR47", 2, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Place the end-ladder stuff into its mother (IDV1) 
   
@@ -2179,22 +2417,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox2[0] - dpcb[0];
-  pMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL5", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL6", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL7", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL8", 3, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Positive-Z end-ladder 
   
@@ -2204,22 +2442,22 @@ void AliITSv3::CreateGeometry()
   // --- PCB 
   
   xpos = dbox2[0] - dpcb[0];
-  pMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL5", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Copper 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0];
-  pMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL6", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Ceramics 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0];
-  pMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL7", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   // --- Silicon (bus) 
   
   xpos = dbox2[0] - dpcb[0] * 2. - dcop[0] * 2. - dcer[0] * 2. - dsil[0];
-  pMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("IEL8", 4, "IDV4", xpos, ypos, zpos, 0, "ONLY");
   
   //--- Place the ghost volumes containing the drift ladders of layer #4 in their
   //     mother volume (IT34) 
@@ -2230,16 +2468,16 @@ void AliITSv3::CreateGeometry()
     AliMatrix(idrotm[i+1399], 90., atheta, 90., atheta + 90., 0.,0.);
     if (i % 2 == 0) {
       rzero = 23.5;
-      xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
       zpos = 0.;
-      pMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
+      gMC->Gspos("IDV3", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
     } else {
       rzero = (24.0+22.8)/2.;
-      xpos = rzero * TMath::Cos((i-1) * twopi / 24.);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 24.);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 24.);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 24.);
       zpos = 0.;
-      pMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
+      gMC->Gspos("IDV4", i, "IT34", xpos, ypos, zpos, idrotm[i+1399], "ONLY");
     }
   }
   
@@ -2277,9 +2515,9 @@ void AliITSv3::CreateGeometry()
       (37.-27)/xxm+(49.998-37.)/xxm;
     dgh[13] = 49.998;
     dgh[14] = 49.998;
-    pMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
-    pMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
-    pMC->Gsatt("IT56", "SEEN", 0);
+    gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
+    gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
+    gMC->Gsatt("IT56", "SEEN", 0);
     
     // --- Layer #5 
     
@@ -2291,11 +2529,11 @@ void AliITSv3::CreateGeometry()
     dbox1[0] = (0.0600+2.*0.0150)/2.;
     dbox1[1] = 3.75;
     dbox1[2] = 90.22/2.;
-    pMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
+    gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ISV1", "SEEN", 0);
+    gMC->Gsatt("ISV1", "SEEN", 0);
     
     // --- Define a ghost volume containing the electronics and cooling of
     //     a single ladder of layer #5 and fill it with air or vacuum 
@@ -2303,11 +2541,11 @@ void AliITSv3::CreateGeometry()
     dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
     dsrv[1] = 3.75;
     dsrv[2] = 90.22/2.;
-    pMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
+    gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("SSV1", "SEEN", 0);
+    gMC->Gsatt("SSV1", "SEEN", 0);
     
     // --- Define a ghost volume containing the end-ladder stuff of 
     //     a single ladder of layer #5 and fill it with air or vacuum 
@@ -2315,11 +2553,11 @@ void AliITSv3::CreateGeometry()
     dela[0] = 2.;
     dela[1] = 3.5;
     dela[2] = 4.;
-    pMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
+    gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ELL5", "SEEN", 0);
+    gMC->Gsatt("ELL5", "SEEN", 0);
     
     // --- Define a volume containing the sensitive part of the strips 
     //     (silicon, layer #5) 
@@ -2327,7 +2565,7 @@ void AliITSv3::CreateGeometry()
     dits[0] = .015;
     dits[1] = 3.75;
     dits[2] = 2.1;
-    pMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
+    gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
     
     // --- Define a volume containing the electronics of the strips 
     //     (silicon, layer #5) 
@@ -2335,21 +2573,21 @@ void AliITSv3::CreateGeometry()
     dchi[0] = .02;
     dchi[1] = 3.4;
     dchi[2] = .525;
-    pMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
+    gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
     
     // --- Define the cooling tubes (aluminum, layer #5) 
     
     dtub[0] = .09;
     dtub[1] = dtub[0] + .01;
     dtub[2] = 90.22/2.;
-    pMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
+    gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
     
     // --- Define the cooling fluid (water or freon, layer #5) 
     
     dwat[0] = 0.;
     dwat[1] = .09;
     dwat[2] = 90.22/2.;
-    pMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
+    gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
     //        CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT)   ! freon
     
     //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
@@ -2365,7 +2603,7 @@ void AliITSv3::CreateGeometry()
     dfra[7] = .015;
     dfra[8] = dfra[5];
     dfra[9] = dfra[6];
-    pMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
+    gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
     
     // --- Define the element connecting the triangles of the heat bridge 
     //     (carbon, layer #5) 
@@ -2373,7 +2611,7 @@ void AliITSv3::CreateGeometry()
     dcei[0] = 0.;
     dcei[1] = .03;
     dcei[2] = 90.22/2.;
-    pMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
+    gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
     
     // --- Define the part of the end-ladder stuff made of plastic (G10FR4) 
     //     (layer #5) 
@@ -2381,21 +2619,21 @@ void AliITSv3::CreateGeometry()
     dpla[0] = (10./(8.*7.))/2.;
     dpla[1] = 3.5;
     dpla[2] = 4.;
-    pMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
+    gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
     
     // --- Define the part of the end-ladder stuff made of copper (layer #5) 
     
     dcop[0] = (2./(8.*7.))/2.;
     dcop[1] = 3.5;
     dcop[2] = 4.;
-    pMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
+    gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
     
     // --- Define the part of the end-ladder stuff made of epoxy (layer #5) 
     
     depx[0] = (30./(8.*7.))/2.;
     depx[1] = 3.5;
     depx[2] = 4.;
-    pMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
+    gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
     
     // --- Define the part of the end-ladder stuff made of silicon (bus) 
     //     (layer #5) 
@@ -2403,7 +2641,7 @@ void AliITSv3::CreateGeometry()
     dsil[0] = (20./(8.*7.))/2.;
     dsil[1] = 3.5;
     dsil[2] = 4.;
-    pMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
+    gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
     
     // --- Place the end-ladder stuff into its mother (ELL5) 
     
@@ -2414,22 +2652,22 @@ void AliITSv3::CreateGeometry()
     // --- Plastic 
     
     xpos = -dela[0] + dpla[0];
-    pMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Copper 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
-    pMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Epoxy 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
-    pMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Silicon (bus) 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
-    pMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the sensitive part of the strips into its mother (ISV1) 
     
@@ -2438,7 +2676,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = dbox1[0] - dits[0];
       else            xpos = -dbox1[0] + dits[0];
       zpos = ((j - 1) - 11.) * 3.91;
-      pMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the electronics of the strips into its mother (SSV1) 
@@ -2448,7 +2686,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = -dsrv[0] + .28;
       else            xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
       zpos = ((j - 1) - 11.) * 3.91 + .85;
-      pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
@@ -2459,22 +2697,26 @@ void AliITSv3::CreateGeometry()
     // --- Left tube (just a matter of convention) 
     
     ypos = -2.25-0.1;
-    pMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right tube (just a matter of convention) 
     
     ypos = 2.25+0.1;
-    pMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the heat bridge elements into their mother (SSV1) 
     
     xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 6. * 4.2;
     ypos = 0.;
-    for (j = 1; j <= 24; ++j) {
+    for (j = 1; j <= 23; ++j) { // Loop was to 24. Changed to 23 to fit inside
+                                // volume SSV1. This is the same number of
+                                // elements as SCH5 above. Done Bjorn S. Nilsen
+                                // April 4 2000. Error found by Ivana 
+                                // Hrivnacova March 29 2000.
       zpos = ((j - 1) - 11.) * 3.91 - -4.2/2.;
-      pMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the elements connecting the triangles of the heat bridge 
@@ -2486,19 +2728,19 @@ void AliITSv3::CreateGeometry()
     
     xpos = -dsrv[0] + .47;
     ypos = -(2.1+0.015);
-    pMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right element 
     
     xpos = -dsrv[0] + .47;
     ypos = 2.1+0.015;
-    pMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Top element 
     
     xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
     ypos = 0.;
-    pMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the ghost volumes containing the strip ladders (ISV1), 
     //    electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
@@ -2510,31 +2752,31 @@ void AliITSv3::CreateGeometry()
     runo    = dbox1[0] * 2. + 40. + dsrv[0];
     rtwo    = dbox1[0] * 2. + 40. + dela[0];
     for (i = 1; i <= 35; ++i) {
-      atheta = (i-1) * twopi * raddeg / 35. + offset2;
+      atheta = (i-1) * ktwopi * kraddeg / 35. + offset2;
       AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
       
       // --- Strip ladders 
       
-      xpos = rzero * TMath::Cos((i-1) * twopi / 35. + offset1);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 35. + offset1);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 35. + offset1);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 35. + offset1);
       zpos = 0.;
-      pMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
       
       // --- Electronics/cooling 
       
-      xpos = runo * TMath::Cos((i-1) * twopi / 35. + offset1);
-      ypos = runo * TMath::Sin((i-1) * twopi / 35. + offset1);
+      xpos = runo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
+      ypos = runo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
       zpos = 0.;
-      pMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
       
       // --- End-ladders (nagative-Z and positive-Z) 
       
-      xpos = rtwo * TMath::Cos((i-1) * twopi / 35. + offset1);
-      ypos = rtwo * TMath::Sin((i-1) * twopi / 35. + offset1);
+      xpos = rtwo * TMath::Cos((i-1) * ktwopi / 35. + offset1);
+      ypos = rtwo * TMath::Sin((i-1) * ktwopi / 35. + offset1);
       zpos = -(dbox1[2] + dela[2] + 6.);
-      pMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
       zpos = dbox1[2] + dela[2] + 6.;
-      pMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
     }
     
     
@@ -2548,11 +2790,11 @@ void AliITSv3::CreateGeometry()
     dbox2[0] = (0.0600+2.*0.0150)/2.;
     dbox2[1] = 3.75;
     dbox2[2] = 101.95/2.;
-    pMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
+    gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ISV2", "SEEN", 0);
+    gMC->Gsatt("ISV2", "SEEN", 0);
     
     // --- Define a ghost volume containing the electronics and cooling of
     //     a single ladder of layer #6 and fill it with air or vacuum 
@@ -2560,11 +2802,11 @@ void AliITSv3::CreateGeometry()
     dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
     dsrv[1] = 3.75;
     dsrv[2] = 101.95/2.;
-    pMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
+    gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("SSV2", "SEEN", 0);
+    gMC->Gsatt("SSV2", "SEEN", 0);
     
     // --- Define a ghost volume containing the end-ladder stuff of 
     //     a single ladder of layer #6 and fill it with air or vacuum 
@@ -2572,11 +2814,11 @@ void AliITSv3::CreateGeometry()
     dela[0] = 2.;
     dela[1] = 3.5;
     dela[2] = 4.;
-    pMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
+    gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ELL6", "SEEN", 0);
+    gMC->Gsatt("ELL6", "SEEN", 0);
     
     // --- Define a volume containing the sensitive part of the strips 
     //     (silicon, layer #6) 
@@ -2584,7 +2826,7 @@ void AliITSv3::CreateGeometry()
     dits[0] = .015;
     dits[1] = 3.75;
     dits[2] = 2.1;
-    pMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
+    gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
     
     // --- Define a volume containing the electronics of the strips 
     //     (silicon, layer #6) 
@@ -2592,21 +2834,21 @@ void AliITSv3::CreateGeometry()
     dchi[0] = .02;
     dchi[1] = 3.4;
     dchi[2] = .525;
-    pMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
+    gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
     
     // --- Define the cooling tubes (aluminum, layer #6) 
     
     dtub[0] = .09;
     dtub[1] = dtub[0] + .01;
     dtub[2] = 101.95/2.;
-    pMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
+    gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
     
     // --- Define the cooling fluid (water or freon, layer #6) 
     
     dwat[0] = 0.;
     dwat[1] = .09;
     dwat[2] = 101.95/2.;
-    pMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
+    gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
     //        CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT)   ! freon
     
     //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
@@ -2622,7 +2864,7 @@ void AliITSv3::CreateGeometry()
     dfra[7] = .015;
     dfra[8] = dfra[5];
     dfra[9] = dfra[6];
-    pMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
+    gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
     
     // --- Define the element connecting the triangles of the heat bridge 
     //     (carbon, layer #6) 
@@ -2630,7 +2872,7 @@ void AliITSv3::CreateGeometry()
     dcei[0] = 0.;
     dcei[1] = .03;
     dcei[2] = 101.95/2.;
-    pMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
+    gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
     
     // --- Define the part of the end-ladder stuff made of plastic (G10FR4) 
     //     (layer #6) 
@@ -2638,21 +2880,21 @@ void AliITSv3::CreateGeometry()
     dpla[0] = (10./(8.*7.))/2.;
     dpla[1] = 3.5;
     dpla[2] = 4.;
-    pMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
+    gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
     
     // --- Define the part of the end-ladder stuff made of copper (layer #6) 
     
     dcop[0] = (2./(8.*7.))/2.;
     dcop[1] = 3.5;
     dcop[2] = 4.;
-    pMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
+    gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
     
     // --- Define the part of the end-ladder stuff made of epoxy (layer #6) 
     
     depx[0] = (30./(8.*7.))/2.;
     depx[1] = 3.5;
     depx[2] = 4.;
-    pMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
+    gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
     
     // --- Define the part of the end-ladder stuff made of silicon (bus) 
     //     (layer #6) 
@@ -2660,7 +2902,7 @@ void AliITSv3::CreateGeometry()
     dsil[0] = (20./(8.*7.))/2.;
     dsil[1] = 3.5;
     dsil[2] = 4.;
-    pMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
+    gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
     
     // --- Place the end-ladder stuff into its mother (ELL5) 
     
@@ -2671,22 +2913,22 @@ void AliITSv3::CreateGeometry()
     // --- Plastic 
     
     xpos = -dela[0] + dpla[0];
-    pMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Copper 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
-    pMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Epoxy 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
-    pMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Silicon (bus) 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
-    pMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the sensitive part of the strips into its mother (ISV2) 
     
@@ -2695,7 +2937,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = dbox2[0] - dits[0];
       else            xpos = -dbox2[0] + dits[0];
       zpos = ((j - 1) - 12.) * 3.91 - 1.96;
-      pMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the electronics of the strips into its mother (SSV2) 
@@ -2705,7 +2947,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = -dsrv[0] + .28;
       else            xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
       zpos = ((j - 1) - 12.) * 3.91 - 1.96 + .85;
-      pMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SCH5", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     }
 
     //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
@@ -2716,14 +2958,14 @@ void AliITSv3::CreateGeometry()
     // --- Left tube (just a matter of convention) 
     
     ypos = -2.25-0.1;
-    pMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right tube (just a matter of convention) 
     
     ypos = 2.25+0.;
-    pMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the heat bridge elements into their mother (SSV2) 
     
@@ -2731,7 +2973,7 @@ void AliITSv3::CreateGeometry()
     ypos = 0.;
     for (j = 1; j <= 27; ++j) {
       zpos = ((j - 1) - 12.) * 3.91 - 1.96 - 4.2/2.;
-      pMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the elements connecting the triangles of the heat bridge 
@@ -2743,19 +2985,19 @@ void AliITSv3::CreateGeometry()
     
     xpos = -dsrv[0] + .47;
     ypos = -(2.1+0.015);
-    pMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right element 
     
     xpos = -dsrv[0] + .47;
     ypos = 2.1+0.015;
-    pMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Top element 
     
     xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
     ypos = 0.;
-    pMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the ghost volumes containing the strip ladders (ISV2), 
     //    electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
@@ -2767,31 +3009,31 @@ void AliITSv3::CreateGeometry()
     runo    = dbox2[0] * 2. + 45. + dsrv[0];
     rtwo    = dbox2[0] * 2. + 45. + dela[0];
     for (i = 1; i <= 39; ++i) {
-      atheta = (i-1) * twopi * raddeg / 39. + offset2;
+      atheta = (i-1) * ktwopi * kraddeg / 39. + offset2;
       AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
       
       // --- Strip ladders 
       
-      xpos = rzero * TMath::Cos((i-1) * twopi / 39. + offset1);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 39. + offset1);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 39. + offset1);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 39. + offset1);
       zpos = 0.;
-      pMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
       
       // --- Electronics/cooling 
       
-      xpos = runo * TMath::Cos((i-1) * twopi / 39. + offset1);
-      ypos = runo * TMath::Sin((i-1) * twopi / 39. + offset1);
+      xpos = runo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
+      ypos = runo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
       zpos = 0.;
-      pMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
       
       // --- End-ladders (nagative-Z and positive-Z) 
       
-      xpos = rtwo * TMath::Cos((i-1) * twopi / 39. + offset1);
-      ypos = rtwo * TMath::Sin((i-1) * twopi / 39. + offset1);
+      xpos = rtwo * TMath::Cos((i-1) * ktwopi / 39. + offset1);
+      ypos = rtwo * TMath::Sin((i-1) * ktwopi / 39. + offset1);
       zpos = -(dbox2[2] + dela[2] + 6.);
-      pMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
       zpos = dbox2[2] + dela[2] + 6.;
-      pMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
     }
     //#ifdef NEVER
   }
@@ -2823,9 +3065,9 @@ void AliITSv3::CreateGeometry()
       (27.-9.01) / xxm + (36.-27.) / xxm + (49.998-36.) / xxm;
     dgh[13] = 49.998;
     dgh[14] = 49.998;
-    pMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
-    pMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
-    pMC->Gsatt("IT56", "SEEN", 0);
+    gMC->Gsvolu("IT56", "PCON", idtmed[275], dgh, 15);
+    gMC->Gspos("IT56", 1, "ITSV", 0., 0., 0., 0, "ONLY");
+    gMC->Gsatt("IT56", "SEEN", 0);
     
     // --- Layer #5 
     
@@ -2837,11 +3079,11 @@ void AliITSv3::CreateGeometry()
     dbox1[0] = (0.0600+2.*0.0150)/2.;
     dbox1[1] = 3.75;
     dbox1[2] = 86.31/2.;
-    pMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
+    gMC->Gsvolu("ISV1", "BOX ", idtmed[253], dbox1, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ISV1", "SEEN", 0);
+    gMC->Gsatt("ISV1", "SEEN", 0);
     
     // --- Define a ghost volume containing the electronics and cooling of
     //     a single ladder of layer #5 and fill it with air or vacuum 
@@ -2849,11 +3091,11 @@ void AliITSv3::CreateGeometry()
     dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
     dsrv[1] = 3.75;
     dsrv[2] = 86.31/2.;
-    pMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
+    gMC->Gsvolu("SSV1", "BOX ", idtmed[253], dsrv, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("SSV1", "SEEN", 0);
+    gMC->Gsatt("SSV1", "SEEN", 0);
     
     // --- Define a ghost volume containing the end-ladder stuff of 
     //     a single ladder of layer #5 and fill it with air or vacuum 
@@ -2861,11 +3103,11 @@ void AliITSv3::CreateGeometry()
     dela[0] = 2.;
     dela[1] = 3.5;
     dela[2] = 4.;
-    pMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
+    gMC->Gsvolu("ELL5", "BOX ", idtmed[253], dela, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ELL5", "SEEN", 0);
+    gMC->Gsatt("ELL5", "SEEN", 0);
     
     // --- Define a volume containing the sensitive part of the strips 
     //     (silicon, layer #5) 
@@ -2873,7 +3115,7 @@ void AliITSv3::CreateGeometry()
     dits[0] = .015;
     dits[1] = 3.75;
     dits[2] = 2.1;
-    pMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
+    gMC->Gsvolu("ITS5", "BOX ", idtmed[249], dits, 3);
     
     // --- Define a volume containing the electronics of the strips 
     //     (silicon, layer #5) 
@@ -2881,21 +3123,21 @@ void AliITSv3::CreateGeometry()
     dchi[0] = .02;
     dchi[1] = 3.4;
     dchi[2] = .525;
-    pMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
+    gMC->Gsvolu("SCH5", "BOX ", idtmed[250], dchi, 3);
     
     // --- Define the cooling tubes (aluminum, layer #5) 
     
     dtub[0] = .09;
     dtub[1] = dtub[0] + .01;
     dtub[2] = 86.31/2.;
-    pMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
+    gMC->Gsvolu("STB5", "TUBE", idtmed[255], dtub, 3);
     
     // --- Define the cooling fluid (water or freon, layer #5) 
     
     dwat[0] = 0.;
     dwat[1] = .09;
     dwat[2] = 86.31/2.;
-    pMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
+    gMC->Gsvolu("SWT5", "TUBE", idtmed[256], dwat, 3);
     //        CALL GSVOLU('SWT5','TUBE',IDTMED(258),DWAT,3,IOUT)   ! freon
     
     //--- Define the (triangular) element of the heat bridge (carbon, layer #5)
@@ -2911,7 +3153,7 @@ void AliITSv3::CreateGeometry()
     dfra[7] = .015;
     dfra[8] = dfra[5];
     dfra[9] = dfra[6];
-    pMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
+    gMC->Gsvolu("SFR5", "PGON", idtmed[252], dfra, 10);
     
     // --- Define the element connecting the triangles of the heat bridge 
     //     (carbon, layer #5) 
@@ -2919,7 +3161,7 @@ void AliITSv3::CreateGeometry()
     dcei[0] = 0.;
     dcei[1] = .03;
     dcei[2] = 86.31/2.;
-    pMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
+    gMC->Gsvolu("SCE5", "TUBE", idtmed[252], dcei, 3);
     
     // --- Define the part of the end-ladder stuff made of plastic (G10FR4) 
     //     (layer #5) 
@@ -2927,21 +3169,21 @@ void AliITSv3::CreateGeometry()
     dpla[0] = (10./(8.*7.))/2;
     dpla[1] = 3.5;
     dpla[2] = 4.;
-    pMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
+    gMC->Gsvolu("EPL5", "BOX ", idtmed[262], dpla, 3);
     
     // --- Define the part of the end-ladder stuff made of copper (layer #5) 
     
     dcop[0] = (2./(8.*7.))/2;
     dcop[1] = 3.5;
     dcop[2] = 4.;
-    pMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
+    gMC->Gsvolu("ECU5", "BOX ", idtmed[259], dcop, 3);
     
     // --- Define the part of the end-ladder stuff made of epoxy (layer #5) 
     
     depx[0] = (30./(8.*7.))/2.;
     depx[1] = 3.5;
     depx[2] = 4.;
-    pMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
+    gMC->Gsvolu("EPX5", "BOX ", idtmed[262], depx, 3);
     
     // --- Define the part of the end-ladder stuff made of silicon (bus) 
     //     (layer #5) 
@@ -2949,7 +3191,7 @@ void AliITSv3::CreateGeometry()
     dsil[0] = (20./(8.*7.))/2.;
     dsil[1] = 3.5;
     dsil[2] = 4.;
-    pMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
+    gMC->Gsvolu("ESI5", "BOX ", idtmed[251], dsil, 3);
     
     // --- Place the end-ladder stuff into its mother (ELL5) 
     
@@ -2960,22 +3202,22 @@ void AliITSv3::CreateGeometry()
     // --- Plastic 
     
     xpos = -dela[0] + dpla[0];
-    pMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPL5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Copper 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
-    pMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ECU5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Epoxy 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
-    pMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPX5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Silicon (bus) 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
-    pMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ESI5", 1, "ELL5", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the sensitive part of the strips into its mother (ISV1) 
     
@@ -2984,7 +3226,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = dbox1[0] - dits[0];
       else            xpos = -dbox1[0] + dits[0];
       zpos = ((j - 1) - 10.) * 3.91 - 1.96;
-      pMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("ITS5", j, "ISV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the electronics of the strips into its mother (SSV1) 
@@ -2994,7 +3236,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = -dsrv[0] + .28;
       else            xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
       zpos = ((j - 1) - 10.) * 3.91 - 1.96 + .85;
-      pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     //--- Place the cooling tubes and the cooling fluid into their mother (SSV1)
@@ -3005,14 +3247,14 @@ void AliITSv3::CreateGeometry()
     // --- Left tube (just a matter of convention) 
     
     ypos = -(2.25+0.1);
-    pMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right tube (just a matter of convention) 
     
     ypos = (2.25+0.1);
-    pMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the heat bridge elements into their mother (SSV1) 
     
@@ -3020,7 +3262,7 @@ void AliITSv3::CreateGeometry()
     ypos = 0.;
     for (j = 1; j <= 23; ++j) {
       zpos = ((j - 1) - 10.) * 3.91 - 1.96 - 4.2/2.;
-      pMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SFR5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the elements connecting the triangles of the heat bridge 
@@ -3032,19 +3274,19 @@ void AliITSv3::CreateGeometry()
     
     xpos = -dsrv[0] + .47;
     ypos = -(2.1+0.015);
-    pMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE5", 1, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right element 
     
     xpos = -dsrv[0] + .47;
     ypos = (2.1+0.015);
-    pMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE5", 2, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Top element 
     
     xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
     ypos = 0.;
-    pMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE5", 3, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the ghost volumes containing the strip ladders (ISV1), 
     //    electronics/cooling (SSV1) and end-ladder stuff (ELL5) of layer #5 in
@@ -3056,31 +3298,31 @@ void AliITSv3::CreateGeometry()
     runo    = dbox1[0] * 2. + 36.6 + dsrv[0];
     rtwo    = dbox1[0] * 2. + 36.6 + dela[0];
     for (i = 1; i <= 32; ++i) {
-      atheta = (i-1) * twopi * raddeg / 32. + offset2;
+      atheta = (i-1) * ktwopi * kraddeg / 32. + offset2;
       AliMatrix(idrotm[i+1499], 90., atheta, 90., atheta + 90., 0., 0.);
       
       // --- Strip ladders 
       
-      xpos = rzero * TMath::Cos((i-1) * twopi / 32. + offset1);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 32. + offset1);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 32. + offset1);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 32. + offset1);
       zpos = 0.;
-      pMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("ISV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
       
       // --- Electronics/cooling 
       
-      xpos = runo * TMath::Cos((i-1) * twopi / 32. + offset1);
-      ypos = runo * TMath::Sin((i-1) * twopi / 32. + offset1);
+      xpos = runo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
+      ypos = runo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
       zpos = 0.;
-      pMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("SSV1", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
       
       // --- End-ladders (nagative-Z and positive-Z) 
       
-      xpos = rtwo * TMath::Cos((i-1) * twopi / 32. + offset1);
-      ypos = rtwo * TMath::Sin((i-1) * twopi / 32. + offset1);
+      xpos = rtwo * TMath::Cos((i-1) * ktwopi / 32. + offset1);
+      ypos = rtwo * TMath::Sin((i-1) * ktwopi / 32. + offset1);
       zpos = -(dbox1[2] + dela[2] + 6.);
-      pMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("ELL5", i, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
       zpos = dbox1[2] + dela[2] + 6.;
-      pMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
+      gMC->Gspos("ELL5", i + 35, "IT56", xpos, ypos, zpos, idrotm[i+1499], "ONLY");
     }
     
     
@@ -3094,11 +3336,11 @@ void AliITSv3::CreateGeometry()
     dbox2[0] = (0.0600+2.*0.0150)/2.;
     dbox2[1] = 3.75;
     dbox2[2] = 94.13/2.;
-    pMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
+    gMC->Gsvolu("ISV2", "BOX ", idtmed[253], dbox2, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ISV2", "SEEN", 0);
+    gMC->Gsatt("ISV2", "SEEN", 0);
     
     // --- Define a ghost volume containing the electronics and cooling of
     //     a single ladder of layer #6 and fill it with air or vacuum 
@@ -3106,11 +3348,11 @@ void AliITSv3::CreateGeometry()
     dsrv[0] = (TMath::Sqrt(3.) / 2. * 4.2 + .47 + .05) / 2.;
     dsrv[1] = 3.75;
     dsrv[2] = 94.13/2.;
-    pMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
+    gMC->Gsvolu("SSV2", "BOX ", idtmed[253], dsrv, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("SSV2", "SEEN", 0);
+    gMC->Gsatt("SSV2", "SEEN", 0);
     
     // --- Define a ghost volume containing the end-ladder stuff of 
     //     a single ladder of layer #6 and fill it with air or vacuum 
@@ -3118,11 +3360,11 @@ void AliITSv3::CreateGeometry()
     dela[0] = 2.;
     dela[1] = 3.5;
     dela[2] = 4.;
-    pMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
+    gMC->Gsvolu("ELL6", "BOX ", idtmed[253], dela, 3);
     
     // --- Make the ghost volume invisible 
     
-    pMC->Gsatt("ELL6", "SEEN", 0);
+    gMC->Gsatt("ELL6", "SEEN", 0);
     
     // --- Define a volume containing the sensitive part of the strips 
     //     (silicon, layer #6) 
@@ -3130,7 +3372,7 @@ void AliITSv3::CreateGeometry()
     dits[0] = .015;
     dits[1] = 3.75;
     dits[2] = 2.1;
-    pMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
+    gMC->Gsvolu("ITS6", "BOX ", idtmed[249], dits, 3);
     
     // --- Define a volume containing the electronics of the strips 
     //     (silicon, layer #6) 
@@ -3138,21 +3380,21 @@ void AliITSv3::CreateGeometry()
     dchi[0] = .02;
     dchi[1] = 3.4;
     dchi[2] = .525;
-    pMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
+    gMC->Gsvolu("SCH6", "BOX ", idtmed[250], dchi, 3);
     
     // --- Define the cooling tubes (aluminum, layer #6) 
     
     dtub[0] = .09;
     dtub[1] = dtub[0] + .01;
     dtub[2] = 94.13/2.;
-    pMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
+    gMC->Gsvolu("STB6", "TUBE", idtmed[255], dtub, 3);
     
     // --- Define the cooling fluid (water or freon, layer #6) 
     
     dwat[0] = 0.;
     dwat[1] = .09;
     dwat[2] = 94.13/2.;
-    pMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
+    gMC->Gsvolu("SWT6", "TUBE", idtmed[256], dwat, 3);
     //        CALL GSVOLU('SWT6','TUBE',IDTMED(258),DWAT,3,IOUT)   ! freon
     
     //--- Define the (triangular) element of the heat bridge (carbon, layer #6)
@@ -3168,7 +3410,7 @@ void AliITSv3::CreateGeometry()
     dfra[7] = .015;
     dfra[8] = dfra[5];
     dfra[9] = dfra[6];
-    pMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
+    gMC->Gsvolu("SFR6", "PGON", idtmed[252], dfra, 10);
     
     // --- Define the element connecting the triangles of the heat bridge 
     //     (carbon, layer #6) 
@@ -3176,7 +3418,7 @@ void AliITSv3::CreateGeometry()
     dcei[0] = 0.;
     dcei[1] = .03;
     dcei[2] = 94.13/2.;
-    pMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
+    gMC->Gsvolu("SCE6", "TUBE", idtmed[252], dcei, 3);
     
     // --- Define the part of the end-ladder stuff made of plastic (G10FR4) 
     //     (layer #6) 
@@ -3184,21 +3426,21 @@ void AliITSv3::CreateGeometry()
     dpla[0] = (10./(8.*7.))/2;
     dpla[1] = 3.5;
     dpla[2] = 4.;
-    pMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
+    gMC->Gsvolu("EPL6", "BOX ", idtmed[262], dpla, 3);
     
     // --- Define the part of the end-ladder stuff made of copper (layer #6) 
     
     dcop[0] = (2./(8.*7.))/2;
     dcop[1] = 3.5;
     dcop[2] = 4.;
-    pMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
+    gMC->Gsvolu("ECU6", "BOX ", idtmed[259], dcop, 3);
     
     // --- Define the part of the end-ladder stuff made of epoxy (layer #6) 
     
     depx[0] = (30./(8.*7.))/2.;
     depx[1] = 3.5;
     depx[2] = 4.;
-    pMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
+    gMC->Gsvolu("EPX6", "BOX ", idtmed[262], depx, 3);
     
     // --- Define the part of the end-ladder stuff made of silicon (bus) 
     //     (layer #6) 
@@ -3206,7 +3448,7 @@ void AliITSv3::CreateGeometry()
     dsil[0] = (20./(8.*7.))/2.;
     dsil[1] = 3.5;
     dsil[2] = 4.;
-    pMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
+    gMC->Gsvolu("ESI6", "BOX ", idtmed[251], dsil, 3);
     
     // --- Place the end-ladder stuff into its mother (ELL5) 
     
@@ -3217,22 +3459,22 @@ void AliITSv3::CreateGeometry()
     // --- Plastic 
     
     xpos = -dela[0] + dpla[0];
-    pMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPL6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Copper 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0];
-    pMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ECU6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Epoxy 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0];
-    pMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("EPX6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Silicon (bus) 
     
     xpos = -dela[0] + dpla[0] * 2. + sep + dcop[0] * 2. + sep + depx[0] * 2. + sep + dsil[0];
-    pMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("ESI6", 1, "ELL6", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the sensitive part of the strips into its mother (ISV2) 
     
@@ -3241,7 +3483,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = -dbox2[0] + dits[0];
       else            xpos = dbox2[0] - dits[0];
       zpos = ((j - 1) - 11.) * 3.91 - 1.96;
-      pMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("ITS6", j, "ISV2", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the electronics of the strips into its mother (SSV2) 
@@ -3251,7 +3493,7 @@ void AliITSv3::CreateGeometry()
       if (j % 2 == 0) xpos = -dsrv[0] + .28 - dits[0] * 2. - .03;
       else            xpos = -dsrv[0] + .28;
       zpos = ((j - 1) - 11.) * 3.91 - 1.96 + .85;
-      pMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SCH5", j, "SSV1", xpos, ypos, zpos, 0, "ONLY");
     }
     
     //--- Place the cooling tubes and the cooling fluid into their mother (SSV2)
@@ -3262,14 +3504,14 @@ void AliITSv3::CreateGeometry()
     // --- Left tube (just a matter of convention) 
     
     ypos = -(2.25+0.1);
-    pMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right tube (just a matter of convention) 
     
     ypos = (2.25+0.1);
-    pMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
-    pMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("STB6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SWT6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the heat bridge elements into their mother (SSV2) 
     
@@ -3277,7 +3519,7 @@ void AliITSv3::CreateGeometry()
     ypos = 0.;
     for (j = 1; j <= 25; ++j) {
       zpos = ((j - 1) - 11.) * 3.91 - 1.96 - 4.2/2.;
-      pMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+      gMC->Gspos("SFR6", j, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     }
     
     // --- Place the elements connecting the triangles of the heat bridge 
@@ -3289,19 +3531,19 @@ void AliITSv3::CreateGeometry()
     
     xpos = -dsrv[0] + .47;
     ypos = -(2.1+0.015);
-    pMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE6", 1, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Right element 
     
     xpos = -dsrv[0] + .47;
     ypos = (2.1+0.015);
-    pMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE6", 2, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Top element 
     
     xpos = -dsrv[0] + .47 + TMath::Sqrt(3.) / 2. * 4.2 + .015;
     ypos = 0.;
-    pMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gspos("SCE6", 3, "SSV2", xpos, ypos, zpos, 0, "ONLY");
     
     // --- Place the ghost volumes containing the strip ladders (ISV2), 
     //    electronics/cooling (SSV2) and end-ladder stuff (ELL6) of layer #6 in
@@ -3313,31 +3555,31 @@ void AliITSv3::CreateGeometry()
     runo    = dbox2[0] * 2. + 41.2 + dsrv[0];
     rtwo    = dbox2[0] * 2. + 41.2 + dela[0];
     for (i = 1; i <= 36; ++i) {
-      atheta = (i-1) * twopi * raddeg / 36. + offset2;
+      atheta = (i-1) * ktwopi * kraddeg / 36. + offset2;
       AliMatrix(idrotm[i+1599], 90., atheta, 90., atheta + 90., 0., 0.);
       
       // --- Strip ladders 
       
-      xpos = rzero * TMath::Cos((i-1) * twopi / 36. + offset1);
-      ypos = rzero * TMath::Sin((i-1) * twopi / 36. + offset1);
+      xpos = rzero * TMath::Cos((i-1) * ktwopi / 36. + offset1);
+      ypos = rzero * TMath::Sin((i-1) * ktwopi / 36. + offset1);
       zpos = 0.;
-      pMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("ISV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
       
       // --- Electronics/cooling 
       
-      xpos = runo * TMath::Cos((i-1) * twopi / 36. + offset1);
-      ypos = runo * TMath::Sin((i-1) * twopi / 36. + offset1);
+      xpos = runo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
+      ypos = runo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
       zpos = 0.;
-      pMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("SSV2", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
       
       // --- End-ladders (nagative-Z and positive-Z) 
       
-      xpos = rtwo * TMath::Cos((i-1) * twopi / 36. + offset1);
-      ypos = rtwo * TMath::Sin((i-1) * twopi / 36. + offset1);
+      xpos = rtwo * TMath::Cos((i-1) * ktwopi / 36. + offset1);
+      ypos = rtwo * TMath::Sin((i-1) * ktwopi / 36. + offset1);
       zpos = -(dbox2[2] + dela[2] + 6.);
-      pMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("ELL6", i, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
       zpos = dbox2[2] + dela[2] + 6.;
-      pMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
+      gMC->Gspos("ELL6", i + 39, "IT56", xpos, ypos, zpos, idrotm[i+1599], "ONLY");
     }
     
     
@@ -3371,8 +3613,8 @@ void AliITSv3::CreateGeometry()
     dits[1] = dits[0] + .06926;
     dits[2] = dpcb[2] * 2. + 62.7 - 10.5;
     // old value 60.3 
-    pMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
-    pMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
+    gMC->Gsvolu("ITSG", "TUBE", idtmed[274], dits, 3);
+    gMC->Gspos("ITSG", 1, "ITSV", 0., 0., 0., 0, "ONLY");
   } else {
     goto L8901;
   }
@@ -3393,156 +3635,156 @@ void AliITSv3::CreateGeometry()
     angle    = 45.;
     offset   = angle / 2.;
     for (i = 0; i < 8; ++i) {
-      xtra[i] = rzero * TMath::Cos(i * angle * degrad);
-      ytra[i] = rzero * TMath::Sin(i * angle * degrad);
+      xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
+      ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
       ztra[i] = 0.;
-      pMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
-      pMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
+      gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
+      gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
     }
     
     atheta = 22.5;
-    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2  = 180. - aphi1;
     xpos   = (xtra[0] + xtra[1]) / 2.;
     ypos   = (ytra[0] + ytra[1]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
+    gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
+    gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
     
     atheta = 67.5;
-    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1  = 180. - aphi2;
     xpos   = (xtra[1] + xtra[2]) / 2.;
     ypos   = (ytra[1] + ytra[2]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
+    gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
+    gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
     
     atheta = 112.5;
-    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2  = 180. - aphi1;
     xpos   = (xtra[2] + xtra[3]) / 2.;
     ypos   = (ytra[2] + ytra[3]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
+    gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
+    gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
     
     atheta = 157.5;
-    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1  = 180. - aphi2;
     xpos   = (xtra[3] + xtra[4]) / 2.;
     ypos   = (ytra[3] + ytra[4]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
+    gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
+    gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
     
     atheta = 22.5;
-    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1  = 180. - aphi2;
     xpos   = (xtra[4] + xtra[5]) / 2.;
     ypos   = (ytra[4] + ytra[5]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
+    gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
+    gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
     
     atheta = 67.5;
-    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2  = 180. - aphi1;
     xpos   = (xtra[5] + xtra[6]) / 2.;
     ypos   = (ytra[5] + ytra[6]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
+    gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
+    gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
     
     atheta = 112.5;
-    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1  = 180. - aphi2;
     xpos   = (xtra[6] + xtra[7]) / 2.;
     ypos   = (ytra[6] + ytra[7]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
+    gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
+    gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
     
     atheta = 157.5;
-    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2  = 180. - aphi1;
     xpos   = (xtra[7] + xtra[0]) / 2.;
     ypos   = (ytra[7] + ytra[0]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
+    gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
+    gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
     
     
   } else if (fMinorVersion == 4) {
@@ -3558,156 +3800,156 @@ void AliITSv3::CreateGeometry()
     angle    = 45.;
     offset   = angle / 2.;
     for (i = 0; i < 8; ++i) {
-      xtra[i] = rzero * TMath::Cos(i * angle * degrad);
-      ytra[i] = rzero * TMath::Sin(i * angle * degrad);
+      xtra[i] = rzero * TMath::Cos(i * angle * kdegrad);
+      ytra[i] = rzero * TMath::Sin(i * angle * kdegrad);
       ztra[i] = 0.;
-      pMC->Gsvolu(natra[i], "TUBE", idtmed[274], dtra, 3);
-      pMC->Gspos(natra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
+      gMC->Gsvolu(knatra[i], "TUBE", idtmed[274], dtra, 3);
+      gMC->Gspos(knatra[i], 1, "ITSV", xtra[i], ytra[i], ztra[i], 0, "ONLY");
     }
     
     atheta = 22.5;
-    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2  = 180. - aphi1;
     xpos   = (xtra[0] + xtra[1]) / 2.;
     ypos   = (ytra[0] + ytra[1]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[0], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[0], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5100], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
+    gMC->Gspos(knatra1[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5100], "ONLY");
     zpos   = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[1], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[1], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5101], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
+    gMC->Gspos(knatra1[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5101], "ONLY");
     
     atheta = 67.5;
-    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2  = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1  = 180. - aphi2;
     xpos   = (xtra[1] + xtra[2]) / 2.;
     ypos   = (ytra[1] + ytra[2]) / 2.;
     zpos   = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[2], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[2], "TUBE", idtmed[274], dtra1, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5102], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
+    gMC->Gspos(knatra1[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5102], "ONLY");
     zpos = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[3], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[3], "TUBE", idtmed[274], dtra1, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5103], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
+    gMC->Gspos(knatra1[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5103], "ONLY");
     
     atheta = 112.5;
-    aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos  = (xtra[2] + xtra[3]) / 2.;
     ypos  = (ytra[2] + ytra[3]) / 2.;
     zpos  = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[4], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[4], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5104], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
+    gMC->Gspos(knatra1[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5104], "ONLY");
     zpos  = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[5], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[5], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5105], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
+    gMC->Gspos(knatra1[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5105], "ONLY");
     
     atheta = 157.5;
-    aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos  = (xtra[3] + xtra[4]) / 2.;
     ypos  = (ytra[3] + ytra[4]) / 2.;
     zpos  = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[6], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[6], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5106], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
+    gMC->Gspos(knatra1[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5106], "ONLY");
     zpos  = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[7], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[7], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5107], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
+    gMC->Gspos(knatra1[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5107], "ONLY");
     
     atheta = 22.5;
-    aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos  = (xtra[4] + xtra[5]) / 2.;
     ypos  = (ytra[4] + ytra[5]) / 2.;
     zpos  = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[8], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[8], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5108], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
+    gMC->Gspos(knatra1[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5108], "ONLY");
     zpos  = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[9], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[9], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5109], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
+    gMC->Gspos(knatra1[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5109], "ONLY");
     
     atheta = 67.5;
-    aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos = (xtra[5] + xtra[6]) / 2.;
     ypos = (ytra[5] + ytra[6]) / 2.;
     zpos = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[10], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[10], "TUBE", idtmed[274], dtra1, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5110], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
+    gMC->Gspos(knatra1[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5110], "ONLY");
     zpos = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[11], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[11], "TUBE", idtmed[274], dtra1, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5111], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
+    gMC->Gspos(knatra1[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5111], "ONLY");
     
     atheta = 112.5;
-    aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi2 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos  = (xtra[6] + xtra[7]) / 2.;
     ypos  = (ytra[6] + ytra[7]) / 2.;
     zpos  = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[12], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[12], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5112], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
+    gMC->Gspos(knatra1[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5112], "ONLY");
     zpos  = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[13], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[13], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5113], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
+    gMC->Gspos(knatra1[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5113], "ONLY");
     
     atheta = 157.5;
-    aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*degrad) * (50.5 / cos(28.*degrad))- 50.5*50.5))) * raddeg;
+    aphi1 = TMath::ACos(dtra[2] / TMath::Sqrt(dtra[2] * dtra[2] + (50.5 / cos(28.*kdegrad) * (50.5 / cos(28.*kdegrad))- 50.5*50.5))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos  = (xtra[7] + xtra[0]) / 2.;
     ypos  = (ytra[7] + ytra[0]) / 2.;
     zpos  = dtra[2] / 2.;
-    pMC->Gsvolu(natra1[14], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[14], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5114], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
+    gMC->Gspos(knatra1[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5114], "ONLY");
     zpos  = -dtra[2] / 2.;
-    pMC->Gsvolu(natra1[15], "TUBE", idtmed[274], dtra1, 3);
+    gMC->Gsvolu(knatra1[15], "TUBE", idtmed[274], dtra1, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5115], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
+    gMC->Gspos(knatra1[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5115], "ONLY");
   } else {
     goto L9012;
   }
@@ -3732,11 +3974,11 @@ void AliITSv3::CreateGeometry()
     angle = 60.;
     offset = angle / 2.;
     for (i = 0; i < 6; ++i) {
-      xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
-      ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
+      xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
+      ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
       ztra1[i] = 0.;
-      pMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
-      pMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
+      gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
+      gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
     }
     
     atheta = 60.;
@@ -3744,209 +3986,209 @@ void AliITSv3::CreateGeometry()
     xpos = (xtra1[0] + xtra1[1]) / 2.;
     ypos = (ytra1[0] + ytra1[1]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
+    gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
     
     atheta = 120.;
     aphi = 90.;
     xpos = (xtra1[1] + xtra1[2]) / 2.;
     ypos = (ytra1[1] + ytra1[2]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
+    gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
     
     atheta = 180.;
     aphi = 90.;
     xpos = (xtra1[2] + xtra1[3]) / 2.;
     ypos = (ytra1[2] + ytra1[3]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
+    gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
     
     atheta = 60.;
     aphi = 90.;
     xpos = (xtra1[3] + xtra1[4]) / 2.;
     ypos = (ytra1[3] + ytra1[4]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
+    gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
     
     atheta = 120.;
     aphi = 90.;
     xpos = (xtra1[4] + xtra1[5]) / 2.;
     ypos = (ytra1[4] + ytra1[5]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
+    gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
     
     atheta = 180.;
     aphi = 90.;
     xpos = (xtra1[5] + xtra1[0]) / 2.;
     ypos = (ytra1[5] + ytra1[0]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
+    gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
     
     atheta = 60.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos  = (xtra1[0] + xtra1[1]) / 2.;
     ypos  = (ytra1[0] + ytra1[1]) / 2.;
     zpos  = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
+    gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
+    gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
     
     atheta = 120.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos = (xtra1[1] + xtra1[2]) / 2.;
     ypos = (ytra1[1] + ytra1[2]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
+    gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
+    gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
     
     atheta = 180.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos  = (xtra1[2] + xtra1[3]) / 2.;
     ypos  = (ytra1[2] + ytra1[3]) / 2.;
     zpos  = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
+    gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
+    gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
     atheta = 180.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad)) 
-                                                                     - 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad)) 
+                                                                     - 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos = (xtra1[2] + xtra1[3]) / 2.;
     ypos = (ytra1[2] + ytra1[3]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
+    gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
+    gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
     
     atheta = 60.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos = (xtra1[3] + xtra1[4]) / 2.;
     ypos = (ytra1[3] + ytra1[4]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
+    gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
+    gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
     
     atheta = 120.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos  = (xtra1[4] + xtra1[5]) / 2.;
     ypos  = (ytra1[4] + ytra1[5]) / 2.;
     zpos  = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
+    gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
     zpos  = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
+    gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
     
     atheta = 180.;
-    aphi2  = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2  = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1  = 180. - aphi2;
     xpos   = (xtra1[5] + xtra1[0]) / 2.;
     ypos   = (ytra1[5] + ytra1[0]) / 2.;
     zpos   = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
     r2     = atheta + 90.;
     r3     = atheta + 90.;
     AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
+    gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
+    gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
     atheta = 180.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos  = (xtra1[5] + xtra1[0]) / 2.;
     ypos  = (ytra1[5] + ytra1[0]) / 2.;
     zpos  = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
+    gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
+    gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
     
     
   } else if (fMinorVersion == 5) {
@@ -3965,11 +4207,11 @@ void AliITSv3::CreateGeometry()
     angle  = 60.;
     offset = angle / 2.;
     for (i = 0; i < 6; ++i) {
-      xtra1[i] = rzero * TMath::Cos((i * angle + offset) *degrad);
-      ytra1[i] = rzero * TMath::Sin((i * angle + offset) *degrad);
+      xtra1[i] = rzero * TMath::Cos((i * angle + offset) *kdegrad);
+      ytra1[i] = rzero * TMath::Sin((i * angle + offset) *kdegrad);
       ztra1[i] = 0.;
-      pMC->Gsvolu(natra2[i], "TUBE", idtmed[274], dtra2, 3);
-      pMC->Gspos(natra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
+      gMC->Gsvolu(knatra2[i], "TUBE", idtmed[274], dtra2, 3);
+      gMC->Gspos(knatra2[i], 1, "ITSV", xtra1[i], ytra1[i], ztra1[i], 0, "ONLY");
     }
     
     atheta = 60.;
@@ -3977,208 +4219,208 @@ void AliITSv3::CreateGeometry()
     xpos = (xtra1[0] + xtra1[1]) / 2.;
     ypos = (ytra1[0] + ytra1[1]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[0], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[0], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5200], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
+    gMC->Gspos(knatra3[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5200], "ONLY");
     
     atheta = 120.;
     aphi = 90.;
     xpos = (xtra1[1] + xtra1[2]) / 2.;
     ypos = (ytra1[1] + ytra1[2]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[1], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[1], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5201], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
+    gMC->Gspos(knatra3[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5201], "ONLY");
     
     atheta = 180.;
     aphi = 90.;
     xpos = (xtra1[2] + xtra1[3]) / 2.;
     ypos = (ytra1[2] + ytra1[3]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[2], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[2], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5202], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
+    gMC->Gspos(knatra3[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5202], "ONLY");
     
     atheta = 60.;
     aphi   = 90.;
     xpos   = (xtra1[3] + xtra1[4]) / 2.;
     ypos   = (ytra1[3] + ytra1[4]) / 2.;
     zpos   = 0.;
-    pMC->Gsvolu(natra3[3], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[3], "TUBE", idtmed[274], dtra3, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5203], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
+    gMC->Gspos(knatra3[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5203], "ONLY");
     
     atheta = 120.;
     aphi = 90.;
     xpos = (xtra1[4] + xtra1[5]) / 2.;
     ypos = (ytra1[4] + ytra1[5]) / 2.;
     zpos = 0.;
-    pMC->Gsvolu(natra3[4], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[4], "TUBE", idtmed[274], dtra3, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5204], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
+    gMC->Gspos(knatra3[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5204], "ONLY");
     
     atheta = 180.;
     aphi   = 90.;
     xpos   = (xtra1[5] + xtra1[0]) / 2.;
     ypos   = (ytra1[5] + ytra1[0]) / 2.;
     zpos   = 0.;
-    pMC->Gsvolu(natra3[5], "TUBE", idtmed[274], dtra3, 3);
+    gMC->Gsvolu(knatra3[5], "TUBE", idtmed[274], dtra3, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5205], 90., atheta, aphi + 90., r2, aphi, r3);
-    pMC->Gspos(natra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
+    gMC->Gspos(knatra3[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5205], "ONLY");
     
     atheta = 60.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos = (xtra1[0] + xtra1[1]) / 2.;
     ypos = (ytra1[0] + ytra1[1]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[0], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[0], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5210], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
+    gMC->Gspos(knatra4[0], 1, "ITSV", xpos, ypos, zpos, idrotm[5210], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[1], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[1], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5211], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
+    gMC->Gspos(knatra4[1], 1, "ITSV", xpos, ypos, zpos, idrotm[5211], "ONLY");
     
     atheta = 120.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos = (xtra1[1] + xtra1[2]) / 2.;
     ypos = (ytra1[1] + ytra1[2]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[2], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[2], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5212], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
+    gMC->Gspos(knatra4[2], 1, "ITSV", xpos, ypos, zpos, idrotm[5212], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[3], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[3], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5213], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
+    gMC->Gspos(knatra4[3], 1, "ITSV", xpos, ypos, zpos, idrotm[5213], "ONLY");
     
     atheta = 180.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos = (xtra1[2] + xtra1[3]) / 2.;
     ypos = (ytra1[2] + ytra1[3]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[4], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[4], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5214], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
+    gMC->Gspos(knatra4[4], 1, "ITSV", xpos, ypos, zpos, idrotm[5214], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[5], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[5], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5215], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
+    gMC->Gspos(knatra4[5], 1, "ITSV", xpos, ypos, zpos, idrotm[5215], "ONLY");
     atheta = 180.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos = (xtra1[2] + xtra1[3]) / 2.;
     ypos = (ytra1[2] + ytra1[3]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[6], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[6], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5216], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
+    gMC->Gspos(knatra4[6], 1, "ITSV", xpos, ypos, zpos, idrotm[5216], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[7], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[7], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5217], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
+    gMC->Gspos(knatra4[7], 1, "ITSV", xpos, ypos, zpos, idrotm[5217], "ONLY");
     
     atheta = 60.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos = (xtra1[3] + xtra1[4]) / 2.;
     ypos = (ytra1[3] + ytra1[4]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[8], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[8], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5218], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
+    gMC->Gspos(knatra4[8], 1, "ITSV", xpos, ypos, zpos, idrotm[5218], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[9], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[9], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5219], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
+    gMC->Gspos(knatra4[9], 1, "ITSV", xpos, ypos, zpos, idrotm[5219], "ONLY");
     
     atheta = 120.;
-    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos  = (xtra1[4] + xtra1[5]) / 2.;
     ypos  = (ytra1[4] + ytra1[5]) / 2.;
     zpos  = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[10], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[10], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5220], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
+    gMC->Gspos(knatra4[10], 1, "ITSV", xpos, ypos, zpos, idrotm[5220], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[11], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[11], "TUBE", idtmed[274], dtra4, 3);
     r2 = atheta + 90.;
     r3 = atheta + 90.;
     AliMatrix(idrotm[5221], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
+    gMC->Gspos(knatra4[11], 1, "ITSV", xpos, ypos, zpos, idrotm[5221], "ONLY");
     
     atheta = 180.;
-    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi2 = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi1 = 180. - aphi2;
     xpos  = (xtra1[5] + xtra1[0]) / 2.;
     ypos  = (ytra1[5] + ytra1[0]) / 2.;
     zpos  = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[12], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[12], "TUBE", idtmed[274], dtra4, 3);
     r2    = atheta + 90.;
     r3    = atheta + 90.;
     AliMatrix(idrotm[5222], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
+    gMC->Gspos(knatra4[12], 1, "ITSV", xpos, ypos, zpos, idrotm[5222], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[13], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[13], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5223], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
+    gMC->Gspos(knatra4[13], 1, "ITSV", xpos, ypos, zpos, idrotm[5223], "ONLY");
     atheta = 180.;
-    aphi1  = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*degrad) * (50. / cos(34.*degrad))- 50.*50.))) * raddeg;
+    aphi1  = TMath::ACos(dtra2[2] / TMath::Sqrt(dtra2[2] * dtra2[2] + (50. / cos(34.*kdegrad) * (50. / cos(34.*kdegrad))- 50.*50.))) * kraddeg;
     aphi2 = 180. - aphi1;
     xpos = (xtra1[5] + xtra1[0]) / 2.;
     ypos = (ytra1[5] + ytra1[0]) / 2.;
     zpos = dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[14], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[14], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5224], 90., atheta, aphi1 + 90., r2, aphi1, r3);
-    pMC->Gspos(natra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
+    gMC->Gspos(knatra4[14], 1, "ITSV", xpos, ypos, zpos, idrotm[5224], "ONLY");
     zpos = -dtra2[2] / 2.;
-    pMC->Gsvolu(natra4[15], "TUBE", idtmed[274], dtra4, 3);
+    gMC->Gsvolu(knatra4[15], "TUBE", idtmed[274], dtra4, 3);
     r2   = atheta + 90.;
     r3   = atheta + 90.;
     AliMatrix(idrotm[5225], 90., atheta, aphi2 + 90., r2, aphi2, r3);
-    pMC->Gspos(natra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
+    gMC->Gspos(knatra4[15], 1, "ITSV", xpos, ypos, zpos, idrotm[5225], "ONLY");
   } else {
     goto L9123;
   }
@@ -4196,15 +4438,15 @@ void AliITSv3::CreateGeometry()
   dcone[1] = 12.;
   dcone[2] = 12.02;
   dcone[3] = (338.-3.)*455./(338.-3.-10.)/10.;
-  dcone[4] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
+  dcone[4] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
   xpos     = 0.;
   ypos     = 0.;
   zpos     = dpcb[2] * 2. + (583.+(338.-3.))/2./10. - 10.5;
   // end-ladder electro 
-  pMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
-  pMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("RCON", "CONE", idtmed[274], dcone, 5);
+  gMC->Gspos("RCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
-  dtube[0] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
+  dtube[0] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
   dtube[1] = 49.9;
   // In the Simonetti's drawings 52. In the TP 50. 
   dtube[2] = .15;
@@ -4212,8 +4454,8 @@ void AliITSv3::CreateGeometry()
   ypos     = 0.;
   zpos     = dpcb[2] * 2. + (583./2.+(338-1.5))/10. - 10.5;
   // end-ladder electro 
-  pMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
-  pMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("RTB1", "TUBE", idtmed[274], dtube, 3);
+  gMC->Gspos("RTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   dtube[0] = 10.5;
   dtube[1] = 12.;
@@ -4222,8 +4464,8 @@ void AliITSv3::CreateGeometry()
   ypos     = 0.;
   zpos     = dpcb[2] * 2. + (583./2.-89.+26.8/2.)/10. - 10.5;
   // end-ladder elect 
-  pMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
-  pMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("RTB2", "TUBE", idtmed[274], dtube, 3);
+  gMC->Gspos("RTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   dpgon[0] = 15.;
   dpgon[1] = 360.;
@@ -4240,8 +4482,8 @@ void AliITSv3::CreateGeometry()
   xpos     = 0.;
   ypos     = 0.;
   zpos     = 0.;
-  pMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
-  pMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("RP03", "PGON", idtmed[274], dpgon, 10);
+  gMC->Gspos("RP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   dpgon[0] = 7.5;
   dpgon[1] = 360.;
@@ -4258,8 +4500,8 @@ void AliITSv3::CreateGeometry()
   xpos     = 0.;
   ypos     = 0.;
   zpos     = 0.;
-  pMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
-  pMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("RP04", "PGON", idtmed[274], dpgon, 10);
+  gMC->Gspos("RP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   if (fMinorVersion < 3 ) {
     offset2  = 5.2;
@@ -4278,8 +4520,8 @@ void AliITSv3::CreateGeometry()
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
     
     dpgon[0] = offset2 + 360./(2.*39.);
     dpgon[1] = 360.;
@@ -4296,8 +4538,8 @@ void AliITSv3::CreateGeometry()
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   }
   if (fMinorVersion > 2 && fMinorVersion < 6) {
     offset2  = 5.2;
@@ -4305,37 +4547,37 @@ void AliITSv3::CreateGeometry()
     dpgon[1] = 360.;
     dpgon[2] = 32.;
     dpgon[3] = 2.;
-    dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
+    dpgon[4] = (583./2.+(338.-106.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
     // end-ladder electronics 
     dpgon[5] = 34.3;
     dpgon[6] = 36.6;
-    dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
+    dpgon[7] = (583./2.+(338.-106.+15.))/10. - (40.-36.6) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
     // end-ladder electr 
     dpgon[8] = 34.3;
     dpgon[9] = 36.6;
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("RP05", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("RP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
     
     dpgon[0] = offset2 + 5.;
     dpgon[1] = 360.;
     dpgon[2] = 36.;
     dpgon[3] = 2.;
-    dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
+    dpgon[4] = (583./2.+(338.-56.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
     // end-ladder electronics 
     dpgon[5] = 38.9;
     dpgon[6] = 41.2;
-    dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*degrad) + dpcb[2] * 2. - 10.5;
+    dpgon[7] = (583./2.+(338.-56.+15.))/10. - (45.-41.2) / TMath::Tan(45.*kdegrad) + dpcb[2] * 2. - 10.5;
     // end-ladder electr 
     dpgon[8] = 38.9;
     dpgon[9] = 41.2;
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("RP06", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("RP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   }
   
   // 9345 CONTINUE 
@@ -4346,18 +4588,18 @@ void AliITSv3::CreateGeometry()
   
   dcone[0] = 16.75;
   dcone[1] = (338.-3.)*455./(338.-3.-10.)/10.;
-  dcone[2] = .02 / TMath::Cos(45.*degrad) + (338.-3.)*455./(338.-3.-10.)/10.;
+  dcone[2] = .02 / TMath::Cos(45.*kdegrad) + (338.-3.)*455./(338.-3.-10.)/10.;
   dcone[3] = 12.;
   dcone[4] = 12.02;
   xpos     = 0.;
   ypos     = 0.;
   zpos     = -(583.+(338.-3.))/2./10. - dpcb[2] * 2. + 10.5;
   // end-ladder electr 
-  pMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
+  gMC->Gsvolu("LCON", "CONE", idtmed[274], dcone, 5);
   
-  pMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("LCON", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
-  dtube[0] = .02 / TMath::Cos(45.*degrad) +  (338.-3.)*455./(338.-3.-10.)/10.;
+  dtube[0] = .02 / TMath::Cos(45.*kdegrad) +  (338.-3.)*455./(338.-3.-10.)/10.;
   dtube[1] = 49.9;
   // In the Simonetti's drawings 52. In the TP 50. 
   dtube[2] = .15;
@@ -4365,9 +4607,9 @@ void AliITSv3::CreateGeometry()
   ypos     = 0.;
   zpos     = -(583./2.+(338-1.5))/10. - dpcb[2] * 2. + 10.5;
   // end-ladder electr 
-  pMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
+  gMC->Gsvolu("LTB1", "TUBE", idtmed[274], dtube, 3);
   
-  pMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("LTB1", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   dtube[0] = 10.5;
   dtube[1] = 12.;
@@ -4376,9 +4618,9 @@ void AliITSv3::CreateGeometry()
   ypos     = 0.;
   zpos     = -(583./2.-89.+26.8/2.)/10. - dpcb[2] * 2. + 10.5;
   // end-ladder elec 
-  pMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
+  gMC->Gsvolu("LTB2", "TUBE", idtmed[274], dtube, 3);
   ;
-  pMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gspos("LTB2", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   dpgon[0] = 15.;
   dpgon[1] = 360.;
@@ -4395,8 +4637,8 @@ void AliITSv3::CreateGeometry()
   xpos     = 0.;
   ypos     = 0.;
   zpos     = 0.;
-  pMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
-  pMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("LP03", "PGON", idtmed[274], dpgon, 10);
+  gMC->Gspos("LP03", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   dpgon[0] = 7.5;
   dpgon[1] = 360.;
@@ -4413,8 +4655,8 @@ void AliITSv3::CreateGeometry()
   xpos     = 0.;
   ypos     = 0.;
   zpos     = 0.;
-  pMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
-  pMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+  gMC->Gsvolu("LP04", "PGON", idtmed[274], dpgon, 10);
+  gMC->Gspos("LP04", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   
   if (fMinorVersion < 3) {
     offset2  = 5.2;
@@ -4433,8 +4675,8 @@ void AliITSv3::CreateGeometry()
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
     
     dpgon[0] = offset2 + 360./(2.*39.);
     dpgon[1] = 360.;
@@ -4451,8 +4693,8 @@ void AliITSv3::CreateGeometry()
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   }
   if (fMinorVersion > 2 && fMinorVersion < 6) {
     offset2  = 5.2;
@@ -4460,37 +4702,37 @@ void AliITSv3::CreateGeometry()
     dpgon[1] = 360.;
     dpgon[2] = 32.;
     dpgon[3] = 2.;
-    dpgon[4] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
+    dpgon[4] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.))/10. - dpcb[2] * 2. + 10.5;
     // end-ladder electronics 
     dpgon[5] = 34.3;
     dpgon[6] = 36.6;
-    dpgon[7] = (40.-36.6) / TMath::Tan(45.*degrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
+    dpgon[7] = (40.-36.6) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-106.+15.))/10. - dpcb[2] * 2. + 10.5;
     // end-ladder electr 
     dpgon[8] = 34.3;
     dpgon[9] = 36.6;
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("LP05", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("LP05", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
     
     dpgon[0] = offset2 + 5.;
     dpgon[1] = 360.;
     dpgon[2] = 36.;
     dpgon[3] = 2.;
-    dpgon[4] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
+    dpgon[4] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.))/10. - dpcb[2] * 2. + 10.5;
     // end-ladder electronics 
     dpgon[5] = 38.9;
     dpgon[6] = 41.2;
-    dpgon[7] = (45.-41.2) / TMath::Tan(45.*degrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
+    dpgon[7] = (45.-41.2) / TMath::Tan(45.*kdegrad) - (583./2.+(338.-56.+15.))/10. - dpcb[2] * 2. + 10.5;
     // end-ladder electr 
     dpgon[8] = 38.9;
     dpgon[9] = 41.2;
     xpos     = 0.;
     ypos     = 0.;
     zpos     = 0.;
-    pMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
-    pMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
+    gMC->Gsvolu("LP06", "PGON", idtmed[274], dpgon, 10);
+    gMC->Gspos("LP06", 1, "ITSV", xpos, ypos, zpos, 0, "ONLY");
   }
   
   // 9456 CONTINUE 
@@ -4499,87 +4741,336 @@ void AliITSv3::CreateGeometry()
   // --- Outputs the geometry tree in the EUCLID/CAD format 
   
   if (fEuclidOut) {
-    pMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
-  }
-}
+    gMC->WriteEuclid("ITSgeometry", "ITSV", 1, 5);
+  };
+} 
 //_____________________________________________________________________________
-void AliITSv3::CreateMaterials()
-{
+void AliITSv3::CreateMaterials(){
+////////////////////////////////////////////////////////////////////////
+  //
+  // Create ITS materials
+  //     This function defines the default materials used in the Geant
+  // Monte Carlo simulations for the geometries AliITSv1 and AliITSv3.
+  // In general it is automatically replaced by
+  // the CreatMaterials 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.
   //
-  // Create Materials for ITS
+  // Water H2O
+  Float_t awat[2]  = { 1.00794,15.9994 };
+  Float_t zwat[2]  = { 1.,8. };
+  Float_t wwat[2]  = { 2.,1. };
+  Float_t denswat  = 1.;
+  // Freon
+  Float_t afre[2]  = { 12.011,18.9984032 };
+  Float_t zfre[2]  = { 6.,9. };
+  Float_t wfre[2]  = { 5.,12. };
+  Float_t densfre  = 1.5;
+  // Ceramics
+  //     94.4% Al2O3 , 2.8% SiO2 , 2.3% MnO , 0.5% Cr2O3 
+  Float_t acer[5]  = { 26.981539,15.9994,28.0855,54.93805,51.9961 };
+  Float_t zcer[5]  = { 13.,8.,14.,25.,     24. };
+  Float_t wcer[5]  = { .49976,1.01233,.01307,      .01782,.00342 };
+  Float_t denscer  = 3.6;
   //
-   AliITS::CreateMaterials();
+  //     60% SiO2 , 40% G10FR4 
+  // PC board
+  Float_t apcb[3]  = { 28.0855,15.9994,17.749 };
+  Float_t zpcb[3]  = { 14.,8.,8.875 };
+  Float_t wpcb[3]  = { .28,.32,.4 };
+  Float_t denspcb  = 1.8;
+  // POLYETHYL
+  Float_t apoly[2] = { 12.01,1. };
+  Float_t zpoly[2] = { 6.,1. };
+  Float_t wpoly[2] = { .33,.67 };
+  // SERVICES
+  Float_t zserv[4] = { 1.,6.,26.,29. };
+  Float_t aserv[4] = { 1.,12.,55.8,63.5 };
+  Float_t wserv[4] = { .014,.086,.42,.48 };
+  
+  Int_t  isxfld  = gAlice->Field()->Integ();
+  Float_t sxmgmx = gAlice->Field()->Max();
+  
+  
+  // --- Define the various materials for GEANT --- 
+  
+  //  200-224 --> Silicon Pixel Detectors (detectors, chips, buses, cooling,..)
+  
+  AliMaterial(0, "SPD Si$",      28.0855, 14., 2.33, 9.36, 999);
+  AliMaterial(1, "SPD Si chip$", 28.0855, 14., 2.33, 9.36, 999);
+  AliMaterial(2, "SPD Si bus$",  28.0855, 14., 2.33, 9.36, 999);
+  AliMaterial(3, "SPD C$",       12.011,   6., 2.265,18.8, 999);
+  // v. dens 
+  AliMaterial(4, "SPD Air$",    14.61, 7.3, .001205, 30423., 999);
+  AliMaterial(5, "SPD Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
+  AliMaterial(6, "SPD Al$",     26.981539, 13., 2.6989, 8.9, 999);
+  AliMixture( 7, "SPD Water $", awat, zwat, denswat, -2, wwat);
+  AliMixture( 8, "SPD Freon$",  afre, zfre, densfre, -2, wfre);
+  // ** 
+  AliMedium(0, "SPD Si$",      0, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(1, "SPD Si chip$", 1, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(2, "SPD Si bus$",  2, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(3, "SPD C$",       3, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(4, "SPD Air$",     4, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(5, "SPD Vacuum$",  5, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
+  AliMedium(6, "SPD Al$",      6, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(7, "SPD Water $",  7, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(8, "SPD Freon$",   8, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  
+  //  225-249 --> Silicon Drift Detectors (detectors, chips, buses, cooling,..)
+  
+  AliMaterial(25, "SDD Si$",      28.0855, 14., 2.33,  9.36, 999);
+  AliMaterial(26, "SDD Si chip$", 28.0855, 14., 2.33,  9.36, 999);
+  AliMaterial(27, "SDD Si bus$",  28.0855, 14., 2.33,  9.36, 999);
+  AliMaterial(28, "SDD C$",       12.011,   6., 2.265,18.8,  999);
+  // v. dens 
+  AliMaterial(29, "SDD Air$",     14.61, 7.3, .001205, 30423., 999);
+  AliMaterial(30, "SDD Vacuum$",  1e-16, 1e-16, 1e-16, 1e16,  1e16);
+  AliMaterial(31, "SDD Al$",      26.981539, 13., 2.6989, 8.9, 999);
+  // After a call with ratios by number (negative number of elements), 
+  // the ratio array is changed to the ratio by weight, so all successive 
+  // calls with the same array must specify the number of elements as 
+  // positive 
+  AliMixture(32, "SDD Water $", awat, zwat, denswat, 2, wwat);
+  // After a call with ratios by number (negative number of elements), 
+  // the ratio array is changed to the ratio by weight, so all successive 
+  // calls with the same array must specify the number of elements as 
+  // positive 
+  AliMixture( 33, "SDD Freon$", afre, zfre, densfre, 2, wfre);
+  AliMixture( 34, "SDD PCB$",   apcb, zpcb, denspcb, 3, wpcb);
+  AliMaterial(35, "SDD Copper$", 63.546, 29., 8.96, 1.43, 999);
+  AliMixture( 36, "SDD Ceramics$", acer, zcer, denscer, -5, wcer);
+  AliMaterial(37, "SDD Kapton$", 12.011, 6., 1.3, 31.27, 999);
+  // ** 
+  // check A and Z 
+  AliMedium(25, "SDD Si$",      25, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(26, "SDD Si chip$", 26, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(27, "SDD Si bus$",  27, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(28, "SDD C$",       28, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(29, "SDD Air$",     29, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(30, "SDD Vacuum$",  30, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
+  AliMedium(31, "SDD Al$",      31, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(32, "SDD Water $",  32, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(33, "SDD Freon$",   33, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(34, "SDD PCB$",     34, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(35, "SDD Copper$",  35, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(36, "SDD Ceramics$",36, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(37, "SDD Kapton$",  37, 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.);
+  AliMaterial(51, "SSD Si chip$", 28.0855, 14., 2.33, 9.36, 999.);
+  AliMaterial(52, "SSD Si bus$",  28.0855, 14., 2.33, 9.36, 999.);
+  AliMaterial(53, "SSD C$",       12.011,   6., 2.265,18.8, 999.);
+  // v. dens 
+  AliMaterial(54, "SSD Air$",     14.61, 7.3, .001205, 30423., 999);
+  AliMaterial(55, "SSD Vacuum$",  1e-16, 1e-16, 1e-16, 1e16, 1e16);
+  AliMaterial(56, "SSD Al$",      26.981539, 13., 2.6989, 8.9, 999);
+  // After a call with ratios by number (negative number of elements), 
+  // the ratio array is changed to the ratio by weight, so all successive 
+  // calls with the same array must specify the number of elements as 
+  // positive 
+  AliMixture(57, "SSD Water $", awat, zwat, denswat, 2, wwat);
+  // After a call with ratios by number (negative number of elements), 
+  // the ratio array is changed to the ratio by weight, so all successive 
+  // calls with the same array must specify the number of elements as 
+  // positive 
+  AliMixture(58, "SSD Freon$", afre, zfre, densfre, 2, wfre);
+  AliMixture(59, "SSD PCB$",   apcb, zpcb, denspcb, 3, wpcb);
+  AliMaterial(60, "SSD Copper$", 63.546, 29., 8.96, 1.43, 999.);
+  // After a call with ratios by number (negative number of elements), 
+  // the ratio array is changed to the ratio by weight, so all successive 
+  // calls with the same array must specify the number of elements as 
+  // positive 
+  AliMixture( 61, "SSD Ceramics$", acer, zcer, denscer, 5, wcer);
+  AliMaterial(62, "SSD Kapton$", 12.011, 6., 1.3, 31.27, 999.);
+  // check A and Z 
+  AliMaterial(63, "SDD G10FR4$", 17.749, 8.875, 1.8, 21.822, 999.);
+  // ** 
+  AliMedium(50, "SSD Si$",      50, 1,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(51, "SSD Si chip$", 51, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(52, "SSD Si bus$",  52, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(53, "SSD C$",       53, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(54, "SSD Air$",     54, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(55, "SSD Vacuum$",  55, 0,isxfld,sxmgmx, 10.,1.00, .1, .100,10.00);
+  AliMedium(56, "SSD Al$",      56, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(57, "SSD Water $",  57, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(58, "SSD Freon$",   58, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(59, "SSD PCB$",     59, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(60, "SSD Copper$",  60, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(61, "SSD Ceramics$",61, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(62, "SSD Kapton$",  62, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(63, "SSD G10FR4$",  63, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  
+  //     275-299 --> General (end-caps, frames, cooling, cables, etc.) 
+  
+  AliMaterial(75, "GEN C$", 12.011, 6., 2.265, 18.8, 999.);
+  // verify density 
+  AliMaterial(76, "GEN Air$", 14.61, 7.3, .001205, 30423., 999);
+  AliMaterial(77, "GEN Vacuum$", 1e-16, 1e-16, 1e-16, 1e16, 1e16);
+  AliMixture( 78, "GEN POLYETHYL$", apoly, zpoly, .95, -2, wpoly);
+  AliMixture( 79, "GEN SERVICES$",  aserv, zserv, 4.68, 4, wserv);
+  AliMaterial(80, "GEN Copper$", 63.546, 29., 8.96, 1.43, 999.);
+  // After a call with ratios by number (negative number of elements), 
+  // the ratio array is changed to the ratio by weight, so all successive 
+  // calls with the same array must specify the number of elements as 
+  // positive 
+  AliMixture(81, "GEN Water $", awat, zwat, denswat, 2, wwat);
+  // ** 
+  AliMedium(75,"GEN C$",        75, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(76,"GEN Air$",      76, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(77,"GEN Vacuum$",   77, 0,isxfld,sxmgmx, 10., .10, .1, .100,10.00);
+  AliMedium(78,"GEN POLYETHYL$",78, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(79,"GEN SERVICES$", 79, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(80,"GEN Copper$",   80, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
+  AliMedium(81,"GEN Water $",   81, 0,isxfld,sxmgmx, 10., .01, .1, .003, .003);
 }
-
 //_____________________________________________________________________________
-void AliITSv3::Init()
-{
-  //
-  // Initialise its after it is built
-  //
-  AliITS::Init();
-} 
+void AliITSv3::Init(){
+////////////////////////////////////////////////////////////////////////
+//     Initialise the ITS after it has been created.
+////////////////////////////////////////////////////////////////////////
 
+    AliITS::Init();
+    fMajorVersion = 3;
+}
 //_____________________________________________________________________________
-void AliITSv3::StepManager()
-{
-  //
-  // Called at every step in ITS
-  //
+void AliITSv3::StepManager(){
+////////////////////////////////////////////////////////////////////////
+//    Called for every step in the ITS, then calles the AliITShit class
+// creator with the information to be recoreded about that hit.
+//     The value of the macro ALIITSPRINTGEOM if set to 1 will allow the
+// printing of information to a file which can be used to create a .det
+// file read in by the routine CreateGeometry(). If set to 0 or any other
+// value except 1, the default behavior, then no such file is created nor
+// it the extra variables and the like used in the printing allocated.
+////////////////////////////////////////////////////////////////////////
   Int_t         copy, id;
-  Float_t       hits[7];
-  Int_t         vol[3];
-  Float_t       position[3];
-  Float_t       momentum[4];
+  Float_t       hits[8];
+  Int_t         vol[4];
+  TLorentzVector position, momentum;
   TClonesArray &lhits = *fHits;
-  AliMC* pMC = AliMC::GetMC();
+#if ALIITSPRINTGEOM==1
+  FILE          *fp;
+  Int_t         i;
+  Float_t       xl[3],xt[3],angl[6];
+//  Float_t       par[20],att[20];
+  Float_t      mat[9];
+  static Bool_t first=kTRUE,printit[6][50][50];
+  if(first){ for(copy1=0;copy1<6;copy1++)for(copy2=0;copy2<50;copy2++)
+      for(id=0;id<50;id++) printit[copy1][copy2][id] = kTRUE;
+  first = kFALSE;
+  }
+  // end if first
+#endif
   //
-  if(pMC->TrackCharge() && pMC->Edep()) {
+  // Track status
+  vol[3] = 0;
+  if(gMC->IsTrackInside())      vol[3] +=  1;
+  if(gMC->IsTrackEntering())    vol[3] +=  2;
+  if(gMC->IsTrackExiting())     vol[3] +=  4;
+  if(gMC->IsTrackOut())         vol[3] +=  8;
+  if(gMC->IsTrackDisappeared()) vol[3] += 16;
+  if(gMC->IsTrackStop())        vol[3] += 32;
+  if(gMC->IsTrackAlive())       vol[3] += 64;
+  //
+  // Fill hit structure.
+  if(!(gMC->TrackCharge())) return;
     //
     // Only entering charged tracks
-    if((id=pMC->CurrentVol(0,copy))==fIdSens1) {  
+    if((id=gMC->CurrentVolID(copy))==fIdSens[0]) {  
       vol[0]=1;
-      id=pMC->CurrentVolOff(1,0,copy);      
+      id=gMC->CurrentVolOffID(1,copy);      
       vol[1]=copy;
-      id=pMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                       
-    } else if(id==fIdSens2) {
+    } else if(id==fIdSens[1]) {
       vol[0]=2;
-      id=pMC->CurrentVolOff(1,0,copy);       
+      id=gMC->CurrentVolOffID(1,copy);       
       vol[1]=copy;
-      id=pMC->CurrentVolOff(2,0,copy);
+      id=gMC->CurrentVolOffID(2,copy);
       vol[2]=copy;                    
-    } else if(id==fIdSens3) {
+    } else if(id==fIdSens[2]) {
       vol[0]=3;
       vol[1]=copy;
-      id=pMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;             
-    } else if(id==fIdSens4) {
+    } else if(id==fIdSens[3]) {
       vol[0]=4;
       vol[1]=copy;
-      id=pMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                  
-    } else if(id==fIdSens5) {
+    } else if(id==fIdSens[4]) {
       vol[0]=5;
       vol[1]=copy;
-      id=pMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;               
-    } else if(id==fIdSens6) {
+    } else if(id==fIdSens[5]) {
       vol[0]=6;
       vol[1]=copy;
-      id=pMC->CurrentVolOff(1,0,copy);
+      id=gMC->CurrentVolOffID(1,copy);
       vol[2]=copy;                      
     } else return;
-    pMC->TrackPosition(position);
-    pMC->TrackMomentum(momentum);
+    gMC->TrackPosition(position);
+    gMC->TrackMomentum(momentum);
     hits[0]=position[0];
     hits[1]=position[1];
     hits[2]=position[2];          
-    hits[3]=momentum[0]*momentum[3];
-    hits[4]=momentum[1]*momentum[3];
-    hits[5]=momentum[2]*momentum[3];        
-    hits[6]=pMC->Edep();
+    hits[3]=momentum[0];
+    hits[4]=momentum[1];
+    hits[5]=momentum[2];        
+    hits[6]=gMC->Edep();
+    hits[7]=gMC->TrackTime();
     new(lhits[fNhits++]) AliITShit(fIshunt,gAlice->CurrentTrack(),vol,hits);
-  }      
+#if ALIITSPRINTGEOM==1
+  if(printit[vol[0]][vol[2]][vol[1]]){
+      printit[vol[0]][vol[2]][vol[1]] = kFALSE;
+      xl[0] = xl[1] = xl[2] = 0.0;
+      gMC->Gdtom(xl,xt,1);
+      for(i=0;i<9;i++) mat[i] = 0.0;
+      mat[0] = mat[4] = mat[8] = 1.0;  // default with identity matrix
+      xl[0] = 1.0;
+      xl[1] = xl[2] =0.0;
+      gMC->Gdtom(xl,&(mat[0]),2);
+      xl[1] = 1.0;
+      xl[0] = xl[2] =0.0;
+      gMC->Gdtom(xl,&(mat[3]),2);
+      xl[2] = 1.0;
+      xl[1] = xl[0] =0.0;
+      gMC->Gdtom(xl,&(mat[6]),2);
+
+      angl[0] = TMath::ACos(mat[2]);
+      if(mat[2]==1.0) angl[0] = 0.0;
+      angl[1] = TMath::ATan2(mat[1],mat[0]);
+      if(angl[1]<0.0) angl[1] += 2.0*TMath::Pi();
+
+      angl[2] = TMath::ACos(mat[5]);
+      if(mat[5]==1.0) angl[2] = 0.0;
+      angl[3] = TMath::ATan2(mat[4],mat[3]);
+      if(angl[3]<0.0) angl[3] += 2.0*TMath::Pi();
+
+      angl[4] = TMath::ACos(mat[8]);
+      if(mat[8]==1.0) angl[4] = 0.0;
+      angl[5] = TMath::ATan2(mat[7],mat[6]);
+      if(angl[5]<0.0) angl[5] += 2.0*TMath::Pi();
+
+      for(i=0;i<6;i++) angl[i] *= 180.0/TMath::Pi(); // degrees
+//      i = gMC->CurrentVolID(copy);
+//      gMC->Gfpara(gMC->CurrentVolName(),copy,1,copy1,copy2,par,att);
+      fp = fopen("ITSgeometry_v5.det","a");
+      fprintf(fp,"%2d %2d %2d %9e %9e %9e %9e %9e %9e %9e %9e %9e ",
+             vol[0],vol[2],vol[1], // layer ladder detector
+             xt[0],xt[1],xt[2],    // Translation vector
+             angl[0],angl[1],angl[2],angl[3],angl[4],angl[5] // Geant rotaion
+                                                           // angles (degrees)
+             );
+      fprintf(fp,"%9e %9e %9e %9e %9e %9e %9e %9e %9e",
+            mat[0],mat[1],mat[2],mat[3],mat[4],mat[5],mat[6],mat[7],mat[8]
+         );  // Adding the rotation matrix.
+      fprintf(fp,"\n");
+      fclose(fp);
+  } // end if printit[layer][ladder][detector]
+#endif
 }