1 /**************************************************************************
3 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
7 * Author: The ALICE Off-line Project. *
9 * Contributors are mentioned in the code where appropriate. *
13 * Permission to use, copy, modify and distribute this software and its *
15 * documentation strictly for non-commercial purposes is hereby granted *
17 * without fee, provided that the above copyright notice appears in all *
19 * copies and that both the copyright notice and this permission notice *
21 * appear in the supporting documentation. The authors make no claims *
23 * about the suitability of this software for any purpose. It is *
25 * provided "as is" without express or implied warranty. *
27 **************************************************************************/
35 //_________________________________________________________________________
37 // Implementation version v0 of EMCAL Manager class
39 // An object of this class does not produce hits nor digits
41 // It is the one to use if you do not want to produce outputs in TREEH or TREED
43 // This class places a Geometry of the EMCAL in the ALICE Detector as defined in AliEMCALGeometry.cxx
45 //*-- Author: Yves Schutz (SUBATECH)
47 //*-- and : Sahal Yacoob (LBL / UCT)
51 // This Version of AliEMCALv0 reduces the number of volumes placed in XEN1 (the envelope) to less than five hundred
53 // The Envelope is Placed in Alice, And the Aluminium layer. Mini envelopes (XU) are then placed in XEN1.
55 // Each mini envelope contains 2 scintillator, and 2 lead layers, except the last one which contains just one scintillator layer.
57 // At the moment I cannot place the 36 and above layers in the mini envelopes so all layers are still placed in XEN1
63 // --- ROOT system ---
73 #include "TGeometry.h"
75 //#include "Tstring.h"
79 // --- Standard library ---
89 #include <strstream.h>
95 // --- AliRoot header files ---
99 #include "AliEMCALv0.h"
101 #include "AliEMCALGeometry.h"
103 #include "AliConst.h"
115 //______________________________________________________________________
117 AliEMCALv0::AliEMCALv0(const char *name, const char *title):
119 AliEMCAL(name,title){
121 // Standard Constructor
125 if (strcmp(GetTitle(),"") != 0 )
127 fGeom = AliEMCALGeometry::GetInstance(GetTitle(), "") ;
133 //______________________________________________________________________
135 void AliEMCALv0::BuildGeometry(){
137 // Display Geometry for display.C
141 const Int_t kColorArm1 = kBlue ;
145 // Difine the shape of the Calorimeter
149 new TTUBS("Envelop1", "Tubs that contains arm 1", "void",
151 fGeom->GetEnvelop(0), // rmin
153 fGeom->GetEnvelop(1) +30 , // rmax
155 fGeom->GetEnvelop(2)/2.0, // half length in Z
157 fGeom->GetArm1PhiMin(), // minimun phi angle
159 fGeom->GetArm1PhiMax() // maximun phi angle
165 TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1") ;
167 envelop1node->SetLineColor(kColorArm1) ;
169 fNodes->Add(envelop1node) ;
173 //______________________________________________________________________
175 void AliEMCALv0::CreateGeometry(){
177 // Create the EMCAL geometry for Geant
179 Float_t etamin,etamax;
183 if(!(fGeom->IsInitialized())){
185 Error("CreateGeometry","EMCAL Geometry class has not been set up.");
189 // Get pointer to the array containing media indices
191 Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
195 // Create an Envelope within which to place the Detector
201 envelopA[0] = fGeom->GetEnvelop(0); // rmin
203 envelopA[1] = fGeom->GetEnvelop(1); // rmax
205 envelopA[2] = fGeom->GetEnvelop(2)/2.0; // dz
207 envelopA[3] = fGeom->GetArm1PhiMin(); // minimun phi angle
209 envelopA[4] = fGeom->GetArm1PhiMax(); // maximun phi angle
215 gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; //filled with air
221 AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
225 // Position the EMCAL Mother Volume in Alice
227 gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
233 TString label = "XU0";
237 //rmin Start mini envelopes after the aluminium layer
239 envelopA[0] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active() +
241 fGeom->GetAlFrontThickness();
243 //rmax larger for first two layers (preshower);
245 Float_t tseg = fGeom->GetPreSintThick()+fGeom->GetPbRadThick();
247 envelopA[1] = envelopA[0] + 2.0*tseg;
249 envelopA[2] = fGeom->GetEnvelop(2)/2.0; // dz
251 envelopA[3] = fGeom->GetArm1PhiMin(); // minimun phi angle
253 envelopA[4] = fGeom->GetArm1PhiMax(); // maximun phi angle
257 gMC->Gsvolu(label.Data(), "TUBS ", idtmed[1599], envelopA, 5);
259 // Place XU0 in to XEN1
261 gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY");
265 tseg = fGeom->GetFullSintThick()+fGeom->GetPbRadThick();
267 for (int i = 1; i < ((fGeom->GetNLayers()-1)/2) + 1 ; i++ ){
273 envelopA[0] = envelopA[1]; //rmin
275 envelopA[1] = envelopA[0] + 2.0*tseg; //rmax
279 gMC->Gsvolu(label.Data(), "TUBS ", idtmed[1599], envelopA, 5);
281 gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
287 // Create the shapes of active material (LEAD/Aluminium/Scintillator)
291 Float_t envelopB[10]; // First Layer of Aluminium
293 Float_t envelopC[10]; // Scintillator Layers
295 Float_t envelopD[10]; // Lead Layers
297 //starting position in Phi
299 envelopC[0] = envelopD[0] = envelopB[0] = fGeom->GetArm1PhiMin();
301 // Angular size of the Detector in Phi
303 envelopB[1] = fGeom->GetArm1PhiMax() - fGeom->GetArm1PhiMin();
305 envelopC[1] = envelopD[1] = envelopB[1];
307 // Number of Section in Phi
309 envelopC[2] = envelopD[2] = envelopB[2] = fGeom->GetNPhi();
311 // each section will be passed 2 z coordinates
313 envelopD[3] = envelopC[3] = envelopB[3] = 2;
315 envelopB[4] = fGeom->ZFromEtaR(fGeom->GetEnvelop(0)+fGeom->GetGap2Active(),
317 fGeom->GetArm1EtaMin());// z co-ordinate 1
319 envelopB[5] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active(); //rmin at z1
321 envelopB[6] = envelopB[5] + fGeom->GetAlFrontThickness();//rmax at z1
323 envelopD[6] = envelopB[6];
325 envelopB[7] =fGeom->ZFromEtaR(fGeom->GetEnvelop(0)+fGeom->GetGap2Active(),
327 fGeom->GetArm1EtaMax()); // z co-ordinate 2
329 envelopB[8] = envelopB[5] ; //
331 envelopB[9] = envelopB[6] ; // radii are the same.
335 // filled shapes wit hactive material
337 // Define Aluminium volume completely
339 gMC->Gsvolu("XALU", "PGON", idtmed[1602], envelopB, 10);
341 // The polystyrene layers will be defined when placed
343 gMC->Gsvolu("XPST", "PGON", idtmed[1601], 0, 0);
345 gMC->Gsvolu("XPBX", "PGON", idtmed[1600], 0, 0);// as will the lead layers
347 // Dividind eta polystyrene divisions into phi segments.
349 gMC->Gsdvn("XPHI", "XPST", fGeom->GetNPhi(), 2);
351 // Position Aluminium Layer in the Envelope
353 gMC->Gspos("XALU", 1, "XEN1", 0.0, 0.0, 0.0 , idrotm, "ONLY") ;
357 // The loop below places the scintillator in Lead Layers alternately.
359 for (int i = 0; i < fGeom->GetNLayers() ; i++ ){
363 label += (int) i/2 ; // we will place two layers (i = one layer) in each mini envelope)
365 envelopC[5] = envelopD[6] ; //rmin
367 envelopC[6] = envelopD[6] + ((i > 1) ? fGeom->GetFullSintThick() :
369 fGeom->GetPreSintThick());//rmax larger for first two layers (preshower)
371 envelopC[8] = envelopD[6] ; //rmin
373 envelopC[9] = envelopD[6] + ((i > 1 ) ? fGeom->GetFullSintThick() :
375 fGeom->GetPreSintThick());//rmax larger for first two layers (preshower)
377 for (int j =0; j < (fGeom->GetNEta()) ; j++){
379 etamin = fGeom->GetArm1EtaMin()+
381 (j*fGeom->GetDeltaEta());
383 etamax = fGeom->GetArm1EtaMin()+
385 ((j+1)*fGeom->GetDeltaEta());
387 envelopC[4] = fGeom->ZFromEtaR(envelopD[6],etamin); //z begin
389 envelopC[7] = fGeom->ZFromEtaR(envelopD[6],etamax);// z end
391 gMC->Gsposp("XPST",1+j+i*(fGeom->GetNEta()), label.Data(), // should be used but there's a weird crash above i = 18,
393 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10); // Position and define layer
397 if (i < (fGeom->GetNLayers()-1)){
399 envelopD[5] = envelopC[6] ; //rmin
401 envelopD[6] = envelopC[6] + fGeom->GetPbRadThick(); //rmax
403 envelopD[8] = envelopC[6] ; //rmin
405 envelopD[9] = envelopC[6] + fGeom->GetPbRadThick(); //rmax
407 for (int j =0; j < (fGeom->GetNEta()) ; j++){
409 etamin = fGeom->GetArm1EtaMin()+
411 (j*fGeom->GetDeltaEta());
413 etamax = fGeom->GetArm1EtaMin()+
415 ((j+1)*fGeom->GetDeltaEta());
417 envelopD[4] = fGeom->ZFromEtaR(envelopC[6],etamin);//z begin
419 envelopD[7] = fGeom->ZFromEtaR(envelopC[6],etamax);// z end
421 // Position and Define Layer
423 gMC->Gsposp("XPBX",1+ j+i*(fGeom->GetNEta()), label.Data(),
425 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopD, 10);
435 //______________________________________________________________________
437 void AliEMCALv0::Init(void){
439 // Just prints an information message
447 for(i=0;i<35;i++) cout <<"*";
449 cout << " EMCAL_INIT ";
451 for(i=0;i<35;i++) cout << "*";
457 // Here the EMCAL initialisation code (if any!)
463 cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for "
465 << fGeom->GetName() << endl ;
469 cout << "AliEMCAL" << Version() <<
471 " : EMCAL geometry initialization failed !" << endl ;
473 for(i=0;i<80;i++) printf("*");