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