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