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