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 | |
b2a60966 |
16 | /* $Id$ */ |
17 | |
d15a28e7 |
18 | //_________________________________________________________________________ |
b2a60966 |
19 | // Geometry class for PHOS : singleton |
a3dfe79c |
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. |
b2a60966 |
26 | // |
710f859a |
27 | //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC "KI" & SUBATECH) |
d15a28e7 |
28 | |
29 | // --- ROOT system --- |
30 | |
31 | #include "TVector3.h" |
32 | #include "TRotation.h" |
e957fea8 |
33 | #include "TParticle.h" |
d15a28e7 |
34 | |
35 | // --- Standard library --- |
36 | |
d15a28e7 |
37 | // --- AliRoot header files --- |
38 | |
39 | #include "AliPHOSGeometry.h" |
468794ea |
40 | #include "AliPHOSEMCAGeometry.h" |
710f859a |
41 | #include "AliPHOSRecPoint.h" |
d15a28e7 |
42 | |
9ec91567 |
43 | ClassImp(AliPHOSGeometry) ; |
d15a28e7 |
44 | |
a4e98857 |
45 | // these initialisations are needed for a singleton |
9ec91567 |
46 | AliPHOSGeometry * AliPHOSGeometry::fgGeom = 0 ; |
282c5906 |
47 | Bool_t AliPHOSGeometry::fgInit = kFALSE ; |
9ec91567 |
48 | |
e957fea8 |
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 | |
d15a28e7 |
61 | //____________________________________________________________________________ |
62 | AliPHOSGeometry::~AliPHOSGeometry(void) |
63 | { |
b2a60966 |
64 | // dtor |
65 | |
52a36ffd |
66 | if (fRotMatrixArray) fRotMatrixArray->Delete() ; |
67 | if (fRotMatrixArray) delete fRotMatrixArray ; |
fa0bc588 |
68 | if (fPHOSAngle ) delete[] fPHOSAngle ; |
52a36ffd |
69 | } |
52a36ffd |
70 | //____________________________________________________________________________ |
71 | |
72 | void AliPHOSGeometry::Init(void) |
73 | { |
a4e98857 |
74 | // Initializes the PHOS parameters : |
75 | // IHEP is the Protvino CPV (cathode pad chambers) |
710f859a |
76 | |
809cd394 |
77 | TString test(GetName()) ; |
22b8277f |
78 | if (test != "IHEP" ) { |
79 | Fatal("Init", "%s is not a known geometry (choose among IHEP)", test.Data() ) ; |
809cd394 |
80 | } |
81 | |
710f859a |
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 | |
581e32d4 |
97 | fPHOSParams[0] = TMath::Max((Double_t)fGeometryCPV->GetCPVBoxSize(0)/2., |
a83b6179 |
98 | (Double_t)(emcParams[0] - (emcParams[1]-emcParams[0])* |
99 | fGeometryCPV->GetCPVBoxSize(1)/2/emcParams[3])); |
710f859a |
100 | fPHOSParams[1] = emcParams[1] ; |
581e32d4 |
101 | fPHOSParams[2] = TMath::Max((Double_t)emcParams[2], (Double_t)fGeometryCPV->GetCPVBoxSize(2)/2.); |
710f859a |
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++ ) |
52a36ffd |
108 | fPHOSAngle[index] = 0.0 ; // Module position angles are set in CreateGeometry() |
710f859a |
109 | |
110 | this->SetPHOSAngles() ; |
111 | fRotMatrixArray = new TObjArray(fNModules) ; |
112 | |
52a36ffd |
113 | } |
114 | |
115 | //____________________________________________________________________________ |
116 | AliPHOSGeometry * AliPHOSGeometry::GetInstance() |
117 | { |
a4e98857 |
118 | // Returns the pointer of the unique instance; singleton specific |
119 | |
809cd394 |
120 | return static_cast<AliPHOSGeometry *>( fgGeom ) ; |
52a36ffd |
121 | } |
122 | |
123 | //____________________________________________________________________________ |
124 | AliPHOSGeometry * AliPHOSGeometry::GetInstance(const Text_t* name, const Text_t* title) |
125 | { |
126 | // Returns the pointer of the unique instance |
a4e98857 |
127 | // Creates it with the specified options (name, title) if it does not exist yet |
128 | |
52a36ffd |
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 { |
21cd0c07 |
145 | if ( strcmp(fgGeom->GetName(), name) != 0 ) |
146 | ::Error("GetInstance", "Current geometry is %s. You cannot call %s", fgGeom->GetName(), name) ; |
52a36ffd |
147 | else |
148 | rv = (AliPHOSGeometry *) fgGeom ; |
149 | } |
150 | return rv ; |
151 | } |
4697edca |
152 | |
52a36ffd |
153 | //____________________________________________________________________________ |
154 | void AliPHOSGeometry::SetPHOSAngles() |
155 | { |
a4e98857 |
156 | // Calculates the position of the PHOS modules in ALICE global coordinate system |
52a36ffd |
157 | |
a8c47ab6 |
158 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; |
710f859a |
159 | Float_t pphi = 2 * TMath::ATan( GetOuterBoxSize(0) / ( 2.0 * GetIPtoUpperCPVsurface() ) ) ; |
52a36ffd |
160 | pphi *= kRADDEG ; |
710f859a |
161 | if (pphi > fAngle){ |
21cd0c07 |
162 | Error("SetPHOSAngles", "PHOS modules overlap!\n pphi = %f fAngle = %f", pphi, fAngle); |
710f859a |
163 | |
164 | } |
ed4205d8 |
165 | pphi = fAngle; |
52a36ffd |
166 | |
167 | for( Int_t i = 1; i <= fNModules ; i++ ) { |
ed4205d8 |
168 | Float_t angle = pphi * ( i - fNModules / 2.0 - 0.5 ) ; |
52a36ffd |
169 | fPHOSAngle[i-1] = - angle ; |
170 | } |
d15a28e7 |
171 | } |
172 | |
173 | //____________________________________________________________________________ |
7b7c1533 |
174 | Bool_t AliPHOSGeometry::AbsToRelNumbering(const Int_t AbsId, Int_t * relid) const |
d15a28e7 |
175 | { |
b2a60966 |
176 | // Converts the absolute numbering into the following array/ |
177 | // relid[0] = PHOS Module number 1:fNModules |
178 | // relid[1] = 0 if PbW04 |
710f859a |
179 | // = -1 if CPV |
180 | // relid[2] = Row number inside a PHOS module |
181 | // relid[3] = Column number inside a PHOS module |
d15a28e7 |
182 | |
183 | Bool_t rv = kTRUE ; |
92862013 |
184 | Float_t id = AbsId ; |
d15a28e7 |
185 | |
710f859a |
186 | Int_t phosmodulenumber = (Int_t)TMath:: Ceil( id / GetNCristalsInModule() ) ; |
d15a28e7 |
187 | |
710f859a |
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() ) ; |
d15a28e7 |
197 | } |
710f859a |
198 | else { // it is a PW04 crystal |
d15a28e7 |
199 | |
92862013 |
200 | relid[0] = phosmodulenumber ; |
201 | relid[1] = 0 ; |
202 | id -= ( phosmodulenumber - 1 ) * GetNPhi() * GetNZ() ; |
710f859a |
203 | relid[2] = (Int_t)TMath::Ceil( id / GetNZ() ) ; |
204 | relid[3] = (Int_t)( id - ( relid[2] - 1 ) * GetNZ() ) ; |
d15a28e7 |
205 | } |
206 | return rv ; |
207 | } |
52a36ffd |
208 | |
9f616d61 |
209 | //____________________________________________________________________________ |
7b7c1533 |
210 | void AliPHOSGeometry::EmcModuleCoverage(const Int_t mod, Double_t & tm, Double_t & tM, Double_t & pm, Double_t & pM, Option_t * opt) const |
9f616d61 |
211 | { |
a4e98857 |
212 | // calculates the angular coverage in theta and phi of one EMC (=PHOS) module |
9f616d61 |
213 | |
214 | Double_t conv ; |
cf0c2bc1 |
215 | if ( opt == Radian() ) |
9f616d61 |
216 | conv = 1. ; |
cf0c2bc1 |
217 | else if ( opt == Degre() ) |
9f616d61 |
218 | conv = 180. / TMath::Pi() ; |
219 | else { |
21cd0c07 |
220 | Warning("EmcModuleCoverage", "%s unknown option; result in radian", opt) ; |
9f616d61 |
221 | conv = 1. ; |
222 | } |
223 | |
710f859a |
224 | Float_t phi = GetPHOSAngle(mod) * (TMath::Pi() / 180.) ; |
225 | Float_t y0 = GetIPtoCrystalSurface() ; |
88cb7938 |
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 ) ; |
710f859a |
230 | phi = phi + 1.5 * TMath::Pi() ; // to follow the convention of the particle generator(PHOS is between 220 and 320 deg.) |
92862013 |
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 ; |
9f616d61 |
235 | |
88cb7938 |
236 | angle = TMath::ATan( z0 / y0 ) ; |
92862013 |
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 ; |
9f616d61 |
241 | |
242 | } |
243 | |
244 | //____________________________________________________________________________ |
7b7c1533 |
245 | void AliPHOSGeometry::EmcXtalCoverage(Double_t & theta, Double_t & phi, Option_t * opt) const |
9f616d61 |
246 | { |
a4e98857 |
247 | // calculates the angular coverage in theta and phi of a single crystal in a EMC(=PHOS) module |
9f616d61 |
248 | |
249 | Double_t conv ; |
cf0c2bc1 |
250 | if ( opt == Radian() ) |
9f616d61 |
251 | conv = 1. ; |
cf0c2bc1 |
252 | else if ( opt == Degre() ) |
9f616d61 |
253 | conv = 180. / TMath::Pi() ; |
254 | else { |
21cd0c07 |
255 | Warning("EmcXtalCoverage", "%s unknown option; result in radian", opt) ; |
9f616d61 |
256 | conv = 1. ; |
257 | } |
258 | |
710f859a |
259 | Float_t y0 = GetIPtoCrystalSurface() ; |
92862013 |
260 | theta = 2 * TMath::ATan( GetCrystalSize(2) / (2 * y0) ) * conv ; |
261 | phi = 2 * TMath::ATan( GetCrystalSize(0) / (2 * y0) ) * conv ; |
9f616d61 |
262 | } |
263 | |
264 | |
265 | //____________________________________________________________________________ |
4c7fd00f |
266 | void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos, TMatrix & /*gmat*/) const |
d15a28e7 |
267 | { |
a4e98857 |
268 | // Calculates the coordinates of a RecPoint and the error matrix in the ALICE global coordinate system |
b2a60966 |
269 | |
d15a28e7 |
270 | AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ; |
92862013 |
271 | TVector3 localposition ; |
d15a28e7 |
272 | |
273 | tmpPHOS->GetLocalPosition(gpos) ; |
274 | |
275 | |
276 | if ( tmpPHOS->IsEmc() ) // it is a EMC crystal |
710f859a |
277 | { gpos.SetY( - GetIPtoCrystalSurface()) ; |
d15a28e7 |
278 | |
279 | } |
280 | else |
710f859a |
281 | { // it is a CPV |
282 | gpos.SetY(- GetIPtoUpperCPVsurface() ) ; |
d15a28e7 |
283 | } |
284 | |
92862013 |
285 | Float_t phi = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; |
a8c47ab6 |
286 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; |
92862013 |
287 | Float_t rphi = phi / kRADDEG ; |
d15a28e7 |
288 | |
92862013 |
289 | TRotation rot ; |
290 | rot.RotateZ(-rphi) ; // a rotation around Z by angle |
d15a28e7 |
291 | |
92862013 |
292 | TRotation dummy = rot.Invert() ; // to transform from original frame to rotate frame |
293 | gpos.Transform(rot) ; // rotate the baby |
6ad0bfa0 |
294 | |
d15a28e7 |
295 | } |
296 | |
297 | //____________________________________________________________________________ |
5cda30f6 |
298 | void AliPHOSGeometry::GetGlobal(const AliRecPoint* RecPoint, TVector3 & gpos) const |
d15a28e7 |
299 | { |
a4e98857 |
300 | // Calculates the coordinates of a RecPoint in the ALICE global coordinate system |
b2a60966 |
301 | |
d15a28e7 |
302 | AliPHOSRecPoint * tmpPHOS = (AliPHOSRecPoint *) RecPoint ; |
92862013 |
303 | TVector3 localposition ; |
d15a28e7 |
304 | tmpPHOS->GetLocalPosition(gpos) ; |
305 | |
306 | |
307 | if ( tmpPHOS->IsEmc() ) // it is a EMC crystal |
710f859a |
308 | { gpos.SetY( - GetIPtoCrystalSurface() ) ; |
d15a28e7 |
309 | } |
310 | else |
710f859a |
311 | { // it is a CPV |
312 | gpos.SetY(- GetIPtoUpperCPVsurface() ) ; |
d15a28e7 |
313 | } |
314 | |
92862013 |
315 | Float_t phi = GetPHOSAngle( tmpPHOS->GetPHOSMod()) ; |
a8c47ab6 |
316 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; |
92862013 |
317 | Float_t rphi = phi / kRADDEG ; |
d15a28e7 |
318 | |
92862013 |
319 | TRotation rot ; |
320 | rot.RotateZ(-rphi) ; // a rotation around Z by angle |
d15a28e7 |
321 | |
92862013 |
322 | TRotation dummy = rot.Invert() ; // to transform from original frame to rotate frame |
323 | gpos.Transform(rot) ; // rotate the baby |
d15a28e7 |
324 | } |
325 | |
326 | //____________________________________________________________________________ |
7b7c1533 |
327 | void AliPHOSGeometry::ImpactOnEmc(const Double_t theta, const Double_t phi, Int_t & ModuleNumber, Double_t & z, Double_t & x) const |
d15a28e7 |
328 | { |
a4e98857 |
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 |
d15a28e7 |
331 | |
52a36ffd |
332 | // searches for the PHOS EMC module |
333 | ModuleNumber = 0 ; |
334 | Double_t tm, tM, pm, pM ; |
335 | Int_t index = 1 ; |
336 | while ( ModuleNumber == 0 && index <= GetNModules() ) { |
337 | EmcModuleCoverage(index, tm, tM, pm, pM) ; |
88cb7938 |
338 | if ( (theta >= tm && theta <= tM) && (phi >= pm && phi <= pM ) ) |
52a36ffd |
339 | ModuleNumber = index ; |
340 | index++ ; |
d15a28e7 |
341 | } |
52a36ffd |
342 | if ( ModuleNumber != 0 ) { |
343 | Float_t phi0 = GetPHOSAngle(ModuleNumber) * (TMath::Pi() / 180.) + 1.5 * TMath::Pi() ; |
710f859a |
344 | Float_t y0 = GetIPtoCrystalSurface() ; |
88cb7938 |
345 | Double_t angle = phi - phi0; |
52a36ffd |
346 | x = y0 * TMath::Tan(angle) ; |
347 | angle = theta - TMath::Pi() / 2 ; |
348 | z = y0 * TMath::Tan(angle) ; |
d15a28e7 |
349 | } |
d15a28e7 |
350 | } |
351 | |
e957fea8 |
352 | //____________________________________________________________________________ |
1c9d8212 |
353 | Bool_t AliPHOSGeometry::Impact(const TParticle * particle) const |
354 | { |
e957fea8 |
355 | // Tells if a particle enters PHOS |
356 | Bool_t in=kFALSE; |
357 | Int_t moduleNumber=0; |
1c9d8212 |
358 | Double_t z,x; |
e957fea8 |
359 | ImpactOnEmc(particle->Theta(),particle->Phi(),moduleNumber,z,x); |
360 | if(moduleNumber) |
361 | in=kTRUE; |
362 | else |
363 | in=kFALSE; |
364 | return in; |
1c9d8212 |
365 | } |
366 | |
d15a28e7 |
367 | //____________________________________________________________________________ |
7b7c1533 |
368 | Bool_t AliPHOSGeometry::RelToAbsNumbering(const Int_t * relid, Int_t & AbsId) const |
d15a28e7 |
369 | { |
b2a60966 |
370 | // Converts the relative numbering into the absolute numbering |
ed4205d8 |
371 | // EMCA crystals: |
372 | // AbsId = from 1 to fNModules * fNPhi * fNZ |
ed4205d8 |
373 | // CPV pad: |
374 | // AbsId = from N(total PHOS crystals) + 1 |
375 | // to NCPVModules * fNumberOfCPVPadsPhi * fNumberOfCPVPadsZ |
d15a28e7 |
376 | |
377 | Bool_t rv = kTRUE ; |
710f859a |
378 | |
379 | if ( relid[1] == 0 ) { // it is a Phos crystal |
52a36ffd |
380 | AbsId = |
710f859a |
381 | ( relid[0] - 1 ) * GetNPhi() * GetNZ() // the offset of PHOS modules |
382 | + ( relid[2] - 1 ) * GetNZ() // the offset along phi |
383 | + relid[3] ; // the offset along z |
d15a28e7 |
384 | } |
710f859a |
385 | else { // it is a CPV pad |
386 | AbsId = GetNPhi() * GetNZ() * GetNModules() // the offset to separate EMCA crystals from CPV pads |
387 | + ( relid[0] - 1 ) * GetNumberOfCPVPadsPhi() * GetNumberOfCPVPadsZ() // the pads offset of PHOS modules |
388 | + ( relid[2] - 1 ) * GetNumberOfCPVPadsZ() // the pads offset of a CPV row |
52a36ffd |
389 | + relid[3] ; // the column number |
390 | } |
391 | |
d15a28e7 |
392 | return rv ; |
393 | } |
394 | |
395 | //____________________________________________________________________________ |
396 | |
7b7c1533 |
397 | void AliPHOSGeometry::RelPosInAlice(const Int_t id, TVector3 & pos ) const |
d15a28e7 |
398 | { |
a4e98857 |
399 | // Converts the absolute numbering into the global ALICE coordinate system |
b2a60966 |
400 | |
ed4205d8 |
401 | |
402 | Int_t relid[4] ; |
403 | |
404 | AbsToRelNumbering(id , relid) ; |
405 | |
406 | Int_t phosmodule = relid[0] ; |
407 | |
408 | Float_t y0 = 0 ; |
409 | |
710f859a |
410 | if ( relid[1] == 0 ) // it is a PbW04 crystal |
411 | y0 = - GetIPtoCrystalSurface() ; |
412 | else |
413 | y0 = - GetIPtoUpperCPVsurface() ; |
414 | |
ed4205d8 |
415 | Float_t x, z ; |
416 | RelPosInModule(relid, x, z) ; |
417 | |
418 | pos.SetX(x) ; |
419 | pos.SetZ(z) ; |
710f859a |
420 | pos.SetY(y0) ; |
ed4205d8 |
421 | |
422 | Float_t phi = GetPHOSAngle( phosmodule) ; |
a8c47ab6 |
423 | Double_t const kRADDEG = 180.0 / TMath::Pi() ; |
ed4205d8 |
424 | Float_t rphi = phi / kRADDEG ; |
425 | |
426 | TRotation rot ; |
427 | rot.RotateZ(-rphi) ; // a rotation around Z by angle |
428 | |
429 | TRotation dummy = rot.Invert() ; // to transform from original frame to rotate frame |
430 | |
431 | pos.Transform(rot) ; // rotate the baby |
d15a28e7 |
432 | } |
433 | |
434 | //____________________________________________________________________________ |
7b7c1533 |
435 | void AliPHOSGeometry::RelPosInModule(const Int_t * relid, Float_t & x, Float_t & z) const |
d15a28e7 |
436 | { |
b2a60966 |
437 | // Converts the relative numbering into the local PHOS-module (x, z) coordinates |
52a36ffd |
438 | // Note: sign of z differs from that in the previous version (Yu.Kharlov, 12 Oct 2000) |
b2a60966 |
439 | |
786222b3 |
440 | Int_t row = relid[2] ; //offset along x axis |
441 | Int_t column = relid[3] ; //offset along z axis |
d15a28e7 |
442 | |
ed4205d8 |
443 | |
66c3e8ff |
444 | if ( relid[1] == 0 ) { // its a PbW04 crystal |
445 | x = - ( GetNPhi()/2. - row + 0.5 ) * GetCellStep() ; // position of Xtal with respect |
446 | z = ( GetNZ() /2. - column + 0.5 ) * GetCellStep() ; // of center of PHOS module |
52a36ffd |
447 | } |
448 | else { |
710f859a |
449 | x = - ( GetNumberOfCPVPadsPhi()/2. - row - 0.5 ) * GetPadSizePhi() ; // position of pad with respect |
450 | z = ( GetNumberOfCPVPadsZ() /2. - column - 0.5 ) * GetPadSizeZ() ; // of center of PHOS module |
52a36ffd |
451 | } |
2f3366b6 |
452 | } |