]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALv0.cxx
Small changes
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALv0.cxx
index 828f73ba2fbfc107357cf8ebc2bf13336138433b..f13ea3d9028ba2a6e49fad33d98af31913c3bb88 100644 (file)
@@ -12,7 +12,6 @@
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
 /* $Id$ */
 
 //_________________________________________________________________________
 
 
 // --- ROOT system ---
+
 #include "TPGON.h"
 #include "TTUBS.h"
 #include "TNode.h"
 #include "TRandom.h"
 #include "TGeometry.h"
-//#include "Tstring.h"
+#include "TVirtualMC.h"
 
 // --- Standard library ---
 
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <strstream.h>
-#include <iostream.h>
+#include <Rstrstream.h>
+#include <Riostream.h>
 
 // --- AliRoot header files ---
 
 #include "AliEMCALGeometry.h"
 #include "AliConst.h"
 #include "AliRun.h"
-#include "AliMC.h"
 
 ClassImp(AliEMCALv0)
 
 //______________________________________________________________________
 AliEMCALv0::AliEMCALv0(const char *name, const char *title):
-    AliEMCAL(name,title){
-    // Standard Constructor
-
-    if (strcmp(GetTitle(),"") != 0 )
-       fGeom =  AliEMCALGeometry::GetInstance(GetTitle(), "") ;
+  AliEMCAL(name,title)
+{
+  // ctor : title is used to identify the layout
+  GetGeometry() ; 
 
 }
+
 //______________________________________________________________________
-void AliEMCALv0::BuildGeometry(){
+void AliEMCALv0::BuildGeometry()
+{
     // Display Geometry for display.C
 
     const Int_t kColorArm1   = kBlue ;
 
-    // Difine the shape of the Calorimeter 
-  
+    AliEMCALGeometry * geom = GetGeometry() ; 
+
+    // Define the shape of the Calorimeter 
+    TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
     new TTUBS("Envelop1", "Tubs that contains arm 1", "void", 
-             fGeom->GetEnvelop(0),     // rmin 
-             fGeom->GetEnvelop(1) +30 ,     // rmax
-             fGeom->GetEnvelop(2)/2.0, // half length in Z
-             fGeom->GetArm1PhiMin(),   // minimun phi angle
-             fGeom->GetArm1PhiMax()    // maximun phi angle
+             geom->GetEnvelop(0),     // rmin 
+             geom->GetEnvelop(1) +30 ,     // rmax
+             geom->GetEnvelop(2)/2.0, // half length in Z
+             geom->GetArm1PhiMin(),   // minimun phi angle
+             geom->GetArm1PhiMax()    // maximun phi angle
        );
+
     // Place the Node
-    TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1") ;
+    top->cd();
+    TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1"
+                                    ,0., 0., 0., "") ;
     envelop1node->SetLineColor(kColorArm1) ;
     fNodes->Add(envelop1node) ;
 }
+
 //______________________________________________________________________
-void AliEMCALv0::CreateGeometry(){
-    // Create the EMCAL geometry for Geant
+void AliEMCALv0::CreateGeometry()
+{
+  // Create the EMCAL geometry for Geant
+  // Geometry of a tower
+  //|-----------------------------------------------------| XEN1
+  //| |                                                 | |
+  //| |    Al thickness = GetAlFrontThickness()         | |
+  //| |                                                 | |
+  //| |                                                 | |
+  //| |                                                 | |
+  //|  -------------------------------------------------  |
+  //| |    Air Gap = GetGap2Active()                    | |
+  //| |                                                 | |
+  //|  -------------------------------------------------  |
+  //| |    XU0 : XPST (PreShower e = GetPRScintThick() )| |
+  //|  -------------------------------------------------  |
+  //| |    XU0 : XPBX (PreShower e = GetPRPbRadThick() )| |
+  //|  -------------------------------------------------  |
+  //| |    XU0 : XPST (PreShower e = GetPEScintThick() )| |
+  //|  -------------------------------------------------  |
+  //| |    XU0 : XPBX (PreShower e = GetPRPbRadThick() )| |
+  //|  -------------------------------------------------  |
+  //|    etc ..... GetNPRLayers() times                   |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPST (ECAL e = GetECScintThick() )     | |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPBX (ECAL e = GetECPbRadThick() )     | |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPST (ECAL e = GetECScintThick()       | |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPBX (ECAL e = GetECPbRadThick() )     | |
+  //|  -------------------------------------------------  |
+  //|    etc ..... GetNECLayers() times                   |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPST (ECAL e = GetHCScintThick() )     | |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPBX (ECAL e = GetHCPbRadThick() )     | |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPST (ECAL e = GetHCScintThick()       | |
+  //|  -------------------------------------------------  |
+  //| |    XU1 : XPBX (ECAL e = GetHCPbRadThick() )     | |
+  //|  -------------------------------------------------  |
+  //|    etc ..... GetNHCLayers() times                   |
+  //|  -------------------------------------------------  |
+  //| |    XU10 : XPST (HCAL e = GetHCScintThick() )    | |
+  //|-----------------------------------------------------|
+    Float_t etamin,etamax;
+    Float_t *dum=0;
 
-    AliEMCALv0 *emcaltmp = (AliEMCALv0*)gAlice->GetModule("EMCAL") ;
+    AliEMCALGeometry * geom = GetGeometry() ; 
 
-    if ( emcaltmp == NULL ) {
-       Warning("CreateGeometry","detector not found!");
-       return;
+    if(!(geom->IsInitialized())){
+       Error("CreateGeometry","EMCAL Geometry class has not been set up.");
     } // end if
+
     // Get pointer to the array containing media indices
     Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
 
-    // Create an Envelope within which to place the Detector 
-    Float_t envelopA[5]  ; 
-      envelopA[0] = fGeom->GetEnvelop(0) ;         // rmin
-      envelopA[1] = fGeom->GetEnvelop(1) + 30 ;    // rmax
-      envelopA[2] = fGeom->GetEnvelop(2) / 2.0 ;   // dz
-      envelopA[3] = fGeom->GetArm1PhiMin() ;       // minimun phi angle
-      envelopA[4] = fGeom->GetArm1PhiMax() ;       // maximun phi angle
-    
-    
-     // create XEN1
-    gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; //filled with air
-    
     Int_t idrotm = 1;
     AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
 
-    // Position the Envelope in Alice  
-    gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "MANY") ;
-     envelopA[1]  =envelopA[0] + fGeom->GetGap2Active(); 
-    TString label = "XU0";
 
-         envelopA[0] = envelopA[1]+ 3.18 ; //rmin Start mini envelopes after the aluminium layer
-       envelopA[1] = envelopA[0] + 2.2    ;  //rmax larger for first two layers (preshower)
 
-    gMC->Gsvolu(label.Data(), "TUBS ", idtmed[1599], envelopA, 5) ; //filled with air
-    gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "MANY") ; // Place XU0 in to XEN1
+    // Create the EMCAL Mother Volume (a polygone) within which to place the Detector and named XEN1 
 
- for (int i = 1; i < ((fGeom->GetNLayers()-1)/2) + 1 ; i++ ){
-       label = "XU" ;
-       label += i ;    
-       
-       envelopA[0] = envelopA[1] ; //rmin
-       envelopA[1] = envelopA[0] + 2.0  ;  //rmax 
+    Float_t envelopA[10];
+    envelopA[0] = geom->GetArm1PhiMin();                         // minimum phi angle
+    envelopA[1] = geom->GetArm1PhiMax() - geom->GetArm1PhiMin(); // angular range in phi
+    envelopA[2] = geom->GetNPhi();                               // number of sections in phi
+    envelopA[3] = 2;                                             // 2 z coordinates
+    envelopA[4] = geom->ZFromEtaR(geom->GetEnvelop(1),
+                                  geom->GetArm1EtaMin());       // z coordinate 1
+    envelopA[5] = geom->GetEnvelop(0) ;                          // rmin at z1
+    envelopA[6] = geom->GetEnvelop(1) ;                          // rmax at z1
+    envelopA[7] = geom->ZFromEtaR(geom->GetEnvelop(1),
+                                 geom->GetArm1EtaMax());        // z coordinate 2
+    envelopA[8] = envelopA[5] ;                                  // radii are the same.
+    envelopA[9] = envelopA[6] ;                                  // radii are the same.
 
-    gMC->Gsvolu(label.Data(), "TUBS ", idtmed[1599], envelopA, 5) ; //filled with air
-    gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "MANY") ;
+    gMC->Gsvolu("XEN1", "PGON ", idtmed[1599], envelopA, 10) ;   // Polygone filled with air 
 
-       } // end  i
+    // Position the EMCAL Mother Volume (XEN1) in Alice (ALIC)  
 
+    gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
     
+    if (gDebug==2) 
+      Info("CreateGeometry","rXEN1 = %f, %f\n", envelopA[5], envelopA[6]); 
+
+    // Create mini-envelopes which will contain the PreShower scintillator-Lead-scintillator-lead  
+   
+    if (gDebug==2) 
+      Info("CreateGeometry","XU0 = %f, %f\n", envelopA[5], envelopA[6]); 
+
+    // Create mini-envelopes which will contain the Tower scintillator-radiator-scintillator-radiator 
+    
+    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 ; 
+
+    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->GetPRScintThick()+geom->GetPRPbRadThick()); // thickness of 2 * scintillator+Pb in pre shower
+       else if ( i <= geom->GetNECLayers()/2) 
+         tseg = 2* (geom->GetECScintThick()+geom->GetECPbRadThick()); // thickness of 2 * scintillator+Pb in E Cal
+       else 
+         tseg = 2* (geom->GetHCScintThick()+geom->GetHCCuRadThick()); // thickness of 2 * scintillator+Cu in H Cal 
+       envelopA[5] = envelopA[6] ;                                   // rmin at z1
+       envelopA[4] = geom->ZFromEtaR(envelopA[5] + tseg,
+                                     geom->GetArm1EtaMin());         // z coordinate 1
+       envelopA[7] = geom->ZFromEtaR(envelopA[5] + tseg,
+                                     geom->GetArm1EtaMax());         // z coordinate 2
+       envelopA[6] = envelopA[5] + tseg ;                            // 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 XUi in XEN1
+       
+       gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
 
-    // Create the shapes of active material (LEAD/Aluminium/Scintillator) to be placed 
+       if (gDebug == 2)
+         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)
+
+    label = "XU" ;
+    label += i ;
+    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
+    if (geom->GetNHCLayers() == 0)                                // last scintillator is in ECAL
+      envelopA[6] = envelopA[5] + geom->GetECScintThick() ;       // rmax at z1
+    else                                                          // last scintillator is in HCAL
+      envelopA[6] = envelopA[5] + geom->GetECScintThick() ;       // 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 the last minienvelope in XEN1
+  
+    gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
+  
+    if(gDebug == 2) 
+      Info("CreateGeometry","XEN%d = %f, %f\n", i, envelopA[5], envelopA[6]); 
+  
+    // Create the shapes of active material (LEAD/Aluminium/Scintillator)
+    // to be placed
     Float_t envelopB[10]; // First Layer of Aluminium
     Float_t envelopC[10]; // Scintillator Layers
-    Float_t envelopD[10]; //  Lead Layers
+    Float_t envelopD[10]; // Lead Layers
+
+    envelopC[0] = envelopD[0] = envelopB[0] = envelopA[0] ;  // starting position in Phi
+    envelopC[1] = envelopD[1] = envelopB[1] = envelopA[1] ;  // angular range in phi          
+    envelopC[2] = envelopD[2] = envelopB[2] = envelopA[2] ;  // number of sections in Phi
+    envelopD[3] = envelopC[3] = envelopB[3] = envelopA[3] ;  // 2 z coordinates
+
+    Float_t dist = geom->GetEnvelop(0) + geom->GetAlFrontThickness() + geom->GetGap2Active() ; 
+    envelopB[4] = geom->ZFromEtaR(dist,
+                                 geom->GetArm1EtaMin());   // z co-ordinate 1
+    envelopB[5] = geom->GetEnvelop(0) ;                     // rmin at z1
+    envelopB[6] = envelopB[5] + geom->GetAlFrontThickness();// rmax at z1
+    envelopB[7] = geom->ZFromEtaR(dist,
+                                 geom->GetArm1EtaMax());   // z co-ordinate 2
+    envelopB[8] = envelopB[5] ;                             // radii are the same.
+    envelopB[9] = envelopB[6] ;                             // radii are the same.
+
+    // Define active volumes completely
     
-    envelopC[0] = envelopD[0] =  envelopB[0] = fGeom->GetArm1PhiMin(); //starting position in Phi
-    envelopC[1] = envelopD[1] =  envelopB[1] = fGeom->GetArm1PhiMax() -  // Angular size of the Detector in Phi
-                                              fGeom->GetArm1PhiMin();
-    envelopC[2] = envelopD[2] =  envelopB[2] = fGeom->GetNPhi() ; // Number of Section in Phi
-    envelopD[3] = envelopC[3] = envelopB[3] = 2; // each section will be passed 2 z coordinates    
-
-    envelopB[4] = (fGeom->GetEnvelop(0) + fGeom->GetGap2Active()) /
-                  (tan(2*atan(exp(0.7)))) ;                          // z co-ordinate 1
-    envelopB[5] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active(); //rmin at z1
-    envelopD[6] = envelopB[6] = envelopB[5] + 3.18;  //rmax at z1
-    envelopB[7] = (fGeom->GetEnvelop(0) + fGeom->GetGap2Active()) /
-                 (tan(2*atan(exp(-0.7)))) ;              // z co-ordinate 2
-    envelopB[8] = envelopB[5] ; //
-    envelopB[9] = envelopB[6] ; // radii are the same.
-
-    // filled shapes wit hactive material 
-    gMC->Gsvolu("XALU", "PGON", idtmed[1602], envelopB, 10); // Define Aluminium volume completely
-    gMC->Gsvolu("XPST", "PGON", idtmed[1601], 0, 0) ;  // The polystyrene layers will be defined when placed 
-    gMC->Gsvolu("XPBX", "PGON", idtmed[1600], 0, 0) ; //  as will the lead layers 
-    gMC->Gsdvn("XPHI", "XPST", fGeom->GetNPhi(), 2) ; //  Dividind eta polystyrene divisions into phi segments.
+    gMC->Gsvolu("XALU", "PGON", idtmed[1602], envelopB, 10); // PGON filled with Al
     
-    // Position Aluminium Layer in the Envelope 
-    gMC->Gspos("XALU", 1, "XEN1", 0.0, 0.0, 0.0 , idrotm, "ONLY") ;
+    gMC->Gspos("XALU", 1, "XEN1", 0.0, 0.0, 0.0 , idrotm, "ONLY") ; // Position Aluminium Layer in XEN1
 
-// The loop below places the scintillator in Lead Layers alternately.
+    gMC->Gsvolu("XPST", "PGON", idtmed[1601], dum, 0);      // PGON filled with Scintillator (shape to be defined by GSPOSP)
+  
+    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.
  
-    for (int i = 0; i < fGeom->GetNLayers() ; i++ ){
-
-       label = "XU" ;
-       
-        label += (int) 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)  ? 0.5 : 0.6)  ;  //rmax larger for first two layers (preshower)
-       envelopC[8] = envelopD[6] ; //rmin
-       envelopC[9] = envelopD[6] + ((i > 1 ) ? 0.5 : 0.6)  ;  //rmax larger for first two layers (preshower)
-       for (int j =0; j < (fGeom->GetNZ()) ; j++){
-           envelopC[4] = envelopD[6]/tan(2*atan(exp(0.7-(j*1.4/
-                                                      (fGeom->GetNZ()))))); //z begin  
-           envelopC[7] = envelopD[6]/tan(2*atan(exp(0.7-((j+1)*1.4/
-                                                      (fGeom->GetNZ()))))); // z end 
-           gMC->Gsposp("XPST",1+j+i*(fGeom->GetNZ()), label.Data(), // should be used but there's a weird crash above i = 18, 
-                       0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10); // Position and define layer
-       } // end for j
-       if (i < (fGeom->GetNLayers()-1)){
-          
-             envelopD[5] = envelopC[6] ; //rmin
-           envelopD[6] = envelopC[6] + 0.5;  //rmax
-           envelopD[8] = envelopC[6] ; //rmin
-           envelopD[9] = envelopC[6] + 0.5;  //rmax
-           for (int j =0; j < (fGeom->GetNZ()) ; j++){
-               envelopD[4] = envelopC[6]/tan(2*atan(exp(0.7-(j*1.4/
-                                                       (fGeom->GetNZ()))))); // z begin 
-               envelopD[7] = envelopC[6]/tan(2*atan(exp(0.7-((j+1)*1.4/
-                                                        (fGeom->GetNZ()))))); // z end
-               gMC->Gsposp("XPBX",1+ j+i*(fGeom->GetNZ()), label.Data(), 
-                           0.0, 0.0, 0.0 , idrotm, "ONLY", envelopD, 10) ; // Position and Define Layer
-           } // end for j
-       } // end if i
+    // 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 < 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->GetPRScintThick() ;
+      else if( i < geom->GetNPRLayers() + geom->GetNECLayers() ) // its an EMCAL section
+       scthick = geom->GetECScintThick() ;
+      else  // its an HCAL section
+       scthick = geom->GetHCScintThick() ;
+
+      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)
+
+      if(gDebug == 2 ) 
+       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->GetPRPbRadThick();
+         radname  =  "XPBX" ; 
+       }
+       else if( i <= geom->GetNECLayers()) {// its an EMCAL section
+         radthick = geom->GetECPbRadThick();
+         radname  =  "XPBX" ; 
+       }
+       else {  // its an HCAL section
+         radthick = geom->GetHCCuRadThick();
+         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
+         
+         if(gDebug == 2 ) 
+           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());
+           etamax = geom->GetArm1EtaMin()+
+             ((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
 }
+
 //______________________________________________________________________
-void AliEMCALv0::Init(void){
+void AliEMCALv0::Init(void)
+{
     // Just prints an information message
-    Int_t i;
-
-    cout << endl;
-    for(i=0;i<35;i++) cout <<"*";
-    cout << " EMCAL_INIT ";
-    for(i=0;i<35;i++) cout << "*";
-    cout << endl;
-
+  
+  if(fDebug) { 
+    TString message("\n") ; 
+    message += "*****************************************\n" ;
+    
     // Here the EMCAL initialisation code (if any!)
-
-    if (fGeom!=0)  
-       cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for "
-            << fGeom->GetName() << endl ;
-    else
-       cout << "AliEMCAL" << Version() << 
-           " : EMCAL geometry initialization failed !" << endl ;
-    for(i=0;i<80;i++) printf("*");
-    cout << endl;
+    
+    AliEMCALGeometry * geom = GetGeometry() ; 
+    
+    if (geom!=0) {   
+      message += "AliEMCAL " ; 
+      message += Version() ; 
+      message += "EMCAL geometry initialized for " ; 
+      message += geom->GetName()  ;
+    }
+    else {
+      message += "AliEMCAL " ; 
+      message += Version() ;  
+      message += "EMCAL geometry initialization failed !" ; 
+    }
+    message += "\n*****************************************" ;
+    Info("Init", message.Data() ) ; 
+  }
 }