Implemented more realistic geometry of slats (Ch. Finck, JP Cussonneau & G. Martinez)
authorcussonno <cussonno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Oct 2004 14:54:48 +0000 (14:54 +0000)
committercussonno <cussonno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Oct 2004 14:54:48 +0000 (14:54 +0000)
MUON/AliMUONConstants.cxx
MUON/AliMUONConstants.h
MUON/AliMUONFactory.cxx
MUON/AliMUONGeometryBuilder.cxx
MUON/AliMUONSegmentationSlat.cxx
MUON/AliMUONSegmentationSlat.h
MUON/AliMUONSlatGeometryBuilder.cxx

index 6b06668..e66a0ed 100644 (file)
@@ -27,9 +27,14 @@ Int_t   AliMUONConstants::fgNTriggerCircuit = 234;
 Int_t   AliMUONConstants::fgNofDetElements[14] =
 { 4, 4, 4, 4, 18, 18, 26, 26, 26, 26, 18, 18, 18, 18 };
 
-Float_t AliMUONConstants::fgDefaultChamberZ[14] =
-{-533.5, -546.5, -678.5, -693.5, -964.0, -986.0, -1251.5, -1278.5, -1416.5, -1443.5,
- -1603.5, -1620.5, -1703.5, -1720.5};
+Float_t AliMUONConstants::fgDefaultChamberZ[14] = 
+  {-533.5, -546.5, -678.5, -693.5, // St12
+   -966.9, -997.9, -1274.5, -1305.5, -1408.6, -1439.6, // St345  update sept04 Ch. Finck 
+   -1603.5, -1620.5, -1703.5, -1720.5}; // M1 & M2
+
+Float_t  AliMUONConstants::fgDzCh   = 15.5/2.;
+Float_t  AliMUONConstants::fgDzSlat = 8.5/2.;
+
 
 Float_t  AliMUONConstants::fgDmin[7] = {  36.4,  46.2,  66.0,   80.,   80., 100., 100.};    
 Float_t  AliMUONConstants::fgDmax[7]  = {183., 245., 395.,  560.,  563., 850., 900.};  
index acb3693..1af0eb3 100644 (file)
@@ -30,6 +30,10 @@ class AliMUONConstants : public TObject {
     static Float_t  Dmax(Int_t i) {return fgDmax[i];}
     // return maximum zoom for event display
     static Int_t    MaxZoom() {return fgMaxZoom;}
+    // return half-distance between two half-chambers
+    static Float_t    DzCh() {return fgDzCh;}
+    // return half-distance between two slats
+    static Float_t    DzSlat() {return fgDzSlat;}
 
     // Conversion functions between chamber Id and detection element Id
     static  Int_t GetChamberId(Int_t detElemId); 
@@ -49,6 +53,10 @@ class AliMUONConstants : public TObject {
     static Float_t  fgDefaultChamberZ[14];    // ! Z-positions of chambers
     static Float_t  fgDmin[7];                // ! inner diameter
     static Float_t  fgDmax[7];                // ! outer diameter
+
+    static Float_t  fgDzCh;             // half-distance between two half-chambers 
+    static Float_t  fgDzSlat;           // half-distance between two slat on the same chamber
+
 //
     static Int_t    fgMaxZoom;                // Maximum Zoom for event display
     ClassDef(AliMUONConstants, 0)             // MUON global constants 
index 1d0f320..1f1c002 100644 (file)
@@ -245,10 +245,13 @@ void AliMUONFactory::BuildStation3()
                             0,0,3,0,
                             0,0,2,0};
        
-       Float_t shift = 1.5/2.;
-       Float_t xpos5[9]    = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
-       Float_t ypos5       = -(20.+4.*(40.-2.*shift));
-       
+       Float_t shift = 0.; // no more constant overlap between slats
+
+       Float_t xpos5[9]    = {1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
+       Float_t ypos5[9]    = {-146.5, -112.8, -75.5, -37.8, 0.0, 37.8, 75.5, 112.8, 146.5};    
+
+       for (Int_t i = 0; i < 9; i++) ypos5[i] -= 20.; // origin in segmentation at the bottom of the slat !
+
        Int_t chamber=5;
        fMUON->SetNsec(chamber-1,2);
        AliMUONSegmentationSlat *seg51=new AliMUONSegmentationSlat(4);
@@ -256,7 +259,7 @@ void AliMUONFactory::BuildStation3()
        seg51->SetShift(shift);  
        seg51->SetNPCBperSector(npcb5); 
        seg51->SetSlatXPositions(xpos5);
-       seg51->SetSlatYPosition(ypos5);
+       seg51->SetSlatYPositions(ypos5);
        seg51->SetPadSize(10.,0.5);
        seg51->SetDAnod(0.25);
        seg51->SetPadDivision(nseg3);
@@ -267,7 +270,7 @@ void AliMUONFactory::BuildStation3()
        seg52->SetShift(shift);  
        seg52->SetNPCBperSector(npcb5); 
        seg52->SetSlatXPositions(xpos5);
-       seg52->SetSlatYPosition(ypos5);
+       seg52->SetSlatYPositions(ypos5);
        seg52->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg52->SetDAnod(0.25);
        seg52->SetPadDivision(nseg3);
@@ -282,7 +285,7 @@ void AliMUONFactory::BuildStation3()
        seg61->SetShift(shift);  
        seg61->SetNPCBperSector(npcb5); 
        seg61->SetSlatXPositions(xpos5);
-       seg61->SetSlatYPosition(ypos5);
+       seg61->SetSlatYPositions(ypos5);
        seg61->SetPadSize(10.,0.5);
        seg61->SetDAnod(0.25);
        seg61->SetPadDivision(nseg3);
@@ -293,7 +296,7 @@ void AliMUONFactory::BuildStation3()
        seg62->SetShift(shift);  
        seg62->SetNPCBperSector(npcb5); 
        seg62->SetSlatXPositions(xpos5);
-       seg62->SetSlatYPosition(ypos5);
+       seg62->SetSlatYPositions(ypos5);
        seg62->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg62->SetDAnod(0.25);
        seg62->SetPadDivision(nseg3);
@@ -318,7 +321,8 @@ void AliMUONFactory::BuildStation4()
        fMUON->SetNsec(chamber-1,2);
 //
        AliMUONSegmentationSlat *seg71=new AliMUONSegmentationSlat(4);
-       Float_t shift = 1.5/2.;
+       Float_t shift = 0.;
+
        Int_t npcb7[52] = {0,0,0,2,
                           0,0,0,3,
                           0,0,2,2,
@@ -332,14 +336,21 @@ void AliMUONFactory::BuildStation4()
                           0,0,2,2, 
                           0,0,0,3,
                           0,0,0,2};
-       Float_t xpos7[13]   = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 44., 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
-       Float_t ypos7       = -(20.+6.*(40.-2.*shift));  
+       Float_t xpos7[13]   = {1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 39.45, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
+       Float_t ypos7[13]   = {-204.1, -175.5, -138.5, -109.2, -72.6, -38.2, 0.0, 
+                              38.2, 72.6, 109.2, 138.5, 175.5, 204.1};
+       Float_t ypos8[13]   = {-208.6, -180.0, -143.0, -113.6, -76.05, -38.2, 0.0, 
+                              38.2, 76.05, 113.6, 143.0, 180.0, 208.6};
+       for (Int_t i = 0; i < 13; i++) {
+         ypos7[i] -= 20.;
+         ypos8[i] -= 20.;
+       }
        
        seg71->SetNSlats(13);  
        seg71->SetShift(shift);  
        seg71->SetNPCBperSector(npcb7); 
        seg71->SetSlatXPositions(xpos7);
-       seg71->SetSlatYPosition(ypos7);
+       seg71->SetSlatYPositions(ypos7);
        
        seg71->SetPadSize(10.,0.5);
        seg71->SetDAnod(0.25);
@@ -353,7 +364,7 @@ void AliMUONFactory::BuildStation4()
        seg72->SetShift(shift);   
        seg72->SetNPCBperSector(npcb7); 
        seg72->SetSlatXPositions(xpos7);
-       seg72->SetSlatYPosition(ypos7);
+       seg72->SetSlatYPositions(ypos7);
        seg72->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg72->SetDAnod(0.25);
        seg72->SetPadDivision(nseg4);
@@ -371,7 +382,7 @@ void AliMUONFactory::BuildStation4()
        seg81->SetShift(shift);  
        seg81->SetNPCBperSector(npcb7); 
        seg81->SetSlatXPositions(xpos7);
-       seg81->SetSlatYPosition(ypos7);
+       seg81->SetSlatYPositions(ypos8);
        seg81->SetPadSize(10.,0.5);
        seg81->SetDAnod(0.25);
        seg81->SetPadDivision(nseg4);
@@ -384,7 +395,7 @@ void AliMUONFactory::BuildStation4()
        seg82->SetShift(shift);  
        seg82->SetNPCBperSector(npcb7); 
        seg82->SetSlatXPositions(xpos7);
-       seg82->SetSlatYPosition(ypos7);
+       seg82->SetSlatYPositions(ypos8);
        seg82->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg82->SetDAnod(0.25);
        seg82->SetPadDivision(nseg4);
@@ -408,7 +419,8 @@ void AliMUONFactory::BuildStation5()
        AliMUONSegmentationSlat *seg91=new AliMUONSegmentationSlat(4);
 
        Int_t   nseg4[4]={4, 4, 2, 1};
-       Float_t shift = 1.5/2.;
+       Float_t shift = 0.;
+
        Int_t   npcb9[52] = {0,0,0,3,
                             0,0,0,4,
                             0,0,2,3,
@@ -423,14 +435,18 @@ void AliMUONFactory::BuildStation5()
                             0,0,0,4, 
                             0,0,0,3};   
        
-       Float_t xpos9[13]   = {4.5, 4.5, 4.5, 4.5, 4.5, 4.5, 44., 4.5, 4.5, 4.5, 4.5, 4.5, 4.5};
-       Float_t ypos9       = -(20.+6.*(40.-2.*shift));
+       Float_t xpos9[13]   = {1.25, 1.25, 1.25, 1.25, 1.25, 1.25, 39.45, 1.25, 1.25, 1.25, 1.25, 1.25, 1.25};
+       Float_t ypos9[13]   = {-224.8, -188.05, -151.0, -113.7, -76.1, -38.2, 0.0, 
+                              38.2, 76.1, 113.7, 151.0, 188.05, 224.8};
+
+       for (Int_t i = 0; i < 13; i++)  ypos9[i] -= 20.;
+
        
        seg91->SetNSlats(13);  
        seg91->SetShift(shift);  
        seg91->SetNPCBperSector(npcb9); 
        seg91->SetSlatXPositions(xpos9);
-       seg91->SetSlatYPosition(ypos9);
+       seg91->SetSlatYPositions(ypos9);
        seg91->SetPadSize(10.,0.5);
        seg91->SetDAnod(0.25);
        seg91->SetPadDivision(nseg4);
@@ -443,7 +459,7 @@ void AliMUONFactory::BuildStation5()
        seg92->SetShift(shift);   
        seg92->SetNPCBperSector(npcb9); 
        seg92->SetSlatXPositions(xpos9);
-       seg92->SetSlatYPosition(ypos9);
+       seg92->SetSlatYPositions(ypos9);
        seg92->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg92->SetDAnod(0.25);
        seg92->SetPadDivision(nseg4);
@@ -461,7 +477,7 @@ void AliMUONFactory::BuildStation5()
        seg101->SetShift(shift);  
        seg101->SetNPCBperSector(npcb9); 
        seg101->SetSlatXPositions(xpos9);
-       seg101->SetSlatYPosition(ypos9);
+       seg101->SetSlatYPositions(ypos9);
        seg101->SetPadSize(10.,0.5);
        seg101->SetDAnod(0.25);
        seg101->SetPadDivision(nseg4);
@@ -474,7 +490,7 @@ void AliMUONFactory::BuildStation5()
        seg102->SetShift(shift);   
        seg102->SetNPCBperSector(npcb9); 
        seg102->SetSlatXPositions(xpos9);
-       seg102->SetSlatYPosition(ypos9);
+       seg102->SetSlatYPositions(ypos9);
        seg102->SetPadSize(1., 10.); // DeltaX(non bending) = 2 * DeltaY(bending)
        seg102->SetDAnod(0.25);
        seg102->SetPadDivision(nseg4);
index 759547d..9739f5a 100644 (file)
@@ -287,75 +287,78 @@ void AliMUONGeometryBuilder::CreateGeometry()
 //_____________________________________________________________________________
 void AliMUONGeometryBuilder::CreateMaterials()
 {
-// Definition of common materials
-// --
+  // Definition of common materials
+  // --
 
   //
   //     Ar-CO2 gas (80%+20%)
-    Float_t ag1[3]   = { 39.95,12.01,16. };
-    Float_t zg1[3]   = { 18.,6.,8. };
-    Float_t wg1[3]   = { .8,.0667,.13333 };
-    Float_t dg1      = .001821;
-    //
-    //     Ar-buthane-freon gas -- trigger chambers 
-    Float_t atr1[4]  = { 39.95,12.01,1.01,19. };
-    Float_t ztr1[4]  = { 18.,6.,1.,9. };
-    Float_t wtr1[4]  = { .56,.1262857,.2857143,.028 };
-    Float_t dtr1     = .002599;
-    //
-    //     Ar-CO2 gas 
-    Float_t agas[3]  = { 39.95,12.01,16. };
-    Float_t zgas[3]  = { 18.,6.,8. };
-    Float_t wgas[3]  = { .74,.086684,.173316 };
-    Float_t dgas     = .0018327;
-    //
-    //     Ar-Isobutane gas (80%+20%) -- tracking 
-    Float_t ag[3]    = { 39.95,12.01,1.01 };
-    Float_t zg[3]    = { 18.,6.,1. };
-    Float_t wg[3]    = { .8,.057,.143 };
-    Float_t dg       = .0019596;
-    //
-    //     Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger 
-    Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
-    Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
-    Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
-    Float_t dtrig    = .0031463;
-    //
-    //     bakelite 
-
-    Float_t abak[3] = {12.01 , 1.01 , 16.};
-    Float_t zbak[3] = {6.     , 1.   , 8.};
-    Float_t wbak[3] = {6.     , 6.   , 1.}; 
-    Float_t dbak = 1.4;
-
-    Int_t iSXFLD   = gAlice->Field()->Integ();
-    Float_t sXMGMX = gAlice->Field()->Max();
-    //
-    // --- Define the various materials for GEANT --- 
-    fMUON->AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-    fMUON->AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
-    // 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;
-    fMUON->AliMixture(15, "AIR$      ", aAir,  zAir, dAir,4, wAir);
-    //    fMUON->AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
-    fMUON->AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
-    fMUON->AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
-    fMUON->AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
-    fMUON->AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
-    fMUON->AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
-    fMUON->AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
-    // materials for slat: 
-    //     Sensitive area: gas (already defined) 
-    //     PCB: copper 
-    //     insulating material and frame: vetronite
-    //     walls: carbon, rohacell, carbon 
-  Float_t aglass[5]={12.01, 28.09, 16.,   10.8,  23.};
-  Float_t zglass[5]={ 6.,   14.,    8.,    5.,   11.};
-  Float_t wglass[5]={ 0.5,  0.105, 0.355, 0.03,  0.01};
-  Float_t dglass=1.74;
+  Float_t ag1[3]   = { 39.95,12.01,16. };
+  Float_t zg1[3]   = { 18.,6.,8. };
+  Float_t wg1[3]   = { .8,.0667,.13333 };
+  Float_t dg1      = .001821;
+  //
+  //     Ar-buthane-freon gas -- trigger chambers 
+  Float_t atr1[4]  = { 39.95,12.01,1.01,19. };
+  Float_t ztr1[4]  = { 18.,6.,1.,9. };
+  Float_t wtr1[4]  = { .56,.1262857,.2857143,.028 };
+  Float_t dtr1     = .002599;
+  //
+  //     Ar-CO2 gas 
+  Float_t agas[3]  = { 39.95,12.01,16. };
+  Float_t zgas[3]  = { 18.,6.,8. };
+  Float_t wgas[3]  = { .74,.086684,.173316 };
+  Float_t dgas     = .0018327;
+  //
+  //     Ar-Isobutane gas (80%+20%) -- tracking 
+  Float_t ag[3]    = { 39.95,12.01,1.01 };
+  Float_t zg[3]    = { 18.,6.,1. };
+  Float_t wg[3]    = { .8,.057,.143 };
+  Float_t dg       = .0019596;
+  //
+  //     Ar-Isobutane-Forane-SF6 gas (49%+7%+40%+4%) -- trigger 
+  Float_t atrig[5] = { 39.95,12.01,1.01,19.,32.066 };
+  Float_t ztrig[5] = { 18.,6.,1.,9.,16. };
+  Float_t wtrig[5] = { .49,1.08,1.5,1.84,0.04 };
+  Float_t dtrig    = .0031463;
+  //
+  //     bakelite: C6 H6 O
+  Float_t abak[3] = {12.01 , 1.01 , 16.};
+  Float_t zbak[3] = {6.     , 1.   , 8.};
+  Float_t wbak[3] = {6.     , 6.   , 1.}; 
+  Float_t dbak = 1.4;
+
+  Int_t iSXFLD   = gAlice->Field()->Integ();
+  Float_t sXMGMX = gAlice->Field()->Max();
+  //
+  // --- Define the various materials for GEANT --- 
+  fMUON->AliMaterial(9, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  fMUON->AliMaterial(10, "ALUMINIUM$", 26.98, 13., 2.7, 8.9, 37.2);
+  // 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;
+  fMUON->AliMixture(15, "AIR$      ", aAir,  zAir, dAir,4, wAir);
+  //    fMUON->AliMaterial(15, "AIR$      ", 14.61, 7.3, .001205, 30423.24, 67500);
+  fMUON->AliMixture(19, "Bakelite$", abak, zbak, dbak, -3, wbak);
+  fMUON->AliMixture(20, "ArC4H10 GAS$", ag, zg, dg, 3, wg);
+  fMUON->AliMixture(21, "TRIG GAS$", atrig, ztrig, dtrig, -5, wtrig);
+  fMUON->AliMixture(22, "ArCO2 80%$", ag1, zg1, dg1, 3, wg1);
+  fMUON->AliMixture(23, "Ar-freon $", atr1, ztr1, dtr1, 4, wtr1);
+  fMUON->AliMixture(24, "ArCO2 GAS$", agas, zgas, dgas, 3, wgas);
+
+  // materials for slat: 
+  //     Sensitive area: gas (already defined) 
+  //     PCB: copper 
+  //     insulating material: vetronite -> replacing by G10 Ch. Finck
+  //     spacer: noryl Ch. Finck
+  //     panel sandwich: carbon, nomex, carbon replacing rohacell by nomex Ch. Finck
+
+  // G10: SiO2(60%) + C8H14O4(40%)
+  Float_t aglass[5] = {12.01, 28.09, 16., 1.01,  16.};
+  Float_t zglass[5] = { 6.,   14.,    8., 1.,    8.};
+  Float_t wglass[5] = { 0.22, 0.28, 0.32, 0.03,  0.15};
+  Float_t dglass    = 1.7;
 
   // rohacell: C9 H13 N1 O2
   Float_t arohac[4] = {12.01,  1.01, 14.010, 16.};
@@ -363,58 +366,78 @@ void AliMUONGeometryBuilder::CreateMaterials()
   Float_t wrohac[4] = { 9.,   13.,    1.,     2.};
   Float_t drohac    = 0.03;
 
-  fMUON->AliMaterial(31, "COPPER$",   63.54,    29.,   8.96,  1.4, 0.);
-  fMUON->AliMixture(32, "Vetronite$",aglass, zglass, dglass,    5, wglass);
-  fMUON->AliMaterial(33, "Carbon$",   12.01,     6.,  2.265, 18.8, 49.9);
-  fMUON->AliMixture(34, "Rohacell$", arohac, zrohac, drohac,   -4, wrohac); 
-
-   Float_t  epsil  = .001; // Tracking precision, 
-   Float_t  stemax = -1.;  // Maximum displacement for multiple scat 
-   Float_t  tmaxfd = -20.; // Maximum angle due to field deflection 
-   Float_t  deemax = -.3;  // Maximum fractional energy loss, DLS 
-   Float_t  stmin  = -.8;
-   Float_t  maxDestepAlu = fMUON->GetMaxDestepAlu();
-   Float_t  maxDestepGas = fMUON->GetMaxDestepGas();
-   Float_t  maxStepAlu = fMUON->GetMaxStepAlu();
-   Float_t  maxStepGas = fMUON->GetMaxStepGas();
-
-    //
-    //    Air 
-    fMUON->AliMedium(1, "AIR_CH_US         ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-    //
-    //    Aluminum 
-
-    fMUON->AliMedium(4, "ALU_CH_US          ", 9, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
-           maxDestepAlu, epsil, stmin);
-    fMUON->AliMedium(5, "ALU_CH_US          ", 10, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
-           maxDestepAlu, epsil, stmin);
-    //
-    //    Ar-isoC4H10 gas 
-
-    fMUON->AliMedium(6, "AR_CH_US          ", 20, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas, 
-           maxDestepGas, epsil, stmin);
-//
-    //    Ar-Isobuthane-Forane-SF6 gas 
-
-    fMUON->AliMedium(7, "GAS_CH_TRIGGER    ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
-
-    fMUON->AliMedium(8, "BAKE_CH_TRIGGER   ", 19, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
-           maxDestepAlu, epsil, stmin);
-
-    fMUON->AliMedium(9, "ARG_CO2   ", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas, 
-           maxDestepAlu, epsil, stmin);
-    // tracking media for slats: check the parameters!! 
-    fMUON->AliMedium(11, "PCB_COPPER        ", 31, 0, iSXFLD, sXMGMX, tmaxfd, 
-             maxStepAlu, maxDestepAlu, epsil, stmin);
-    fMUON->AliMedium(12, "VETRONITE         ", 32, 0, iSXFLD, sXMGMX, tmaxfd, 
-             maxStepAlu, maxDestepAlu, epsil, stmin);
-    fMUON->AliMedium(13, "CARBON            ", 33, 0, iSXFLD, sXMGMX, tmaxfd, 
-             maxStepAlu, maxDestepAlu, epsil, stmin);
-    fMUON->AliMedium(14, "Rohacell          ", 34, 0, iSXFLD, sXMGMX, tmaxfd, 
-             maxStepAlu, maxDestepAlu, epsil, stmin);
-
+  // Nomex: C22 H10 N2 O5
+  Float_t aNomex[4] = {12.01,  1.01, 14.010, 16.};
+  Float_t zNomex[4] = { 6.,    1.,    7.,     8.};
+  Float_t wNomex[4] = { 22.,   10.,   2.,     5.};
+  Float_t dNomex    = 0.024; //honey comb
+  Float_t dNomex2   = 1.43;  //bulk material
+
+
+  // Noryl: C8 H8 O polyphenylene oxyde (di-methyl not sure)
+  Float_t aNoryl[3] = {12.01,  1.01, 16.};
+  Float_t zNoryl[3] = { 6.,    1.,    8.};
+  Float_t wNoryl[3] = { 8.,    8.,    1.};
+  Float_t dNoryl    = 1.06;
+
+  fMUON->AliMaterial(31, "COPPER$",   63.54,    29.,   8.96,   1.4, 0.);
+  fMUON->AliMixture( 32, "G10$",      aglass, zglass, dglass, -5, wglass);
+  fMUON->AliMaterial(33, "Carbon$",   12.01,     6.,  2.265,  18.8, 49.9);
+  fMUON->AliMixture( 34, "Rohacell$", arohac, zrohac, drohac, -4, wrohac); 
+  fMUON->AliMixture( 35, "Nomex$",    aNomex, zNomex, dNomex, -4, wNomex); 
+  fMUON->AliMixture( 36, "Noryl$",    aNoryl, zNoryl, dNoryl, -3, wNoryl); 
+  fMUON->AliMixture( 37, "Nomex_bulk$",aNomex, zNomex, dNomex2, -4, wNomex); 
+
+  Float_t  epsil  = .001; // Tracking precision, 
+  Float_t  stemax = -1.;  // Maximum displacement for multiple scat 
+  Float_t  tmaxfd = -20.; // Maximum angle due to field deflection 
+  Float_t  deemax = -.3;  // Maximum fractional energy loss, DLS 
+  Float_t  stmin  = -.8;
+  Float_t  maxDestepAlu = fMUON->GetMaxDestepAlu();
+  Float_t  maxDestepGas = fMUON->GetMaxDestepGas();
+  Float_t  maxStepAlu = fMUON->GetMaxStepAlu();
+  Float_t  maxStepGas = fMUON->GetMaxStepGas();
 
+  //
+  //    Air 
+  fMUON->AliMedium(1, "AIR_CH_US         ", 15, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
+  //
+  //    Aluminum 
+  fMUON->AliMedium(4, "ALU_CH_US          ", 9, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
+                  maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(5, "ALU_CH_US          ", 10, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
+                  maxDestepAlu, epsil, stmin);
+  //
+  //    Ar-isoC4H10 gas 
+  fMUON->AliMedium(6, "AR_CH_US          ", 20, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas, 
+                  maxDestepGas, epsil, stmin);
+  //
+  //    Ar-Isobuthane-Forane-SF6 gas 
+  fMUON->AliMedium(7, "GAS_CH_TRIGGER    ", 21, 1, iSXFLD, sXMGMX, tmaxfd, stemax, deemax, epsil, stmin);
 
+  fMUON->AliMedium(8, "BAKE_CH_TRIGGER   ", 19, 0, iSXFLD, sXMGMX, tmaxfd, maxStepAlu, 
+                  maxDestepAlu, epsil, stmin);
+  //
+  // slat medium
+  fMUON->AliMedium(9, "ARG_CO2   ", 22, 1, iSXFLD, sXMGMX, tmaxfd, maxStepGas, 
+                  maxDestepAlu, epsil, stmin);
+  //
+  // tracking media for slats: check the parameters!! 
+  fMUON->AliMedium(11, "PCB_COPPER        ", 31, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(12, "G10               ", 32, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(13, "CARBON            ", 33, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(14, "Rohacell          ", 34, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(15, "Nomex             ", 35, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(16, "Noryl             ", 36, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
+  fMUON->AliMedium(17, "Nomex bulk        ", 37, 0, iSXFLD, sXMGMX, tmaxfd, 
+                  maxStepAlu, maxDestepAlu, epsil, stmin);
   //.Materials specific to stations
   // created via builders
   
index 715e7b6..22fa022 100644 (file)
@@ -27,7 +27,7 @@
 #include "AliMUON.h"
 #include "AliMUONChamber.h"
 #include "AliRun.h"
-
+#include "AliMUONConstants.h"
 //___________________________________________
 ClassImp(AliMUONSegmentationSlat)
 
@@ -85,7 +85,6 @@ AliMUONSegmentationSlat::operator=(const AliMUONSegmentationSlat& rhs)
   return *this;  
 }    
           
-
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
 {
@@ -94,6 +93,7 @@ void AliMUONSegmentationSlat::SetPadSize(Float_t p1, Float_t p2)
     fDpx=p1;
     fDpy=p2;
 }
+
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::GetAnod(Float_t xhit) const
 {
@@ -101,20 +101,23 @@ Float_t AliMUONSegmentationSlat::GetAnod(Float_t xhit) const
     Float_t wire= (xhit>0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5;
     return fWireD*wire;
 }
+
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::GetNParallelAndOffset(Int_t /*iX*/, Int_t /*iY*/, Int_t *Nparallel, Int_t *Offset) 
 {
-  *Nparallel=1;
-  *Offset=0;
+  *Nparallel = 1;
+  *Offset = 0;
 }
 //-----------------------------------------------------------
 void AliMUONSegmentationSlat::GiveTestPoints(Int_t & /*n*/, Float_t */*x*/, Float_t */*y*/)  const 
 {;}
+
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::Distance2AndOffset(Int_t /*iX*/, Int_t /*iY*/, Float_t /*X*/, Float_t /*Y*/, Int_t * /*dummy*/) 
 {
   return 0.;
 }
+
 //-----------------------------------------------------------
 Float_t AliMUONSegmentationSlat::Dpx(Int_t isec) const
 {
@@ -142,8 +145,8 @@ void AliMUONSegmentationSlat::SetPadDivision(Int_t ndiv[4])
 // Pad sizes are defined as integral fractions ndiv of a basis pad size
 // fDpx
 // 
-    for (Int_t i=0; i<4; i++) {
-       (*fNDiv)[i]=ndiv[i];
+    for (Int_t i = 0; i < 4; i++) {
+       (*fNDiv)[i] = ndiv[i];
     }
 }
 
@@ -155,7 +158,7 @@ void AliMUONSegmentationSlat::GlobalToLocal(
 //
     Float_t zlocal;
     Int_t i;
-    Int_t index=-1;
+    Int_t index = -1;
     Float_t eps = 1.e-4;
     
 // Transform According to slat plane z-position: negative side is shifted down 
@@ -164,32 +167,37 @@ void AliMUONSegmentationSlat::GlobalToLocal(
     zlocal = z-fChamber->Z();
 
 //     zlocal = (x>0) ? zlocal-2.*fDz : zlocal+2.*fDz;
-    zlocal = (x>0) ? zlocal+2.*fDz : zlocal-2.*fDz;      //Change?
+//      zlocal = (x>0) ? zlocal+2.*fDz : zlocal-2.*fDz;      //Change?
+
+
+  
 
 //  Set the signs for the symmetry transformation and transform to first quadrant
     SetSymmetry(x);
-    Float_t xabs=TMath::Abs(x);
+    Float_t xabs = TMath::Abs(x);
 
 
 // Find slat number                      
-    for (i=0; i<fNSlats; i+=1) {       //Loop on all slats (longuer but more secure)
-       index=i;
+    for (i = 0; i < fNSlats; i++) {       //Loop on all slats (longuer but more secure)
+       index = i;
        if ((y >= fYPosition[i]-eps) && (y <= fYPosition[i]+fSlatY+eps)) break;
     }
-    
+
 //
 // Transform to local coordinate system
 
     
     if (index >= fNSlats || index < 0 ) {
-      islat = -1; xlocal=-1; ylocal = -1; }
-    else {
-      ylocal = y   -fYPosition[index];
-      xlocal = xabs-fXPosition[index];
+      islat  = -1; 
+      xlocal = -1; 
+      ylocal = -1; 
+    } else {
       islat  = index;
+      xlocal = xabs - fXPosition[index];
+      ylocal = y    - fYPosition[index];
     }
 }
-
+//_________________________________________________
 void AliMUONSegmentationSlat::GlobalToLocal(
     Int_t ix, Int_t iy, Int_t &islat, Int_t &ixlocal, Int_t &iylocal) const
 {
@@ -214,6 +222,7 @@ void AliMUONSegmentationSlat::GlobalToLocal(
     islat=index;
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 LocalToGlobal(Int_t islat, Float_t  xlocal, Float_t  ylocal, Float_t  &x, Float_t  &y, Float_t &z) const
 {
@@ -225,16 +234,21 @@ LocalToGlobal(Int_t islat, Float_t  xlocal, Float_t  ylocal, Float_t  &x, Float_
 // lower plane (y<0)  odd slat number is shifted down
 //
 
-    x = (xlocal+fXPosition[islat])*fSym;
-    y=(ylocal+fYPosition[islat]);
+    x = (xlocal + fXPosition[islat])*fSym;
+    y = (ylocal + fYPosition[islat]);
 
-    z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
-    z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
+//     z = (TMath::Even(islat)) ?     fDz : -fDz ; //Change for new referential
+//     z = (x>0)                ? z+2.*fDz : z-2.*fDz ; 
+//     z+=fChamber->Z();
 
-    z+=fChamber->Z();
-}
+// z-position
+    z = (TMath::Even(islat)) ?      -fDzSlat : fDzSlat ; //Change for new referential
+    z = (x>0)                ?  -z + fDzCh : z - fDzCh; 
+    z += fChamber->Z();
 
+}
 
+//_________________________________________________
 void AliMUONSegmentationSlat::LocalToGlobal (
     Int_t islat, Int_t ixlocal, Int_t iylocal, Int_t &ix, Int_t &iy) const
 {
@@ -251,19 +265,21 @@ void AliMUONSegmentationSlat::LocalToGlobal (
     iy=iy;
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::SetSymmetry(Int_t   ix)
 {
 // Set set signs for symmetry transformation
-    fSym=TMath::Sign(1,ix);
+    fSym = TMath::Sign(1,ix);
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::SetSymmetry(Float_t  x)
 {
 // Set set signs for symmetry transformation
-    fSym=Int_t (TMath::Sign((Float_t)1.,x));
+    fSym = Int_t (TMath::Sign((Float_t)1.,x));
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 GetPadI(Float_t x, Float_t y, Float_t z, Int_t &ix, Int_t &iy)
 {
@@ -274,16 +290,17 @@ GetPadI(Float_t x, Float_t y, Float_t z, Int_t &ix, Int_t &iy)
     
     GlobalToLocal(x,y,z,islat,xlocal,ylocal);
     if (islat == -1) {
-       ix=0; iy=0; return;
+       ix = 0; iy = 0; 
+       return;
     }
     
     Slat(islat)->GetPadI(xlocal, ylocal, ix, iy);
-    for (i=0; i<islat; i++) iy+=Slat(islat)->Npy();
+    for (i = 0; i < islat; i++) iy += Slat(islat)->Npy();
 
-    ix=ix*Int_t(TMath::Sign((Float_t)1.,x));    
+    ix = ix*Int_t(TMath::Sign((Float_t)1.,x));    
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::
 GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
 {
@@ -295,18 +312,19 @@ GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y, Float_t &z)
     GlobalToLocal(ix,iy,islat,ixlocal,iylocal);
     Slat(islat)->GetPadC(ixlocal, iylocal, x, y);
 // Slat offset
-    x+=fXPosition[islat];
-    y+=fYPosition[islat];    
+    x += fXPosition[islat];
+    y += fYPosition[islat];    
 
 // Symmetry transformation of half planes
-    x=x*TMath::Sign(1,ix);
+    x = x * TMath::Sign(1,ix);
 
 // z-position
-    z = (TMath::Even(islat)) ?      fDz : -fDz ; //Change for new referential
-    z = (x>0)                ?  z+2.*fDz : z-2.*fDz ; 
+    z  = (TMath::Even(islat)) ?      -fDzSlat : fDzSlat ; //Change for new referential
+    z  = (x>0)                ?  -z + fDzCh : z - fDzCh; 
     z += fChamber->Z();
 }
 
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::ISector()
 {
 // Returns current sector during tracking
@@ -316,6 +334,7 @@ Int_t AliMUONSegmentationSlat::ISector()
     return 100*fSlatIndex+iregion;
 }
 
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::Sector(Int_t ix, Int_t iy)
 {
 // Returns sector for pad coordiantes (ix,iy)
@@ -327,7 +346,7 @@ Int_t AliMUONSegmentationSlat::Sector(Int_t ix, Int_t iy)
     return 100*islat+iregion;
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::SetPad(Int_t ix, Int_t iy)
 {
     //
@@ -343,6 +362,7 @@ void AliMUONSegmentationSlat::SetPad(Int_t ix, Int_t iy)
     fCurrentSlat->SetPad(ixlocal, iylocal);
 }
 
+//_________________________________________________
 void  AliMUONSegmentationSlat::SetHit(Float_t xhit, Float_t yhit, Float_t zhit)
 {   //
     // Sets current hit coordinates
@@ -360,7 +380,7 @@ void  AliMUONSegmentationSlat::SetHit(Float_t xhit, Float_t yhit, Float_t zhit)
     fCurrentSlat->SetHit(xlocal, ylocal);
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::
 FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy)
 {
@@ -379,7 +399,7 @@ FirstPad(Float_t xhit, Float_t yhit, Float_t zhit, Float_t dx, Float_t dy)
 
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::NextPad()
 {
 // Stepper for the iteration over pads
@@ -387,7 +407,7 @@ void AliMUONSegmentationSlat::NextPad()
     fCurrentSlat->NextPad();
 }
 
-
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::MorePads()
 // Stopping condition for the iterator over pads
 //
@@ -396,6 +416,7 @@ Int_t AliMUONSegmentationSlat::MorePads()
     return fCurrentSlat->MorePads();
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
 {
@@ -406,6 +427,7 @@ IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)
 
 }
 
+//_________________________________________________
 void AliMUONSegmentationSlat::
 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 {
@@ -423,7 +445,7 @@ Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
 
 }
 
-
+//_________________________________________________
 Int_t  AliMUONSegmentationSlat::Ix()
 {
 // Return current pad coordinate ix during stepping
@@ -440,7 +462,7 @@ Int_t  AliMUONSegmentationSlat::Ix()
     return ix;
 }
 
-
+//_________________________________________________
 Int_t  AliMUONSegmentationSlat::Iy()
 {
 // Return current pad coordinate iy during stepping
@@ -451,11 +473,10 @@ Int_t  AliMUONSegmentationSlat::Iy()
     return iy;
 }
 
-
-
-   // Signal Generation Condition during Stepping
+//_________________________________________________
 Int_t AliMUONSegmentationSlat::SigGenCond(Float_t x, Float_t y, Float_t z)
 { 
+ // Signal Generation Condition during Stepping
 //
 //  True if signal generation condition fullfilled
     Float_t xlocal, ylocal;
@@ -464,9 +485,10 @@ Int_t AliMUONSegmentationSlat::SigGenCond(Float_t x, Float_t y, Float_t z)
     return Slat(islat)->SigGenCond(xlocal, ylocal, z);
 }
 
-// Initialise signal generation at coord (x,y,z)
+//_________________________________________________
 void  AliMUONSegmentationSlat::SigGenInit(Float_t x, Float_t y, Float_t z)
 {
+
 // Initialize the signal generation condition
 //
     Float_t xlocal, ylocal;
@@ -476,8 +498,7 @@ void  AliMUONSegmentationSlat::SigGenInit(Float_t x, Float_t y, Float_t z)
     Slat(islat)->SigGenInit(xlocal, ylocal, z);
 }
 
-
-
+//_________________________________________________
 void AliMUONSegmentationSlat::Init(Int_t chamber)
 {
 //    
@@ -492,12 +513,15 @@ void AliMUONSegmentationSlat::Init(Int_t chamber)
     Int_t ndiv[4];
 // Pad division
     for (i=0; i<4; i++) ndiv[i]=(*fNDiv)[i];
-//
-    fDz=0.813;
+
 // Slat height    
     fSlatY=40.;
     for (i=0; i<15; i++) fSlatX[i]=0.;
-    
+// shifts in z direction
+     fDzSlat = AliMUONConstants::DzSlat();
+     fDzCh   = AliMUONConstants::DzCh();
 // Initialize array of slats 
     fSlats  = new TObjArray(fNSlats);
 // Maximum number of strips (pads) in x and y
@@ -521,7 +545,7 @@ void AliMUONSegmentationSlat::Init(Int_t chamber)
 // Initialize slat module
        slat->Init(chamber);
 // y-position of slat module relative to the first (closest to the beam)
-       fYPosition[islat]= fYPosOrigin+islat*(fSlatY-2.*fShift);
+//     fYPosition[islat]= fYPosOrigin+islat*(fSlatY-2.*fShift);
 //
        fNpy+=slat->Npy();
        if (slat->Npx() > fNpx) fNpx=slat->Npx();
@@ -538,10 +562,7 @@ void AliMUONSegmentationSlat::Init(Int_t chamber)
     fId=chamber;
 }
 
-
-
-
-
+//_________________________________________________
 void AliMUONSegmentationSlat::SetNPCBperSector(Int_t *npcb)
 { 
     //  PCB distribution for station 4 (6 rows with 1+3 segmentation regions)
@@ -553,18 +574,28 @@ void AliMUONSegmentationSlat::SetNPCBperSector(Int_t *npcb)
     }
 }
 
-
+//_________________________________________________
 void  AliMUONSegmentationSlat::SetSlatXPositions(Float_t *xpos)
 {
 // Set x-positions of Slats
     for (Int_t islat=0; islat<fNSlats; islat++) fXPosition[islat]=xpos[islat];
 }
 
+//_________________________________________________
+void  AliMUONSegmentationSlat::SetSlatYPositions(Float_t *ypos)
+{
+// Set y-positions of Slats
+    for (Int_t islat=0; islat<fNSlats; islat++) fYPosition[islat]=ypos[islat];
+}
+
+//_________________________________________________
 AliMUONSegmentationSlatModule*  AliMUONSegmentationSlat::Slat(Int_t index) const
   //PH { return ((AliMUONSegmentationSlatModule*) (*fSlats)[index]);}
-{ return ((AliMUONSegmentationSlatModule*) fSlats->At(index));}
-
+{ 
+  return ((AliMUONSegmentationSlatModule*) fSlats->At(index));
+}
 
+//_________________________________________________
 AliMUONSegmentationSlatModule* AliMUONSegmentationSlat::
 CreateSlatModule() const
 {
@@ -572,11 +603,11 @@ CreateSlatModule() const
     return new AliMUONSegmentationSlatModule(4);
 }
 
-
+//_________________________________________________
 void AliMUONSegmentationSlat::Draw(const char* opt)
 {
-// Draw method for event display
-// 
+  // Draw method for event display
+  // 
   if (!strcmp(opt,"eventdisplay")) { 
     const int kColorMUON1 = kYellow;
     const int kColorMUON2 = kBlue; 
@@ -588,9 +619,9 @@ void AliMUONSegmentationSlat::Draw(const char* opt)
     
     //
     // Number of modules per slat
-    for (i=0; i<fNSlats; i++) {
-      npcb[i]=0;
-      for (j=0; j<4; j++) npcb[i]+=fPcb[i][j];
+    for (i = 0; i < fNSlats; i++) {
+      npcb[i] = 0;
+      for (j = 0; j < 4; j++) npcb[i] += fPcb[i][j];
     }  
     //
     TNode* top=gAlice->GetGeometry()->GetNode("alice");
@@ -606,25 +637,24 @@ void AliMUONSegmentationSlat::Draw(const char* opt)
     TNode* nodeSlat;
     Int_t color;
     
-    for (j=0; j<fNSlats; j++)
-      {
-       sprintf(nameSlat,"SLAT%d",100*fId+1+j);
-       Float_t dx = 20.*npcb[j];
-       Float_t dy = 20;
-       new TBRIK(nameSlat,"Slat Module","void",dx,20.,0.25);
-       node->cd();
-       color =  TMath::Even(j) ? kColorMUON1 : kColorMUON2;
+    for (j = 0; j < fNSlats; j++) {
+      sprintf(nameSlat,"SLAT%d",100*fId+1+j);
+      Float_t dx = 20.*npcb[j];
+      Float_t dy = 20;
+      new TBRIK(nameSlat,"Slat Module","void",dx,20.,0.25);
+      node->cd();
+      color =  TMath::Even(j) ? kColorMUON1 : kColorMUON2;
        
-       sprintf(nameNode,"SLAT%d",100*fId+1+j);
-       nodeSlat = 
-         new TNode(nameNode,"Slat Module",nameSlat, dx+fXPosition[j],fYPosition[j]+dy,0,"");
-       nodeSlat->SetLineColor(color);
-       node->cd();
-       sprintf(nameNode,"SLAT%d",100*fId+1+j+fNSlats);
-       nodeSlat = 
-         new TNode(nameNode,"Slat Module",nameSlat,-dx-fXPosition[j],fYPosition[j]+dy,0,"");
-       nodeSlat->SetLineColor(color);
-      }
+      sprintf(nameNode,"SLAT%d",100*fId+1+j);
+      nodeSlat = 
+       new TNode(nameNode,"Slat Module",nameSlat, dx+fXPosition[j],fYPosition[j]+dy,0,"");
+      nodeSlat->SetLineColor(color);
+      node->cd();
+      sprintf(nameNode,"SLAT%d",100*fId+1+j+fNSlats);
+      nodeSlat = 
+       new TNode(nameNode,"Slat Module",nameSlat,-dx-fXPosition[j],fYPosition[j]+dy,0,"");
+      nodeSlat->SetLineColor(color);
+    }
   }
 }
 
index b63991b..2082a92 100644 (file)
@@ -112,7 +112,7 @@ class AliMUONSegmentationSlat : public AliSegmentation
     virtual void SetShift(Float_t shift) {fShift = shift;}
     virtual void SetNPCBperSector(Int_t *npcb);
     virtual void SetSlatXPositions(Float_t *xpos);
-    virtual void SetSlatYPosition(Float_t ypos) {fYPosOrigin = ypos;}    
+    virtual void SetSlatYPositions(Float_t *ypos);    
     virtual AliMUONSegmentationSlatModule* Slat(Int_t index) const;
     
 // Not used
@@ -167,15 +167,16 @@ class AliMUONSegmentationSlat : public AliSegmentation
     Int_t      fNpy;                              // maximum number of pads in y
     Int_t      fSym;                              // signs for symmetry trafo
     Float_t    fShift;                            // Half overlap of pad planes
-    Float_t    fDz;                               // Half distance between slat planes
-    
+    Float_t    fDzSlat;                           // Half distance between slat planes
+    Float_t    fDzCh;                             // Half distance between half-chamber planes
+
     TArrayI*    fNDiv;                             // Pad size division
     // Slats
     TObjArray*  fSlats;                            // Array of Slats
     // Proxy data
     AliMUONSegmentationSlatModule* fCurrentSlat;   // Pointer to current slat
     Int_t       fSlatIndex;                        // Current slat index
-    ClassDef(AliMUONSegmentationSlat,1)            // Segmentation for Muon Chamber built from Slat Modules
+    ClassDef(AliMUONSegmentationSlat,2)            // Segmentation for Muon Chamber built from Slat Modules
 };
        
 
index fd8ac62..d600f5b 100644 (file)
 #include "AliMUONChamber.h"
 #include "AliMUONChamberGeometry.h"
 #include "AliMUONGeometryEnvelopeStore.h"
+#include "AliMUONConstants.h"
 #include "AliRun.h"
 
 ClassImp(AliMUONSlatGeometryBuilder)
 
-//Int_t   ConvertSlatNum(Int_t numslat, Int_t quadnum, Int_t fspq);
 
 //______________________________________________________________________________
 AliMUONSlatGeometryBuilder::AliMUONSlatGeometryBuilder(AliMUON* muon)
@@ -86,968 +86,1030 @@ AliMUONSlatGeometryBuilder::operator = (const AliMUONSlatGeometryBuilder& rhs)
 //______________________________________________________________________________
 void AliMUONSlatGeometryBuilder::CreateGeometry()
 {
-// CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
-// It includes description and placements of support panels and slats.
-// The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning 
-// the use of Enveloppe method to place the Geant volumes.
-// Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters, 
-// and this builder would then be dedicated only to the
-// placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
+  // CreateGeometry is the method containing all the informations concerning Stations 345 geometry.
+  // It includes description and placements of support panels and slats.
+  // The code comes directly from what was written in AliMUONv1.cxx before, with modifications concerning 
+  // the use of Enveloppe method to place the Geant volumes.
+  // Now, few changes would allow the creation of a Slat methode where slat could be described by few parameters, 
+  // and this builder would then be dedicated only to the
+  // placements of the slats. Those modifications could shorten the Station 345 geometry by a non-negligeable factor...
  
-     Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
-
-     Float_t angle;
-     Float_t *dum=0;
-
-      // define the id of tracking media:
-     Int_t idCopper = idtmed[1110];
-     Int_t idGlass  = idtmed[1111];
-     Int_t idCarbon = idtmed[1112];
-     Int_t idRoha   = idtmed[1113];
-     Int_t idGas    = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
-     Int_t idAir    = idtmed[1100]; // medium 1
-
-      // sensitive area: 40*40 cm**2
-     const Float_t kSensLength = 40.; 
-     const Float_t kSensHeight = 40.; 
-     const Float_t kSensWidth  = 0.5; // according to TDR fig 2.120 
-     const Int_t kSensMaterial = idGas;
-     const Float_t kYoverlap   = 1.5; 
-
-     // PCB dimensions in cm; width: 30 mum copper   
-     const Float_t kPcbLength  = kSensLength; 
-     const Float_t kPcbHeight  = 60.; 
-     const Float_t kPcbWidth   = 0.003;   
-     const Int_t kPcbMaterial  = idCopper;
-
-     // Insulating material: 200 mum glass fiber glued to pcb  
-     const Float_t kInsuLength = kPcbLength; 
-     const Float_t kInsuHeight = kPcbHeight; 
-     const Float_t kInsuWidth  = 0.020;   
-     const Int_t kInsuMaterial = idGlass;
-
-     // Carbon fiber panels: 200mum carbon/epoxy skin   
-     const Float_t kPanelLength = kSensLength; 
-     const Float_t kPanelHeight = kSensHeight; 
-     const Float_t kPanelWidth  = 0.020;      
-     const Int_t kPanelMaterial = idCarbon;
-
-     // rohacell between the two carbon panels   
-     const Float_t kRohaLength = kSensLength; 
-     const Float_t kRohaHeight = kSensHeight; 
-     const Float_t kRohaWidth  = 0.5;
-     const Int_t kRohaMaterial = idRoha;
-
-     // Frame around the slat: 2 sticks along length,2 along height  
-     // H: the horizontal ones 
-     const Float_t kHframeLength = kPcbLength; 
-     const Float_t kHframeHeight = 1.5; 
-     const Float_t kHframeWidth  = kSensWidth; 
-     const Int_t kHframeMaterial = idGlass;
-
-     // V: the vertical ones 
-     const Float_t kVframeLength = 4.0; 
-     const Float_t kVframeHeight = kSensHeight + kHframeHeight; 
-     const Float_t kVframeWidth  = kSensWidth;
-     const Int_t kVframeMaterial = idGlass;
-
-     // B: the horizontal border filled with rohacell 
-     const Float_t kBframeLength = kHframeLength; 
-     const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight; 
-     const Float_t kBframeWidth  = kHframeWidth;
-     const Int_t kBframeMaterial = idRoha;
-
-     // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper)
-     const Float_t kNulocLength = 2.5; 
-     const Float_t kNulocHeight = 7.5; 
-     const Float_t kNulocWidth  = 0.0030 + 0.0014; // equivalent copper width of vetronite; 
-     const Int_t   kNulocMaterial = idCopper;
-
-     const Float_t kSlatHeight = kPcbHeight; 
-     const Float_t kSlatWidth = kSensWidth + 2.*(kPcbWidth + kInsuWidth + 
-                                              2.* kPanelWidth + kRohaWidth);
-     const Int_t kSlatMaterial = idAir;
-     const Float_t kDslatLength = 2.5;//kVframeLength; // border on left and right 
-
-     Float_t spar[3];  
-     Int_t i, j;
-     Int_t detElemId;
-
-     // the panel volume contains the rohacell
-
-     Float_t twidth = 2 * kPanelWidth + kRohaWidth; 
-     Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., twidth/2. }; 
-     Float_t rohapar[3] = { kRohaLength/2., kRohaHeight/2., kRohaWidth/2. }; 
-
-     // insulating material contains PCB-> gas-> 2 borders filled with rohacell
-
-     twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth;  
-     Float_t insupar[3] = { kInsuLength/2., kInsuHeight/2., twidth/2. }; 
-     twidth -= 2 * kInsuWidth; 
-     Float_t pcbpar[3] = { kPcbLength/2., kPcbHeight/2., twidth/2. }; 
-     Float_t senspar[3] = { kSensLength/2., kSensHeight/2., kSensWidth/2. }; 
-     Float_t theight = 2*kHframeHeight + kSensHeight;
-     Float_t hFramepar[3]={kHframeLength/2., theight/2., kHframeWidth/2.}; 
-     Float_t bFramepar[3]={kBframeLength/2., kBframeHeight/2., kBframeWidth/2.}; 
-     Float_t vFramepar[3]={kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
-     Float_t nulocpar[3]={kNulocLength/2., kNulocHeight/2., kNulocWidth/2.}; 
-     Float_t xx;
-     Float_t xxmax = (kBframeLength - kNulocLength)/2.; 
-     Int_t index=0;
+  Int_t *idtmed = fMUON->GetIdtmed()->GetArray()-1099;
+
+  Float_t angle;
+  Float_t *dum=0;
+
+  // define the id of tracking media:
+  Int_t idAir    = idtmed[1100]; // medium 1
+  Int_t idGas    = idtmed[1108]; // medium 9 = Ar-CO2 gas (80%+20%)
+  Int_t idCopper = idtmed[1110];
+  Int_t idG10    = idtmed[1111];
+  Int_t idCarbon = idtmed[1112];
+  Int_t idRoha   = idtmed[1113];
+  Int_t idNomex  = idtmed[1114]; // honey comb
+  Int_t idNoryl  = idtmed[1115]; 
+  Int_t idNomexB = idtmed[1116]; // bulk material 
+
+  // sensitive area: 40*40 cm**2
+  const Float_t kSensLength = 40.; 
+  const Float_t kSensHeight = 40.; 
+  const Float_t kSensWidth  = 0.5; // according to TDR fig 2.120 
+  const Int_t kSensMaterial = idGas;
+  //     const Float_t kYoverlap   = 1.5; 
+
+  // PCB dimensions in cm; width: 30 mum copper   
+  const Float_t kPcbLength  = kSensLength; 
+  const Float_t kPcbHeight  = 58.; // updated Ch. Finck 
+  const Float_t kPcbWidth   = 0.003; 
+  const Int_t kPcbMaterial  = idCopper;
+
+  // Insulating material: 220 mum G10 fiber  glued to pcb  
+  const Float_t kInsuLength = kPcbLength; 
+  const Float_t kInsuHeight = kPcbHeight; 
+  const Float_t kInsuWidth  = 0.022;  // updated Ch. Finck 
+  const Int_t kInsuMaterial = idG10;
+
+  // Carbon fiber panels: 200mum carbon/epoxy skin   
+  const Float_t kCarbonWidth  = 0.020;      
+  const Int_t kCarbonMaterial = idCarbon;
+
+  // Nomex (honey comb) between the two panel carbon skins    
+  const Float_t kNomexLength = kSensLength; 
+  const Float_t kNomexHeight = kSensHeight; 
+  const Float_t kNomexWidth  = 0.8; // updated Ch. Finck 
+  const Int_t kNomexMaterial = idNomex;
+  // Bulk Nomex under panel sandwich Ch. Finck    
+  const Float_t kNomexBWidth  = 0.025; 
+  const Int_t kNomexBMaterial = idNomexB;
+
+  // Panel sandwich 0.02 carbon*2 + 0.8 nomex     
+  const Float_t kPanelLength = kSensLength; 
+  const Float_t kPanelHeight = kSensHeight; 
+  const Float_t kPanelWidth  = 2 * kCarbonWidth + kNomexWidth;
+
+  // spacer around the slat: 2 sticks along length,2 along height  
+  // H: the horizontal ones 
+  const Float_t kHframeLength = kPcbLength; 
+  const Float_t kHframeHeight = 1.95; // updated Ch. Finck 
+  const Float_t kHframeWidth  = kSensWidth; 
+  const Int_t kHframeMaterial = idNoryl;
+
+  // V: the vertical ones; vertical spacers 
+  const Float_t kVframeLength = 2.5; 
+  const Float_t kVframeHeight = kSensHeight + kHframeHeight; 
+  const Float_t kVframeWidth  = kSensWidth;
+  const Int_t kVframeMaterial = idNoryl;
+
+  // B: the horizontal border filled with rohacell: ok Ch. Finck
+  const Float_t kBframeLength = kHframeLength; 
+  const Float_t kBframeHeight = (kPcbHeight - kSensHeight)/2. - kHframeHeight; 
+  const Float_t kBframeWidth  = kHframeWidth;
+  const Int_t kBframeMaterial = idRoha;
+
+  // NULOC: 30 mum copper + 200 mum vetronite (same radiation length as 14mum copper) for electronics
+  const Float_t kNulocLength   = 2.5; 
+  const Float_t kNulocHeight   = kBframeHeight;
+  const Float_t kNulocWidth    = 0.0030 + 0.0014; // equivalent copper width of vetronite; 
+  const Int_t   kNulocMaterial = idCopper;
+
+  // Slat parameters
+  const Float_t kSlatHeight = kPcbHeight; 
+  const Float_t kSlatWidth  = kSensWidth + 2.*(kPcbWidth + kInsuWidth + kPanelWidth 
+                                              + kNomexBWidth); //replaced rohacell with Nomex Ch. Finck 
+  const Int_t   kSlatMaterial = idAir;
+  const Float_t kDslatLength  = -1.25; // position of the slat respect to the beam plane (half vertical spacer) Ch. Finck
+  Float_t zSlat               = AliMUONConstants::DzSlat();// implemented Ch. Finck
+  Float_t dzCh                = AliMUONConstants::DzCh();
+
+  Float_t spar[3];  
+  Int_t i, j;
+  Int_t detElemId;
+
+  // the panel volume contains the nomex
+  Float_t panelpar[3] = { kPanelLength/2., kPanelHeight/2., kPanelWidth/2. }; 
+  Float_t nomexpar[3] = { kNomexLength/2., kNomexHeight/2., kNomexWidth/2. }; 
+  Float_t twidth =  kPanelWidth +  kNomexBWidth; 
+  Float_t nomexbpar[3] = {kNomexLength/2., kNomexHeight/2.,twidth/2. };// bulk nomex 
+
+  // insulating material contains PCB-> gas   
+  twidth = 2*(kInsuWidth + kPcbWidth) + kSensWidth ; 
+  Float_t insupar[3] = {kInsuLength/2., kInsuHeight/2., twidth/2. }; 
+  twidth -= 2 * kInsuWidth; 
+  Float_t pcbpar[3]  = {kPcbLength/2., kPcbHeight/2., twidth/2. }; 
+  Float_t senspar[3] = {kSensLength/2., kSensHeight/2., kSensWidth/2. }; 
+  Float_t theight    = 2 * kHframeHeight + kSensHeight;
+  Float_t hFramepar[3] = {kHframeLength/2., theight/2., kHframeWidth/2.}; 
+  Float_t bFramepar[3] = {kBframeLength/2., kBframeHeight/2., kBframeWidth/2.}; 
+  Float_t vFramepar[3] = {kVframeLength/2., kVframeHeight/2., kVframeWidth/2.};
+  Float_t nulocpar[3]  = {kNulocLength/2.,  kNulocHeight/2.,  kNulocWidth/2.}; 
+
+  Float_t xx;
+  Float_t xxmax = (kBframeLength - kNulocLength)/2.; 
+  Int_t index=0;
       
-    AliMUONChamber *iChamber, *iChamber1, *iChamber2;
-
-    Int_t* fStations = new Int_t[5];
-    for (Int_t i=0; i<5; i++) fStations[i] = 1;
-    fStations[2] = 1;
+  AliMUONChamber *iChamber, *iChamber1, *iChamber2;
 
-    if (fStations[2])
+  Int_t* fStations = new Int_t[5];
+  for (Int_t i=0; i<5; i++) fStations[i] = 1;
+  fStations[4] = 1;
+     
+  if (fStations[2])
     {
-//********************************************************************
-//                            Station 3                             **
-//********************************************************************
-     // indices 1 and 2 for first and second chambers in the station
-     // iChamber (first chamber) kept for other quanties than Z,
-     // assumed to be the same in both chambers
-
-     iChamber = GetChamber(4);
-     iChamber1 = iChamber;
-     iChamber2 = GetChamber(5);
+      //********************************************************************
+       //                            Station 3                             **
+       //********************************************************************
+       // indices 1 and 2 for first and second chambers in the station
+       // iChamber (first chamber) kept for other quanties than Z,
+       // assumed to be the same in both chambers
+
+       iChamber = GetChamber(4);
+      iChamber1 = iChamber;
+      iChamber2 = GetChamber(5);
      
-     //iChamber1->GetGeometry()->SetDebug(kTRUE);
-     //iChamber2->GetGeometry()->SetDebug(kTRUE);
-
-     if (gAlice->GetModule("DIPO")) {
-       // if DIPO is preset, the whole station will be placed in DDIP volume
-       iChamber1->GetGeometry()->SetMotherVolume("DDIP");
-       iChamber2->GetGeometry()->SetMotherVolume("DDIP");
-     }
-
-
-     // volumes for slat geometry (xx=5,..,10 chamber id): 
-     // Sxx0 Sxx1 Sxx2 Sxx3  -->   Slat Mother volumes 
-     // SxxG                          -->   Sensitive volume (gas)
-     // SxxP                          -->   PCB (copper) 
-     // SxxI                          -->   Insulator (vetronite) 
-     // SxxC                          -->   Carbon panel 
-     // SxxR                          -->   Rohacell
-     // SxxH, SxxV                    -->   Horizontal and Vertical frames (vetronite)
-     // SB5x                          -->   Volumes for the 35 cm long PCB
-     // slat dimensions: slat is a MOTHER volume!!! made of air
-
-     // only for chamber 5: slat 1 has a PCB shorter by 5cm!
-
-     Float_t tlength = 35.;
-     Float_t panelpar2[3]  = { tlength/2., panelpar[1],  panelpar[2]}; 
-     Float_t rohapar2[3]   = { tlength/2., rohapar[1],   rohapar[2]}; 
-     Float_t insupar2[3]   = { tlength/2., insupar[1],   insupar[2]}; 
-     Float_t pcbpar2[3]    = { tlength/2., pcbpar[1],    pcbpar[2]}; 
-     Float_t senspar2[3]   = { tlength/2., senspar[1],   senspar[2]}; 
-     Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]}; 
-     Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]}; 
-     Float_t *dum=0;
-     Float_t pcbDLength3   = (kPcbLength - tlength);
-
-     const Int_t kNslats3 = 5;  // number of slats per quadrant
-     const Int_t kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
-     const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
-     Float_t slatLength3[kNslats3]; 
-
-     // create and position the slat (mother) volumes 
-
-     char idSlatCh5[5];
-     char idSlatCh6[5];
-     Float_t xSlat3;
-     Float_t ySlat3;
-     Float_t angle = 0.;
-     Float_t spar2[3];
-     for (i = 0; i < kNslats3; i++){
-       slatLength3[i] = kPcbLength * kNPCB3[i] + 2. * kDslatLength; 
-       xSlat3 = slatLength3[i]/2. + kVframeLength/2. + kXpos3[i]; 
-       ySlat3 = kSensHeight * i - kYoverlap * i; 
-       spar[0] = slatLength3[i]/2.; 
-       spar[1] = kSlatHeight/2.;
-       spar[2] = kSlatWidth/2. * 1.01; 
-       // take away 5 cm from the first slat in chamber 5
+      //iChamber1->GetGeometry()->SetDebug(kTRUE);
+      //iChamber2->GetGeometry()->SetDebug(kTRUE);
+
+      if (gAlice->GetModule("DIPO")) {
+       // if DIPO is preset, the whole station will be placed in DDIP volume
+       iChamber1->GetGeometry()->SetMotherVolume("DDIP");
+       iChamber2->GetGeometry()->SetMotherVolume("DDIP");
+      }
+
+
+      // volumes for slat geometry (xx=5,..,10 chamber id): 
+      // Sxx0 Sxx1 Sxx2 Sxx3  -->   Slat Mother volumes 
+      // SxxG                          -->   Sensitive volume (gas)
+      // SxxP                          -->   PCB (copper) 
+      // SxxI                          -->   Insulator (G10) 
+      // SxxC                          -->   Carbon panel 
+      // SxxN                          -->   Nomex comb
+      // SxxX                          -->   Nomex bulk
+      // SxxH, SxxV                    -->   Horizontal and Vertical frames (Noryl)
+      // SB5x                          -->   Volumes for the 35 cm long PCB
+      // slat dimensions: slat is a MOTHER volume!!! made of air
+
+      // only for chamber 5: slat 1 has a PCB shorter by 5cm!
+
+      Float_t tlength = 35.;
+      Float_t panelpar2[3]  = { tlength/2., panelpar[1],  panelpar[2]}; 
+      Float_t nomexpar2[3]  = { tlength/2., nomexpar[1],  nomexpar[2]}; 
+      Float_t nomexbpar2[3] = { tlength/2., nomexbpar[1],  nomexbpar[2]}; 
+      Float_t insupar2[3]   = { tlength/2., insupar[1],   insupar[2]}; 
+      Float_t pcbpar2[3]    = { tlength/2., pcbpar[1],    pcbpar[2]}; 
+      Float_t senspar2[3]   = { tlength/2., senspar[1],   senspar[2]}; 
+      Float_t hFramepar2[3] = { tlength/2., hFramepar[1], hFramepar[2]}; 
+      Float_t bFramepar2[3] = { tlength/2., bFramepar[1], bFramepar[2]}; 
+      Float_t *dum=0;
+      Float_t pcbDLength3   = (kPcbLength - tlength);
+
+      const Int_t   kNslats3         = 5;  // number of slats per quadrant
+      const Int_t   kNPCB3[kNslats3] = {4, 4, 4, 3, 2}; // n PCB per slat
+      const Float_t kXpos3[kNslats3] = {0., 0., 0., 0., 0.};//{31., 0., 0., 0., 0.};
+      const Float_t kYpos3[kNslats3] = {0, 37.8, 37.7, 37.3, 33.7};
+      Float_t slatLength3[kNslats3]; 
+
+      // create and position the slat (mother) volumes 
+
+      char idSlatCh5[5];
+      char idSlatCh6[5];
+      Float_t xSlat3;
+      Float_t ySlat3 = 0;
+      Float_t angle = 0.;
+      Float_t spar2[3];
+      for (i = 0; i < kNslats3; i++){
+
+       slatLength3[i] = kPcbLength * kNPCB3[i] + 2.* kVframeLength; 
+       xSlat3 = slatLength3[i]/2. +  kDslatLength + kXpos3[i]; 
+       ySlat3 += kYpos3[i];
+
+       spar[0] = slatLength3[i]/2.; 
+       spar[1] = kSlatHeight/2.;
+       spar[2] = kSlatWidth/2.; 
+       // take away 5 cm from the first slat in chamber 5
         if (i == 0 || i == 1 || i == 2) { // 1 pcb is shortened by 5cm
-        spar2[0] = spar[0] - pcbDLength3/2.;
-       } else {
-        spar2[0] = spar[0];
-       }
-       spar2[1] = spar[1];
-       spar2[2] = spar[2]; 
-       Float_t dzCh3=spar[2] * 1.01;
-       // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2]; 
-
-       sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
-       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-       detElemId = 500 + i + kNslats3-1;
-       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, zSlat+2.*dzCh3),
-                                                TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
-       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-       detElemId = 550 + i + kNslats3-1;
-       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat-2.*dzCh3),
-                                                TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
-
-       if (i > 0) { 
-        sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
-        gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-        detElemId = 500 - i + kNslats3-1;
-        GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, zSlat+2.*dzCh3), 
-                                                  TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
-        gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
-        detElemId = 550 - i + kNslats3-1;
-        GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat-2.*dzCh3),
-                                                  TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
-       }
-
-       sprintf(idSlatCh6,"LB%d",kNslats3-1+i);  
-       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-       detElemId = 600 + i  + kNslats3-1;
-       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, zSlat+2.*dzCh3),
-                                                TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
-       sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
-       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-       detElemId = 650 + i + kNslats3-1;
-       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat-2.*dzCh3),
-                                                TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
-
-       if (i > 0) { 
-        sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
-        gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-        detElemId = 600 - i + kNslats3-1;
-        GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, zSlat+2.*dzCh3),
-                                                  TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
-        gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
-        detElemId = 650 - i + kNslats3-1;
-        GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat-2.*dzCh3),
-                                                  TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
-       }
-     }
+         spar2[0] = spar[0] - pcbDLength3/2.;
+       } else {
+         spar2[0] = spar[0];
+       }
+       spar2[1] = spar[1];
+       spar2[2] = spar[2]; 
+       Float_t dzCh3 = dzCh; 
+       Float_t zSlat3 = (i%2 ==0)? -zSlat : zSlat; // seems not that zSlat3 = zSlat4 & 5 refering to plan PQ7EN345-6 ?
+
+       sprintf(idSlatCh5,"LA%d",kNslats3-1+i);
+       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+       detElemId = 500 + i + kNslats3-1;
+       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
+                                    TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
+
+       sprintf(idSlatCh5,"LA%d",3*kNslats3-2+i);
+       gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+       detElemId = 550 + i + kNslats3-1;
+       GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
+                                    TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
+
+       if (i > 0) { 
+         sprintf(idSlatCh5,"LA%d",kNslats3-1-i);
+         gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+         detElemId = 500 - i + kNslats3-1;
+         GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3), 
+                                      TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
+
+         sprintf(idSlatCh5,"LA%d",3*kNslats3-2-i);
+         gMC->Gsvolu(idSlatCh5,"BOX",kSlatMaterial,spar2,3);
+         detElemId = 550 - i + kNslats3-1;
+         GetEnvelopes(4)->AddEnvelope(idSlatCh5, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
+                                      TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
+       }
+
+       sprintf(idSlatCh6,"LB%d",kNslats3-1+i);  
+       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+       detElemId = 600 + i  + kNslats3-1;
+       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, ySlat3, -zSlat3 + dzCh3),
+                                    TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
+       sprintf(idSlatCh6,"LB%d",3*kNslats3-2+i);
+       gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+       detElemId = 650 + i + kNslats3-1;
+       GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, ySlat3, zSlat3 - dzCh3),
+                                    TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
+
+       if (i > 0) { 
+         sprintf(idSlatCh6,"LB%d",kNslats3-1-i);
+         gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+         detElemId = 600 - i + kNslats3-1;
+         GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(xSlat3, -ySlat3, -zSlat3 + dzCh3),
+                                      TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
+
+         sprintf(idSlatCh6,"LB%d",3*kNslats3-2-i);
+         gMC->Gsvolu(idSlatCh6,"BOX",kSlatMaterial,spar,3);
+         detElemId = 650 - i + kNslats3-1;
+         GetEnvelopes(5)->AddEnvelope(idSlatCh6, detElemId, true, TGeoTranslation(-xSlat3, -ySlat3, zSlat3 - dzCh3),
+                                      TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
+       }
+      }
      
-     // create the panel volume 
+      // create the panel volume 
  
-     gMC->Gsvolu("S05C","BOX",kPanelMaterial,panelpar,3);
-     gMC->Gsvolu("SB5C","BOX",kPanelMaterial,panelpar2,3);
-     gMC->Gsvolu("S06C","BOX",kPanelMaterial,panelpar,3);
+      gMC->Gsvolu("S05C","BOX",kCarbonMaterial,panelpar,3);
+      gMC->Gsvolu("SB5C","BOX",kCarbonMaterial,panelpar2,3);
+      gMC->Gsvolu("S06C","BOX",kCarbonMaterial,panelpar,3);
  
-     // create the rohacell volume 
+      // create the nomex volume (honey comb)
 
-     gMC->Gsvolu("S05R","BOX",kRohaMaterial,rohapar,3);
-     gMC->Gsvolu("SB5R","BOX",kRohaMaterial,rohapar2,3);
-     gMC->Gsvolu("S06R","BOX",kRohaMaterial,rohapar,3);
+      gMC->Gsvolu("S05N","BOX",kNomexMaterial,nomexpar,3);
+      gMC->Gsvolu("SB5N","BOX",kNomexMaterial,nomexpar2,3);
+      gMC->Gsvolu("S06N","BOX",kNomexMaterial,nomexpar,3);
  
-     // create the insulating material volume 
+      // create the nomex volume (bulk)
+
+      gMC->Gsvolu("S05X","BOX",kNomexBMaterial,nomexbpar,3);
+      gMC->Gsvolu("SB5X","BOX",kNomexBMaterial,nomexbpar2,3);
+      gMC->Gsvolu("S06X","BOX",kNomexBMaterial,nomexbpar,3);
 
-     gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
-     gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
-     gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
+      // create the insulating material volume 
+
+      gMC->Gsvolu("S05I","BOX",kInsuMaterial,insupar,3);
+      gMC->Gsvolu("SB5I","BOX",kInsuMaterial,insupar2,3);
+      gMC->Gsvolu("S06I","BOX",kInsuMaterial,insupar,3);
  
-     // create the PCB volume 
+      // create the PCB volume 
 
-     gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
-     gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
-     gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
+      gMC->Gsvolu("S05P","BOX",kPcbMaterial,pcbpar,3);
+      gMC->Gsvolu("SB5P","BOX",kPcbMaterial,pcbpar2,3);
+      gMC->Gsvolu("S06P","BOX",kPcbMaterial,pcbpar,3);
  
-     // create the sensitive volumes,
+      // create the sensitive volumes,
 
-     gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
-     gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
+      gMC->Gsvolu("S05G","BOX",kSensMaterial,dum,0);
+      gMC->Gsvolu("S06G","BOX",kSensMaterial,dum,0);
 
-     // create the vertical frame volume 
+      // create the vertical frame volume 
 
-     gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
-     gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
+      gMC->Gsvolu("S05V","BOX",kVframeMaterial,vFramepar,3);
+      gMC->Gsvolu("S06V","BOX",kVframeMaterial,vFramepar,3);
 
-     // create the horizontal frame volume 
+      // create the horizontal frame volume 
 
-     gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
-     gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
-     gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
+      gMC->Gsvolu("S05H","BOX",kHframeMaterial,hFramepar,3);
+      gMC->Gsvolu("SB5H","BOX",kHframeMaterial,hFramepar2,3);
+      gMC->Gsvolu("S06H","BOX",kHframeMaterial,hFramepar,3);
  
-     // create the horizontal border volume 
+      // create the horizontal border volume 
 
-     gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
-     gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
-     gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
+      gMC->Gsvolu("S05B","BOX",kBframeMaterial,bFramepar,3);
+      gMC->Gsvolu("SB5B","BOX",kBframeMaterial,bFramepar2,3);
+      gMC->Gsvolu("S06B","BOX",kBframeMaterial,bFramepar,3);
  
-     index = 0; 
-     for (i = 0; i<kNslats3; i++){
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
-        if (i == 0 && quadrant == 2) continue;
-        if (i == 0 && quadrant == 4) continue;
-
-        sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
-        sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
-        Float_t xvFrame  = (slatLength3[i] - kVframeLength)/2.;
-        Float_t xvFrame2  = xvFrame;
-
-        if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
-
-        // position the vertical frames 
-        if ( i > 2) { 
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));    
-        } 
-
-        if (i == 2) {
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        }
-
-        if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
-          GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
-                                                  (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-        }
-
-        // position the panels and the insulating material 
-        for (j = 0; j < kNPCB3[i]; j++){
-          if (i == 1 && j == 0) continue;
-          if (i == 0 && j == 0) continue;
-          index++;
-          Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5); 
-          Float_t xx2 = xx - pcbDLength3/2.; 
+      index = 0; 
+      for (i = 0; i<kNslats3; i++){
+       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+         if (i == 0 && quadrant == 2) continue;
+         if (i == 0 && quadrant == 4) continue;
+
+         sprintf(idSlatCh5,"LA%d",ConvertSlatNum(i,quadrant,kNslats3-1));
+         sprintf(idSlatCh6,"LB%d",ConvertSlatNum(i,quadrant,kNslats3-1));
+         Float_t xvFrame  = (slatLength3[i] - kVframeLength)/2.;
+         Float_t xvFrame2  = xvFrame;
+
+         if (i == 0 || i == 1 || i == 2) xvFrame2 -= pcbDLength3/2.;
+
+         // position the vertical frames 
+         if ( i > 2) { 
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));   
+         } 
+
+         if (i == 2) {
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         }
+
+         if (i == 0 || i == 1) { // no rounded spacer for the moment (Ch. Finck)
+           GetEnvelopes(4)->AddEnvelopeConstituent("S05V", idSlatCh5, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame2,0.,0.));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06V", idSlatCh6, 
+                                                   (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         }
+
+         // position the panels and the insulating material 
+         for (j = 0; j < kNPCB3[i]; j++){
+           if (i == 1 && j == 0) continue;
+           if (i == 0 && j == 0) continue;
+           index++;
+           Float_t xx = kSensLength * (-kNPCB3[i]/2. + j + 0.5); 
+           Float_t xx2 = xx - pcbDLength3/2.; 
         
-          Float_t zPanel = spar[2] - panelpar[2]; 
-
-          if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm 
-            GetEnvelopes(4)->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("SB5C", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
-          } else {
-            GetEnvelopes(4)->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("S05C", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
-            GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
-          }
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06C", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
+           Float_t zPanel = spar[2] - nomexbpar[2]; 
+
+           if ( (i == 0 || i == 1 || i == 2) && j == kNPCB3[i]-1) { // 1 pcb is shortened by 5cm 
+             GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index-1,TGeoTranslation(xx2,0.,zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("SB5X", idSlatCh5, 2*index,TGeoTranslation(xx2,0.,-zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("SB5I", idSlatCh5, index,TGeoTranslation(xx2,0.,0.));
+           } else {
+             GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("S05X", idSlatCh5, 2*index,TGeoTranslation(xx,0.,-zPanel));
+             GetEnvelopes(4)->AddEnvelopeConstituent("S05I", idSlatCh5, index,TGeoTranslation(xx,0.,0.));
+           }
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06X", idSlatCh6, 2*index,TGeoTranslation(xx,0.,-zPanel));
+           GetEnvelopes(5)->AddEnvelopeConstituent("S06I", idSlatCh6, index,TGeoTranslation(xx,0.,0.));
  
-        } 
-       }
-     }
-
-     // position the rohacell volume inside the panel volume
-     gMC->Gspos("S05R",1,"S05C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("SB5R",1,"SB5C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S06R",1,"S06C",0.,0.,0.,0,"ONLY"); 
+         } 
+       }
+      }
+
+      // position the nomex volume inside the panel volume
+      gMC->Gspos("S05N",1,"S05C",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("SB5N",1,"SB5C",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("S06N",1,"S06C",0.,0.,0.,0,"ONLY"); 
   
-     // position the PCB volume inside the insulating material volume
-     gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY"); 
+      // position panel volume inside the bulk nomex material volume
+      gMC->Gspos("S05C",1,"S05X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+      gMC->Gspos("SB5C",1,"SB5X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+      gMC->Gspos("S06C",1,"S06X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+
+      // position the PCB volume inside the insulating material volume
+      gMC->Gspos("S05P",1,"S05I",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("SB5P",1,"SB5I",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("S06P",1,"S06I",0.,0.,0.,0,"ONLY"); 
   
-     // position the horizontal frame volume inside the PCB volume
-     gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY"); 
+      // position the horizontal frame volume inside the PCB volume
+      gMC->Gspos("S05H",1,"S05P",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("SB5H",1,"SB5P",0.,0.,0.,0,"ONLY"); 
+      gMC->Gspos("S06H",1,"S06P",0.,0.,0.,0,"ONLY"); 
   
-     // position the sensitive volume inside the horizontal frame volume
-     gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3); 
-     gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3); 
-     gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3); 
+      // position the sensitive volume inside the horizontal frame volume
+      gMC->Gsposp("S05G",1,"S05H",0.,0.,0.,0,"ONLY",senspar,3); 
+      gMC->Gsposp("S05G",1,"SB5H",0.,0.,0.,0,"ONLY",senspar2,3); 
+      gMC->Gsposp("S06G",1,"S06H",0.,0.,0.,0,"ONLY",senspar,3); 
   
  
-     // position the border volumes inside the PCB volume
-     Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
-     gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY"); 
-     gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY"); 
-
-     gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY"); 
+      // position the border volumes inside the PCB volume
+      Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
+      gMC->Gspos("S05B",1,"S05P",0., yborder,0.,0,"ONLY"); 
+      gMC->Gspos("S05B",2,"S05P",0.,-yborder,0.,0,"ONLY"); 
+      gMC->Gspos("SB5B",1,"SB5P",0., yborder,0.,0,"ONLY"); 
+      gMC->Gspos("SB5B",2,"SB5P",0.,-yborder,0.,0,"ONLY"); 
+
+      gMC->Gspos("S06B",1,"S06P",0., yborder,0.,0,"ONLY"); 
+      gMC->Gspos("S06B",2,"S06P",0.,-yborder,0.,0,"ONLY"); 
   
-     // create the NULOC volume and position it in the horizontal frame
-     gMC->Gsvolu("S05N","BOX",kNulocMaterial,nulocpar,3);
-     gMC->Gsvolu("S06N","BOX",kNulocMaterial,nulocpar,3);
-     index = 0;
-     Float_t xxmax2 = xxmax - pcbDLength3/2.;
-     for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
-       index++; 
-       gMC->Gspos("S05N",2*index-1,"S05B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S05N",2*index  ,"S05B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S06N",2*index-1,"S06B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S06N",2*index  ,"S06B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       if (xx > -xxmax2 && xx< xxmax2) {
-        gMC->Gspos("S05N",2*index-1,"SB5B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-        gMC->Gspos("S05N",2*index  ,"SB5B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       }
-     }
-
-     // position the volumes approximating the circular section of the pipe
-     Float_t yoffs = kSensHeight/2.-kYoverlap; 
-     Float_t epsilon = 0.001; 
-     Int_t ndiv = 6;
-     Double_t divpar[3];
-     Double_t dydiv= kSensHeight/ndiv;
-     Double_t ydiv = yoffs -dydiv/2.;
-     Int_t imax = 0; 
-     imax = 1; 
-     Double_t rmin = 31.5;  // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat 
-     Double_t xdiv = 0.;
-     for (Int_t idiv = 0;idiv < ndiv; idiv++){ 
-       ydiv += dydiv;
-       xdiv = 0.; 
-       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
-       divpar[0] = (kPcbLength-xdiv)/2.; 
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.;
-       Float_t yvol = ydiv; 
-
-       // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-        sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
-        sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
-
-        GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
-                       TGeoTranslation(xvol-(kPcbLength * (kNPCB3[1])/2.),yvol-kPcbLength+kYoverlap,0.),3,divpar);
-
-        GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,  quadrant*100+imax+4*idiv+1,
-                       TGeoTranslation(xvol-kPcbLength * kNPCB3[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-       }
-     }
-
-     // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
-     //      Gines Martinez, Subatech sep 04
-     // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3
-     // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
-     // Rmin = 31.5 cm
-     Double_t rmin_122000SR1 = 31.5; //in cm  
-     ndiv  = 9; 
-     dydiv = kSensHeight/ndiv;           // Vertical size of the box volume approximating the rounded PCB
-     ydiv  = -kSensHeight/2 + dydiv/2.-kYoverlap;   // Initializing vertical position of the volume from bottom
-     xdiv  = 0.;                         // Initializing horizontal position of the box volumes
-     for (Int_t idiv=0;idiv<ndiv; idiv++){ 
-       xdiv = TMath::Abs( rmin_122000SR1 * TMath::Sin( TMath::ACos(ydiv/rmin_122000SR1) ) );
-       divpar[0] = (kPcbLength-xdiv)/2.; // Dimension of the box volume
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.; //2D traslition for positionning of box volume
-       Float_t yvol =  ydiv;
-       Int_t side;
-       for (side = 1; side <= 2; side++) {
-        sprintf(idSlatCh5,"LA%d",4);      
-        sprintf(idSlatCh6,"LB%d",4);
-        if(side == 2) {
-          sprintf(idSlatCh5,"LA%d",13);           
-          sprintf(idSlatCh6,"LB%d",13);
-        }         
-        GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
-                       TGeoTranslation(xvol-(kPcbLength * (kNPCB3[0])/2.),yvol+kYoverlap,0.),3,divpar);
-
-        GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
-                        TGeoTranslation(xvol-kPcbLength * kNPCB3[0]/2.,yvol+kYoverlap,0.),3,divpar);
-       }
-       ydiv += dydiv; // Going from bottom to top
-     }
-     // cout << "Geometry for Station 3...... done" << endl;   
+      // create the NULOC volume and position it in the horizontal frame
+      gMC->Gsvolu("S05E","BOX",kNulocMaterial,nulocpar,3);
+      gMC->Gsvolu("S06E","BOX",kNulocMaterial,nulocpar,3);
+      index = 0;
+      Float_t xxmax2 = xxmax - pcbDLength3/2.;
+      for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
+       index++; 
+       gMC->Gspos("S05E",2*index-1,"S05B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+       gMC->Gspos("S05E",2*index  ,"S05B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+       gMC->Gspos("S06E",2*index-1,"S06B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+       gMC->Gspos("S06E",2*index  ,"S06B", xx, 0., kBframeWidth/2.-  kNulocWidth/2, 0, "ONLY");
+       if (xx > -xxmax2 && xx< xxmax2) {
+         gMC->Gspos("S05E",2*index-1,"SB5B", xx, 0.,-kBframeWidth/2.+ kNulocWidth/2, 0, "ONLY");
+         gMC->Gspos("S05E",2*index  ,"SB5B", xx, 0., kBframeWidth/2.- kNulocWidth/2, 0, "ONLY");
+       }
+      }
+
+      // position the volumes approximating the circular section of the pipe
+      Float_t yoffs = kSensHeight/2.; 
+      Float_t epsilon = 0.001; 
+      Int_t ndiv = 6;
+      Double_t divpar[3];
+      Double_t dydiv= kSensHeight/ndiv;
+      Double_t ydiv = yoffs -dydiv/2.;
+      Int_t imax = 0; 
+      imax = 1; 
+      Double_t rmin = 31.5;  // Corrected in sep04 from PQ-LAT-SR2 de CEA-DSM-DAPNIA-SIS/BE ph HARDY 19-Oct-2002 slat 
+      Double_t xdiv = 0.;
+      for (Int_t idiv = 0;idiv < ndiv; idiv++){ 
+       ydiv += dydiv;
+       xdiv = 0.; 
+       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
+       divpar[0] = (kPcbLength-xdiv)/2.; 
+       divpar[1] = dydiv/2. - epsilon;
+       divpar[2] = kSensWidth/2.; 
+       Float_t xvol = (kPcbLength+xdiv)/2.;
+       Float_t yvol = ydiv; 
+
+       // Volumes close to the beam pipe for slat i=1 so 4 slats per chamber
+       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+         sprintf(idSlatCh5,"LA%d",ConvertSlatNum(1,quadrant,kNslats3-1));
+         sprintf(idSlatCh6,"LB%d",ConvertSlatNum(1,quadrant,kNslats3-1));
+
+         GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5, quadrant*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-(kPcbLength * (kNPCB3[1])/2.),yvol-kPcbLength,0.),3,divpar);
+
+         GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,  quadrant*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-kPcbLength * kNPCB3[1]/2.,yvol-kPcbLength,0.),3,divpar);
+       }
+      }
+
+      // Volumes close to the beam pipe for slat i=0 so 2 slats per chamber (central slat for station 3)
+      //      Gines Martinez, Subatech sep 04
+      // 9 box volumes are used to define the PCB closed to the beam pipe of the slat 122000SR1 of chamber 5 and 6 of St3
+      // Accordingly to plan PQ-LAT-SR1 of CEA-DSM-DAPNIA-SIS/BE ph HARDY 8-Oct-2002
+      // Rmin = 31.5 cm
+      Double_t rmin_122000SR1 = 31.5; //in cm  
+      ndiv  = 9; 
+      dydiv = kSensHeight/ndiv;           // Vertical size of the box volume approximating the rounded PCB
+      ydiv  = -kSensHeight/2 + dydiv/2.;   // Initializing vertical position of the volume from bottom
+      xdiv  = 0.;                         // Initializing horizontal position of the box volumes
+      for (Int_t idiv=0;idiv<ndiv; idiv++){ 
+       xdiv = TMath::Abs( rmin_122000SR1 * TMath::Sin( TMath::ACos(ydiv/rmin_122000SR1) ) );
+       divpar[0] = (kPcbLength-xdiv)/2.; // Dimension of the box volume
+       divpar[1] = dydiv/2. - epsilon;
+       divpar[2] = kSensWidth/2.; 
+       Float_t xvol = (kPcbLength+xdiv)/2.; //2D traslition for positionning of box volume
+       Float_t yvol =  ydiv;
+       Int_t side;
+       for (side = 1; side <= 2; side++) {
+         sprintf(idSlatCh5,"LA%d",4);     
+         sprintf(idSlatCh6,"LB%d",4);
+         if(side == 2) {
+           sprintf(idSlatCh5,"LA%d",13);          
+           sprintf(idSlatCh6,"LB%d",13);
+         }        
+         GetEnvelopes(4)->AddEnvelopeConstituentParam("S05G", idSlatCh5,500+side*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-(kPcbLength * (kNPCB3[0])/2.),yvol,0.),3,divpar);
+
+         GetEnvelopes(5)->AddEnvelopeConstituentParam("S06G", idSlatCh6,500+side*100+imax+4*idiv+1,
+                                                      TGeoTranslation(xvol-kPcbLength * kNPCB3[0]/2.,yvol,0.),3,divpar);
+       }
+       ydiv += dydiv; // Going from bottom to top
+      }
+      // cout << "Geometry for Station 3...... done" << endl;  
     }
     
-    if (fStations[3]) {
+  if (fStations[3]) {
 
 
-// //********************************************************************
-// //                            Station 4                             **
-// //********************************************************************
-//      // indices 1 and 2 for first and second chambers in the station
-//      // iChamber (first chamber) kept for other quanties than Z,
-//      // assumed to be the same in both chambers
-//      corrected geometry (JP. Cussonneau, Ch. Finck)
+    // //********************************************************************
+    // //                            Station 4                             **
+    // //********************************************************************
+    //      // indices 1 and 2 for first and second chambers in the station
+    //      // iChamber (first chamber) kept for other quanties than Z,
+    //      // assumed to be the same in both chambers
+    //      corrected geometry (JP. Cussonneau, Ch. Finck)
  
-     iChamber = GetChamber(6);
-     iChamber1 = iChamber;
-     iChamber2 = GetChamber(7);
-
-     const Int_t kNslats4 = 7;  // number of slats per quadrant
-     const Int_t kNPCB4[kNslats4] = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
-     const Float_t kXpos4[kNslats4] = {38.5, 0., 0., 0., 0., 0., 0.};
-     Float_t slatLength4[kNslats4];     
-
-//      // create and position the slat (mother) volumes 
-
-     char idSlatCh7[5];
-     char idSlatCh8[5];
-     Float_t xSlat4;
-     Float_t ySlat4;
-     angle = 0.;
-
-     for (i = 0; i<kNslats4; i++){
-       slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kDslatLength; 
-       xSlat4 = slatLength4[i]/2. + kVframeLength/2. + kXpos4[i]; 
-       ySlat4 = kSensHeight * i - kYoverlap *i;
-       
-       spar[0] = slatLength4[i]/2.; 
-       spar[1] = kSlatHeight/2.;
-       spar[2] = kSlatWidth/2.*1.01; 
-       Float_t dzCh4 = spar[2]*1.01;
-       // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? spar[2] : -spar[2]; 
-
-       sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
-       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-       detElemId = 700 + i + kNslats4-1;
-       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
-                                                TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
-       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-       detElemId = 750 + i + kNslats4-1;
-       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
-                                                TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
+    iChamber = GetChamber(6);
+    iChamber1 = iChamber;
+    iChamber2 = GetChamber(7);
+
+    const Int_t   kNslats4          = 7;  // number of slats per quadrant
+    const Int_t   kNPCB4[kNslats4]  = {5, 6, 5, 5, 4, 3, 2}; // n PCB per slat
+    const Float_t kXpos4[kNslats4]  = {38.2, 0., 0., 0., 0., 0., 0.};
+    const Float_t kYpos41[kNslats4] = {0., 38.2, 34.40, 36.60, 29.3, 37.0, 28.6};
+    const Float_t kYpos42[kNslats4] = {0., 38.2, 37.85, 37.55, 37.0, 29.4, 36.2};
+
+    Float_t slatLength4[kNslats4];     
+
+    // create and position the slat (mother) volumes 
+
+    char idSlatCh7[5];
+    char idSlatCh8[5];
+    Float_t xSlat4;
+    Float_t ySlat41 = 0;
+    Float_t ySlat42 = 0;
+
+    angle = 0.;
+
+    for (i = 0; i<kNslats4; i++){
+      slatLength4[i] = kPcbLength * kNPCB4[i] + 2. * kVframeLength; 
+      xSlat4 = slatLength4[i]/2. + kDslatLength + kXpos4[i]; 
+      ySlat41 += kYpos41[i];
+      ySlat42 += kYpos42[i];
+
+      spar[0] = slatLength4[i]/2.; 
+      spar[1] = kSlatHeight/2.;
+      spar[2] = kSlatWidth/2.; 
+      Float_t dzCh4 = dzCh;
+      Float_t zSlat4 = (i%2 ==0)? -zSlat : zSlat; 
+
+      sprintf(idSlatCh7,"LC%d",kNslats4-1+i);
+      gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+      detElemId = 700 + i + kNslats4-1;
+      GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, ySlat41, -zSlat4 + dzCh4),
+                                  TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh7,"LC%d",3*kNslats4-2+i);
+      gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+      detElemId = 750 + i + kNslats4-1;
+      GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(-xSlat4, ySlat41, zSlat4 - dzCh4),
+                                  TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
  
-       if (i > 0) { 
-        sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
-        gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-        detElemId = 700 - i + kNslats4-1;
-        GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
-                                                  TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
-        detElemId = 750 - i + kNslats4-1;
-        gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, 
-                                                  TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
-                                                  TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
-       }
-
-       sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
-       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-       detElemId = 800 + i + kNslats4-1;
-       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat4, zSlat+2.*dzCh4),
-                                                TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
-       detElemId = 850 + i + kNslats4-1;
-       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat4, zSlat-2.*dzCh4),
-                                                TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
-       if (i > 0) { 
-        sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
-        detElemId = 800 - i + kNslats4-1;
-        gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat4, zSlat+2.*dzCh4),
-                                                  TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
-        sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
-        detElemId = 850 - i + kNslats4-1;
-        gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat4, zSlat-2.*dzCh4),
-                                                  TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
-       }
-     }
+      if (i > 0) { 
+       sprintf(idSlatCh7,"LC%d",kNslats4-1-i);
+       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+       detElemId = 700 - i + kNslats4-1;
+       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, TGeoTranslation(xSlat4, -ySlat41, -zSlat4 + dzCh4),
+                                    TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
+
+       sprintf(idSlatCh7,"LC%d",3*kNslats4-2-i);
+       detElemId = 750 - i + kNslats4-1;
+       gMC->Gsvolu(idSlatCh7,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(6)->AddEnvelope(idSlatCh7, detElemId, true, 
+                                    TGeoTranslation(-xSlat4, -ySlat41, zSlat4 - dzCh4),
+                                    TGeoRotation("rot4",90,180+angle,90,270+angle,0,0) );
+      }
+
+      sprintf(idSlatCh8,"LD%d",kNslats4-1+i);
+      gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+      detElemId = 800 + i + kNslats4-1;
+      GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, ySlat42, -zSlat4 + dzCh4),
+                                  TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh8,"LD%d",3*kNslats4-2+i);
+      detElemId = 850 + i + kNslats4-1;
+      gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, ySlat42, zSlat4 - dzCh4),
+                                  TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
+      if (i > 0) { 
+       sprintf(idSlatCh8,"LD%d",kNslats4-1-i);
+       detElemId = 800 - i + kNslats4-1;
+       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(xSlat4, -ySlat42, -zSlat4 + dzCh4),
+                                    TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
+       sprintf(idSlatCh8,"LD%d",3*kNslats4-2-i);
+       detElemId = 850 - i + kNslats4-1;
+       gMC->Gsvolu(idSlatCh8,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(7)->AddEnvelope(idSlatCh8, detElemId, true, TGeoTranslation(-xSlat4, -ySlat42, zSlat4 - dzCh4),
+                                    TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
+      }
+    }
      
-     // create the panel volume 
+    // create the panel volume 
  
-     gMC->Gsvolu("S07C","BOX",kPanelMaterial,panelpar,3);
-     gMC->Gsvolu("S08C","BOX",kPanelMaterial,panelpar,3);
+    gMC->Gsvolu("S07C","BOX",kCarbonMaterial,panelpar,3);
+    gMC->Gsvolu("S08C","BOX",kCarbonMaterial,panelpar,3);
 
-     // create the rohacell volume 
+    // create the nomex volume 
 
-     gMC->Gsvolu("S07R","BOX",kRohaMaterial,rohapar,3);
-     gMC->Gsvolu("S08R","BOX",kRohaMaterial,rohapar,3);
+    gMC->Gsvolu("S07N","BOX",kNomexMaterial,nomexpar,3);
+    gMC->Gsvolu("S08N","BOX",kNomexMaterial,nomexpar,3);
 
-     // create the insulating material volume 
 
-     gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
-     gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
+    // create the nomex volume (bulk)
 
-     // create the PCB volume 
+    gMC->Gsvolu("S07X","BOX",kNomexBMaterial,nomexbpar,3);
+    gMC->Gsvolu("S08X","BOX",kNomexBMaterial,nomexbpar,3);
 
-     gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
-     gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
+    // create the insulating material volume 
+
+    gMC->Gsvolu("S07I","BOX",kInsuMaterial,insupar,3);
+    gMC->Gsvolu("S08I","BOX",kInsuMaterial,insupar,3);
+
+    // create the PCB volume 
+
+    gMC->Gsvolu("S07P","BOX",kPcbMaterial,pcbpar,3);
+    gMC->Gsvolu("S08P","BOX",kPcbMaterial,pcbpar,3);
  
-     // create the sensitive volumes,
-
-     gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
-     gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
-
-     // create the vertical frame volume 
-
-     gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
-     gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
-
-     // create the horizontal frame volume 
-
-     gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
-     gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
-
-     // create the horizontal border volume 
-
-     gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
-     gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
-
-     index = 0; 
-     for (i = 0; i < kNslats4; i++){
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
-        if (i == 0 && quadrant == 2) continue;
-        if (i == 0 && quadrant == 4) continue;
-
-        sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
-        sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
-        Float_t xvFrame  = (slatLength4[i] - kVframeLength)/2.;
-
-        // position the vertical frames 
-        if (i != 1) { 
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        } else { // no rounded spacer yet
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        }
-        // position the panels and the insulating material 
-        for (j = 0; j < kNPCB4[i]; j++){
-          if (i == 1 && j == 0) continue;
-          index++;
-          Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5); 
-
-          Float_t zPanel = spar[2] - panelpar[2]; 
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07C", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08C", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
-        }
-       } 
-     }
-
-     // position the rohacell volume inside the panel volume
-     gMC->Gspos("S07R",1,"S07C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S08R",1,"S08C",0.,0.,0.,0,"ONLY"); 
-
-     // position the PCB volume inside the insulating material volume
-     gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY"); 
-     // position the horizontal frame volume inside the PCB volume
-     gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY"); 
-     // position the sensitive volume inside the horizontal frame volume
-     gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3); 
-     gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3); 
-     // position the border volumes inside the PCB volume
-     Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
-     gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY"); 
-
-//      // create the NULOC volume and position it in the horizontal frame
-
-     gMC->Gsvolu("S07N","BOX",kNulocMaterial,nulocpar,3);
-     gMC->Gsvolu("S08N","BOX",kNulocMaterial,nulocpar,3);
-     index = 0;
-     for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
-       index++; 
-       gMC->Gspos("S07N",2*index-1,"S07B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S07N",2*index  ,"S07B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S08N",2*index-1,"S08B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S08N",2*index  ,"S08B", xx, 0., kBframeWidth/4., 0, "ONLY");
-     }
-
-//      // position the volumes approximating the circular section of the pipe
-     Float_t yoffs = kSensHeight/2. - kYoverlap; 
-     Float_t epsilon = 0.001; 
-     Int_t ndiv = 10;
-     Double_t divpar[3];
-     Double_t dydiv= kSensHeight/ndiv;
-     Double_t ydiv = yoffs -dydiv;
-     Int_t imax=0; 
-     imax = 1; 
-     Float_t rmin = 39.5;
-     Float_t shiftR = 0.;
-     for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
-       ydiv += dydiv;
-       Float_t xdiv = 0.; 
-       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
-       divpar[0] = (kPcbLength-xdiv-shiftR)/2.; 
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.+shiftR;
-       Float_t yvol = ydiv + dydiv/2.;
+    // create the sensitive volumes,
+
+    gMC->Gsvolu("S07G","BOX",kSensMaterial,dum,0);
+    gMC->Gsvolu("S08G","BOX",kSensMaterial,dum,0);
+
+    // create the vertical frame volume 
+
+    gMC->Gsvolu("S07V","BOX",kVframeMaterial,vFramepar,3);
+    gMC->Gsvolu("S08V","BOX",kVframeMaterial,vFramepar,3);
+
+    // create the horizontal frame volume 
+
+    gMC->Gsvolu("S07H","BOX",kHframeMaterial,hFramepar,3);
+    gMC->Gsvolu("S08H","BOX",kHframeMaterial,hFramepar,3);
+
+    // create the horizontal border volume 
+
+    gMC->Gsvolu("S07B","BOX",kBframeMaterial,bFramepar,3);
+    gMC->Gsvolu("S08B","BOX",kBframeMaterial,bFramepar,3);
+
+    index = 0; 
+    for (i = 0; i < kNslats4; i++){
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+       if (i == 0 && quadrant == 2) continue;
+       if (i == 0 && quadrant == 4) continue;
+
+       sprintf(idSlatCh7,"LC%d",ConvertSlatNum(i,quadrant,kNslats4-1));
+       sprintf(idSlatCh8,"LD%d",ConvertSlatNum(i,quadrant,kNslats4-1));
+       Float_t xvFrame  = (slatLength4[i] - kVframeLength)/2.;
+
+       // position the vertical frames 
+       if (i != 1) { 
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       } else { // no rounded spacer yet
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         // GetEnvelopes(6)->AddEnvelopeConstituent("S07V", idSlatCh7, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         // GetEnvelopes(7)->AddEnvelopeConstituent("S08V", idSlatCh8, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       }
+       // position the panels and the insulating material 
+       for (j = 0; j < kNPCB4[i]; j++){
+         if (i == 1 && j == 0) continue;
+         index++;
+         Float_t xx = kSensLength * (-kNPCB4[i]/2.+j+.5); 
+
+         Float_t zPanel = spar[2] - nomexbpar[2]; 
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07X", idSlatCh7, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(6)->AddEnvelopeConstituent("S07I", idSlatCh7, index,TGeoTranslation(xx,0.,0.));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08X", idSlatCh8, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(7)->AddEnvelopeConstituent("S08I", idSlatCh8, index,TGeoTranslation(xx,0.,0.));
+       }
+      } 
+    }
+
+    // position the nomex volume inside the panel volume
+    gMC->Gspos("S07N",1,"S07C",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S08N",1,"S08C",0.,0.,0.,0,"ONLY"); 
+
+    // position panel volume inside the bulk nomex material volume
+    gMC->Gspos("S07C",1,"S07X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+    gMC->Gspos("S08C",1,"S08X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+
+    // position the PCB volume inside the insulating material volume
+    gMC->Gspos("S07P",1,"S07I",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S08P",1,"S08I",0.,0.,0.,0,"ONLY"); 
+
+    // position the horizontal frame volume inside the PCB volume
+    gMC->Gspos("S07H",1,"S07P",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S08H",1,"S08P",0.,0.,0.,0,"ONLY"); 
+
+    // position the sensitive volume inside the horizontal frame volume
+    gMC->Gsposp("S07G",1,"S07H",0.,0.,0.,0,"ONLY",senspar,3); 
+    gMC->Gsposp("S08G",1,"S08H",0.,0.,0.,0,"ONLY",senspar,3); 
+
+    // position the border volumes inside the PCB volume
+    Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
+    gMC->Gspos("S07B",1,"S07P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S07B",2,"S07P",0.,-yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S08B",1,"S08P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S08B",2,"S08P",0.,-yborder,0.,0,"ONLY"); 
+
+    // create the NULOC volume and position it in the horizontal frame
+
+    gMC->Gsvolu("S07E","BOX",kNulocMaterial,nulocpar,3);
+    gMC->Gsvolu("S08E","BOX",kNulocMaterial,nulocpar,3);
+    index = 0;
+    for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
+      index++; 
+      gMC->Gspos("S07E",2*index-1,"S07B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S07E",2*index  ,"S07B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S08E",2*index-1,"S08B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S08E",2*index  ,"S08B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+    }
+
+    // position the volumes approximating the circular section of the pipe
+
+    Float_t yoffs = kSensHeight/2.; 
+    Float_t epsilon = 0.001; 
+    Int_t ndiv = 10;
+    Double_t divpar[3];
+    Double_t dydiv= kSensHeight/ndiv;
+    Double_t ydiv = yoffs -dydiv;
+    Int_t imax=0; 
+    imax = 1; 
+    Float_t rmin = 39.5;
+    for (Int_t idiv = 0; idiv < ndiv; idiv++){ 
+      ydiv += dydiv;
+      Float_t xdiv = 0.; 
+      if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
+      divpar[0] = (kPcbLength-xdiv)/2.; 
+      divpar[1] = dydiv/2. - epsilon;
+      divpar[2] = kSensWidth/2.; 
+      Float_t xvol = (kPcbLength+xdiv)/2.;
+      Float_t yvol = ydiv + dydiv/2.;
        
-       for (Int_t quadrant=1; quadrant<=4; quadrant++) {
-        sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
-        sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
+      for (Int_t quadrant=1; quadrant<=4; quadrant++) {
+       sprintf(idSlatCh7,"LC%d",ConvertSlatNum(1,quadrant,kNslats4-1));
+       sprintf(idSlatCh8,"LD%d",ConvertSlatNum(1,quadrant,kNslats4-1));
         
-        GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
+       GetEnvelopes(6)->AddEnvelopeConstituentParam("S07G",idSlatCh7, quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
         
-        GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-       }
-     }
-     // cout << "Geometry for Station 4...... done" << endl;
-
+       GetEnvelopes(7)->AddEnvelopeConstituentParam("S08G", idSlatCh8, quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB4[1]/2.,yvol-kPcbLength,0.),3,divpar);
+      }
     }
+    // cout << "Geometry for Station 4...... done" << endl;
+
+  }
     
-    if (fStations[4]) {
+  if (fStations[4]) {
       
 
-// //********************************************************************
-// //                            Station 5                             **
-// //********************************************************************
-//      // indices 1 and 2 for first and second chambers in the station
-//      // iChamber (first chamber) kept for other quanties than Z,
-//      // assumed to be the same in both chambers
-//      corrected geometry (JP. Cussonneau, Ch. Finck)
-
-     iChamber = GetChamber(8);
-     iChamber1 = iChamber;
-     iChamber2 = GetChamber(9);
+    // //********************************************************************
+    // //                            Station 5                             **
+    // //********************************************************************
+    //      // indices 1 and 2 for first and second chambers in the station
+    //      // iChamber (first chamber) kept for other quanties than Z,
+    //      // assumed to be the same in both chambers
+    //      corrected geometry (JP. Cussonneau, Ch. Finck)
+
+    iChamber = GetChamber(8);
+    iChamber1 = iChamber;
+    iChamber2 = GetChamber(9);
  
-     const Int_t kNslats5 = 7;  // number of slats per quadrant
-     const Int_t kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
-     const Float_t kXpos5[kNslats5] = {38.5, 0., 0., 0., 0., 0., 0.};
-     Float_t slatLength5[kNslats5]; 
-
-//      // create and position the slat (mother) volumes 
-
-     char idSlatCh9[5];
-     char idSlatCh10[5];
-     Float_t xSlat5;
-     Float_t ySlat5;
-     angle = 0.;
-
-     for (i = 0; i < kNslats5; i++){
-       slatLength5[i] = kPcbLength * kNPCB5[i] + 2. * kDslatLength; 
-       xSlat5 = slatLength5[i]/2. + kVframeLength/2. +kXpos5[i]; 
-       ySlat5 = kSensHeight * i - kYoverlap * i;
+    const Int_t   kNslats5         = 7;  // number of slats per quadrant
+    const Int_t   kNPCB5[kNslats5] = {5, 6, 6, 6, 5, 4, 3}; // n PCB per slat
+    const Float_t kXpos5[kNslats5] = {38.2, 0., 0., 0., 0., 0., 0.};
+    const Float_t kYpos5[kNslats5] = {0., 38.2, 37.9, 37.6, 37.3, 37.05, 36.75};
+    Float_t slatLength5[kNslats5]; 
+
+    // create and position the slat (mother) volumes 
+
+    char idSlatCh9[5];
+    char idSlatCh10[5];
+    Float_t xSlat5;
+    Float_t ySlat5 = 0;
+    angle = 0.;
+
+    for (i = 0; i < kNslats5; i++){
+
+      slatLength5[i] = kPcbLength * kNPCB5[i] + 2.* kVframeLength; 
+      xSlat5 = slatLength5[i]/2. + kDslatLength + kXpos5[i]; 
+      ySlat5 += kYpos5[i];
+
+      spar[0] = slatLength5[i]/2.; 
+      spar[1] = kSlatHeight/2.;
+      spar[2] = kSlatWidth/2.; 
+
+      Float_t dzCh5  = dzCh;
+      Float_t zSlat5 = (i%2 ==0)? -zSlat : zSlat; 
+
+      sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
+      detElemId = 900 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
+                                  TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
+      detElemId = 950 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
+                                  TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
  
-       spar[0] = slatLength5[i]/2.; 
-       spar[1] = kSlatHeight/2.;
-       spar[2] = kSlatWidth/2. * 1.01; 
-       Float_t dzCh5 = spar[2]*1.01;
-       // zSlat to be checked (odd downstream or upstream?)
-       Float_t zSlat = (i%2 ==0)? -spar[2] : spar[2]; 
-
-       sprintf(idSlatCh9,"LE%d",kNslats5-1+i);
-       detElemId = 900 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
-                                                TGeoRotation("rot1",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh9,"LE%d",3*kNslats5-2+i);
-       detElemId = 950 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
-                                                TGeoRotation("rot2",90,180+angle,90,90+angle,180,0) );
-       if (i > 0) { 
-        sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
-        detElemId = 900 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
-                                                  TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
-
-        sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
-        detElemId = 950 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
-                                                  TGeoRotation("rot4",90,180+angle,90,270+angle,0,0)  );
-       }
-
-       sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
-       detElemId = 1000 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, zSlat+2.*dzCh5),
-                                                TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
-
-       sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
-       detElemId = 1050 + i + kNslats5-1;
-       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat-2.*dzCh5),
-                                                TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
-
-       if (i > 0) { 
-        sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
-        detElemId = 1000 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, zSlat+2.*dzCh5),
-                                                  TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
-        sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
-        detElemId = 1050 - i + kNslats5-1;
-        gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
-        GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat-2.*dzCh5),
-                                                  TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
-       }
-     }
-     //      // create the panel volume 
+      if (i > 0) { 
+       sprintf(idSlatCh9,"LE%d",kNslats5-1-i);
+       detElemId = 900 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
+                                    TGeoRotation("rot3",90,angle,90,270+angle,180,0) );
+
+       sprintf(idSlatCh9,"LE%d",3*kNslats5-2-i);
+       detElemId = 950 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh9,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(8)->AddEnvelope(idSlatCh9, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
+                                    TGeoRotation("rot4",90,180+angle,90,270+angle,0,0)  );
+      }
+
+      sprintf(idSlatCh10,"LF%d",kNslats5-1+i);
+      detElemId = 1000 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, ySlat5, -zSlat5 + dzCh5),
+                                  TGeoRotation("rot5",90,angle,90,90+angle,0,0) );
+
+      sprintf(idSlatCh10,"LF%d",3*kNslats5-2+i);
+      detElemId = 1050 + i + kNslats5-1;
+      gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+      GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, ySlat5, zSlat5 - dzCh5),
+                                  TGeoRotation("rot6",90,180+angle,90,90+angle,180,0) );
+
+      if (i > 0) { 
+       sprintf(idSlatCh10,"LF%d",kNslats5-1-i);
+       detElemId = 1000 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(xSlat5, -ySlat5, -zSlat5 + dzCh5),
+                                    TGeoRotation("rot7",90,angle,90,270+angle,180,0) );
+       sprintf(idSlatCh10,"LF%d",3*kNslats5-2-i);
+       detElemId = 1050 - i + kNslats5-1;
+       gMC->Gsvolu(idSlatCh10,"BOX",kSlatMaterial,spar,3);
+       GetEnvelopes(9)->AddEnvelope(idSlatCh10, detElemId, true, TGeoTranslation(-xSlat5, -ySlat5, zSlat5 - dzCh5),
+                                    TGeoRotation("rot8",90,180+angle,90,270+angle,0,0) );
+      }
+    }
+
+    // create the panel volume 
  
-     gMC->Gsvolu("S09C","BOX",kPanelMaterial,panelpar,3);
-     gMC->Gsvolu("S10C","BOX",kPanelMaterial,panelpar,3);
+    gMC->Gsvolu("S09C","BOX",kCarbonMaterial,panelpar,3);
+    gMC->Gsvolu("S10C","BOX",kCarbonMaterial,panelpar,3);
+
+    // create the nomex volume 
+
+    gMC->Gsvolu("S09N","BOX",kNomexMaterial,nomexpar,3);
+    gMC->Gsvolu("S10N","BOX",kNomexMaterial,nomexpar,3);
 
-     // create the rohacell volume 
 
-     gMC->Gsvolu("S09R","BOX",kRohaMaterial,rohapar,3);
-     gMC->Gsvolu("S10R","BOX",kRohaMaterial,rohapar,3);
+    // create the nomex volume (bulk)
 
-     // create the insulating material volume 
+    gMC->Gsvolu("S09X","BOX",kNomexBMaterial,nomexbpar,3);
+    gMC->Gsvolu("S10X","BOX",kNomexBMaterial,nomexbpar,3);
 
-     gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
-     gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
+    // create the insulating material volume 
 
-     // create the PCB volume 
+    gMC->Gsvolu("S09I","BOX",kInsuMaterial,insupar,3);
+    gMC->Gsvolu("S10I","BOX",kInsuMaterial,insupar,3);
 
-     gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
-     gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
+    // create the PCB volume 
+
+    gMC->Gsvolu("S09P","BOX",kPcbMaterial,pcbpar,3);
+    gMC->Gsvolu("S10P","BOX",kPcbMaterial,pcbpar,3);
  
-     // create the sensitive volumes,
-
-     gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
-     gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
-
-     // create the vertical frame volume 
-
-     gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
-     gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
-
-     // create the horizontal frame volume 
-
-     gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
-     gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
-
-     // create the horizontal border volume 
-
-     gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
-     gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
-
-     index = 0; 
-     for (i = 0; i < kNslats5; i++){
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-
-        if (i == 0 && quadrant == 2) continue;
-        if (i == 0 && quadrant == 4) continue;
-
-        sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
-        sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
-        Float_t xvFrame  = (slatLength5[i] - kVframeLength)/2.;
-
-        // position the vertical frames 
-        if (i != 1) { 
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        } else {  // no rounded spacer yet
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          //      GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
-          //      GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
-        }
-
-        // position the panels and the insulating material 
-        for (j = 0; j < kNPCB5[i]; j++){
-          if (i == 1 && j == 0) continue;
-          index++;
-          Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5); 
-
-          Float_t zPanel = spar[2] - panelpar[2]; 
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09C", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10C", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
-          GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
-        }
-       } 
-     }
-
-     // position the rohacell volume inside the panel volume
-     gMC->Gspos("S09R",1,"S09C",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S10R",1,"S10C",0.,0.,0.,0,"ONLY"); 
-
-     // position the PCB volume inside the insulating material volume
-     gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY"); 
-     // position the horizontal frame volume inside the PCB volume
-     gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY"); 
-     gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY"); 
-     // position the sensitive volume inside the horizontal frame volume
-     gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3); 
-     gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3); 
-     // position the border volumes inside the PCB volume
-     Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
-     gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY"); 
-     gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY"); 
-
-     //      // create the NULOC volume and position it in the horizontal frame
-
-     gMC->Gsvolu("S09N","BOX",kNulocMaterial,nulocpar,3);
-     gMC->Gsvolu("S10N","BOX",kNulocMaterial,nulocpar,3);
-     index = 0;
-     for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
-       index++; 
-       gMC->Gspos("S09N",2*index-1,"S09B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S09N",2*index  ,"S09B", xx, 0., kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S10N",2*index-1,"S10B", xx, 0.,-kBframeWidth/4., 0, "ONLY");
-       gMC->Gspos("S10N",2*index  ,"S10B", xx, 0., kBframeWidth/4., 0, "ONLY");
-     }
-
-     //      // position the volumes approximating the circular section of the pipe
-     Float_t yoffs = kSensHeight/2. - kYoverlap; 
-     Float_t epsilon = 0.001; 
-     Int_t ndiv = 10;
-     Double_t divpar[3];
-     Double_t dydiv = kSensHeight/ndiv;
-     Double_t ydiv = yoffs -dydiv;
-     Int_t imax = 0; 
-     //     for (Int_t islat=0; islat<kNslats3; islat++) imax += kNPCB3[islat]; 
-     imax = 1; 
-     Float_t rmin = 40.;
-     Float_t shiftR = 0.;
-     for (Int_t idiv = 0;idiv < ndiv; idiv++){ 
-       ydiv += dydiv;
-       Float_t xdiv = 0.; 
-       if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
-       divpar[0] = (kPcbLength-xdiv-shiftR)/2.; 
-       divpar[1] = dydiv/2. - epsilon;
-       divpar[2] = kSensWidth/2.; 
-       Float_t xvol = (kPcbLength+xdiv)/2.+ shiftR;
-       Float_t yvol = ydiv + dydiv/2.;
-
-       for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
-        sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
-        sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
-
-        GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-        GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10,  quadrant*100+imax+4*idiv+1,
-                                                     TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength+kYoverlap,0.),3,divpar);
-       }
-     }
-     // cout << "Geometry for Station 5...... done" << endl;
+    // create the sensitive volumes,
+
+    gMC->Gsvolu("S09G","BOX",kSensMaterial,dum,0);
+    gMC->Gsvolu("S10G","BOX",kSensMaterial,dum,0);
+
+    // create the vertical frame volume 
+
+    gMC->Gsvolu("S09V","BOX",kVframeMaterial,vFramepar,3);
+    gMC->Gsvolu("S10V","BOX",kVframeMaterial,vFramepar,3);
+
+    // create the horizontal frame volume 
+
+    gMC->Gsvolu("S09H","BOX",kHframeMaterial,hFramepar,3);
+    gMC->Gsvolu("S10H","BOX",kHframeMaterial,hFramepar,3);
+
+    // create the horizontal border volume 
+
+    gMC->Gsvolu("S09B","BOX",kBframeMaterial,bFramepar,3);
+    gMC->Gsvolu("S10B","BOX",kBframeMaterial,bFramepar,3);
+
+    index = 0; 
+    for (i = 0; i < kNslats5; i++){
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+
+       if (i == 0 && quadrant == 2) continue;
+       if (i == 0 && quadrant == 4) continue;
+
+       sprintf(idSlatCh9,"LE%d",ConvertSlatNum(i,quadrant,kNslats5-1));
+       sprintf(idSlatCh10,"LF%d",ConvertSlatNum(i,quadrant,kNslats5-1));
+       Float_t xvFrame  = (slatLength5[i] - kVframeLength)/2.; // ok
+
+       // position the vertical frames (spacers)
+       if (i != 1) { 
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       } else {  // no rounded spacer yet
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         //       GetEnvelopes(8)->AddEnvelopeConstituent("S09V", idSlatCh9, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i-1)*10+quadrant,TGeoTranslation(xvFrame,0.,0.));
+         //       GetEnvelopes(9)->AddEnvelopeConstituent("S10V", idSlatCh10, (2*i)*10+quadrant,TGeoTranslation(-xvFrame,0.,0.));
+       }
+
+       // position the panels and the insulating material 
+       for (j = 0; j < kNPCB5[i]; j++){
+         if (i == 1 && j == 0) continue;
+         index++;
+         Float_t xx = kSensLength * (-kNPCB5[i]/2.+j+.5); 
+
+         Float_t zPanel = spar[2] - nomexbpar[2]; 
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09X", idSlatCh9, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(8)->AddEnvelopeConstituent("S09I", idSlatCh9, index,TGeoTranslation(xx,0.,0.));
+
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index-1,TGeoTranslation(xx,0.,zPanel));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10X", idSlatCh10, 2*index,TGeoTranslation(xx,0.,-zPanel));
+         GetEnvelopes(9)->AddEnvelopeConstituent("S10I", idSlatCh10, index,TGeoTranslation(xx,0.,0.));
+       }
+      } 
+    }
+
+    // position the nomex volume inside the panel volume
+    gMC->Gspos("S09N",1,"S09C",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S10N",1,"S10C",0.,0.,0.,0,"ONLY"); 
+
+    // position panel  volume inside the bulk nomex material volume
+    gMC->Gspos("S09C",1,"S09X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+    gMC->Gspos("S10C",1,"S10X",0.,0.,kNomexBWidth/2.,0,"ONLY"); 
+
+    // position the PCB volume inside the insulating material volume
+    gMC->Gspos("S09P",1,"S09I",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S10P",1,"S10I",0.,0.,0.,0,"ONLY"); 
+
+    // position the horizontal frame volume inside the PCB volume
+    gMC->Gspos("S09H",1,"S09P",0.,0.,0.,0,"ONLY"); 
+    gMC->Gspos("S10H",1,"S10P",0.,0.,0.,0,"ONLY"); 
+
+    // position the sensitive volume inside the horizontal frame volume
+    gMC->Gsposp("S09G",1,"S09H",0.,0.,0.,0,"ONLY",senspar,3); 
+    gMC->Gsposp("S10G",1,"S10H",0.,0.,0.,0,"ONLY",senspar,3); 
+
+    // position the border volumes inside the PCB volume
+    Float_t yborder = ( kPcbHeight - kBframeHeight ) / 2.; 
+    gMC->Gspos("S09B",1,"S09P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S09B",2,"S09P",0.,-yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S10B",1,"S10P",0., yborder,0.,0,"ONLY"); 
+    gMC->Gspos("S10B",2,"S10P",0.,-yborder,0.,0,"ONLY"); 
+
+    //      // create the NULOC volume and position it in the horizontal frame
+
+    gMC->Gsvolu("S09E","BOX",kNulocMaterial,nulocpar,3);
+    gMC->Gsvolu("S10E","BOX",kNulocMaterial,nulocpar,3);
+    index = 0;
+    for (xx = -xxmax; xx <= xxmax; xx += 2*kNulocLength) { 
+      index++; 
+      gMC->Gspos("S09E",2*index-1,"S09B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S09E",2*index  ,"S09B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S10E",2*index-1,"S10B", xx, 0.,-kBframeWidth/2. + kNulocWidth/2, 0, "ONLY");
+      gMC->Gspos("S10E",2*index  ,"S10B", xx, 0., kBframeWidth/2. - kNulocWidth/2, 0, "ONLY");
+    }
+
 
+    // position the volumes approximating the circular section of the pipe
+    Float_t yoffs = kSensHeight/2.; 
+    Float_t epsilon = 0.001; 
+    Int_t ndiv = 10;
+    Double_t divpar[3];
+    Double_t dydiv = kSensHeight/ndiv;
+    Double_t ydiv = yoffs -dydiv;
+    Int_t imax = 0; 
+    imax = 1; 
+    Float_t rmin = 40.;
+    for (Int_t idiv = 0;idiv < ndiv; idiv++){ 
+      ydiv += dydiv;
+      Float_t xdiv = 0.; 
+      if (ydiv < rmin) xdiv = rmin * TMath::Sin( TMath::ACos(ydiv/rmin) );
+      divpar[0] = (kPcbLength-xdiv)/2.; 
+      divpar[1] = dydiv/2. - epsilon;
+      divpar[2] = kSensWidth/2.; 
+      Float_t xvol = (kPcbLength+xdiv)/2.;
+      Float_t yvol = ydiv + dydiv/2.;
+
+      for (Int_t quadrant = 1; quadrant <= 4; quadrant++) {
+       sprintf(idSlatCh9,"LE%d",ConvertSlatNum(1,quadrant,kNslats5-1));
+       sprintf(idSlatCh10,"LF%d",ConvertSlatNum(1,quadrant,kNslats5-1));
+
+       GetEnvelopes(8)->AddEnvelopeConstituentParam("S09G", idSlatCh9, quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
+       GetEnvelopes(9)->AddEnvelopeConstituentParam("S10G", idSlatCh10,  quadrant*100+imax+4*idiv+1,
+                                                    TGeoTranslation(xvol-kPcbLength * kNPCB5[1]/2.,yvol-kPcbLength,0.),3,divpar);
+      }
     }
+    // cout << "Geometry for Station 5...... done" << endl;
+
+  }
 }