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.18 2002/12/03 09:03:06 hristov
19 Changes needed on Itanium (F.Carminati)
21 Revision 1.17 2002/10/22 14:45:41 alibrary
22 Introducing Riostream.h
24 Revision 1.16 2002/10/14 14:57:00 hristov
25 Merging the VirtualMC branch to the main development branch (HEAD)
27 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
30 Revision 1.15 2002/05/19 18:17:03 hristov
31 Changes needed by ICC/IFC compiler (Intel)
33 Revision 1.14 2001/11/19 16:17:03 nilsen
34 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
35 bugs found by Rene require more work to fix. Will be fixed soon.
37 Revision 1.13 2001/10/12 22:07:20 nilsen
38 A patch for C++ io manipulation functions so that they will work both
39 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
42 Revision 1.12 2001/08/24 21:06:37 nilsen
43 Added more documentation, fixed up some coding violations, and some
46 Revision 1.11 2001/05/16 08:17:49 hristov
47 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)
49 Revision 1.10 2001/02/09 00:00:57 nilsen
50 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
51 bugs in iostream based streamers used to read and write .det files. Fixed
52 some detector sizes. Fixed bugs in some default-special constructors.
54 Revision 1.9 2001/02/03 00:00:30 nilsen
55 New version of AliITSgeom and related files. Now uses automatic streamers,
56 set up for new formatted .det file which includes detector information.
57 Additional smaller modifications are still to come.
59 Revision 1.8 2000/10/02 16:32:43 barbera
60 Forward declaration added
62 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
63 Forward declaration added
65 Revision 1.7 2000/07/10 16:07:18 fca
66 Release version of ITS code
68 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
69 Fixed up the comments/documentation
71 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
72 This is the version of the files after the merging done in December 1999.
73 See the ReadMe110100.txt file for details
75 Revision 1.2 1999/09/29 09:24:20 fca
76 Introduction of the Copyright and cvs Log
80 ////////////////////////////////////////////////////////////////////////
81 // This class is for the Silicon Strip Detector, SSD, specific geometry.
82 // It is being replaced by AliITSsegmentationSSD class. This file also
83 // constains classes derived from AliITSgeomSSD which do nothing but
84 // initilize this one with predefined values.
85 ////////////////////////////////////////////////////////////////////////
87 #include <Riostream.h>
92 #include "AliITSgeomSSD.h"
94 ClassImp(AliITSgeomSSD)
97 AliITSgeomSSD::AliITSgeomSSD(){
98 // Default constructor
107 //----------------------------------------------------------------------
108 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
109 Int_t np,Float_t *p,Int_t nn,Float_t *n){
110 ////////////////////////////////////////////////////////////////////////
111 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
112 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
113 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
114 ///////////////////////////////////////////////////////////////////////
122 ResetSSD(box,ap,an,np,p,nn,n);
124 //----------------------------------------------------------------------
125 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
126 Int_t np,Float_t *p,Int_t nn,Float_t *n){
127 ////////////////////////////////////////////////////////////////////////
128 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
129 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
130 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
131 ///////////////////////////////////////////////////////////////////////
134 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
135 box[0],box[1],box[2]);
136 // if(fLowEdgeP!=0) delete fLowEdgeP;
137 // if(fLowEdgeN!=0) delete fLowEdgeN;
142 fLowEdgeP = new Float_t[fNp];
143 fLowEdgeN = new Float_t[fNn];
144 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
145 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
147 //______________________________________________________________________
148 AliITSgeomSSD::~AliITSgeomSSD(){
151 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
152 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
153 if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
159 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
160 ////////////////////////////////////////////////////////////////////////
162 ////////////////////////////////////////////////////////////////////////
165 if(this == &source) return;
166 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
167 this->fNp = source.fNp;
168 this->fNn = source.fNn;
171 this->fAngleP = source.fAngleP;
172 this->fAngleN = source.fAngleN;
173 fLowEdgeP = new Float_t[fNp];
174 fLowEdgeN = new Float_t[fNn];
175 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
176 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
180 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
181 ////////////////////////////////////////////////////////////////////////
182 // assignment operator
183 ////////////////////////////////////////////////////////////////////////
186 if(this == &source) return *this;
187 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
188 this->fNp = source.fNp;
189 this->fNn = source.fNn;
192 this->fAngleP = source.fAngleP;
193 this->fAngleN = source.fAngleN;
194 fLowEdgeP = new Float_t[fNp];
195 fLowEdgeN = new Float_t[fNn];
196 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
197 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
200 //______________________________________________________________________
201 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
202 // Given a GEANT detector local coordinate, cm, this function returns
203 // the detector specific P and N side strip numbers.
205 // Float_t x Geant detector local x coordinate in cm
206 // Float_t z Geant detector local z coordinate in cm
208 // Int_t &a Detector anode strip number (P side)
209 // Int_t &c Detector cathode strip number (N side)
213 // project on to bonding edges.
214 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
215 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
216 if(d<fLowEdgeP[0]) i=-1;
217 else for(i=0;i<fNp;i++){
218 if(fLowEdgeP[i]<d) break;
221 if(b<fLowEdgeN[0]) i=-1;
222 else for(i=0;i<fNn;i++){
223 if(fLowEdgeN[i]<b) break;
228 //______________________________________________________________________
229 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
235 //______________________________________________________________________
236 void AliITSgeomSSD::Print(ostream *os) const {
237 ////////////////////////////////////////////////////////////////////////
238 // Standard output format for this class.
239 ////////////////////////////////////////////////////////////////////////
248 #if defined __ICC || defined __ECC
255 fmt = os->setf(ios::scientific); // set scientific floating point output
256 *os << "TBRIK" << " ";
257 *os << setprecision(16) << GetDx() << " ";
258 *os << setprecision(16) << GetDy() << " ";
259 *os << setprecision(16) << GetDz() << " ";
260 *os << fNp << " " << fNn << " ";
261 *os << setprecision(16) << fAngleP << " ";
262 *os << setprecision(16) << fAngleN << " ";
263 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
264 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
266 os->flags(fmt); // reset back to old formating.
269 //______________________________________________________________________
270 void AliITSgeomSSD::Read(istream *is){
271 ////////////////////////////////////////////////////////////////////////
272 // Standard input format for this class.
273 ////////////////////////////////////////////////////////////////////////
279 *is >> dx >> dy >> dz;
280 if(fShapeSSD!=0) delete fShapeSSD;
281 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
284 *is >> fAngleP >> fAngleN;
285 if(fLowEdgeP !=0) delete fLowEdgeP;
286 if(fLowEdgeN !=0) delete fLowEdgeN;
287 fLowEdgeP = new Float_t[fNp];
288 fLowEdgeN = new Float_t[fNn];
289 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
290 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
293 //----------------------------------------------------------------------
294 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
295 ////////////////////////////////////////////////////////////////////////
296 // Standard output streaming function.
297 ////////////////////////////////////////////////////////////////////////
302 //----------------------------------------------------------------------
303 istream &operator>>(istream &is,AliITSgeomSSD &r){
304 ////////////////////////////////////////////////////////////////////////
305 // Standard input streaming function.
306 ////////////////////////////////////////////////////////////////////////
311 //======================================================================
314 Revision 1.18 2002/12/03 09:03:06 hristov
315 Changes needed on Itanium (F.Carminati)
317 Revision 1.17 2002/10/22 14:45:41 alibrary
318 Introducing Riostream.h
320 Revision 1.16 2002/10/14 14:57:00 hristov
321 Merging the VirtualMC branch to the main development branch (HEAD)
323 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
326 Revision 1.15 2002/05/19 18:17:03 hristov
327 Changes needed by ICC/IFC compiler (Intel)
329 Revision 1.14 2001/11/19 16:17:03 nilsen
330 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
331 bugs found by Rene require more work to fix. Will be fixed soon.
333 Revision 1.13 2001/10/12 22:07:20 nilsen
334 A patch for C++ io manipulation functions so that they will work both
335 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
338 Revision 1.12 2001/08/24 21:06:37 nilsen
339 Added more documentation, fixed up some coding violations, and some
340 forward declorations.
342 Revision 1.11 2001/05/16 08:17:49 hristov
343 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)
345 Revision 1.10 2001/02/09 00:00:57 nilsen
346 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
347 bugs in iostream based streamers used to read and write .det files. Fixed
348 some detector sizes. Fixed bugs in some default-special constructors.
350 Revision 1.9 2001/02/03 00:00:30 nilsen
351 New version of AliITSgeom and related files. Now uses automatic streamers,
352 set up for new formatted .det file which includes detector information.
353 Additional smaller modifications are still to come.
357 //#include "AliITSgeomSSD175.h"
359 ClassImp(AliITSgeomSSD175)
361 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
362 ////////////////////////////////////////////////////////////////////////
363 // default constructor
364 ////////////////////////////////////////////////////////////////////////
365 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
366 // Size of sensitive detector area x,y(thickness),z
367 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
368 const Float_t kpitch = 0.0095;// cm anode separation.
369 const Int_t kNstrips = 768; // number of anode or cathode strips.
370 Float_t *leA,*leC; // array of low edges anode and cathorde.
373 leA = new Float_t[kNstrips+1];
374 leC = new Float_t[kNstrips+1];
376 leA[1] = -kpitch*(0.5*kNstrips-1);
378 leC[1] = kpitch*(0.5*kNstrips-1);
379 for(i=1;i<kNstrips;i++){
380 leA[i+1] = leA[i] + kpitch;
381 leC[i+1] = leC[i] - kpitch;
383 leA[kNstrips] = kDxyz[0];
384 leC[kNstrips] = -kDxyz[0];
385 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
386 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
387 kNstrips+1,leA,kNstrips+1,leC);
390 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
392 //________________________________________________________________________
393 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
394 ////////////////////////////////////////////////////////////////////////
395 // Standard output streaming function.
396 ////////////////////////////////////////////////////////////////////////
401 //----------------------------------------------------------------------
402 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
403 ////////////////////////////////////////////////////////////////////////
404 // Standard input streaming function.
405 ////////////////////////////////////////////////////////////////////////
410 //======================================================================
413 Revision 1.18 2002/12/03 09:03:06 hristov
414 Changes needed on Itanium (F.Carminati)
416 Revision 1.17 2002/10/22 14:45:41 alibrary
417 Introducing Riostream.h
419 Revision 1.16 2002/10/14 14:57:00 hristov
420 Merging the VirtualMC branch to the main development branch (HEAD)
422 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
425 Revision 1.15 2002/05/19 18:17:03 hristov
426 Changes needed by ICC/IFC compiler (Intel)
428 Revision 1.14 2001/11/19 16:17:03 nilsen
429 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
430 bugs found by Rene require more work to fix. Will be fixed soon.
432 Revision 1.13 2001/10/12 22:07:20 nilsen
433 A patch for C++ io manipulation functions so that they will work both
434 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
437 Revision 1.12 2001/08/24 21:06:37 nilsen
438 Added more documentation, fixed up some coding violations, and some
439 forward declorations.
441 Revision 1.11 2001/05/16 08:17:49 hristov
442 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)
444 Revision 1.10 2001/02/09 00:00:57 nilsen
445 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
446 bugs in iostream based streamers used to read and write .det files. Fixed
447 some detector sizes. Fixed bugs in some default-special constructors.
449 Revision 1.9 2001/02/03 00:00:30 nilsen
450 New version of AliITSgeom and related files. Now uses automatic streamers,
451 set up for new formatted .det file which includes detector information.
452 Additional smaller modifications are still to come.
456 //#include "AliITSgeomSSD275and75.h"
458 ClassImp(AliITSgeomSSD275and75)
460 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
461 ////////////////////////////////////////////////////////////////////////
462 // default constructor
463 ////////////////////////////////////////////////////////////////////////
465 //----------------------------------------------------------------------
466 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
468 // Default constructor for AliITSgeomSSD with strip angles of
469 // 275 miliradians and 75 miliradians. This constructor initlizes
470 // AliITSgeomSSD with the correct values. This is the miror image
471 // of the AliITSgeomSSD75and275 class.
472 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
473 // Size of sensitive detector area x,y(thickness),z
474 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
475 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
476 const Float_t kpitch = 0.0095;// cm anode separation.
477 const Int_t kNstrips = 768; // number of anode or cathode strips.
478 Float_t *leA,*leC; // array of low edges anode and cathorde.
481 leA = new Float_t[kNstrips+1];
482 leC = new Float_t[kNstrips+1];
484 leA[1] = -kpitch*(0.5*kNstrips-1);
486 leC[1] = kpitch*(0.5*kNstrips-1);
487 for(i=1;i<kNstrips;i++){
488 leA[i+1] = leA[i] + kpitch;
489 leC[i+1] = leC[i] - kpitch;
491 leA[kNstrips] = kDxyz[0];
492 leC[kNstrips] = -kDxyz[0];
493 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
494 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
495 kNstrips+1,leA,kNstrips+1,leC);
498 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
500 //________________________________________________________________________
501 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
502 ////////////////////////////////////////////////////////////////////////
503 // Standard output streaming function.
504 ////////////////////////////////////////////////////////////////////////
509 //----------------------------------------------------------------------
510 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
511 ////////////////////////////////////////////////////////////////////////
512 // Standard input streaming function.
513 ////////////////////////////////////////////////////////////////////////
518 //======================================================================
521 Revision 1.18 2002/12/03 09:03:06 hristov
522 Changes needed on Itanium (F.Carminati)
524 Revision 1.17 2002/10/22 14:45:41 alibrary
525 Introducing Riostream.h
527 Revision 1.16 2002/10/14 14:57:00 hristov
528 Merging the VirtualMC branch to the main development branch (HEAD)
530 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
533 Revision 1.15 2002/05/19 18:17:03 hristov
534 Changes needed by ICC/IFC compiler (Intel)
536 Revision 1.14 2001/11/19 16:17:03 nilsen
537 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
538 bugs found by Rene require more work to fix. Will be fixed soon.
540 Revision 1.13 2001/10/12 22:07:20 nilsen
541 A patch for C++ io manipulation functions so that they will work both
542 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
545 Revision 1.12 2001/08/24 21:06:37 nilsen
546 Added more documentation, fixed up some coding violations, and some
547 forward declorations.
549 Revision 1.11 2001/05/16 08:17:49 hristov
550 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)
552 Revision 1.10 2001/02/09 00:00:57 nilsen
553 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
554 bugs in iostream based streamers used to read and write .det files. Fixed
555 some detector sizes. Fixed bugs in some default-special constructors.
557 Revision 1.9 2001/02/03 00:00:30 nilsen
558 New version of AliITSgeom and related files. Now uses automatic streamers,
559 set up for new formatted .det file which includes detector information.
560 Additional smaller modifications are still to come.
563 //#include "AliITSgeomSSD75and275.h"
565 ClassImp(AliITSgeomSSD75and275)
567 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
568 ////////////////////////////////////////////////////////////////////////
569 // default constructor
570 ////////////////////////////////////////////////////////////////////////
572 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
574 // Default constructor for AliITSgeomSSD with strip angles of
575 // 75 miliradians and 275 miliradians. This constructor initlizes
576 // AliITSgeomSSD with the correct values. This is the miror image
577 // of the AliITSgeomSSD275and75 class.
578 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
579 // Size of sensitive detector area x,y(thickness),z
580 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
581 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
582 const Float_t kpitch = 0.0095;// cm anode separation.
583 const Int_t kNstrips = 768; // number of anode or cathode strips.
584 Float_t *leA,*leC; // array of low edges anode and cathorde.
587 leA = new Float_t[kNstrips+1];
588 leC = new Float_t[kNstrips+1];
590 leA[1] = -kpitch*(0.5*kNstrips-1);
592 leC[1] = kpitch*(0.5*kNstrips-1);
593 for(i=1;i<kNstrips;i++){
594 leA[i+1] = leA[i] + kpitch;
595 leC[i+1] = leC[i] - kpitch;
597 leA[kNstrips] = kDxyz[0];
598 leC[kNstrips] = -kDxyz[0];
599 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
600 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
601 kNstrips+1,leA,kNstrips+1,leC);
604 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
606 //________________________________________________________________________
607 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
608 ////////////////////////////////////////////////////////////////////////
609 // Standard output streaming function.
610 ////////////////////////////////////////////////////////////////////////
615 //----------------------------------------------------------------------
616 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
617 ////////////////////////////////////////////////////////////////////////
618 // Standard input streaming function.
619 ////////////////////////////////////////////////////////////////////////
624 //======================================================================