]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 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 | ||
b0f5e3fc | 16 | #include "AliITSsegmentationSPD.h" |
55d2c544 | 17 | //#include "AliITSgeom.h" |
18 | ////////////////////////////////////////////////////// | |
19 | // Segmentation class for // | |
20 | // pixels // | |
21 | // // | |
22 | ////////////////////////////////////////////////////// | |
b0f5e3fc | 23 | ClassImp(AliITSsegmentationSPD) |
24 | ||
55d2c544 | 25 | //_____________________________________________________________________________ |
26 | AliITSsegmentationSPD::AliITSsegmentationSPD(): AliITSsegmentation(){ | |
27 | // Default constructor | |
28 | fNpx = 0; | |
29 | fNpz = 0; | |
30 | for(Int_t k=0; k<256; k++){ | |
31 | fCellSizeX[k] = 0.; | |
32 | fCellSizeZ[k] = 0.; | |
33 | } | |
34 | } | |
b0f5e3fc | 35 | |
55d2c544 | 36 | //_____________________________________________________________________________ |
37 | Float_t AliITSsegmentationSPD::ColFromZ300(Float_t z) const { | |
b0f5e3fc | 38 | // Get column number for each z-coordinate taking into account the |
39 | // extra pixels in z direction assuming 300 micron sized pixels. | |
40 | Float_t col = 0.0; | |
41 | Float_t pitchz = 300.0; | |
42 | col = Float_t (z/pitchz); | |
43 | return col; | |
44 | } | |
45 | //_____________________________________________________________________________ | |
55d2c544 | 46 | Float_t AliITSsegmentationSPD::ZFromCol300(Int_t col) const { |
b0f5e3fc | 47 | // same comments as above |
48 | // Get z-coordinate for each colunm number | |
49 | Float_t pitchz = 300.0; | |
50 | Float_t z = 0.0; | |
51 | z = (col+0.5)*pitchz; | |
52 | return z; | |
53 | } | |
54 | //_____________________________________________________________________________ | |
55d2c544 | 55 | Float_t AliITSsegmentationSPD::ZpitchFromCol300(Int_t col) const { |
b0f5e3fc | 56 | // returns Z pixel pitch for 300 micron pixels. |
ac74f489 | 57 | |
58 | col = 0; // done to remove unused variable warning. | |
59 | return 300.0; | |
b0f5e3fc | 60 | } |
61 | //_____________________________________________________________________________ | |
55d2c544 | 62 | Float_t AliITSsegmentationSPD::ColFromZ(Float_t z) const { |
f1e07e4b | 63 | // hard-wired - keep it like this till we can parametrise |
64 | // and get rid of AliITSgeomSPD425 | |
65 | // Get column number for each z-coordinate taking into account the | |
66 | // extra pixels in z direction | |
67 | Int_t i; | |
68 | Float_t s,col; | |
5d3918d6 | 69 | |
f1e07e4b | 70 | if(z<0||z>fDz){ |
71 | Error("ColFromZ","z=%f outside of range 0.0<=z<fDz=%f",z,fDz); | |
72 | return 0.0; // error | |
73 | } // end if outsize of detector | |
74 | s = 0.0; | |
75 | i = -1; | |
76 | while(z>s){ | |
77 | i++; | |
78 | s += fCellSizeZ[i]; | |
79 | } // end while | |
80 | s -= fCellSizeZ[i]; | |
81 | col = (Float_t) i + (z-s)/fCellSizeZ[i]; | |
82 | return col; | |
83 | ||
84 | /* | |
b0f5e3fc | 85 | Float_t col = 0; |
86 | Float_t pitchz = 425; | |
87 | if( z < 13175) { | |
88 | col = Float_t(z/pitchz); | |
89 | } else if( z < 14425) { | |
90 | pitchz = 625; | |
91 | col = 31 + (z - 13175)/pitchz; | |
92 | } else if( z < 27175) { | |
93 | col = 33 + (z - 14425)/pitchz; | |
94 | } else if( z < 28425) { | |
95 | pitchz = 625; | |
96 | col = 63 + (z - 27175)/pitchz; | |
97 | } else if( z < 41175) { | |
98 | col = 65 + (z - 28425)/pitchz; | |
99 | } else if( z < 42425) { | |
100 | pitchz = 625; | |
101 | col = 95 + (z - 41175)/pitchz; | |
102 | } else if( z < 55175) { | |
103 | col = 97 + (z - 42425)/pitchz; | |
104 | } else if( z < 56425) { | |
105 | pitchz = 625; | |
106 | col = 127 + (z - 55175)/pitchz; | |
107 | } else if( z < 69175) { | |
108 | col = 129 + (z - 56425)/pitchz; | |
109 | } else if( z < 70425) { | |
110 | pitchz = 625; | |
111 | col = 159 + (z - 69175)/pitchz; | |
112 | } else if( z < 83600) { | |
113 | col = 161 + (z - 70425)/pitchz; | |
114 | } | |
f1e07e4b | 115 | return TMath::Abs(col);*/ |
b0f5e3fc | 116 | } |
117 | ||
118 | //_____________________________________________________________________________ | |
55d2c544 | 119 | Float_t AliITSsegmentationSPD::ZFromCol(Int_t col) const { |
f1e07e4b | 120 | // same comments as above |
121 | // Get z-coordinate for each colunm number | |
122 | Int_t i; | |
123 | Float_t z; | |
5d3918d6 | 124 | |
f1e07e4b | 125 | if(col<0||col>=fNpz){ |
126 | Error("ZFromCol","col=%d outside of range 0<=col<fNpZ=%d",col,fNpz); | |
127 | return 0.0; // error | |
128 | } // end if outsize of detector | |
129 | z = 0.0; | |
130 | for(i=0;i<col;i++) z += fCellSizeZ[i]; | |
131 | z += 0.5*fCellSizeZ[col]; | |
132 | return z; | |
133 | ||
134 | /* | |
b0f5e3fc | 135 | Float_t pitchz = 425; |
136 | Float_t z = 0; | |
137 | if( col >=0 && col <= 30 ) { | |
138 | z = (col + 0.5)*pitchz; | |
139 | } else if( col >= 31 && col <= 32) { | |
140 | pitchz = 625; | |
141 | z = 13175 + (col -31 + 0.5)*pitchz; | |
142 | } else if( col >= 33 && col <= 62) { | |
143 | z = 14425 + (col -33 + 0.5)*pitchz; | |
144 | } else if( col >= 63 && col <= 64) { | |
145 | pitchz = 625; | |
146 | z = 27175 + (col -63 + 0.5)*pitchz; | |
147 | } else if( col >= 65 && col <= 94) { | |
148 | z = 28425 + (col -65 + 0.5)*pitchz; | |
149 | } else if( col >= 95 && col <= 96) { | |
150 | pitchz = 625; | |
151 | z = 41175 + (col -95 + 0.5)*pitchz; | |
152 | } else if( col >= 97 && col <= 126) { | |
153 | z = 42425 + (col -97 + 0.5)*pitchz; | |
154 | } else if( col >= 127 && col <= 128) { | |
155 | pitchz = 625; | |
156 | z = 55175 + (col -127 + 0.5)*pitchz; | |
157 | } else if( col >= 129 && col <= 158) { | |
158 | z = 56425 + (col -129 + 0.5)*pitchz; | |
159 | } else if( col >= 159 && col <= 160) { | |
160 | pitchz = 625; | |
161 | z = 69175 + (col -159 + 0.5)*pitchz; | |
162 | } else if( col >= 161 && col <= 191) { | |
163 | z = 70425 + (col -161 + 0.5)*pitchz; | |
5752a110 | 164 | } |
b0f5e3fc | 165 | |
f1e07e4b | 166 | return z;*/ |
b0f5e3fc | 167 | } |
5752a110 | 168 | //______________________________________________________________________ |
55d2c544 | 169 | Float_t AliITSsegmentationSPD::ZpitchFromCol(Int_t col) const { |
f1e07e4b | 170 | // Get pitch size in z direction for each colunm |
b0f5e3fc | 171 | |
87663651 | 172 | Float_t pitchz = 425.; |
5752a110 | 173 | if(col < 0){ |
174 | pitchz = 0.0; | |
91378d45 | 175 | } else if(col >= 31 && col <= 32) { |
87663651 | 176 | pitchz = 625.; |
91378d45 | 177 | } else if(col >= 63 && col <= 64) { |
87663651 | 178 | pitchz = 625.; |
91378d45 | 179 | } else if(col >= 95 && col <= 96) { |
87663651 | 180 | pitchz = 625.; |
91378d45 | 181 | } else if(col >= 127 && col <= 128) { |
87663651 | 182 | pitchz = 625.; |
91378d45 | 183 | } else if(col >= 159 && col <= 160) { |
87663651 | 184 | pitchz = 625.; |
f1e07e4b | 185 | } else if(col>=192){ |
87663651 | 186 | pitchz = 425.; |
5752a110 | 187 | } |
188 | return pitchz; | |
b0f5e3fc | 189 | } |
5752a110 | 190 | //______________________________________________________________________ |
b0f5e3fc | 191 | AliITSsegmentationSPD::AliITSsegmentationSPD(AliITSgeom *gm){ |
192 | // Constructor | |
193 | fCorr=0; | |
194 | fNpx = 0; | |
195 | fNpz = 0; | |
196 | Init(); | |
197 | fGeom = gm; | |
198 | ||
199 | } | |
5752a110 | 200 | //______________________________________________________________________ |
55d2c544 | 201 | void AliITSsegmentationSPD::Copy(TObject &obj) const { |
202 | // protected method. copy this to obj | |
203 | AliITSsegmentation::Copy(obj); | |
204 | ((AliITSsegmentationSPD& ) obj).fNpx = fNpx; | |
205 | ((AliITSsegmentationSPD& ) obj).fNpz = fNpz; | |
206 | Int_t i; | |
207 | for(i=0;i<256;i++) | |
208 | ((AliITSsegmentationSPD& ) obj).fCellSizeX[i] = fCellSizeX[i]; | |
209 | for(i=0;i<280;i++) | |
210 | ((AliITSsegmentationSPD& ) obj).fCellSizeZ[i] = fCellSizeZ[i]; | |
211 | } | |
212 | ||
213 | //______________________________________________________________________ | |
214 | AliITSsegmentationSPD& AliITSsegmentationSPD::operator=(const AliITSsegmentationSPD &source){ | |
b0f5e3fc | 215 | // = operator |
b0f5e3fc | 216 | if(this==&source) return *this; |
55d2c544 | 217 | source.Copy(*this); |
b0f5e3fc | 218 | return *this; |
219 | } | |
220 | //____________________________________________________________________________ | |
55d2c544 | 221 | AliITSsegmentationSPD::AliITSsegmentationSPD(const AliITSsegmentationSPD &source) : |
ac74f489 | 222 | AliITSsegmentation(source){ |
b0f5e3fc | 223 | // copy constructor |
55d2c544 | 224 | source.Copy(*this); |
b0f5e3fc | 225 | } |
91378d45 | 226 | //---------------------------------------------------------------------- |
227 | void AliITSsegmentationSPD::SetBinSize(Float_t *x,Float_t *z){ | |
228 | // Fills the array of pixel sizes in x, microns | |
229 | // The input array x must have 256 elements. | |
230 | Int_t i; | |
231 | ||
232 | for(i=0;i<256;i++) fCellSizeX[i] = x[i]; | |
7775613f | 233 | for(i=0;i<280;i++) fCellSizeZ[i] = z[i]; |
91378d45 | 234 | return; |
235 | } | |
236 | //---------------------------------------------------------------------- | |
b0f5e3fc | 237 | void AliITSsegmentationSPD::Init300(){ |
238 | // Initialize infromation for 6 read out chip 300X50 micron pixel SPD | |
239 | // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.37 cm | |
240 | // long. It has 256 50 micron pixels in x and 279 300 micron size | |
241 | // pixels in z. | |
242 | ||
b0f5e3fc | 243 | //const Float_t kconv=10000.; |
e8189707 | 244 | Int_t i; |
b0f5e3fc | 245 | fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size |
246 | fNpz = 279; // The number of Z pixel Cell same as in fCellSizeZ array size | |
247 | for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same | |
f1e07e4b | 248 | for(i=0;i<280;i++) fCellSizeZ[i] = ZpitchFromCol300(i); // microns |
249 | // for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array | |
b0f5e3fc | 250 | fDx = 0; |
251 | for(i=0;i<fNpx;i++) fDx += fCellSizeX[i]; | |
252 | fDz = 0; | |
253 | for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i]; | |
254 | fDy = 300.0; //microns SPD sensitive layer thickness | |
255 | } | |
256 | ||
257 | //------------------------------ | |
258 | void AliITSsegmentationSPD::Init(){ | |
259 | // Initialize infromation for 6 read out chip 425X50 micron pixel SPD | |
260 | // detectors. This chip is 150 microns thick by 1.28 cm in x by 8.375 cm | |
261 | // long. It has 256 50 micron pixels in x and 197 mostly 425 micron size | |
262 | // pixels in z. The two pixels between each readout chip are 625 microns long. | |
263 | ||
b0f5e3fc | 264 | //const Float_t kconv=10000.; |
e8189707 | 265 | Int_t i; |
b0f5e3fc | 266 | fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size |
267 | fNpz = 192; // The number of Z pixel Cell same as in fCellSizeZ array size | |
268 | for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same | |
f1e07e4b | 269 | for(i=0;i<280;i++) fCellSizeZ[i] = ZpitchFromCol(i); // microns |
270 | // for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array | |
b0f5e3fc | 271 | fDx = 0; |
272 | for(i=0;i<fNpx;i++) fDx += fCellSizeX[i]; | |
273 | fDz = 0; | |
274 | for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i]; | |
275 | fDy = 300.0; //microns SPD sensitive layer thickness | |
e8189707 | 276 | //printf(" AliITSsegmentationSPD - Init: fNpx fNpz fDx fDz %d %d %f %f\n",fNpx, fNpz, fDx, fDz); |
b0f5e3fc | 277 | |
278 | } | |
279 | //------------------------------ | |
e8189707 | 280 | void AliITSsegmentationSPD::SetNPads(Int_t p1, Int_t p2){ |
b0f5e3fc | 281 | // for SPD this function should be used ONLY when a beam test setup |
282 | // configuration is studied | |
283 | ||
284 | fNpx=p1; | |
285 | fNpz=p2; | |
286 | ||
287 | } | |
b0f5e3fc | 288 | |
b0f5e3fc | 289 | //------------------------------ |
55d2c544 | 290 | Float_t AliITSsegmentationSPD::Dpx(Int_t i) const { |
f1e07e4b | 291 | //returs x pixel pitch for a give pixel |
292 | if(i<0||i>=256) return 0.0; | |
293 | return fCellSizeX[i]; | |
b0f5e3fc | 294 | } |
295 | //------------------------------ | |
55d2c544 | 296 | Float_t AliITSsegmentationSPD::Dpz(Int_t i) const { |
f1e07e4b | 297 | // returns z pixel pitch for a give pixel |
298 | if(i<0||i>=280) return 0.0; | |
299 | return fCellSizeZ[i]; | |
b0f5e3fc | 300 | } |
301 | //------------------------------ | |
55d2c544 | 302 | void AliITSsegmentationSPD::GetPadIxz(Float_t x,Float_t z,Int_t &ix,Int_t &iz) const { |
b0f5e3fc | 303 | // Returns pixel coordinates (ix,iz) for given real local coordinates (x,z) |
304 | // | |
305 | ||
306 | // expects x, z in microns | |
307 | ||
308 | // same segmentation on x | |
309 | Float_t dpx=Dpx(0); | |
310 | ix = (Int_t)(x/dpx + 1); | |
311 | // different segmentation on z | |
312 | iz = (Int_t)(ColFromZ(z) + 1); | |
313 | ||
b0f5e3fc | 314 | |
315 | if (iz > fNpz) iz= fNpz; | |
316 | if (ix > fNpx) ix= fNpx; | |
b0f5e3fc | 317 | /* |
318 | if (iz < -fNpz) iz= -fNpz; | |
319 | if (ix < -fNpx) ix=-fNpx; | |
320 | */ | |
321 | } | |
322 | ||
323 | //------------------------------ | |
55d2c544 | 324 | void AliITSsegmentationSPD::GetPadTxz(Float_t &x,Float_t &z) const{ |
e8189707 | 325 | // local transformation of real local coordinates (x,z) |
326 | // | |
327 | ||
328 | // expects x, z in microns | |
329 | ||
330 | // same segmentation on x | |
331 | Float_t dpx=Dpx(0); | |
332 | ||
333 | x /= dpx; | |
334 | z = ColFromZ(z); | |
335 | ||
336 | } | |
337 | //------------------------------ | |
55d2c544 | 338 | void AliITSsegmentationSPD::GetPadCxz(Int_t ix,Int_t iz,Float_t &x,Float_t&z) const { |
b0f5e3fc | 339 | // Transform from pixel to real local coordinates |
340 | ||
341 | // returns x, z in microns | |
342 | ||
343 | Float_t dpx=Dpx(0); | |
344 | ||
345 | x = (ix>0) ? Float_t(ix*dpx)-dpx/2. : Float_t(ix*dpx)+dpx/2.; | |
346 | z = ZFromCol(iz); | |
347 | ||
348 | ||
349 | } | |
350 | //------------------------------ | |
351 | void AliITSsegmentationSPD:: | |
55d2c544 | 352 | Neighbours(Int_t iX, Int_t iZ, Int_t* Nlist, Int_t Xlist[8], Int_t Zlist[8]) const { |
b0f5e3fc | 353 | // returns the neighbouring pixels for use in Cluster Finders and the like. |
354 | /* | |
355 | *Nlist=4;Xlist[0]=Xlist[1]=iX;Xlist[2]=iX-1;Xlist[3]=iX+1; | |
356 | Zlist[0]=iZ-1;Zlist[1]=iZ+1;Zlist[2]=Zlist[3]=iZ; | |
357 | */ | |
358 | ||
359 | ||
360 | *Nlist=8; | |
361 | Xlist[0]=Xlist[1]=iX; | |
362 | Xlist[2]=iX-1; | |
363 | Xlist[3]=iX+1; | |
364 | Zlist[0]=iZ-1; | |
365 | Zlist[1]=iZ+1; | |
366 | Zlist[2]=Zlist[3]=iZ; | |
367 | ||
368 | // Diagonal elements | |
369 | Xlist[4]=iX+1; | |
370 | Zlist[4]=iZ+1; | |
371 | ||
372 | Xlist[5]=iX-1; | |
373 | Zlist[5]=iZ-1; | |
374 | ||
375 | Xlist[6]=iX-1; | |
376 | Zlist[6]=iZ+1; | |
377 | ||
378 | Xlist[7]=iX+1; | |
379 | Zlist[7]=iZ-1; | |
380 | } | |
5752a110 | 381 | //______________________________________________________________________ |
55d2c544 | 382 | void AliITSsegmentationSPD::LocalToDet(Float_t x,Float_t z,Int_t &ix,Int_t &iz) const { |
5752a110 | 383 | // Transformation from Geant detector centered local coordinates (cm) to |
384 | // Pixel cell numbers ix and iz. | |
385 | // Input: | |
386 | // Float_t x detector local coordinate x in cm with respect to the | |
387 | // center of the sensitive volume. | |
388 | // Float_t z detector local coordinate z in cm with respect to the | |
389 | // center of the sensitive volulme. | |
390 | // Output: | |
391 | // Int_t ix detector x cell coordinate. Has the range 0<=ix<fNpx. | |
392 | // Int_t iz detector z cell coordinate. Has the range 0<=iz<fNpz. | |
393 | // A value of -1 for ix or iz indecates that this point is outside of the | |
394 | // detector segmentation as defined. | |
395 | Int_t i,j; | |
396 | Float_t dx,dz; | |
397 | const Float_t kconv = 1.0E-04; // converts microns to cm. | |
398 | ||
399 | dx = -0.5*kconv*Dx(); | |
400 | dz = -0.5*kconv*Dz(); | |
401 | ix = -1; | |
402 | iz = -1; | |
403 | if(x<dx) return; // outside x range. | |
404 | if(z<dz) return; // outside z range. | |
405 | for(i=0;i<Npx();i++){ | |
406 | dx += kconv*fCellSizeX[i]; | |
407 | if(x<dx) break; | |
408 | } // end for i | |
409 | if(i>=Npx()) return; // outside x range. | |
410 | for(j=0;j<Npz();j++){ | |
411 | dz += kconv*fCellSizeZ[j]; | |
412 | if(z<dz) break; | |
413 | } // end for j | |
414 | if(j>=Npz()) return; // outside z range. | |
415 | ix = i; | |
416 | iz = j; | |
417 | return; // Found ix and iz, return. | |
418 | } | |
419 | //______________________________________________________________________ | |
55d2c544 | 420 | void AliITSsegmentationSPD::DetToLocal(Int_t ix,Int_t iz,Float_t &x,Float_t &z) const |
5752a110 | 421 | { |
422 | // Transformation from Detector cell coordiantes to Geant detector centerd | |
423 | // local coordinates (cm). | |
424 | // Input: | |
425 | // Int_t ix detector x cell coordinate. Has the range 0<=ix<fNpx. | |
426 | // Int_t iz detector z cell coordinate. Has the range 0<=iz<fNpz. | |
427 | // Output: | |
428 | // Float_t x detector local coordinate x in cm with respect to the | |
429 | // center of the sensitive volume. | |
430 | // Float_t z detector local coordinate z in cm with respect to the | |
431 | // center of the sensitive volulme. | |
432 | // If ix and or iz is outside of the segmentation range a value of -0.5*Dx() | |
433 | // or -0.5*Dz() is returned. | |
434 | Int_t i,j; | |
435 | const Float_t kconv = 1.0E-04; // converts microns to cm. | |
436 | ||
437 | x = -0.5*kconv*Dx(); // default value. | |
438 | z = -0.5*kconv*Dz(); // default value. | |
439 | if(ix<0 || ix>=Npx()) return; // outside of detector | |
440 | if(iz<0 || iz>=Npz()) return; // outside of detctor | |
441 | for(i=0;i<ix;i++) x += kconv*fCellSizeX[i]; // sum up to cell ix-1 | |
442 | x += 0.5*kconv*fCellSizeX[ix]; // add 1/2 of cell ix for center location. | |
443 | for(j=0;j<iz;j++) z += kconv*fCellSizeZ[j]; // sum up cell iz-1 | |
444 | z += 0.5*kconv*fCellSizeZ[iz]; // add 1/2 of cell iz for center location. | |
445 | return; // Found x and z, return. | |
446 | } | |
bd8ff387 | 447 | //______________________________________________________________________ |
448 | void AliITSsegmentationSPD::CellBoundries(Int_t ix,Int_t iz, | |
449 | Double_t &xl,Double_t &xu, | |
55d2c544 | 450 | Double_t &zl,Double_t &zu) const |
bd8ff387 | 451 | { |
452 | // Transformation from Detector cell coordiantes to Geant detector centerd | |
453 | // local coordinates (cm). | |
454 | // Input: | |
455 | // Int_t ix detector x cell coordinate. Has the range 0<=ix<fNpx. | |
456 | // Int_t iz detector z cell coordinate. Has the range 0<=iz<fNpz. | |
457 | // Output: | |
458 | // Double_t xl detector local coordinate cell lower bounds x in cm | |
459 | // with respect to the center of the sensitive volume. | |
460 | // Double_t xu detector local coordinate cell upper bounds x in cm | |
461 | // with respect to the center of the sensitive volume. | |
462 | // Double_t zl detector local coordinate lower bounds z in cm with | |
463 | // respect to the center of the sensitive volulme. | |
464 | // Double_t zu detector local coordinate upper bounds z in cm with | |
465 | // respect to the center of the sensitive volulme. | |
466 | // If ix and or iz is outside of the segmentation range a value of -0.5*Dx() | |
467 | // and -0.5*Dx() or -0.5*Dz() and -0.5*Dz() are returned. | |
468 | Int_t i,j; | |
469 | const Float_t kconv = 1.0E-04; // converts microns to cm. | |
470 | Float_t x,z; | |
471 | ||
472 | xl = xu = x = -0.5*kconv*Dx(); // default value. | |
473 | zl = zu = z = -0.5*kconv*Dz(); // default value. | |
474 | if(ix<0 || ix>=Npx()) return; // outside of detector | |
475 | if(iz<0 || iz>=Npz()) return; // outside of detctor | |
476 | for(i=0;i<ix;i++) x += kconv*fCellSizeX[i]; // sum up to cell ix-1 | |
477 | xl = x; | |
478 | x += kconv*fCellSizeX[ix]; | |
479 | xu = x; | |
480 | for(j=0;j<iz;j++) z += kconv*fCellSizeZ[j]; // sum up cell iz-1 | |
481 | zl = z; | |
482 | z += kconv*fCellSizeZ[iz]; | |
483 | zu = z; | |
484 | return; // Found x and z, return. | |
485 | } |