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.6.1 2002/06/10 17:51:15 hristov
21 Revision 1.15 2002/05/19 18:17:03 hristov
22 Changes needed by ICC/IFC compiler (Intel)
24 Revision 1.14 2001/11/19 16:17:03 nilsen
25 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
26 bugs found by Rene require more work to fix. Will be fixed soon.
28 Revision 1.13 2001/10/12 22:07:20 nilsen
29 A patch for C++ io manipulation functions so that they will work both
30 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
33 Revision 1.12 2001/08/24 21:06:37 nilsen
34 Added more documentation, fixed up some coding violations, and some
37 Revision 1.11 2001/05/16 08:17:49 hristov
38 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)
40 Revision 1.10 2001/02/09 00:00:57 nilsen
41 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
42 bugs in iostream based streamers used to read and write .det files. Fixed
43 some detector sizes. Fixed bugs in some default-special constructors.
45 Revision 1.9 2001/02/03 00:00:30 nilsen
46 New version of AliITSgeom and related files. Now uses automatic streamers,
47 set up for new formatted .det file which includes detector information.
48 Additional smaller modifications are still to come.
50 Revision 1.8 2000/10/02 16:32:43 barbera
51 Forward declaration added
53 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
54 Forward declaration added
56 Revision 1.7 2000/07/10 16:07:18 fca
57 Release version of ITS code
59 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
60 Fixed up the comments/documentation
62 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
63 This is the version of the files after the merging done in December 1999.
64 See the ReadMe110100.txt file for details
66 Revision 1.2 1999/09/29 09:24:20 fca
67 Introduction of the Copyright and cvs Log
71 ////////////////////////////////////////////////////////////////////////
72 // This class is for the Silicon Strip Detector, SSD, specific geometry.
73 // It is being replaced by AliITSsegmentationSSD class. This file also
74 // constains classes derived from AliITSgeomSSD which do nothing but
75 // initilize this one with predefined values.
76 ////////////////////////////////////////////////////////////////////////
84 #include "AliITSgeomSSD.h"
86 ClassImp(AliITSgeomSSD)
89 AliITSgeomSSD::AliITSgeomSSD(){
90 // Default constructor
99 //----------------------------------------------------------------------
100 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
101 Int_t np,Float_t *p,Int_t nn,Float_t *n){
102 ////////////////////////////////////////////////////////////////////////
103 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
104 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
105 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
106 ///////////////////////////////////////////////////////////////////////
114 ResetSSD(box,ap,an,np,p,nn,n);
116 //----------------------------------------------------------------------
117 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
118 Int_t np,Float_t *p,Int_t nn,Float_t *n){
119 ////////////////////////////////////////////////////////////////////////
120 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
121 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
122 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
123 ///////////////////////////////////////////////////////////////////////
126 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
127 box[0],box[1],box[2]);
128 // if(fLowEdgeP!=0) delete fLowEdgeP;
129 // if(fLowEdgeN!=0) delete fLowEdgeN;
134 fLowEdgeP = new Float_t[fNp];
135 fLowEdgeN = new Float_t[fNn];
136 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
137 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
139 //______________________________________________________________________
140 AliITSgeomSSD::~AliITSgeomSSD(){
143 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
144 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
145 if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
151 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
152 ////////////////////////////////////////////////////////////////////////
154 ////////////////////////////////////////////////////////////////////////
157 if(this == &source) return;
158 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
159 this->fNp = source.fNp;
160 this->fNn = source.fNn;
163 this->fAngleP = source.fAngleP;
164 this->fAngleN = source.fAngleN;
165 fLowEdgeP = new Float_t[fNp];
166 fLowEdgeN = new Float_t[fNn];
167 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
168 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
172 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
173 ////////////////////////////////////////////////////////////////////////
174 // assignment operator
175 ////////////////////////////////////////////////////////////////////////
178 if(this == &source) return *this;
179 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
180 this->fNp = source.fNp;
181 this->fNn = source.fNn;
184 this->fAngleP = source.fAngleP;
185 this->fAngleN = source.fAngleN;
186 fLowEdgeP = new Float_t[fNp];
187 fLowEdgeN = new Float_t[fNn];
188 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
189 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
192 //______________________________________________________________________
193 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
194 // Given a GEANT detector local coordinate, cm, this function returns
195 // the detector specific P and N side strip numbers.
197 // Float_t x Geant detector local x coordinate in cm
198 // Float_t z Geant detector local z coordinate in cm
200 // Int_t &a Detector anode strip number (P side)
201 // Int_t &c Detector cathode strip number (N side)
205 // project on to bonding edges.
206 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
207 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
208 if(d<fLowEdgeP[0]) i=-1;
209 else for(i=0;i<fNp;i++){
210 if(fLowEdgeP[i]<d) break;
213 if(b<fLowEdgeN[0]) i=-1;
214 else for(i=0;i<fNn;i++){
215 if(fLowEdgeN[i]<b) break;
220 //______________________________________________________________________
221 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
227 //______________________________________________________________________
228 void AliITSgeomSSD::Print(ostream *os) const {
229 ////////////////////////////////////////////////////////////////////////
230 // Standard output format for this class.
231 ////////////////////////////////////////////////////////////////////////
247 fmt = os->setf(ios::scientific); // set scientific floating point output
248 *os << "TBRIK" << " ";
249 *os << setprecision(16) << GetDx() << " ";
250 *os << setprecision(16) << GetDy() << " ";
251 *os << setprecision(16) << GetDz() << " ";
252 *os << fNp << " " << fNn << " ";
253 *os << setprecision(16) << fAngleP << " ";
254 *os << setprecision(16) << fAngleN << " ";
255 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
256 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
258 os->flags(fmt); // reset back to old formating.
261 //______________________________________________________________________
262 void AliITSgeomSSD::Read(istream *is){
263 ////////////////////////////////////////////////////////////////////////
264 // Standard input format for this class.
265 ////////////////////////////////////////////////////////////////////////
271 *is >> dx >> dy >> dz;
272 if(fShapeSSD!=0) delete fShapeSSD;
273 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
276 *is >> fAngleP >> fAngleN;
277 if(fLowEdgeP !=0) delete fLowEdgeP;
278 if(fLowEdgeN !=0) delete fLowEdgeN;
279 fLowEdgeP = new Float_t[fNp];
280 fLowEdgeN = new Float_t[fNn];
281 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
282 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
285 //----------------------------------------------------------------------
286 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
287 ////////////////////////////////////////////////////////////////////////
288 // Standard output streaming function.
289 ////////////////////////////////////////////////////////////////////////
294 //----------------------------------------------------------------------
295 istream &operator>>(istream &is,AliITSgeomSSD &r){
296 ////////////////////////////////////////////////////////////////////////
297 // Standard input streaming function.
298 ////////////////////////////////////////////////////////////////////////
303 //======================================================================
306 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
309 Revision 1.15 2002/05/19 18:17:03 hristov
310 Changes needed by ICC/IFC compiler (Intel)
312 Revision 1.14 2001/11/19 16:17:03 nilsen
313 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
314 bugs found by Rene require more work to fix. Will be fixed soon.
316 Revision 1.13 2001/10/12 22:07:20 nilsen
317 A patch for C++ io manipulation functions so that they will work both
318 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
321 Revision 1.12 2001/08/24 21:06:37 nilsen
322 Added more documentation, fixed up some coding violations, and some
323 forward declorations.
325 Revision 1.11 2001/05/16 08:17:49 hristov
326 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)
328 Revision 1.10 2001/02/09 00:00:57 nilsen
329 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
330 bugs in iostream based streamers used to read and write .det files. Fixed
331 some detector sizes. Fixed bugs in some default-special constructors.
333 Revision 1.9 2001/02/03 00:00:30 nilsen
334 New version of AliITSgeom and related files. Now uses automatic streamers,
335 set up for new formatted .det file which includes detector information.
336 Additional smaller modifications are still to come.
340 //#include "AliITSgeomSSD175.h"
342 ClassImp(AliITSgeomSSD175)
344 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
345 ////////////////////////////////////////////////////////////////////////
346 // default constructor
347 ////////////////////////////////////////////////////////////////////////
348 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
349 // Size of sensitive detector area x,y(thickness),z
350 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
351 const Float_t kpitch = 0.0095;// cm anode separation.
352 const Int_t kNstrips = 768; // number of anode or cathode strips.
353 Float_t *leA,*leC; // array of low edges anode and cathorde.
356 leA = new Float_t[kNstrips+1];
357 leC = new Float_t[kNstrips+1];
359 leA[1] = -kpitch*(0.5*kNstrips-1);
361 leC[1] = kpitch*(0.5*kNstrips-1);
362 for(i=1;i<kNstrips;i++){
363 leA[i+1] = leA[i] + kpitch;
364 leC[i+1] = leC[i] - kpitch;
366 leA[kNstrips] = kDxyz[0];
367 leC[kNstrips] = -kDxyz[0];
368 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
369 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
370 kNstrips+1,leA,kNstrips+1,leC);
373 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
375 //________________________________________________________________________
376 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
377 ////////////////////////////////////////////////////////////////////////
378 // Standard output streaming function.
379 ////////////////////////////////////////////////////////////////////////
384 //----------------------------------------------------------------------
385 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
386 ////////////////////////////////////////////////////////////////////////
387 // Standard input streaming function.
388 ////////////////////////////////////////////////////////////////////////
393 //======================================================================
396 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
399 Revision 1.15 2002/05/19 18:17:03 hristov
400 Changes needed by ICC/IFC compiler (Intel)
402 Revision 1.14 2001/11/19 16:17:03 nilsen
403 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
404 bugs found by Rene require more work to fix. Will be fixed soon.
406 Revision 1.13 2001/10/12 22:07:20 nilsen
407 A patch for C++ io manipulation functions so that they will work both
408 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
411 Revision 1.12 2001/08/24 21:06:37 nilsen
412 Added more documentation, fixed up some coding violations, and some
413 forward declorations.
415 Revision 1.11 2001/05/16 08:17:49 hristov
416 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)
418 Revision 1.10 2001/02/09 00:00:57 nilsen
419 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
420 bugs in iostream based streamers used to read and write .det files. Fixed
421 some detector sizes. Fixed bugs in some default-special constructors.
423 Revision 1.9 2001/02/03 00:00:30 nilsen
424 New version of AliITSgeom and related files. Now uses automatic streamers,
425 set up for new formatted .det file which includes detector information.
426 Additional smaller modifications are still to come.
430 //#include "AliITSgeomSSD275and75.h"
432 ClassImp(AliITSgeomSSD275and75)
434 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
435 ////////////////////////////////////////////////////////////////////////
436 // default constructor
437 ////////////////////////////////////////////////////////////////////////
439 //----------------------------------------------------------------------
440 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
442 // Default constructor for AliITSgeomSSD with strip angles of
443 // 275 miliradians and 75 miliradians. This constructor initlizes
444 // AliITSgeomSSD with the correct values. This is the miror image
445 // of the AliITSgeomSSD75and275 class.
446 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
447 // Size of sensitive detector area x,y(thickness),z
448 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
449 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
450 const Float_t kpitch = 0.0095;// cm anode separation.
451 const Int_t kNstrips = 768; // number of anode or cathode strips.
452 Float_t *leA,*leC; // array of low edges anode and cathorde.
455 leA = new Float_t[kNstrips+1];
456 leC = new Float_t[kNstrips+1];
458 leA[1] = -kpitch*(0.5*kNstrips-1);
460 leC[1] = kpitch*(0.5*kNstrips-1);
461 for(i=1;i<kNstrips;i++){
462 leA[i+1] = leA[i] + kpitch;
463 leC[i+1] = leC[i] - kpitch;
465 leA[kNstrips] = kDxyz[0];
466 leC[kNstrips] = -kDxyz[0];
467 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
468 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
469 kNstrips+1,leA,kNstrips+1,leC);
472 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
474 //________________________________________________________________________
475 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
476 ////////////////////////////////////////////////////////////////////////
477 // Standard output streaming function.
478 ////////////////////////////////////////////////////////////////////////
483 //----------------------------------------------------------------------
484 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
485 ////////////////////////////////////////////////////////////////////////
486 // Standard input streaming function.
487 ////////////////////////////////////////////////////////////////////////
492 //======================================================================
495 Revision 1.14.6.1 2002/06/10 17:51:15 hristov
498 Revision 1.15 2002/05/19 18:17:03 hristov
499 Changes needed by ICC/IFC compiler (Intel)
501 Revision 1.14 2001/11/19 16:17:03 nilsen
502 Applyed fixes to bugs found by Rene Brun. With many thanks. Some additonal
503 bugs found by Rene require more work to fix. Will be fixed soon.
505 Revision 1.13 2001/10/12 22:07:20 nilsen
506 A patch for C++ io manipulation functions so that they will work both
507 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
510 Revision 1.12 2001/08/24 21:06:37 nilsen
511 Added more documentation, fixed up some coding violations, and some
512 forward declorations.
514 Revision 1.11 2001/05/16 08:17:49 hristov
515 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)
517 Revision 1.10 2001/02/09 00:00:57 nilsen
518 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
519 bugs in iostream based streamers used to read and write .det files. Fixed
520 some detector sizes. Fixed bugs in some default-special constructors.
522 Revision 1.9 2001/02/03 00:00:30 nilsen
523 New version of AliITSgeom and related files. Now uses automatic streamers,
524 set up for new formatted .det file which includes detector information.
525 Additional smaller modifications are still to come.
528 //#include "AliITSgeomSSD75and275.h"
530 ClassImp(AliITSgeomSSD75and275)
532 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
533 ////////////////////////////////////////////////////////////////////////
534 // default constructor
535 ////////////////////////////////////////////////////////////////////////
537 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
539 // Default constructor for AliITSgeomSSD with strip angles of
540 // 75 miliradians and 275 miliradians. This constructor initlizes
541 // AliITSgeomSSD with the correct values. This is the miror image
542 // of the AliITSgeomSSD275and75 class.
543 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
544 // Size of sensitive detector area x,y(thickness),z
545 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
546 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
547 const Float_t kpitch = 0.0095;// cm anode separation.
548 const Int_t kNstrips = 768; // number of anode or cathode strips.
549 Float_t *leA,*leC; // array of low edges anode and cathorde.
552 leA = new Float_t[kNstrips+1];
553 leC = new Float_t[kNstrips+1];
555 leA[1] = -kpitch*(0.5*kNstrips-1);
557 leC[1] = kpitch*(0.5*kNstrips-1);
558 for(i=1;i<kNstrips;i++){
559 leA[i+1] = leA[i] + kpitch;
560 leC[i+1] = leC[i] - kpitch;
562 leA[kNstrips] = kDxyz[0];
563 leC[kNstrips] = -kDxyz[0];
564 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
565 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
566 kNstrips+1,leA,kNstrips+1,leC);
569 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
571 //________________________________________________________________________
572 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
573 ////////////////////////////////////////////////////////////////////////
574 // Standard output streaming function.
575 ////////////////////////////////////////////////////////////////////////
580 //----------------------------------------------------------------------
581 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
582 ////////////////////////////////////////////////////////////////////////
583 // Standard input streaming function.
584 ////////////////////////////////////////////////////////////////////////
589 //======================================================================