]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSgeomSPD.cxx
Some function moved to AliZDC
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD.cxx
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 /*
17 $Log$
18 Revision 1.11  2001/05/16 08:17:49  hristov
19 Bug fixed in the StepManager to account for the difference in the geometry 
20 tree for the ITS pixels. This fixes both the funny distribution of pixel 
21 coordinates and the missing hits/digits/points in many sectors of the ITS 
22 pixel barrel. Also included is a patch to properly get and use the detector 
23 dimensions through out the ITS code. (B.Nilsen)
24
25 Revision 1.10  2001/04/26 22:44:34  nilsen
26 Bug fix.
27
28 Revision 1.9  2001/02/09 00:00:57  nilsen
29 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
30 bugs in iostream based streamers used to read and write .det files. Fixed
31 some detector sizes. Fixed bugs in some default-special constructors.
32
33 Revision 1.8  2001/02/03 00:00:30  nilsen
34 New version of AliITSgeom and related files. Now uses automatic streamers,
35 set up for new formatted .det file which includes detector information.
36 Additional smaller modifications are still to come.
37
38 */
39
40 ////////////////////////////////////////////////////////////////////////
41 // This class is for the Silicon Pixel Detector, SPD, specific geometry.
42 // It is being replaced by AliITSsegmentationSPD class. This file also
43 // constains classes derived from AliITSgeomSPD which do nothing but
44 // initilize this one with predefined values.
45 ////////////////////////////////////////////////////////////////////////
46
47 #include <iostream.h>
48 #include <iomanip.h>
49 #include <TShape.h>
50 #include <TMath.h>
51
52 #include "AliITSgeomSPD.h"
53
54 ClassImp(AliITSgeomSPD)
55
56 AliITSgeomSPD::AliITSgeomSPD(){
57 // Default Constructor. Set everthing to null.
58
59     fShapeSPD    = 0;
60     fNbinx       = 0;
61     fNbinz       = 0;
62     fLowBinEdgeX = 0;
63     fLowBinEdgeZ = 0;
64 }
65 //______________________________________________________________________
66 AliITSgeomSPD::AliITSgeomSPD(Float_t dy,Int_t nx,Float_t *bx,
67                              Int_t nz,Float_t *bz){
68 // Standard Constructor. Set everthing to null.
69
70     fShapeSPD    = 0;
71     fNbinx       = 0;
72     fNbinz       = 0;
73     fLowBinEdgeX = 0;
74     fLowBinEdgeZ = 0;
75     ReSetBins(dy,nx,bx,nz,bz);
76     return;
77 }
78 //______________________________________________________________________
79 void AliITSgeomSPD::ReSetBins(Float_t dy,Int_t nx,Float_t *bx,
80                               Int_t nz,Float_t *bz){
81 // delets the contents of this and replaces it with the given values.
82     Int_t i;
83     Float_t dx = 0.0, dz = 0.0;
84
85     // Compute size in x and z (based on bins).
86     for(i=0;i<nx;i++) dx += bx[i];
87     for(i=0;i<nz;i++) dz += bz[i];
88     dx *= 0.5;
89     dz *= 0.5;
90
91     delete fShapeSPD; // delete existing shape
92     if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX; // delete existing
93     if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ; // delete existing
94
95     SetNbinX(nx);
96     SetNbinZ(nz);
97     InitLowBinEdgeX();
98     InitLowBinEdgeZ();
99     fLowBinEdgeX[0] = -dx;
100     fLowBinEdgeZ[0] = -dz;
101     for(i=0;i<nx;i++) fLowBinEdgeX[i+1] = fLowBinEdgeX[i] + bx[i];
102     for(i=0;i<nz;i++) fLowBinEdgeZ[i+1] = fLowBinEdgeZ[i] + bz[i];
103     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,dy,dz);
104     return;
105 }
106 //______________________________________________________________________
107 AliITSgeomSPD::AliITSgeomSPD(AliITSgeomSPD &source){
108     // Copy constructor
109
110     *this = source; // just use the = operator for now.
111     return;
112 }
113 //______________________________________________________________________
114 AliITSgeomSPD& AliITSgeomSPD::operator=(AliITSgeomSPD &source){
115     // = operator
116     Int_t i;
117
118     if(&source == this) return *this;
119     this->fShapeSPD = new TBRIK(*(source.fShapeSPD));
120     if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX;
121     if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ;
122     this->fNbinx = source.fNbinx;
123     this->fNbinz = source.fNbinz;
124     this->InitLowBinEdgeX();
125     this->InitLowBinEdgeZ();
126     for(i=0;i<fNbinx;i++) this->fLowBinEdgeX[i] = source.fLowBinEdgeX[i];
127     for(i=0;i<fNbinz;i++) this->fLowBinEdgeZ[i] = source.fLowBinEdgeZ[i];
128     return *this;
129 }
130 //______________________________________________________________________
131 AliITSgeomSPD::~AliITSgeomSPD(){
132 // Destructor
133
134     delete fShapeSPD;
135     if(this->fLowBinEdgeX) delete[] this->fLowBinEdgeX;
136     if(this->fLowBinEdgeZ) delete[] this->fLowBinEdgeZ;
137     fShapeSPD    = 0;
138     fNbinx       = 0;
139     fNbinz       = 0;
140     fLowBinEdgeX = 0;
141     fLowBinEdgeZ = 0;
142 }
143 //______________________________________________________________________
144 void AliITSgeomSPD::LToDet(Float_t xl,Float_t zl,Int_t &row,Int_t &col){
145 // Returns the row and column pixel numbers for a given local coordinate
146 // system. If they are outside then it will return -1 or fNbinx/z.
147     Int_t i;
148
149     if(xl<fLowBinEdgeX[0]) row = -1;
150     else{
151         for(i=0;i<fNbinx;i++) if(xl<=fLowBinEdgeX[i]) break;
152         row = i;
153     } //end if too low.
154     if(zl<fLowBinEdgeX[0]) col = -1;
155     else{
156         for(i=0;i<fNbinz;i++) if(zl<=fLowBinEdgeZ[i]) break;
157         col = i;
158     } //end if too low.
159     return;
160 }
161 //______________________________________________________________________
162 void AliITSgeomSPD::DetToL(Int_t row,Int_t col,Float_t &xl,Float_t &zl){
163 // returns the pixel center local coordinate system location for a given
164 // row and column number. It the row or column number is outside of the 
165 // defined range then it will return the nearest detector edge.
166
167     if(row>=0||row<fNbinx-1) xl = 0.5*(fLowBinEdgeX[row]+fLowBinEdgeX[row+1]);
168     else if(row<0) xl = fLowBinEdgeX[0];else xl = fLowBinEdgeX[fNbinx-1];
169     if(col>=0||col<fNbinz-1) zl = 0.5*(fLowBinEdgeZ[col]+fLowBinEdgeZ[col+1]);
170     else if(col<0) zl = fLowBinEdgeZ[0];else zl = fLowBinEdgeZ[fNbinz-1];
171     return;
172 }
173 //______________________________________________________________________
174 void AliITSgeomSPD::Print(ostream *os) const {
175 // Standard output format for this class
176     Int_t i;
177     Int_t fmt;
178
179     fmt = os->setf(ios::scientific); // set scientific floating point output
180     *os << "TBRIK" << " ";
181     *os << setprecision(16) << GetDx() << " ";
182     *os << setprecision(16) << GetDy() << " ";
183     *os << setprecision(16) << GetDz() << " ";
184     *os << fNbinx-1 << " " << fNbinz-1 << " ";
185     for(i=0;i<fNbinx;i++) *os << setprecision(16) << fLowBinEdgeX[i] << " ";
186     for(i=0;i<fNbinz;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
187     *os << endl;
188     os->flags(fmt);
189     return;
190 }
191 //______________________________________________________________________
192 void AliITSgeomSPD::Read(istream *is){
193 // Standard input format for this class
194     Int_t i,j;
195     Float_t dx,dy,dz;
196     char shape[20];
197
198     for(i=0;i<20;i++) shape[i]='\0';
199     *is >> shape;
200     if(strcmp(shape,"TBRIK")) Warning("::Read","Shape not a TBRIK");
201     *is >> dx >> dy >> dz;
202     if(fShapeSPD!=0) delete fShapeSPD;
203     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,dy,dz);
204     *is >> i >> j;
205     SetNbinX(i);
206     SetNbinZ(j);
207     InitLowBinEdgeX();
208     InitLowBinEdgeZ();
209     for(i=0;i<fNbinx;i++) *is >> fLowBinEdgeX[i];
210     for(i=0;i<fNbinz;i++) *is >> fLowBinEdgeZ[i];
211     return;
212 }
213 //----------------------------------------------------------------------
214 ostream &operator<<(ostream &os,AliITSgeomSPD &p){
215 ////////////////////////////////////////////////////////////////////////
216 // Standard output streaming function.
217 ////////////////////////////////////////////////////////////////////////
218
219     p.Print(&os);
220     return os;
221 }
222 //----------------------------------------------------------------------
223 istream &operator>>(istream &is,AliITSgeomSPD &r){
224 ////////////////////////////////////////////////////////////////////////
225 // Standard input streaming function.
226 ////////////////////////////////////////////////////////////////////////
227
228     r.Read(&is);
229     return is;
230 }
231 //=====================================================================
232
233 /*
234 $Log$
235 Revision 1.11  2001/05/16 08:17:49  hristov
236 Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
237
238 Revision 1.10  2001/04/26 22:44:34  nilsen
239 Bug fix.
240
241 Revision 1.9  2001/02/09 00:00:57  nilsen
242 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
243 bugs in iostream based streamers used to read and write .det files. Fixed
244 some detector sizes. Fixed bugs in some default-special constructors.
245
246 Revision 1.8  2001/02/03 00:00:30  nilsen
247 New version of AliITSgeom and related files. Now uses automatic streamers,
248 set up for new formatted .det file which includes detector information.
249 Additional smaller modifications are still to come.
250
251 Revision 1.7  2000/10/02 16:32:35  barbera
252 Forward declaration added
253
254 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
255 Forward declaration added
256
257 Revision 1.6  2000/07/10 16:07:18  fca
258 Release version of ITS code
259
260 Revision 1.4  2000/06/10 20:34:37  nilsen
261 Fixed compilation warning with HP unix.
262
263 Revision 1.3  2000/06/10 10:43:04  nilsen
264 Fixed bug in copy and operator =.
265
266 */
267
268 //#include "AliITSgeomSPD300.h"
269
270 ClassImp(AliITSgeomSPD300)
271
272 AliITSgeomSPD300::AliITSgeomSPD300() : AliITSgeomSPD(){
273 ////////////////////////////////////////////////////////////////////////
274 //    default constructor, for ITS TDR geometry. This only consists of
275 // a default constructor to construct the defalut TDR SPD detector geometry
276 // 256 X 279 300 by 50 micron pixels.
277 ////////////////////////////////////////////////////////////////////////
278 const Float_t kdx=0.6400,kdy=0.0075,kdz=4.1900; // cm; Standard pixel detector
279                                                 // size is 2dx wide, 2dz long,
280                                                 // and 2dy thick. Geant 3.12
281                                                 // units.
282 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
283 const Int_t   knbinx = 256;    // number of pixels along x direction.
284 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
285 const Float_t kbinz1 = 0.0350; // cm; Edge pixel size in z direction.
286 const Int_t   knbinz = 279;    // number of pixels along z direction.
287     Int_t i;
288     Float_t dx=0.0,dz=0.0;
289
290 //    cout << "AliITSgeomSPD300 default creator called: start" << endl;
291
292     SetNbinX(knbinx); // default number of bins in x.
293     SetNbinZ(knbinz); // default number of bins in z.
294
295     for(i=0;i<knbinx;i++) dx += kbinx0; // Compute size x.
296     dx *= 0.5;
297     for(i=0;i<knbinz;i++) dz += kbinz0; // Compute size z.
298     dz += 2.0*(kbinz1-kbinz0);
299     dz *= 0.5;
300     InitLowBinEdgeX();
301     InitLowBinEdgeZ();
302     SetLowBinEdgeX(0,-dx); // Starting position X
303     for(i=0;i<knbinx;i++) SetLowBinEdgeX(i+1,GetBinLowEdgeX(i)+kbinx0);
304     SetLowBinEdgeZ(0,-dz); // Starting position z
305     SetLowBinEdgeZ(1,GetBinLowEdgeZ(0)+kbinz1);
306     for(i=1;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+kbinz0);
307     SetLowBinEdgeZ(knbinz,GetBinLowEdgeZ(knbinz-1)+kbinz1);
308
309     if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) 
310         Warning("Default Creator","Detector size may not be write.");
311     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
312 //    cout << "AliITSgeomSPD300 default creator called: end" << endl;
313 }
314 //----------------------------------------------------------------------
315 ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){
316 ////////////////////////////////////////////////////////////////////////
317 // Standard output streaming function.
318 ////////////////////////////////////////////////////////////////////////
319
320     p.Print(&os);
321     return os;
322 }
323 //----------------------------------------------------------------------
324 istream &operator>>(istream &is,AliITSgeomSPD300 &r){
325 ////////////////////////////////////////////////////////////////////////
326 // Standard input streaming function.
327 ////////////////////////////////////////////////////////////////////////
328
329     r.Read(&is);
330     return is;
331 }
332 //=====================================================================
333 /*
334 $Log$
335 Revision 1.11  2001/05/16 08:17:49  hristov
336 Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
337
338 Revision 1.10  2001/04/26 22:44:34  nilsen
339 Bug fix.
340
341 Revision 1.9  2001/02/09 00:00:57  nilsen
342 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
343 bugs in iostream based streamers used to read and write .det files. Fixed
344 some detector sizes. Fixed bugs in some default-special constructors.
345
346 Revision 1.8  2001/02/03 00:00:30  nilsen
347 New version of AliITSgeom and related files. Now uses automatic streamers,
348 set up for new formatted .det file which includes detector information.
349 Additional smaller modifications are still to come.
350
351 Revision 1.7  2000/10/02 16:32:35  barbera
352 Forward declaration added
353
354 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
355 Forward declaration added
356
357 Revision 1.6  2000/07/10 16:07:18  fca
358 Release version of ITS code
359
360 Revision 1.4  2000/06/10 20:34:22  nilsen
361 Fixed compilation warning with HP unix.
362
363 Revision 1.3  2000/06/10 10:42:49  nilsen
364 Fixed bug in copy and operator =.
365
366
367 */
368
369 //#include "AliITSgeomSPD425Short.h"
370
371 ClassImp(AliITSgeomSPD425Short)
372
373 AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){
374 ////////////////////////////////////////////////////////////////////////
375 //    default constructor, for ITS post TDR geometry. This only consists of
376 // a default constructor to construct the defalut post TDR SPD detector 
377 // geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50
378 // micron pixels (large detector).
379 ////////////////////////////////////////////////////////////////////////
380 }
381 //----------------------------------------------------------------------
382 AliITSgeomSPD425Short::AliITSgeomSPD425Short(Int_t npar,Float_t *par) :
383                                                               AliITSgeomSPD(){
384 ////////////////////////////////////////////////////////////////////////
385 //    Standard constructor, for ITS post TDR geometry. This only consists of
386 // a default constructor to construct the defalut post TDR SPD detector 
387 // geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50
388 // micron pixels (large detector).
389 ////////////////////////////////////////////////////////////////////////
390
391     const Float_t kdx=0.6400/*,kdy=0.015*/,kdz=3.480; // cm; Standard pixel
392                                                       // detector size is 2dx
393                                                       //  wide, 2dz long, and
394                                                       //  2dy thick. Geant 3.12
395                                                       // units.
396     const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
397     const Int_t   knbinx = 256;    // number of pixels along x direction.
398     const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
399     const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
400     const Int_t   knbinz = 160;    // number of pixels along z direction.
401     Int_t i;
402     Float_t dx,dz,*binSizeX,*binSizeZ;
403
404     SetNbinX(knbinx); // default number of bins in x.
405     SetNbinZ(knbinz); // default number of bins in z.
406
407     binSizeX = new Float_t[knbinx]; // array of bin sizes along x.
408     for(i=0;i<knbinx;i++) binSizeX[i] = kbinx0; // default x bin size.
409     binSizeZ = new Float_t[knbinz]; // array of bin sizes along z.
410     for(i=0;i<knbinz;i++) binSizeZ[i] = kbinz0; // default z bin size.
411     binSizeZ[ 31] = kbinz1;
412     binSizeZ[ 32] = kbinz1;
413
414     binSizeZ[ 63] = kbinz1;
415     binSizeZ[ 64] = kbinz1;
416
417     binSizeZ[ 95] = kbinz1;
418     binSizeZ[ 96] = kbinz1;
419
420     binSizeZ[127] = kbinz1;
421     binSizeZ[128] = kbinz1;
422
423     // correct detector size for bin size.
424     dx = 0.0;
425     for(i=0;i<knbinx;i++) dx += binSizeX[i];
426     dx *= 0.5;
427     dz = 0.0;
428     for(i=0;i<knbinz;i++) dz += binSizeZ[i];
429     dz *= 0.5;
430
431     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
432              par[0],par[1],par[2]);
433     if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) 
434         Warning("Default Creator","Detector size may not be write.");
435
436     InitLowBinEdgeX(); // array of bin sizes along x.
437     InitLowBinEdgeZ(); // array of bin sizes along x.
438     SetLowBinEdgeX(0,-dx);
439     SetLowBinEdgeZ(0,-dz);
440     for(i=0;i<knbinx;i++) SetLowBinEdgeX(i+1,GetBinLowEdgeX(i)+binSizeX[i]);
441     for(i=0;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+binSizeZ[i]);
442 }
443 //----------------------------------------------------------------------
444 ostream &operator<<(ostream &os,AliITSgeomSPD425Short &p){
445 ////////////////////////////////////////////////////////////////////////
446 // Standard output streaming function.
447 ////////////////////////////////////////////////////////////////////////
448
449     p.Print(&os);
450     return os;
451 }
452 //----------------------------------------------------------------------
453 istream &operator>>(istream &is,AliITSgeomSPD425Short &r){
454 ////////////////////////////////////////////////////////////////////////
455 // Standard input streaming function.
456 ////////////////////////////////////////////////////////////////////////
457
458     r.Read(&is);
459     return is;
460 }
461 //======================================================================
462
463 /*
464 $Log$
465 Revision 1.11  2001/05/16 08:17:49  hristov
466 Bug fixed in the StepManager to account for the difference in the geometry tree for the ITS pixels. This fixes both the funny distribution of pixel coordinates and the missing hits/digits/points in many sectors of the ITS pixel barrel. Also included is a patch to properly get and use the detector dimensions through out the ITS code. (B.Nilsen)
467
468 Revision 1.10  2001/04/26 22:44:34  nilsen
469 Bug fix.
470
471 Revision 1.9  2001/02/09 00:00:57  nilsen
472 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
473 bugs in iostream based streamers used to read and write .det files. Fixed
474 some detector sizes. Fixed bugs in some default-special constructors.
475
476 Revision 1.8  2001/02/03 00:00:30  nilsen
477 New version of AliITSgeom and related files. Now uses automatic streamers,
478 set up for new formatted .det file which includes detector information.
479 Additional smaller modifications are still to come.
480
481 Revision 1.7  2000/10/02 16:32:35  barbera
482 Forward declaration added
483
484 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
485 Forward declaration added
486
487 Revision 1.6  2000/07/10 16:07:18  fca
488 Release version of ITS code
489
490 Revision 1.4  2000/06/10 20:34:22  nilsen
491 Fixed compilation warning with HP unix.
492
493 Revision 1.3  2000/06/10 10:42:49  nilsen
494 Fixed bug in copy and operator =.
495
496
497 */
498
499 //#include "AliITSgeomSPD425Long.h"
500
501 ClassImp(AliITSgeomSPD425Long)
502
503 AliITSgeomSPD425Long::AliITSgeomSPD425Long(){
504 ////////////////////////////////////////////////////////////////////////
505 //    default constructor, for ITS post TDR geometry. This only consists of
506 // a default constructor to construct the defalut post TDR SPD detector 
507 // geometry 256 X 197 425 by 50 micron pixels with interleaved 625 by 50
508 // micron pixels (large detector).
509 ////////////////////////////////////////////////////////////////////////
510
511     const Float_t kdx=0.6400,kdy=0.0075,kdz=4.2650; // cm; Standard pixel
512                                                     // detector size is 2dx
513                                                     //  wide, 2dz long, and
514                                                     //  2dy thick. Geant 3.12
515                                                     // units.
516     const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
517     const Int_t   knbinx = 256;    // number of pixels along x direction.
518     const Float_t kbinz0 = 0.0425; // cm; Standard pixel size in z direction.
519     const Float_t kbinz1 = 0.0625; // cm; Special pixel size in z direction.
520     const Int_t   knbinz = 192;    // number of pixels along z direction.
521     Int_t i;
522     Float_t dx,dz,*binSizeX,*binSizeZ;
523
524     SetNbinX(knbinx); // default number of bins in x.
525     SetNbinZ(knbinz); // default number of bins in z.
526
527     binSizeX = new Float_t[knbinx]; // array of bin sizes along x.
528     for(i=0;i<knbinx;i++) binSizeX[i] = kbinx0; // default x bin size.
529     binSizeZ = new Float_t[knbinz]; // array of bin sizes along z.
530     for(i=0;i<knbinz;i++) binSizeZ[i] = kbinz0; // default z bin size.
531     binSizeZ[ 31] = kbinz1;
532     binSizeZ[ 32] = kbinz1;
533
534     binSizeZ[ 63] = kbinz1;
535     binSizeZ[ 64] = kbinz1;
536
537     binSizeZ[ 95] = kbinz1;
538     binSizeZ[ 96] = kbinz1;
539
540     binSizeZ[127] = kbinz1;
541     binSizeZ[128] = kbinz1;
542
543     binSizeZ[159] = kbinz1;
544     binSizeZ[160] = kbinz1;
545
546     // correct detector size for bin size.
547     dx = 0.0;
548     for(i=0;i<knbinx;i++) dx += binSizeX[i];
549     dx *= 0.5;
550     dz = 0.0;
551     for(i=0;i<knbinz;i++) dz += binSizeZ[i];
552     dz *= 0.5;
553
554     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
555     if(TMath::Abs(dx-kdx)>1.0E-4 || TMath::Abs(dz-kdz)>1.0E-4) 
556         Warning("Default Creator","Detector size may not be write.");
557
558     InitLowBinEdgeX(); // array of bin sizes along x.
559     InitLowBinEdgeZ(); // array of bin sizes along x.
560     SetLowBinEdgeX(0,-dx);
561     SetLowBinEdgeZ(0,-dz);
562     for(i=0;i<knbinx;i++) SetLowBinEdgeX(i+1,GetBinLowEdgeX(i)+binSizeX[i]);
563     for(i=0;i<knbinz;i++) SetLowBinEdgeZ(i+1,GetBinLowEdgeZ(i)+binSizeZ[i]);
564 }
565 //----------------------------------------------------------------------
566 ostream &operator<<(ostream &os,AliITSgeomSPD425Long &p){
567 ////////////////////////////////////////////////////////////////////////
568 // Standard output streaming function.
569 ////////////////////////////////////////////////////////////////////////
570
571     p.Print(&os);
572     return os;
573 }
574 //----------------------------------------------------------------------
575 istream &operator>>(istream &is,AliITSgeomSPD425Long &r){
576 ////////////////////////////////////////////////////////////////////////
577 // Standard input streaming function.
578 ////////////////////////////////////////////////////////////////////////
579
580     r.Read(&is);
581     return is;
582 }
583 //======================================================================