-
- 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++){