]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSgeomSPD.cxx
fRefVolumeId for reference volume identification added.
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSPD.cxx
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$
18 Revision 1.17  2002/10/22 14:45:41  alibrary
19 Introducing Riostream.h
20
21 Revision 1.16  2002/10/14 14:57:00  hristov
22 Merging the VirtualMC branch to the main development branch (HEAD)
23
24 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
25 Merged with v3-08-02
26
27 Revision 1.15  2002/05/19 18:17:03  hristov
28 Changes needed by ICC/IFC compiler (Intel)
29
30 Revision 1.14  2001/10/19 21:32:35  nilsen
31 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
32 cleanded up a little bit of code.
33
34 Revision 1.13  2001/10/12 22:07:20  nilsen
35 A patch for C++ io manipulation functions so that they will work both
36 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
37 other platforms.
38
39 Revision 1.12  2001/08/24 21:06:37  nilsen
40 Added more documentation, fixed up some coding violations, and some
41 forward declorations.
42
43 Revision 1.11  2001/05/16 08:17:49  hristov
44 Bug fixed in the StepManager to account for the difference in the geometry 
45 tree for the ITS pixels. This fixes both the funny distribution of pixel 
46 coordinates and the missing hits/digits/points in many sectors of the ITS 
47 pixel barrel. Also included is a patch to properly get and use the detector 
48 dimensions through out the ITS code. (B.Nilsen)
49
50 Revision 1.10  2001/04/26 22:44:34  nilsen
51 Bug fix.
52
53 Revision 1.9  2001/02/09 00:00:57  nilsen
54 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
55 bugs in iostream based streamers used to read and write .det files. Fixed
56 some detector sizes. Fixed bugs in some default-special constructors.
57
58 Revision 1.8  2001/02/03 00:00:30  nilsen
59 New version of AliITSgeom and related files. Now uses automatic streamers,
60 set up for new formatted .det file which includes detector information.
61 Additional smaller modifications are still to come.
62
63 */
64
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
72 #include <Riostream.h>
73 #include <TShape.h>
74 #include <TMath.h>
75
76 #include "AliITSgeomSPD.h"
77
78 ClassImp(AliITSgeomSPD)
79
80 AliITSgeomSPD::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 //______________________________________________________________________
90 AliITSgeomSPD::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 //______________________________________________________________________
103 void 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 //______________________________________________________________________
131 AliITSgeomSPD::AliITSgeomSPD(AliITSgeomSPD &source){
132     // Copy constructor
133
134     *this = source; // just use the = operator for now.
135     return;
136 }
137 //______________________________________________________________________
138 AliITSgeomSPD& 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 //______________________________________________________________________
155 AliITSgeomSPD::~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 //______________________________________________________________________
168 void 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 //______________________________________________________________________
186 void 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 //______________________________________________________________________
198 void AliITSgeomSPD::Print(ostream *os) const {
199 // Standard output format for this class
200     Int_t i;
201 #if defined __GNUC__
202 #if __GNUC__ > 2
203     ios::fmtflags fmt;
204 #else
205     Int_t fmt;
206 #endif
207 #else
208 #if defined __ICC || defined __ECC
209     ios::fmtflags fmt;
210 #else
211     Int_t fmt;
212 #endif
213 #endif
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] << " ";
222     for(i=0;i<fNbinz;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
223     *os << endl;
224     os->flags(fmt);
225     return;
226 }
227 //______________________________________________________________________
228 void 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 //----------------------------------------------------------------------
250 ostream &operator<<(ostream &os,AliITSgeomSPD &p){
251 ////////////////////////////////////////////////////////////////////////
252 // Standard output streaming function.
253 ////////////////////////////////////////////////////////////////////////
254
255     p.Print(&os);
256     return os;
257 }
258 //----------------------------------------------------------------------
259 istream &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$
271 Revision 1.17  2002/10/22 14:45:41  alibrary
272 Introducing Riostream.h
273
274 Revision 1.16  2002/10/14 14:57:00  hristov
275 Merging the VirtualMC branch to the main development branch (HEAD)
276
277 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
278 Merged with v3-08-02
279
280 Revision 1.15  2002/05/19 18:17:03  hristov
281 Changes needed by ICC/IFC compiler (Intel)
282
283 Revision 1.14  2001/10/19 21:32:35  nilsen
284 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
285 cleanded up a little bit of code.
286
287 Revision 1.13  2001/10/12 22:07:20  nilsen
288 A patch for C++ io manipulation functions so that they will work both
289 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
290 other platforms.
291
292 Revision 1.12  2001/08/24 21:06:37  nilsen
293 Added more documentation, fixed up some coding violations, and some
294 forward declorations.
295
296 Revision 1.11  2001/05/16 08:17:49  hristov
297 Bug 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
299 Revision 1.10  2001/04/26 22:44:34  nilsen
300 Bug fix.
301
302 Revision 1.9  2001/02/09 00:00:57  nilsen
303 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
304 bugs in iostream based streamers used to read and write .det files. Fixed
305 some detector sizes. Fixed bugs in some default-special constructors.
306
307 Revision 1.8  2001/02/03 00:00:30  nilsen
308 New version of AliITSgeom and related files. Now uses automatic streamers,
309 set up for new formatted .det file which includes detector information.
310 Additional smaller modifications are still to come.
311
312 Revision 1.7  2000/10/02 16:32:35  barbera
313 Forward declaration added
314
315 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
316 Forward declaration added
317
318 Revision 1.6  2000/07/10 16:07:18  fca
319 Release version of ITS code
320
321 Revision 1.4  2000/06/10 20:34:37  nilsen
322 Fixed compilation warning with HP unix.
323
324 Revision 1.3  2000/06/10 10:43:04  nilsen
325 Fixed bug in copy and operator =.
326
327 */
328
329 //#include "AliITSgeomSPD300.h"
330
331 ClassImp(AliITSgeomSPD300)
332
333 AliITSgeomSPD300::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 ////////////////////////////////////////////////////////////////////////
339 const 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.
343 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
344 const Int_t   knbinx = 256;    // number of pixels along x direction.
345 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
346 const Float_t kbinz1 = 0.0350; // cm; Edge pixel size in z direction.
347 const 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
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.");
372     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
373 //    cout << "AliITSgeomSPD300 default creator called: end" << endl;
374 }
375 //----------------------------------------------------------------------
376 ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){
377 ////////////////////////////////////////////////////////////////////////
378 // Standard output streaming function.
379 ////////////////////////////////////////////////////////////////////////
380
381     p.Print(&os);
382     return os;
383 }
384 //----------------------------------------------------------------------
385 istream &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$
396 Revision 1.17  2002/10/22 14:45:41  alibrary
397 Introducing Riostream.h
398
399 Revision 1.16  2002/10/14 14:57:00  hristov
400 Merging the VirtualMC branch to the main development branch (HEAD)
401
402 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
403 Merged with v3-08-02
404
405 Revision 1.15  2002/05/19 18:17:03  hristov
406 Changes needed by ICC/IFC compiler (Intel)
407
408 Revision 1.14  2001/10/19 21:32:35  nilsen
409 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
410 cleanded up a little bit of code.
411
412 Revision 1.13  2001/10/12 22:07:20  nilsen
413 A patch for C++ io manipulation functions so that they will work both
414 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
415 other platforms.
416
417 Revision 1.12  2001/08/24 21:06:37  nilsen
418 Added more documentation, fixed up some coding violations, and some
419 forward declorations.
420
421 Revision 1.11  2001/05/16 08:17:49  hristov
422 Bug 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
424 Revision 1.10  2001/04/26 22:44:34  nilsen
425 Bug fix.
426
427 Revision 1.9  2001/02/09 00:00:57  nilsen
428 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
429 bugs in iostream based streamers used to read and write .det files. Fixed
430 some detector sizes. Fixed bugs in some default-special constructors.
431
432 Revision 1.8  2001/02/03 00:00:30  nilsen
433 New version of AliITSgeom and related files. Now uses automatic streamers,
434 set up for new formatted .det file which includes detector information.
435 Additional smaller modifications are still to come.
436
437 Revision 1.7  2000/10/02 16:32:35  barbera
438 Forward declaration added
439
440 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
441 Forward declaration added
442
443 Revision 1.6  2000/07/10 16:07:18  fca
444 Release version of ITS code
445
446 Revision 1.4  2000/06/10 20:34:22  nilsen
447 Fixed compilation warning with HP unix.
448
449 Revision 1.3  2000/06/10 10:42:49  nilsen
450 Fixed bug in copy and operator =.
451
452
453 */
454
455 //#include "AliITSgeomSPD425Short.h"
456
457 ClassImp(AliITSgeomSPD425Short)
458
459 AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){
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).
465 ////////////////////////////////////////////////////////////////////////
466 }
467 //----------------------------------------------------------------------
468 AliITSgeomSPD425Short::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).
475 ////////////////////////////////////////////////////////////////////////
476
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.
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.
486     const Int_t   knbinz = 160;    // number of pixels along z direction.
487     Int_t i;
488     Float_t dx,dz,*binSizeX,*binSizeZ;
489
490     SetNbinX(knbinx); // default number of bins in x.
491     SetNbinZ(knbinz); // default number of bins in z.
492
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
500     binSizeZ[ 63] = kbinz1;
501     binSizeZ[ 64] = kbinz1;
502
503     binSizeZ[ 95] = kbinz1;
504     binSizeZ[ 96] = kbinz1;
505
506     binSizeZ[127] = kbinz1;
507     binSizeZ[128] = kbinz1;
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
517     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
518              par[0],par[1],par[2]);
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.");
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 //----------------------------------------------------------------------
530 ostream &operator<<(ostream &os,AliITSgeomSPD425Short &p){
531 ////////////////////////////////////////////////////////////////////////
532 // Standard output streaming function.
533 ////////////////////////////////////////////////////////////////////////
534
535     p.Print(&os);
536     return os;
537 }
538 //----------------------------------------------------------------------
539 istream &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$
551 Revision 1.17  2002/10/22 14:45:41  alibrary
552 Introducing Riostream.h
553
554 Revision 1.16  2002/10/14 14:57:00  hristov
555 Merging the VirtualMC branch to the main development branch (HEAD)
556
557 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
558 Merged with v3-08-02
559
560 Revision 1.15  2002/05/19 18:17:03  hristov
561 Changes needed by ICC/IFC compiler (Intel)
562
563 Revision 1.14  2001/10/19 21:32:35  nilsen
564 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
565 cleanded up a little bit of code.
566
567 Revision 1.13  2001/10/12 22:07:20  nilsen
568 A patch for C++ io manipulation functions so that they will work both
569 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
570 other platforms.
571
572 Revision 1.12  2001/08/24 21:06:37  nilsen
573 Added more documentation, fixed up some coding violations, and some
574 forward declorations.
575
576 Revision 1.11  2001/05/16 08:17:49  hristov
577 Bug 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
579 Revision 1.10  2001/04/26 22:44:34  nilsen
580 Bug fix.
581
582 Revision 1.9  2001/02/09 00:00:57  nilsen
583 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
584 bugs in iostream based streamers used to read and write .det files. Fixed
585 some detector sizes. Fixed bugs in some default-special constructors.
586
587 Revision 1.8  2001/02/03 00:00:30  nilsen
588 New version of AliITSgeom and related files. Now uses automatic streamers,
589 set up for new formatted .det file which includes detector information.
590 Additional smaller modifications are still to come.
591
592 Revision 1.7  2000/10/02 16:32:35  barbera
593 Forward declaration added
594
595 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
596 Forward declaration added
597
598 Revision 1.6  2000/07/10 16:07:18  fca
599 Release version of ITS code
600
601 Revision 1.4  2000/06/10 20:34:22  nilsen
602 Fixed compilation warning with HP unix.
603
604 Revision 1.3  2000/06/10 10:42:49  nilsen
605 Fixed bug in copy and operator =.
606
607
608 */
609
610 //#include "AliITSgeomSPD425Long.h"
611
612 ClassImp(AliITSgeomSPD425Long)
613
614 AliITSgeomSPD425Long::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.
631     const Int_t   knbinz = 192;    // number of pixels along z direction.
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
645     binSizeZ[ 63] = kbinz1;
646     binSizeZ[ 64] = kbinz1;
647
648     binSizeZ[ 95] = kbinz1;
649     binSizeZ[ 96] = kbinz1;
650
651     binSizeZ[127] = kbinz1;
652     binSizeZ[128] = kbinz1;
653
654     binSizeZ[159] = kbinz1;
655     binSizeZ[160] = kbinz1;
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);
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.");
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 //----------------------------------------------------------------------
677 ostream &operator<<(ostream &os,AliITSgeomSPD425Long &p){
678 ////////////////////////////////////////////////////////////////////////
679 // Standard output streaming function.
680 ////////////////////////////////////////////////////////////////////////
681
682     p.Print(&os);
683     return os;
684 }
685 //----------------------------------------------------------------------
686 istream &operator>>(istream &is,AliITSgeomSPD425Long &r){
687 ////////////////////////////////////////////////////////////////////////
688 // Standard input streaming function.
689 ////////////////////////////////////////////////////////////////////////
690
691     r.Read(&is);
692     return is;
693 }
694 //======================================================================