]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSgeomSPD.cxx
Add in missing set of {}'s.
[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.16  2002/10/14 14:57:00  hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
20
21 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
22 Merged with v3-08-02
23
24 Revision 1.15  2002/05/19 18:17:03  hristov
25 Changes needed by ICC/IFC compiler (Intel)
26
27 Revision 1.14  2001/10/19 21:32:35  nilsen
28 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
29 cleanded up a little bit of code.
30
31 Revision 1.13  2001/10/12 22:07:20  nilsen
32 A patch for C++ io manipulation functions so that they will work both
33 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
34 other platforms.
35
36 Revision 1.12  2001/08/24 21:06:37  nilsen
37 Added more documentation, fixed up some coding violations, and some
38 forward declorations.
39
40 Revision 1.11  2001/05/16 08:17:49  hristov
41 Bug fixed in the StepManager to account for the difference in the geometry 
42 tree for the ITS pixels. This fixes both the funny distribution of pixel 
43 coordinates and the missing hits/digits/points in many sectors of the ITS 
44 pixel barrel. Also included is a patch to properly get and use the detector 
45 dimensions through out the ITS code. (B.Nilsen)
46
47 Revision 1.10  2001/04/26 22:44:34  nilsen
48 Bug fix.
49
50 Revision 1.9  2001/02/09 00:00:57  nilsen
51 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
52 bugs in iostream based streamers used to read and write .det files. Fixed
53 some detector sizes. Fixed bugs in some default-special constructors.
54
55 Revision 1.8  2001/02/03 00:00:30  nilsen
56 New version of AliITSgeom and related files. Now uses automatic streamers,
57 set up for new formatted .det file which includes detector information.
58 Additional smaller modifications are still to come.
59
60 */
61
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
69 #include <Riostream.h>
70 #include <TShape.h>
71 #include <TMath.h>
72
73 #include "AliITSgeomSPD.h"
74
75 ClassImp(AliITSgeomSPD)
76
77 AliITSgeomSPD::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 //______________________________________________________________________
87 AliITSgeomSPD::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 //______________________________________________________________________
100 void 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 //______________________________________________________________________
128 AliITSgeomSPD::AliITSgeomSPD(AliITSgeomSPD &source){
129     // Copy constructor
130
131     *this = source; // just use the = operator for now.
132     return;
133 }
134 //______________________________________________________________________
135 AliITSgeomSPD& 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 //______________________________________________________________________
152 AliITSgeomSPD::~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 //______________________________________________________________________
165 void 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 //______________________________________________________________________
183 void 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 //______________________________________________________________________
195 void AliITSgeomSPD::Print(ostream *os) const {
196 // Standard output format for this class
197     Int_t i;
198 #if defined __GNUC__
199 #if __GNUC__ > 2
200     ios::fmtflags fmt;
201 #else
202     Int_t fmt;
203 #endif
204 #else
205 #if defined __ICC
206     ios::fmtflags fmt;
207 #else
208     Int_t fmt;
209 #endif
210 #endif
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] << " ";
219     for(i=0;i<fNbinz;i++) *os << setprecision(16) << fLowBinEdgeZ[i] << " ";
220     *os << endl;
221     os->flags(fmt);
222     return;
223 }
224 //______________________________________________________________________
225 void 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 //----------------------------------------------------------------------
247 ostream &operator<<(ostream &os,AliITSgeomSPD &p){
248 ////////////////////////////////////////////////////////////////////////
249 // Standard output streaming function.
250 ////////////////////////////////////////////////////////////////////////
251
252     p.Print(&os);
253     return os;
254 }
255 //----------------------------------------------------------------------
256 istream &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$
268 Revision 1.16  2002/10/14 14:57:00  hristov
269 Merging the VirtualMC branch to the main development branch (HEAD)
270
271 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
272 Merged with v3-08-02
273
274 Revision 1.15  2002/05/19 18:17:03  hristov
275 Changes needed by ICC/IFC compiler (Intel)
276
277 Revision 1.14  2001/10/19 21:32:35  nilsen
278 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
279 cleanded up a little bit of code.
280
281 Revision 1.13  2001/10/12 22:07:20  nilsen
282 A patch for C++ io manipulation functions so that they will work both
283 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
284 other platforms.
285
286 Revision 1.12  2001/08/24 21:06:37  nilsen
287 Added more documentation, fixed up some coding violations, and some
288 forward declorations.
289
290 Revision 1.11  2001/05/16 08:17:49  hristov
291 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)
292
293 Revision 1.10  2001/04/26 22:44:34  nilsen
294 Bug fix.
295
296 Revision 1.9  2001/02/09 00:00:57  nilsen
297 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
298 bugs in iostream based streamers used to read and write .det files. Fixed
299 some detector sizes. Fixed bugs in some default-special constructors.
300
301 Revision 1.8  2001/02/03 00:00:30  nilsen
302 New version of AliITSgeom and related files. Now uses automatic streamers,
303 set up for new formatted .det file which includes detector information.
304 Additional smaller modifications are still to come.
305
306 Revision 1.7  2000/10/02 16:32:35  barbera
307 Forward declaration added
308
309 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
310 Forward declaration added
311
312 Revision 1.6  2000/07/10 16:07:18  fca
313 Release version of ITS code
314
315 Revision 1.4  2000/06/10 20:34:37  nilsen
316 Fixed compilation warning with HP unix.
317
318 Revision 1.3  2000/06/10 10:43:04  nilsen
319 Fixed bug in copy and operator =.
320
321 */
322
323 //#include "AliITSgeomSPD300.h"
324
325 ClassImp(AliITSgeomSPD300)
326
327 AliITSgeomSPD300::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 ////////////////////////////////////////////////////////////////////////
333 const 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.
337 const Float_t kbinx0 = 0.0050; // cm; Standard pixel size in x direction.
338 const Int_t   knbinx = 256;    // number of pixels along x direction.
339 const Float_t kbinz0 = 0.0300; // cm; Standard pixel size in z direction.
340 const Float_t kbinz1 = 0.0350; // cm; Edge pixel size in z direction.
341 const 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
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.");
366     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",dx,kdy,dz);
367 //    cout << "AliITSgeomSPD300 default creator called: end" << endl;
368 }
369 //----------------------------------------------------------------------
370 ostream &operator<<(ostream &os,AliITSgeomSPD300 &p){
371 ////////////////////////////////////////////////////////////////////////
372 // Standard output streaming function.
373 ////////////////////////////////////////////////////////////////////////
374
375     p.Print(&os);
376     return os;
377 }
378 //----------------------------------------------------------------------
379 istream &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$
390 Revision 1.16  2002/10/14 14:57:00  hristov
391 Merging the VirtualMC branch to the main development branch (HEAD)
392
393 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
394 Merged with v3-08-02
395
396 Revision 1.15  2002/05/19 18:17:03  hristov
397 Changes needed by ICC/IFC compiler (Intel)
398
399 Revision 1.14  2001/10/19 21:32:35  nilsen
400 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
401 cleanded up a little bit of code.
402
403 Revision 1.13  2001/10/12 22:07:20  nilsen
404 A patch for C++ io manipulation functions so that they will work both
405 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
406 other platforms.
407
408 Revision 1.12  2001/08/24 21:06:37  nilsen
409 Added more documentation, fixed up some coding violations, and some
410 forward declorations.
411
412 Revision 1.11  2001/05/16 08:17:49  hristov
413 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)
414
415 Revision 1.10  2001/04/26 22:44:34  nilsen
416 Bug fix.
417
418 Revision 1.9  2001/02/09 00:00:57  nilsen
419 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
420 bugs in iostream based streamers used to read and write .det files. Fixed
421 some detector sizes. Fixed bugs in some default-special constructors.
422
423 Revision 1.8  2001/02/03 00:00:30  nilsen
424 New version of AliITSgeom and related files. Now uses automatic streamers,
425 set up for new formatted .det file which includes detector information.
426 Additional smaller modifications are still to come.
427
428 Revision 1.7  2000/10/02 16:32:35  barbera
429 Forward declaration added
430
431 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
432 Forward declaration added
433
434 Revision 1.6  2000/07/10 16:07:18  fca
435 Release version of ITS code
436
437 Revision 1.4  2000/06/10 20:34:22  nilsen
438 Fixed compilation warning with HP unix.
439
440 Revision 1.3  2000/06/10 10:42:49  nilsen
441 Fixed bug in copy and operator =.
442
443
444 */
445
446 //#include "AliITSgeomSPD425Short.h"
447
448 ClassImp(AliITSgeomSPD425Short)
449
450 AliITSgeomSPD425Short::AliITSgeomSPD425Short() : AliITSgeomSPD(){
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).
456 ////////////////////////////////////////////////////////////////////////
457 }
458 //----------------------------------------------------------------------
459 AliITSgeomSPD425Short::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).
466 ////////////////////////////////////////////////////////////////////////
467
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.
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.
477     const Int_t   knbinz = 160;    // number of pixels along z direction.
478     Int_t i;
479     Float_t dx,dz,*binSizeX,*binSizeZ;
480
481     SetNbinX(knbinx); // default number of bins in x.
482     SetNbinZ(knbinz); // default number of bins in z.
483
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
491     binSizeZ[ 63] = kbinz1;
492     binSizeZ[ 64] = kbinz1;
493
494     binSizeZ[ 95] = kbinz1;
495     binSizeZ[ 96] = kbinz1;
496
497     binSizeZ[127] = kbinz1;
498     binSizeZ[128] = kbinz1;
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
508     SetShape("ActiveSPD","Active volume of SPD","SPD SI DET",
509              par[0],par[1],par[2]);
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.");
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 //----------------------------------------------------------------------
521 ostream &operator<<(ostream &os,AliITSgeomSPD425Short &p){
522 ////////////////////////////////////////////////////////////////////////
523 // Standard output streaming function.
524 ////////////////////////////////////////////////////////////////////////
525
526     p.Print(&os);
527     return os;
528 }
529 //----------------------------------------------------------------------
530 istream &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$
542 Revision 1.16  2002/10/14 14:57:00  hristov
543 Merging the VirtualMC branch to the main development branch (HEAD)
544
545 Revision 1.14.6.1  2002/06/10 17:51:15  hristov
546 Merged with v3-08-02
547
548 Revision 1.15  2002/05/19 18:17:03  hristov
549 Changes needed by ICC/IFC compiler (Intel)
550
551 Revision 1.14  2001/10/19 21:32:35  nilsen
552 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
553 cleanded up a little bit of code.
554
555 Revision 1.13  2001/10/12 22:07:20  nilsen
556 A patch for C++ io manipulation functions so that they will work both
557 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
558 other platforms.
559
560 Revision 1.12  2001/08/24 21:06:37  nilsen
561 Added more documentation, fixed up some coding violations, and some
562 forward declorations.
563
564 Revision 1.11  2001/05/16 08:17:49  hristov
565 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)
566
567 Revision 1.10  2001/04/26 22:44:34  nilsen
568 Bug fix.
569
570 Revision 1.9  2001/02/09 00:00:57  nilsen
571 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
572 bugs in iostream based streamers used to read and write .det files. Fixed
573 some detector sizes. Fixed bugs in some default-special constructors.
574
575 Revision 1.8  2001/02/03 00:00:30  nilsen
576 New version of AliITSgeom and related files. Now uses automatic streamers,
577 set up for new formatted .det file which includes detector information.
578 Additional smaller modifications are still to come.
579
580 Revision 1.7  2000/10/02 16:32:35  barbera
581 Forward declaration added
582
583 Revision 1.1.2.8  2000/10/02 15:52:05  barbera
584 Forward declaration added
585
586 Revision 1.6  2000/07/10 16:07:18  fca
587 Release version of ITS code
588
589 Revision 1.4  2000/06/10 20:34:22  nilsen
590 Fixed compilation warning with HP unix.
591
592 Revision 1.3  2000/06/10 10:42:49  nilsen
593 Fixed bug in copy and operator =.
594
595
596 */
597
598 //#include "AliITSgeomSPD425Long.h"
599
600 ClassImp(AliITSgeomSPD425Long)
601
602 AliITSgeomSPD425Long::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.
619     const Int_t   knbinz = 192;    // number of pixels along z direction.
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
633     binSizeZ[ 63] = kbinz1;
634     binSizeZ[ 64] = kbinz1;
635
636     binSizeZ[ 95] = kbinz1;
637     binSizeZ[ 96] = kbinz1;
638
639     binSizeZ[127] = kbinz1;
640     binSizeZ[128] = kbinz1;
641
642     binSizeZ[159] = kbinz1;
643     binSizeZ[160] = kbinz1;
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);
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.");
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 //----------------------------------------------------------------------
665 ostream &operator<<(ostream &os,AliITSgeomSPD425Long &p){
666 ////////////////////////////////////////////////////////////////////////
667 // Standard output streaming function.
668 ////////////////////////////////////////////////////////////////////////
669
670     p.Print(&os);
671     return os;
672 }
673 //----------------------------------------------------------------------
674 istream &operator>>(istream &is,AliITSgeomSPD425Long &r){
675 ////////////////////////////////////////////////////////////////////////
676 // Standard input streaming function.
677 ////////////////////////////////////////////////////////////////////////
678
679     r.Read(&is);
680     return is;
681 }
682 //======================================================================