]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
revised geometry, fully parametrized and including HCAL possibility
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Dec 2002 17:48:52 +0000 (17:48 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 13 Dec 2002 17:48:52 +0000 (17:48 +0000)
EMCAL/AliEMCAL.cxx
EMCAL/AliEMCALGeometry.cxx
EMCAL/AliEMCALGeometry.h
EMCAL/AliEMCALv0.cxx

index aad20680a75e43a4efb399906f8dcdf3c662cbcd..8546a66cee4ff5be847957fb1c2dc94349fdb003 100644 (file)
@@ -94,6 +94,9 @@ void AliEMCAL::CreateMaterials()
   AliMaterial(3, "Al$", 26.98, 13., 2.7, 8.9, 999., 0, 0) ;
   // ---         Absorption length is ignored ^
 
+  // --- Copper ---
+  AliMaterial(4, "Cu$", 63.546, 29, 8.96, 1.43, 14.8, 0, 0) ; 
+  // ---         Absorption length is ignored ^
 
 
   // DEFINITION OF THE TRACKING MEDIA
@@ -109,7 +112,7 @@ void AliEMCAL::CreateMaterials()
   AliMedium(0, "Air          $", 0, 0,
             isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
 
-  // The Lead                                                                       -> idtmed[1600]
+  // The Lead                                                                      -> idtmed[1600]
  
   AliMedium(1, "Lead      $", 1, 0,
             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1, 0, 0) ;
@@ -119,10 +122,13 @@ void AliEMCAL::CreateMaterials()
   AliMedium(2, "CPV scint.   $", 2, 1,
             isxfld, sxmgmx, 10.0, 0.001, 0.1, 0.001, 0.001, 0, 0) ;
 
-  // Various Aluminium parts made of Al                                             -> idtmed[1602]
+  // Various Aluminium parts made of Al                                            -> idtmed[1602]
   AliMedium(3, "Al parts     $", 3, 0,
              isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
 
+  // Copper for HCal (post shower)                                                 -> idtmed[1603]
+  AliMedium(4, "Copper       $", 4, 0,
+             isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001, 0, 0) ;
 
 
 
@@ -139,12 +145,19 @@ void AliEMCAL::CreateMaterials()
   gMC->Gstpar(idtmed[1600], "DCUTE",0.00001) ;
   gMC->Gstpar(idtmed[1600], "DCUTM",0.00001) ;
 
-// --- and in aluminium parts ---
+// --- in aluminium parts ---
   gMC->Gstpar(idtmed[1602], "LOSS",3.) ;
   gMC->Gstpar(idtmed[1602], "DRAY",1.) ;
   gMC->Gstpar(idtmed[1602], "DCUTE",0.00001) ;
   gMC->Gstpar(idtmed[1602], "DCUTM",0.00001) ;
 
+// --- in copper parts ---
+  gMC->Gstpar(idtmed[1603], "LOSS",3.) ;
+  gMC->Gstpar(idtmed[1603], "DRAY",1.) ;
+  gMC->Gstpar(idtmed[1603], "DCUTE",0.00001) ;
+  gMC->Gstpar(idtmed[1603], "DCUTM",0.00001) ;
+
+
 
 // --- and finally thresholds for photons and electrons in the scintillator ---
   gMC->Gstpar(idtmed[1601],"CUTGAM",0.00008) ;
index 6f796f29328b60c62bf616932dda55e15147346d..3176c195df975bf9ccf0c5ce2056bd17409171b8 100644 (file)
@@ -63,12 +63,14 @@ void AliEMCALGeometry::Init(void){
     if( name != "EMCALArch1a" &&
        name != "EMCALArch1b" && 
        name != "EMCALArch2a" && 
-       name != "EMCALArch2b"  ){
-      Fatal("Init", "%s is not a known geometry (choose among EMCALArch1a, EMCALArch1b, EMCALArch2a and EMCALArch2b)",  name.Data()) ;  
+       name != "EMCALArch2b" && 
+       name != "EMCALArch1aN" ){
+      Fatal("Init", "%s is not a known geometry (choose among EMCALArch1a, EMCALArch1b, EMCALArch2a and EMCALArch2b, EMCALArch1aN)",  name.Data()) ;  
     } // end if
     //
     if ( name == "EMCALArch1a"  ||
-        name == "EMCALArch1b" ) {
+        name == "EMCALArch1b"  || 
+        name == "EMCALArch1aN") {
       fNZ         = 96;
       fNPhi       = 144;
     } // end if
@@ -79,30 +81,50 @@ void AliEMCALGeometry::Init(void){
     } // end if
     if ( name == "EMCALArch1a"  ||
         name == "EMCALArch2a" ) {
-      fNLayers    = 21;
+      fNPRLayers  = 2;
+      fNECLayers  = 19;
+      fNHCLayers  = 0;
     } // end if
     if ( name == "EMCALArch1b"  ||
         name == "EMCALArch2b" ) {
-       fNLayers    = 25;
+       fNPRLayers  = 2;
+       fNECLayers  = 23;
+       fNHCLayers  = 0;
     } // end if
+    if ( name == "EMCALArch1aN") { 
+      fNPRLayers   = 2;
+      fNECLayers  = 19;
+      fNHCLayers  = 14;
+    }
 
     // geometry
-    fAlFrontThick   = 3.18; // cm, Thickness of front Al layer
-    fGap2Active     = 1.0;  // cm, Gap between Al and 1st Scintillator
-    fPbRadThickness = 0.5; // cm, Thickness of the Pb radiators.
-    fPreShowerSintThick = 0.6; // cm, Thickness of the sintilator for the
-                               // preshower part of the calorimeter
-    fFullShowerSintThick = 0.5; // cm, Thickness of the sintilator for the
-                                // full shower part of the calorimeter
     fArm1PhiMin     =  60.0; // degrees, Starting EMCAL Phi position
     fArm1PhiMax     = 180.0; // degrees, Ending EMCAL Phi position
     fArm1EtaMin     = -0.7; // pseudorapidity, Starting EMCAL Eta position
     fArm1EtaMax     = +0.7; // pseudorapidity, Ending EMCAL Eta position
+
+    fAlFrontThick        = 3.18; // cm, Thickness of front Al layer
+    fGap2Active          = 1.0;  // cm, Gap between Al and 1st Scintillator
+    fPbRadThickness      = 0.5;  // cm, Thickness of the Pb radiators.
+    fPreShowerSintThick  = 0.6;  // cm, Thickness of the sintilator for the preshower part of the calorimeter
+    fFullShowerSintThick = 0.5;  // cm, Thickness of the sintilator for the dull shower part of the calorimeter
+    fCuRadThickness      = 0.0;  // cm, Thickness of the Cu radiators.
+
+    if (name ==  "EMCALArch1aN") {
+      fAlFrontThick        = 3.0;  // cm, Thickness of front Al layer
+      fGap2Active          = 1.0;  // cm, Gap between Al and 1st Scintillator
+      fPbRadThickness      = 0.6;  // cm, Thickness of the Pb radiators.
+      fPreShowerSintThick  = 0.5;  // cm, Thickness of the sintilator for the preshower part of the calorimeter
+      fFullShowerSintThick = 0.4;  // cm, Thickness of the sintilator for the full shower part of the calorimeter
+      fCuRadThickness      = 1.0;  // cm, Thickness of the Cu radiators.
+   }
+
     fIPDistance     = 454.0; // cm, Radial distance to inner surface of EMCAL
-    fShellThickness = fAlFrontThick + fGap2Active + 2.*(GetPreSintThick() + GetPbRadThick()) + 
-       (fNLayers-3)*(GetFullSintThick()+ GetPbRadThick()) + GetFullSintThick() ;
-    //below; cm, Z length of the EMCAL.
-    fZLength        = 2.*ZFromEtaR(fIPDistance+fShellThickness,fArm1EtaMax);
+    fShellThickness = fAlFrontThick + fGap2Active + 2.*(GetPreSintThick() + GetPbRadThick()) + // pre shower 
+      (fNECLayers-1)*(GetFullSintThick()+ GetPbRadThick()) + // E cal -1 because the last element is a scintillator
+      fNHCLayers*(GetFullSintThick()+ GetCuRadThick()) + // H cal
+      GetFullSintThick() ; // last scintillator
+    fZLength        = 2.*ZFromEtaR(fIPDistance+fShellThickness,fArm1EtaMax); // Z coverage
     fEnvelop[0]     = fIPDistance; // mother volume inner radius
     fEnvelop[1]     = fIPDistance + fShellThickness; // mother volume outer r.
     fEnvelop[2]     = 1.00001*fZLength; // add some padding for mother volume. 
index d4277386a6fce6d374901d8d221dfa94938a184e..cce1331dce21f652ad1adb57e2351720fd3e4fb2 100644 (file)
@@ -66,14 +66,15 @@ public:
                                       ((Float_t)fNZ);}
   const Float_t GetDeltaPhi() const {return (fArm1PhiMax-fArm1PhiMin)/
                                       ((Float_t)fNPhi);}
-  const Int_t   GetNLayers() const {return fNLayers ;}
+  const Int_t   GetNECLayers() const {return fNECLayers ;}
+  const Int_t   GetNHCLayers() const {return fNHCLayers ;}
+  const Int_t   GetNPRLayers() const {return fNPRLayers;}
   const Int_t   GetNZ() const {return fNZ ;}
   const Int_t   GetNEta() const {return fNZ ;}
   const Int_t   GetNPhi() const {return fNPhi ;}
   const Int_t   GetNTowers() const {return fNPhi * fNZ ;}
-  const Float_t GetPbRadThick()const { // returns Pb radiator thickness in cm.
-    return fPbRadThickness;
-  }
+  const Float_t GetPbRadThick()const {return fPbRadThickness;}
+  const Float_t GetCuRadThick()const {return fCuRadThickness;}
   const Float_t GetFullSintThick() const { // returns Full tower sintilator
     // thickness in cm.
     return fFullShowerSintThick;
@@ -131,22 +132,25 @@ private:
   Float_t fFullShowerSintThick;// Thickness of the sintilaor for the full
   // shower part of the calorimeter
   Float_t fPbRadThickness; // Thickness of Pb radiators cm.
+  Float_t fCuRadThickness; // Thickness of Cu radiators cm.
   Float_t fArm1PhiMin; // Minimum angular position of EMCAL in Phi (degrees)
   Float_t fArm1PhiMax; // Maximum angular position of EMCAL in Phi (degrees)
   Float_t fArm1EtaMin; // Minimum pseudorapidity position of EMCAL in Eta
   Float_t fArm1EtaMax; // Maximum pseudorapidity position of EMCAL in Eta
   
   // It is assumed that Arm1 and Arm2 have the same following parameters
-  Float_t fEnvelop[3];      // the GEANT TUB for the detector 
-  Float_t fIPDistance; // Radial Distance of the inner surface of the EMCAL
+  Float_t fEnvelop[3];     // the GEANT TUB for the detector 
+  Float_t fIPDistance;     // Radial Distance of the inner surface of the EMCAL
   Float_t fShellThickness; // Total thickness in (x,y) direction
   Float_t fZLength;        // Total length in z direction
   Float_t fGap2Active;     // Gap between the envelop and the active material
-  Int_t   fNLayers;        // Number of layers of material in the R direction
+  Int_t   fNECLayers;        // Number of layers of material in the R direction for the electromagnetic calorimeter 
+  Int_t   fNPRLayers;      // Number of layers of material in the R direction for the preshower
+  Int_t   fNHCLayers;      // Number of layers of material in the R direction for the hadron calorimeter
   Int_t   fNZ;             // Number of Towers in the Z direction
-  Int_t   fNPhi;           //Number of Towers in the Phi Direction
+  Int_t   fNPhi;           // Number of Towers in the Phi Direction
   
-  ClassDef(AliEMCALGeometry,4) // EMCAL geometry class 
+  ClassDef(AliEMCALGeometry,5) // EMCAL geometry class 
     
     };
 
index d52dcab9f8bbed696edb336ef3fa64605919bfbf..e450c9cbe8493761d5edba20c2c7b27a917a700b 100644 (file)
@@ -166,44 +166,59 @@ void AliEMCALv0::CreateGeometry()
     if (fDebug==2) 
       Info("CreateGeometry","rXEN1 = %f, %f\n", envelopA[5], envelopA[6]); 
 
-    // Create mini-envelopes which will contain the PreShower scintillator-Lead-scintillator-lead (XU0) 
+    // Create mini-envelopes which will contain the PreShower scintillator-Lead-scintillator-lead  
    
-    TString label = "XU0";
-
-    envelopA[5] = envelopA[5] + geom->GetGap2Active() 
-      + geom->GetAlFrontThickness();                              // rmin at z1
-    envelopA[4] = geom->ZFromEtaR(envelopA[5],
-                                 geom->GetArm1EtaMin());         // z coordinate 1
-    envelopA[7] = geom->ZFromEtaR(envelopA[5],
-                                 geom->GetArm1EtaMax());         // z coordinate 2
-    envelopA[6] = envelopA[5] + 2 * (geom->GetPreSintThick()
-      + geom->GetPbRadThick() );                                  // rmax at z1
-    envelopA[8] = envelopA[5] ;                                   // radii are the same.
-    envelopA[9] = envelopA[6] ;                                   // radii are the same.
+//     TString label = "XU0";
+
+//     envelopA[5] = envelopA[5] + geom->GetGap2Active() 
+//       + geom->GetAlFrontThickness();                              // rmin at z1
+//     envelopA[4] = geom->ZFromEtaR(envelopA[5],
+//                               geom->GetArm1EtaMin());         // z coordinate 1
+//     envelopA[7] = geom->ZFromEtaR(envelopA[5],
+//                               geom->GetArm1EtaMax());         // z coordinate 2
+//     envelopA[6] = envelopA[5] + 2 * (geom->GetPreSintThick()
+//       + geom->GetPbRadThick() );                                  // rmax at z1
+//     envelopA[8] = envelopA[5] ;                                   // radii are the same.
+//     envelopA[9] = envelopA[6] ;                                   // radii are the same.
     
-    gMC->Gsvolu(label.Data(), "PGON", idtmed[1599], envelopA, 10);// Polygone filled with air 
+//     gMC->Gsvolu(label.Data(), "PGON", idtmed[1599], envelopA, 10);// Polygone filled with air 
 
-    // Position XU0 in XEN1
+//     // Position XU0 in XEN1
   
-    gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY");
+//     gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY");
 
     if (fDebug==2) 
-      Info("CreateGeometry","rXU0 = %f, %f\n", envelopA[5], envelopA[6]); 
+      Info("CreateGeometry","XU0 = %f, %f\n", envelopA[5], envelopA[6]); 
 
-    // Create mini-envelopes which will contain the Tower scintillator-Lead-scintillator-lead (XU1 -> XU9)
+    // Create mini-envelopes which will contain the Tower scintillator-radiator-scintillator-radiator 
     
-    Float_t tseg = geom->GetFullSintThick()+geom->GetPbRadThick(); // thickness of scintillator+Pb
+    TString label ;
+
+    envelopA[5] = envelopA[5] + geom->GetGap2Active() // we are at the first scintllator
+      + geom->GetAlFrontThickness();                  // rmin at z1
+    envelopA[6] = envelopA[5] ;
+
  
     Int_t i ; 
-    for (i = 1; i < ((geom->GetNLayers()-2)/2) + 1 ; i++ ){
+
+    Int_t nLayers = geom->GetNPRLayers() + geom->GetNECLayers() + geom->GetNHCLayers() ;
+
+    for (i = 0; i < nLayers/2 ; i++ ){
        label = "XU" ;
        label += i ;
+       Float_t tseg ; 
+       if (i == 0 ) 
+         tseg = 2 *(geom->GetPreSintThick()+geom->GetPbRadThick()); // thickness of 2 * scintillator+Pb in pre shower
+       else if ( i <= geom->GetNECLayers()/2) 
+         tseg = 2* (geom->GetFullSintThick()+geom->GetPbRadThick()); // thickness of 2 * scintillator+Pb in E Cal
+       else 
+         tseg = 2* (geom->GetFullSintThick()+geom->GetCuRadThick()); // thickness of 2 * scintillator+Cu in H Cal 
        envelopA[5] = envelopA[6] ;                                   // rmin at z1
        envelopA[4] = geom->ZFromEtaR(envelopA[5],
                                      geom->GetArm1EtaMin());         // z coordinate 1
        envelopA[7] = geom->ZFromEtaR(envelopA[5],
                                      geom->GetArm1EtaMax());         // z coordinate 2
-       envelopA[6] = envelopA[5] + 2 * tseg ;                        // rmax at z1
+       envelopA[6] = envelopA[5] + tseg ;                            // rmax at z1
        envelopA[8] = envelopA[5] ;                                   // radii are the same.
        envelopA[9] = envelopA[6] ;                                   // radii are the same.
  
@@ -213,15 +228,13 @@ void AliEMCALv0::CreateGeometry()
        
        gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
 
-       if (fDebug==2) 
-         Info("CreateGeometry","rXEN%d = %f, %f\n", i, envelopA[5], envelopA[6]); 
+       Info("CreateGeometry","XU%d = %f, %f\n", i, envelopA[5], envelopA[6]); 
 
     } // end  i
  
   
     // Create one mini-envelope which will contain the last Tower scintillator (XU(nlayers-1)/2)
 
-    tseg = geom->GetFullSintThick() ;
     label = "XU" ;
     label += i ;
     envelopA[5] = envelopA[6] ;                                   // rmin at z1
@@ -229,18 +242,17 @@ void AliEMCALv0::CreateGeometry()
                                  geom->GetArm1EtaMin());         // z coordinate 1
     envelopA[7] = geom->ZFromEtaR(envelopA[5],
                                  geom->GetArm1EtaMax());         // z coordinate 2
-    envelopA[6] = envelopA[5] + tseg ;                            // rmax at z1
+    envelopA[6] = envelopA[5] + geom->GetFullSintThick() ;        // rmax at z1
     envelopA[8] = envelopA[5] ;                                   // radii are the same.
     envelopA[9] = envelopA[6] ;                                   // radii are the same.
 
     gMC->Gsvolu(label.Data(), "PGON", idtmed[1599], envelopA, 10); // Polygone filled with air
 
-    // Position XU10 in XEN1
+    // Position the last minienvelope in XEN1
   
     gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
   
-    if (fDebug==2) 
-      Info("CreateGeometry","rXEN%d = %f, %f\n", i, envelopA[5], envelopA[6]); 
+    Info("CreateGeometry","XEN%d = %f, %f\n", i, envelopA[5], envelopA[6]); 
   
     // Create the shapes of active material (LEAD/Aluminium/Scintillator)
     // to be placed
@@ -272,52 +284,91 @@ void AliEMCALv0::CreateGeometry()
   
     gMC->Gsvolu("XPBX", "PGON", idtmed[1600], dum, 0);      // PGON filled with Lead (shape to be defined by GSPOSP)
   
+    gMC->Gsvolu("XCUX", "PGON", idtmed[1603], dum, 0);      // PGON filled with Copper (shape to be defined by GSPOSP)
+
     gMC->Gsdvn("XPHI", "XPST", geom->GetNPhi(), 2);         // Divide eta section of scintillators into phi segments.
  
     // Position alternatively scintillator and  Lead Layers in XUi.
 
     envelopD[6] = envelopB[6] + geom->GetGap2Active() ;// gap between Al layer and XU0
-
-    for (int i = 0; i < geom->GetNLayers() ; i++ ){
-       label = "XU" ;
-        label += static_cast<Int_t> (i/2)  ; // we will place two layers (i = one layer) in each mini envelope)        
-        envelopC[5] = envelopD[6] ; //rmin
-       envelopC[6] = envelopD[6] + ((i > 1)  ? geom->GetFullSintThick() : 
-                                    geom->GetPreSintThick());//rmax larger for first two layers (preshower)
-       envelopC[8] = envelopD[6] ; //rmin
-       envelopC[9] = envelopD[6] + ((i > 1 ) ? geom->GetFullSintThick() :
-                                    geom->GetPreSintThick());//rmax larger for first two layers (preshower)
-       for (int j =0; j < (geom->GetNEta()) ; j++){
+    
+    for (int i = 0; i < nLayers; i++ ){
+      label = "XU" ;
+      label += static_cast<Int_t> (i/2)  ; // we will place two layers (i = one layer) in each mini envelope)  
+
+      Float_t scthick ; // scintillator thickness 
+      if ( i <  geom->GetNPRLayers() ) // its a preshower
+       scthick = geom->GetPreSintThick() ;
+      else if( i < geom->GetNPRLayers() + geom->GetNECLayers() ) // its an EMCAL section
+       scthick = geom->GetFullSintThick() ;
+      else  // its an HCAL section
+       scthick = geom->GetFullSintThick() ;
+
+      envelopC[5] = envelopD[6] ;           //rmin
+      envelopC[6] = envelopC[5] + scthick ; //rmax
+      envelopC[8] = envelopC[5] ;           //rmin
+      envelopC[9] = envelopC[6] ;           //rmax
+
+
+      //       envelopC[6] = envelopD[6] + ((i > 1)  ? geom->GetFullSintThick() : geom->GetPreSintThick());//rmax larger for first two layers (preshower)
+      //       envelopC[9] = envelopD[6] + ((i > 1 ) ? geom->GetFullSintThick() :geom->GetPreSintThick());//rmax larger for first two layers (preshower)
+
+      Info("CreateGeometry", "volume = %s, name = XPST thickness = %f deb = %f/%f fin = %f/%f", label.Data(), scthick, envelopC[5], envelopC[8], envelopC[6], envelopC[9]) ; 
+
+      for (int j =0; j < (geom->GetNEta()) ; j++){
+       etamin = geom->GetArm1EtaMin()+
+         (j*geom->GetDeltaEta());
+       etamax = geom->GetArm1EtaMin()+
+         ((j+1)*geom->GetDeltaEta());
+       envelopC[4] = geom->ZFromEtaR(envelopC[5],etamin); //z begin  
+       envelopC[7] = geom->ZFromEtaR(envelopC[5],etamax);// z end 
+       
+       gMC->Gsposp("XPST",1+j+i*(geom->GetNEta()), label.Data(), 
+                   0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10); // Position and define layer
+      } // end for j
+      
+      if (i < nLayers){ 
+       Float_t radthick ; // radiator thickness 
+       TString radname ;  // radiator name
+       if ( i <= 1 ) { // its a preshower
+         radthick =  geom->GetPbRadThick();
+         radname  =  "XPBX" ; 
+       }
+       else if( i <= geom->GetNECLayers()) {// its an EMCAL section
+         radthick = geom->GetPbRadThick();
+         radname  =  "XPBX" ; 
+       }
+       else {  // its an HCAL section
+         radthick = geom->GetCuRadThick();
+         radname  =  "XCUX" ; 
+       }
+
+       if ( i < nLayers -1 ) { // except for the last XU which contains only one scintillator layer 
+
+         envelopD[5] = envelopC[6] ; //rmin
+         envelopD[8] = envelopD[5] ; //rmin
+         envelopD[6] = envelopD[5] + radthick ; // rmax
+         //  envelopD[6] = envelopC[6] + geom->GetPbRadThick();  //rmax
+         envelopD[9] = envelopD[6] ; //rmax
+         // envelopD[9] = envelopC[6] + geom->GetPbRadThick();  //rmax
+
+         Info("CreateGeometry", "volume = %s, name = %s thickness = %f deb = %f/%f fin = %f/%f", label.Data(), radname.Data(), radthick, envelopD[5], envelopD[8], envelopD[6], envelopD[9]) ; 
+
+         for (int j =0; j < (geom->GetNEta()) ; j++){
            etamin = geom->GetArm1EtaMin()+
-               (j*geom->GetDeltaEta());
+             (j*geom->GetDeltaEta());
            etamax = geom->GetArm1EtaMin()+
-               ((j+1)*geom->GetDeltaEta());
-           envelopC[4] = geom->ZFromEtaR(envelopD[6],etamin); //z begin  
-           envelopC[7] = geom->ZFromEtaR(envelopD[6],etamax);// z end 
-
-           gMC->Gsposp("XPST",1+j+i*(geom->GetNEta()), label.Data(), 
-                       0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10); // Position and define layer
-       } // end for j
-
-       if (i < (geom->GetNLayers()-1)){ // except for the last XU which contains only one scintillator layer
-           envelopD[5] = envelopC[6] ; //rmin
-           envelopD[6] = envelopC[6] + geom->GetPbRadThick();  //rmax
-           envelopD[8] = envelopC[6] ; //rmin
-           envelopD[9] = envelopC[6] + geom->GetPbRadThick();  //rmax
-           for (int j =0; j < (geom->GetNEta()) ; j++){
-               etamin = geom->GetArm1EtaMin()+
-                   (j*geom->GetDeltaEta());
-               etamax = geom->GetArm1EtaMin()+
-                   ((j+1)*geom->GetDeltaEta());
-               envelopD[4] = geom->ZFromEtaR(envelopC[6],etamin);//z begin  
-               envelopD[7] = geom->ZFromEtaR(envelopC[6],etamax);// z end
-
-               // Position and Define Layer
-
-               gMC->Gsposp("XPBX",1+j+i*(geom->GetNEta()), label.Data(), 
-                           0.0, 0.0, 0.0 , idrotm, "ONLY", envelopD, 10);
-           } // end for j
-       } // end if i
+             ((j+1)*geom->GetDeltaEta());
+           envelopD[4] = geom->ZFromEtaR(envelopD[5],etamin);//z begin  
+           envelopD[7] = geom->ZFromEtaR(envelopD[5],etamax);// z end
+           
+           // Position and Define Layer
+           
+           gMC->Gsposp(radname.Data(),1+j+i*(geom->GetNEta()), label.Data(), 
+                       0.0, 0.0, 0.0 , idrotm, "ONLY", envelopD, 10);
+         } // end for j
+       } // if not last layer
+      } // end if i
     }  // for i
 }