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