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
148 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
150 new TTUBS("Envelop1", "Tubs that contains arm 1", "void",
152 fGeom->GetEnvelop(0), // rmin
154 fGeom->GetEnvelop(1) +30 , // rmax
156 fGeom->GetEnvelop(2)/2.0, // half length in Z
158 fGeom->GetArm1PhiMin(), // minimun phi angle
160 fGeom->GetArm1PhiMax() // maximun phi angle
167 TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1"
170 envelop1node->SetLineColor(kColorArm1) ;
172 fNodes->Add(envelop1node) ;
176 //______________________________________________________________________
178 void AliEMCALv0::CreateGeometry(){
180 // Create the EMCAL geometry for Geant
182 Float_t etamin,etamax;
188 if(!(fGeom->IsInitialized())){
190 Error("CreateGeometry","EMCAL Geometry class has not been set up.");
194 // Get pointer to the array containing media indices
196 Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
200 // Create an Envelope within which to place the Detector
206 envelopA[0] = fGeom->GetEnvelop(0); // rmin
208 envelopA[1] = fGeom->GetEnvelop(1); // rmax
210 envelopA[2] = fGeom->GetEnvelop(2)/2.0; // dz
212 envelopA[3] = fGeom->GetArm1PhiMin(); // minimun phi angle
214 envelopA[4] = fGeom->GetArm1PhiMax(); // maximun phi angle
220 gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; //filled with air
226 AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
230 // Position the EMCAL Mother Volume in Alice
232 gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
238 TString label = "XU0";
242 //rmin Start mini envelopes after the aluminium layer
244 envelopA[0] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active() +
246 fGeom->GetAlFrontThickness();
248 //rmax larger for first two layers (preshower);
250 Float_t tseg = fGeom->GetPreSintThick()+fGeom->GetPbRadThick();
252 envelopA[1] = envelopA[0] + 2.0*tseg;
254 envelopA[2] = fGeom->GetEnvelop(2)/2.0; // dz
256 envelopA[3] = fGeom->GetArm1PhiMin(); // minimun phi angle
258 envelopA[4] = fGeom->GetArm1PhiMax(); // maximun phi angle
262 gMC->Gsvolu(label.Data(), "TUBS ", idtmed[1599], envelopA, 5);
264 // Place XU0 in to XEN1
266 gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY");
270 tseg = fGeom->GetFullSintThick()+fGeom->GetPbRadThick();
272 for (int i = 1; i < ((fGeom->GetNLayers()-1)/2) + 1 ; i++ ){
278 envelopA[0] = envelopA[1]; //rmin
280 envelopA[1] = envelopA[0] + 2.0*tseg; //rmax
284 gMC->Gsvolu(label.Data(), "TUBS ", idtmed[1599], envelopA, 5);
286 gMC->Gspos(label.Data(), 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
292 // Create the shapes of active material (LEAD/Aluminium/Scintillator)
296 Float_t envelopB[10]; // First Layer of Aluminium
298 Float_t envelopC[10]; // Scintillator Layers
300 Float_t envelopD[10]; // Lead Layers
302 //starting position in Phi
304 envelopC[0] = envelopD[0] = envelopB[0] = fGeom->GetArm1PhiMin();
306 // Angular size of the Detector in Phi
308 envelopB[1] = fGeom->GetArm1PhiMax() - fGeom->GetArm1PhiMin();
310 envelopC[1] = envelopD[1] = envelopB[1];
312 // Number of Section in Phi
314 envelopC[2] = envelopD[2] = envelopB[2] = fGeom->GetNPhi();
316 // each section will be passed 2 z coordinates
318 envelopD[3] = envelopC[3] = envelopB[3] = 2;
320 envelopB[4] = fGeom->ZFromEtaR(fGeom->GetEnvelop(0)+fGeom->GetGap2Active(),
322 fGeom->GetArm1EtaMin());// z co-ordinate 1
324 envelopB[5] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active(); //rmin at z1
326 envelopB[6] = envelopB[5] + fGeom->GetAlFrontThickness();//rmax at z1
328 envelopD[6] = envelopB[6];
330 envelopB[7] =fGeom->ZFromEtaR(fGeom->GetEnvelop(0)+fGeom->GetGap2Active(),
332 fGeom->GetArm1EtaMax()); // z co-ordinate 2
334 envelopB[8] = envelopB[5] ; //
336 envelopB[9] = envelopB[6] ; // radii are the same.
340 // filled shapes wit hactive material
342 // Define Aluminium volume completely
344 gMC->Gsvolu("XALU", "PGON", idtmed[1602], envelopB, 10);
346 // The polystyrene layers will be defined when placed
348 gMC->Gsvolu("XPST", "PGON", idtmed[1601], dum, 0);
350 gMC->Gsvolu("XPBX", "PGON", idtmed[1600], dum, 0);// as will the lead layers
352 // Dividind eta polystyrene divisions into phi segments.
354 gMC->Gsdvn("XPHI", "XPST", fGeom->GetNPhi(), 2);
356 // Position Aluminium Layer in the Envelope
358 gMC->Gspos("XALU", 1, "XEN1", 0.0, 0.0, 0.0 , idrotm, "ONLY") ;
362 // The loop below places the scintillator in Lead Layers alternately.
364 for (int i = 0; i < fGeom->GetNLayers() ; i++ ){
368 label += (int) i/2 ; // we will place two layers (i = one layer) in each mini envelope)
370 envelopC[5] = envelopD[6] ; //rmin
372 envelopC[6] = envelopD[6] + ((i > 1) ? fGeom->GetFullSintThick() :
374 fGeom->GetPreSintThick());//rmax larger for first two layers (preshower)
376 envelopC[8] = envelopD[6] ; //rmin
378 envelopC[9] = envelopD[6] + ((i > 1 ) ? fGeom->GetFullSintThick() :
380 fGeom->GetPreSintThick());//rmax larger for first two layers (preshower)
382 for (int j =0; j < (fGeom->GetNEta()) ; j++){
386 etamin = fGeom->GetArm1EtaMin()+
388 (j*fGeom->GetDeltaEta());
390 etamax = fGeom->GetArm1EtaMin()+
392 ((j+1)*fGeom->GetDeltaEta());
394 envelopC[4] = fGeom->ZFromEtaR(envelopD[6],etamin); //z begin
396 envelopC[7] = fGeom->ZFromEtaR(envelopD[6],etamax);// z end
398 gMC->Gsposp("XPST",1+j+i*(fGeom->GetNEta()), label.Data(), // should be used but there's a weird crash above i = 18,
400 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10); // Position and define layer
404 if (i < (fGeom->GetNLayers()-1)){
406 envelopD[5] = envelopC[6] ; //rmin
408 envelopD[6] = envelopC[6] + fGeom->GetPbRadThick(); //rmax
410 envelopD[8] = envelopC[6] ; //rmin
412 envelopD[9] = envelopC[6] + fGeom->GetPbRadThick(); //rmax
414 for (int j =0; j < (fGeom->GetNEta()) ; j++){
416 etamin = fGeom->GetArm1EtaMin()+
418 (j*fGeom->GetDeltaEta());
420 etamax = fGeom->GetArm1EtaMin()+
422 ((j+1)*fGeom->GetDeltaEta());
424 envelopD[4] = fGeom->ZFromEtaR(envelopC[6],etamin);//z begin
426 envelopD[7] = fGeom->ZFromEtaR(envelopC[6],etamax);// z end
428 // Position and Define Layer
430 gMC->Gsposp("XPBX",1+ j+i*(fGeom->GetNEta()), label.Data(),
432 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopD, 10);
441 //______________________________________________________________________
443 void AliEMCALv0::Init(void){
445 // Just prints an information message
453 for(i=0;i<35;i++) cout <<"*";
455 cout << " EMCAL_INIT ";
457 for(i=0;i<35;i++) cout << "*";
463 // Here the EMCAL initialisation code (if any!)
469 cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for "
471 << fGeom->GetName() << endl ;
475 cout << "AliEMCAL" << Version() <<
477 " : EMCAL geometry initialization failed !" << endl ;
479 for(i=0;i<80;i++) printf("*");