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