1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.14 2001/11/19 16:17:03 nilsen
19 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
20 bugs found by Rene require more work to fix. Will be fixed soon.
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
27 Revision 1.12 2001/08/24 21:06:37 nilsen
28 Added more documentation, fixed up some coding violations, and some
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 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)
34 Revision 1.10 2001/02/09 00:00:57 nilsen
35 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
36 bugs in iostream based streamers used to read and write .det files. Fixed
37 some detector sizes. Fixed bugs in some default-special constructors.
39 Revision 1.9 2001/02/03 00:00:30 nilsen
40 New version of AliITSgeom and related files. Now uses automatic streamers,
41 set up for new formatted .det file which includes detector information.
42 Additional smaller modifications are still to come.
44 Revision 1.8 2000/10/02 16:32:43 barbera
45 Forward declaration added
47 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
48 Forward declaration added
50 Revision 1.7 2000/07/10 16:07:18 fca
51 Release version of ITS code
53 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
54 Fixed up the comments/documentation
56 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
57 This is the version of the files after the merging done in December 1999.
58 See the ReadMe110100.txt file for details
60 Revision 1.2 1999/09/29 09:24:20 fca
61 Introduction of the Copyright and cvs Log
65 ////////////////////////////////////////////////////////////////////////
66 // This class is for the Silicon Strip Detector, SSD, specific geometry.
67 // It is being replaced by AliITSsegmentationSSD class. This file also
68 // constains classes derived from AliITSgeomSSD which do nothing but
69 // initilize this one with predefined values.
70 ////////////////////////////////////////////////////////////////////////
78 #include "AliITSgeomSSD.h"
80 ClassImp(AliITSgeomSSD)
83 AliITSgeomSSD::AliITSgeomSSD(){
84 // Default constructor
93 //----------------------------------------------------------------------
94 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
95 Int_t np,Float_t *p,Int_t nn,Float_t *n){
96 ////////////////////////////////////////////////////////////////////////
97 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
98 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
99 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
100 ///////////////////////////////////////////////////////////////////////
108 ResetSSD(box,ap,an,np,p,nn,n);
110 //----------------------------------------------------------------------
111 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
112 Int_t np,Float_t *p,Int_t nn,Float_t *n){
113 ////////////////////////////////////////////////////////////////////////
114 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
115 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
116 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
117 ///////////////////////////////////////////////////////////////////////
120 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
121 box[0],box[1],box[2]);
122 // if(fLowEdgeP!=0) delete fLowEdgeP;
123 // if(fLowEdgeN!=0) delete fLowEdgeN;
128 fLowEdgeP = new Float_t[fNp];
129 fLowEdgeN = new Float_t[fNn];
130 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
131 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
133 //______________________________________________________________________
134 AliITSgeomSSD::~AliITSgeomSSD(){
137 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
138 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
139 if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
145 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
146 ////////////////////////////////////////////////////////////////////////
148 ////////////////////////////////////////////////////////////////////////
151 if(this == &source) return;
152 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
153 this->fNp = source.fNp;
154 this->fNn = source.fNn;
157 this->fAngleP = source.fAngleP;
158 this->fAngleN = source.fAngleN;
159 fLowEdgeP = new Float_t[fNp];
160 fLowEdgeN = new Float_t[fNn];
161 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
162 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
166 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
167 ////////////////////////////////////////////////////////////////////////
168 // assignment operator
169 ////////////////////////////////////////////////////////////////////////
172 if(this == &source) return *this;
173 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
174 this->fNp = source.fNp;
175 this->fNn = source.fNn;
178 this->fAngleP = source.fAngleP;
179 this->fAngleN = source.fAngleN;
180 fLowEdgeP = new Float_t[fNp];
181 fLowEdgeN = new Float_t[fNn];
182 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
183 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
186 //______________________________________________________________________
187 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
188 // Given a GEANT detector local coordinate, cm, this function returns
189 // the detector specific P and N side strip numbers.
191 // Float_t x Geant detector local x coordinate in cm
192 // Float_t z Geant detector local z coordinate in cm
194 // Int_t &a Detector anode strip number (P side)
195 // Int_t &c Detector cathode strip number (N side)
199 // project on to bonding edges.
200 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
201 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
202 if(d<fLowEdgeP[0]) i=-1;
203 else for(i=0;i<fNp;i++){
204 if(fLowEdgeP[i]<d) break;
207 if(b<fLowEdgeN[0]) i=-1;
208 else for(i=0;i<fNn;i++){
209 if(fLowEdgeN[i]<b) break;
214 //______________________________________________________________________
215 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
221 //______________________________________________________________________
222 void AliITSgeomSSD::Print(ostream *os) const {
223 ////////////////////////////////////////////////////////////////////////
224 // Standard output format for this class.
225 ////////////////////////////////////////////////////////////////////////
241 fmt = os->setf(ios::scientific); // set scientific floating point output
242 *os << "TBRIK" << " ";
243 *os << setprecision(16) << GetDx() << " ";
244 *os << setprecision(16) << GetDy() << " ";
245 *os << setprecision(16) << GetDz() << " ";
246 *os << fNp << " " << fNn << " ";
247 *os << setprecision(16) << fAngleP << " ";
248 *os << setprecision(16) << fAngleN << " ";
249 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
250 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
252 os->flags(fmt); // reset back to old formating.
255 //______________________________________________________________________
256 void AliITSgeomSSD::Read(istream *is){
257 ////////////////////////////////////////////////////////////////////////
258 // Standard input format for this class.
259 ////////////////////////////////////////////////////////////////////////
265 *is >> dx >> dy >> dz;
266 if(fShapeSSD!=0) delete fShapeSSD;
267 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
270 *is >> fAngleP >> fAngleN;
271 if(fLowEdgeP !=0) delete fLowEdgeP;
272 if(fLowEdgeN !=0) delete fLowEdgeN;
273 fLowEdgeP = new Float_t[fNp];
274 fLowEdgeN = new Float_t[fNn];
275 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
276 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
279 //----------------------------------------------------------------------
280 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
281 ////////////////////////////////////////////////////////////////////////
282 // Standard output streaming function.
283 ////////////////////////////////////////////////////////////////////////
288 //----------------------------------------------------------------------
289 istream &operator>>(istream &is,AliITSgeomSSD &r){
290 ////////////////////////////////////////////////////////////////////////
291 // Standard input streaming function.
292 ////////////////////////////////////////////////////////////////////////
297 //======================================================================
300 Revision 1.14 2001/11/19 16:17:03 nilsen
301 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
302 bugs found by Rene require more work to fix. Will be fixed soon.
304 Revision 1.13 2001/10/12 22:07:20 nilsen
305 A patch for C++ io manipulation functions so that they will work both
306 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
309 Revision 1.12 2001/08/24 21:06:37 nilsen
310 Added more documentation, fixed up some coding violations, and some
311 forward declorations.
313 Revision 1.11 2001/05/16 08:17:49 hristov
314 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)
316 Revision 1.10 2001/02/09 00:00:57 nilsen
317 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
318 bugs in iostream based streamers used to read and write .det files. Fixed
319 some detector sizes. Fixed bugs in some default-special constructors.
321 Revision 1.9 2001/02/03 00:00:30 nilsen
322 New version of AliITSgeom and related files. Now uses automatic streamers,
323 set up for new formatted .det file which includes detector information.
324 Additional smaller modifications are still to come.
328 //#include "AliITSgeomSSD175.h"
330 ClassImp(AliITSgeomSSD175)
332 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
333 ////////////////////////////////////////////////////////////////////////
334 // default constructor
335 ////////////////////////////////////////////////////////////////////////
336 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
337 // Size of sensitive detector area x,y(thickness),z
338 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
339 const Float_t kpitch = 0.0095;// cm anode separation.
340 const Int_t kNstrips = 768; // number of anode or cathode strips.
341 Float_t *leA,*leC; // array of low edges anode and cathorde.
344 leA = new Float_t[kNstrips+1];
345 leC = new Float_t[kNstrips+1];
347 leA[1] = -kpitch*(0.5*kNstrips-1);
349 leC[1] = kpitch*(0.5*kNstrips-1);
350 for(i=1;i<kNstrips;i++){
351 leA[i+1] = leA[i] + kpitch;
352 leC[i+1] = leC[i] - kpitch;
354 leA[kNstrips] = kDxyz[0];
355 leC[kNstrips] = -kDxyz[0];
356 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
357 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
358 kNstrips+1,leA,kNstrips+1,leC);
361 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
363 //________________________________________________________________________
364 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
365 ////////////////////////////////////////////////////////////////////////
366 // Standard output streaming function.
367 ////////////////////////////////////////////////////////////////////////
372 //----------------------------------------------------------------------
373 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
374 ////////////////////////////////////////////////////////////////////////
375 // Standard input streaming function.
376 ////////////////////////////////////////////////////////////////////////
381 //======================================================================
384 Revision 1.14 2001/11/19 16:17:03 nilsen
385 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
386 bugs found by Rene require more work to fix. Will be fixed soon.
388 Revision 1.13 2001/10/12 22:07:20 nilsen
389 A patch for C++ io manipulation functions so that they will work both
390 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
393 Revision 1.12 2001/08/24 21:06:37 nilsen
394 Added more documentation, fixed up some coding violations, and some
395 forward declorations.
397 Revision 1.11 2001/05/16 08:17:49 hristov
398 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)
400 Revision 1.10 2001/02/09 00:00:57 nilsen
401 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
402 bugs in iostream based streamers used to read and write .det files. Fixed
403 some detector sizes. Fixed bugs in some default-special constructors.
405 Revision 1.9 2001/02/03 00:00:30 nilsen
406 New version of AliITSgeom and related files. Now uses automatic streamers,
407 set up for new formatted .det file which includes detector information.
408 Additional smaller modifications are still to come.
412 //#include "AliITSgeomSSD275and75.h"
414 ClassImp(AliITSgeomSSD275and75)
416 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
417 ////////////////////////////////////////////////////////////////////////
418 // default constructor
419 ////////////////////////////////////////////////////////////////////////
421 //----------------------------------------------------------------------
422 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
424 // Default constructor for AliITSgeomSSD with strip angles of
425 // 275 miliradians and 75 miliradians. This constructor initlizes
426 // AliITSgeomSSD with the correct values. This is the miror image
427 // of the AliITSgeomSSD75and275 class.
428 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
429 // Size of sensitive detector area x,y(thickness),z
430 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
431 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
432 const Float_t kpitch = 0.0095;// cm anode separation.
433 const Int_t kNstrips = 768; // number of anode or cathode strips.
434 Float_t *leA,*leC; // array of low edges anode and cathorde.
437 leA = new Float_t[kNstrips+1];
438 leC = new Float_t[kNstrips+1];
440 leA[1] = -kpitch*(0.5*kNstrips-1);
442 leC[1] = kpitch*(0.5*kNstrips-1);
443 for(i=1;i<kNstrips;i++){
444 leA[i+1] = leA[i] + kpitch;
445 leC[i+1] = leC[i] - kpitch;
447 leA[kNstrips] = kDxyz[0];
448 leC[kNstrips] = -kDxyz[0];
449 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
450 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
451 kNstrips+1,leA,kNstrips+1,leC);
454 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
456 //________________________________________________________________________
457 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
458 ////////////////////////////////////////////////////////////////////////
459 // Standard output streaming function.
460 ////////////////////////////////////////////////////////////////////////
465 //----------------------------------------------------------------------
466 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
467 ////////////////////////////////////////////////////////////////////////
468 // Standard input streaming function.
469 ////////////////////////////////////////////////////////////////////////
474 //======================================================================
477 Revision 1.14 2001/11/19 16:17:03 nilsen
478 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
479 bugs found by Rene require more work to fix. Will be fixed soon.
481 Revision 1.13 2001/10/12 22:07:20 nilsen
482 A patch for C++ io manipulation functions so that they will work both
483 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
486 Revision 1.12 2001/08/24 21:06:37 nilsen
487 Added more documentation, fixed up some coding violations, and some
488 forward declorations.
490 Revision 1.11 2001/05/16 08:17:49 hristov
491 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)
493 Revision 1.10 2001/02/09 00:00:57 nilsen
494 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
495 bugs in iostream based streamers used to read and write .det files. Fixed
496 some detector sizes. Fixed bugs in some default-special constructors.
498 Revision 1.9 2001/02/03 00:00:30 nilsen
499 New version of AliITSgeom and related files. Now uses automatic streamers,
500 set up for new formatted .det file which includes detector information.
501 Additional smaller modifications are still to come.
504 //#include "AliITSgeomSSD75and275.h"
506 ClassImp(AliITSgeomSSD75and275)
508 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
509 ////////////////////////////////////////////////////////////////////////
510 // default constructor
511 ////////////////////////////////////////////////////////////////////////
513 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
515 // Default constructor for AliITSgeomSSD with strip angles of
516 // 75 miliradians and 275 miliradians. This constructor initlizes
517 // AliITSgeomSSD with the correct values. This is the miror image
518 // of the AliITSgeomSSD275and75 class.
519 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
520 // Size of sensitive detector area x,y(thickness),z
521 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
522 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
523 const Float_t kpitch = 0.0095;// cm anode separation.
524 const Int_t kNstrips = 768; // number of anode or cathode strips.
525 Float_t *leA,*leC; // array of low edges anode and cathorde.
528 leA = new Float_t[kNstrips+1];
529 leC = new Float_t[kNstrips+1];
531 leA[1] = -kpitch*(0.5*kNstrips-1);
533 leC[1] = kpitch*(0.5*kNstrips-1);
534 for(i=1;i<kNstrips;i++){
535 leA[i+1] = leA[i] + kpitch;
536 leC[i+1] = leC[i] - kpitch;
538 leA[kNstrips] = kDxyz[0];
539 leC[kNstrips] = -kDxyz[0];
540 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
541 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
542 kNstrips+1,leA,kNstrips+1,leC);
545 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
547 //________________________________________________________________________
548 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
549 ////////////////////////////////////////////////////////////////////////
550 // Standard output streaming function.
551 ////////////////////////////////////////////////////////////////////////
556 //----------------------------------------------------------------------
557 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
558 ////////////////////////////////////////////////////////////////////////
559 // Standard input streaming function.
560 ////////////////////////////////////////////////////////////////////////
565 //======================================================================