New ALIPHOSv1: includes the light transport in the Xtal
[u/mrichter/AliRoot.git] / PHOS / AliPHOSGeometry.cxx
CommitLineData
d15a28e7 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 **************************************************************************/
15
16//_________________________________________________________________________
17// Geometry class for PHOS version SUBATECH
18//*-- Author : Y. Schutz SUBATECH
19//////////////////////////////////////////////////////////////////////////////
20
21// --- ROOT system ---
22
23#include "TVector3.h"
24#include "TRotation.h"
25
26// --- Standard library ---
27
9f616d61 28#include <iostream>
29#include <cassert>
d15a28e7 30
31// --- AliRoot header files ---
32
33#include "AliPHOSGeometry.h"
34#include "AliPHOSPpsdRecPoint.h"
35#include "AliConst.h"
36
37ClassImp(AliPHOSGeometry)
38
39 AliPHOSGeometry * AliPHOSGeometry::fGeom = 0 ;
40
41//____________________________________________________________________________
42AliPHOSGeometry::~AliPHOSGeometry(void)
43{
44 fRotMatrixArray->Delete() ;
45 delete fRotMatrixArray ;
46}
47
48//____________________________________________________________________________
49Bool_t AliPHOSGeometry::AbsToRelNumbering(const Int_t AbsId, Int_t * RelId)
50{
51 // RelId[0] = PHOS Module number 1:fNModules
52 // RelId[1] = 0 if PbW04
53 // = PPSD Module number 1:fNumberOfModulesPhi*fNumberOfModulesZ*2 (2->up and bottom level)
54 // RelId[2] = Row number inside a PHOS or PPSD module
55 // RelId[3] = Column number inside a PHOS or PPSD module
56
57 Bool_t rv = kTRUE ;
58 Float_t Id = AbsId ;
59
60 Int_t PHOSModuleNumber = (Int_t)TMath:: Ceil( Id / ( GetNPhi() * GetNZ() ) ) ;
61
62 if ( PHOSModuleNumber > GetNModules() ) { // its a PPSD pad
63
64 Id -= GetNPhi() * GetNZ() * GetNModules() ;
65 Float_t tempo = 2 * GetNumberOfModulesPhi() * GetNumberOfModulesZ() * GetNumberOfPadsPhi() * GetNumberOfPadsZ() ;
66 RelId[0] = (Int_t)TMath::Ceil( Id / tempo ) ;
67 Id -= ( RelId[0] - 1 ) * tempo ;
68 RelId[1] = (Int_t)TMath::Ceil( Id / ( GetNumberOfPadsPhi() * GetNumberOfPadsZ() ) ) ;
69 Id -= ( RelId[1] - 1 ) * GetNumberOfPadsPhi() * GetNumberOfPadsZ() ;
70 RelId[2] = (Int_t)TMath::Ceil( Id / GetNumberOfPadsPhi() ) ;
71 RelId[3] = (Int_t) ( Id - ( RelId[2] - 1 ) * GetNumberOfPadsPhi() ) ;
72 }
73 else { // its a PW04 crystal
74
75 RelId[0] = PHOSModuleNumber ;
76 RelId[1] = 0 ;
77 Id -= ( PHOSModuleNumber - 1 ) * GetNPhi() * GetNZ() ;
78 RelId[2] = (Int_t)TMath::Ceil( Id / GetNPhi() ) ;
79 RelId[3] = (Int_t)( Id - ( RelId[2] - 1 ) * GetNPhi() ) ;
80 }
81 return rv ;
82}
9f616d61 83//____________________________________________________________________________
84void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt)
85{
86 // calculates the angular coverage in theta and phi of a EMC module
87
88 Double_t conv ;
89 if ( opt == kRadian )
90 conv = 1. ;
91 else if ( opt == kDegre )
92 conv = 180. / TMath::Pi() ;
93 else {
94 cout << "<I> AliPHOSGeometry::EmcXtalCoverage : " << opt << " unknown option; result in radian " << endl ;
95 conv = 1. ;
96 }
97
98 Float_t phi = GetPHOSAngle(mod) * (TMath::Pi() / 180.) ;
99 Float_t Y0 = GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
100 + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness() ;
101
102 Double_t angle = TMath::ATan( GetCrystalSize(0)*GetNPhi() / (2 * Y0) ) ;
103 phi = phi + 1.5 * TMath::Pi() ; // to follow the convention of the particle generator(PHOS is between 230 and 310 deg.)
104 Double_t m = phi - angle ;
105 Double_t M = phi + angle ;
106 pM = TMath::Max(M, m) * conv ;
107 pm = TMath::Min(M, m) * conv ;
108
109 angle = TMath::ATan( GetCrystalSize(2)*GetNZ() / (2 * Y0) ) ;
110 M = TMath::Pi() / 2. + angle ; // to follow the convention of the particle generator(PHOS is at 90 deg.)
111 m = TMath::Pi() / 2. - angle ;
112 tM = TMath::Max(M, m) * conv ;
113 tm = TMath::Min(M, m) * conv ;
114
115}
116
117//____________________________________________________________________________
118void AliPHOSGeometry::EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt)
119{
120 // calculates the angular coverage in theta and phi of a single crystal in a EMC module
121
122 Double_t conv ;
123 if ( opt == kRadian )
124 conv = 1. ;
125 else if ( opt == kDegre )
126 conv = 180. / TMath::Pi() ;
127 else {
128 cout << "<I> AliPHOSGeometry::EmcXtalCoverage : " << opt << " unknown option; result in radian " << endl ;
129 conv = 1. ;
130 }
131
132 Float_t Y0 = GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
133 + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness() ;
134 theta = 2 * TMath::ATan( GetCrystalSize(2) / (2 * Y0) ) * conv ;
135 phi = 2 * TMath::ATan( GetCrystalSize(0) / (2 * Y0) ) * conv ;
136}
137
138
139//____________________________________________________________________________
140void AliPHOSGeometry::ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & z, Double_t & x)
141{
142 // calculates the impact coordinates of a neutral particle
143 // emitted in direction theta and phi in ALICE
144
145 // searches for the PHOS EMC module
146 ModuleNumber = 0 ;
147 Double_t tm, tM, pm, pM ;
148 Int_t index = 1 ;
149 while ( ModuleNumber == 0 && index <= GetNModules() ) {
150 EmcModuleCoverage(index, tm, tM, pm, pM) ;
151 if ( (theta >= tm && theta <= tM) && (phi >= pm && phi <= pM ) )
152 ModuleNumber = index ;
153 index++ ;
154 }
155 if ( ModuleNumber != 0 ) {
156 Float_t phi0 = GetPHOSAngle(ModuleNumber) * (TMath::Pi() / 180.) + 1.5 * TMath::Pi() ;
157 Float_t Y0 = GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
158 + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness() ;
159 Double_t angle = phi - phi0;
160 x = Y0 * TMath::Tan(angle) ;
161 angle = theta - TMath::Pi() / 2 ;
162 z = Y0 * TMath::Tan(angle) ;
163 }
164}
d15a28e7 165
166//____________________________________________________________________________
167void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & gmat)
168{
169
170 AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ;
171 TVector3 LocalPosition ;
172
173 tmpPHOS->GetLocalPosition(gpos) ;
174
175
176 if ( tmpPHOS->IsEmc() ) // it is a EMC crystal
177 { gpos.SetY( -(GetIPtoOuterCoverDistance() + GetUpperPlateThickness() +
178 GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()) ) ;
179
180 }
181 else
182 { // it is a PPSD pad
183 AliPHOSPpsdRecPoint * tmpPpsd = (AliPHOSPpsdRecPoint *) RecPoint ;
184 if (tmpPpsd->GetUp() ) // it is an upper module
185 {
186 gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() -
187 GetLeadToMicro2Gap() - GetLeadConverterThickness() -
188 GetMicro1ToLeadGap() - GetMicromegas1Thickness() / 2.0 ) ) ;
189 }
190 else // it is a lower module
191 gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() / 2.0) ) ;
192 }
193
194 Float_t Phi = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ;
195 Double_t const RADDEG = 180.0 / kPI ;
196 Float_t rPhi = Phi / RADDEG ;
197
198 TRotation Rot ;
199 Rot.RotateZ(-rPhi) ; // a rotation around Z by angle
200
201 TRotation dummy = Rot.Invert() ; // to transform from original frame to rotate frame
202 gpos.Transform(Rot) ; // rotate the baby
6ad0bfa0 203
d15a28e7 204}
205
206//____________________________________________________________________________
207void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos)
208{
209 AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ;
210 TVector3 LocalPosition ;
211 tmpPHOS->GetLocalPosition(gpos) ;
212
213
214 if ( tmpPHOS->IsEmc() ) // it is a EMC crystal
215 { gpos.SetY( -(GetIPtoOuterCoverDistance() + GetUpperPlateThickness() +
216 GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()) ) ;
217 }
218 else
219 { // it is a PPSD pad
220 AliPHOSPpsdRecPoint * tmpPpsd = (AliPHOSPpsdRecPoint *) RecPoint ;
221 if (tmpPpsd->GetUp() ) // it is an upper module
222 {
223 gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() -
224 GetLeadToMicro2Gap() - GetLeadConverterThickness() -
225 GetMicro1ToLeadGap() - GetMicromegas1Thickness() / 2.0 ) ) ;
226 }
227 else // it is a lower module
228 gpos.SetY(-( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() / 2.0) ) ;
229 }
230
231 Float_t Phi = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ;
232 Double_t const RADDEG = 180.0 / kPI ;
233 Float_t rPhi = Phi / RADDEG ;
234
235 TRotation Rot ;
236 Rot.RotateZ(-rPhi) ; // a rotation around Z by angle
237
238 TRotation dummy = Rot.Invert() ; // to transform from original frame to rotate frame
239 gpos.Transform(Rot) ; // rotate the baby
240}
241
242//____________________________________________________________________________
243void AliPHOSGeometry::Init(void)
244{
245 fRotMatrixArray = new TObjArray(fNModules) ;
246
247 cout << "PHOS geometry setup: parameters for option " << fName << " " << fTitle << endl ;
248 if ( ((strcmp( fName, "default" )) == 0) || ((strcmp( fName, "GPS2" )) == 0) ) {
249 fInit = kTRUE ;
250 this->InitPHOS() ;
251 this->InitPPSD() ;
252 this->SetPHOSAngles() ;
253 }
254 else {
255 fInit = kFALSE ;
256 cout << "PHOS Geometry setup: option not defined " << fName << endl ;
257 }
258}
259
260//____________________________________________________________________________
261void AliPHOSGeometry::InitPHOS(void)
262{
263 // PHOS
264
265 fNPhi = 64 ;
266 fNZ = 64 ;
267 fNModules = 5 ;
268
269 fPHOSAngle[0] = 0.0 ; // Module position angles are set in CreateGeometry()
270 fPHOSAngle[1] = 0.0 ;
271 fPHOSAngle[2] = 0.0 ;
272 fPHOSAngle[3] = 0.0 ;
273
274 fXtlSize[0] = 2.2 ;
275 fXtlSize[1] = 18.0 ;
276 fXtlSize[2] = 2.2 ;
277
278 // all these numbers coming next are subject to changes
279
280 fOuterBoxThickness[0] = 2.8 ;
281 fOuterBoxThickness[1] = 5.0 ;
282 fOuterBoxThickness[2] = 5.0 ;
283
284 fUpperPlateThickness = 4.0 ;
285
286 fSecondUpperPlateThickness = 5.0 ;
287
288 fCrystalSupportHeight = 6.95 ;
289 fCrystalWrapThickness = 0.01 ;
290 fCrystalHolderThickness = 0.005 ;
291 fModuleBoxThickness = 2.0 ;
292 fIPtoOuterCoverDistance = 447.0 ;
293 fIPtoCrystalSurface = 460.0 ;
294
295 fPinDiodeSize[0] = 1.0 ;
296 fPinDiodeSize[1] = 0.1 ;
297 fPinDiodeSize[2] = 1.0 ;
298
299 fUpperCoolingPlateThickness = 0.06 ;
300 fSupportPlateThickness = 10.0 ;
301 fLowerThermoPlateThickness = 3.0 ;
302 fLowerTextolitPlateThickness = 1.0 ;
303 fGapBetweenCrystals = 0.03 ;
304
305 fTextolitBoxThickness[0] = 1.5 ;
306 fTextolitBoxThickness[1] = 0.0 ;
307 fTextolitBoxThickness[2] = 3.0 ;
308
309 fAirThickness[0] = 1.56 ;
310 fAirThickness[1] = 20.5175 ;
311 fAirThickness[2] = 2.48 ;
312
313 Float_t XtalModulePhiSize = fNPhi * ( fXtlSize[0] + 2 * fGapBetweenCrystals ) ;
314 Float_t XtalModuleZSize = fNZ * ( fXtlSize[2] + 2 * fGapBetweenCrystals ) ;
315
316 // The next dimensions are calculated from the above parameters
317
318 fOuterBoxSize[0] = XtalModulePhiSize + 2 * ( fAirThickness[0] + fModuleBoxThickness
319 + fTextolitBoxThickness[0] + fOuterBoxThickness[0] ) ;
320 fOuterBoxSize[1] = ( fXtlSize[1] + fCrystalSupportHeight + fCrystalWrapThickness + fCrystalHolderThickness )
321 + 2 * (fAirThickness[1] + fModuleBoxThickness + fTextolitBoxThickness[1] + fOuterBoxThickness[1] ) ;
322 fOuterBoxSize[2] = XtalModuleZSize + 2 * ( fAirThickness[2] + fModuleBoxThickness
323 + fTextolitBoxThickness[2] + fOuterBoxThickness[2] ) ;
324
325 fTextolitBoxSize[0] = fOuterBoxSize[0] - 2 * fOuterBoxThickness[0] ;
326 fTextolitBoxSize[1] = fOuterBoxSize[1] - fOuterBoxThickness[1] - fUpperPlateThickness ;
327 fTextolitBoxSize[2] = fOuterBoxSize[2] - 2 * fOuterBoxThickness[2] ;
328
329 fAirFilledBoxSize[0] = fTextolitBoxSize[0] - 2 * fTextolitBoxThickness[0] ;
330 fAirFilledBoxSize[1] = fTextolitBoxSize[1] - fSecondUpperPlateThickness ;
331 fAirFilledBoxSize[2] = fTextolitBoxSize[2] - 2 * fTextolitBoxThickness[2] ;
332
333}
334
335//____________________________________________________________________________
336void AliPHOSGeometry::InitPPSD(void)
337{
338 // PPSD
339
340 fAnodeThickness = 0.0009 ;
341 fAvalancheGap = 0.01 ;
342 fCathodeThickness = 0.0009 ;
343 fCompositeThickness = 0.3 ;
9f616d61 344 fConversionGap = 0.6 ;
d15a28e7 345 fLeadConverterThickness = 0.56 ;
346 fLeadToMicro2Gap = 0.1 ;
347 fLidThickness = 0.2 ;
348 fMicro1ToLeadGap = 0.1 ;
349 fMicromegasWallThickness = 0.6 ;
350 fNumberOfModulesPhi = 4 ;
351 fNumberOfModulesZ = 4 ;
352 fNumberOfPadsPhi = 24 ;
353 fNumberOfPadsZ = 24 ;
354 fPCThickness = 0.1 ;
355 fPhiDisplacement = 0.8 ;
356 fZDisplacement = 0.8 ;
357
358 fMicromegas1Thickness = fLidThickness + 2 * fCompositeThickness + fCathodeThickness + fPCThickness
359 + fAnodeThickness + fConversionGap + fAvalancheGap ;
360 fMicromegas2Thickness = fMicromegas1Thickness ;
361
362
363 fPPSDModuleSize[0] = 38.0 ;
364 fPPSDModuleSize[1] = fMicromegas1Thickness ;
365 fPPSDModuleSize[2] = 38.0 ;
366
367 fPPSDBoxSize[0] = fNumberOfModulesPhi * fPPSDModuleSize[0] + 2 * fPhiDisplacement ;
368 fPPSDBoxSize[1] = fMicromegas2Thickness + fMicromegas2Thickness + fLeadConverterThickness + fMicro1ToLeadGap + fLeadToMicro2Gap ;
369 fPPSDBoxSize[2] = fNumberOfModulesZ * fPPSDModuleSize[2] + 2 * fZDisplacement ;
370
371 fIPtoTopLidDistance = fIPtoOuterCoverDistance - fPPSDBoxSize[1] - 1. ;
372
373}
374
375//____________________________________________________________________________
376AliPHOSGeometry * AliPHOSGeometry::GetInstance()
377{
d15a28e7 378 return (AliPHOSGeometry *) fGeom ;
379}
380
381//____________________________________________________________________________
382AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t* title)
383{
384 AliPHOSGeometry * rv = 0 ;
385 if ( fGeom == 0 ) {
386 fGeom = new AliPHOSGeometry(name, title) ;
387 rv = (AliPHOSGeometry * ) fGeom ;
388 }
389 else {
390 if ( strcmp(fGeom->GetName(), name) != 0 ) {
391 cout << "AliPHOSGeometry <E> : current geometry is " << fGeom->GetName() << endl
392 << " you cannot call " << name << endl ;
393 }
394 else
395 rv = (AliPHOSGeometry *) fGeom ;
396 }
397 return rv ;
398}
399
400//____________________________________________________________________________
401Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * RelId, Int_t & AbsId)
402{
403
404 // AbsId = 1:fNModules * fNPhi * fNZ -> PbWO4
405 // AbsId = 1:fNModules * 2 * (fNumberOfModulesPhi * fNumberOfModulesZ) * fNumberOfPadsPhi * fNumberOfPadsZ -> PPSD
406
407 Bool_t rv = kTRUE ;
408
409 if ( RelId[1] > 0 ) { // its a PPSD pad
410
411 AbsId = GetNPhi() * GetNZ() * GetNModules() // the offset to separate emcal crystals from PPSD pads
412 + ( RelId[0] - 1 ) * GetNumberOfModulesPhi() * GetNumberOfModulesZ() // the pads offset of PHOS modules
413 * GetNumberOfPadsPhi() * GetNumberOfPadsZ() * 2
414 + ( RelId[1] - 1 ) * GetNumberOfPadsPhi() * GetNumberOfPadsZ() // the pads offset of PPSD modules
415 + ( RelId[2] - 1 ) * GetNumberOfPadsPhi() // the pads offset of a PPSD row
416 + RelId[3] ; // the column number
417 }
418 else {
419 if ( RelId[1] == 0 ) { // its a Phos crystal
420 AbsId = ( RelId[0] - 1 ) * GetNPhi() * GetNZ() // the offset of PHOS modules
421 + ( RelId[2] - 1 ) * GetNPhi() // the offset of a xtal row
422 + RelId[3] ; // the column number
423 }
424 }
425
426 return rv ;
427}
428
429//____________________________________________________________________________
430
431void AliPHOSGeometry::RelPosInAlice(const Int_t Id, TVector3 & pos )
432{
433 if (Id > 0) {
434
435 Int_t RelId[4] ;
436
437 AbsToRelNumbering(Id , RelId) ;
438
439 Int_t PHOSModule = RelId[0] ;
440
9f616d61 441 Float_t Y0 ;
442
d15a28e7 443 if ( RelId[1] == 0 ) // it is a PbW04 crystal
9f616d61 444 { Y0 = -(GetIPtoOuterCoverDistance() + GetUpperPlateThickness()
445 + GetSecondUpperPlateThickness() + GetUpperCoolingPlateThickness()) ;
d15a28e7 446 }
447 if ( RelId[1] > 0 ) { // its a PPSD pad
448 if ( RelId[1] > GetNumberOfModulesPhi() * GetNumberOfModulesZ() ) // its an bottom module
449 {
9f616d61 450 Y0 = -( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() / 2.0) ;
d15a28e7 451 }
452 else // its an upper module
9f616d61 453 Y0 = -( GetIPtoOuterCoverDistance() - GetMicromegas2Thickness() - GetLeadToMicro2Gap()
454 - GetLeadConverterThickness() - GetMicro1ToLeadGap() - GetMicromegas1Thickness() / 2.0) ;
d15a28e7 455 }
456
457 Float_t x, z ;
458 RelPosInModule(RelId, x, z) ;
459
9f616d61 460 pos.SetX(x) ;
461 pos.SetZ(z) ;
462 pos.SetY( TMath::Sqrt(x*x + z*z + Y0*Y0) ) ;
463
d15a28e7 464
465
466 Float_t Phi = GetPHOSAngle( PHOSModule) ;
467 Double_t const RADDEG = 180.0 / kPI ;
468 Float_t rPhi = Phi / RADDEG ;
469
470 TRotation Rot ;
471 Rot.RotateZ(-rPhi) ; // a rotation around Z by angle
472
473 TRotation dummy = Rot.Invert() ; // to transform from original frame to rotate frame
474
475 pos.Transform(Rot) ; // rotate the baby
476 }
477 else {
478 pos.SetX(0.);
479 pos.SetY(0.);
480 pos.SetZ(0.);
481 }
482}
483
484//____________________________________________________________________________
485void AliPHOSGeometry::RelPosInModule(const Int_t * RelId, Float_t & x, Float_t & z)
486{
487 Int_t PPSDModule ;
488 Int_t Row = RelId[2] ; //offset along z axiz
489 Int_t Column = RelId[3] ; //offset along x axiz
490
491 Float_t PadSizeZ = GetPPSDModuleSize(2)/ GetNumberOfPadsZ();
492 Float_t PadSizeX = GetPPSDModuleSize(0)/ GetNumberOfPadsPhi();
493
494 if ( RelId[1] == 0 ) { // its a PbW04 crystal
495 x = -( GetNPhi()/2. - Row + 0.5 ) * GetCrystalSize(0) ; // position ox Xtal with respect
6ad0bfa0 496 z = ( GetNZ() /2. - Column + 0.5 ) * GetCrystalSize(2) ; // of center of PHOS module
d15a28e7 497 }
498 else {
499 if ( RelId[1] > GetNumberOfModulesPhi() * GetNumberOfModulesZ() )
500 PPSDModule = RelId[1]-GetNumberOfModulesPhi() * GetNumberOfModulesZ();
501 else PPSDModule = RelId[1] ;
502 Int_t ModRow = 1+(Int_t)TMath::Ceil( (Float_t)PPSDModule / GetNumberOfModulesPhi()-1. ) ;
503 Int_t ModCol = PPSDModule - ( ModRow-1 ) * GetNumberOfModulesPhi() ;
504 Float_t x0 = ( GetNumberOfModulesPhi() / 2. - ModRow + 0.5 ) * GetPPSDModuleSize(0) ;
505 Float_t z0 = ( GetNumberOfModulesZ() / 2. - ModCol + 0.5 ) * GetPPSDModuleSize(2) ;
506 x = - ( GetNumberOfPadsPhi()/2. - Row - 0.5 ) * PadSizeX + x0 ; // position of pad with respect
6ad0bfa0 507 z = ( GetNumberOfPadsZ()/2. - Column - 0.5 ) * PadSizeZ - z0 ; // of center of PHOS module
d15a28e7 508 }
509}
510
511//____________________________________________________________________________
512void AliPHOSGeometry:: SetPHOSAngles()
513{
514 Double_t const RADDEG = 180.0 / kPI ;
515 Float_t PPHI = TMath::ATan( fOuterBoxSize[0] / ( 2.0 * fIPtoOuterCoverDistance ) ) ;
516 PPHI *= RADDEG ;
517
518 for( Int_t i = 1; i <= fNModules ; i++ ) {
519 Float_t angle = PPHI * 2 * ( i - fNModules / 2.0 - 0.5 ) ;
520 fPHOSAngle[i-1] = - angle ;
521 }
522}
523