]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSgeomSPD.cxx
Smaller changes
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD.cxx
CommitLineData
4c039060 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$
b48af428 18Revision 1.13 2001/10/12 22:07:20 nilsen
19A patch for C++ io manipulation functions so that they will work both
20with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
21other platforms.
22
431a7819 23Revision 1.12 2001/08/24 21:06:37 nilsen
24Added more documentation, fixed up some coding violations, and some
25forward declorations.
26
85f1e34a 27Revision 1.11 2001/05/16 08:17:49 hristov
28Bug fixed in the StepManager to account for the difference in the geometry
29tree for the ITS pixels. This fixes both the funny distribution of pixel
30coordinates and the missing hits/digits/points in many sectors of the ITS
31pixel barrel. Also included is a patch to properly get and use the detector
32dimensions through out the ITS code. (B.Nilsen)
33
e99dbc71 34Revision 1.10 2001/04/26 22:44:34 nilsen
35Bug fix.
36
2d408567 37Revision 1.9 2001/02/09 00:00:57 nilsen
38Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
39bugs in iostream based streamers used to read and write .det files. Fixed
40some detector sizes. Fixed bugs in some default-special constructors.
41
31b8cd63 42Revision 1.8 2001/02/03 00:00:30 nilsen
43New version of AliITSgeom and related files. Now uses automatic streamers,
44set up for new formatted .det file which includes detector information.
45Additional smaller modifications are still to come.
46
8253cd9a 47*/
48
85f1e34a 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
8253cd9a 56#include <iostream.h>
57#include <iomanip.h>
58#include <TShape.h>
31b8cd63 59#include <TMath.h>
8253cd9a 60
61#include "AliITSgeomSPD.h"
62
63ClassImp(AliITSgeomSPD)
64
65AliITSgeomSPD::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//______________________________________________________________________
75AliITSgeomSPD::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//______________________________________________________________________
88void 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//______________________________________________________________________
116AliITSgeomSPD::AliITSgeomSPD(AliITSgeomSPD &source){
117 // Copy constructor
118
119 *this = source; // just use the = operator for now.
120 return;
121}
122//______________________________________________________________________
123AliITSgeomSPD& 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//______________________________________________________________________
140AliITSgeomSPD::~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//______________________________________________________________________
153void 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//______________________________________________________________________
171void 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//______________________________________________________________________
31b8cd63 183void AliITSgeomSPD::Print(ostream *os) const {
8253cd9a 184// Standard output format for this class
185 Int_t i;
431a7819 186#if defined __GNUC__
187#if __GNUC__ > 2
188 ios::fmtflags fmt;
189#else
190 Int_t fmt;
191#endif
192#else
31b8cd63 193 Int_t fmt;
b48af428 194#endif
8253cd9a 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] << " ";
31b8cd63 203 for(i=0;i<fNbinz;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
8253cd9a 204 *os << endl;
205 os->flags(fmt);
206 return;
207}
208//______________________________________________________________________
209void 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//----------------------------------------------------------------------
231ostream &operator<<(ostream &os,AliITSgeomSPD &p){
232////////////////////////////////////////////////////////////////////////
233// Standard output streaming function.
234////////////////////////////////////////////////////////////////////////
235
236 p.Print(&os);
237 return os;
238}
239//----------------------------------------------------------------------
240istream &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$
b48af428 252Revision 1.13 2001/10/12 22:07:20 nilsen
253A patch for C++ io manipulation functions so that they will work both
254with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
255other platforms.
256
431a7819 257Revision 1.12 2001/08/24 21:06:37 nilsen
258Added more documentation, fixed up some coding violations, and some
259forward declorations.
260
85f1e34a 261Revision 1.11 2001/05/16 08:17:49 hristov
262Bug 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
e99dbc71 264Revision 1.10 2001/04/26 22:44:34 nilsen
265Bug fix.
266
2d408567 267Revision 1.9 2001/02/09 00:00:57 nilsen
268Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
269bugs in iostream based streamers used to read and write .det files. Fixed
270some detector sizes. Fixed bugs in some default-special constructors.
271
31b8cd63 272Revision 1.8 2001/02/03 00:00:30 nilsen
273New version of AliITSgeom and related files. Now uses automatic streamers,
274set up for new formatted .det file which includes detector information.
275Additional smaller modifications are still to come.
276
8253cd9a 277Revision 1.7 2000/10/02 16:32:35 barbera
278Forward declaration added
279
280Revision 1.1.2.8 2000/10/02 15:52:05 barbera
281Forward declaration added
282
283Revision 1.6 2000/07/10 16:07:18 fca
284Release version of ITS code
285
286Revision 1.4 2000/06/10 20:34:37 nilsen
287Fixed compilation warning with HP unix.
288
289Revision 1.3 2000/06/10 10:43:04 nilsen
290Fixed bug in copy and operator =.
291
292*/
293
294//#include "AliITSgeomSPD300.h"
295
296ClassImp(AliITSgeomSPD300)
297
298AliITSgeomSPD300::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////////////////////////////////////////////////////////////////////////
304const 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.
308const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
309const Int_t knbinx = 256; // number of pixels along x direction.
310const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
311const Float_t kbinz1 = 0.0350; // cm; Edge pixel size in z direction.
312const 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
31b8cd63 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.");
8253cd9a 337 SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
338// cout << "AliITSgeomSPD300 default creator called: end" << endl;
339}
340//----------------------------------------------------------------------
341ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){
342////////////////////////////////////////////////////////////////////////
343// Standard output streaming function.
344////////////////////////////////////////////////////////////////////////
345
346 p.Print(&os);
347 return os;
348}
349//----------------------------------------------------------------------
350istream &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$
b48af428 361Revision 1.13 2001/10/12 22:07:20 nilsen
362A patch for C++ io manipulation functions so that they will work both
363with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
364other platforms.
365
431a7819 366Revision 1.12 2001/08/24 21:06:37 nilsen
367Added more documentation, fixed up some coding violations, and some
368forward declorations.
369
85f1e34a 370Revision 1.11 2001/05/16 08:17:49 hristov
371Bug 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
e99dbc71 373Revision 1.10 2001/04/26 22:44:34 nilsen
374Bug fix.
375
2d408567 376Revision 1.9 2001/02/09 00:00:57 nilsen
377Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
378bugs in iostream based streamers used to read and write .det files. Fixed
379some detector sizes. Fixed bugs in some default-special constructors.
380
31b8cd63 381Revision 1.8 2001/02/03 00:00:30 nilsen
382New version of AliITSgeom and related files. Now uses automatic streamers,
383set up for new formatted .det file which includes detector information.
384Additional smaller modifications are still to come.
385
8253cd9a 386Revision 1.7 2000/10/02 16:32:35 barbera
387Forward declaration added
388
389Revision 1.1.2.8 2000/10/02 15:52:05 barbera
92c19c36 390Forward declaration added
391
392Revision 1.6 2000/07/10 16:07:18 fca
393Release version of ITS code
394
8253cd9a 395Revision 1.4 2000/06/10 20:34:22 nilsen
396Fixed compilation warning with HP unix.
397
398Revision 1.3 2000/06/10 10:42:49 nilsen
399Fixed bug in copy and operator =.
400
401
402*/
403
404//#include "AliITSgeomSPD425Short.h"
405
406ClassImp(AliITSgeomSPD425Short)
407
e99dbc71 408AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){
8253cd9a 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).
e99dbc71 414////////////////////////////////////////////////////////////////////////
415}
416//----------------------------------------------------------------------
417AliITSgeomSPD425Short::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).
8253cd9a 424////////////////////////////////////////////////////////////////////////
425
85f1e34a 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.
8253cd9a 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.
e99dbc71 435 const Int_t knbinz = 160; // number of pixels along z direction.
8253cd9a 436 Int_t i;
437 Float_t dx,dz,*binSizeX,*binSizeZ;
195d8dfe 438
8253cd9a 439 SetNbinX(knbinx); // default number of bins in x.
440 SetNbinZ(knbinz); // default number of bins in z.
1cea8f13 441
8253cd9a 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
31b8cd63 449 binSizeZ[ 63] = kbinz1;
8253cd9a 450 binSizeZ[ 64] = kbinz1;
8253cd9a 451
31b8cd63 452 binSizeZ[ 95] = kbinz1;
453 binSizeZ[ 96] = kbinz1;
8253cd9a 454
31b8cd63 455 binSizeZ[127] = kbinz1;
456 binSizeZ[128] = kbinz1;
8253cd9a 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
e99dbc71 466 SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
467 par[0],par[1],par[2]);
31b8cd63 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.");
8253cd9a 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//----------------------------------------------------------------------
479ostream &operator<<(ostream &os,AliITSgeomSPD425Short &p){
480////////////////////////////////////////////////////////////////////////
481// Standard output streaming function.
482////////////////////////////////////////////////////////////////////////
483
484 p.Print(&os);
485 return os;
486}
487//----------------------------------------------------------------------
488istream &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$
b48af428 500Revision 1.13 2001/10/12 22:07:20 nilsen
501A patch for C++ io manipulation functions so that they will work both
502with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
503other platforms.
504
431a7819 505Revision 1.12 2001/08/24 21:06:37 nilsen
506Added more documentation, fixed up some coding violations, and some
507forward declorations.
508
85f1e34a 509Revision 1.11 2001/05/16 08:17:49 hristov
510Bug 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
e99dbc71 512Revision 1.10 2001/04/26 22:44:34 nilsen
513Bug fix.
514
2d408567 515Revision 1.9 2001/02/09 00:00:57 nilsen
516Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
517bugs in iostream based streamers used to read and write .det files. Fixed
518some detector sizes. Fixed bugs in some default-special constructors.
519
31b8cd63 520Revision 1.8 2001/02/03 00:00:30 nilsen
521New version of AliITSgeom and related files. Now uses automatic streamers,
522set up for new formatted .det file which includes detector information.
523Additional smaller modifications are still to come.
524
8253cd9a 525Revision 1.7 2000/10/02 16:32:35 barbera
526Forward declaration added
527
528Revision 1.1.2.8 2000/10/02 15:52:05 barbera
529Forward declaration added
530
531Revision 1.6 2000/07/10 16:07:18 fca
532Release version of ITS code
533
534Revision 1.4 2000/06/10 20:34:22 nilsen
535Fixed compilation warning with HP unix.
536
537Revision 1.3 2000/06/10 10:42:49 nilsen
538Fixed bug in copy and operator =.
1cea8f13 539
1cea8f13 540
4c039060 541*/
542
8253cd9a 543//#include "AliITSgeomSPD425Long.h"
58005f18 544
8253cd9a 545ClassImp(AliITSgeomSPD425Long)
546
547AliITSgeomSPD425Long::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.
2d408567 564 const Int_t knbinz = 192; // number of pixels along z direction.
8253cd9a 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
2d408567 578 binSizeZ[ 63] = kbinz1;
8253cd9a 579 binSizeZ[ 64] = kbinz1;
8253cd9a 580
2d408567 581 binSizeZ[ 95] = kbinz1;
582 binSizeZ[ 96] = kbinz1;
195d8dfe 583
2d408567 584 binSizeZ[127] = kbinz1;
585 binSizeZ[128] = kbinz1;
8253cd9a 586
2d408567 587 binSizeZ[159] = kbinz1;
588 binSizeZ[160] = kbinz1;
8253cd9a 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);
31b8cd63 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.");
8253cd9a 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//----------------------------------------------------------------------
610ostream &operator<<(ostream &os,AliITSgeomSPD425Long &p){
1cea8f13 611////////////////////////////////////////////////////////////////////////
8253cd9a 612// Standard output streaming function.
1cea8f13 613////////////////////////////////////////////////////////////////////////
1cea8f13 614
8253cd9a 615 p.Print(&os);
616 return os;
617}
618//----------------------------------------------------------------------
619istream &operator>>(istream &is,AliITSgeomSPD425Long &r){
620////////////////////////////////////////////////////////////////////////
621// Standard input streaming function.
622////////////////////////////////////////////////////////////////////////
195d8dfe 623
8253cd9a 624 r.Read(&is);
625 return is;
626}
627//======================================================================