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.16 2002/10/14 14:57:00 hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
21 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
24 Revision 1.15 2002/05/19 18:17:03 hristov
25 Changes needed by ICC/IFC compiler (Intel)
27 Revision 1.14 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.
31 Revision 1.13 2001/10/12 22:07:20 nilsen
32 A patch for C++ io manipulation functions so that they will work both
33 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
36 Revision 1.12 2001/08/24 21:06:37 nilsen
37 Added more documentation, fixed up some coding violations, and some
40 Revision 1.11 2001/05/16 08:17:49 hristov
41 Bug fixed in the StepManager to account for the difference in the geometry 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)
43 Revision 1.10 2001/02/09 00:00:57 nilsen
44 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
45 bugs in iostream based streamers used to read and write .det files. Fixed
46 some detector sizes. Fixed bugs in some default-special constructors.
48 Revision 1.9 2001/02/03 00:00:30 nilsen
49 New version of AliITSgeom and related files. Now uses automatic streamers,
50 set up for new formatted .det file which includes detector information.
51 Additional smaller modifications are still to come.
53 Revision 1.8 2000/10/02 16:32:43 barbera
54 Forward declaration added
56 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
57 Forward declaration added
59 Revision 1.7 2000/07/10 16:07:18 fca
60 Release version of ITS code
62 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
63 Fixed up the comments/documentation
65 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
66 This is the version of the files after the merging done in December 1999.
67 See the ReadMe110100.txt file for details
69 Revision 1.2 1999/09/29 09:24:20 fca
70 Introduction of the Copyright and cvs Log
74 ////////////////////////////////////////////////////////////////////////
75 // This class is for the Silicon Strip Detector, SSD, specific geometry.
76 // It is being replaced by AliITSsegmentationSSD class. This file also
77 // constains classes derived from AliITSgeomSSD which do nothing but
78 // initilize this one with predefined values.
79 ////////////////////////////////////////////////////////////////////////
81 #include <Riostream.h>
86 #include "AliITSgeomSSD.h"
88 ClassImp(AliITSgeomSSD)
91 AliITSgeomSSD::AliITSgeomSSD(){
92 // Default constructor
101 //----------------------------------------------------------------------
102 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
103 Int_t np,Float_t *p,Int_t nn,Float_t *n){
104 ////////////////////////////////////////////////////////////////////////
105 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
106 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
107 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
108 ///////////////////////////////////////////////////////////////////////
116 ResetSSD(box,ap,an,np,p,nn,n);
118 //----------------------------------------------------------------------
119 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
120 Int_t np,Float_t *p,Int_t nn,Float_t *n){
121 ////////////////////////////////////////////////////////////////////////
122 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
123 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
124 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
125 ///////////////////////////////////////////////////////////////////////
128 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
129 box[0],box[1],box[2]);
130 // if(fLowEdgeP!=0) delete fLowEdgeP;
131 // if(fLowEdgeN!=0) delete fLowEdgeN;
136 fLowEdgeP = new Float_t[fNp];
137 fLowEdgeN = new Float_t[fNn];
138 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
139 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
141 //______________________________________________________________________
142 AliITSgeomSSD::~AliITSgeomSSD(){
145 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
146 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
147 if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
153 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
154 ////////////////////////////////////////////////////////////////////////
156 ////////////////////////////////////////////////////////////////////////
159 if(this == &source) return;
160 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
161 this->fNp = source.fNp;
162 this->fNn = source.fNn;
165 this->fAngleP = source.fAngleP;
166 this->fAngleN = source.fAngleN;
167 fLowEdgeP = new Float_t[fNp];
168 fLowEdgeN = new Float_t[fNn];
169 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
170 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
174 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
175 ////////////////////////////////////////////////////////////////////////
176 // assignment operator
177 ////////////////////////////////////////////////////////////////////////
180 if(this == &source) return *this;
181 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
182 this->fNp = source.fNp;
183 this->fNn = source.fNn;
186 this->fAngleP = source.fAngleP;
187 this->fAngleN = source.fAngleN;
188 fLowEdgeP = new Float_t[fNp];
189 fLowEdgeN = new Float_t[fNn];
190 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
191 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
194 //______________________________________________________________________
195 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
196 // Given a GEANT detector local coordinate, cm, this function returns
197 // the detector specific P and N side strip numbers.
199 // Float_t x Geant detector local x coordinate in cm
200 // Float_t z Geant detector local z coordinate in cm
202 // Int_t &a Detector anode strip number (P side)
203 // Int_t &c Detector cathode strip number (N side)
207 // project on to bonding edges.
208 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
209 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
210 if(d<fLowEdgeP[0]) i=-1;
211 else for(i=0;i<fNp;i++){
212 if(fLowEdgeP[i]<d) break;
215 if(b<fLowEdgeN[0]) i=-1;
216 else for(i=0;i<fNn;i++){
217 if(fLowEdgeN[i]<b) break;
222 //______________________________________________________________________
223 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
229 //______________________________________________________________________
230 void AliITSgeomSSD::Print(ostream *os) const {
231 ////////////////////////////////////////////////////////////////////////
232 // Standard output format for this class.
233 ////////////////////////////////////////////////////////////////////////
249 fmt = os->setf(ios::scientific); // set scientific floating point output
250 *os << "TBRIK" << " ";
251 *os << setprecision(16) << GetDx() << " ";
252 *os << setprecision(16) << GetDy() << " ";
253 *os << setprecision(16) << GetDz() << " ";
254 *os << fNp << " " << fNn << " ";
255 *os << setprecision(16) << fAngleP << " ";
256 *os << setprecision(16) << fAngleN << " ";
257 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
258 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
260 os->flags(fmt); // reset back to old formating.
263 //______________________________________________________________________
264 void AliITSgeomSSD::Read(istream *is){
265 ////////////////////////////////////////////////////////////////////////
266 // Standard input format for this class.
267 ////////////////////////////////////////////////////////////////////////
273 *is >> dx >> dy >> dz;
274 if(fShapeSSD!=0) delete fShapeSSD;
275 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
278 *is >> fAngleP >> fAngleN;
279 if(fLowEdgeP !=0) delete fLowEdgeP;
280 if(fLowEdgeN !=0) delete fLowEdgeN;
281 fLowEdgeP = new Float_t[fNp];
282 fLowEdgeN = new Float_t[fNn];
283 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
284 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
287 //----------------------------------------------------------------------
288 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
289 ////////////////////////////////////////////////////////////////////////
290 // Standard output streaming function.
291 ////////////////////////////////////////////////////////////////////////
296 //----------------------------------------------------------------------
297 istream &operator>>(istream &is,AliITSgeomSSD &r){
298 ////////////////////////////////////////////////////////////////////////
299 // Standard input streaming function.
300 ////////////////////////////////////////////////////////////////////////
305 //======================================================================
308 Revision 1.16 2002/10/14 14:57:00 hristov
309 Merging the VirtualMC branch to the main development branch (HEAD)
311 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
314 Revision 1.15 2002/05/19 18:17:03 hristov
315 Changes needed by ICC/IFC compiler (Intel)
317 Revision 1.14 2001/11/19 16:17:03 nilsen
318 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
319 bugs found by Rene require more work to fix. Will be fixed soon.
321 Revision 1.13 2001/10/12 22:07:20 nilsen
322 A patch for C++ io manipulation functions so that they will work both
323 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
326 Revision 1.12 2001/08/24 21:06:37 nilsen
327 Added more documentation, fixed up some coding violations, and some
328 forward declorations.
330 Revision 1.11 2001/05/16 08:17:49 hristov
331 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)
333 Revision 1.10 2001/02/09 00:00:57 nilsen
334 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
335 bugs in iostream based streamers used to read and write .det files. Fixed
336 some detector sizes. Fixed bugs in some default-special constructors.
338 Revision 1.9 2001/02/03 00:00:30 nilsen
339 New version of AliITSgeom and related files. Now uses automatic streamers,
340 set up for new formatted .det file which includes detector information.
341 Additional smaller modifications are still to come.
345 //#include "AliITSgeomSSD175.h"
347 ClassImp(AliITSgeomSSD175)
349 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
350 ////////////////////////////////////////////////////////////////////////
351 // default constructor
352 ////////////////////////////////////////////////////////////////////////
353 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
354 // Size of sensitive detector area x,y(thickness),z
355 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
356 const Float_t kpitch = 0.0095;// cm anode separation.
357 const Int_t kNstrips = 768; // number of anode or cathode strips.
358 Float_t *leA,*leC; // array of low edges anode and cathorde.
361 leA = new Float_t[kNstrips+1];
362 leC = new Float_t[kNstrips+1];
364 leA[1] = -kpitch*(0.5*kNstrips-1);
366 leC[1] = kpitch*(0.5*kNstrips-1);
367 for(i=1;i<kNstrips;i++){
368 leA[i+1] = leA[i] + kpitch;
369 leC[i+1] = leC[i] - kpitch;
371 leA[kNstrips] = kDxyz[0];
372 leC[kNstrips] = -kDxyz[0];
373 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
374 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
375 kNstrips+1,leA,kNstrips+1,leC);
378 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
380 //________________________________________________________________________
381 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
382 ////////////////////////////////////////////////////////////////////////
383 // Standard output streaming function.
384 ////////////////////////////////////////////////////////////////////////
389 //----------------------------------------------------------------------
390 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
391 ////////////////////////////////////////////////////////////////////////
392 // Standard input streaming function.
393 ////////////////////////////////////////////////////////////////////////
398 //======================================================================
401 Revision 1.16 2002/10/14 14:57:00 hristov
402 Merging the VirtualMC branch to the main development branch (HEAD)
404 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
407 Revision 1.15 2002/05/19 18:17:03 hristov
408 Changes needed by ICC/IFC compiler (Intel)
410 Revision 1.14 2001/11/19 16:17:03 nilsen
411 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
412 bugs found by Rene require more work to fix. Will be fixed soon.
414 Revision 1.13 2001/10/12 22:07:20 nilsen
415 A patch for C++ io manipulation functions so that they will work both
416 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
419 Revision 1.12 2001/08/24 21:06:37 nilsen
420 Added more documentation, fixed up some coding violations, and some
421 forward declorations.
423 Revision 1.11 2001/05/16 08:17:49 hristov
424 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)
426 Revision 1.10 2001/02/09 00:00:57 nilsen
427 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
428 bugs in iostream based streamers used to read and write .det files. Fixed
429 some detector sizes. Fixed bugs in some default-special constructors.
431 Revision 1.9 2001/02/03 00:00:30 nilsen
432 New version of AliITSgeom and related files. Now uses automatic streamers,
433 set up for new formatted .det file which includes detector information.
434 Additional smaller modifications are still to come.
438 //#include "AliITSgeomSSD275and75.h"
440 ClassImp(AliITSgeomSSD275and75)
442 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
443 ////////////////////////////////////////////////////////////////////////
444 // default constructor
445 ////////////////////////////////////////////////////////////////////////
447 //----------------------------------------------------------------------
448 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
450 // Default constructor for AliITSgeomSSD with strip angles of
451 // 275 miliradians and 75 miliradians. This constructor initlizes
452 // AliITSgeomSSD with the correct values. This is the miror image
453 // of the AliITSgeomSSD75and275 class.
454 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
455 // Size of sensitive detector area x,y(thickness),z
456 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
457 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
458 const Float_t kpitch = 0.0095;// cm anode separation.
459 const Int_t kNstrips = 768; // number of anode or cathode strips.
460 Float_t *leA,*leC; // array of low edges anode and cathorde.
463 leA = new Float_t[kNstrips+1];
464 leC = new Float_t[kNstrips+1];
466 leA[1] = -kpitch*(0.5*kNstrips-1);
468 leC[1] = kpitch*(0.5*kNstrips-1);
469 for(i=1;i<kNstrips;i++){
470 leA[i+1] = leA[i] + kpitch;
471 leC[i+1] = leC[i] - kpitch;
473 leA[kNstrips] = kDxyz[0];
474 leC[kNstrips] = -kDxyz[0];
475 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
476 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
477 kNstrips+1,leA,kNstrips+1,leC);
480 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
482 //________________________________________________________________________
483 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
484 ////////////////////////////////////////////////////////////////////////
485 // Standard output streaming function.
486 ////////////////////////////////////////////////////////////////////////
491 //----------------------------------------------------------------------
492 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
493 ////////////////////////////////////////////////////////////////////////
494 // Standard input streaming function.
495 ////////////////////////////////////////////////////////////////////////
500 //======================================================================
503 Revision 1.16 2002/10/14 14:57:00 hristov
504 Merging the VirtualMC branch to the main development branch (HEAD)
506 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
509 Revision 1.15 2002/05/19 18:17:03 hristov
510 Changes needed by ICC/IFC compiler (Intel)
512 Revision 1.14 2001/11/19 16:17:03 nilsen
513 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
514 bugs found by Rene require more work to fix. Will be fixed soon.
516 Revision 1.13 2001/10/12 22:07:20 nilsen
517 A patch for C++ io manipulation functions so that they will work both
518 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
521 Revision 1.12 2001/08/24 21:06:37 nilsen
522 Added more documentation, fixed up some coding violations, and some
523 forward declorations.
525 Revision 1.11 2001/05/16 08:17:49 hristov
526 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)
528 Revision 1.10 2001/02/09 00:00:57 nilsen
529 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
530 bugs in iostream based streamers used to read and write .det files. Fixed
531 some detector sizes. Fixed bugs in some default-special constructors.
533 Revision 1.9 2001/02/03 00:00:30 nilsen
534 New version of AliITSgeom and related files. Now uses automatic streamers,
535 set up for new formatted .det file which includes detector information.
536 Additional smaller modifications are still to come.
539 //#include "AliITSgeomSSD75and275.h"
541 ClassImp(AliITSgeomSSD75and275)
543 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
544 ////////////////////////////////////////////////////////////////////////
545 // default constructor
546 ////////////////////////////////////////////////////////////////////////
548 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
550 // Default constructor for AliITSgeomSSD with strip angles of
551 // 75 miliradians and 275 miliradians. This constructor initlizes
552 // AliITSgeomSSD with the correct values. This is the miror image
553 // of the AliITSgeomSSD275and75 class.
554 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
555 // Size of sensitive detector area x,y(thickness),z
556 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
557 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
558 const Float_t kpitch = 0.0095;// cm anode separation.
559 const Int_t kNstrips = 768; // number of anode or cathode strips.
560 Float_t *leA,*leC; // array of low edges anode and cathorde.
563 leA = new Float_t[kNstrips+1];
564 leC = new Float_t[kNstrips+1];
566 leA[1] = -kpitch*(0.5*kNstrips-1);
568 leC[1] = kpitch*(0.5*kNstrips-1);
569 for(i=1;i<kNstrips;i++){
570 leA[i+1] = leA[i] + kpitch;
571 leC[i+1] = leC[i] - kpitch;
573 leA[kNstrips] = kDxyz[0];
574 leC[kNstrips] = -kDxyz[0];
575 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
576 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
577 kNstrips+1,leA,kNstrips+1,leC);
580 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
582 //________________________________________________________________________
583 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
584 ////////////////////////////////////////////////////////////////////////
585 // Standard output streaming function.
586 ////////////////////////////////////////////////////////////////////////
591 //----------------------------------------------------------------------
592 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
593 ////////////////////////////////////////////////////////////////////////
594 // Standard input streaming function.
595 ////////////////////////////////////////////////////////////////////////
600 //======================================================================