]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSgeomSPD.cxx
Displaced a cd()... Not sure if it makes any difference
[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$
94831058 18Revision 1.14 2001/10/19 21:32:35 nilsen
19Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
20cleanded up a little bit of code.
21
b48af428 22Revision 1.13 2001/10/12 22:07:20 nilsen
23A patch for C++ io manipulation functions so that they will work both
24with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
25other platforms.
26
431a7819 27Revision 1.12 2001/08/24 21:06:37 nilsen
28Added more documentation, fixed up some coding violations, and some
29forward declorations.
30
85f1e34a 31Revision 1.11 2001/05/16 08:17:49 hristov
32Bug fixed in the StepManager to account for the difference in the geometry
33tree for the ITS pixels. This fixes both the funny distribution of pixel
34coordinates and the missing hits/digits/points in many sectors of the ITS
35pixel barrel. Also included is a patch to properly get and use the detector
36dimensions through out the ITS code. (B.Nilsen)
37
e99dbc71 38Revision 1.10 2001/04/26 22:44:34 nilsen
39Bug fix.
40
2d408567 41Revision 1.9 2001/02/09 00:00:57 nilsen
42Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
43bugs in iostream based streamers used to read and write .det files. Fixed
44some detector sizes. Fixed bugs in some default-special constructors.
45
31b8cd63 46Revision 1.8 2001/02/03 00:00:30 nilsen
47New version of AliITSgeom and related files. Now uses automatic streamers,
48set up for new formatted .det file which includes detector information.
49Additional smaller modifications are still to come.
50
8253cd9a 51*/
52
85f1e34a 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
8253cd9a 60#include <iostream.h>
61#include <iomanip.h>
62#include <TShape.h>
31b8cd63 63#include <TMath.h>
8253cd9a 64
65#include "AliITSgeomSPD.h"
66
67ClassImp(AliITSgeomSPD)
68
69AliITSgeomSPD::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//______________________________________________________________________
79AliITSgeomSPD::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//______________________________________________________________________
92void 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//______________________________________________________________________
120AliITSgeomSPD::AliITSgeomSPD(AliITSgeomSPD &source){
121 // Copy constructor
122
123 *this = source; // just use the = operator for now.
124 return;
125}
126//______________________________________________________________________
127AliITSgeomSPD& 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//______________________________________________________________________
144AliITSgeomSPD::~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//______________________________________________________________________
157void 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//______________________________________________________________________
175void 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//______________________________________________________________________
31b8cd63 187void AliITSgeomSPD::Print(ostream *os) const {
8253cd9a 188// Standard output format for this class
189 Int_t i;
431a7819 190#if defined __GNUC__
191#if __GNUC__ > 2
192 ios::fmtflags fmt;
193#else
194 Int_t fmt;
195#endif
94831058 196#else
197#if defined __ICC
198 ios::fmtflags fmt;
431a7819 199#else
31b8cd63 200 Int_t fmt;
94831058 201#endif
b48af428 202#endif
8253cd9a 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] << " ";
31b8cd63 211 for(i=0;i<fNbinz;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
8253cd9a 212 *os << endl;
213 os->flags(fmt);
214 return;
215}
216//______________________________________________________________________
217void 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//----------------------------------------------------------------------
239ostream &operator<<(ostream &os,AliITSgeomSPD &p){
240////////////////////////////////////////////////////////////////////////
241// Standard output streaming function.
242////////////////////////////////////////////////////////////////////////
243
244 p.Print(&os);
245 return os;
246}
247//----------------------------------------------------------------------
248istream &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$
94831058 260Revision 1.14 2001/10/19 21:32:35 nilsen
261Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
262cleanded up a little bit of code.
263
b48af428 264Revision 1.13 2001/10/12 22:07:20 nilsen
265A patch for C++ io manipulation functions so that they will work both
266with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
267other platforms.
268
431a7819 269Revision 1.12 2001/08/24 21:06:37 nilsen
270Added more documentation, fixed up some coding violations, and some
271forward declorations.
272
85f1e34a 273Revision 1.11 2001/05/16 08:17:49 hristov
274Bug 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
e99dbc71 276Revision 1.10 2001/04/26 22:44:34 nilsen
277Bug fix.
278
2d408567 279Revision 1.9 2001/02/09 00:00:57 nilsen
280Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
281bugs in iostream based streamers used to read and write .det files. Fixed
282some detector sizes. Fixed bugs in some default-special constructors.
283
31b8cd63 284Revision 1.8 2001/02/03 00:00:30 nilsen
285New version of AliITSgeom and related files. Now uses automatic streamers,
286set up for new formatted .det file which includes detector information.
287Additional smaller modifications are still to come.
288
8253cd9a 289Revision 1.7 2000/10/02 16:32:35 barbera
290Forward declaration added
291
292Revision 1.1.2.8 2000/10/02 15:52:05 barbera
293Forward declaration added
294
295Revision 1.6 2000/07/10 16:07:18 fca
296Release version of ITS code
297
298Revision 1.4 2000/06/10 20:34:37 nilsen
299Fixed compilation warning with HP unix.
300
301Revision 1.3 2000/06/10 10:43:04 nilsen
302Fixed bug in copy and operator =.
303
304*/
305
306//#include "AliITSgeomSPD300.h"
307
308ClassImp(AliITSgeomSPD300)
309
310AliITSgeomSPD300::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////////////////////////////////////////////////////////////////////////
316const 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.
320const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
321const Int_t knbinx = 256; // number of pixels along x direction.
322const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
323const Float_t kbinz1 = 0.0350; // cm; Edge pixel size in z direction.
324const 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
31b8cd63 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.");
8253cd9a 349 SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
350// cout << "AliITSgeomSPD300 default creator called: end" << endl;
351}
352//----------------------------------------------------------------------
353ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){
354////////////////////////////////////////////////////////////////////////
355// Standard output streaming function.
356////////////////////////////////////////////////////////////////////////
357
358 p.Print(&os);
359 return os;
360}
361//----------------------------------------------------------------------
362istream &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$
94831058 373Revision 1.14 2001/10/19 21:32:35 nilsen
374Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
375cleanded up a little bit of code.
376
b48af428 377Revision 1.13 2001/10/12 22:07:20 nilsen
378A patch for C++ io manipulation functions so that they will work both
379with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
380other platforms.
381
431a7819 382Revision 1.12 2001/08/24 21:06:37 nilsen
383Added more documentation, fixed up some coding violations, and some
384forward declorations.
385
85f1e34a 386Revision 1.11 2001/05/16 08:17:49 hristov
387Bug 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
e99dbc71 389Revision 1.10 2001/04/26 22:44:34 nilsen
390Bug fix.
391
2d408567 392Revision 1.9 2001/02/09 00:00:57 nilsen
393Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
394bugs in iostream based streamers used to read and write .det files. Fixed
395some detector sizes. Fixed bugs in some default-special constructors.
396
31b8cd63 397Revision 1.8 2001/02/03 00:00:30 nilsen
398New version of AliITSgeom and related files. Now uses automatic streamers,
399set up for new formatted .det file which includes detector information.
400Additional smaller modifications are still to come.
401
8253cd9a 402Revision 1.7 2000/10/02 16:32:35 barbera
403Forward declaration added
404
405Revision 1.1.2.8 2000/10/02 15:52:05 barbera
92c19c36 406Forward declaration added
407
408Revision 1.6 2000/07/10 16:07:18 fca
409Release version of ITS code
410
8253cd9a 411Revision 1.4 2000/06/10 20:34:22 nilsen
412Fixed compilation warning with HP unix.
413
414Revision 1.3 2000/06/10 10:42:49 nilsen
415Fixed bug in copy and operator =.
416
417
418*/
419
420//#include "AliITSgeomSPD425Short.h"
421
422ClassImp(AliITSgeomSPD425Short)
423
e99dbc71 424AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){
8253cd9a 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).
e99dbc71 430////////////////////////////////////////////////////////////////////////
431}
432//----------------------------------------------------------------------
433AliITSgeomSPD425Short::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).
8253cd9a 440////////////////////////////////////////////////////////////////////////
441
85f1e34a 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.
8253cd9a 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.
e99dbc71 451 const Int_t knbinz = 160; // number of pixels along z direction.
8253cd9a 452 Int_t i;
453 Float_t dx,dz,*binSizeX,*binSizeZ;
195d8dfe 454
8253cd9a 455 SetNbinX(knbinx); // default number of bins in x.
456 SetNbinZ(knbinz); // default number of bins in z.
1cea8f13 457
8253cd9a 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
31b8cd63 465 binSizeZ[ 63] = kbinz1;
8253cd9a 466 binSizeZ[ 64] = kbinz1;
8253cd9a 467
31b8cd63 468 binSizeZ[ 95] = kbinz1;
469 binSizeZ[ 96] = kbinz1;
8253cd9a 470
31b8cd63 471 binSizeZ[127] = kbinz1;
472 binSizeZ[128] = kbinz1;
8253cd9a 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
e99dbc71 482 SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
483 par[0],par[1],par[2]);
31b8cd63 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.");
8253cd9a 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//----------------------------------------------------------------------
495ostream &operator<<(ostream &os,AliITSgeomSPD425Short &p){
496////////////////////////////////////////////////////////////////////////
497// Standard output streaming function.
498////////////////////////////////////////////////////////////////////////
499
500 p.Print(&os);
501 return os;
502}
503//----------------------------------------------------------------------
504istream &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$
94831058 516Revision 1.14 2001/10/19 21:32:35 nilsen
517Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
518cleanded up a little bit of code.
519
b48af428 520Revision 1.13 2001/10/12 22:07:20 nilsen
521A patch for C++ io manipulation functions so that they will work both
522with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
523other platforms.
524
431a7819 525Revision 1.12 2001/08/24 21:06:37 nilsen
526Added more documentation, fixed up some coding violations, and some
527forward declorations.
528
85f1e34a 529Revision 1.11 2001/05/16 08:17:49 hristov
530Bug 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
e99dbc71 532Revision 1.10 2001/04/26 22:44:34 nilsen
533Bug fix.
534
2d408567 535Revision 1.9 2001/02/09 00:00:57 nilsen
536Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
537bugs in iostream based streamers used to read and write .det files. Fixed
538some detector sizes. Fixed bugs in some default-special constructors.
539
31b8cd63 540Revision 1.8 2001/02/03 00:00:30 nilsen
541New version of AliITSgeom and related files. Now uses automatic streamers,
542set up for new formatted .det file which includes detector information.
543Additional smaller modifications are still to come.
544
8253cd9a 545Revision 1.7 2000/10/02 16:32:35 barbera
546Forward declaration added
547
548Revision 1.1.2.8 2000/10/02 15:52:05 barbera
549Forward declaration added
550
551Revision 1.6 2000/07/10 16:07:18 fca
552Release version of ITS code
553
554Revision 1.4 2000/06/10 20:34:22 nilsen
555Fixed compilation warning with HP unix.
556
557Revision 1.3 2000/06/10 10:42:49 nilsen
558Fixed bug in copy and operator =.
1cea8f13 559
1cea8f13 560
4c039060 561*/
562
8253cd9a 563//#include "AliITSgeomSPD425Long.h"
58005f18 564
8253cd9a 565ClassImp(AliITSgeomSPD425Long)
566
567AliITSgeomSPD425Long::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.
2d408567 584 const Int_t knbinz = 192; // number of pixels along z direction.
8253cd9a 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
2d408567 598 binSizeZ[ 63] = kbinz1;
8253cd9a 599 binSizeZ[ 64] = kbinz1;
8253cd9a 600
2d408567 601 binSizeZ[ 95] = kbinz1;
602 binSizeZ[ 96] = kbinz1;
195d8dfe 603
2d408567 604 binSizeZ[127] = kbinz1;
605 binSizeZ[128] = kbinz1;
8253cd9a 606
2d408567 607 binSizeZ[159] = kbinz1;
608 binSizeZ[160] = kbinz1;
8253cd9a 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);
31b8cd63 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.");
8253cd9a 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//----------------------------------------------------------------------
630ostream &operator<<(ostream &os,AliITSgeomSPD425Long &p){
1cea8f13 631////////////////////////////////////////////////////////////////////////
8253cd9a 632// Standard output streaming function.
1cea8f13 633////////////////////////////////////////////////////////////////////////
1cea8f13 634
8253cd9a 635 p.Print(&os);
636 return os;
637}
638//----------------------------------------------------------------------
639istream &operator>>(istream &is,AliITSgeomSPD425Long &r){
640////////////////////////////////////////////////////////////////////////
641// Standard input streaming function.
642////////////////////////////////////////////////////////////////////////
195d8dfe 643
8253cd9a 644 r.Read(&is);
645 return is;
646}
647//======================================================================