]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ACORDE/AliACORDEv0.cxx
ATO-97 - adding defaul aliases for per pad calibrations
[u/mrichter/AliRoot.git] / ACORDE / AliACORDEv0.cxx
index d434fbe5b99845e2a32626380f2d0d1d9c9156c0..54642522566e371b329883d995011fc73a13089e 100644 (file)
@@ -98,8 +98,8 @@ void AliACORDEv0::CreateCavern()
   //pbox[0] = 12073;
   pbox[1] = AliACORDEConstants::Instance()->Depth();
   pbox[2] = pbox[0];
-  gMC->Gsvolu("ACORDE", "BOX", idtmed[1114], pbox, 3);
-  gMC->Gspos("ACORDE", 1, "ALIC", 0, 0, 0, 0, "ONLY");
+  TVirtualMC::GetMC()->Gsvolu("ACORDE", "BOX", idtmed[1114], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("ACORDE", 1, "ALIC", 0, 0, 0, 0, "ONLY");
   CreateShafts();
   CreateMolasse();
 }
@@ -127,7 +127,7 @@ void AliACORDEv0::CreateShafts()
   ptube[0] = 0;    // inner radius
   ptube[1] = 1250; // outer radius
   ptube[2] = 5150/2; // Half lenght in Z
-  gMC->Gsvolu("CSF1", "TUBE", idtmed[1114], ptube, 3);
+  TVirtualMC::GetMC()->Gsvolu("CSF1", "TUBE", idtmed[1114], ptube, 3);
 
   Float_t ptubs[5];
   // The open section of the PX24
@@ -136,90 +136,90 @@ void AliACORDEv0::CreateShafts()
   ptubs[2] = 1300; // Half length
   ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]); // starting angle
   ptubs[4] = 180 -  kRaddeg*TMath::ASin(1070/ptubs[0]);
-  gMC->Gsvolu("CSF2", "TUBS", idtmed[1116], ptubs, 5);
-  gMC->Gspos("CSF2", 1, "CSF1", 0, 0, -ptube[2] + ptubs[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSF2", "TUBS", idtmed[1116], ptubs, 5);
+  TVirtualMC::GetMC()->Gspos("CSF2", 1, "CSF1", 0, 0, -ptube[2] + ptubs[2], 0, "MANY");
 
   // The other part of the shaft.
   ptube[0] = ptubs[0]; // Inner radius
   ptube[1] = ptubs[1]; // Outer radius
   ptube[2] = 5150/2 - ptubs[2]; // Half lenght
-  gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
-  gMC->Gspos("CSF3", 1, "CSF1", 0, 0, 5150/2 - ptube[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3);
+  TVirtualMC::GetMC()->Gspos("CSF3", 1, "CSF1", 0, 0, 5150/2 - ptube[2], 0, "MANY");
 
   Float_t pbox[3];
   // Concrete walls along the shaft (next to the elevator.)
   pbox[0] = 480/2;  // Half length in X
   pbox[1] = 120/2;  // Half length in Y
   pbox[2] = 5150/2; // Half length in Z
-  gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW1", 1, "CSF1", 820+pbox[0],  150+pbox[1], 0, 0, "MANY");
-  gMC->Gspos("CSW1", 2, "CSF1", 820+pbox[0], -300-pbox[1], 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW1", 1, "CSF1", 820+pbox[0],  150+pbox[1], 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("CSW1", 2, "CSF1", 820+pbox[0], -300-pbox[1], 0, 0, "MANY");
 
   //
   pbox[0] = 120/2;  // Half length in X
   pbox[1] = 750/2;  // Half length in Y
   pbox[2] = 5150/2; // Half length in Z
-  gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW2", 1, "CSF1", 820-60, 150+pbox[1], 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW2", 1, "CSF1", 820-60, 150+pbox[1], 0, 0, "MANY");
 
   //
   pbox[0] = 120/2;  // Half length in X
   pbox[1] = 600/2;  // Half lenght in Y
   pbox[2] = 5150/2; // Half length in Z
-  gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW3", 1, "CSF1", 820-60, -300-pbox[1], 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW3", 1, "CSF1", 820-60, -300-pbox[1], 0, 0, "MANY");
 
   // Material below the counting rooms.
   pbox[0] = 400/2;
   pbox[1] = 2300/2;
   pbox[2] = 300/2;
-  gMC->Gsvolu("CSW4", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW4",1,"CSF1",2300/2-pbox[0],0,3000-5150/2-pbox[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW4", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW4",1,"CSF1",2300/2-pbox[0],0,3000-5150/2-pbox[2], 0, "MANY");
 
   // Shielding plug.
   pbox[0] = 1400/2;
   pbox[1] = 2300/2;
   pbox[2] = 170/2;
-  gMC->Gsvolu("CSW5", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW5", 1, "CSF1", 0, 0, 3000-5150/2-130, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW5", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW5", 1, "CSF1", 0, 0, 3000-5150/2-130, 0, "MANY");
 
   // The end of the support for the shielding plug.
   pbox[0] = 170/2;
   pbox[1] = 2300/2;
   pbox[2] = 300/2;
-  gMC->Gsvolu("CSW6", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW6",1,"CSF1",-1400/2-pbox[0],0,3000-5150/2-pbox[2],0,"MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW6", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW6",1,"CSF1",-1400/2-pbox[0],0,3000-5150/2-pbox[2],0,"MANY");
 
   // ...
   pbox[0] = 100/2;
   pbox[1] = 2300/2;
   pbox[2] = 450/2;
-  gMC->Gsvolu("CSW7", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW7",1,"CSF1",-1400/2-170-pbox[0],0,3000-5150/2+pbox[2],0,"MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW7", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW7",1,"CSF1",-1400/2-170-pbox[0],0,3000-5150/2+pbox[2],0,"MANY");
 
   // Material close to the pipe.
   pbox[0] = 300/2;
   pbox[1] = 2300/2;
   pbox[2] = 170/2;
-  gMC->Gsvolu("CSW8", "BOX", idtmed[1116], pbox, 3);
-  gMC->Gspos("CSW8",1,"CSF1",-2300/2+pbox[0],0,2500-5150/2,0,"MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSW8", "BOX", idtmed[1116], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CSW8",1,"CSF1",-2300/2+pbox[0],0,2500-5150/2,0,"MANY");
 
   // Now put the shaft into the mother volume.
-  gMC->Gspos("CSF1", 1, "ACORDE", 0, AliACORDEConstants::Instance()->Depth() - 5150/2, 2300, idrotm[2001], "MANY");
+  TVirtualMC::GetMC()->Gspos("CSF1", 1, "ACORDE", 0, AliACORDEConstants::Instance()->Depth() - 5150/2, 2300, idrotm[2001], "MANY");
 
   // PM25 Access Shaft
   ptube[0] = 910/2;
   ptube[1] = ptube[0] + 100;
   ptube[2] = (5150 - 1166)/2;
-  gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
-  gMC->Gspos("CSF4", 1, "ACORDE", 2100, AliACORDEConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3);
+  TVirtualMC::GetMC()->Gspos("CSF4", 1, "ACORDE", 2100, AliACORDEConstants::Instance()->Depth()-ptube[2], 0, idrotm[2001], "MANY");
 
   // PGC2 Access Shaft
   ptube[0] = 1100/2;
   ptube[1] = ptube[0] + 100;
   ptube[2] = (5150 - 690)/2;
-  gMC->Gsvolu("CSF5", "TUBE", idtmed[1116], ptube, 3);
-  gMC->Gspos("CSF5", 1, "ACORDE", -375, AliACORDEConstants::Instance()->Depth()-ptube[2], -1900 - 2987.7, idrotm[2001], "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CSF5", "TUBE", idtmed[1116], ptube, 3);
+  TVirtualMC::GetMC()->Gspos("CSF5", 1, "ACORDE", -375, AliACORDEConstants::Instance()->Depth()-ptube[2], -1900 - 2987.7, idrotm[2001], "MANY");
 
 }
 
@@ -255,7 +255,7 @@ void AliACORDEv0::CreateMolasse()
   pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = pbox[0];
-  gMC->Gsvolu("CMO1", "BOX", idtmed[1114], pbox, 3);
+  TVirtualMC::GetMC()->Gsvolu("CMO1", "BOX", idtmed[1114], pbox, 3);
 
   // Now put the molasse exactly above the hall. OK
   // Above the ceiling
@@ -265,8 +265,8 @@ void AliACORDEv0::CreateMolasse()
   ptubs[2] = 1900/2 + px24radius;
   ptubs[3] = 0;
   ptubs[4] = 180;
-  gMC->Gsvolu("CMO2", "TUBS", idtmed[1123], ptubs, 5);
-  gMC->Gspos("CMO2", 1, "CMO1", 0, 500-AliACORDEConstants::Instance()->Depth()/2, ptubs[2]-1900, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO2", "TUBS", idtmed[1123], ptubs, 5);
+  TVirtualMC::GetMC()->Gspos("CMO2", 1, "CMO1", 0, 500-AliACORDEConstants::Instance()->Depth()/2, ptubs[2]-1900, 0, "MANY");
 
   // Molasse around the RB24/26 Wall. OK
   ptubs[0] = 220 + 1600;
@@ -274,34 +274,34 @@ void AliACORDEv0::CreateMolasse()
   ptubs[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
   ptubs[3] = 0;
   ptubs[4] = 180;
-  gMC->Gsvolu("CMO3", "TUBS", idtmed[1123], ptubs, 5);
-  gMC->Gspos("CMO3", 1, "CMO1", 70, 40-AliACORDEConstants::Instance()->Depth()/2, -1900 - ptubs[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO3", "TUBS", idtmed[1123], ptubs, 5);
+  TVirtualMC::GetMC()->Gspos("CMO3", 1, "CMO1", 70, 40-AliACORDEConstants::Instance()->Depth()/2, -1900 - ptubs[2], 0, "MANY");
 
   // A big block above the RB24/26 wall. OK
   pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
   pbox[1] = (AliACORDEConstants::Instance()->Depth() - 220 - 1600)/2;
   pbox[2] = 2987.7/2 - 1100/4 - concreteWidth/2;
-  gMC->Gsvolu("CMO4", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CMO4", 1, "CMO1", 0, AliACORDEConstants::Instance()->Depth()/2 - pbox[1], -1900 - pbox[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO4", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CMO4", 1, "CMO1", 0, AliACORDEConstants::Instance()->Depth()/2 - pbox[1], -1900 - pbox[2], 0, "MANY");
   // Small blocks below the volume CMO4 on both sides of the wall RB24/26. OK
   pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
 ptubs[0])/2;
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2 - pbox[1];
-  gMC->Gsvolu("CM17", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM17", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
-  gMC->Gspos("CM17", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad)+ pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM17", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM17", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("CM17", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad)+ pbox[0], -AliACORDEConstants::Instance()->Depth()/2 + pbox[1], -1900 - pbox[2], 0, "MANY");
 
   // And a big block of molasse above the hall up to the surface. OK
   pbox[0] = pm25X - pm25radius;
   pbox[1] = (AliACORDEConstants::Instance()->Depth()-500-1170)/2;
   pbox[2] = (1900 + 1150)/2;
-  gMC->Gsvolu("CMO5", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CMO5", 1, "CMO1", 0,AliACORDEConstants::Instance()->Depth()/2-pbox[1], pbox[2]-1900, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO5", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CMO5", 1, "CMO1", 0,AliACORDEConstants::Instance()->Depth()/2-pbox[1], pbox[2]-1900, 0, "MANY");
   // Small blocks of molasse betwen the blocks CMO2, CMO5 and PM25. Ok
   pbox[0] = (pm25X - pm25radius - 1170)/2;
   pbox[1] = 1000;
-  gMC->Gsvolu("CM16", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM16", 1, "CMO1", 1170 + pbox[0], -AliACORDEConstants::Instance()->Depth()/2+pbox[1], pbox[2] - 1900, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM16", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM16", 1, "CMO1", 1170 + pbox[0], -AliACORDEConstants::Instance()->Depth()/2+pbox[1], pbox[2] - 1900, 0, "MANY");
 
   // Molasse around the shafts.
   AliMatrix(idrotm[2003], 0, 0, 90, 0, 90, 90);
@@ -311,80 +311,80 @@ ptubs[0])/2;
   ptubs[2] = (2300 - (5150 - AliACORDEConstants::Instance()->Depth()))/2;
   ptubs[3] = 180 + kRaddeg*TMath::ASin(1070/ptubs[0]);
   ptubs[4] = 180 -  kRaddeg*TMath::ASin(1070/ptubs[0]);
-  gMC->Gsvolu("CMO6", "TUBS", idtmed[1123], ptubs, 5);
-  gMC->Gspos("CMO6", 1, "CMO1", px24X, ptubs[2] - AliACORDEConstants::Instance()->Depth()/2, px24Z, idrotm[2003], "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO6", "TUBS", idtmed[1123], ptubs, 5);
+  TVirtualMC::GetMC()->Gspos("CMO6", 1, "CMO1", px24X, ptubs[2] - AliACORDEConstants::Instance()->Depth()/2, px24Z, idrotm[2003], "MANY");
   // Around the PX24, the closed section. OK
   Float_t ptube[3];
   ptube[0] = px24radius + concreteWidth;
   ptube[1] = ptube[0] + 1000;
   ptube[2] = (5150 - 2300)/2;
-  gMC->Gsvolu("CMO7", "TUBE", idtmed[1123], ptube, 3);
-  gMC->Gspos("CMO7", 1, "CMO1", px24X, AliACORDEConstants::Instance()->Depth()/2 - ptube[2], px24Z, idrotm[2003], "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO7", "TUBE", idtmed[1123], ptube, 3);
+  TVirtualMC::GetMC()->Gspos("CMO7", 1, "CMO1", px24X, AliACORDEConstants::Instance()->Depth()/2 - ptube[2], px24Z, idrotm[2003], "MANY");
 
   // Around PM25. OK
   ptube[0] = pm25radius + concreteWidth;
   ptube[1] = ptube[0] + 400;
   ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
-  gMC->Gsvolu("CMO8", "TUBE", idtmed[1123], ptube, 3);
-  gMC->Gspos("CMO8", 1, "CMO1", pm25X, 0, pm25Z, idrotm[2003], "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO8", "TUBE", idtmed[1123], ptube, 3);
+  TVirtualMC::GetMC()->Gspos("CMO8", 1, "CMO1", pm25X, 0, pm25Z, idrotm[2003], "MANY");
   // On both sides of the PM25 along the HALL.
   pbox[0] = (2100 + pm25radius - 1170)/2;
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = (3*px24radius - pm25radius)/2;
-  gMC->Gsvolu("CM18", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM18", 1, "CMO1", 2100, 0, pbox[2] + pm25radius, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM18", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM18", 1, "CMO1", 2100, 0, pbox[2] + pm25radius, 0, "MANY");
 
   pbox[2] = (1900 - pm25radius)/2;
-  gMC->Gsvolu("CM19", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM19", 1, "CMO1", 2100, 0, -pbox[2] - pm25radius, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM19", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM19", 1, "CMO1", 2100, 0, -pbox[2] - pm25radius, 0, "MANY");
 
   // Around the PGC2. OK
   ptube[0] = pgc2radius + concreteWidth;
   ptube[1] = 2987.7 - 740;
   ptube[2] = AliACORDEConstants::Instance()->Depth()/2;
-  gMC->Gsvolu("CMO9", "TUBE", idtmed[1123], ptube, 3);
-  gMC->Gspos("CMO9", 1, "CMO1", pgc2X, 0, pgc2Z, idrotm[2003], "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CMO9", "TUBE", idtmed[1123], ptube, 3);
+  TVirtualMC::GetMC()->Gspos("CMO9", 1, "CMO1", pgc2X, 0, pgc2Z, idrotm[2003], "MANY");
 
   // On both sides of the PGC2.OK
   pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
 1100 - 375)/2;
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = pgc2radius + concreteWidth;
-  gMC->Gsvolu("CM10", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM10", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], 0, pgc2Z, 0, "MANY");
-  gMC->Gspos("CM10", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) + pbox[0], 0, pgc2Z, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM10", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM10", 1, "CMO1", AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) - pbox[0], 0, pgc2Z, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("CM10", 2, "CMO1", -AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) + pbox[0], 0, pgc2Z, 0, "MANY");
 
   // big block of molasse behind the PX24. OK
   pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = (pbox[0] - (2300 + 1150 + 100))/2;
-  gMC->Gsvolu("CM12", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM12", 1, "CMO1", px24X, 0, px24Z + px24radius + concreteWidth + pbox[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM12", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM12", 1, "CMO1", px24X, 0, px24Z + px24radius + concreteWidth + pbox[2], 0, "MANY");
 
   // big block of molasse in the opposite side of the PM25. OK
   pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
 1150)/2;
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = (1900 + 2300 + 1150)/2;
-  gMC->Gsvolu("CM13", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM13", 1, "CMO1", -1150 - pbox[0], 0, pbox[2] - 1900, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM13", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM13", 1, "CMO1", -1150 - pbox[0], 0, pbox[2] - 1900, 0, "MANY");
 
   // big block of molasse behind the PM25. OK
   pbox[0] = (AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad) -
 (2100 + 910/2 + 100))/2;
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = (1900 + 2300 + 1150)/2;
-  gMC->Gsvolu("CM14", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM14", 1, "CMO1", pm25X + pm25radius + concreteWidth + pbox[0], 0, pbox[2] - 1900, 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM14", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM14", 1, "CMO1", pm25X + pm25radius + concreteWidth + pbox[0], 0, pbox[2] - 1900, 0, "MANY");
 
   // big block of molasse behind the PGC2. OK
   pbox[0] = AliACORDEConstants::Instance()->Depth()*TMath::Tan(67.5*kDegrad);
   pbox[1] = AliACORDEConstants::Instance()->Depth()/2;
   pbox[2] = (pbox[0] - (2987.7 + 1900 + 1100/2 + 100))/2;
-  gMC->Gsvolu("CM15", "BOX", idtmed[1123], pbox, 3);
-  gMC->Gspos("CM15", 1, "CMO1", 0, 0, -pbox[0] + pbox[2], 0, "MANY");
+  TVirtualMC::GetMC()->Gsvolu("CM15", "BOX", idtmed[1123], pbox, 3);
+  TVirtualMC::GetMC()->Gspos("CM15", 1, "CMO1", 0, 0, -pbox[0] + pbox[2], 0, "MANY");
 
-  gMC->Gspos("CMO1",1,"ACORDE",0,AliACORDEConstants::Instance()->Depth()/2,0,0,"MANY");
+  TVirtualMC::GetMC()->Gspos("CMO1",1,"ACORDE",0,AliACORDEConstants::Instance()->Depth()/2,0,0,"MANY");
 
 }
 
@@ -427,21 +427,21 @@ void AliACORDEv0::CreateAcorde()
   box[0] = constants->ModuleLength()/2;
   box[1] = constants->ModuleHeight()/2;
   box[2] = constants->ModuleWidth()/2;
-  gMC->Gsvolu("ACORDE1", "BOX", idtmed[1114], box, 3);
+  TVirtualMC::GetMC()->Gsvolu("ACORDE1", "BOX", idtmed[1114], box, 3);
 
   // The scintillators
   box[0] = constants->PlasticLength()/2;
   box[1] = constants->PlasticHeight()/2;
   box[2] = constants->PlasticWidth()/2;
-  gMC->Gsvolu("ACORDE2", "BOX", idtmed[1112], box, 3);
+  TVirtualMC::GetMC()->Gsvolu("ACORDE2", "BOX", idtmed[1112], box, 3);
 
   // it is important to keep this order for easy assignment of 
   // a volume to a physical module:
   placed_at = box[1]+constants->ProfileThickness()
     - constants->ModuleHeight()/2+small;
-  gMC->Gspos("ACORDE2", 1, "ACORDE1", 0, placed_at, 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE2", 1, "ACORDE1", 0, placed_at, 0, 0, "MANY");
   placed_at = placed_at + 2.0*box[1]+small;
-  gMC->Gspos("ACORDE2", 2, "ACORDE1", 0, placed_at, 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE2", 2, "ACORDE1", 0, placed_at, 0, 0, "MANY");
 
 
   // The metallic frame: long walls of box
@@ -453,57 +453,57 @@ void AliACORDEv0::CreateAcorde()
   box[0] = constants->ModuleLength()/2;
   box[1] = constants->ModuleHeight()/2;
   box[2] = constants->ProfileThickness()/2.0; 
-  gMC->Gsvolu("ACORDE3", "BOX", idtmed[1108], box, 3);
+  TVirtualMC::GetMC()->Gsvolu("ACORDE3", "BOX", idtmed[1108], box, 3);
   // front wall
   placed_at = constants->ModuleWidth()/2-constants->ProfileThickness()/2.0;
-  gMC->Gspos("ACORDE3", 1, "ACORDE1", 0, 0, placed_at, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE3", 1, "ACORDE1", 0, 0, placed_at, 0, "MANY");
   // back wall
-  gMC->Gspos("ACORDE3", 2, "ACORDE1", 0, 0, -placed_at , 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE3", 2, "ACORDE1", 0, 0, -placed_at , 0, "MANY");
 
   // The metallic frame: end caps
   box[0] = constants->ProfileThickness()/2.0;
   box[1] = constants->ModuleHeight()/2;
   box[2] = constants->ModuleWidth()/2;
-  gMC->Gsvolu("ACORDE4", "BOX", idtmed[1108], box, 3);
+  TVirtualMC::GetMC()->Gsvolu("ACORDE4", "BOX", idtmed[1108], box, 3);
   // right cap
   placed_at = constants->ModuleLength()/2-constants->ProfileThickness()/2.0;
-  gMC->Gspos("ACORDE4", 1, "ACORDE1", placed_at, 0, 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE4", 1, "ACORDE1", placed_at, 0, 0, 0, "MANY");
   // left cap
-  gMC->Gspos("ACORDE4", 2, "ACORDE1", -placed_at, 0, 0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE4", 2, "ACORDE1", -placed_at, 0, 0, 0, "MANY");
 
   // The metallic frame: the profile, long stripes
   box[0] = constants->ModuleLength()/2.0;
   box[1] = constants->ProfileThickness()/2;
   box[2] = constants->ProfileWidth()/2;
-  gMC->Gsvolu("ACORDE5", "BOX", idtmed[1108], box, 3);
+  TVirtualMC::GetMC()->Gsvolu("ACORDE5", "BOX", idtmed[1108], box, 3);
   // upper front
   placed_at = constants->ModuleHeight()/2-box[1];
   placed_at2 = constants->ModuleWidth()/2-
     constants->ProfileThickness()-box[2];
-  gMC->Gspos("ACORDE5", 1, "ACORDE1",0,placed_at,placed_at2, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE5", 1, "ACORDE1",0,placed_at,placed_at2, 0, "MANY");
   // upper back
-  gMC->Gspos("ACORDE5", 2, "ACORDE1",0,placed_at,-placed_at2, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE5", 2, "ACORDE1",0,placed_at,-placed_at2, 0, "MANY");
   // lower front
-  gMC->Gspos("ACORDE5", 3, "ACORDE1",0,-placed_at,placed_at2, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE5", 3, "ACORDE1",0,-placed_at,placed_at2, 0, "MANY");
   // lower back
-  gMC->Gspos("ACORDE5", 4, "ACORDE1",0,-placed_at,-placed_at2, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE5", 4, "ACORDE1",0,-placed_at,-placed_at2, 0, "MANY");
 
   // The metallic frame: the profile, long stripes
   box[0] = constants->ProfileWidth()/2.0;
   box[1] = constants->ProfileThickness()/2;
   box[2] = constants->ModuleWidth()/2-constants->ProfileWidth();
-  gMC->Gsvolu("ACORDE6", "BOX", idtmed[1108], box, 3);
+  TVirtualMC::GetMC()->Gsvolu("ACORDE6", "BOX", idtmed[1108], box, 3);
   // upper right
   placed_at = constants->ModuleHeight()/2-box[1];
   placed_at2 = constants->ModuleLength()/2-
     constants->ProfileThickness()-box[0];
-  gMC->Gspos("ACORDE6", 1, "ACORDE1",placed_at2,placed_at,0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE6", 1, "ACORDE1",placed_at2,placed_at,0, 0, "MANY");
   // upper left
-  gMC->Gspos("ACORDE6", 2, "ACORDE1",-placed_at2,placed_at,0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE6", 2, "ACORDE1",-placed_at2,placed_at,0, 0, "MANY");
   // lower right
-  gMC->Gspos("ACORDE6", 3, "ACORDE1",placed_at2,-placed_at,0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE6", 3, "ACORDE1",placed_at2,-placed_at,0, 0, "MANY");
   // lower left
-  gMC->Gspos("ACORDE6", 4, "ACORDE1",-placed_at2,-placed_at,0, 0, "MANY");
+  TVirtualMC::GetMC()->Gspos("ACORDE6", 4, "ACORDE1",-placed_at2,-placed_at,0, 0, "MANY");
 
   // End of MODULE definition
 
@@ -530,78 +530,78 @@ void AliACORDEv0::CreateAcorde()
 
   // first column, except first and last  modules
   for (Int_t copy = 2; copy < 10; copy++)
-    gMC->Gspos("ACORDE1",copy,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
               constants->OldModulePositionX(copy-1),
               constants->OldModulePositionY(copy-1),
               constants->OldModulePositionZ(copy-1),
               idrotm[232], "MANY");
   // second column
   for (Int_t copy = 11; copy < 21; copy++)
-    gMC->Gspos("ACORDE1",copy,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
               constants->OldModulePositionX(copy-1),
               constants->OldModulePositionY(copy-1),
               constants->OldModulePositionZ(copy-1),
               idrotm[232], "MANY");
   // third and fourth columns
   for (Int_t copy = 21; copy < 41; copy++)
-    gMC->Gspos("ACORDE1",copy,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
               constants->OldModulePositionX(copy-1),
               constants->OldModulePositionY(copy-1),
               constants->OldModulePositionZ(copy-1),
               0, "MANY");
   // fifth column
   for (Int_t copy = 41; copy < 51; copy++)
-    gMC->Gspos("ACORDE1",copy,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
               constants->OldModulePositionX(copy-1),
               constants->OldModulePositionY(copy-1),
               constants->OldModulePositionZ(copy-1),
               idrotm[231], "MANY");
   // last column, except first and last  modules
   for (Int_t copy = 52; copy < 60; copy++)
-    gMC->Gspos("ACORDE1",copy,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",copy,"ALIC",
               constants->OldModulePositionX(copy-1),
               constants->OldModulePositionY(copy-1),
               constants->OldModulePositionZ(copy-1),
               idrotm[231], "MANY");
   // the last four modules
   if (Get4CentralModulesGeometry()) {
-    gMC->Gspos("ACORDE1",1,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",1,"ALIC",
               constants->OldExtraModulePositionX(),
               constants->OldExtraModulePositionY(),
               constants->OldExtraModulePositionZ(0),
               0, "MANY");  
-    gMC->Gspos("ACORDE1",10,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",10,"ALIC",
               constants->OldExtraModulePositionX(),
               constants->OldExtraModulePositionY(),
               constants->OldExtraModulePositionZ(1),
               0, "MANY");  
-    gMC->Gspos("ACORDE1",51,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",51,"ALIC",
               constants->OldExtraModulePositionX(),
               constants->OldExtraModulePositionY(),
               constants->OldExtraModulePositionZ(2),
               0, "MANY");  
-    gMC->Gspos("ACORDE1",60,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",60,"ALIC",
               constants->OldExtraModulePositionX(),
               constants->OldExtraModulePositionY(),
               constants->OldExtraModulePositionZ(3),
               0, "MANY");  
   } else {
-    gMC->Gspos("ACORDE1",1,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",1,"ALIC",
               constants->OldModulePositionX(0),
               constants->OldModulePositionY(0),
               constants->OldModulePositionZ(0),
               idrotm[232], "MANY");
-    gMC->Gspos("ACORDE1",10,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",10,"ALIC",
               constants->OldModulePositionX(9),
               constants->OldModulePositionY(9),
               constants->OldModulePositionZ(9),
               idrotm[232], "MANY");
-    gMC->Gspos("ACORDE1",51,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",51,"ALIC",
               constants->OldModulePositionX(50),
               constants->OldModulePositionY(50),
               constants->OldModulePositionZ(50),
               idrotm[231], "MANY");
-    gMC->Gspos("ACORDE1",60,"ALIC",
+    TVirtualMC::GetMC()->Gspos("ACORDE1",60,"ALIC",
               constants->OldModulePositionX(59),
               constants->OldModulePositionY(59),
               constants->OldModulePositionZ(59),
@@ -655,7 +655,7 @@ void AliACORDEv0::StepManager()
   static Float_t eloss;
   static Float_t step;
   // scintillator volume
-  static Int_t idScint = gMC->VolId("ACORDE2");
+  static Int_t idScint = TVirtualMC::GetMC()->VolId("ACORDE2");
 
   // local variables
   Int_t copy;
@@ -663,19 +663,19 @@ void AliACORDEv0::StepManager()
   TLorentzVector mom;
 
   // only charged tracks
-  if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
+  if ( !TVirtualMC::GetMC()->TrackCharge() || !TVirtualMC::GetMC()->IsTrackAlive() ) return;
 
   // only in sensitive material
-  if (gMC->CurrentVolID(copy) == idScint) {
-    step  += gMC->TrackStep();
-    eloss += gMC->Edep();
+  if (TVirtualMC::GetMC()->CurrentVolID(copy) == idScint) {
+    step  += TVirtualMC::GetMC()->TrackStep();
+    eloss += TVirtualMC::GetMC()->Edep();
     // set all hit variables except eloss which is resetted
     // set volume variables
-    if (gMC->IsTrackEntering()) {
+    if (TVirtualMC::GetMC()->IsTrackEntering()) {
       eloss = 0.0;
       step = 0.0;
-      gMC->TrackPosition(pos);
-      gMC->TrackMomentum(mom);
+      TVirtualMC::GetMC()->TrackPosition(pos);
+      TVirtualMC::GetMC()->TrackMomentum(mom);
       // hit
       // [0] = PID
       // [1-3] = x, y, z 
@@ -683,32 +683,32 @@ void AliACORDEv0::StepManager()
       // [5-7] = px, py, pz
       // [8] = energy 
       // [9] = energy loss
-      hits[0]  = (Float_t ) gMC->TrackPid(); 
+      hits[0]  = (Float_t ) TVirtualMC::GetMC()->TrackPid(); 
       hits[1] = pos[0]; 
       hits[2] = pos[1]; 
       hits[3] = pos[2]; 
-      hits[4] = gMC->TrackTime();
+      hits[4] = TVirtualMC::GetMC()->TrackTime();
       hits[5] = mom[0]; 
       hits[6] = mom[1]; 
       hits[7] = mom[2]; 
-      hits[8] = gMC->Etot();
+      hits[8] = TVirtualMC::GetMC()->Etot();
       // volume: 
       //  [0] = module number 1-60 (1==>(0-0), 60 (5-9)
       //  [1] = Plastic number: 0 (down) to 1 (up)
       Int_t copyPlastic; // plastic: down=1, up=2
       Int_t copyModule; // module: 1-60
-      gMC->CurrentVolID(copyPlastic);
-      gMC->CurrentVolOffID(1, copyModule);
+      TVirtualMC::GetMC()->CurrentVolID(copyPlastic);
+      TVirtualMC::GetMC()->CurrentVolOffID(1, copyModule);
       // module
       vol[0] = copyModule;
       // plastic: 0 = down, 1 = up
       vol[1] = copyPlastic;
-    } // end if gMC->IsTrackEntering()
+    } // end if TVirtualMC::GetMC()->IsTrackEntering()
 
     // set hit[9] = total energy loss and book hit
-    if( gMC->IsTrackExiting() || 
-       gMC->IsTrackStop() || 
-       gMC->IsTrackDisappeared()){
+    if( TVirtualMC::GetMC()->IsTrackExiting() || 
+       TVirtualMC::GetMC()->IsTrackStop() || 
+       TVirtualMC::GetMC()->IsTrackDisappeared()){
       hits[9] = eloss;
       hits[10] = step;
       eloss = 0.0;