1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //_________________________________________________________________________
19 // Implementation version v0 of EMCAL Manager class
20 // An object of this class does not produce hits nor digits
21 // It is the one to use if you do not want to produce outputs in TREEH or TREED
23 //*-- Author: Yves Schutz (SUBATECH)
24 //*-- and : Sahal Yacoob (LBL / UCT)
26 // --- ROOT system ---
31 #include "TGeometry.h"
34 // --- Standard library ---
39 #include <strstream.h>
42 // --- AliRoot header files ---
44 #include "AliEMCALv0.h"
45 #include "AliEMCALGeometry.h"
52 //______________________________________________________________________
53 AliEMCALv0::AliEMCALv0(const char *name, const char *title):
55 // Standard Constructor
57 if (strcmp(GetTitle(),"") != 0 )
58 fGeom = AliEMCALGeometry::GetInstance(GetTitle(), "") ;
61 //______________________________________________________________________
62 void AliEMCALv0::BuildGeometry(){
63 // Display Geometry for display.C
65 const Int_t kColorArm1 = kBlue ;
67 // make the container of Arm1
69 new TTUBS("Envelop1", "Tubs that contains arm 1", "void",
70 fGeom->GetEnvelop(0), // rmin
71 fGeom->GetEnvelop(1) +30 , // rmax
72 fGeom->GetEnvelop(2)/2.0, // half length in Z
73 fGeom->GetArm1PhiMin(), // minimun phi angle
74 fGeom->GetArm1PhiMax() // maximun phi angle
77 TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1") ;
78 envelop1node->SetLineColor(kColorArm1) ;
79 fNodes->Add(envelop1node) ;
81 //______________________________________________________________________
82 void AliEMCALv0::CreateGeometry(){
83 // Create the EMCAL geometry for Geant
85 AliEMCALv0 *emcaltmp = (AliEMCALv0*)gAlice->GetModule("EMCAL") ;
87 if ( emcaltmp == NULL ) {
88 Warning("CreateGeometry","detector not found!");
91 // Get pointer to the array containing media indices
92 Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
94 // Create tube sectors that contains Arm 1 & 2
97 envelopA[0] = fGeom->GetEnvelop(0) ; // rmin
98 envelopA[1] = fGeom->GetEnvelop(1) + 30 ; // rmax
99 envelopA[2] = fGeom->GetEnvelop(2) / 2.0 ; // dz
100 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
101 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
103 gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; //filled with air
105 // Create a tube sector that contains active material Arm 1 & 2
107 Float_t envelopB[10];
108 Float_t envelopC[10];
109 Float_t envelopD[10];
110 envelopC[0] = envelopD[0] = envelopB[0] = fGeom->GetArm1PhiMin();
111 envelopC[1] = envelopD[1] = envelopB[1] = fGeom->GetArm1PhiMax() -
112 fGeom->GetArm1PhiMin();
113 envelopC[2] = envelopD[2] = envelopB[2] = fGeom->GetNPhi() ;
118 envelopB[4] = (fGeom->GetEnvelop(0) + fGeom->GetGap2Active()) /
119 (tan(2*atan(exp(0.7)))) ;
120 envelopB[5] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active(); //rmin
121 envelopD[6] = envelopB[6] = envelopB[5] + 3.18; //rmax
122 envelopB[7] = (fGeom->GetEnvelop(0) + fGeom->GetGap2Active()) /
123 (tan(2*atan(exp(-0.7)))) ;
124 envelopB[8] = envelopB[5] ;
125 envelopB[9] = envelopB[6] ;
127 // filled with active material (average)
128 gMC->Gsvolu("XALU", "PGON", idtmed[1602], envelopB, 10);
129 // filled with active material (Polystyrene)
130 gMC->Gsvolu("XPST", "PGON", idtmed[1601], 0, 0) ;
131 gMC->Gsvolu("XPBX", "PGON", idtmed[1600], 0, 0) ; // filled with Lead
132 gMC->Gsdvn("XPHI", "XPST", fGeom->GetNPhi(), 2) ; // Naming Phi divisions
135 AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
137 // Position ENV1 container in ALIC
138 gMC->Gspos("XEN1", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "MANY") ;
139 // Position ARM1 into ENV1
140 gMC->Gspos("XALU", 1, "XEN1", 0.0, 0.0, 0.0 , idrotm, "ONLY") ;
142 for (int i = 0; i < (fGeom->GetNLayers()); i++ ){
143 envelopC[5] = envelopD[6] ; //rmin
144 envelopC[6] = envelopD[6] + ((i > +2) ? 0.5 : 0.6) ; //rmax
145 envelopC[8] = envelopD[6] ; //rmin
146 envelopC[9] = envelopD[6] + ((i > 2 ) ? 0.5 : 0.6) ; //rmax
147 for (int j =0; j < (fGeom->GetNZ()) ; j++){
148 envelopC[4] = envelopD[6]/tan(2*atan(exp(0.7-(j*1.4/
149 (fGeom->GetNZ())))));
150 envelopC[7] = envelopD[6]/tan(2*atan(exp(0.7-((j+1)*1.4/
151 (fGeom->GetNZ())))));
152 gMC->Gsposp("XPST",1+j+i*(fGeom->GetNZ()), "XEN1",
153 0.0, 0.0, 0.0 , idrotm, "ONLY", envelopC, 10);
155 if (i < (fGeom->GetNLayers()-1)){
156 envelopD[5] = envelopC[6] ; //rmin
157 envelopD[6] = envelopC[6] + 0.5; //rmax
158 envelopD[8] = envelopC[6] ; //rmin
159 envelopD[9] = envelopC[6] + 0.5; //rmax
160 for (int j =0; j < (fGeom->GetNZ()) ; j++){
161 envelopD[4] = envelopC[6]/tan(2*atan(exp(0.7-(j*1.4/
162 (fGeom->GetNZ())))));
163 envelopD[7] = envelopC[6]/tan(2*atan(exp(0.7-((j+1)*1.4/
164 (fGeom->GetNZ())))));
165 gMC->Gsposp("XPBX",1+ j+i*(fGeom->GetNZ()), "XEN1",
166 0.0, 0.0, 0.0 , idrotm, "MANY", envelopD, 10) ;
171 //______________________________________________________________________
172 void AliEMCALv0::Init(void){
173 // Just prints an information message
177 for(i=0;i<35;i++) cout <<"*";
178 cout << " EMCAL_INIT ";
179 for(i=0;i<35;i++) cout << "*";
182 // Here the EMCAL initialisation code (if any!)
185 cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for "
186 << fGeom->GetName() << endl ;
188 cout << "AliEMCAL" << Version() <<
189 " : EMCAL geometry initialization failed !" << endl ;
190 for(i=0;i<80;i++) printf("*");