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