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