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