]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSv0.cxx
Typo corrected
[u/mrichter/AliRoot.git] / PHOS / AliPHOSv0.cxx
CommitLineData
4c039060 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
b2a60966 15/* $Id$ */
16
7b7c1533 17
d15a28e7 18//_________________________________________________________________________
b2a60966 19// Implementation version v0 of PHOS Manager class
5f20d3fb 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
b2a60966 22//
85218d13 23//*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
b2a60966 24
d2cf0e38 25
fe4da5cc 26// --- ROOT system ---
d15a28e7 27
fe4da5cc 28#include "TBRIK.h"
85218d13 29#include "TTRD1.h"
fe4da5cc 30#include "TNode.h"
0869cea5 31#include "TRandom.h"
94de3818 32#include "TGeometry.h"
7367f709 33#include "TFolder.h"
34#include "TROOT.h"
7b7c1533 35#include "TTree.h"
fe4da5cc 36
81e92872 37
d15a28e7 38// --- Standard library ---
39
de9ec31b 40#include <string.h>
41#include <stdlib.h>
d15a28e7 42
43// --- AliRoot header files ---
44
fe4da5cc 45#include "AliPHOSv0.h"
46#include "AliRun.h"
d15a28e7 47#include "AliConst.h"
94de3818 48#include "AliMC.h"
13add4de 49#include "AliPHOSGeometry.h"
7b7c1533 50#include "AliPHOSGetter.h"
fe4da5cc 51
52ClassImp(AliPHOSv0)
53
d15a28e7 54//____________________________________________________________________________
55AliPHOSv0::AliPHOSv0(const char *name, const char *title):
56 AliPHOS(name,title)
57{
b2a60966 58 // ctor : title is used to identify the layout
bd46a237 59 GetGeometry() ;
d15a28e7 60}
61
d15a28e7 62//____________________________________________________________________________
63void AliPHOSv0::BuildGeometry()
fe4da5cc 64{
b2a60966 65 // Build the PHOS geometry for the ROOT display
66 //BEGIN_HTML
67 /*
68 <H2>
69 PHOS in ALICE displayed by root
70 </H2>
71 <UL>
72 <LI> All Views
73 <P>
74 <CENTER>
75 <IMG Align=BOTTOM ALT="All Views" SRC="../images/AliPHOSv0AllViews.gif">
76 </CENTER></P></LI>
77 <LI> Front View
78 <P>
79 <CENTER>
80 <IMG Align=BOTTOM ALT="Front View" SRC="../images/AliPHOSv0FrontView.gif">
81 </CENTER></P></LI>
82 <LI> 3D View 1
83 <P>
84 <CENTER>
85 <IMG Align=BOTTOM ALT="3D View 1" SRC="../images/AliPHOSv03DView1.gif">
86 </CENTER></P></LI>
87 <LI> 3D View 2
88 <P>
89 <CENTER>
90 <IMG Align=BOTTOM ALT="3D View 2" SRC="../images/AliPHOSv03DView2.gif">
91 </CENTER></P></LI>
92 </UL>
93 */
94 //END_HTML
7367f709 95
85218d13 96 this->BuildGeometryforEMC() ;
97 this->BuildGeometryforCPV() ;
98
fe4da5cc 99}
d15a28e7 100
101//____________________________________________________________________________
85218d13 102void AliPHOSv0:: BuildGeometryforEMC(void)
d15a28e7 103{
85218d13 104 // Build the PHOS-EMC geometry for the ROOT display
105
d15a28e7 106 const Int_t kColorPHOS = kRed ;
107 const Int_t kColorXTAL = kBlue ;
85218d13 108
92862013 109 Double_t const kRADDEG = 180.0 / kPI ;
85218d13 110
7367f709 111 AliPHOSGeometry * geom = GetGeometry() ;
85218d13 112 AliPHOSEMCAGeometry * emcg = geom->GetEMCAGeometry() ;
113 Float_t * boxparams = emcg->GetEMCParams() ;
7367f709 114
85218d13 115 new TTRD1("OuterBox", "PHOS box", "void",boxparams[0],boxparams[1],boxparams[2], boxparams[3] );
116
d15a28e7 117
d15a28e7 118 // Crystals Box
d15a28e7 119
85218d13 120 Float_t * cribox = emcg->GetInnerThermoHalfSize() ;
121 new TBRIK( "CrystalsBox", "PHOS crystals box", "void", cribox[0], cribox[2], cribox[1] ) ;
122
123 // position PHOS into ALICE
124
125 Float_t r = geom->GetIPtoOuterCoverDistance() + boxparams[3] ;
d15a28e7 126 Int_t number = 988 ;
92862013 127 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
85218d13 128
d15a28e7 129 char * nodename = new char[20] ;
130 char * rotname = new char[20] ;
131
85218d13 132 new TRotMatrix("cribox", "cribox", 90, 0, 90, 90, 0, 0);
d15a28e7 133
85218d13 134 for( Int_t i = 1; i <= geom->GetNModules(); i++ ) {
d15a28e7 135
7367f709 136 Float_t angle = geom->GetPHOSAngle(i) ;
85218d13 137 sprintf(rotname, "%s%d", "rot", number++) ;
138 new TRotMatrix(rotname, rotname, 90, angle, 0, 0, 90, 270 + angle);
139
92862013 140 top->cd();
85218d13 141 sprintf(nodename,"%s%d", "Module", i) ;
92862013 142 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
143 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
85218d13 144 TNode * outerboxnode = new TNode(nodename, nodename, "OuterBox", x, y, 0, rotname ) ;
145 outerboxnode->SetLineColor(kColorPHOS) ;
146 fNodes->Add(outerboxnode) ;
147 outerboxnode->cd() ;
148
149 Float_t z = -boxparams[3] - geom->GetIPtoOuterCoverDistance() +
150 cribox[1] + geom->GetIPtoCrystalSurface() ;
151 TNode * crystalsboxnode = new TNode(nodename, nodename, "CrystalsBox", 0, 0, z) ;
152 crystalsboxnode->SetLineColor(kColorXTAL) ;
153 fNodes->Add(crystalsboxnode) ;
154 }
31aa6d6c 155
85218d13 156 delete[] rotname ;
157 delete[] nodename ;
fe4da5cc 158}
159
85218d13 160
bacd0b23 161//____________________________________________________________________________
162void AliPHOSv0:: BuildGeometryforCPV(void)
163{
164 // Build the PHOS-CPV geometry for the ROOT display
165 // Author: Yuri Kharlov 11 September 2000
166 //
167 //BEGIN_HTML
168 /*
169 <H2>
170 CPV displayed by root
171 </H2>
172 <table width=700>
173
174 <tr>
175 <td>CPV perspective view</td>
176 <td>CPV front view </td>
177 </tr>
178
179 <tr>
180 <td> <img height=300 width=290 src="../images/CPVRootPersp.gif"> </td>
181 <td> <img height=300 width=290 src="../images/CPVRootFront.gif"> </td>
182 </tr>
183
184 </table>
185
186 */
187 //END_HTML
188
189 const Double_t kRADDEG = 180.0 / kPI ;
190 const Int_t kColorCPV = kGreen ;
191 const Int_t kColorFrame = kYellow ;
192 const Int_t kColorGassiplex = kRed;
193 const Int_t kColorPCB = kCyan;
194
7367f709 195 AliPHOSGeometry * geom = GetGeometry() ;
196
bacd0b23 197 // Box for a full PHOS module
198
7367f709 199 new TBRIK ("CPVBox", "CPV box", "void", geom->GetCPVBoxSize(0)/2,
200 geom->GetCPVBoxSize(1)/2,
201 geom->GetCPVBoxSize(2)/2 );
202 new TBRIK ("CPVFrameLR", "CPV frame Left-Right", "void", geom->GetCPVFrameSize(0)/2,
203 geom->GetCPVFrameSize(1)/2,
204 geom->GetCPVBoxSize(2)/2 );
205 new TBRIK ("CPVFrameUD", "CPV frame Up-Down", "void", geom->GetCPVBoxSize(0)/2 - geom->GetCPVFrameSize(0),
206 geom->GetCPVFrameSize(1)/2,
207 geom->GetCPVFrameSize(2)/2);
208 new TBRIK ("CPVPCB", "CPV PCB", "void", geom->GetCPVActiveSize(0)/2,
209 geom->GetCPVTextoliteThickness()/2,
210 geom->GetCPVActiveSize(1)/2);
211 new TBRIK ("CPVGassiplex", "CPV Gassiplex PCB", "void", geom->GetGassiplexChipSize(0)/2,
212 geom->GetGassiplexChipSize(1)/2,
213 geom->GetGassiplexChipSize(2)/2);
bacd0b23 214
215 // position CPV into ALICE
216
217 char * nodename = new char[25] ;
218 char * rotname = new char[25] ;
219
7367f709 220 Float_t r = geom->GetIPtoCPVDistance() + geom->GetCPVBoxSize(1) / 2.0 ;
bacd0b23 221 Int_t number = 988 ;
222 TNode * top = gAlice->GetGeometry()->GetNode("alice") ;
ed4205d8 223
224 Int_t lastModule = 0 ;
85218d13 225 lastModule = geom->GetNModules();
ed4205d8 226
227 for( Int_t i = 1; i <= lastModule; i++ ) { // the number of PHOS modules
85218d13 228
bacd0b23 229 // One CPV module
85218d13 230
7367f709 231 Float_t angle = geom->GetPHOSAngle(i) ;
ed4205d8 232 sprintf(rotname, "%s%d", "rotg", number+i) ;
bacd0b23 233 new TRotMatrix(rotname, rotname, 90, angle, 90, 90 + angle, 0, 0);
234 top->cd();
235 sprintf(nodename, "%s%d", "CPVModule", i) ;
236 Float_t x = r * TMath::Sin( angle / kRADDEG ) ;
237 Float_t y = -r * TMath::Cos( angle / kRADDEG ) ;
238 Float_t z;
239 TNode * cpvBoxNode = new TNode(nodename , nodename ,"CPVBox", x, y, 0, rotname ) ;
240 cpvBoxNode->SetLineColor(kColorCPV) ;
241 fNodes->Add(cpvBoxNode) ;
242 cpvBoxNode->cd() ;
243
244 // inside each CPV box:
245
246 // Frame around CPV
cd461ab8 247 Int_t j;
248 for (j=0; j<=1; j++) {
bacd0b23 249 sprintf(nodename, "CPVModule%d Frame%d", i, j+1) ;
7367f709 250 x = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(0) - geom->GetCPVFrameSize(0)) / 2;
bacd0b23 251 TNode * cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameLR", x, 0, 0) ;
252 cpvFrameNode->SetLineColor(kColorFrame) ;
253 fNodes->Add(cpvFrameNode) ;
254
255 sprintf(nodename, "CPVModule%d Frame%d", i, j+3) ;
7367f709 256 z = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(2) - geom->GetCPVFrameSize(2)) / 2;
bacd0b23 257 cpvFrameNode = new TNode(nodename , nodename ,"CPVFrameUD", 0, 0, z) ;
258 cpvFrameNode->SetLineColor(kColorFrame) ;
259 fNodes->Add(cpvFrameNode) ;
260 }
261
262 // 4 printed circuit boards
cd461ab8 263 for (j=0; j<4; j++) {
bacd0b23 264 sprintf(nodename, "CPVModule%d PCB%d", i, j+1) ;
7367f709 265 y = geom->GetCPVFrameSize(1) / 2 - geom->GetFTPosition(j) + geom->GetCPVTextoliteThickness()/2;
bacd0b23 266 TNode * cpvPCBNode = new TNode(nodename , nodename ,"CPVPCB", 0, y, 0) ;
267 cpvPCBNode->SetLineColor(kColorPCB) ;
268 fNodes->Add(cpvPCBNode) ;
269 }
270
271 // Gassiplex chips
7367f709 272 Float_t xStep = geom->GetCPVActiveSize(0) / (geom->GetNumberOfCPVChipsPhi() + 1);
273 Float_t zStep = geom->GetCPVActiveSize(1) / (geom->GetNumberOfCPVChipsZ() + 1);
274 y = geom->GetCPVFrameSize(1)/2 - geom->GetFTPosition(0) +
275 geom->GetCPVTextoliteThickness() / 2 + geom->GetGassiplexChipSize(1) / 2 + 0.1;
276 for (Int_t ix=0; ix<geom->GetNumberOfCPVChipsPhi(); ix++) {
277 x = xStep * (ix+1) - geom->GetCPVActiveSize(0)/2;
278 for (Int_t iz=0; iz<geom->GetNumberOfCPVChipsZ(); iz++) {
279 z = zStep * (iz+1) - geom->GetCPVActiveSize(1)/2;
bacd0b23 280 sprintf(nodename, "CPVModule%d Chip(%dx%d)", i, ix+1,iz+1) ;
281 TNode * cpvGassiplexNode = new TNode(nodename , nodename ,"CPVGassiplex", x, y, z) ;
282 cpvGassiplexNode->SetLineColor(kColorGassiplex) ;
283 fNodes->Add(cpvGassiplexNode) ;
284 }
285 }
286
287 } // PHOS modules
288
289 delete[] rotname ;
290 delete[] nodename ;
291}
292
d15a28e7 293//____________________________________________________________________________
fe4da5cc 294void AliPHOSv0::CreateGeometry()
295{
b2a60966 296 // Create the PHOS geometry for Geant
d15a28e7 297
7a9d98f9 298 AliPHOSv0 *phostmp = dynamic_cast<AliPHOSv0*>(gAlice->GetModule("PHOS")) ;
d15a28e7 299
92862013 300 if ( phostmp == NULL ) {
d15a28e7 301
302 fprintf(stderr, "PHOS detector not found!\n") ;
303 return;
fe4da5cc 304
d15a28e7 305 }
7367f709 306
307 AliPHOSGeometry * geom = GetGeometry() ;
308
d15a28e7 309 // Get pointer to the array containing media indeces
92862013 310 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 311
85218d13 312 // Create a PHOS module.
d15a28e7 313
85218d13 314 gMC->Gsvolu("PHOS", "TRD1", idtmed[798], geom->GetPHOSParams(), 4) ;
d15a28e7 315
85218d13 316 this->CreateGeometryforEMC() ;
ed4205d8 317
85218d13 318 this->CreateGeometryforCPV() ;
319
b73f246d 320 this->CreateGeometryforSupport() ;
d15a28e7 321
322 // --- Position PHOS mdules in ALICE setup ---
323
92862013 324 Int_t idrotm[99] ;
325 Double_t const kRADDEG = 180.0 / kPI ;
85218d13 326 Float_t * phosParams = geom->GetPHOSParams() ;
382780d0 327
328 Float_t r = geom->GetIPtoOuterCoverDistance() + phosParams[3] - geom->GetCPVBoxSize(1) ;
ed4205d8 329 Int_t i;
85218d13 330 for( i = 1; i <= geom->GetNModules() ; i++ ) {
d15a28e7 331
7367f709 332 Float_t angle = geom->GetPHOSAngle(i) ;
85218d13 333 AliMatrix(idrotm[i-1], 90.,angle, 0., 0., 90., 270. +angle) ;
334
ed4205d8 335 Float_t xP1 = r * TMath::Sin( angle / kRADDEG ) ;
92862013 336 Float_t yP1 = -r * TMath::Cos( angle / kRADDEG ) ;
85218d13 337
92862013 338 gMC->Gspos("PHOS", i, "ALIC", xP1, yP1, 0.0, idrotm[i-1], "ONLY") ;
ed4205d8 339
85218d13 340 }
ed4205d8 341
fe4da5cc 342}
d15a28e7 343
344//____________________________________________________________________________
85218d13 345void AliPHOSv0::CreateGeometryforEMC()
d15a28e7 346{
b2a60966 347 // Create the PHOS-EMC geometry for GEANT
85218d13 348 // Author: Dmitri Peressounko August 2001
349 // The used coordinate system:
350 // 1. in Module: X along longer side, Y out of beam, Z along shorter side (along beam)
351 // 2. In Strip the same: X along longer side, Y out of beam, Z along shorter side (along beam)
352
353
b2a60966 354 //BEGIN_HTML
355 /*
356 <H2>
357 Geant3 geometry tree of PHOS-EMC in ALICE
358 </H2>
359 <P><CENTER>
360 <IMG Align=BOTTOM ALT="EMC geant tree" SRC="../images/EMCinAlice.gif">
361 </CENTER><P>
362 */
363 //END_HTML
364
365 // Get pointer to the array containing media indexes
92862013 366 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
d15a28e7 367
7367f709 368 AliPHOSGeometry * geom = GetGeometry() ;
85218d13 369 AliPHOSEMCAGeometry * emcg = geom->GetEMCAGeometry() ;
7367f709 370
85218d13 371 // ======= Define the strip ===============
d15a28e7 372
85218d13 373 gMC->Gsvolu("PSTR", "BOX ", idtmed[716], emcg->GetStripHalfSize(), 3) ; //Made of stell
d15a28e7 374
85218d13 375 // --- define air volume (cell of the honeycomb)
376 gMC->Gsvolu("PCEL", "BOX ", idtmed[798], emcg->GetAirCellHalfSize(), 3);
d15a28e7 377
85218d13 378 // --- define wrapped crystal and put it into AirCell
d15a28e7 379
85218d13 380 gMC->Gsvolu("PWRA", "BOX ", idtmed[702], emcg->GetWrappedHalfSize(), 3);
381 Float_t * pin = emcg->GetAPDHalfSize() ;
382 Float_t * preamp = emcg->GetPreampHalfSize() ;
383 Float_t y = (emcg->GetAirGapLed()-2*pin[1]-2*preamp[1])/2;
384 gMC->Gspos("PWRA", 1, "PCEL", 0.0, y, 0.0, 0, "ONLY") ;
385
386 // --- Define crystall and put it into wrapped crystall ---
387 gMC->Gsvolu("PXTL", "BOX ", idtmed[699], emcg->GetCrystalHalfSize(), 3) ;
388 gMC->Gspos("PXTL", 1, "PWRA", 0.0, 0.0, 0.0, 0, "ONLY") ;
389
390 // --- define APD/PIN preamp and put it into AirCell
fe4da5cc 391
85218d13 392 gMC->Gsvolu("PPIN", "BOX ", idtmed[705], emcg->GetAPDHalfSize(), 3) ;
393 Float_t * crystal = emcg->GetCrystalHalfSize() ;
394 y = crystal[1] + emcg->GetAirGapLed() /2 - preamp[1];
395 gMC->Gspos("PPIN", 1, "PCEL", 0.0, y, 0.0, 0, "ONLY") ;
396
397 gMC->Gsvolu("PREA", "BOX ", idtmed[711], emcg->GetPreampHalfSize(), 3) ; // Here I assumed preamp
398 // as a printed Circuit
399 y = crystal[1] + emcg->GetAirGapLed() /2 + pin[1] ; // May it should be changed
400 gMC->Gspos("PREA", 1, "PCEL", 0.0, y, 0.0, 0, "ONLY") ; // to ceramics?
d15a28e7 401
d15a28e7 402
85218d13 403 // --- Fill strip with wrapped cristalls in Air Cells
b2a60966 404
85218d13 405 Float_t* splate = emcg->GetSupportPlateHalfSize();
406 y = -splate[1] ;
407 Float_t* acel = emcg->GetAirCellHalfSize() ;
408 Int_t icel ;
409 for(icel = 1; icel <= emcg->GetNCellsInStrip(); icel++){
410 Float_t x = (2*icel - 1 - emcg->GetNCellsInStrip())* acel[0] ;
411 gMC->Gspos("PCEL", icel, "PSTR", x, y, 0.0, 0, "ONLY") ;
412 }
7367f709 413
85218d13 414 // --- define the support plate, hole in it and position it in strip ----
415 gMC->Gsvolu("PSUP", "BOX ", idtmed[701], emcg->GetSupportPlateHalfSize(), 3) ;
7367f709 416
85218d13 417 gMC->Gsvolu("PSHO", "BOX ", idtmed[798], emcg->GetSupportPlateInHalfSize(), 3) ;
418 Float_t z = emcg->GetSupportPlateThickness()/2 ;
419 gMC->Gspos("PSHO", 1, "PSUP", 0.0, 0.0, z, 0, "ONLY") ;
fe4da5cc 420
85218d13 421 y = acel[1] ;
422 gMC->Gspos("PSUP", 1, "PSTR", 0.0, y, 0.0, 0, "ONLY") ;
d15a28e7 423
d15a28e7 424
85218d13 425 // ========== Fill module with strips and put them into inner thermoinsulation=============
426 gMC->Gsvolu("PTII", "BOX ", idtmed[706], emcg->GetInnerThermoHalfSize(), 3) ;
d15a28e7 427
85218d13 428 Float_t * inthermo = emcg->GetInnerThermoHalfSize() ;
429 Float_t * strip = emcg->GetStripHalfSize() ;
430 y = inthermo[1] - strip[1] ;
431 Int_t irow;
432 Int_t nr = 1 ;
433 Int_t icol ;
d15a28e7 434
85218d13 435 for(irow = 0; irow < emcg->GetNStripX(); irow ++){
436 Float_t x = (2*irow + 1 - emcg->GetNStripX())* strip[0] ;
437 for(icol = 0; icol < emcg->GetNStripZ(); icol ++){
438 z = (2*icol + 1 - emcg->GetNStripZ()) * strip[2] ;
439 gMC->Gspos("PSTR", nr, "PTII", x, y, z, 0, "ONLY") ;
440 nr++ ;
441 }
442 }
443
d15a28e7 444
85218d13 445 // ------- define the air gap between thermoinsulation and cooler
446 gMC->Gsvolu("PAGA", "BOX ", idtmed[798], emcg->GetAirGapHalfSize(), 3) ;
447 Float_t * agap = emcg->GetAirGapHalfSize() ;
448 y = agap[1] - inthermo[1] ;
449
450 gMC->Gspos("PTII", 1, "PAGA", 0.0, y, 0.0, 0, "ONLY") ;
d15a28e7 451
d15a28e7 452
d15a28e7 453
85218d13 454 // ------- define the Al passive cooler
455 gMC->Gsvolu("PCOR", "BOX ", idtmed[701], emcg->GetCoolerHalfSize(), 3) ;
456 Float_t * cooler = emcg->GetCoolerHalfSize() ;
457 y = cooler[1] - agap[1] ;
458
459 gMC->Gspos("PAGA", 1, "PCOR", 0.0, y, 0.0, 0, "ONLY") ;
d15a28e7 460
85218d13 461 // ------- define the outer thermoinsulating cover
462 gMC->Gsvolu("PTIO", "TRD1", idtmed[706], emcg->GetOuterThermoParams(), 4) ;
463 Float_t * outparams = emcg->GetOuterThermoParams() ;
d15a28e7 464
85218d13 465 Int_t idrotm[99] ;
466 AliMatrix(idrotm[1], 90.0, 0.0, 0.0, 0.0, 90.0, 270.0) ;
467 // Frame in outer thermoinsulation and so on: z out of beam, y along beam, x across beam
d15a28e7 468
85218d13 469 z = outparams[3] - cooler[1] ;
470 gMC->Gspos("PCOR", 1, "PTIO", 0., 0.0, z, idrotm[1], "ONLY") ;
471
472 // -------- Define the outer Aluminium cover -----
473 gMC->Gsvolu("PCOL", "TRD1", idtmed[701], emcg->GetAlCoverParams(), 4) ;
474 Float_t * covparams = emcg->GetAlCoverParams() ;
475 z = covparams[3] - outparams[3] ;
476 gMC->Gspos("PTIO", 1, "PCOL", 0., 0.0, z, 0, "ONLY") ;
477
478 // --------- Define front fiberglass cover -----------
479 gMC->Gsvolu("PFGC", "BOX ", idtmed[717], emcg->GetFiberGlassHalfSize(), 3) ;
480 z = - outparams[3] ;
481 gMC->Gspos("PFGC", 1, "PCOL", 0., 0.0, z, 0, "ONLY") ;
482
483 //=============This is all with cold section==============
484
485
486 //------ Warm Section --------------
487 gMC->Gsvolu("PWAR", "BOX ", idtmed[701], emcg->GetWarmAlCoverHalfSize(), 3) ;
488 Float_t * warmcov = emcg->GetWarmAlCoverHalfSize() ;
489
490 // --- Define the outer thermoinsulation ---
491 gMC->Gsvolu("PWTI", "BOX ", idtmed[706], emcg->GetWarmThermoHalfSize(), 3) ;
492 Float_t * warmthermo = emcg->GetWarmThermoHalfSize() ;
493 z = -warmcov[2] + warmthermo[2] ;
494
495 gMC->Gspos("PWTI", 1, "PWAR", 0., 0.0, z, 0, "ONLY") ;
496
497 // --- Define cables area and put in it T-supports ----
498 gMC->Gsvolu("PCA1", "BOX ", idtmed[718], emcg->GetTCables1HalfSize(), 3) ;
499 Float_t * cbox = emcg->GetTCables1HalfSize() ;
500
501 gMC->Gsvolu("PBE1", "BOX ", idtmed[701], emcg->GetTSupport1HalfSize(), 3) ;
502 Float_t * beams = emcg->GetTSupport1HalfSize() ;
503 Int_t isup ;
504 for(isup = 0; isup < emcg->GetNTSuppots(); isup++){
505 Float_t x = -cbox[0] + beams[0] + (2*beams[0]+emcg->GetTSupportDist())*isup ;
506 gMC->Gspos("PBE1", isup, "PCA1", x, 0.0, 0.0, 0, "ONLY") ;
507 }
d15a28e7 508
85218d13 509 z = -warmthermo[2] + cbox[2] ;
510 gMC->Gspos("PCA1", 1, "PWTI", 0.0, 0.0, z, 0, "ONLY") ;
d15a28e7 511
85218d13 512 gMC->Gsvolu("PCA2", "BOX ", idtmed[718], emcg->GetTCables2HalfSize(), 3) ;
513 Float_t * cbox2 = emcg->GetTCables2HalfSize() ;
d15a28e7 514
85218d13 515 gMC->Gsvolu("PBE2", "BOX ", idtmed[701], emcg->GetTSupport2HalfSize(), 3) ;
516 for(isup = 0; isup < emcg->GetNTSuppots(); isup++){
517 Float_t x = -cbox[0] + beams[0] + (2*beams[0]+emcg->GetTSupportDist())*isup ;
518 gMC->Gspos("PBE2", isup, "PCA2", x, 0.0, 0.0, 0, "ONLY") ;
519 }
d15a28e7 520
85218d13 521 z = -warmthermo[2] + 2*cbox[2] + cbox2[2];
522 gMC->Gspos("PCA2", 1, "PWTI", 0.0, 0.0, z, 0, "ONLY") ;
d15a28e7 523
d15a28e7 524
85218d13 525 // --- Define frame ---
526 gMC->Gsvolu("PFRX", "BOX ", idtmed[716], emcg->GetFrameXHalfSize(), 3) ;
527 Float_t * posit = emcg->GetFrameXPosition() ;
528 gMC->Gspos("PFRX", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
529 gMC->Gspos("PFRX", 2, "PWTI", posit[0], -posit[1], posit[2], 0, "ONLY") ;
d15a28e7 530
85218d13 531 gMC->Gsvolu("PFRZ", "BOX ", idtmed[716], emcg->GetFrameZHalfSize(), 3) ;
532 posit = emcg->GetFrameZPosition() ;
533 gMC->Gspos("PFRZ", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
534 gMC->Gspos("PFRZ", 2, "PWTI", -posit[0], posit[1], posit[2], 0, "ONLY") ;
d15a28e7 535
85218d13 536 // --- Define Fiber Glass support ---
537 gMC->Gsvolu("PFG1", "BOX ", idtmed[717], emcg->GetFGupXHalfSize(), 3) ;
538 posit = emcg->GetFGupXPosition() ;
539 gMC->Gspos("PFG1", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
540 gMC->Gspos("PFG1", 2, "PWTI", posit[0], -posit[1], posit[2], 0, "ONLY") ;
d15a28e7 541
85218d13 542 gMC->Gsvolu("PFG2", "BOX ", idtmed[717], emcg->GetFGupZHalfSize(), 3) ;
543 posit = emcg->GetFGupZPosition() ;
544 gMC->Gspos("PFG2", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
545 gMC->Gspos("PFG2", 2, "PWTI", -posit[0], posit[1], posit[2], 0, "ONLY") ;
d15a28e7 546
85218d13 547 gMC->Gsvolu("PFG3", "BOX ", idtmed[717], emcg->GetFGlowXHalfSize(), 3) ;
548 posit = emcg->GetFGlowXPosition() ;
549 gMC->Gspos("PFG3", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
550 gMC->Gspos("PFG3", 2, "PWTI", posit[0], -posit[1], posit[2], 0, "ONLY") ;
d15a28e7 551
85218d13 552 gMC->Gsvolu("PFG4", "BOX ", idtmed[717], emcg->GetFGlowZHalfSize(), 3) ;
553 posit = emcg->GetFGlowZPosition() ;
554 gMC->Gspos("PFG4", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
555 gMC->Gspos("PFG4", 2, "PWTI", -posit[0], posit[1], posit[2], 0, "ONLY") ;
d15a28e7 556
85218d13 557 // --- Define Air Gap for FEE electronics -----
d15a28e7 558
85218d13 559 gMC->Gsvolu("PAFE", "BOX ", idtmed[798], emcg->GetFEEAirHalfSize(), 3) ;
560 posit = emcg->GetFEEAirPosition() ;
561 gMC->Gspos("PAFE", 1, "PWTI", posit[0], posit[1], posit[2], 0, "ONLY") ;
d15a28e7 562
85218d13 563 // Define the EMC module volume and combine Cool and Warm sections
d15a28e7 564
85218d13 565 gMC->Gsvolu("PEMC", "TRD1", idtmed[798], emcg->GetEMCParams(), 4) ;
d15a28e7 566
85218d13 567 z = - warmcov[2] ;
568 gMC->Gspos("PCOL", 1, "PEMC", 0., 0., z, 0, "ONLY") ;
569 z = covparams[3] ;
570 gMC->Gspos("PWAR", 1, "PEMC", 0., 0., z, 0, "ONLY") ;
d15a28e7 571
d15a28e7 572
85218d13 573 // Put created EMC geometry into PHOS volume
574
575 z = geom->GetCPVBoxSize(1) / 2. ;
576 gMC->Gspos("PEMC", 1, "PHOS", 0., 0., z, 0, "ONLY") ;
577
fe4da5cc 578}
579
bacd0b23 580//____________________________________________________________________________
581void AliPHOSv0::CreateGeometryforCPV()
582{
583 // Create the PHOS-CPV geometry for GEANT
584 // Author: Yuri Kharlov 11 September 2000
bacd0b23 585 //BEGIN_HTML
586 /*
587 <H2>
588 Geant3 geometry of PHOS-CPV in ALICE
589 </H2>
590 <table width=700>
591
592 <tr>
593 <td>CPV perspective view</td>
594 <td>CPV front view </td>
595 </tr>
596
597 <tr>
598 <td> <img height=300 width=290 src="../images/CPVallPersp.gif"> </td>
599 <td> <img height=300 width=290 src="../images/CPVallFront.gif"> </td>
600 </tr>
601
602 <tr>
603 <td>One CPV module, perspective view </td>
604 <td>One CPV module, front view (extended in vertical direction) </td>
605 </tr>
606
607 <tr>
608 <td><img height=300 width=290 src="../images/CPVmodulePers.gif"></td>
609 <td><img height=300 width=290 src="../images/CPVmoduleSide.gif"></td>
610 </tr>
611
612 </table>
613
614 <H2>
615 Geant3 geometry tree of PHOS-CPV in ALICE
616 </H2>
617 <center>
618 <img height=300 width=290 src="../images/CPVtree.gif">
619 </center>
620 */
621 //END_HTML
622
623 Float_t par[3], x,y,z;
624
625 // Get pointer to the array containing media indexes
626 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
7367f709 627
628 AliPHOSGeometry * geom = GetGeometry() ;
629
bacd0b23 630 // The box containing all CPV for one PHOS module filled with air
7367f709 631 par[0] = geom->GetCPVBoxSize(0) / 2.0 ;
632 par[1] = geom->GetCPVBoxSize(1) / 2.0 ;
633 par[2] = geom->GetCPVBoxSize(2) / 2.0 ;
13add4de 634 gMC->Gsvolu("PCPV", "BOX ", idtmed[798], par, 3) ;
85218d13 635
636 Float_t * emcParams = geom->GetEMCAGeometry()->GetEMCParams() ;
637 z = - emcParams[3] ;
638 Int_t rotm ;
639 AliMatrix(rotm, 90.,0., 0., 0., 90., 90.) ;
640
641 gMC->Gspos("PCPV", 1, "PHOS", 0.0, 0.0, z, rotm, "ONLY") ;
bacd0b23 642
643 // Gassiplex board
644
7367f709 645 par[0] = geom->GetGassiplexChipSize(0)/2.;
646 par[1] = geom->GetGassiplexChipSize(1)/2.;
647 par[2] = geom->GetGassiplexChipSize(2)/2.;
13add4de 648 gMC->Gsvolu("PCPC","BOX ",idtmed[707],par,3);
bacd0b23 649
650 // Cu+Ni foil covers Gassiplex board
651
7367f709 652 par[1] = geom->GetCPVCuNiFoilThickness()/2;
13add4de 653 gMC->Gsvolu("PCPD","BOX ",idtmed[710],par,3);
7367f709 654 y = -(geom->GetGassiplexChipSize(1)/2 - par[1]);
13add4de 655 gMC->Gspos("PCPD",1,"PCPC",0,y,0,0,"ONLY");
bacd0b23 656
657 // Position of the chip inside CPV
658
7367f709 659 Float_t xStep = geom->GetCPVActiveSize(0) / (geom->GetNumberOfCPVChipsPhi() + 1);
660 Float_t zStep = geom->GetCPVActiveSize(1) / (geom->GetNumberOfCPVChipsZ() + 1);
bacd0b23 661 Int_t copy = 0;
7367f709 662 y = geom->GetCPVFrameSize(1)/2 - geom->GetFTPosition(0) +
663 geom->GetCPVTextoliteThickness() / 2 + geom->GetGassiplexChipSize(1) / 2 + 0.1;
664 for (Int_t ix=0; ix<geom->GetNumberOfCPVChipsPhi(); ix++) {
665 x = xStep * (ix+1) - geom->GetCPVActiveSize(0)/2;
666 for (Int_t iz=0; iz<geom->GetNumberOfCPVChipsZ(); iz++) {
bacd0b23 667 copy++;
7367f709 668 z = zStep * (iz+1) - geom->GetCPVActiveSize(1)/2;
13add4de 669 gMC->Gspos("PCPC",copy,"PCPV",x,y,z,0,"ONLY");
bacd0b23 670 }
671 }
672
673 // Foiled textolite (1 mm of textolite + 50 mkm of Cu + 6 mkm of Ni)
674
7367f709 675 par[0] = geom->GetCPVActiveSize(0) / 2;
676 par[1] = geom->GetCPVTextoliteThickness() / 2;
677 par[2] = geom->GetCPVActiveSize(1) / 2;
13add4de 678 gMC->Gsvolu("PCPF","BOX ",idtmed[707],par,3);
bacd0b23 679
680 // Argon gas volume
681
7367f709 682 par[1] = (geom->GetFTPosition(2) - geom->GetFTPosition(1) - geom->GetCPVTextoliteThickness()) / 2;
13add4de 683 gMC->Gsvolu("PCPG","BOX ",idtmed[715],par,3);
bacd0b23 684
685 for (Int_t i=0; i<4; i++) {
7367f709 686 y = geom->GetCPVFrameSize(1) / 2 - geom->GetFTPosition(i) + geom->GetCPVTextoliteThickness()/2;
13add4de 687 gMC->Gspos("PCPF",i+1,"PCPV",0,y,0,0,"ONLY");
bacd0b23 688 if(i==1){
7367f709 689 y-= (geom->GetFTPosition(2) - geom->GetFTPosition(1)) / 2;
13add4de 690 gMC->Gspos("PCPG",1,"PCPV ",0,y,0,0,"ONLY");
bacd0b23 691 }
692 }
693
694 // Dummy sensitive plane in the middle of argone gas volume
695
696 par[1]=0.001;
13add4de 697 gMC->Gsvolu("PCPQ","BOX ",idtmed[715],par,3);
698 gMC->Gspos ("PCPQ",1,"PCPG",0,0,0,0,"ONLY");
bacd0b23 699
700 // Cu+Ni foil covers textolite
701
7367f709 702 par[1] = geom->GetCPVCuNiFoilThickness() / 2;
13add4de 703 gMC->Gsvolu("PCP1","BOX ",idtmed[710],par,3);
7367f709 704 y = geom->GetCPVTextoliteThickness()/2 - par[1];
13add4de 705 gMC->Gspos ("PCP1",1,"PCPF",0,y,0,0,"ONLY");
bacd0b23 706
707 // Aluminum frame around CPV
708
7367f709 709 par[0] = geom->GetCPVFrameSize(0)/2;
710 par[1] = geom->GetCPVFrameSize(1)/2;
711 par[2] = geom->GetCPVBoxSize(2) /2;
13add4de 712 gMC->Gsvolu("PCF1","BOX ",idtmed[701],par,3);
bacd0b23 713
7367f709 714 par[0] = geom->GetCPVBoxSize(0)/2 - geom->GetCPVFrameSize(0);
715 par[1] = geom->GetCPVFrameSize(1)/2;
716 par[2] = geom->GetCPVFrameSize(2)/2;
13add4de 717 gMC->Gsvolu("PCF2","BOX ",idtmed[701],par,3);
bacd0b23 718
719 for (Int_t j=0; j<=1; j++) {
7367f709 720 x = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(0) - geom->GetCPVFrameSize(0)) / 2;
13add4de 721 gMC->Gspos("PCF1",j+1,"PCPV", x,0,0,0,"ONLY");
7367f709 722 z = TMath::Sign(1,2*j-1) * (geom->GetCPVBoxSize(2) - geom->GetCPVFrameSize(2)) / 2;
13add4de 723 gMC->Gspos("PCF2",j+1,"PCPV",0, 0,z,0,"ONLY");
bacd0b23 724 }
725
726}
727
728
6a5795b4 729//____________________________________________________________________________
730void AliPHOSv0::CreateGeometryforSupport()
731{
732 // Create the PHOS' support geometry for GEANT
733 //BEGIN_HTML
734 /*
735 <H2>
736 Geant3 geometry of the PHOS's support
737 </H2>
738 <P><CENTER>
739 <IMG Align=BOTTOM ALT="EMC geant tree" SRC="../images/PHOS_support.gif">
740 </CENTER><P>
741 */
742 //END_HTML
743
744 Float_t par[5], x0,y0,z0 ;
745 Int_t i,j,copy;
746
747 // Get pointer to the array containing media indexes
748 Int_t *idtmed = fIdtmed->GetArray() - 699 ;
749
7367f709 750 AliPHOSGeometry * geom = GetGeometry() ;
751
6a5795b4 752 // --- Dummy box containing two rails on which PHOS support moves
753 // --- Put these rails to the bottom of the L3 magnet
754
7367f709 755 par[0] = geom->GetRailRoadSize(0) / 2.0 ;
756 par[1] = geom->GetRailRoadSize(1) / 2.0 ;
757 par[2] = geom->GetRailRoadSize(2) / 2.0 ;
6a5795b4 758 gMC->Gsvolu("PRRD", "BOX ", idtmed[798], par, 3) ;
759
7367f709 760 y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) / 2.0) ;
6a5795b4 761 gMC->Gspos("PRRD", 1, "ALIC", 0.0, y0, 0.0, 0, "ONLY") ;
762
763 // --- Dummy box containing one rail
764
7367f709 765 par[0] = geom->GetRailOuterSize(0) / 2.0 ;
766 par[1] = geom->GetRailOuterSize(1) / 2.0 ;
767 par[2] = geom->GetRailOuterSize(2) / 2.0 ;
6a5795b4 768 gMC->Gsvolu("PRAI", "BOX ", idtmed[798], par, 3) ;
769
770 for (i=0; i<2; i++) {
7367f709 771 x0 = (2*i-1) * geom->GetDistanceBetwRails() / 2.0 ;
6a5795b4 772 gMC->Gspos("PRAI", i, "PRRD", x0, 0.0, 0.0, 0, "ONLY") ;
773 }
774
775 // --- Upper and bottom steel parts of the rail
776
7367f709 777 par[0] = geom->GetRailPart1(0) / 2.0 ;
778 par[1] = geom->GetRailPart1(1) / 2.0 ;
779 par[2] = geom->GetRailPart1(2) / 2.0 ;
6a5795b4 780 gMC->Gsvolu("PRP1", "BOX ", idtmed[716], par, 3) ;
781
7367f709 782 y0 = - (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 ;
6a5795b4 783 gMC->Gspos("PRP1", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
7367f709 784 y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart1(1)) / 2.0 - geom->GetRailPart3(1);
6a5795b4 785 gMC->Gspos("PRP1", 2, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
786
787 // --- The middle vertical steel parts of the rail
788
7367f709 789 par[0] = geom->GetRailPart2(0) / 2.0 ;
790 par[1] = geom->GetRailPart2(1) / 2.0 ;
791 par[2] = geom->GetRailPart2(2) / 2.0 ;
6a5795b4 792 gMC->Gsvolu("PRP2", "BOX ", idtmed[716], par, 3) ;
793
7367f709 794 y0 = - geom->GetRailPart3(1) / 2.0 ;
6a5795b4 795 gMC->Gspos("PRP2", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
796
797 // --- The most upper steel parts of the rail
798
7367f709 799 par[0] = geom->GetRailPart3(0) / 2.0 ;
800 par[1] = geom->GetRailPart3(1) / 2.0 ;
801 par[2] = geom->GetRailPart3(2) / 2.0 ;
6a5795b4 802 gMC->Gsvolu("PRP3", "BOX ", idtmed[716], par, 3) ;
803
7367f709 804 y0 = (geom->GetRailOuterSize(1) - geom->GetRailPart3(1)) / 2.0 ;
6a5795b4 805 gMC->Gspos("PRP3", 1, "PRAI", 0.0, y0, 0.0, 0, "ONLY") ;
806
807 // --- The wall of the cradle
808 // --- The wall is empty: steel thin walls and air inside
809
85218d13 810 par[1] = TMath::Sqrt(TMath::Power((geom->GetIPtoCPVDistance() + geom->GetOuterBoxSize(3)),2) +
811 TMath::Power((geom->GetOuterBoxSize(1)/2),2))+10. ;
7367f709 812 par[0] = par[1] - geom->GetCradleWall(1) ;
813 par[2] = geom->GetCradleWall(2) / 2.0 ;
814 par[3] = geom->GetCradleWall(3) ;
815 par[4] = geom->GetCradleWall(4) ;
6a5795b4 816 gMC->Gsvolu("PCRA", "TUBS", idtmed[716], par, 5) ;
817
7367f709 818 par[0] -= geom->GetCradleWallThickness() ;
819 par[1] -= geom->GetCradleWallThickness() ;
820 par[2] -= geom->GetCradleWallThickness() ;
6a5795b4 821 gMC->Gsvolu("PCRE", "TUBS", idtmed[798], par, 5) ;
822 gMC->Gspos ("PCRE", 1, "PCRA", 0.0, 0.0, 0.0, 0, "ONLY") ;
823
824 for (i=0; i<2; i++) {
85218d13 825 z0 = (2*i-1) * (geom->GetOuterBoxSize(2) + geom->GetCradleWall(2) )/ 2.0 ;
826 gMC->Gspos("PCRA", i, "ALIC", 0.0, 0.0, z0, 0, "ONLY") ;
6a5795b4 827 }
828
829 // --- The "wheels" of the cradle
830
7367f709 831 par[0] = geom->GetCradleWheel(0) / 2;
832 par[1] = geom->GetCradleWheel(1) / 2;
833 par[2] = geom->GetCradleWheel(2) / 2;
6a5795b4 834 gMC->Gsvolu("PWHE", "BOX ", idtmed[716], par, 3) ;
835
7367f709 836 y0 = -(geom->GetRailsDistanceFromIP() - geom->GetRailRoadSize(1) -
837 geom->GetCradleWheel(1)/2) ;
6a5795b4 838 for (i=0; i<2; i++) {
85218d13 839 z0 = (2*i-1) * ((geom->GetOuterBoxSize(2) + geom->GetCradleWheel(2))/ 2.0 +
7367f709 840 geom->GetCradleWall(2));
6a5795b4 841 for (j=0; j<2; j++) {
842 copy = 2*i + j;
7367f709 843 x0 = (2*j-1) * geom->GetDistanceBetwRails() / 2.0 ;
6a5795b4 844 gMC->Gspos("PWHE", copy, "ALIC", x0, y0, z0, 0, "ONLY") ;
845 }
846 }
847
848}
849
ed4205d8 850//____________________________________________________________________________
851Float_t AliPHOSv0::ZMin(void) const
852{
853 // Overall dimension of the PHOS (min)
7367f709 854
855 AliPHOSGeometry * geom = GetGeometry() ;
856
85218d13 857 return -geom->GetOuterBoxSize(2)/2.;
ed4205d8 858}
859
860//____________________________________________________________________________
861Float_t AliPHOSv0::ZMax(void) const
862{
863 // Overall dimension of the PHOS (max)
7367f709 864
865 AliPHOSGeometry * geom = GetGeometry() ;
866
85218d13 867 return geom->GetOuterBoxSize(2)/2.;
ed4205d8 868}
869
d15a28e7 870//____________________________________________________________________________
871void AliPHOSv0::Init(void)
872{
b2a60966 873 // Just prints an information message
874
d15a28e7 875 Int_t i;
876
9e1a0ddb 877 if(fDebug) {
21cd0c07 878 TString st ;
bd46a237 879 for(i=0;i<35;i++)
21cd0c07 880 st += "*";
881 Info("Init", "%s", st.Data()) ;
9e1a0ddb 882 // Here the PHOS initialisation code (if any!)
bd46a237 883
7367f709 884 AliPHOSGeometry * geom = GetGeometry() ;
885
886 if (geom!=0)
21cd0c07 887 Info("Init", "AliPHOS%s: PHOS geometry intialized for %s", Version().Data(), geom->GetName()) ;
9e1a0ddb 888 else
21cd0c07 889 Info("Init", "AliPHOS%s: PHOS geometry initialization failed !", Version().Data()) ;
890
891 Info("Init", "%s", st.Data()) ;
bd46a237 892 }
d15a28e7 893}