]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STRUCT/AliFRAMEv2.cxx
Internal extrusions corrected.
[u/mrichter/AliRoot.git] / STRUCT / AliFRAMEv2.cxx
index e94d4d464fde66e931eae979c1ce2e6dbb08e3c4..3d0e7545cf0f30f2d80d9f4cef23c3c31645c585 100644 (file)
 
 #include <TSystem.h>
 #include <TVirtualMC.h>
-
+#include <TString.h>
+#include <TGeoManager.h>
+#include <TGeoBBox.h>
+#include <TGeoMatrix.h>
+#include <TGeoPgon.h>
+#include <TGeoCompositeShape.h>
 #include "AliFRAMEv2.h"
 #include "AliMagF.h"
 #include "AliRun.h"
 #include "AliConst.h"
 #include "AliMC.h"
+#include "AliLog.h"
+#include "AliTrackReference.h"
  
 ClassImp(AliFRAMEv2)
+
  
 //_____________________________________________________________________________
-AliFRAMEv2::AliFRAMEv2()
+AliFRAMEv2::AliFRAMEv2():
+    fHoles(0)
 {
 // Constructor
-    SetHoles(0);
 }
 
 //_____________________________________________________________________________
 AliFRAMEv2::AliFRAMEv2(const char *name, const char *title)
-  : AliFRAME(name,title)
+    : AliFRAME(name,title), 
+      fHoles(0)
 {
 // Constructor
-    SetHoles(0);
 }
 
 //___________________________________________
 void AliFRAMEv2::CreateGeometry()
 {
@@ -65,6 +72,62 @@ void AliFRAMEv2::CreateGeometry()
 //End_Html
 
   Int_t idrotm[2299];
+
+
+  AliMatrix(idrotm[2070],  90.0,   0.0,  90.0, 270.0,   0.0,   0.0);  
+//
+  AliMatrix(idrotm[2083], 170.0,   0.0,  90.0,  90.0,  80.0,   0.0);
+  AliMatrix(idrotm[2084], 170.0, 180.0,  90.0,  90.0,  80.0, 180.0);
+  AliMatrix(idrotm[2085],  90.0, 180.0,  90.0,  90.0,   0.0,   0.0);
+//  
+  AliMatrix(idrotm[2086],  90.0,   0.0, 90.0,   90.,   0.0,   0.0);
+  AliMatrix(idrotm[2087],  90.0, 180.0, 90.0,  270.,   0.0,   0.0);
+  AliMatrix(idrotm[2088],  90.0,  90.0, 90.0,  180.,   0.0,   0.0);
+  AliMatrix(idrotm[2089],  90.0,  90.0, 90.0,    0.,   0.0,   0.0);
+//
+  AliMatrix(idrotm[2090],  90.0,   0.0,   0.0,    0.,   90.0, 90.0);
+  AliMatrix(idrotm[2091],   0.0,   0.0,  90.0,   90.,   90.0,  0.0);
+//
+// Matrices have been imported from Euclid. Some simplification
+// seems possible
+//
+
+  AliMatrix(idrotm[2003],   0.0, 0.0, 90.0, 130.0, 90.0,  40.0);
+  AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0,  40.0);
+  AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
+  AliMatrix(idrotm[2006],   0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
+  AliMatrix(idrotm[2007],   0.0, 0.0, 90.0, 170.0, 90.0,  80.0);
+  AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
+  AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0,  80.0);
+  AliMatrix(idrotm[2010],   0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
+  AliMatrix(idrotm[2011],   0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
+  AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
+  AliMatrix(idrotm[2013], 180.0, 0.0, 90.0,  10.0, 90.0, 100.0);
+  AliMatrix(idrotm[2014],   0.0, 0.0, 90.0,  10.0, 90.0, 100.0);
+  AliMatrix(idrotm[2015],   0.0, 0.0, 90.0,  30.0, 90.0, 300.0);
+  AliMatrix(idrotm[2016], 180.0, 0.0, 90.0,  30.0, 90.0, 300.0);
+  AliMatrix(idrotm[2017], 180.0, 0.0, 90.0,  50.0, 90.0, 140.0);
+  AliMatrix(idrotm[2018],   0.0, 0.0, 90.0,  50.0, 90.0, 140.0);
+
+  AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
+  AliMatrix(idrotm[2020], 180.0, 0.0, 90.0,  50.0, 90.0, 320.0);
+  AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0,  60.0);
+  AliMatrix(idrotm[2022], 180.0, 0.0, 90.0,  30.0, 90.0, 120.0);
+  AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
+  AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
+  AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0,  80.0);
+  AliMatrix(idrotm[2026], 180.0, 0.0, 90.0,  10.0, 90.0, 280.0);
+  
+  AliMatrix(idrotm[2027],   0.0, 0.0, 90.0,  50.0, 90.0, 320.0);
+  AliMatrix(idrotm[2028],   0.0, 0.0, 90.0, 150.0, 90.0,  60.0); 
+  AliMatrix(idrotm[2029],   0.0, 0.0, 90.0,  30.0, 90.0, 120.0);
+  AliMatrix(idrotm[2030],   0.0, 0.0, 90.0,  10.0, 90.0, 280.0);
+  AliMatrix(idrotm[2031],   0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
+  AliMatrix(idrotm[2032],   0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
+  AliMatrix(idrotm[2033],   0.0, 0.0, 90.0, 350.0, 90.0,  80.0);
+
+
   Int_t *idtmed = fIdtmed->GetArray()-1999;
 //
 // The Space frame
@@ -74,65 +137,59 @@ void AliFRAMEv2::CreateGeometry()
   
   Float_t dx, dy, dz;
   Int_t i, j, jmod;
+  jmod = 0;
 //
 // Constants 
   const Float_t kEps   = 0.01;
-  const Int_t kAir   = idtmed[2004];
-  const Int_t kSteel = idtmed[2064];
+  const Int_t   kAir   = idtmed[2004];
+  const Int_t   kSteel = idtmed[2064];
   
-  const Float_t krad2deg = 180./TMath::Pi();
-  const Float_t kdeg2rad = 1./krad2deg;
-
-  Float_t iFrH   = 114.40;
-  Float_t ringH  =   4.00;
-  Float_t ringW  =  10.00;
-  Float_t longH  =   5.39;
-  Float_t longW  =   6.00;  
-  Float_t dwl    =   3.14;
-  Float_t dwh    =   0.96;
-
+  const Float_t krad2deg = 180. / TMath::Pi();
+  const Float_t kdeg2rad = 1. / krad2deg;
+
+  Float_t iFrH   = 118.66;  // Height of inner frame 
+  Float_t ringH  =   6.00;  // Height of the ring bars 
+  Float_t ringW  =  10.00;  // Width  of the ring bars in z
+  Float_t longH  =   6.00; 
+  Float_t longW  =   4.00; 
 // 
-  Float_t dymodU[3] = {70.0, 224.0, 341.};
-//  new ?
-  Float_t dymodL[3] = {54.0, 178.5, 341.};
-
+  Float_t dymodU[3] = {70.0, 224.0, 340.2};
+  Float_t dymodL[3] = {50.0, 175.0, 297.5};
+  //
+  
 //
 // Frame mother volume
 //
-//  ptube[0] = 280.;
-//  ptube[1] = 430.;
-//  ptube[2] = 376.;
-  ppgon[0] =   0.;
-  ppgon[1] = 360.;
-  ppgon[2] =  18.;
-  
-  ppgon[3] =   2.;
-  ppgon[4] = -376.;
-  ppgon[5] =  280.;
-  ppgon[6] =  421.;
-  
-  ppgon[7] =  -ppgon[4]; 
-  ppgon[8] =   ppgon[5];
-  ppgon[9] =   ppgon[6];
-
-  gMC->Gsvolu("B077", "PGON", kAir, ppgon, 10);
-
-//  gMC->Gsvolu("B077", "TUBE", kAir, ptube, 3);
+  TGeoPgon* shB77A = new TGeoPgon(0., 360., 18, 2);
+  shB77A->SetName("shB77A");
+  shB77A->DefineSection( 0, -376., 280., 415.7);
+  shB77A->DefineSection( 1,  376., 280., 415.7);
+  TGeoBBox* shB77B = new TGeoBBox(3.42, 2., 375.5);
+  shB77B->SetName("shB77B");
+  TGeoTranslation* trB77A = new TGeoTranslation("trB77A", +283.42, 0., 0.);
+  TGeoTranslation* trB77B = new TGeoTranslation("trB77B", -283.42, 0., 0.);
+  trB77A->RegisterYourself();
+  trB77B->RegisterYourself();
+  TGeoCompositeShape* shB77 = new TGeoCompositeShape("shB77", "shB77A+shB77B:trB77A+shB77B:trB77B");
+  TGeoVolume* voB77 = new TGeoVolume("B077", shB77, gGeoManager->GetMedium("FRAME_Air"));
   gMC->Gspos("B077", 1, "ALIC", 0., 0., 0., 0, "ONLY");
 //
-// Reference plane for TRD
-//
-  ppgon[6] = ppgon[5] + 0.1;
-  ppgon[9] = ppgon[6];
-  gMC->Gsvolu("BREF", "PGON", kAir, ppgon, 10);
-  gMC->Gspos("BREF", 1, "B077", 0., 0., 0., 0, "ONLY");
+// Reference plane #1 for TRD
+  TGeoPgon* shBREFA = new TGeoPgon(0.0, 360., 18, 2);
+  shBREFA->DefineSection( 0, -376., 280., 280.1);
+  shBREFA->DefineSection( 1,  376., 280., 280.1);
+  shBREFA->SetName("shBREFA");
+  TGeoCompositeShape* shBREF1 = new TGeoCompositeShape("shBREF1", "shBREFA-(shB77B:trB77A+shB77B:trB77B)");
+  TGeoVolume* voBREF = new TGeoVolume("BREF1", shBREF1, gGeoManager->GetMedium("FRAME_Air"));
+  voBREF->SetVisibility(0);
+  gMC->Gspos("BREF1", 1, "B077", 0., 0., 0., 0, "ONLY");
 //
 //  The outer Frame
 //
 
-  Float_t dol = 8.75;
-  Float_t doh = 5.;
-  Float_t ds  = 0.35;
+  Float_t dol = 4.;
+  Float_t doh = 4.;
+  Float_t ds  = 0.63;
 //
 // Mother volume
 //
@@ -143,9 +200,9 @@ void AliFRAMEv2::CreateGeometry()
   ppgon[3] =   2.;
 
   ppgon[4] = -350.;
-  ppgon[5] =  399.;
-  ppgon[6] =  420.7122;
-  
+  ppgon[5] =  401.35;
+  ppgon[6] =  415.6;
+
   ppgon[7] =  -ppgon[4]; 
   ppgon[8] =   ppgon[5];
   ppgon[9] =   ppgon[6];
@@ -154,47 +211,73 @@ void AliFRAMEv2::CreateGeometry()
 //  
 // Rings    
 //
-  dz = 2.*410.2*TMath::Sin(10.*kdeg2rad)-2.*dol*TMath::Cos(10.*kdeg2rad)-
-       2.*doh*TMath::Tan(10.*kdeg2rad);
+  dz = 2. * 410.2 * TMath::Sin(10.*kdeg2rad) - 2. *dol * TMath::Cos(10.*kdeg2rad)- 2. * doh * TMath::Tan(10.*kdeg2rad);
   Float_t l1 = dz/2.;
   Float_t l2 = dz/2.+2.*doh*TMath::Tan(10.*kdeg2rad);
 
-  ptrd1[0] =  l1;
-  ptrd1[1] =  l2;
-  
-  ptrd1[2] =  dol;
-  ptrd1[3] =  doh;  
-  gMC->Gsvolu("B042", "TRD1", kSteel, ptrd1, 4);
 
-  ptrd1[0] =  ptrd1[0]+ds*(l2-l1)/2./doh;
-  ptrd1[1] =  ptrd1[1]-ds*(l2-l1)/2./doh;
-  ptrd1[2] =  dol-ds;
-  ptrd1[3] =  doh-ds;  
-  gMC->Gsvolu("B043", "TRD1", kAir, ptrd1, 4);
-  gMC->Gspos("B043", 1, "B042", 0., 0., 0., 0, "ONLY");
+  TGeoVolumeAssembly* asBI42 = new TGeoVolumeAssembly("BI42");
+ // Horizontal
+  ptrd1[0] =  l2 - 0.6 * TMath::Tan(10.*kdeg2rad);
+  ptrd1[1] =  l2;
+  ptrd1[2] =  8.0 / 2.;
+  ptrd1[3] =  0.6 / 2.;
+  gMC->Gsvolu("BIH142", "TRD1", kSteel, ptrd1, 4);
+  ptrd1[0] =  l1;
+  ptrd1[1] =  l1 + 0.6 * TMath::Tan(10.*kdeg2rad);
+  ptrd1[2] =  8.0 / 2.;
+  ptrd1[3] =  0.6 / 2.;
+  gMC->Gsvolu("BIH242", "TRD1", kSteel, ptrd1, 4);
+
+  // Vertical 
+  ptrd1[0] =  l1 + 0.6 * TMath::Tan(10.*kdeg2rad);
+  ptrd1[1] =  l2 - 0.6 * TMath::Tan(10.*kdeg2rad);
+  ptrd1[2] =  0.8 / 2.;
+  ptrd1[3] =  6.8 / 2.;
+  gMC->Gsvolu("BIV42", "TRD1", kSteel, ptrd1, 4);
+  // Place 
+  asBI42->AddNode(gGeoManager->GetVolume("BIV42"),  1, new TGeoTranslation(0., 0., 0.));
+  asBI42->AddNode(gGeoManager->GetVolume("BIH142"), 1, new TGeoTranslation(0., 0.,  3.7));
+  asBI42->AddNode(gGeoManager->GetVolume("BIH242"), 1, new TGeoTranslation(0., 0., -3.7));
 //
 // longitudinal bars
 //
-// 170x200x5
+// 80 x 80 x 6.3
 //
   pbox[0] = dol;
   pbox[1] = doh;
-  pbox[2] = 350.;
+  pbox[2] = 345.;
   gMC->Gsvolu("B033", "BOX", kSteel, pbox, 3);
   pbox[0] = dol-ds;
   pbox[1] = doh-ds;
   gMC->Gsvolu("B034", "BOX", kAir, pbox, 3);
   gMC->Gspos("B034", 1, "B033", 0., 0., 0., 0, "ONLY");
 
-  pbox[0] =   1.0;
-  pbox[1] =   5.0;
-  pbox[2] = 375.5;
-  
 
+  //
+  // TPC support
+  //
+  pbox[0] =   3.37;
+  pbox[1] =   2.0;
+  pbox[2] = 375.5;
   gMC->Gsvolu("B080", "BOX", kSteel, pbox, 3);
-  gMC->Gspos("B080", 1, "B077",  286.01, 0., 0., 0, "ONLY");
-  gMC->Gspos("B080", 2, "B077", -286.01, 0., 0., 0, "ONLY");
+  pbox[0] =   2.78;
+  pbox[1] =   1.4;
+  pbox[2] = 375.5;
+  gMC->Gsvolu("B081", "BOX", kAir, pbox, 3);
+  gMC->Gspos("B081", 1, "B080",  0., 0., 0., 0, "ONLY");
+
+  // Small 2nd reference plane elemenet 
+   pbox[0] =   0.05;
+   pbox[1] =   2.0;
+   pbox[2] = 375.5;
+   gMC->Gsvolu("BREF2", "BOX", kAir, pbox, 3);
+   gMC->Gspos("BREF2", 1, "B080",  3.37 - 0.05, 0., 0., 0, "ONLY");
+
+  gMC->Gspos("B080", 1, "B077",  283.4, 0., 0., 0, "ONLY");
+  gMC->Gspos("B080", 2, "B077", -283.4, 0., 0., idrotm[2087], "ONLY");
 
+   
 //
 // Diagonal bars (1) 
 //
@@ -316,7 +399,7 @@ void AliFRAMEv2::CreateGeometry()
 
   Float_t ddx, ddz, drx, drz, rtheta;
 
-  AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0);
+  AliMatrix(idrotm[2001], -theta+180, 0.0, 90.0, 90.0, 90.-theta, 0.0); 
   rtheta = (90.-theta)*kdeg2rad;
   ddx = -ddx0-dol*TMath::Tan(theta2);
   ddz = -dol;
@@ -365,45 +448,8 @@ void AliFRAMEv2::CreateGeometry()
 
 //
 // Positioning of diagonal bars
-//
-// Matrices have been imported from Euclid. Some simplification
-// seems possible
-//
-  AliMatrix(idrotm[2003],   0.0, 0.0, 90.0, 130.0, 90.0,  40.0);
-  AliMatrix(idrotm[2004], 180.0, 0.0, 90.0, 130.0, 90.0,  40.0);
-  AliMatrix(idrotm[2005], 180.0, 0.0, 90.0, 150.0, 90.0, 240.0);
-  AliMatrix(idrotm[2006],   0.0, 0.0, 90.0, 150.0, 90.0, 240.0);
-  AliMatrix(idrotm[2007],   0.0, 0.0, 90.0, 170.0, 90.0,  80.0);
-  AliMatrix(idrotm[2008], 180.0, 0.0, 90.0, 190.0, 90.0, 280.0);
-  AliMatrix(idrotm[2009], 180.0, 0.0, 90.0, 170.0, 90.0,  80.0);
-  AliMatrix(idrotm[2010],   0.0, 0.0, 90.0, 190.0, 90.0, 280.0);
-  AliMatrix(idrotm[2011],   0.0, 0.0, 90.0, 350.0, 90.0, 260.0);
-  AliMatrix(idrotm[2012], 180.0, 0.0, 90.0, 350.0, 90.0, 260.0);
-  AliMatrix(idrotm[2013], 180.0, 0.0, 90.0,  10.0, 90.0, 100.0);
-  AliMatrix(idrotm[2014],   0.0, 0.0, 90.0,  10.0, 90.0, 100.0);
-  AliMatrix(idrotm[2015],   0.0, 0.0, 90.0,  30.0, 90.0, 300.0);
-  AliMatrix(idrotm[2016], 180.0, 0.0, 90.0,  30.0, 90.0, 300.0);
-  AliMatrix(idrotm[2017], 180.0, 0.0, 90.0,  50.0, 90.0, 140.0);
-  AliMatrix(idrotm[2018],   0.0, 0.0, 90.0,  50.0, 90.0, 140.0);
-
-  AliMatrix(idrotm[2019], 180.0, 0.0, 90.0, 130.0, 90.0, 220.0);
-  AliMatrix(idrotm[2020], 180.0, 0.0, 90.0, 50.0, 90.0, 320.0);
-  AliMatrix(idrotm[2021], 180.0, 0.0, 90.0, 150.0, 90.0, 60.0);
-  AliMatrix(idrotm[2022], 180.0, 0.0, 90.0, 30.0, 90.0, 120.0);
-  AliMatrix(idrotm[2023], 180.0, 0.0, 90.0, 170.0, 90.0, 260.0);
-  AliMatrix(idrotm[2024], 180.0, 0.0, 90.0, 190.0, 90.0, 100.0);
-  AliMatrix(idrotm[2025], 180.0, 0.0, 90.0, 350.0, 90.0, 80.0);
-  AliMatrix(idrotm[2026], 180.0, 0.0, 90.0, 10.0, 90.0, 280.0);
-  
-  AliMatrix(idrotm[2027], 0.0, 0.0, 90.0, 50.0, 90.0, 320.0);
-  AliMatrix(idrotm[2028], 0.0, 0.0, 90.0, 150.0, 90.0, 60.0); 
-  AliMatrix(idrotm[2029], 0.0, 0.0, 90.0, 30.0, 90.0, 120.0);
-  AliMatrix(idrotm[2030], 0.0, 0.0, 90.0, 10.0, 90.0, 280.0);
-  AliMatrix(idrotm[2031], 0.0, 0.0, 90.0, 170.0, 90.0, 260.0);
-  AliMatrix(idrotm[2032], 0.0, 0.0, 90.0, 190.0, 90.0, 100.0);
-  AliMatrix(idrotm[2033], 0.0, 0.0, 90.0, 350.0, 90.0, 80.0);
   
-  Float_t rd =  410.56;
+  Float_t rd =  405.5;
   dz = (dymodU[1]+dymodU[0])/2.;
   Float_t dz2 =  (dymodU[1]+dymodU[2])/2.;
 
@@ -460,315 +506,209 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gspos("BM49", 7, "B076",  dx, -dy,  0., idrotm[2025], "ONLY");
   gMC->Gspos("BM49", 8, "B076", -dx, -dy,  0., idrotm[2024], "ONLY");
 
-
+//
 // The internal frame
 //
-  char*  module[3] = {"B071\0", "B074\0", "B075\0"};
 //
 //
 //  Mother Volumes
 //
-  ptrd1[0] = 50.18;
-  ptrd1[1] = 70.35;
-//  ptrd1[0] = 50.10;
-//  ptrd1[1] = 70.20;
 
-  ptrd1[2] = 375.5;
-  ptrd1[3] =  57.2;  
-  for (jmod = 0; jmod < 3; jmod++)
-  {
-      gMC->Gsvolu(module[jmod], "TRD1", kAir, ptrd1, 4);
-  }
-// Position of Holes for PHOS (P) and RICH (R) starting at 6h
-//                 P  P  P  -  -  R  R  R  -  -  -  -  -  -  -  -  P  P
-  Int_t mod[18] = {1, 1, 1, 0, 0, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1};
+  ptrd1[0] =  49.8;
+  ptrd1[1] =  70.7;
+  ptrd1[2] = 376.0;    
+  ptrd1[3] =  iFrH / 2.;  
   
+  Float_t r      = 342.0;
+  Float_t rout1  = 405.5;
+  Float_t rout2  = 411.55;
+  TString module[18];
   
-  Float_t r      = 341.8;
-  Float_t rout1  = 410.564;
-  Float_t rout2  = 415.2;
-  Int_t modcount[3] = {0, 0, 0};
-  
-  for (i=0; i<18; i++) {
-      Float_t phi = i*20.;
-      Float_t phi2 = 270+phi;
-      if (phi2 >= 360.) phi2-=360.;
+  for (i = 0; i < 18; i++) {
+
+      // Create volume i 
+      char name[16];
+      Int_t mod = i + 13;
+      if (mod > 17) mod -= 18;
+      sprintf(name, "BSEGMO%d", mod);
+      gMC->Gsvolu(name, "TRD1", kAir, ptrd1, 4);
+      gGeoManager->GetVolume(name)->SetVisibility(kFALSE);
+
+      module[i] = name;
+      // Place volume i
+      Float_t phi1  = i * 20.;
+      Float_t phi2 = 270 + phi1;
+      if (phi2 >= 360.) phi2 -= 360.;
       
-      dx =  TMath::Sin(phi*kdeg2rad)*r;
-      dy = -TMath::Cos(phi*kdeg2rad)*r;
-      modcount[mod[i]]++;
+      dx =  TMath::Sin(phi1*kdeg2rad)*r;
+      dy = -TMath::Cos(phi1*kdeg2rad)*r;
       
-      AliMatrix(idrotm[2034+i],  90.0, phi, 0., 0., 90., phi2);  
-      gMC->Gspos(module[mod[i]], modcount[mod[i]], "B077", dx, dy, 0., idrotm[2034+i], "ONLY");
+      char nameR[64];
+      sprintf(nameR, "B43_Rot_%d", i);
+      TGeoRotation* rot = new TGeoRotation(nameR,  90.0, phi1, 0., 0., 90., phi2);  
+      AliMatrix(idrotm[2034+i],  90.0, phi1, 0., 0., 90., phi2);  
+      TGeoVolume* vol77 = gGeoManager->GetVolume("B077");
+      TGeoVolume* volS  = gGeoManager->GetVolume(name);
+      vol77->AddNode(volS, 1,  new TGeoCombiTrans(dx, dy, 0., rot));
+
 //
 //    Position elements of outer Frame
 //
-      dx =  TMath::Sin(phi*kdeg2rad)*rout1;
-      dy = -TMath::Cos(phi*kdeg2rad)*rout1;
+      dx =  TMath::Sin(phi1*kdeg2rad)*rout1;
+      dy = -TMath::Cos(phi1*kdeg2rad)*rout1;
       for (j = 0; j < 3; j++)
       {
          dz = dymodU[j];
-         gMC->Gspos("B042", 6*i+2*j+1, "B076", dx, dy,  dz, idrotm[2034+i], "ONLY");     
-         gMC->Gspos("B042", 6*i+2*j+2, "B076", dx, dy, -dz, idrotm[2034+i], "ONLY");     
+         TGeoVolume* vol = gGeoManager->GetVolume("B076");
+         vol->AddNode(asBI42, 6*i+2*j+1, new TGeoCombiTrans(dx, dy,  dz, rot));
+         vol->AddNode(asBI42, 6*i+2*j+2, new TGeoCombiTrans(dx, dy, -dz, rot));
       }
 
-      phi = i*20.+10;
-      phi2 = 270+phi;
-      AliMatrix(idrotm[2052+i],  90.0, phi, 90., phi2, 0., 0.);  
+      phi1 = i*20.+10;
+      phi2 = 270+phi1;
+      AliMatrix(idrotm[2052+i],  90.0, phi1, 90., phi2, 0., 0.);  
 
-      dx =  TMath::Sin(phi*kdeg2rad)*rout2;
-      dy = -TMath::Cos(phi*kdeg2rad)*rout2;
+      dx =  TMath::Sin(phi1*kdeg2rad)*rout2;
+      dy = -TMath::Cos(phi1*kdeg2rad)*rout2;
       gMC->Gspos("B033", i+1, "B076", dx, dy,  0., idrotm[2052+i], "ONLY");      
 //
   }
 // Internal Frame rings
 //
 //
-// new specs: 40x100x6 for inner rings
-//            30x135x6 for front and rear rings
-//
-// currently no distinction between front/rear and inner rings
-// 
-//
+//            60x60x5x6  for inner rings (I-beam)
+//           100x60x5    for front and rear rings
 //
-  pbox[0] = 50.;
-  pbox[1] =  ringW/2.;
-  pbox[2] =  ringH/2.;
+// Front and rear 
+  ptrd1[0] =  287. * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[1] =  293. * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[2] =  ringW/2.;
+  ptrd1[3] =  ringH/2.;  
   
-  gMC->Gsvolu("B072", "BOX ", kSteel, pbox, 3);
+  gMC->Gsvolu("B072", "TRD1", kSteel, ptrd1, 4);
 
-  pbox[1] =  pbox[1] - 0.6;
-  pbox[2] =  pbox[2] - 0.6;  
-  gMC->Gsvolu("B073", "BOX ", kAir, pbox, 3);
+  ptrd1[0] =  287.5 * TMath::Sin(10. * kdeg2rad) - 2.1;
+  ptrd1[1] =  292.5 * TMath::Sin(10. * kdeg2rad) - 2.1;
+  ptrd1[2] =  ringW / 2. - 0.5;
+  ptrd1[3] =  ringH / 2. - 0.5;  
+
+  gMC->Gsvolu("B073", "TRD1", kAir, ptrd1, 4);
   gMC->Gspos("B073", 1, "B072", 0., 0., 0., 0, "ONLY");
+//
+// I-Beam
+// Mother volume
+  TGeoVolumeAssembly* asBI72 = new TGeoVolumeAssembly("BI72");
+ // Horizontal
+  ptrd1[0] =  292.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[1] =  293.0 * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[2] =  6./2.;
+  ptrd1[3] =  0.5/2.;
+  gMC->Gsvolu("BIH172", "TRD1", kSteel, ptrd1, 4);
+  ptrd1[0] =  287.0 * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[1] =  287.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[2] =  6./2.;
+  ptrd1[3] =  0.5/2.;
+  gMC->Gsvolu("BIH272", "TRD1", kSteel, ptrd1, 4);
+
+  // Vertical 
+  ptrd1[0] =  287.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[1] =  292.5 * TMath::Sin(10.* kdeg2rad) - 2.1;
+  ptrd1[2] =  0.6/2.;
+  ptrd1[3] =  5./2.;
+  gMC->Gsvolu("BIV72", "TRD1", kSteel, ptrd1, 4);
+  // Place 
+  asBI72->AddNode(gGeoManager->GetVolume("BIV72"), 1,  new TGeoTranslation(0., 0., 0.));
+  asBI72->AddNode(gGeoManager->GetVolume("BIH172"), 1, new TGeoTranslation(0., 0.,  2.75));
+  asBI72->AddNode(gGeoManager->GetVolume("BIH272"), 1, new TGeoTranslation(0., 0., -2.75));
 
 // Web frame 0-degree
 //
-// h x w x s = 60x40x4 
+// h x w x s = 60x40x5 
 // (attention: element is are half bars, "U" shaped)  
 //
-  dz  = 106.2;
-  d   = 2.*dwl;
-  h   = dymodU[0]-dymodL[0];
-  dq  = h*h+dz*dz;
-
-  x  =  TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
-  
-  theta = TMath::ACos(x);
-  Float_t thetaP = (TMath::Pi()-theta)*krad2deg;
-  
-  ptrap[0]  = dz/2.;
-  ptrap[1]  = thetaP;
-  ptrap[2]  =  0.;
-  ptrap[3]  =  dwh;
-  ptrap[4]  =  dwl/cos(theta);
-  ptrap[5]  = ptrap[4];
-  ptrap[6]  = 0;
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  ptrap[10] = 0;
-  gMC->Gsvolu("B063", "TRAP", kSteel, ptrap, 11);
-  ptrap[3]  =  dwh - 0.2;
-  ptrap[4]  =  (dwl-0.4)/cos(theta);
-  ptrap[5]  = ptrap[4];
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  gMC->Gsvolu("B064", "TRAP", kAir, ptrap, 11);
-  gMC->Gspos("B064", 1, "B063", 0.0, -0.2, 0., 0, "ONLY");
-
-
-  h  = 106.2;
-  d  = 2.*dwl;
-  dz = dymodU[1]-dymodL[1];
-  dq = h*h+dz*dz;
-
-  x  =  TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
-  
-
-  theta = krad2deg * TMath::ACos(x);
-  
-  ptrap[0]  = dz/2.;
-  ptrap[1]  = theta;
-  ptrap[2]  =  0.;
-  ptrap[3]  =  dwh;
-  ptrap[4]  =  dwl/x;
-  ptrap[5]  = ptrap[4];
-  ptrap[6]  = 0;
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  ptrap[10] = 0;
-  gMC->Gsvolu("B163", "TRAP", kSteel, ptrap, 11);
-  ptrap[3]  =  dwh - 0.2;
-  ptrap[4]  =  (dwl-0.4)/x;
-  ptrap[5]  = ptrap[4];
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  gMC->Gsvolu("B164", "TRAP", kAir, ptrap, 11);
-  gMC->Gspos("B164", 1, "B163", 0.0, -0.2, 0., 0, "ONLY");
-  pbox[0] = dwh;
-  pbox[1] = dwl;
-  pbox[2] = (iFrH-ringH-longH)/2.;
-  gMC->Gsvolu("B263", "BOX ", kSteel, pbox, 3);
-  pbox[0] = dwh-0.2;
-  pbox[1] = dwl-0.4;
-  
-  gMC->Gsvolu("B264", "BOX ", kAir, pbox, 3);
-  gMC->Gspos("B264", 1, "B263", 0.2, 0., 0., 0, "ONLY");
-
+  Float_t dHz    = 112.66;
   
-  AliMatrix(idrotm[2070],  90.0,   0.0,  90.0, 270.0,   0.0,   0.0);  
-//
-  AliMatrix(idrotm[2071], 100.0,   0.0,  90.0, 270.0,  10.0,   0.0);
-  AliMatrix(idrotm[2072], 100.0,   0.0,  90.0,  90.0,  10.0,   0.0);
-  AliMatrix(idrotm[2073], 100.0, 180.0,  90.0, 270.0,  10.0, 180.0);
-  AliMatrix(idrotm[2074], 100.0, 180.0,  90.0,  90.0,  10.0,  180.0);
-//
-  AliMatrix(idrotm[2075],  10.0,   0.0,  80.0, 180.0,  90.0,  90.0);
-  AliMatrix(idrotm[2076],  10.0,   0.0,  80.0, 180.0,  90.0, 270.0);
-  AliMatrix(idrotm[2077],  10.0, 180.0,  80.0,   0.0,  90.0,  90.0);
-  AliMatrix(idrotm[2078],  10.0, 180.0,  80.0,   0.0,  90.0, 270.0);
-//
-  AliMatrix(idrotm[2079], 170.0, 180.0,  80.0, 180.0,  90.0,  90.0);
-  AliMatrix(idrotm[2080], 170.0, 180.0,  80.0, 180.0,  90.0, 270.0);
-  AliMatrix(idrotm[2081], 170.0,   0.0,  80.0,   0.0,  90.0,  90.0);
-  AliMatrix(idrotm[2082], 170.0,   0.0,  80.0,   0.0,  90.0, 270.0);
+  WebFrame("B063",  dHz, 10.0,  10.);
+  WebFrame("B063I", dHz, 10.0, -10.);
 
-//
-  AliMatrix(idrotm[2083], 170.0,   0.0,  90.0,  90.0,  80.0,   0.0);
-  AliMatrix(idrotm[2084], 170.0, 180.0,  90.0,  90.0,  80.0, 180.0);
-  AliMatrix(idrotm[2085],  90.0, 180.0,  90.0,  90.0,   0.0,   0.0);
-//
-  AliMatrix(idrotm[2086],  90.0,  90.0, 100.0,    0.,  170.0,  180.0);
-  AliMatrix(idrotm[2087],  90.0,  90.0, 100.0,    0.,   10.0,    0.0);
-  AliMatrix(idrotm[2088],  90.0,  90.0,  80.0,    0.,  170.0,    0.0);
-  AliMatrix(idrotm[2089],  90.0,  90.0,  80.0,    0.,  -10.0,    0.0);
+  WebFrame("B163",  dHz,  -40.0,  10.);
+  WebFrame("B163I", dHz,  -40.0, -10.);
 
-//
-// web frame diagonal (outer)
-//  
-  h  = 106.2;
-  d  = 2.*dwl;
-  dz = dymodL[2]-dymodU[1]-dwl;
-  dq = h*h+dz*dz;
-
-  x  =  TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
-  
-
-  theta = krad2deg * TMath::ACos(x);
-  
-  ptrap[0]  = dz/2.;
-  ptrap[1]  = theta;
-  ptrap[2]  =  0.;
-  ptrap[3]  =  dwh;
-  ptrap[4]  =  dwl/x;
-  ptrap[5]  = ptrap[4];
-  ptrap[6]  = 0;
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  ptrap[10] = 0;
-  gMC->Gsvolu("B065", "TRAP", kSteel, ptrap, 11);
-  ptrap[3]  =  dwh - 0.2;
-  ptrap[4]  =  (dwl-0.4)/x;
-  ptrap[5]  = ptrap[4];
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  gMC->Gsvolu("B066", "TRAP", kAir, ptrap, 11);
-  gMC->Gspos("B066", 1, "B065", 0.0, -0.2, 0., 0, "ONLY");
+  WebFrame("B263",  dHz,  20.0,  10.);
+  WebFrame("B263I", dHz,  20.0, -10.);
 
-//
-// web frame diagonal (inner)
-//
-  dz = dymodL[1]-dymodU[0];
-  dq = h*h+dz*dz;
-  x  =  TMath::Sqrt((dz*dz-d*d)/dq + d*d*h*h/dq/dq)+d*h/dq;
-  
+  WebFrame("B363",  dHz,  -27.1,  10.);
+  WebFrame("B363I", dHz,  -27.1, -10.);
 
-  theta = krad2deg * TMath::ACos(x);
-  
-  ptrap[0]  = (dymodL[1]-dymodU[0])/2.;
-  ptrap[1]  = theta;
-  ptrap[2]  =  0.;
-  ptrap[3]  =  dwh;
-  ptrap[4]  =  dwl/x;
-  ptrap[5]  = ptrap[4];
-  ptrap[6]  = 0;
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  ptrap[10] = 0;
-  gMC->Gsvolu("B067", "TRAP", kSteel, ptrap, 11);
-  ptrap[3]  =  dwh-0.2;
-  ptrap[4]  =  (dwl-0.4)/x;
-  ptrap[5]  = ptrap[4];
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  gMC->Gsvolu("B068", "TRAP", kAir, ptrap, 11);
-  gMC->Gspos("B068", 1, "B067", 0.0, -0.2, 0., 0, "ONLY");
+  WebFrame("B463",  dHz, 18.4,  10.);
+  WebFrame("B463I", dHz, 18.4, -10.);
 
 
   dz = -iFrH/2.+ringH/2.+kEps;
+  Float_t dz0 = 3.;  
+  Float_t dx0 = 49.8 + dHz/2. * TMath::Tan(10. * kdeg2rad) + 0.035;
   
-  for (i = 0; i< 3; i++)
+  for (jmod = 0; jmod< 18; jmod++)
   {
 // ring bars
-      for (jmod = 0; jmod<3; jmod++) {
-         gMC->Gspos("B072", 6*i+jmod+1, module[jmod], 0,  dymodL[i], dz, 0, "ONLY");
-         gMC->Gspos("B072", 6*i+jmod+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");      
-
-// 0-deg web
-         if (i==2) {
-             gMC->Gspos("B263", 12*i+jmod+1,  module[jmod],  60.0732,  dymodU[i], 4.6669, idrotm[2072], "ONLY");
-             gMC->Gspos("B263", 12*i+jmod+4,  module[jmod],  60.0732, -dymodU[i], 4.6669, idrotm[2071], "ONLY");      
-             gMC->Gspos("B263", 12*i+jmod+7,  module[jmod], -60.0732,  dymodU[i], 4.6669, idrotm[2074], "ONLY");
-             gMC->Gspos("B263", 12*i+jmod+10, module[jmod], -60.0732, -dymodU[i], 4.6669, idrotm[2073], "ONLY");      
-         }
+      for (i = 0; i < 3; i++) {
+       //      if ((i == 2) || (jmod ==0) || (jmod == 8)) { 
+       if (i == 2) { 
+         gMC->Gspos("B072", 6*jmod+i+1, module[jmod], 0,  dymodL[i], dz, 0, "ONLY");
+         gMC->Gspos("B072", 6*jmod+i+4, module[jmod], 0, -dymodL[i], dz, idrotm[2070], "ONLY");      
+       } else {
+         TGeoVolume* vol = gGeoManager->GetVolume(module[jmod]);
+         vol->AddNode(asBI72, 6*jmod+i+1, new TGeoTranslation(0,   dymodL[i], dz));
+         vol->AddNode(asBI72, 6*jmod+i+4, new TGeoTranslation(0,  -dymodL[i], dz));
+       }
       }
   }
   
 // outer diagonal web
 
-  dy = (dymodU[0]+dymodL[0])/2.;
-  for (jmod = 0; jmod<3; jmod++) {
-      gMC->Gspos("B063", 4*jmod+1, module[jmod],  60.0732,   dy, 4.6669, idrotm[2086], "ONLY");
-      gMC->Gspos("B063", 4*jmod+2, module[jmod],  60.0732,  -dy, 4.6669, idrotm[2087], "ONLY");
-      gMC->Gspos("B063", 4*jmod+3, module[jmod], -60.0732,   dy, 4.6669, idrotm[2088], "ONLY");
-      gMC->Gspos("B063", 4*jmod+4, module[jmod], -60.0732,  -dy, 4.6669, idrotm[2089], "ONLY");
+  dy = dymodL[0] + (dHz/2. - 4.) * TMath::Tan(10. * kdeg2rad);
+  
+  for (jmod = 0; jmod < 18; jmod++) {
+      gMC->Gspos("B063",   4*jmod+1, module[jmod],  dx0,   dy, dz0, idrotm[2086], "ONLY");
+      gMC->Gspos("B063I",  4*jmod+2, module[jmod],  dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B063",   4*jmod+3, module[jmod], -dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B063I",  4*jmod+4, module[jmod], -dx0,   dy, dz0, idrotm[2086], "ONLY");
   }
 
-  dy = (dymodU[1]+dymodL[1])/2.;
-  for (jmod = 0; jmod<3; jmod++) {
-      gMC->Gspos("B163", 4*jmod+1, module[jmod],  60.0732,   dy, 4.6669, idrotm[2080], "ONLY");
-      gMC->Gspos("B163", 4*jmod+2, module[jmod],  60.0732,  -dy, 4.6669, idrotm[2079], "ONLY");
-      gMC->Gspos("B163", 4*jmod+3, module[jmod], -60.0732,   dy, 4.6669, idrotm[2082], "ONLY");
-      gMC->Gspos("B163", 4*jmod+4, module[jmod], -60.0732,  -dy, 4.6669, idrotm[2081], "ONLY");
+  dy = 73.6 + (dHz/2. + 4.)  * TMath::Tan(40. * kdeg2rad);
+
+  for (jmod = 0; jmod < 18; jmod++) {
+      gMC->Gspos("B163",  4*jmod+1, module[jmod],  dx0,   dy, dz0, idrotm[2086], "ONLY");
+      gMC->Gspos("B163I", 4*jmod+2, module[jmod],  dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B163",  4*jmod+3, module[jmod], -dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B163I", 4*jmod+4, module[jmod], -dx0,   dy, dz0, idrotm[2086], "ONLY");
   }
 
+  dy = 224.5 -  (dHz/2 + 4.) * TMath::Tan(20. * kdeg2rad);
 
-  dy = (dymodL[2]+dymodU[1])/2.-dwl/2.;
-  for (jmod = 0; jmod<3; jmod++) {
-      gMC->Gspos("B065", 4*jmod+1, module[jmod],  60.0732,   dy, 4.6669, idrotm[2076], "ONLY");
-      gMC->Gspos("B065", 4*jmod+2, module[jmod],  60.0732,  -dy, 4.6669, idrotm[2075], "ONLY");
-      gMC->Gspos("B065", 4*jmod+3, module[jmod], -60.0732,   dy, 4.6669, idrotm[2078], "ONLY");
-      gMC->Gspos("B065", 4*jmod+4, module[jmod], -60.0732,  -dy, 4.6669, idrotm[2077], "ONLY");
+    for (jmod = 0; jmod < 18; jmod++) {
+      gMC->Gspos("B263",  4*jmod+1, module[jmod],  dx0,   dy, dz0, idrotm[2086], "ONLY");
+      gMC->Gspos("B263I", 4*jmod+2, module[jmod],  dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B263",  4*jmod+3, module[jmod], -dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B263I", 4*jmod+4, module[jmod], -dx0,   dy, dz0, idrotm[2086], "ONLY");
+  }
+
+  dy = 231.4 +  (dHz/2.+ 4.) * TMath::Tan(27.1 * kdeg2rad);
+
+    for (jmod = 0; jmod < 18; jmod++) {
+      gMC->Gspos("B363",  4*jmod+1, module[jmod],  dx0,   dy, dz0, idrotm[2086], "ONLY");
+      gMC->Gspos("B363I", 4*jmod+2, module[jmod],  dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B363",  4*jmod+3, module[jmod], -dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B363I", 4*jmod+4, module[jmod], -dx0,   dy, dz0, idrotm[2086], "ONLY");
   }
-  
 
-  dy = (dymodL[1]+dymodU[0])/2.;
+  dy = 340.2 -  (dHz/2.+ 4.) * TMath::Tan(18.4 * kdeg2rad);
 
-  for (jmod = 0; jmod<3; jmod++) {
-      gMC->Gspos("B067", 4*jmod+1, module[jmod],  60.0732,   dy, 4.6669, idrotm[2076], "ONLY");
-      gMC->Gspos("B067", 4*jmod+2, module[jmod],  60.0732,  -dy, 4.6669, idrotm[2075], "ONLY");
-      gMC->Gspos("B067", 4*jmod+3, module[jmod], -60.0732,   dy, 4.6669, idrotm[2078], "ONLY");
-      gMC->Gspos("B067", 4*jmod+4, module[jmod], -60.0732,  -dy, 4.6669, idrotm[2077], "ONLY");
+    for (jmod = 0; jmod < 18; jmod++) {
+      gMC->Gspos("B463",  4*jmod+1, module[jmod],  dx0,   dy, dz0, idrotm[2086], "ONLY");
+      gMC->Gspos("B463I", 4*jmod+2, module[jmod],  dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B463",  4*jmod+3, module[jmod], -dx0,  -dy, dz0, idrotm[2087], "ONLY");
+      gMC->Gspos("B463I", 4*jmod+4, module[jmod], -dx0,   dy, dz0, idrotm[2086], "ONLY");
   }
  
 // longitudinal bars (TPC rails attached)
@@ -802,8 +742,7 @@ void AliFRAMEv2::CreateGeometry()
 
 //
 // longitudinal bars (no TPC rails attached)
-// new specs: h x w x s = 60 x 60 x 3
-// (was: 75 x 100 x 5?)
+// new specs: h x w x s = 40 x 60 x 5
 //
 //
 // 
@@ -815,8 +754,8 @@ void AliFRAMEv2::CreateGeometry()
   ptrap[9]  = ptrap[4];
 
   gMC->Gsvolu("BA59", "TRAP", kSteel, ptrap, 11);
-  ptrap[0]  = longW/4.-0.15;
-  ptrap[4]  = longH/2.-0.30;
+  ptrap[0]  = longW/4.-0.25;
+  ptrap[4]  = longH/2.-0.50;
   ptrap[5]  = ptrap[4];
   ptrap[7]  = ptrap[3];
   ptrap[8]  = ptrap[4];
@@ -824,95 +763,82 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gsvolu("BA62", "TRAP", kAir, ptrap, 11);
   gMC->Gspos("BA62", 1, "BA59", 0.0, 0.0, -0.15, 0, "ONLY");
 
-  dz = -iFrH/2.+ringH+longH/2.;
+  dz = -iFrH/2. + longH/2.;
 
-  for (jmod = 0; jmod<3; jmod++) {
-      gMC->Gspos("BA59", 2*jmod+1, module[jmod],  49.6476, 0.0, dz, idrotm[2084], "ONLY");
-      gMC->Gspos("BA59", 2*jmod+2, module[jmod], -49.6476, 0.0, dz, idrotm[2083], "ONLY");
+  for (jmod = 0; jmod < 18; jmod++) {
+      gMC->Gspos("BA59", 2*jmod+1, module[jmod],  49.31, 0.0, dz, idrotm[2084], "ONLY");
+      gMC->Gspos("BA59", 2*jmod+2, module[jmod], -49.31, 0.0, dz, idrotm[2083], "ONLY");
   }
+
+  
 //
+// Thermal shield
 //
-// Spacer between TRD and TOF modules
-  ptrap[0]  =   0.99;
-  ptrap[1]  =  10.00;
-  ptrap[2]  =   0.00;
-  ptrap[3]  = 350.00;
-  ptrap[4]  =    0.9;
-  ptrap[5]  = ptrap[4];
-  ptrap[6]  = 0;
-  ptrap[7]  = ptrap[3];
-  ptrap[8]  = ptrap[4];
-  ptrap[9]  = ptrap[4];
-  ptrap[10] = 0;
-  gMC->Gsvolu("B056", "TRAP", kSteel, ptrap, 11);
-  for (jmod = 0; jmod<3; jmod++) {
-      gMC->Gspos("B056", 2*jmod+1, module[jmod],  61.9607, 0.0, 27.2, 0           , "ONLY");
-      gMC->Gspos("B056", 2*jmod+2, module[jmod], -61.9607, 0.0, 27.2, idrotm[2085], "ONLY");
-  }
+
+  Float_t dyM  =  99.0;
+  MakeHeatScreen("M",   dyM, idrotm[2090], idrotm[2091]);
+  Float_t dyAM = 119.5;
+  MakeHeatScreen("AM", dyAM, idrotm[2090], idrotm[2091]);
+  Float_t dyA  = 122.5 - 5.5;
+  MakeHeatScreen("A" ,  dyA, idrotm[2090], idrotm[2091]);
+
 //
-// Mother volumes for TRD and TOF 
-// 
-  if (!fHoles) {
-      printf("\n FRAME Version without Holes !");
-      ptrd1[0] = 49.8065;
-      ptrd1[1] = 62.8535;
-      ptrd1[2] = 375.5;
-      ptrd1[3] = 37.;
-      gMC->Gsvolu("BTR1", "TRD1", kAir, ptrd1, 4);
-      gMC->Gsvolu("BTR2", "TRD1", kAir, ptrd1, 4);
-      gMC->Gsvolu("BTR3", "TRD1", kAir, ptrd1, 4);  
-      
-      ptrd1[0] = 63.2061;
-      ptrd1[1] = 68.3192;
-      ptrd1[2] = 375.5;
-      ptrd1[3] = 14.5;
-      gMC->Gsvolu("BTO1", "TRD1", kAir, ptrd1, 4);
-      gMC->Gsvolu("BTO2", "TRD1", kAir, ptrd1, 4);
-      gMC->Gsvolu("BTO3", "TRD1", kAir, ptrd1, 4);  
-      
-      gMC->Gspos("BTR1", 1, "B071", 0., 0., -10.8, 0, "ONLY");
-      gMC->Gspos("BTR2", 1, "B074", 0., 0., -10.8, 0, "ONLY");
-      gMC->Gspos("BTR3", 1, "B075", 0., 0., -10.8, 0, "ONLY");
-      
-      gMC->Gspos("BTO1", 1, "B071", 0., 0.,  42.69, 0, "ONLY");
-      gMC->Gspos("BTO2", 1, "B074", 0., 0.,  42.69, 0, "ONLY");
-      gMC->Gspos("BTO3", 1, "B075", 0., 0.,  42.69, 0, "ONLY");
-  } else {
-      printf("\n FRAME Version with Holes !");
-      ptrd1[0] = 49.8065;
-      ptrd1[1] = 62.8535;
-      ptrd1[2] = 375.5;
-      ptrd1[3] = 37;
-      gMC->Gsvolu("BTR1", "TRD1", kAir, ptrd1, 4);
-      ptrd1[2] = 156.75;
-      gMC->Gsvolu("BTR2", "TRD1", kAir, ptrd1, 4);
-      ptrd1[2] =  79.75;
-      gMC->Gsvolu("BTR3", "TRD1", kAir, ptrd1, 4);  
-
-      ptrd1[0] = 63.2061;
-      ptrd1[1] = 68.3192;
-      ptrd1[2] = 375.5;
-      ptrd1[3] = 14.5;
-      gMC->Gsvolu("BTO1", "TRD1", kAir, ptrd1, 4);
-      ptrd1[2] = 156.75;
-      gMC->Gsvolu("BTO2", "TRD1", kAir, ptrd1, 4);
-      ptrd1[2] =  79.75;
-      gMC->Gsvolu("BTO3", "TRD1", kAir, ptrd1, 4);  
-      
+//
+//
+  dz = -57.2 + 0.6;  
+  for (i = 0; i < 18; i++) {
 
-      gMC->Gspos("BTR1", 1, "B071", 0.,    0.00, -10.8,            0, "ONLY");
-      gMC->Gspos("BTR2", 1, "B074", 0., -218.75, -10.8, idrotm[2070], "ONLY");
-      gMC->Gspos("BTR2", 2, "B074", 0.,  218.75, -10.8,            0, "ONLY");
-      gMC->Gspos("BTR3", 1, "B075", 0., -295.75, -10.8, idrotm[2070], "ONLY");
-      gMC->Gspos("BTR3", 2, "B075", 0.,  295.75, -10.8,            0, "ONLY");
-
-      gMC->Gspos("BTO1", 1, "B071", 0.,    0.00, 42.69,            0, "ONLY");
-      gMC->Gspos("BTO2", 1, "B074", 0., -218.75, 42.69, idrotm[2070], "ONLY");
-      gMC->Gspos("BTO2", 2, "B074", 0.,  218.75, 42.69,            0, "ONLY");
-      gMC->Gspos("BTO3", 1, "B075", 0., -295.75, 42.69, idrotm[2070], "ONLY");
-      gMC->Gspos("BTO3", 2, "B075", 0.,  295.75, 42.69,            0, "ONLY");
-  }
+      char nameMo[16];
+      sprintf(nameMo, "BSEGMO%d",i);
+      // M
+      gMC->Gspos("BTSH_M" , i+1 , nameMo,  0., 0., dz, 0, "ONLY"); 
+      // AM, CM
+      dy = dymodL[0] + dyAM / 2. + 3.;
+      gMC->Gspos("BTSH_AM", i+ 1, nameMo, 0.,  dy, dz, 0, "ONLY"); 
+      gMC->Gspos("BTSH_AM", i+19, nameMo, 0., -dy, dz, 0, "ONLY"); 
+      // A, C
+      dy = dymodL[1] + dyA / 2 + 0.4;
+      gMC->Gspos("BTSH_A" , i+ 1, nameMo, 0.,  dy, dz, 0, "ONLY"); 
+      gMC->Gspos("BTSH_A" , i+19, nameMo, 0., -dy, dz, 0, "ONLY"); 
+}
   
+
+  //
+  // TRD mother volumes
+  //
+
+  ptrd1[0] = 47.4405;   // CBL 28/6/2006
+  ptrd1[1] = 61.1765;   // CBL
+  ptrd1[2] = 375.5;     // CBL
+  ptrd1[3] = 38.95;     // CBL
+
+  for (i = 0; i < 18; i++) {
+    char nameCh[16];
+    sprintf(nameCh, "BTRD%d",i);
+    char nameMo[16];
+    sprintf(nameMo, "BSEGMO%d",i);
+    gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
+    gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
+    gMC->Gspos(nameCh, 1, nameMo, 0., 0., -12.62, 0, "ONLY"); // CBL 28/6/2006
+  }
+
+//
+// TOF  mother volumes
+//
+  ptrd1[0] = 62.2500; 
+  ptrd1[1] = 67.3631; 
+  ptrd1[2] = 373.6; 
+  ptrd1[3] = 14.525; //AdC
+  for (i = 0; i < 18; i++) {
+    char nameCh[16];
+    sprintf(nameCh, "BTOF%d",i);
+    char nameMo[16];
+    sprintf(nameMo, "BSEGMO%d",i);
+    gMC->Gsvolu(nameCh, "TRD1", kAir, ptrd1, 4);
+    gGeoManager->GetVolume(nameCh)->SetVisibility(kFALSE);
+    gMC->Gspos(nameCh, 1, nameMo, 0., 0., 43.525, 0, "ONLY"); //AdC
+  }
+
 //
 //    Geometry of Rails starts here
 //
@@ -938,18 +864,18 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gspos("BRS2", 1, "BRS1", 0., -27.5+3.75, 0., 0, "ONLY");
   gMC->Gspos("BRS2", 2, "BRS1", 0.,  27.5-3.75, 0., 0, "ONLY");
   gMC->Gspos("BRS3", 1, "BRS1", 0.,         0., 0., 0, "ONLY");
-  gMC->Gspos("BRS1", 1, "ALIC", -430.-3.,    -180., 0., 0, "ONLY");
-  gMC->Gspos("BRS1", 2, "ALIC",  430.+3.,    -180., 0., 0, "ONLY");
+  gMC->Gspos("BRS1", 1, "ALIC", -430.-3.,    -190., 0., 0, "ONLY");
+  gMC->Gspos("BRS1", 2, "ALIC",  430.+3.,    -190., 0., 0, "ONLY");
 
   rbox[0] =    3.0;
-  rbox[1] =  145./2.;
+  rbox[1] =  145./4.;
   rbox[2] =   25.0;
   gMC->Gsvolu("BRS4", "BOX", kSteel, rbox, 3);
 
-  gMC->Gspos("BRS4", 1, "ALIC",  430.+3.,    -180.+55./2.+rbox[1],  224., 0, "ONLY");
-  gMC->Gspos("BRS4", 2, "ALIC",  430.+3.,    -180.+55./2.+rbox[1], -224., 0, "ONLY");
-  gMC->Gspos("BRS4", 3, "ALIC", -430.-3.,    -180.+55./2.+rbox[1],  224., 0, "ONLY");
-  gMC->Gspos("BRS4", 4, "ALIC", -430.-3.,    -180.+55./2.+rbox[1], -224., 0, "ONLY");
+  gMC->Gspos("BRS4", 1, "ALIC",  430.+3.,    -190.+55./2.+rbox[1],  224., 0, "ONLY");
+  gMC->Gspos("BRS4", 2, "ALIC",  430.+3.,    -190.+55./2.+rbox[1], -224., 0, "ONLY");
+//  gMC->Gspos("BRS4", 3, "ALIC", -430.+3,    -180.+55./2.+rbox[1],  224., 0, "ONLY");
+//  gMC->Gspos("BRS4", 4, "ALIC", -430.+3,    -180.+55./2.+rbox[1], -224., 0, "ONLY");
 
 
 
@@ -981,6 +907,29 @@ void AliFRAMEv2::CreateGeometry()
   tpar[1] = kBFMRou;
   tpar[2] = kBFMdz / 2.;
   gMC->Gsvolu("BFMO", "TUBE", kAir, tpar, 3);  
+
+  // CBL ////////////////////////////////////////////////////////
+  //
+  // TRD mother volume
+  //
+
+  ptrd1[0] = 47.4405 - 0.3;
+  ptrd1[1] = 61.1765 - 0.3;
+  ptrd1[2] = kBFMdz / 2.;
+  ptrd1[3] = 38.95;
+  gMC->Gsvolu("BFTRD", "TRD1", kAir, ptrd1, 4);
+  gGeoManager->GetVolume("BFTRD")->SetVisibility(kFALSE);
+
+  for (i = 0; i < 18; i++) {
+
+    Float_t phiBF  = i * 20.0;      
+    dx =  TMath::Sin(phiBF*kdeg2rad)*(342.0-12.62);
+    dy = -TMath::Cos(phiBF*kdeg2rad)*(342.0-12.62);      
+    gMC->Gspos("BFTRD",i,"BFMO",dx,dy,0.0,idrotm[2034+i],"ONLY");
+
+  }
+
+  // CBL ////////////////////////////////////////////////////////
   
   // Rings
   //
@@ -998,9 +947,6 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gsvolu("BFII", "TUBE", kAir, tpar, 3);  
   gMC->Gspos("BFII", 1, "BFIR", 0., 0., 0., 0, "ONLY");  
 
-  dz = kBFMdz/2. -  kBFRdz / 2.;
-  gMC->Gspos("BFIR", 1, "BFMO", 0., 0., dz, 0, "ONLY");  
-
   //
   // Outer RING
   tpar[0] =  kBFMRou - kBFRdr;
@@ -1041,21 +987,21 @@ void AliFRAMEv2::CreateGeometry()
 
   for (i = 0; i < 18; i++)
   {
-      Float_t ro   = kBFMRou - kBFBd / 2.;
+      Float_t ro   = kBFMRou - kBFBd / 2. - 0.02;
       Float_t ri   = kBFMRin + kBFBd / 2.;
 
-      Float_t phi = Float_t(i) * 20.;
+      Float_t phi0 = Float_t(i) * 20.;
       
-      Float_t x = ri * TMath::Cos(phi * kDegrad);
-      Float_t y = ri * TMath::Sin(phi * kDegrad);
-      AliMatrix(idrotm[2090+i],  90.0, phi,  90.0, phi + 270., 0., 0.);
+      Float_t xb = ri * TMath::Cos(phi0 * kDegrad);
+      Float_t yb = ri * TMath::Sin(phi0 * kDegrad);
+      AliMatrix(idrotm[2090+i],  90.0, phi0,  90.0, phi0 + 270., 0., 0.);
       
-      gMC->Gspos("BFLB", i + 1, "BFMO", x, y, 0., idrotm[2090 + i], "ONLY");      
+      gMC->Gspos("BFLB", i + 1, "BFMO", xb, yb, 0., idrotm[2090 + i], "ONLY");      
 
-      x = ro * TMath::Cos(phi * kDegrad);
-      y = ro * TMath::Sin(phi * kDegrad);
+      xb = ro * TMath::Cos(phi0 * kDegrad);
+      yb = ro * TMath::Sin(phi0 * kDegrad);
 
-      gMC->Gspos("BFLB", i + 19, "BFMO", x, y, 0., idrotm[2090 +i], "ONLY");       
+      gMC->Gspos("BFLB", i + 19, "BFMO", xb, yb, 0., idrotm[2090 +i], "ONLY");       
  }
 
   // 
@@ -1084,18 +1030,18 @@ void AliFRAMEv2::CreateGeometry()
   for (i = 0; i < 10; i++)
   {
       
-      Float_t r   = (kBFMRin + kBFMRou)/2.;
-      Float_t phi = Float_t(iphi[i]) * 20.;
+      Float_t rb   = (kBFMRin + kBFMRou)/2.;
+      Float_t phib = Float_t(iphi[i]) * 20.;
       
-      Float_t x = r * TMath::Cos(phi * kDegrad);
-      Float_t y = r * TMath::Sin(phi * kDegrad);
+      Float_t xb = rb * TMath::Cos(phib * kDegrad);
+      Float_t yb = rb * TMath::Sin(phib * kDegrad);
       
-      gMC->Gspos("BFRB", i + 1,  "BFMO", x, y,  dz, idrotm[2034 + iphi[i]], "ONLY");      
-      gMC->Gspos("BFRB", i + 11, "BFMO", x, y, -dz, idrotm[2034 + iphi[i]], "ONLY");      
+      gMC->Gspos("BFRB", i + 1,  "BFMO", xb, yb,  dz, idrotm[2034 + iphi[i]], "ONLY");      
+      gMC->Gspos("BFRB", i + 11, "BFMO", xb, yb, -dz, idrotm[2034 + iphi[i]], "ONLY");      
 
  }
 
-  gMC->Gspos("BFMO", i + 19, "ALIC", 0, 0, 376. + kBFMdz/2. + 0.5 , 0, "ONLY");       
+  gMC->Gspos("BFMO", i + 19, "ALIC", 0, 0, - 376. - kBFMdz/2. - 0.5 , 0, "ONLY");       
 
 
 
@@ -1133,6 +1079,23 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gsvolu("BBMO", "PGON", kAir, ppgon, 10);
   gMC->Gsdvn("BBCE", "BBMO", 18, 2);
 
+  // CBL ////////////////////////////////////////////////////////
+  //
+  // TRD mother volume
+  //
+
+  AliMatrix(idrotm[2092],  90.0,  90.0,   0.0,   0.0,   90.0,  0.0);
+
+  ptrd1[0] = 47.4405 - 2.5;
+  ptrd1[1] = 61.1765 - 2.5;
+  ptrd1[2] = kBBMdz / 2.;
+  ptrd1[3] = 38.95;
+  gMC->Gsvolu("BBTRD", "TRD1", kAir, ptrd1, 4);
+  gGeoManager->GetVolume("BBTRD")->SetVisibility(kFALSE);
+  gMC->Gspos("BBTRD", 1, "BBCE", 342.0-12.62, 0.0, 0.0, idrotm[2092], "ONLY");
+
+  // CBL ////////////////////////////////////////////////////////
+
   // Longitudinal bars
   bpar[0] =  kBBBdz/2.;
   bpar[1] =  bpar[0];
@@ -1144,11 +1107,11 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gsvolu("BBLL", "BOX ", kAir, bpar, 3); 
   gMC->Gspos("BBLL", 1, "BBLB", 0., 0., 0., 0, "ONLY"); 
 
-  dx = kBBMRin + kBBBdz/2.;
+  dx = kBBMRin + kBBBdz/2. + (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
   dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
   gMC->Gspos("BBLB", 1, "BBCE", dx, dy, 0., idrotm[2052], "ONLY"); 
 
-  dx = kBBMRou - kBBBdz/2.;
+  dx = kBBMRou - kBBBdz/2. - (bpar[1] + kBBBdd) * TMath::Sin(10. * kDegrad);
   dy = dx * TMath::Tan(10. * kDegrad) - kBBBdz/2./TMath::Cos(10. * kDegrad);
  
   gMC->Gspos("BBLB", 2, "BBCE", dx, dy, 0., idrotm[2052], "ONLY");  
@@ -1272,7 +1235,7 @@ void AliFRAMEv2::CreateGeometry()
   gMC->Gspos("BBD2", 1, "BBCE", dx, dy,   -dz/2. - kBBBdz/2., idrotm[2052], "ONLY");  
 
 
-  gMC->Gspos("BBMO", 1, "ALIC", 0., 0., - 376. - kBBMdz / 2. - 0.5, 0, "ONLY");  
+  gMC->Gspos("BBMO", 1, "ALIC", 0., 0., + 376. + kBBMdz / 2. + 0.5, 0, "ONLY");  
 
 
 }
@@ -1286,21 +1249,33 @@ void AliFRAMEv2::CreateMaterials()
   Float_t epsil, stemax, tmaxfd, deemax, stmin;
   
   epsil  = 1.e-4;     // Tracking precision, 
-  stemax = -0.01;   // Maximum displacement for multiple scat 
-  tmaxfd = -20.;    // Maximum angle due to field deflection 
-  deemax = -.3;     // Maximum fractional energy loss, DLS 
+  stemax = -0.01;     // Maximum displacement for multiple scat 
+  tmaxfd = -20.;      // Maximum angle due to field deflection 
+  deemax = -.3;       // Maximum fractional energy loss, DLS 
   stmin  = -.8;
   Int_t   isxfld = gAlice->Field()->Integ();
   Float_t sxmgmx = gAlice->Field()->Max();
-  
+
+
   Float_t asteel[4] = { 55.847,51.9961,58.6934,28.0855 };
   Float_t zsteel[4] = { 26.,24.,28.,14. };
   Float_t wsteel[4] = { .715,.18,.1,.005 };
+  
+  //Air
+  
+  Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
+  Float_t zAir[4]={6.,7.,8.,18.};
+  Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
+  Float_t dAir = 1.20479E-3;
 
   AliMixture(65, "STAINLESS STEEL$", asteel, zsteel, 7.88, 4, wsteel);
-  AliMaterial(5, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500.);
+  AliMixture(5, "AIR$      ", aAir, zAir, dAir,4, wAir);
+  AliMaterial(9, "ALU      ", 26.98, 13., 2.7, 8.9, 37.2);
+
   AliMedium(65, "Stainless Steel", 65, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
-  AliMedium( 5, "Air            ", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium( 5, "Air", 5, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+  AliMedium( 9, "Aluminum", 9, 0, isxfld, sxmgmx, tmaxfd, stemax, deemax, epsil, stmin);
+
 }
 
 //_____________________________________________________________________________
@@ -1309,7 +1284,7 @@ void AliFRAMEv2::Init()
   //
   // Initialise the module after the geometry has been defined
   //
-    if(fDebug) {
+    if(AliLog::GetGlobalDebugLevel()>0) {
        printf("%s: **************************************"
               " FRAME "
               "**************************************\n",ClassName());
@@ -1320,7 +1295,8 @@ void AliFRAMEv2::Init()
     }
 //
 // The reference volume id
-    fRefVolumeId = gMC->VolId("BREF");
+    fRefVolumeId1 = gMC->VolId("BREF1");
+    fRefVolumeId2 = gMC->VolId("BREF2");
 }
 
 Int_t AliFRAMEv2::IsVersion() const 
@@ -1348,16 +1324,140 @@ void AliFRAMEv2::StepManager()
 
   id=gMC->CurrentVolID(copy);
 
-  if (id != fRefVolumeId)  return;
+  if ((id != fRefVolumeId1) && (id != fRefVolumeId2))  return;
   if(!gMC->IsTrackEntering()) return;
   //
   // Add the reference track
   //
-  AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber());
+  AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kFRAME);
 }
 
   
 
+void AliFRAMEv2::MakeHeatScreen(char* name, Float_t dyP, Int_t rot1, Int_t rot2)
+{
+    // Heat screen panel
+    //
+    Int_t *idtmed = fIdtmed->GetArray()-1999;
+    const Int_t kAir   = idtmed[2004];
+    const Int_t kAlu   = idtmed[2008];
+
+    Float_t dx, dy;
+    char mname [128];
+    char cname [128];
+    char t1name[128];
+    char t2name[128];
+    char t3name[128];
+    char t4name[128];
+    char t5name[128];
+    
+    // 
+    Float_t dxP =  2. * (287. * TMath::Sin(10.* TMath::Pi()/180.) - 2.);
+    Float_t dzP =  1.05;
+    //
+    // Mother volume
+    Float_t thshM[3];
+    thshM[0]  =  dxP / 2.;
+    thshM[1]  =  dyP / 2.;
+    thshM[2]  =  dzP / 2.;
+    sprintf(mname, "BTSH_%s", name);
+    gMC->Gsvolu(mname,  "BOX ", kAir, thshM,  3);
+    //
+    // Aluminum sheet
+    thshM[2] = 0.025;
+    sprintf(cname, "BTSHA_%s", name);
+    gMC->Gsvolu(cname, "BOX ", kAlu, thshM,  3);
+    gMC->Gspos(cname, 1, mname, 0., 0., -0.5, 0);
+    //
+    // Tubes
+    Float_t thshT[3];
+    thshT[0] = 0.4;
+    thshT[1] = 0.5;
+    thshT[2] = (dyP / 2. - 8.);
+    //
+    sprintf(t1name, "BTSHT1_%s", name);
+    gMC->Gsvolu(t1name,  "TUBE", kAlu, thshT,  3);
+    dx = - dxP / 2. + 8. - 0.5;
+    gMC->Gspos(t1name, 1, mname,  dx, 0., 0.025, rot1);
+    //
+    sprintf(t2name, "BTSHT2_%s", name);
+    sprintf(t3name, "BTSHT3_%s", name);
+    sprintf(t4name, "BTSHT4_%s", name);
+    sprintf(t5name, "BTSHT5_%s", name);
+    thshT[2] = (thshM[1] - 12.);
+    gMC->Gsvolu(t2name,  "TUBE", kAlu, thshT,  3);
+    thshT[2] = 7.9/2.;
+    gMC->Gsvolu(t3name,  "TUBE", kAlu, thshT,  3);
+    thshT[2] = 23.9/2.;
+    gMC->Gsvolu(t4name,  "TUBE", kAlu, thshT,  3);
+
+    Int_t sig = 1;
+    Int_t ipo = 1;
+    for (Int_t i = 0; i < 5; i++) {
+       sig *= -1;
+       dx += 8.00;
+       dy = 4. * sig;
+       Float_t dy1 =  - (thshM[1] - 15.5) * sig;
+       Float_t dy2 =  - (thshM[1] -  7.5) * sig;
+       
+       gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);
+       dx += 6.9;
+       gMC->Gspos(t2name, ipo++, mname, dx, dy, 0.025, rot1);      
+       
+       gMC->Gspos(t3name, i+1,   mname, dx - 3.45, dy1, 0.025, rot2);      
+       gMC->Gspos(t4name, i+1,   mname, dx - 3.45, dy2, 0.025, rot2);      
+    }
+    dx += 8.;
+    gMC->Gspos(t1name, 2, mname, dx, 0., 0.025, rot1);
+    gMC->Gspos(t3name, 6,   mname, dx - 3.45, -(thshM[1] - 7.5), 0.025, rot2);      
+}
+
 
 
+void AliFRAMEv2::WebFrame(char* name, Float_t dHz, Float_t theta0, Float_t phi0)
+{
+    //
+    // Create a web frame element
+    //
+    Int_t *idtmed = fIdtmed->GetArray()-1999;
+    const Float_t krad2deg = 180. / TMath::Pi();
+    const Float_t kdeg2rad = 1. / krad2deg;
+    const Int_t   kAir   = idtmed[2004];
+    const Int_t   kSteel = idtmed[2064];
+
+    Float_t ptrap[11];
+    char nameA[64];
+    sprintf(nameA, "%sA", name );
+    theta0 *= kdeg2rad;
+    phi0   *= kdeg2rad;
+    Float_t theta   = TMath::ATan(TMath::Tan(theta0)/TMath::Sin(phi0));
+    Float_t phi     = TMath::ACos(TMath::Cos(theta0) * TMath::Cos(phi0));
+    if (phi0 < 0) phi = -phi;
+
+    phi   *= krad2deg;
+    theta *= krad2deg;
+    
+    ptrap[0]  = dHz/2;
+    ptrap[2]  = theta;
+    ptrap[1]  = phi;
+    ptrap[3]  = 6./cos(theta0 * kdeg2rad)/2.;
+    ptrap[4]  = 1.;
+    ptrap[5]  = ptrap[4];
+    ptrap[6]  = 0;
+    ptrap[7]  = ptrap[3];
+    ptrap[8]  = ptrap[4];
+    ptrap[9]  = ptrap[4];
+    ptrap[10] = 0;
+    gMC->Gsvolu(name, "TRAP", kSteel, ptrap, 11);
+    ptrap[3]  =  (6. - 1.)/cos(theta0 * kdeg2rad)/2.;
+    ptrap[4]  =  0.75;
+    ptrap[5]  = ptrap[4];
+    ptrap[7]  = ptrap[3];
+    ptrap[8]  = ptrap[4];
+    ptrap[9]  = ptrap[4];
+    
+    gMC->Gsvolu(nameA, "TRAP", kAir, ptrap, 11);
+    gMC->Gspos(nameA, 1, name, 0.0, -0.25, 0., 0, "ONLY");
+    gGeoManager->GetVolume(name)->SetVisibility(1);
+}