]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSsegmentationSPD.cxx
bug fix in the vertex selection
[u/mrichter/AliRoot.git] / ITS / AliITSsegmentationSPD.cxx
CommitLineData
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
2b6642a2 16/* $Id$ */
c9649d1e 17#include <TGeoManager.h>
18#include <TGeoVolume.h>
19#include <TGeoBBox.h>
b0f5e3fc 20#include "AliITSsegmentationSPD.h"
fa4f0f62 21
55d2c544 22//////////////////////////////////////////////////////
23// Segmentation class for //
24// pixels //
25// //
26//////////////////////////////////////////////////////
2b6642a2 27const Int_t AliITSsegmentationSPD::fgkNchipsPerModule = 5;
28const Int_t AliITSsegmentationSPD::fgkNcolumnsPerChip = 32;
b0f5e3fc 29ClassImp(AliITSsegmentationSPD)
30
55d2c544 31//_____________________________________________________________________________
c9649d1e 32 AliITSsegmentationSPD::AliITSsegmentationSPD(Option_t *opt): AliITSsegmentation(),
e56160b8 33fNpx(0),
34fNpz(0){
55d2c544 35 // Default constructor
c9649d1e 36
a5e51e90 37 // Initialization to default values
38 Init();
39
40 // Initialization of detector dimensions from TGeo
c9649d1e 41 if(strstr(opt,"TGeo")){
42 if(!gGeoManager){
a5e51e90 43 AliError("Geometry is not initialized\n Using hardwired default values");
c9649d1e 44 return;
45 }
46 TGeoVolume *v=NULL;
47 v = gGeoManager->GetVolume("ITSSPDlay1-sensor");
48 if(!v){
49 AliWarning("TGeo volume ITSSPDlay1-sensor not found (hint: use v11Hybrid geometry)\n Using hardwired default values");
c9649d1e 50 }
51 else {
52 TGeoBBox *s=(TGeoBBox*)v->GetShape();
53 SetDetSize(s->GetDX()*20000.,s->GetDZ()*20000.,s->GetDY()*20000.);
54 }
c9649d1e 55 }
55d2c544 56}
b0f5e3fc 57
55d2c544 58//_____________________________________________________________________________
59Float_t AliITSsegmentationSPD::ColFromZ300(Float_t z) const {
b0f5e3fc 60// Get column number for each z-coordinate taking into account the
61// extra pixels in z direction assuming 300 micron sized pixels.
62 Float_t col = 0.0;
63 Float_t pitchz = 300.0;
64 col = Float_t (z/pitchz);
65 return col;
66}
67//_____________________________________________________________________________
55d2c544 68Float_t AliITSsegmentationSPD::ZFromCol300(Int_t col) const {
b0f5e3fc 69// same comments as above
70// Get z-coordinate for each colunm number
71 Float_t pitchz = 300.0;
72 Float_t z = 0.0;
73 z = (col+0.5)*pitchz;
74 return z;
75}
76//_____________________________________________________________________________
55d2c544 77Float_t AliITSsegmentationSPD::ZpitchFromCol300(Int_t col) const {
b0f5e3fc 78 // returns Z pixel pitch for 300 micron pixels.
ac74f489 79
80 col = 0; // done to remove unused variable warning.
81 return 300.0;
b0f5e3fc 82}
83//_____________________________________________________________________________
55d2c544 84Float_t AliITSsegmentationSPD::ColFromZ(Float_t z) const {
f1e07e4b 85 // hard-wired - keep it like this till we can parametrise
86 // and get rid of AliITSgeomSPD425
87 // Get column number for each z-coordinate taking into account the
88 // extra pixels in z direction
89 Int_t i;
90 Float_t s,col;
5d3918d6 91
f1e07e4b 92 if(z<0||z>fDz){
f6b6d58e 93 AliError(Form("z=%f outside of range 0.0<=z<fDz=%f",z,fDz));
f1e07e4b 94 return 0.0; // error
95 } // end if outsize of detector
96 s = 0.0;
97 i = -1;
98 while(z>s){
99 i++;
100 s += fCellSizeZ[i];
101 } // end while
102 s -= fCellSizeZ[i];
103 col = (Float_t) i + (z-s)/fCellSizeZ[i];
104 return col;
105
106/*
b0f5e3fc 107 Float_t col = 0;
108 Float_t pitchz = 425;
109 if( z < 13175) {
110 col = Float_t(z/pitchz);
111 } else if( z < 14425) {
112 pitchz = 625;
113 col = 31 + (z - 13175)/pitchz;
114 } else if( z < 27175) {
115 col = 33 + (z - 14425)/pitchz;
116 } else if( z < 28425) {
117 pitchz = 625;
118 col = 63 + (z - 27175)/pitchz;
119 } else if( z < 41175) {
120 col = 65 + (z - 28425)/pitchz;
121 } else if( z < 42425) {
122 pitchz = 625;
123 col = 95 + (z - 41175)/pitchz;
124 } else if( z < 55175) {
125 col = 97 + (z - 42425)/pitchz;
126 } else if( z < 56425) {
127 pitchz = 625;
128 col = 127 + (z - 55175)/pitchz;
129 } else if( z < 69175) {
130 col = 129 + (z - 56425)/pitchz;
131 } else if( z < 70425) {
132 pitchz = 625;
133 col = 159 + (z - 69175)/pitchz;
134 } else if( z < 83600) {
135 col = 161 + (z - 70425)/pitchz;
136 }
f1e07e4b 137 return TMath::Abs(col);*/
b0f5e3fc 138}
139
140//_____________________________________________________________________________
55d2c544 141Float_t AliITSsegmentationSPD::ZFromCol(Int_t col) const {
f1e07e4b 142 // same comments as above
143 // Get z-coordinate for each colunm number
144 Int_t i;
145 Float_t z;
5d3918d6 146
f1e07e4b 147 if(col<0||col>=fNpz){
f6b6d58e 148 AliError(Form("col=%d outside of range 0<=col<fNpZ=%d",col,fNpz));
f1e07e4b 149 return 0.0; // error
150 } // end if outsize of detector
151 z = 0.0;
152 for(i=0;i<col;i++) z += fCellSizeZ[i];
153 z += 0.5*fCellSizeZ[col];
154 return z;
155
156/*
b0f5e3fc 157 Float_t pitchz = 425;
158 Float_t z = 0;
159 if( col >=0 && col <= 30 ) {
160 z = (col + 0.5)*pitchz;
161 } else if( col >= 31 && col <= 32) {
162 pitchz = 625;
163 z = 13175 + (col -31 + 0.5)*pitchz;
164 } else if( col >= 33 && col <= 62) {
165 z = 14425 + (col -33 + 0.5)*pitchz;
166 } else if( col >= 63 && col <= 64) {
167 pitchz = 625;
168 z = 27175 + (col -63 + 0.5)*pitchz;
169 } else if( col >= 65 && col <= 94) {
170 z = 28425 + (col -65 + 0.5)*pitchz;
171 } else if( col >= 95 && col <= 96) {
172 pitchz = 625;
173 z = 41175 + (col -95 + 0.5)*pitchz;
174 } else if( col >= 97 && col <= 126) {
175 z = 42425 + (col -97 + 0.5)*pitchz;
176 } else if( col >= 127 && col <= 128) {
177 pitchz = 625;
178 z = 55175 + (col -127 + 0.5)*pitchz;
179 } else if( col >= 129 && col <= 158) {
180 z = 56425 + (col -129 + 0.5)*pitchz;
181 } else if( col >= 159 && col <= 160) {
182 pitchz = 625;
183 z = 69175 + (col -159 + 0.5)*pitchz;
184 } else if( col >= 161 && col <= 191) {
185 z = 70425 + (col -161 + 0.5)*pitchz;
5752a110 186 }
b0f5e3fc 187
f1e07e4b 188 return z;*/
b0f5e3fc 189}
5752a110 190//______________________________________________________________________
55d2c544 191Float_t AliITSsegmentationSPD::ZpitchFromCol(Int_t col) const {
f1e07e4b 192 // Get pitch size in z direction for each colunm
b0f5e3fc 193
87663651 194 Float_t pitchz = 425.;
5752a110 195 if(col < 0){
196 pitchz = 0.0;
91378d45 197 } else if(col >= 31 && col <= 32) {
87663651 198 pitchz = 625.;
91378d45 199 } else if(col >= 63 && col <= 64) {
87663651 200 pitchz = 625.;
91378d45 201 } else if(col >= 95 && col <= 96) {
87663651 202 pitchz = 625.;
91378d45 203 } else if(col >= 127 && col <= 128) {
87663651 204 pitchz = 625.;
91378d45 205 } else if(col >= 159 && col <= 160) {
87663651 206 pitchz = 625.;
f1e07e4b 207 } else if(col>=192){
87663651 208 pitchz = 425.;
5752a110 209 }
210 return pitchz;
b0f5e3fc 211}
a5e51e90 212
5752a110 213//______________________________________________________________________
55d2c544 214void AliITSsegmentationSPD::Copy(TObject &obj) const {
215 // protected method. copy this to obj
216 AliITSsegmentation::Copy(obj);
217 ((AliITSsegmentationSPD& ) obj).fNpx = fNpx;
218 ((AliITSsegmentationSPD& ) obj).fNpz = fNpz;
219 Int_t i;
220 for(i=0;i<256;i++)
221 ((AliITSsegmentationSPD& ) obj).fCellSizeX[i] = fCellSizeX[i];
222 for(i=0;i<280;i++)
223 ((AliITSsegmentationSPD& ) obj).fCellSizeZ[i] = fCellSizeZ[i];
224}
225
226//______________________________________________________________________
227AliITSsegmentationSPD& AliITSsegmentationSPD::operator=(const AliITSsegmentationSPD &source){
b0f5e3fc 228 // = operator
b0f5e3fc 229 if(this==&source) return *this;
55d2c544 230 source.Copy(*this);
b0f5e3fc 231 return *this;
232}
233//____________________________________________________________________________
55d2c544 234AliITSsegmentationSPD::AliITSsegmentationSPD(const AliITSsegmentationSPD &source) :
e56160b8 235 AliITSsegmentation(source),
236fNpx(0),
237fNpz(0){
b0f5e3fc 238 // copy constructor
55d2c544 239 source.Copy(*this);
b0f5e3fc 240}
91378d45 241//----------------------------------------------------------------------
242void AliITSsegmentationSPD::SetBinSize(Float_t *x,Float_t *z){
243 // Fills the array of pixel sizes in x, microns
244 // The input array x must have 256 elements.
245 Int_t i;
246
247 for(i=0;i<256;i++) fCellSizeX[i] = x[i];
7775613f 248 for(i=0;i<280;i++) fCellSizeZ[i] = z[i];
91378d45 249 return;
250}
251//----------------------------------------------------------------------
b0f5e3fc 252void AliITSsegmentationSPD::Init300(){
253// Initialize infromation for 6 read out chip 300X50 micron pixel SPD
254// detectors. This chip is 150 microns thick by 1.28 cm in x by 8.37 cm
255// long. It has 256 50 micron pixels in x and 279 300 micron size
256// pixels in z.
257
b0f5e3fc 258 //const Float_t kconv=10000.;
e8189707 259 Int_t i;
b0f5e3fc 260 fNpx = 256; // The number of X pixel Cell same as in fCellSizeX array size
261 fNpz = 279; // The number of Z pixel Cell same as in fCellSizeZ array size
262 for(i=0;i<fNpx;i++) fCellSizeX[i] = 50.0; // microns all the same
f1e07e4b 263 for(i=0;i<280;i++) fCellSizeZ[i] = ZpitchFromCol300(i); // microns
264// for(i=fNpz;i<280;i++) fCellSizeZ[i] = 0.0; // zero out rest of array
b0f5e3fc 265 fDx = 0;
266 for(i=0;i<fNpx;i++) fDx += fCellSizeX[i];
267 fDz = 0;
268 for(i=0;i<fNpz;i++) fDz += fCellSizeZ[i];
269 fDy = 300.0; //microns SPD sensitive layer thickness
270}
271
272//------------------------------
273void AliITSsegmentationSPD::Init(){
2b6642a2 274// Initialize information for 5 read out chip 425X50 micron pixel SPD
275// detectors (ladder).
276// Each readout chip is 150 micron thick.
277// The ladder sensor is 200 micron thick by 1.28 cm in x by 6.96 cm in z.
278// It has 256 50 micron pixels in x and 160 mostly 425 micron pixels in z.
279// The two pixels at boundary between two adjacent readout chips are
280// 625 micron long.
b0f5e3fc 281
a5e51e90 282 Float_t bx[256],bz[280];
283 Int_t i;
284 SetNPads(256,160); // Number of Bins in x and z
285 for(i=000;i<256;i++) bx[i] = 50.0; // in x all are 50 microns.
286 for(i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
287 for(i=160;i<280;i++) bz[i] = 0.0; // Outside of detector.
288 bz[ 31] = bz[ 32] = 625.0; // first chip boundary
289 bz[ 63] = bz[ 64] = 625.0; // first chip boundary
290 bz[ 95] = bz[ 96] = 625.0; // first chip boundary
291 bz[127] = bz[128] = 625.0; // first chip boundary
292 bz[160] = 425.0; // Set so that there is no zero pixel size for fNz.
293 SetBinSize(bx,bz);
294 SetDetSize(12800,69600,200); // full lengths (x,z,y) in microns
b0f5e3fc 295
296}
297//------------------------------
e8189707 298void AliITSsegmentationSPD::SetNPads(Int_t p1, Int_t p2){
b0f5e3fc 299 // for SPD this function should be used ONLY when a beam test setup
300 // configuration is studied
301
302 fNpx=p1;
303 fNpz=p2;
304
305}
b0f5e3fc 306
b0f5e3fc 307//------------------------------
55d2c544 308Float_t AliITSsegmentationSPD::Dpx(Int_t i) const {
f1e07e4b 309 //returs x pixel pitch for a give pixel
310 if(i<0||i>=256) return 0.0;
311 return fCellSizeX[i];
b0f5e3fc 312}
313//------------------------------
55d2c544 314Float_t AliITSsegmentationSPD::Dpz(Int_t i) const {
f1e07e4b 315 // returns z pixel pitch for a give pixel
316 if(i<0||i>=280) return 0.0;
317 return fCellSizeZ[i];
b0f5e3fc 318}
319//------------------------------
55d2c544 320void AliITSsegmentationSPD::GetPadIxz(Float_t x,Float_t z,Int_t &ix,Int_t &iz) const {
b0f5e3fc 321// Returns pixel coordinates (ix,iz) for given real local coordinates (x,z)
322//
323
324 // expects x, z in microns
325
326 // same segmentation on x
327 Float_t dpx=Dpx(0);
328 ix = (Int_t)(x/dpx + 1);
329 // different segmentation on z
330 iz = (Int_t)(ColFromZ(z) + 1);
331
b0f5e3fc 332
333 if (iz > fNpz) iz= fNpz;
334 if (ix > fNpx) ix= fNpx;
b0f5e3fc 335 /*
336 if (iz < -fNpz) iz= -fNpz;
337 if (ix < -fNpx) ix=-fNpx;
338 */
339}
340
341//------------------------------
55d2c544 342void AliITSsegmentationSPD::GetPadTxz(Float_t &x,Float_t &z) const{
e8189707 343// local transformation of real local coordinates (x,z)
344//
345
346 // expects x, z in microns
347
348 // same segmentation on x
349 Float_t dpx=Dpx(0);
350
351 x /= dpx;
352 z = ColFromZ(z);
353
354}
355//------------------------------
55d2c544 356void AliITSsegmentationSPD::GetPadCxz(Int_t ix,Int_t iz,Float_t &x,Float_t&z) const {
b0f5e3fc 357 // Transform from pixel to real local coordinates
358
359 // returns x, z in microns
360
361 Float_t dpx=Dpx(0);
362
363 x = (ix>0) ? Float_t(ix*dpx)-dpx/2. : Float_t(ix*dpx)+dpx/2.;
364 z = ZFromCol(iz);
365
366
367}
368//------------------------------
369void AliITSsegmentationSPD::
55d2c544 370Neighbours(Int_t iX, Int_t iZ, Int_t* Nlist, Int_t Xlist[8], Int_t Zlist[8]) const {
b0f5e3fc 371 // returns the neighbouring pixels for use in Cluster Finders and the like.
372 /*
373 *Nlist=4;Xlist[0]=Xlist[1]=iX;Xlist[2]=iX-1;Xlist[3]=iX+1;
374 Zlist[0]=iZ-1;Zlist[1]=iZ+1;Zlist[2]=Zlist[3]=iZ;
375 */
376
377
378 *Nlist=8;
379 Xlist[0]=Xlist[1]=iX;
380 Xlist[2]=iX-1;
381 Xlist[3]=iX+1;
382 Zlist[0]=iZ-1;
383 Zlist[1]=iZ+1;
384 Zlist[2]=Zlist[3]=iZ;
385
386 // Diagonal elements
387 Xlist[4]=iX+1;
388 Zlist[4]=iZ+1;
389
390 Xlist[5]=iX-1;
391 Zlist[5]=iZ-1;
392
393 Xlist[6]=iX-1;
394 Zlist[6]=iZ+1;
395
396 Xlist[7]=iX+1;
397 Zlist[7]=iZ-1;
398}
5752a110 399//______________________________________________________________________
aacedc3e 400Bool_t AliITSsegmentationSPD::LocalToDet(Float_t x,Float_t z,
401 Int_t &ix,Int_t &iz) const {
402 // Transformation from Geant detector centered local coordinates (cm) to
403 // Pixel cell numbers ix and iz.
404 // Input:
405 // Float_t x detector local coordinate x in cm with respect to
406 // the center of the sensitive volume.
407 // Float_t z detector local coordinate z in cm with respect to
408 // the center of the sensitive volulme.
409 // Output:
410 // Int_t ix detector x cell coordinate. Has the range
411 // 0<=ix<fNpx.
412 // Int_t iz detector z cell coordinate. Has the range
413 // 0<=iz<fNpz.
414 // Return:
415 // kTRUE if point x,z is inside sensitive volume, kFALSE otherwise.
416 // A value of -1 for ix or iz indecates that this point is outside of the
417 // detector segmentation as defined.
5752a110 418 Int_t i,j;
419 Float_t dx,dz;
420 const Float_t kconv = 1.0E-04; // converts microns to cm.
421
422 dx = -0.5*kconv*Dx();
423 dz = -0.5*kconv*Dz();
424 ix = -1;
425 iz = -1;
aacedc3e 426 if(x<dx) return kFALSE; // outside x range.
427 if(z<dz) return kFALSE; // outside z range.
5752a110 428 for(i=0;i<Npx();i++){
429 dx += kconv*fCellSizeX[i];
430 if(x<dx) break;
431 } // end for i
aacedc3e 432 if(i>=Npx()) return kFALSE; // outside x range.
5752a110 433 for(j=0;j<Npz();j++){
434 dz += kconv*fCellSizeZ[j];
435 if(z<dz) break;
436 } // end for j
aacedc3e 437 if(j>=Npz()) return kFALSE; // outside z range.
5752a110 438 ix = i;
439 iz = j;
aacedc3e 440 return kTRUE; // Found ix and iz, return.
5752a110 441}
442//______________________________________________________________________
55d2c544 443void AliITSsegmentationSPD::DetToLocal(Int_t ix,Int_t iz,Float_t &x,Float_t &z) const
5752a110 444{
445// Transformation from Detector cell coordiantes to Geant detector centerd
446// local coordinates (cm).
447// Input:
448// Int_t ix detector x cell coordinate. Has the range 0<=ix<fNpx.
449// Int_t iz detector z cell coordinate. Has the range 0<=iz<fNpz.
450// Output:
451// Float_t x detector local coordinate x in cm with respect to the
452// center of the sensitive volume.
453// Float_t z detector local coordinate z in cm with respect to the
454// center of the sensitive volulme.
455// If ix and or iz is outside of the segmentation range a value of -0.5*Dx()
456// or -0.5*Dz() is returned.
457 Int_t i,j;
458 const Float_t kconv = 1.0E-04; // converts microns to cm.
459
460 x = -0.5*kconv*Dx(); // default value.
461 z = -0.5*kconv*Dz(); // default value.
462 if(ix<0 || ix>=Npx()) return; // outside of detector
463 if(iz<0 || iz>=Npz()) return; // outside of detctor
464 for(i=0;i<ix;i++) x += kconv*fCellSizeX[i]; // sum up to cell ix-1
465 x += 0.5*kconv*fCellSizeX[ix]; // add 1/2 of cell ix for center location.
466 for(j=0;j<iz;j++) z += kconv*fCellSizeZ[j]; // sum up cell iz-1
467 z += 0.5*kconv*fCellSizeZ[iz]; // add 1/2 of cell iz for center location.
468 return; // Found x and z, return.
469}
bd8ff387 470//______________________________________________________________________
471void AliITSsegmentationSPD::CellBoundries(Int_t ix,Int_t iz,
472 Double_t &xl,Double_t &xu,
55d2c544 473 Double_t &zl,Double_t &zu) const
bd8ff387 474{
475// Transformation from Detector cell coordiantes to Geant detector centerd
476// local coordinates (cm).
477// Input:
478// Int_t ix detector x cell coordinate. Has the range 0<=ix<fNpx.
479// Int_t iz detector z cell coordinate. Has the range 0<=iz<fNpz.
480// Output:
481// Double_t xl detector local coordinate cell lower bounds x in cm
482// with respect to the center of the sensitive volume.
483// Double_t xu detector local coordinate cell upper bounds x in cm
484// with respect to the center of the sensitive volume.
485// Double_t zl detector local coordinate lower bounds z in cm with
486// respect to the center of the sensitive volulme.
487// Double_t zu detector local coordinate upper bounds z in cm with
488// respect to the center of the sensitive volulme.
489// If ix and or iz is outside of the segmentation range a value of -0.5*Dx()
490// and -0.5*Dx() or -0.5*Dz() and -0.5*Dz() are returned.
491 Int_t i,j;
492 const Float_t kconv = 1.0E-04; // converts microns to cm.
493 Float_t x,z;
494
495 xl = xu = x = -0.5*kconv*Dx(); // default value.
496 zl = zu = z = -0.5*kconv*Dz(); // default value.
497 if(ix<0 || ix>=Npx()) return; // outside of detector
498 if(iz<0 || iz>=Npz()) return; // outside of detctor
499 for(i=0;i<ix;i++) x += kconv*fCellSizeX[i]; // sum up to cell ix-1
500 xl = x;
501 x += kconv*fCellSizeX[ix];
502 xu = x;
503 for(j=0;j<iz;j++) z += kconv*fCellSizeZ[j]; // sum up cell iz-1
504 zl = z;
505 z += kconv*fCellSizeZ[iz];
506 zu = z;
507 return; // Found x and z, return.
508}
2b6642a2 509//----------------------------------------------------------------------
510Int_t AliITSsegmentationSPD::GetChipFromChannel(Int_t, Int_t iz) const {
511 // returns chip number (in range 0-4) starting from channel number
512 if(iz>=fNpz || iz<0 ){
513 AliWarning("Bad cell number");
514 return -1;
515 }
516 Int_t theChip=iz/fgkNcolumnsPerChip;
517 return theChip;
518}
519//----------------------------------------------------------------------
520Int_t AliITSsegmentationSPD::GetChipFromLocal(Float_t, Float_t zloc) const {
521 // returns chip number (in range 0-4) starting from local coordinates
522 Int_t ix0,iz;
523 if (!LocalToDet(0,zloc,ix0,iz)) {
524 AliWarning("Bad local coordinate");
525 return -1;
526 }
527 return GetChipFromChannel(ix0,iz);
528}
529//----------------------------------------------------------------------
23197852 530Int_t AliITSsegmentationSPD::GetChipsInLocalWindow(Int_t* array, Float_t zmin, Float_t zmax, Float_t, Float_t) const {
531 // returns the number of chips containing a road defined by given local coordinate limits
532
533 const Float_t kconv = 1.0E-04; // converts microns to cm.
534
535 if (zmin>zmax) {
536 AliWarning("Bad coordinate limits: zmin>zmax!");
537 return -1;
538 }
539
540 Int_t nChipInW = 0;
541
542 Float_t zminDet = -0.5*kconv*Dz();
543 Float_t zmaxDet = 0.5*kconv*Dz();
544 if(zmin<zminDet) zmin=zminDet;
545 if(zmax>zmaxDet) zmax=zmaxDet;
546
547 Int_t n1 = GetChipFromLocal(0,zmin);
548 array[nChipInW] = n1;
549 nChipInW++;
550
551 Int_t n2 = GetChipFromLocal(0,zmax);
552
553 if(n2!=n1){
554 Int_t imin=TMath::Min(n1,n2);
555 Int_t imax=TMath::Max(n1,n2);
556 for(Int_t ichip=imin; ichip<=imax; ichip++){
557 if(ichip==n1) continue;
558 array[nChipInW]=ichip;
559 nChipInW++;
560 }
561 }
562
563 return nChipInW;
564}
565//----------------------------------------------------------------------