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)
26 // --- ROOT system ---
31 #include "TGeometry.h"
34 // --- Standard library ---
38 // --- AliRoot header files ---
40 #include "AliEMCALv0.h"
41 #include "AliEMCALGeometry.h"
47 //____________________________________________________________________________
48 AliEMCALv0::AliEMCALv0(const char *name, const char *title):
53 cout << " $Id$ " << endl ;
57 //____________________________________________________________________________
58 void AliEMCALv0::BuildGeometry()
61 const Int_t kColorEmcal = kGreen ;
62 const Int_t kColorArm1 = kBlue ;
63 const Int_t kColorArm2 = kBlue ;
64 const Int_t kColorArm1Active = kRed ;
65 const Int_t kColorArm2Active = kRed ;
67 // make the container of entire calorimeter
69 new TTUBS("EMCA", "Tubs that contains the calorimeter", "void",
70 fGeom->GetEnvelop(0), // rmin
71 fGeom->GetEnvelop(1), // rmax
72 fGeom->GetEnvelop(2)/2.0, // half length in Z
77 // make the container of Arm1
79 new TTUBS("Envelop1", "Tubs that contains arm 1", "void",
80 fGeom->GetEnvelop(0), // rmin
81 fGeom->GetEnvelop(1), // rmax
82 fGeom->GetEnvelop(2)/2.0, // half length in Z
83 fGeom->GetArm1PhiMin(), // minimun phi angle
84 fGeom->GetArm1PhiMax() // maximun phi angle
86 // Active material of Arm1
88 new TTUBS("Arm1", "Active material of arm 1", "void",
89 fGeom->GetEnvelop(0) + fGeom->GetGap2Active(), // rmin
90 fGeom->GetEnvelop(0) + fGeom->GetGap2Active() + fGeom->GetLmat(),// rmax
91 fGeom->GetEnvelop(2)/2.0, // half length in Z
92 fGeom->GetArm1PhiMin(), // minimun phi angle
93 fGeom->GetArm1PhiMax() // maximun phi angle
95 // make the container of Arm2
97 new TTUBS("Envelop2", "Tubs that contains arm 2", "void",
98 fGeom->GetEnvelop(0), // rmin
99 fGeom->GetEnvelop(1), // rmax
100 fGeom->GetEnvelop(2)/2.0, // half length in Z
101 fGeom->GetArm2PhiMin(), // minimun phi angle
102 fGeom->GetArm2PhiMax() // maximun phi angle
105 // Active material of Arm2
107 new TTUBS("Arm2", "Active material of arm 2", "void",
108 fGeom->GetEnvelop(0) + fGeom->GetGap2Active(), // rmin
109 fGeom->GetEnvelop(0) + fGeom->GetGap2Active() + fGeom->GetLmat(),// rmax
110 fGeom->GetEnvelop(2)/2.0, // half length in Z
111 fGeom->GetArm2PhiMin(), // minimun phi angle
112 fGeom->GetArm2PhiMax() // maximun phi angle
115 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
118 // Calorimeter inside alice
119 TNode * emcanode = new TNode("EMCAL", "EMCAL Envelop", "EMCAL") ;
120 emcanode->SetLineColor(kColorEmcal) ;
121 fNodes->Add(emcanode) ;
123 // Arm 1 inside Calorimeter
125 TNode * envelop1node = new TNode("Envelop1", "Arm1 Envelop", "Envelop1") ;
126 envelop1node->SetLineColor(kColorArm1) ;
127 fNodes->Add(envelop1node) ;
129 // Arm 2 inside alice
130 TNode * envelop2node = new TNode("Envelop2", "Arm2 Envelop", "Envelop2") ;
131 envelop2node->SetLineColor(kColorArm2) ;
132 fNodes->Add(envelop2node) ;
134 // active material inside Arm 1
136 TNode * arm1node = new TNode("Arm1", "Arm1 with Mat", "Arm1") ;
137 arm1node->SetLineColor(kColorArm1Active) ;
138 fNodes->Add(arm1node) ;
140 // active material inside Arm 2
142 TNode * arm2node = new TNode("Arm2", "Arm2 with Mat", "Arm2") ;
143 arm2node->SetLineColor(kColorArm2Active) ;
144 fNodes->Add(arm2node) ;
148 //____________________________________________________________________________
149 void AliEMCALv0::CreateGeometry()
151 // Create the EMCAL geometry for Geant
153 AliEMCALv0 *emcaltmp = (AliEMCALv0*)gAlice->GetModule("EMCAL") ;
155 if ( emcaltmp == NULL ) {
157 fprintf(stderr, "EMCAL detector not found!\n") ;
161 // Get pointer to the array containing media indices
162 Int_t *idtmed = fIdtmed->GetArray() - 1599 ;
164 // Create the EMCA volume that contains entirely EMCAL
166 Float_t envelopA[5] ;
167 envelopA[0] = fGeom->GetEnvelop(0) ; // rmin
168 envelopA[1] = fGeom->GetEnvelop(1) ; // rmax
169 envelopA[2] = fGeom->GetEnvelop(2) / 2.0 ; // dz
173 gMC->Gsvolu("EMCA", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
175 // Create tube sectors that contains Arm 1 & 2
177 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
178 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
180 gMC->Gsvolu("XEN1", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
182 envelopA[3] = fGeom->GetArm2PhiMin() ; // minimun phi angle
183 envelopA[4] = fGeom->GetArm2PhiMax() ; // maximun phi angle
185 gMC->Gsvolu("XEN2", "TUBS ", idtmed[1599], envelopA, 5) ; // filled with air
187 // Create a tube sector that contains active material Arm 1 & 2
189 envelopA[0] = fGeom->GetEnvelop(0) + fGeom->GetGap2Active() ;
190 envelopA[1] = envelopA[0] + fGeom->GetLmat() ;
191 envelopA[3] = fGeom->GetArm1PhiMin() ; // minimun phi angle
192 envelopA[4] = fGeom->GetArm1PhiMax() ; // maximun phi angle
194 gMC->Gsvolu("XAR1", "TUBS ", idtmed[1601], envelopA, 5) ; // filled with active material (average)
196 envelopA[3] = fGeom->GetArm2PhiMin() ; // minimun phi angle
197 envelopA[4] = fGeom->GetArm2PhiMax() ; // maximun phi angle
199 gMC->Gsvolu("XAR2", "TUBS ", idtmed[1601], envelopA, 5) ; // filled with active material (average)
202 AliMatrix(idrotm, 90.0, 0., 90.0, 90.0, 0.0, 0.0) ;
204 // Position Calorimeter in ALICE
205 gMC->Gspos("EMCA", 1, "ALIC", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
207 // Position ENV1 container in EMCA
208 gMC->Gspos("XEN1", 1, "EMCA", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
210 // Position ARM1 into ENV1
211 gMC->Gspos("XAR1", 1, "XEN1", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
213 // Position ENV2 container in ALIC
214 gMC->Gspos("XEN2", 1, "EMCA", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
216 // Position ARM2 into ENV2
217 gMC->Gspos("XAR2", 1, "XEN2", 0.0, 0.0, 0.0, idrotm, "ONLY") ;
221 //____________________________________________________________________________
222 void AliEMCALv0::Init(void)
224 // Just prints an information message
229 for(i=0;i<35;i++) printf("*");
230 printf(" EMCAL_INIT ");
231 for(i=0;i<35;i++) printf("*");
234 // Here the EMCAL initialisation code (if any!)
237 cout << "AliEMCAL" << Version() << " : EMCAL geometry intialized for " << fGeom->GetName() << endl ;
239 cout << "AliEMCAL" << Version() << " : EMCAL geometry initialization failed !" << endl ;
241 for(i=0;i<80;i++) printf("*");