]>
Commit | Line | Data |
---|---|---|
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 | /* $Id$ */ | |
17 | ||
18 | //_________________________________________________________________________ | |
19 | // Geometry class for PHOS : singleton | |
20 | // PHOS consists of the electromagnetic calorimeter (EMCA) | |
21 | // and a charged particle veto either in the Subatech's version (PPSD) | |
22 | // or in the IHEP's one (CPV). | |
23 | // The EMCA/PPSD/CPV modules are parametrized so that any configuration | |
24 | // can be easily implemented | |
25 | // The title is used to identify the version of CPV used. | |
26 | // | |
27 | //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC "KI" & SUBATECH) | |
28 | ||
29 | // --- ROOT system --- | |
30 | ||
31 | #include "TVector3.h" | |
32 | #include "TRotation.h" | |
33 | #include "TParticle.h" | |
34 | ||
35 | // --- Standard library --- | |
36 | ||
37 | // --- AliRoot header files --- | |
38 | ||
39 | #include "AliPHOSGeometry.h" | |
40 | #include "AliPHOSEMCAGeometry.h" | |
41 | #include "AliPHOSRecPoint.h" | |
42 | ||
43 | ClassImp(AliPHOSGeometry) ; | |
44 | ||
45 | // these initialisations are needed for a singleton | |
46 | AliPHOSGeometry * AliPHOSGeometry::fgGeom = 0 ; | |
47 | Bool_t AliPHOSGeometry::fgInit = kFALSE ; | |
48 | ||
49 | //____________________________________________________________________________ | |
50 | AliPHOSGeometry::AliPHOSGeometry() { | |
51 | // default ctor | |
52 | // must be kept public for root persistency purposes, but should never be called by the outside world | |
53 | fPHOSAngle = 0 ; | |
54 | fGeometryEMCA = 0 ; | |
55 | fGeometrySUPP = 0 ; | |
56 | fGeometryCPV = 0 ; | |
57 | fgGeom = 0 ; | |
58 | fRotMatrixArray = 0 ; | |
59 | } | |
60 | ||
61 | //____________________________________________________________________________ | |
62 | AliPHOSGeometry::~AliPHOSGeometry(void) | |
63 | { | |
64 | // dtor | |
65 | ||
66 | if (fRotMatrixArray) fRotMatrixArray->Delete() ; | |
67 | if (fRotMatrixArray) delete fRotMatrixArray ; | |
68 | if (fPHOSAngle ) delete[] fPHOSAngle ; | |
69 | } | |
70 | //____________________________________________________________________________ | |
71 | ||
72 | void AliPHOSGeometry::Init(void) | |
73 | { | |
74 | // Initializes the PHOS parameters : | |
75 | // IHEP is the Protvino CPV (cathode pad chambers) | |
76 | ||
77 | TString test(GetName()) ; | |
78 | if (test != "IHEP" ) { | |
79 | Fatal("Init", "%s is not a known geometry (choose among IHEP)", test.Data() ) ; | |
80 | } | |
81 | ||
82 | fgInit = kTRUE ; | |
83 | ||
84 | fNModules = 5; | |
85 | fAngle = 20; | |
86 | ||
87 | fGeometryEMCA = new AliPHOSEMCAGeometry(); | |
88 | ||
89 | fGeometryCPV = new AliPHOSCPVGeometry (); | |
90 | ||
91 | fGeometrySUPP = new AliPHOSSupportGeometry(); | |
92 | ||
93 | fPHOSAngle = new Float_t[fNModules] ; | |
94 | ||
95 | Float_t * emcParams = fGeometryEMCA->GetEMCParams() ; | |
96 | ||
97 | fPHOSParams[0] = TMath::Max((Double_t)fGeometryCPV->GetCPVBoxSize(0)/2., | |
98 | (Double_t)(emcParams[0] - (emcParams[1]-emcParams[0])* | |
99 | fGeometryCPV->GetCPVBoxSize(1)/2/emcParams[3])); | |
100 | fPHOSParams[1] = emcParams[1] ; | |
101 | fPHOSParams[2] = TMath::Max((Double_t)emcParams[2], (Double_t)fGeometryCPV->GetCPVBoxSize(2)/2.); | |
102 | fPHOSParams[3] = emcParams[3] + fGeometryCPV->GetCPVBoxSize(1)/2. ; | |
103 | ||
104 | fIPtoUpperCPVsurface = fGeometryEMCA->GetIPtoOuterCoverDistance() - fGeometryCPV->GetCPVBoxSize(1) ; | |
105 | ||
106 | Int_t index ; | |
107 | for ( index = 0; index < fNModules; index++ ) | |
108 | fPHOSAngle[index] = 0.0 ; // Module position angles are set in CreateGeometry() | |
109 | ||
110 | this->SetPHOSAngles() ; | |
111 | fRotMatrixArray = new TObjArray(fNModules) ; | |
112 | ||
113 | } | |
114 | ||
115 | //____________________________________________________________________________ | |
116 | AliPHOSGeometry * AliPHOSGeometry::GetInstance() | |
117 | { | |
118 | // Returns the pointer of the unique instance; singleton specific | |
119 | ||
120 | return static_cast<AliPHOSGeometry *>( fgGeom ) ; | |
121 | } | |
122 | ||
123 | //____________________________________________________________________________ | |
124 | AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t* title) | |
125 | { | |
126 | // Returns the pointer of the unique instance | |
127 | // Creates it with the specified options (name, title) if it does not exist yet | |
128 | ||
129 | AliPHOSGeometry * rv = 0 ; | |
130 | if ( fgGeom == 0 ) { | |
131 | if ( strcmp(name,"") == 0 ) | |
132 | rv = 0 ; | |
133 | else { | |
134 | fgGeom = new AliPHOSGeometry(name, title) ; | |
135 | if ( fgInit ) | |
136 | rv = (AliPHOSGeometry * ) fgGeom ; | |
137 | else { | |
138 | rv = 0 ; | |
139 | delete fgGeom ; | |
140 | fgGeom = 0 ; | |
141 | } | |
142 | } | |
143 | } | |
144 | else { | |
145 | if ( strcmp(fgGeom->GetName(), name) != 0 ) | |
146 | ::Error("GetInstance", "Current geometry is %s. You cannot call %s", fgGeom->GetName(), name) ; | |
147 | else | |
148 | rv = (AliPHOSGeometry *) fgGeom ; | |
149 | } | |
150 | return rv ; | |
151 | } | |
152 | ||
153 | //____________________________________________________________________________ | |
154 | void AliPHOSGeometry::SetPHOSAngles() | |
155 | { | |
156 | // Calculates the position of the PHOS modules in ALICE global coordinate system | |
157 | ||
158 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; | |
159 | Float_t pphi = 2 * TMath::ATan( GetOuterBoxSize(0) / ( 2.0 * GetIPtoUpperCPVsurface() ) ) ; | |
160 | pphi *= kRADDEG ; | |
161 | if (pphi > fAngle){ | |
162 | Error("SetPHOSAngles", "PHOS modules overlap!\n pphi = %f fAngle = %f", pphi, fAngle); | |
163 | ||
164 | } | |
165 | pphi = fAngle; | |
166 | ||
167 | for( Int_t i = 1; i <= fNModules ; i++ ) { | |
168 | Float_t angle = pphi * ( i - fNModules / 2.0 - 0.5 ) ; | |
169 | fPHOSAngle[i-1] = - angle ; | |
170 | } | |
171 | } | |
172 | ||
173 | //____________________________________________________________________________ | |
174 | Bool_t AliPHOSGeometry::AbsToRelNumbering(Int_t AbsId, Int_t * relid) const | |
175 | { | |
176 | // Converts the absolute numbering into the following array/ | |
177 | // relid[0] = PHOS Module number 1:fNModules | |
178 | // relid[1] = 0 if PbW04 | |
179 | // = -1 if CPV | |
180 | // relid[2] = Row number inside a PHOS module | |
181 | // relid[3] = Column number inside a PHOS module | |
182 | ||
183 | Bool_t rv = kTRUE ; | |
184 | Float_t id = AbsId ; | |
185 | ||
186 | Int_t phosmodulenumber = (Int_t)TMath:: Ceil( id / GetNCristalsInModule() ) ; | |
187 | ||
188 | if ( phosmodulenumber > GetNModules() ) { // it is a CPV pad | |
189 | ||
190 | id -= GetNPhi() * GetNZ() * GetNModules() ; | |
191 | Float_t nCPV = GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() ; | |
192 | relid[0] = (Int_t) TMath::Ceil( id / nCPV ) ; | |
193 | relid[1] = -1 ; | |
194 | id -= ( relid[0] - 1 ) * nCPV ; | |
195 | relid[2] = (Int_t) TMath::Ceil( id / GetNumberOfCPVPadsZ() ) ; | |
196 | relid[3] = (Int_t) ( id - ( relid[2] - 1 ) * GetNumberOfCPVPadsZ() ) ; | |
197 | } | |
198 | else { // it is a PW04 crystal | |
199 | ||
200 | relid[0] = phosmodulenumber ; | |
201 | relid[1] = 0 ; | |
202 | id -= ( phosmodulenumber - 1 ) * GetNPhi() * GetNZ() ; | |
203 | relid[2] = (Int_t)TMath::Ceil( id / GetNZ() ) ; | |
204 | relid[3] = (Int_t)( id - ( relid[2] - 1 ) * GetNZ() ) ; | |
205 | } | |
206 | return rv ; | |
207 | } | |
208 | ||
209 | //____________________________________________________________________________ | |
210 | void AliPHOSGeometry::EmcModuleCoverage(Int_t mod, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt) const | |
211 | { | |
212 | // calculates the angular coverage in theta and phi of one EMC (=PHOS) module | |
213 | ||
214 | Double_t conv ; | |
215 | if ( opt == Radian() ) | |
216 | conv = 1. ; | |
217 | else if ( opt == Degre() ) | |
218 | conv = 180. / TMath::Pi() ; | |
219 | else { | |
220 | Warning("EmcModuleCoverage", "%s unknown option; result in radian", opt) ; | |
221 | conv = 1. ; | |
222 | } | |
223 | ||
224 | Float_t phi = GetPHOSAngle(mod) * (TMath::Pi() / 180.) ; | |
225 | Float_t y0 = GetIPtoCrystalSurface() ; | |
226 | Float_t * strip = fGeometryEMCA->GetStripHalfSize() ; | |
227 | Float_t x0 = fGeometryEMCA->GetNStripX()*strip[0] ; | |
228 | Float_t z0 = fGeometryEMCA->GetNStripZ()*strip[2] ; | |
229 | Double_t angle = TMath::ATan( x0 / y0 ) ; | |
230 | phi = phi + 1.5 * TMath::Pi() ; // to follow the convention of the particle generator(PHOS is between 220 and 320 deg.) | |
231 | Double_t max = phi - angle ; | |
232 | Double_t min = phi + angle ; | |
233 | pM = TMath::Max(max, min) * conv ; | |
234 | pm = TMath::Min(max, min) * conv ; | |
235 | ||
236 | angle = TMath::ATan( z0 / y0 ) ; | |
237 | max = TMath::Pi() / 2. + angle ; // to follow the convention of the particle generator(PHOS is at 90 deg.) | |
238 | min = TMath::Pi() / 2. - angle ; | |
239 | tM = TMath::Max(max, min) * conv ; | |
240 | tm = TMath::Min(max, min) * conv ; | |
241 | ||
242 | } | |
243 | ||
244 | //____________________________________________________________________________ | |
245 | void AliPHOSGeometry::EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt) const | |
246 | { | |
247 | // calculates the angular coverage in theta and phi of a single crystal in a EMC(=PHOS) module | |
248 | ||
249 | Double_t conv ; | |
250 | if ( opt == Radian() ) | |
251 | conv = 1. ; | |
252 | else if ( opt == Degre() ) | |
253 | conv = 180. / TMath::Pi() ; | |
254 | else { | |
255 | Warning("EmcXtalCoverage", "%s unknown option; result in radian", opt) ; | |
256 | conv = 1. ; | |
257 | } | |
258 | ||
259 | Float_t y0 = GetIPtoCrystalSurface() ; | |
260 | theta = 2 * TMath::ATan( GetCrystalSize(2) / (2 * y0) ) * conv ; | |
261 | phi = 2 * TMath::ATan( GetCrystalSize(0) / (2 * y0) ) * conv ; | |
262 | } | |
263 | ||
264 | ||
265 | //____________________________________________________________________________ | |
266 | void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & /*gmat*/) const | |
267 | { | |
268 | // Calculates the coordinates of a RecPoint and the error matrix in the ALICE global coordinate system | |
269 | ||
270 | AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ; | |
271 | TVector3 localposition ; | |
272 | ||
273 | tmpPHOS->GetLocalPosition(gpos) ; | |
274 | ||
275 | ||
276 | if ( tmpPHOS->IsEmc() ) // it is a EMC crystal | |
277 | { gpos.SetY( - GetIPtoCrystalSurface()) ; | |
278 | ||
279 | } | |
280 | else | |
281 | { // it is a CPV | |
282 | gpos.SetY(- GetIPtoUpperCPVsurface() ) ; | |
283 | } | |
284 | ||
285 | Float_t phi = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; | |
286 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; | |
287 | Float_t rphi = phi / kRADDEG ; | |
288 | ||
289 | TRotation rot ; | |
290 | rot.RotateZ(-rphi) ; // a rotation around Z by angle | |
291 | ||
292 | TRotation dummy = rot.Invert() ; // to transform from original frame to rotate frame | |
293 | gpos.Transform(rot) ; // rotate the baby | |
294 | ||
295 | } | |
296 | ||
297 | //____________________________________________________________________________ | |
298 | void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const | |
299 | { | |
300 | // Calculates the coordinates of a RecPoint in the ALICE global coordinate system | |
301 | ||
302 | AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ; | |
303 | TVector3 localposition ; | |
304 | tmpPHOS->GetLocalPosition(gpos) ; | |
305 | ||
306 | ||
307 | if ( tmpPHOS->IsEmc() ) // it is a EMC crystal | |
308 | { gpos.SetY( - GetIPtoCrystalSurface() ) ; | |
309 | } | |
310 | else | |
311 | { // it is a CPV | |
312 | gpos.SetY(- GetIPtoUpperCPVsurface() ) ; | |
313 | } | |
314 | ||
315 | Float_t phi = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; | |
316 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; | |
317 | Float_t rphi = phi / kRADDEG ; | |
318 | ||
319 | TRotation rot ; | |
320 | rot.RotateZ(-rphi) ; // a rotation around Z by angle | |
321 | ||
322 | TRotation dummy = rot.Invert() ; // to transform from original frame to rotate frame | |
323 | gpos.Transform(rot) ; // rotate the baby | |
324 | } | |
325 | ||
326 | //____________________________________________________________________________ | |
327 | void AliPHOSGeometry::ImpactOnEmc(Double_t theta, Double_t phi, Int_t & moduleNumber, Double_t & z, Double_t & x) const | |
328 | { | |
329 | // calculates the impact coordinates on PHOS of a neutral particle | |
330 | // emitted in the direction theta and phi in the ALICE global coordinate system | |
331 | ||
332 | // searches for the PHOS EMC module | |
333 | ||
334 | moduleNumber = 0 ; | |
335 | Double_t tm, tM, pm, pM ; | |
336 | Int_t index = 1 ; | |
337 | while ( moduleNumber == 0 && index <= GetNModules() ) { | |
338 | EmcModuleCoverage(index, tm, tM, pm, pM) ; | |
339 | if ( (theta >= tm && theta <= tM) && (phi >= pm && phi <= pM ) ) | |
340 | moduleNumber = index ; | |
341 | index++ ; | |
342 | } | |
343 | if ( moduleNumber != 0 ) { | |
344 | Float_t phi0 = GetPHOSAngle(moduleNumber) * (TMath::Pi() / 180.) + 1.5 * TMath::Pi() ; | |
345 | Float_t y0 = GetIPtoCrystalSurface() ; | |
346 | Double_t angle = phi - phi0; | |
347 | x = y0 * TMath::Tan(angle) ; | |
348 | angle = theta - TMath::Pi() / 2 ; | |
349 | z = y0 * TMath::Tan(angle) ; | |
350 | } | |
351 | } | |
352 | ||
353 | //____________________________________________________________________________ | |
354 | void AliPHOSGeometry::ImpactOnEmc(TVector3 vec, Int_t & moduleNumber, Double_t & z, Double_t & x) const | |
355 | { | |
356 | // calculates the impact coordinates on PHOS of a neutral particle | |
357 | // emitted in the direction theta and phi in the ALICE global coordinate system | |
358 | // searches for the PHOS EMC module | |
359 | ||
360 | TParticle p ; | |
361 | p.SetMomentum(vec.X(), vec.Y(), vec.Z(), 0.) ; | |
362 | ||
363 | ImpactOnEmc(p, moduleNumber, z, x) ; | |
364 | } | |
365 | ||
366 | //____________________________________________________________________________ | |
367 | void AliPHOSGeometry::ImpactOnEmc(TParticle p, Int_t & moduleNumber, Double_t & z, Double_t & x) const | |
368 | { | |
369 | // calculates the impact coordinates on PHOS of a neutral particle | |
370 | // emitted in the direction theta and phi in the ALICE global coordinate system | |
371 | ||
372 | // searches for the PHOS EMC module | |
373 | Double_t theta = p.Theta() ; | |
374 | Double_t phi = p.Phi() ; | |
375 | ||
376 | ImpactOnEmc(theta, phi, moduleNumber, z, x) ; | |
377 | } | |
378 | ||
379 | //____________________________________________________________________________ | |
380 | Bool_t AliPHOSGeometry::Impact(const TParticle * particle) const | |
381 | { | |
382 | // Tells if a particle enters PHOS | |
383 | Bool_t in=kFALSE; | |
384 | Int_t moduleNumber=0; | |
385 | Double_t z,x; | |
386 | ImpactOnEmc(particle->Theta(),particle->Phi(),moduleNumber,z,x); | |
387 | if(moduleNumber) | |
388 | in=kTRUE; | |
389 | else | |
390 | in=kFALSE; | |
391 | return in; | |
392 | } | |
393 | ||
394 | //____________________________________________________________________________ | |
395 | Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t & AbsId) const | |
396 | { | |
397 | // Converts the relative numbering into the absolute numbering | |
398 | // EMCA crystals: | |
399 | // AbsId = from 1 to fNModules * fNPhi * fNZ | |
400 | // CPV pad: | |
401 | // AbsId = from N(total PHOS crystals) + 1 | |
402 | // to NCPVModules * fNumberOfCPVPadsPhi * fNumberOfCPVPadsZ | |
403 | ||
404 | Bool_t rv = kTRUE ; | |
405 | ||
406 | if ( relid[1] == 0 ) { // it is a Phos crystal | |
407 | AbsId = | |
408 | ( relid[0] - 1 ) * GetNPhi() * GetNZ() // the offset of PHOS modules | |
409 | + ( relid[2] - 1 ) * GetNZ() // the offset along phi | |
410 | + relid[3] ; // the offset along z | |
411 | } | |
412 | else { // it is a CPV pad | |
413 | AbsId = GetNPhi() * GetNZ() * GetNModules() // the offset to separate EMCA crystals from CPV pads | |
414 | + ( relid[0] - 1 ) * GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() // the pads offset of PHOS modules | |
415 | + ( relid[2] - 1 ) * GetNumberOfCPVPadsZ() // the pads offset of a CPV row | |
416 | + relid[3] ; // the column number | |
417 | } | |
418 | ||
419 | return rv ; | |
420 | } | |
421 | ||
422 | //____________________________________________________________________________ | |
423 | ||
424 | void AliPHOSGeometry::RelPosInAlice(Int_t id, TVector3 & pos ) const | |
425 | { | |
426 | // Converts the absolute numbering into the global ALICE coordinate system | |
427 | ||
428 | ||
429 | Int_t relid[4] ; | |
430 | ||
431 | AbsToRelNumbering(id , relid) ; | |
432 | ||
433 | Int_t phosmodule = relid[0] ; | |
434 | ||
435 | Float_t y0 = 0 ; | |
436 | ||
437 | if ( relid[1] == 0 ) // it is a PbW04 crystal | |
438 | y0 = - GetIPtoCrystalSurface() ; | |
439 | else | |
440 | y0 = - GetIPtoUpperCPVsurface() ; | |
441 | ||
442 | Float_t x, z ; | |
443 | RelPosInModule(relid, x, z) ; | |
444 | ||
445 | pos.SetX(x) ; | |
446 | pos.SetZ(z) ; | |
447 | pos.SetY(y0) ; | |
448 | ||
449 | Float_t phi = GetPHOSAngle( phosmodule) ; | |
450 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; | |
451 | Float_t rphi = phi / kRADDEG ; | |
452 | ||
453 | TRotation rot ; | |
454 | rot.RotateZ(-rphi) ; // a rotation around Z by angle | |
455 | ||
456 | TRotation dummy = rot.Invert() ; // to transform from original frame to rotate frame | |
457 | ||
458 | pos.Transform(rot) ; // rotate the baby | |
459 | } | |
460 | ||
461 | //____________________________________________________________________________ | |
462 | void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t & z) const | |
463 | { | |
464 | // Converts the relative numbering into the local PHOS-module (x, z) coordinates | |
465 | // Note: sign of z differs from that in the previous version (Yu.Kharlov, 12 Oct 2000) | |
466 | ||
467 | Int_t row = relid[2] ; //offset along x axis | |
468 | Int_t column = relid[3] ; //offset along z axis | |
469 | ||
470 | ||
471 | if ( relid[1] == 0 ) { // its a PbW04 crystal | |
472 | x = - ( GetNPhi()/2. - row + 0.5 ) * GetCellStep() ; // position of Xtal with respect | |
473 | z = - ( GetNZ() /2. - column + 0.5 ) * GetCellStep() ; // of center of PHOS module | |
474 | } | |
475 | else { | |
476 | x = - ( GetNumberOfCPVPadsPhi()/2. - row - 0.5 ) * GetPadSizePhi() ; // position of pad with respect | |
477 | z = - ( GetNumberOfCPVPadsZ() /2. - column - 0.5 ) * GetPadSizeZ() ; // of center of PHOS module | |
478 | } | |
479 | } | |
480 | ||
481 | //____________________________________________________________________________ | |
482 | ||
483 | TVector3 AliPHOSGeometry::GetCpvModuleCenter(Int_t module) const | |
484 | { | |
485 | // Returns a position of the center of the CPV module | |
486 | Float_t rCPV = GetIPtoCPVDistance(); | |
487 | Float_t angle = GetPHOSAngle(module); // (40,20,0,-20,-40) degrees | |
488 | angle *= TMath::Pi()/180; | |
489 | angle += 3*TMath::Pi()/2.; | |
490 | return TVector3(rCPV*TMath::Cos(angle), rCPV*TMath::Sin(angle), 0.); | |
491 | } | |
492 | ||
493 | //____________________________________________________________________________ | |
494 | ||
495 | TVector3 AliPHOSGeometry::Global2LocalCpv(TVector3 globalPosition, Int_t module) const | |
496 | { | |
497 | // Transforms a global position of the CPV point to the local coordinate system | |
498 | Float_t angle = GetPHOSAngle(module); // (40,20,0,-20,-40) degrees | |
499 | angle *= TMath::Pi()/180; | |
500 | angle += 3*TMath::Pi()/2.; | |
501 | globalPosition.RotateZ(-angle); | |
502 | return TVector3(globalPosition.Y(),globalPosition.X(),globalPosition.Z()); | |
503 | } |