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