]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSgeomSDD.cxx
Introducing Riostream.h
[u/mrichter/AliRoot.git] / ITS / AliITSgeomSDD.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/14 14:57:00  hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
20
21 Revision 1.15.6.1  2002/06/10 17:51:15  hristov
22 Merged with v3-08-02
23
24 Revision 1.16  2002/05/19 18:17:03  hristov
25 Changes needed by ICC/IFC compiler (Intel)
26
27 Revision 1.15  2001/11/19 16:17:03  nilsen
28 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
29 bugs found by Rene require more work to fix. Will be fixed soon.
30
31 Revision 1.14  2001/10/19 21:32:35  nilsen
32 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
33 cleanded up a little bit of code.
34
35 Revision 1.13  2001/10/12 22:07:20  nilsen
36 A patch for C++ io manipulation functions so that they will work both
37 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
38 other platforms.
39
40 Revision 1.12  2001/08/24 21:06:37  nilsen
41 Added more documentation, fixed up some coding violations, and some
42 forward declorations.
43
44 Revision 1.11  2001/05/16 08:17:49  hristov
45 Bug fixed in the StepManager to account for the difference in the geometry 
46 tree for the ITS pixels. This fixes both the funny distribution of pixel 
47 coordinates and the missing hits/digits/points in many sectors of the ITS 
48 pixel barrel. Also included is a patch to properly get and use the detector 
49 dimensions through out the ITS code. (B.Nilsen)
50
51 Revision 1.10  2001/02/09 00:00:57  nilsen
52 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
53 bugs in iostream based streamers used to read and write .det files. Fixed
54 some detector sizes. Fixed bugs in some default-special constructors.
55
56 Revision 1.9  2001/02/03 00:00:30  nilsen
57 New version of AliITSgeom and related files. Now uses automatic streamers,
58 set up for new formatted .det file which includes detector information.
59 Additional smaller modifications are still to come.
60
61 Revision 1.8  2000/10/02 16:32:35  barbera
62 Forward declaration added
63
64 Revision 1.2.4.8  2000/10/02 15:52:05  barbera
65 Forward declaration added
66
67 Revision 1.7  2000/07/10 16:07:18  fca
68 Release version of ITS code
69
70 Revision 1.2.4.2  2000/03/04 23:55:35  nilsen
71 Fixed up comments/documentation.
72
73 Revision 1.2.4.1  2000/01/12 19:03:32  nilsen
74 This is the version of the files after the merging done in December 1999.
75 See the ReadMe110100.txt file for details
76
77 Revision 1.2  1999/09/29 09:24:20  fca
78 Introduction of the Copyright and cvs Log
79
80 */
81
82 ////////////////////////////////////////////////////////////////////////
83 // This class is for the Silicon Drift Detector, SDD, specific geometry.
84 // It is being replaced by AliITSsegmentationSDD class. This file also
85 // constains classes derived from AliITSgeomSDD which do nothing but
86 // initilize this one with predefined values.
87 ////////////////////////////////////////////////////////////////////////
88
89 #include <Riostream.h>
90 #include <stdlib.h>
91 #include <TShape.h>
92
93 #include "AliITSgeomSDD.h"
94
95 ClassImp(AliITSgeomSDD)
96 AliITSgeomSDD::AliITSgeomSDD(){
97 ////////////////////////////////////////////////////////////////////////
98 //    default constructor
99 ////////////////////////////////////////////////////////////////////////
100 //    const Float_t kDx = 3.500;//cm. (Geant 3.12 units) Orthonormal to y and z
101 //    const Float_t kDy = 0.014;//cm. (Geant 3.12 units) Radialy from the Beam
102 //    const Float_t kDz = 3.763;//cm. (Geant 3.12 units) Allong the Beam Pipe
103
104 //    cout << "AliITSgeomSDD default creator called: start" << endl;
105     fPeriod        = 0.0;
106     fDvelocity     = 0.0;
107     fNAnodesL      = 0;
108     fNAnodesR      = 0;
109     fAnodeXL       = 0.0;
110     fAnodeXR       = 0.0;
111     fAnodeLowEdgeL = 0;
112     fAnodeLowEdgeR = 0;
113     fShapeSDD      = 0;
114 //    cout << "AliITSgeomSDD default creator called: end" << endl;
115 }
116 //________________________________________________________________________
117 AliITSgeomSDD::AliITSgeomSDD(const Float_t *box,Float_t per,Float_t vel,
118                              Float_t axL,Float_t axR,
119                              Int_t nAL,Float_t *leL,
120                              Int_t nAR,Float_t *leR){
121 ////////////////////////////////////////////////////////////////////////
122 //    Standard constructor
123 ////////////////////////////////////////////////////////////////////////
124     fPeriod        = 0.0;
125     fDvelocity     = 0.0;
126     fNAnodesL      = 0;
127     fNAnodesR      = 0;
128     fAnodeXL       = 0.0;
129     fAnodeXR       = 0.0;
130     fAnodeLowEdgeL = 0;
131     fAnodeLowEdgeR = 0;
132     fShapeSDD      = 0;
133     ResetSDD(box,per,vel,axL,axR,nAL,leL,nAR,leR);
134 }
135 //________________________________________________________________________
136 void AliITSgeomSDD::ResetSDD(const Float_t *box,Float_t per,Float_t vel,
137                              Float_t axL,Float_t axR,
138                              Int_t nAL,Float_t *leL,
139                              Int_t nAR,Float_t *leR){
140 ////////////////////////////////////////////////////////////////////////
141 //    Standard Filler
142 ////////////////////////////////////////////////////////////////////////
143     Int_t i;
144
145     fPeriod        = per;
146     fDvelocity     = vel;
147     fNAnodesL      = nAL;
148     fNAnodesR      = nAR;
149     fAnodeXL       = axL;
150     fAnodeXR       = axR;
151 //    if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
152     fAnodeLowEdgeL = new Float_t[fNAnodesL];
153 //    if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
154     fAnodeLowEdgeR = new Float_t[fNAnodesR];
155     for(i=0;i<fNAnodesL;i++) fAnodeLowEdgeL[i] = leL[i];
156     for(i=0;i<fNAnodesR;i++) fAnodeLowEdgeR[i] = leR[i];
157     fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI DET",
158                                box[0],box[1],box[2]);
159 }
160 //________________________________________________________________________
161 AliITSgeomSDD::~AliITSgeomSDD(){
162 // Destructor
163
164     if(fShapeSDD!=0) delete fShapeSDD;
165     if(fAnodeLowEdgeL!=0) delete [] fAnodeLowEdgeL;
166     if(fAnodeLowEdgeR!=0) delete [] fAnodeLowEdgeR;
167     fShapeSDD  = 0;
168     fPeriod    = 0.0;
169     fDvelocity = 0.0;
170     fAnodeXL   = 0.0;
171     fAnodeXR   = 0.0;
172     fNAnodesL  = 0;
173     fNAnodesR  = 0;
174     fAnodeLowEdgeL = 0;
175     fAnodeLowEdgeR = 0;
176 }
177 //________________________________________________________________________
178 AliITSgeomSDD::AliITSgeomSDD(AliITSgeomSDD &source){
179     // Copy constructor
180     Int_t i;
181
182     if(this==&source) return;
183     this->fShapeSDD  = new TBRIK(*(source.fShapeSDD));
184     this->fPeriod    = source.fPeriod;
185     this->fDvelocity = source.fDvelocity;
186     this->fNAnodesL  = source.fNAnodesL;
187     this->fNAnodesR  = source.fNAnodesR;
188     this->fAnodeXL  = source.fAnodeXL;
189     this->fAnodeXR  = source.fAnodeXR;
190     if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
191     this->fAnodeLowEdgeL = new Float_t[fNAnodesL];
192     if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
193     this->fAnodeLowEdgeR = new Float_t[fNAnodesR];
194     for(i=0;i<fNAnodesL;i++)this->fAnodeLowEdgeL[i] = source.fAnodeLowEdgeL[i];
195     for(i=0;i<fNAnodesR;i++)this->fAnodeLowEdgeR[i] = source.fAnodeLowEdgeR[i];
196     return;
197 }
198 //________________________________________________________________________
199 AliITSgeomSDD& AliITSgeomSDD::operator=(AliITSgeomSDD &source){
200     // = operator
201     Int_t i;
202
203     if(this==&source) return *this;
204     this->fShapeSDD  = new TBRIK(*(source.fShapeSDD));
205     this->fPeriod    = source.fPeriod;
206     this->fDvelocity = source.fDvelocity;
207     this->fNAnodesL  = source.fNAnodesL;
208     this->fNAnodesR  = source.fNAnodesR;
209     this->fNAnodesR  = source.fNAnodesR;
210     this->fAnodeXL  = source.fAnodeXL;
211     this->fAnodeXR  = source.fAnodeXR;
212     if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
213     this->fAnodeLowEdgeL = new Float_t[fNAnodesL];
214     if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
215     this->fAnodeLowEdgeR = new Float_t[fNAnodesR];
216     for(i=0;i<fNAnodesL;i++)this->fAnodeLowEdgeL[i] = source.fAnodeLowEdgeL[i];
217     for(i=0;i<fNAnodesR;i++)this->fAnodeLowEdgeR[i] = source.fAnodeLowEdgeR[i];
218     return *this;
219 }
220 //______________________________________________________________________
221 void AliITSgeomSDD::Local2Det(Float_t xl,Float_t zl,Int_t &a,Int_t &t,Int_t &s){
222 // Give the local detector coordinate it returns the anode number, time
223 // bucket, and detector side.
224     Int_t i;
225
226     if(xl>0) {
227         if(zl<fAnodeLowEdgeR[0]) i=-1;
228         else for(i=0;i<fNAnodesR;i++) if(zl<fAnodeLowEdgeR[i]) break;
229         a = i;
230         s = 1;
231     } else if(xl<0){
232         if(zl<fAnodeLowEdgeL[0]) i=-1;
233         else for(i=0;i<fNAnodesL;i++) if(zl<fAnodeLowEdgeL[i]) break;
234         a = i;
235         s = 0;
236     } else { // x==0.
237         if(zl<fAnodeLowEdgeR[0]) i=-1;
238         else for(i=0;i<fNAnodesR;i++) if(zl<fAnodeLowEdgeR[i]) break;
239         a = i;
240         if(zl<fAnodeLowEdgeL[0]) i=-1;
241         else for(i=0;i<fNAnodesL;i++) if(zl<fAnodeLowEdgeL[i]) break;
242         s = -i;
243     } // end if
244     t = (Int_t)TMath::Abs((GetAnodeX(a,s)-xl)/fDvelocity/fPeriod);
245     return;
246 }
247 //______________________________________________________________________
248 void AliITSgeomSDD::Det2Local(Int_t a,Int_t t,Int_t s,Float_t &xl,Float_t &zl){
249 // Give the anode number, time bucket, and detector side, it returns the
250 // local detector coordinate.
251
252     zl = 0.5*GetAnodeZ(a,s);
253     if(s==0){
254         xl = GetAnodeX(a,s)+(t+0.5)*fPeriod*fDvelocity;
255     } else { // s==1
256         xl = GetAnodeX(a,s)-(t+0.5)*fPeriod*fDvelocity;
257     } // end if s==0;
258     return;
259 }
260 //______________________________________________________________________
261 void AliITSgeomSDD::Print(ostream *os) const {
262 ////////////////////////////////////////////////////////////////////////
263 // Standard output format for this class.
264 ////////////////////////////////////////////////////////////////////////
265     Int_t i;
266 #if defined __GNUC__
267 #if __GNUC__ > 2
268     ios::fmtflags fmt;
269 #else
270     Int_t fmt;
271 #endif
272 #else
273 #if defined __ICC
274     ios::fmtflags fmt;
275 #else
276     Int_t fmt;
277 #endif
278 #endif
279
280     fmt = os->setf(ios::scientific);  // set scientific floating point output
281     *os << "TBRIK" << " ";
282     *os << setprecision(16) << GetDx() << " ";
283     *os << setprecision(16) << GetDy() << " ";
284     *os << setprecision(16) << GetDz() << " ";
285     *os << setprecision(16) << fPeriod << " ";
286     *os << setprecision(16) << fDvelocity << " ";
287     *os << fNAnodesL << " ";
288     *os << fNAnodesR << " ";
289     *os << fAnodeXL << " ";
290     *os << fAnodeXR << " ";
291     for(i=0;i<fNAnodesL;i++) *os <<setprecision(16)<<fAnodeLowEdgeL[i]<< " ";
292     for(i=0;i<fNAnodesR;i++) *os <<setprecision(16)<<fAnodeLowEdgeR[i]<< " ";
293     *os << endl;
294     os->flags(fmt); // reset back to old formating.
295     return;
296 }
297 //______________________________________________________________________
298 void AliITSgeomSDD::Read(istream *is){
299 ////////////////////////////////////////////////////////////////////////
300 // Standard input format for this class.
301 ////////////////////////////////////////////////////////////////////////
302     Int_t i;
303     Float_t dx,dy,dz;
304     char shp[20];
305
306     *is >> shp;
307     *is >> dx >> dy >> dz;
308     if(fShapeSDD!=0) delete fShapeSDD;
309     fShapeSDD = new TBRIK("ActiveSDD","Active volume of SDD","SDD SI DET",
310                             dx,dy,dz);
311     *is >> fPeriod >> fDvelocity >> fNAnodesL >> fNAnodesR;
312     *is >> fAnodeXL >> fAnodeXR;
313     if(fAnodeLowEdgeL!=0) delete fAnodeLowEdgeL;
314     this->fAnodeLowEdgeL = new Float_t[fNAnodesL];
315     if(fAnodeLowEdgeR!=0) delete fAnodeLowEdgeR;
316     this->fAnodeLowEdgeR = new Float_t[fNAnodesR];
317     for(i=0;i<fNAnodesL;i++) *is >> fAnodeLowEdgeL[i];
318     for(i=0;i<fNAnodesR;i++) *is >> fAnodeLowEdgeR[i];
319     return;
320 }
321 //----------------------------------------------------------------------
322 ostream &operator<<(ostream &os,AliITSgeomSDD &p){
323 ////////////////////////////////////////////////////////////////////////
324 // Standard output streaming function.
325 ////////////////////////////////////////////////////////////////////////
326
327     p.Print(&os);
328     return os;
329 }
330 //----------------------------------------------------------------------
331 istream &operator>>(istream &is,AliITSgeomSDD &r){
332 ////////////////////////////////////////////////////////////////////////
333 // Standard input streaming function.
334 ////////////////////////////////////////////////////////////////////////
335
336     r.Read(&is);
337     return is;
338 }
339 //======================================================================
340 /*
341 $Log$
342 Revision 1.17  2002/10/14 14:57:00  hristov
343 Merging the VirtualMC branch to the main development branch (HEAD)
344
345 Revision 1.15.6.1  2002/06/10 17:51:15  hristov
346 Merged with v3-08-02
347
348 Revision 1.16  2002/05/19 18:17:03  hristov
349 Changes needed by ICC/IFC compiler (Intel)
350
351 Revision 1.15  2001/11/19 16:17:03  nilsen
352 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
353 bugs found by Rene require more work to fix. Will be fixed soon.
354
355 Revision 1.14  2001/10/19 21:32:35  nilsen
356 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
357 cleanded up a little bit of code.
358
359 Revision 1.13  2001/10/12 22:07:20  nilsen
360 A patch for C++ io manipulation functions so that they will work both
361 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
362 other platforms.
363
364 Revision 1.12  2001/08/24 21:06:37  nilsen
365 Added more documentation, fixed up some coding violations, and some
366 forward declorations.
367
368 Revision 1.11  2001/05/16 08:17:49  hristov
369 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)
370
371 Revision 1.10  2001/02/09 00:00:57  nilsen
372 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
373 bugs in iostream based streamers used to read and write .det files. Fixed
374 some detector sizes. Fixed bugs in some default-special constructors.
375
376 Revision 1.9  2001/02/03 00:00:30  nilsen
377 New version of AliITSgeom and related files. Now uses automatic streamers,
378 set up for new formatted .det file which includes detector information.
379 Additional smaller modifications are still to come.
380
381 */
382 //#include <Riostream.h>
383 //#include <TBRIK.h>
384
385 //#include "AliITSgeomSDD256.h"
386
387 ClassImp(AliITSgeomSDD256)
388
389 AliITSgeomSDD256::AliITSgeomSDD256() : AliITSgeomSDD(){
390     // Default Constructor
391 }
392 //----------------------------------------------------------------------
393 AliITSgeomSDD256::AliITSgeomSDD256(Int_t npar,const Float_t *par) : 
394     AliITSgeomSDD(){
395 ////////////////////////////////////////////////////////////////////////
396 //    constructor
397 /*
398 Pads for probe cards in ALICE-D2       /05.03.2000/
399 (X,Y) coordinates are quoted in microns and referred to the centers of 
400 bonding pads. (0, 0) corrispond to the center of the detector.
401 Convention: 
402 left is for negative X, right is for positive X;
403 DOWN half is for negative Y, UP half is for positive Y.
404
405 Detector size: X= 87588 micrometers; Y= 72500 micrometers. 
406 Detector corners:
407   LEFT UP: (-43794, 36250)
408 RIGHT UP:  (43794, 36250)
409  LEFT DOWN: (-43794, -36250)
410 RIGHT DOWN:  (43794, -36250)
411
412         Drift cathodes (n-side)
413
414 cathode #0 (Ubias) 
415 (-1477, 0), pad size (150, 60)
416    (875, 0), pad size (150, 60)
417 (-36570, 0), pad size (200, 70)
418 (-37570, 0), pad size (200, 70)
419 (36570, 0), pad size (200, 70)
420 (37570, 0), pad size (200, 70)
421
422 cathode #1 DOWN half 
423 (-1477, -120), pad size (150, 60)
424    (875, -120), pad size (150, 60)
425 (-36570, -120), pad size (200, 70)
426 (-37570, -120), pad size (200, 70)
427 (36570, -120), pad size (200, 70)
428 (37570, -120), pad size (200, 70)
429
430 cathode #2 DOWN half 
431 (-1477, -240), pad size (150, 60)
432    (875, -240), pad size (150, 60)
433 (-36570, -240), pad size (200, 70)
434 (-37570, -240), pad size (200, 70)
435 (36570, -240), pad size (200, 70)
436 (37570, -240), pad size (200, 70)
437
438 cathode #3 DOWN half 
439 (-1477, -360), pad size (150, 60)
440    (875, -360), pad size (150, 60)
441 (-36570, -360), pad size (200, 70)
442 (-37570, -360), pad size (200, 70)
443 (36570, -360), pad size (200, 70)
444 (37570, -360), pad size (200, 70)
445 .....................................
446 ......................................
447 ......................................
448 cathode #30 DOWN half
449 (-1477, -3600), pad size (150, 60)
450    (875, -3600), pad size (150, 60)
451 (-36570, -3600), pad size (200, 70)
452 (-37570, -3600), pad size (200, 70)
453 (36570, -3600), pad size (200, 70)
454 (37570, -3600), pad size (200, 70)
455 ...................................
456 cathode #60 DOWN half
457 (-1477, -7200), pad size (150, 60)
458    (875, -7200), pad size (150, 60)
459 (-36570, -7200), pad size (200, 70)
460 (-37570, -7200), pad size (200, 70)
461 (36570, -7200), pad size (200, 70)
462 (37570, -7200), pad size (200, 70)
463 ....................................
464 cathode #90 DOWN half
465 (-1477, -10800), pad size (150, 60)
466    (875, -10800), pad size (150, 60)
467 (-36570, -10800), pad size (200, 70)
468 (-37570, -10800), pad size (200, 70)
469 (36570, -10800), pad size (200, 70)
470 (37570, -10800), pad size (200, 70)
471 ....................................
472 cathode #120 DOWN half
473 (-1477, -14400), pad size (150, 60)
474    (875, -14400), pad size (150, 60)
475 (-36570, -14400), pad size (200, 70)
476 (-37570, -14400), pad size (200, 70)
477 (36570, -14400), pad size (200, 70)
478 (37570, -14400), pad size (200, 70)
479 ....................................
480 cathode #150 DOWN half
481 (-1477, -18000), pad size (150, 60)
482    (875, -18000), pad size (150, 60)
483 (-36570, -18000), pad size (200, 70)
484 (-37570, -18000), pad size (200, 70)
485 (36570, -18000), pad size (200, 70)
486 (37570, -18000), pad size (200, 70)
487 ....................................
488 cathode #180 DOWN half
489 (-1477, -21600), pad size (150, 60)
490    (875, -21600), pad size (150, 60)
491 (-36570, -21600), pad size (200, 70)
492 (-37570, -21600), pad size (200, 70)
493 (36570, -21600), pad size (200, 70)
494 (37570, -21600), pad size (200, 70)
495 ....................................
496 cathode #210 DOWN half
497 (-1477, -25200), pad size (150, 60)
498    (875, -25200), pad size (150, 60)
499 (-36570, -25200), pad size (200, 70)
500 (-37570, -25200), pad size (200, 70)
501 (36570, -25200), pad size (200, 70)
502 (37570, -25200), pad size (200, 70)
503 ....................................
504 cathode #240 DOWN half
505 (-1477, -28800), pad size (150, 60)
506    (875, -28800), pad size (150, 60)
507 (-36570, -28800), pad size (200, 70)
508 (-37570, -28800), pad size (200, 70)
509 (36570, -28800), pad size (200, 70)
510 (37570, -28800), pad size (200, 70)
511 ....................................
512 cathode #270 DOWN half
513 (-1477, -32400), pad size (150, 60)
514    (875, -32400), pad size (150, 60)
515 (-36570, -32400), pad size (200, 70)
516 (-37570, -32400), pad size (200, 70)
517 (36570, -32400), pad size (200, 70)
518 (37570, -32400), pad size (200, 70)
519 ....................................
520 cathode #290 DOWN half
521 (-1477, -34800), pad size (150, 60)
522    (875, -34800), pad size (150, 60)
523 (-36570, -34800), pad size (200, 70)
524 (-37570, -34800), pad size (200, 70)
525 (36570, -34800), pad size (200, 70)
526 (37570, -34800), pad size (200, 70)
527 ___________________________________________________
528 cathode #1 UP half 
529 (-1477, 120), pad size (150, 60)
530    (875, 120), pad size (150, 60)
531 (-36570, 120), pad size (200, 70)
532 (-37570, 120), pad size (200, 70)
533 (36570, 120), pad size (200, 70)
534 (37570, 120), pad size (200, 70)
535
536 cathode #2 UP half 
537 (-1477, 240), pad size (150, 60)
538    (875, 240), pad size (150, 60)
539 (-36570, 240), pad size (200, 70)
540 (-37570, 240), pad size (200, 70)
541 (36570, 240), pad size (200, 70)
542 (37570, 240), pad size (200, 70)
543
544 cathode #3 UP half 
545 (-1477, 360), pad size (150, 60)
546    (875, 360), pad size (150, 60)
547 (-36570, 360), pad size (200, 70)
548 (-37570, 360), pad size (200, 70)
549 (36570, 360), pad size (200, 70)
550 (37570, 360), pad size (200, 70)
551 .....................................
552 ......................................
553 ......................................
554 cathode #30 UP half
555 (-1477, 3600), pad size (150, 60)
556    (875, 3600), pad size (150, 60)
557 (-36570, 3600), pad size (200, 70)
558 (-37570, 3600), pad size (200, 70)
559 (36570, 3600), pad size (200, 70)
560 (37570, 3600), pad size (200, 70)
561 ......................................
562 cathode #60 UP half
563 (-1477, 7200), pad size (150, 60)
564    (875, 7200), pad size (150, 60)
565 (-36570, 7200), pad size (200, 70)
566 (-37570, 7200), pad size (200, 70)
567 (36570, 7200), pad size (200, 70)
568 (37570, 7200), pad size (200, 70)
569 ......................................
570 cathode #90 UP half
571 (-1477, 10800), pad size (150, 60)
572    (875, 10800), pad size (150, 60)
573 (-36570, 10800), pad size (200, 70)
574 (-37570, 10800), pad size (200, 70)
575 (36570, 10800), pad size (200, 70)
576 (37570, 10800), pad size (200, 70)
577 ......................................
578 cathode #120 UP half
579 (-1477, 14400), pad size (150, 60)
580    (875, 14400), pad size (150, 60)
581 (-36570, 14400), pad size (200, 70)
582 (-37570, 14400), pad size (200, 70)
583 (36570, 14400), pad size (200, 70)
584 (37570, 14400), pad size (200, 70)
585 ......................................
586 cathode #150 UP half
587 (-1477, 18000), pad size (150, 60)
588    (875, 18000), pad size (150, 60)
589 (-36570, 18000), pad size (200, 70)
590 (-37570, 18000), pad size (200, 70)
591 (36570, 18000), pad size (200, 70)
592 (37570, 18000), pad size (200, 70)
593 ......................................
594 cathode #180 UP half
595 (-1477, 21600), pad size (150, 60)
596    (875, 21600), pad size (150, 60)
597 (-36570, 21600), pad size (200, 70)
598 (-37570, 21600), pad size (200, 70)
599 (36570, 21600), pad size (200, 70)
600 (37570, 21600), pad size (200, 70)
601 ......................................
602 cathode #210 UP half
603 (-1477, 25200), pad size (150, 60)
604    (875, 25200), pad size (150, 60)
605 (-36570, 25200), pad size (200, 70)
606 (-37570, 25200), pad size (200, 70)
607 (36570, 25200), pad size (200, 70)
608 (37570, 25200), pad size (200, 70)
609 ......................................
610 cathode #240 UP half
611 (-1477, 28800), pad size (150, 60)
612    (875, 28800), pad size (150, 60)
613 (-36570, 28800), pad size (200, 70)
614 (-37570, 28800), pad size (200, 70)
615 (36570, 28800), pad size (200, 70)
616 (37570, 28800), pad size (200, 70)
617 ......................................
618 cathode #270 UP half
619 (-1477, 32400), pad size (150, 60)
620    (875, 32400), pad size (150, 60)
621 (-36570, 32400), pad size (200, 70)
622 (-37570, 32400), pad size (200, 70)
623 (36570, 32400), pad size (200, 70)
624 (37570, 32400), pad size (200, 70)
625 ......................................
626 cathode #290 UP half
627 (-1477, 34800), pad size (150, 60)
628    (875, 34800), pad size (150, 60)
629 (-36570, 34800), pad size (200, 70)
630 (-37570, 34800), pad size (200, 70)
631 (36570, 34800), pad size (200, 70)
632 (37570, 34800), pad size (200, 70)
633         Injectors (n-side)
634
635 Central line injectors (DOWN half)
636 (-1237, -660), pad size (150, 65)
637 (1115, -660), pad size (150, 65)
638 (37890, -660), pad size (100, 74)
639
640 Middle line injectors (DOWN half)
641 (-1237, -17460), pad size (150, 80)
642 (1115, -17460), pad size (150, 80)
643 (37890, -17460), pad size (100, 74)
644
645 Bottom line injectors (DOWN half)
646 (-1237, -34020), pad size (150, 80)
647 (1115, -34020), pad size (150, 80)
648 (37890, -34020), pad size (100, 74)
649 ___________________________________________
650 Central line injectors (UP half)
651 (-1237, 660), pad size (150, 65)
652 (1115, 660), pad size (150, 65)
653 (37890, 660), pad size (100, 74)
654
655 Middle line injectors (UP half)
656 (-1237, 17460), pad size (150, 80)
657 (1115, 17460), pad size (150, 80)
658 (37890, 17460), pad size (100, 74)
659
660 Bottom line injectors (UP half)
661 (-1237, 34020), pad size (150, 80)
662 (1115, 34020), pad size (150, 80)
663 (37890, 34020), pad size (100, 74)
664
665 Drift cathodes and injectors of p-side have the bonding pads with the same 
666 coordinates as for the n-side (when looking through the masks)
667
668         Cathodes of the collection zone (n-side)
669
670 cathode #291 (-40 V) DOWN half
671 (-38220, -35055), pad size (120, 160)
672 (38190, -34992), pad size (120, 145)
673
674 GRID cathode (-15 V) DOWN half
675 (-37988, -35085), pad size (144, 210)
676   (37988, -35085), pad size (144, 210)
677
678 cathode #292 (-30 V) DOWN half
679 (-38245, -35290), pad size (100, 170)
680 (38210, -35242), pad size (150, 215)
681
682 cathode #293 (-15 V) DOWN half
683 (-38055, -35460), pad size (690, 70)
684 (36488, -35460), pad size (3805, 70)
685
686 n+ bulk contact (GND) DOWN half
687 (-38300, -36050), pad size (1000, 395)
688 (38300, -36050), pad size (1000, 395)
689
690 bonding pad of the last integrated resistor DOWN half
691 /it has to be connected to the GND/
692 (-38190, -35620) pad size (160, 110)
693 ________________________________________________ 
694 cathode #291 (-40 V) UP half
695 (-38220, 35055), pad size (120, 160)
696 (38190, 34992), pad size (120, 145)
697
698 GRID cathode (-15 V) UP half
699 (-37988, 35085), pad size (144, 210)
700   (37988, 35085), pad size (144, 210)
701
702 cathode #292 (-30 V) UP half
703 (-38245, 35290), pad size (100, 170)
704 (38210, 35242), pad size (150, 215)
705
706 cathode #293 (-15 V) UP half
707 (-38055, 35460), pad size (690, 70)
708 (36488, 35460), pad size (3805, 70)
709
710 n+ bulk contact (GND) UP half
711 (-38300, 36050), pad size (1000, 395)
712 (38300, 36050), pad size (1000, 395)
713
714 bonding pad of the last integrated resistor UP half
715 /it has to be connected to the GND/
716 (-38190, 35620) pad size (160, 110)
717
718 Cathodes of the collection zone (p-side)
719
720 cathode #291 (-40 V) DOWN half
721 (-38215, -35055), pad size (120, 160)
722 (38190, -34992), pad size (120, 145)
723
724 cathode W1 (-60 V) DOWN half
725 (-38000, -35110), pad size (140, 240)
726  (38000, -35110), pad size (140, 240)
727
728 cathode W2 (-80 V) DOWN half
729 ( 0, -35090), pad size (75600, 110)
730
731 cathode #292 (-40 V) DOWN half
732 (-38220, -35290), pad size (150, 170)
733 (38210, -35242), pad size (150, 215)
734
735 p+ bulk contact (GND) DOWN half
736 (-38300, -36050), pad size (1000, 395)
737 (38300, -36050), pad size (1000, 395)
738
739 It is necessary to connect cathode #291 to cathode #292 in order to
740 close the integrated divider to p+ bulk contact (GND).
741
742 _______________________________________________
743 cathode #291 (-40 V) UP half
744 (-38215, 35055), pad size (120, 160)
745 (38190, 34992), pad size (120, 145)
746
747 cathode W1 (-60 V) UP half
748 (-38000, 35110), pad size (140, 240)
749  (38000, 35110), pad size (140, 240)
750
751 cathode W2 (-80 V) UP half
752 ( 0, 35090), pad size (75600, 110)
753
754 cathode #292 (-40 V) UP half
755 (-38220, 35290), pad size (150, 170)
756 (38210, 35242), pad size (150, 215)
757
758 p+ bulk contact (GND) UP half
759 (-38300, 36050), pad size (1000, 395)
760 (38300, 36050), pad size (1000, 395)
761
762 It is necessary to connect cathode #291 to cathode #292 in order to
763 close the integrated divider to p+ bulk contact (GND).
764
765         Anodes (n-side)
766 There are 256 anodes to be bonded to the inputs of front-end electronics. In 
767 addition there are 2 anodes (one at the left edge and one at the right edge 
768 of the anode array) that have to be bonded to the ground. I call these 2 
769 anodes #L and #R. The pitch of all anodes is 294 micrometers.
770
771                 DOWN half anodes
772 #L             (-37779, -35085), pad size (184, 140)
773 #1             (-37485, -35085), pad size (184, 140)
774 .........................................
775 .........................................
776 #256.............(37485, -35085), pad size (184, 140)
777 #R              (37779, -35085), pad size (184, 140)
778 _____________________________________________
779                 UP half anodes
780 #L             (-37779, 35085), pad size (184, 140)
781 #1             (-37485, 35085), pad size (184, 140)
782 .........................................
783 .........................................
784 #256.............(37485, 35085), pad size (184, 140)
785 #R              (37779, 35085), pad size (184, 140)
786 */
787 ////////////////////////////////////////////////////////////////////////
788 //   const Float_t kDxyz[]   = {3.6250,0.01499,4.3794};//cm. (Geant 3.12 units)
789                                       // Size of sensitive region of detector
790     const Float_t kPeriod   = 25.0E-09; // 40 MHz sampling frequence
791     const Float_t kVelocity = 5.46875E+03; // cm/s drift velocity
792     const Float_t kAnodeXL  = -3.5085; // cm location in x of anodes left side
793     const Float_t kAnodeXR  =  3.5085; // cm location in x of anodes right side
794     const Int_t   kNAnodes  = 256;  // nuber of anodes connected
795     const Float_t kAnodePitch = 0.0294; // cm
796     const Float_t kAnodesZ  = -3.7485; // cm Starting location of anodes in z
797     Float_t anodeLowEdges[kNAnodes+1];
798     Int_t i;
799
800 //    cout << "AliITSgeomSDD256 default creator called: start" << end;
801    anodeLowEdges[0] = kAnodesZ;
802     for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kAnodePitch+anodeLowEdges[i];
803     AliITSgeomSDD::ResetSDD(par,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
804                             kNAnodes+1,anodeLowEdges,
805                             kNAnodes+1,anodeLowEdges);
806 //    cout << "AliITSgeomSDD256 default creator called: end" << endl;
807 }
808 //________________________________________________________________________
809 ostream &operator<<(ostream &os,AliITSgeomSDD256 &p){
810 ////////////////////////////////////////////////////////////////////////
811 // Standard output streaming function.
812 ////////////////////////////////////////////////////////////////////////
813
814     p.Print(&os);
815     return os;
816 }
817 //----------------------------------------------------------------------
818 istream &operator>>(istream &is,AliITSgeomSDD256 &r){
819 ////////////////////////////////////////////////////////////////////////
820 // Standard input streaming function.
821 ////////////////////////////////////////////////////////////////////////
822
823     r.Read(&is);
824     return is;
825 }
826 //======================================================================
827 /*
828 $Log$
829 Revision 1.17  2002/10/14 14:57:00  hristov
830 Merging the VirtualMC branch to the main development branch (HEAD)
831
832 Revision 1.15.6.1  2002/06/10 17:51:15  hristov
833 Merged with v3-08-02
834
835 Revision 1.16  2002/05/19 18:17:03  hristov
836 Changes needed by ICC/IFC compiler (Intel)
837
838 Revision 1.15  2001/11/19 16:17:03  nilsen
839 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
840 bugs found by Rene require more work to fix. Will be fixed soon.
841
842 Revision 1.14  2001/10/19 21:32:35  nilsen
843 Minor changes to remove compliation warning on gcc 2.92.2 compiler, and
844 cleanded up a little bit of code.
845
846 Revision 1.13  2001/10/12 22:07:20  nilsen
847 A patch for C++ io manipulation functions so that they will work both
848 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
849 other platforms.
850
851 Revision 1.12  2001/08/24 21:06:37  nilsen
852 Added more documentation, fixed up some coding violations, and some
853 forward declorations.
854
855 Revision 1.11  2001/05/16 08:17:49  hristov
856 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)
857
858 Revision 1.10  2001/02/09 00:00:57  nilsen
859 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
860 bugs in iostream based streamers used to read and write .det files. Fixed
861 some detector sizes. Fixed bugs in some default-special constructors.
862
863 Revision 1.9  2001/02/03 00:00:30  nilsen
864 New version of AliITSgeom and related files. Now uses automatic streamers,
865 set up for new formatted .det file which includes detector information.
866 Additional smaller modifications are still to come.
867
868 */
869 //#include <Riostream.h>
870 //#include <TBRIK.h>
871
872 //#include "AliITSgeomSDD300.h"
873
874 ClassImp(AliITSgeomSDD300)
875
876 AliITSgeomSDD300::AliITSgeomSDD300() : AliITSgeomSDD(){
877 ////////////////////////////////////////////////////////////////////////
878 //    default constructor
879 ////////////////////////////////////////////////////////////////////////
880     const Float_t kDxyz[] = {3.500,0.014,3.763};//cm.
881     const Float_t kPeriod = 25.0E-09; // 40 MHz
882     const Float_t kVelocity = 5.46875E+3; // cm/s
883     const Int_t kNAnodes = 300; // number of anodes
884     const Float_t kAnodeXL = -3.500; // cm
885     const Float_t kAnodeXR = +3.500; // cm
886     const Float_t kAnodesZ = -3.75; // cm
887     Float_t anodeLowEdges[kNAnodes+1];
888     const Float_t kanode = 0.0250;// cm anode separation.
889     Int_t i;
890
891 //    cout << "AliITSgeomSDD300 default creator called: start" << endl;
892    anodeLowEdges[0] = kAnodesZ;
893     for(i=0;i<kNAnodes;i++)anodeLowEdges[i+1] = kanode+anodeLowEdges[i];
894     AliITSgeomSDD::ResetSDD(kDxyz,kPeriod,kVelocity,kAnodeXL,kAnodeXR,
895                             kNAnodes+1,anodeLowEdges,
896                             kNAnodes+1,anodeLowEdges);
897 //    cout << "AliITSgeomSDD300 default creator called: end" << endl;
898 }
899 //________________________________________________________________________
900 ostream &operator<<(ostream &os,AliITSgeomSDD300 &p){
901 ////////////////////////////////////////////////////////////////////////
902 // Standard output streaming function.
903 ////////////////////////////////////////////////////////////////////////
904
905     p.Print(&os);
906     return os;
907 }
908 //----------------------------------------------------------------------
909 istream &operator>>(istream &is,AliITSgeomSDD300 &r){
910 ////////////////////////////////////////////////////////////////////////
911 // Standard input streaming function.
912 ////////////////////////////////////////////////////////////////////////
913
914     r.Read(&is);
915     return is;
916 }
917 //----------------------------------------------------------------------