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.13 2001/10/12 22:07:20 nilsen
19 A patch for C++ io manipulation functions so that they will work both
20 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
23 Revision 1.12 2001/08/24 21:06:37 nilsen
24 Added more documentation, fixed up some coding violations, and some
27 Revision 1.11 2001/05/16 08:17:49 hristov
28 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)
30 Revision 1.10 2001/02/09 00:00:57 nilsen
31 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
32 bugs in iostream based streamers used to read and write .det files. Fixed
33 some detector sizes. Fixed bugs in some default-special constructors.
35 Revision 1.9 2001/02/03 00:00:30 nilsen
36 New version of AliITSgeom and related files. Now uses automatic streamers,
37 set up for new formatted .det file which includes detector information.
38 Additional smaller modifications are still to come.
40 Revision 1.8 2000/10/02 16:32:43 barbera
41 Forward declaration added
43 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
44 Forward declaration added
46 Revision 1.7 2000/07/10 16:07:18 fca
47 Release version of ITS code
49 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
50 Fixed up the comments/documentation
52 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
53 This is the version of the files after the merging done in December 1999.
54 See the ReadMe110100.txt file for details
56 Revision 1.2 1999/09/29 09:24:20 fca
57 Introduction of the Copyright and cvs Log
61 ////////////////////////////////////////////////////////////////////////
62 // This class is for the Silicon Strip Detector, SSD, specific geometry.
63 // It is being replaced by AliITSsegmentationSSD class. This file also
64 // constains classes derived from AliITSgeomSSD which do nothing but
65 // initilize this one with predefined values.
66 ////////////////////////////////////////////////////////////////////////
74 #include "AliITSgeomSSD.h"
76 ClassImp(AliITSgeomSSD)
79 AliITSgeomSSD::AliITSgeomSSD(){
80 // Default constructor
89 //----------------------------------------------------------------------
90 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
91 Int_t np,Float_t *p,Int_t nn,Float_t *n){
92 ////////////////////////////////////////////////////////////////////////
93 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
94 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
95 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
96 ///////////////////////////////////////////////////////////////////////
104 ResetSSD(box,ap,an,np,p,nn,n);
106 //----------------------------------------------------------------------
107 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
108 Int_t np,Float_t *p,Int_t nn,Float_t *n){
109 ////////////////////////////////////////////////////////////////////////
110 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
111 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
112 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
113 ///////////////////////////////////////////////////////////////////////
116 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
117 box[0],box[1],box[2]);
118 // if(fLowEdgeP!=0) delete fLowEdgeP;
119 // if(fLowEdgeN!=0) delete fLowEdgeN;
124 fLowEdgeP = new Float_t[fNp];
125 fLowEdgeN = new Float_t[fNn];
126 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
127 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
129 //______________________________________________________________________
130 AliITSgeomSSD::~AliITSgeomSSD(){
133 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
134 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
135 if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
141 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
142 ////////////////////////////////////////////////////////////////////////
144 ////////////////////////////////////////////////////////////////////////
147 if(this == &source) return;
148 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
149 this->fNp = source.fNp;
150 this->fNn = source.fNn;
153 this->fAngleP = source.fAngleP;
154 this->fAngleN = source.fAngleN;
155 fLowEdgeP = new Float_t[fNp];
156 fLowEdgeN = new Float_t[fNn];
157 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
158 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
162 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
163 ////////////////////////////////////////////////////////////////////////
164 // assignment operator
165 ////////////////////////////////////////////////////////////////////////
168 if(this == &source) return *this;
169 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
170 this->fNp = source.fNp;
171 this->fNn = source.fNn;
174 this->fAngleP = source.fAngleP;
175 this->fAngleN = source.fAngleN;
176 fLowEdgeP = new Float_t[fNp];
177 fLowEdgeN = new Float_t[fNn];
178 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
179 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
182 //______________________________________________________________________
183 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
184 // Given a GEANT detector local coordinate, cm, this function returns
185 // the detector specific P and N side strip numbers.
187 // Float_t x Geant detector local x coordinate in cm
188 // Float_t z Geant detector local z coordinate in cm
190 // Int_t &a Detector anode strip number (P side)
191 // Int_t &c Detector cathode strip number (N side)
195 // project on to bonding edges.
196 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
197 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
198 if(d<fLowEdgeP[0]) i=-1;
199 else for(i=0;i<fNp;i++){
200 if(fLowEdgeP[i]<d) break;
203 if(b<fLowEdgeN[0]) i=-1;
204 else for(i=0;i<fNn;i++){
205 if(fLowEdgeN[i]<b) break;
210 //______________________________________________________________________
211 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
217 //______________________________________________________________________
218 void AliITSgeomSSD::Print(ostream *os) const {
219 ////////////////////////////////////////////////////////////////////////
220 // Standard output format for this class.
221 ////////////////////////////////////////////////////////////////////////
233 fmt = os->setf(ios::scientific); // set scientific floating point output
234 *os << "TBRIK" << " ";
235 *os << setprecision(16) << GetDx() << " ";
236 *os << setprecision(16) << GetDy() << " ";
237 *os << setprecision(16) << GetDz() << " ";
238 *os << fNp << " " << fNn << " ";
239 *os << setprecision(16) << fAngleP << " ";
240 *os << setprecision(16) << fAngleN << " ";
241 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
242 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
244 os->flags(fmt); // reset back to old formating.
247 //______________________________________________________________________
248 void AliITSgeomSSD::Read(istream *is){
249 ////////////////////////////////////////////////////////////////////////
250 // Standard input format for this class.
251 ////////////////////////////////////////////////////////////////////////
257 *is >> dx >> dy >> dz;
258 if(fShapeSSD!=0) delete fShapeSSD;
259 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
262 *is >> fAngleP >> fAngleN;
263 if(fLowEdgeP !=0) delete fLowEdgeP;
264 if(fLowEdgeN !=0) delete fLowEdgeN;
265 fLowEdgeP = new Float_t[fNp];
266 fLowEdgeN = new Float_t[fNn];
267 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
268 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
271 //----------------------------------------------------------------------
272 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
273 ////////////////////////////////////////////////////////////////////////
274 // Standard output streaming function.
275 ////////////////////////////////////////////////////////////////////////
280 //----------------------------------------------------------------------
281 istream &operator>>(istream &is,AliITSgeomSSD &r){
282 ////////////////////////////////////////////////////////////////////////
283 // Standard input streaming function.
284 ////////////////////////////////////////////////////////////////////////
289 //======================================================================
292 Revision 1.13 2001/10/12 22:07:20 nilsen
293 A patch for C++ io manipulation functions so that they will work both
294 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
297 Revision 1.12 2001/08/24 21:06:37 nilsen
298 Added more documentation, fixed up some coding violations, and some
299 forward declorations.
301 Revision 1.11 2001/05/16 08:17:49 hristov
302 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)
304 Revision 1.10 2001/02/09 00:00:57 nilsen
305 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
306 bugs in iostream based streamers used to read and write .det files. Fixed
307 some detector sizes. Fixed bugs in some default-special constructors.
309 Revision 1.9 2001/02/03 00:00:30 nilsen
310 New version of AliITSgeom and related files. Now uses automatic streamers,
311 set up for new formatted .det file which includes detector information.
312 Additional smaller modifications are still to come.
316 //#include "AliITSgeomSSD175.h"
318 ClassImp(AliITSgeomSSD175)
320 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
321 ////////////////////////////////////////////////////////////////////////
322 // default constructor
323 ////////////////////////////////////////////////////////////////////////
324 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
325 // Size of sensitive detector area x,y(thickness),z
326 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
327 const Float_t kpitch = 0.0095;// cm anode separation.
328 const Int_t kNstrips = 768; // number of anode or cathode strips.
329 Float_t *leA,*leC; // array of low edges anode and cathorde.
332 leA = new Float_t[kNstrips+1];
333 leC = new Float_t[kNstrips+1];
335 leA[1] = -kpitch*(0.5*kNstrips-1);
337 leC[1] = kpitch*(0.5*kNstrips-1);
338 for(i=1;i<kNstrips;i++){
339 leA[i+1] = leA[i] + kpitch;
340 leC[i+1] = leC[i] - kpitch;
342 leA[kNstrips] = kDxyz[0];
343 leC[kNstrips] = -kDxyz[0];
344 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
345 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
346 kNstrips+1,leA,kNstrips+1,leC);
349 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
351 //________________________________________________________________________
352 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
353 ////////////////////////////////////////////////////////////////////////
354 // Standard output streaming function.
355 ////////////////////////////////////////////////////////////////////////
360 //----------------------------------------------------------------------
361 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
362 ////////////////////////////////////////////////////////////////////////
363 // Standard input streaming function.
364 ////////////////////////////////////////////////////////////////////////
369 //======================================================================
372 Revision 1.13 2001/10/12 22:07:20 nilsen
373 A patch for C++ io manipulation functions so that they will work both
374 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
377 Revision 1.12 2001/08/24 21:06:37 nilsen
378 Added more documentation, fixed up some coding violations, and some
379 forward declorations.
381 Revision 1.11 2001/05/16 08:17:49 hristov
382 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)
384 Revision 1.10 2001/02/09 00:00:57 nilsen
385 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
386 bugs in iostream based streamers used to read and write .det files. Fixed
387 some detector sizes. Fixed bugs in some default-special constructors.
389 Revision 1.9 2001/02/03 00:00:30 nilsen
390 New version of AliITSgeom and related files. Now uses automatic streamers,
391 set up for new formatted .det file which includes detector information.
392 Additional smaller modifications are still to come.
396 //#include "AliITSgeomSSD275and75.h"
398 ClassImp(AliITSgeomSSD275and75)
400 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
401 ////////////////////////////////////////////////////////////////////////
402 // default constructor
403 ////////////////////////////////////////////////////////////////////////
405 //----------------------------------------------------------------------
406 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
408 // Default constructor for AliITSgeomSSD with strip angles of
409 // 275 miliradians and 75 miliradians. This constructor initlizes
410 // AliITSgeomSSD with the correct values. This is the miror image
411 // of the AliITSgeomSSD75and275 class.
412 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
413 // Size of sensitive detector area x,y(thickness),z
414 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
415 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
416 const Float_t kpitch = 0.0095;// cm anode separation.
417 const Int_t kNstrips = 768; // number of anode or cathode strips.
418 Float_t *leA,*leC; // array of low edges anode and cathorde.
421 leA = new Float_t[kNstrips+1];
422 leC = new Float_t[kNstrips+1];
424 leA[1] = -kpitch*(0.5*kNstrips-1);
426 leC[1] = kpitch*(0.5*kNstrips-1);
427 for(i=1;i<kNstrips;i++){
428 leA[i+1] = leA[i] + kpitch;
429 leC[i+1] = leC[i] - kpitch;
431 leA[kNstrips] = kDxyz[0];
432 leC[kNstrips] = -kDxyz[0];
433 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
434 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
435 kNstrips+1,leA,kNstrips+1,leC);
438 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
440 //________________________________________________________________________
441 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
442 ////////////////////////////////////////////////////////////////////////
443 // Standard output streaming function.
444 ////////////////////////////////////////////////////////////////////////
449 //----------------------------------------------------------------------
450 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
451 ////////////////////////////////////////////////////////////////////////
452 // Standard input streaming function.
453 ////////////////////////////////////////////////////////////////////////
458 //======================================================================
461 Revision 1.13 2001/10/12 22:07:20 nilsen
462 A patch for C++ io manipulation functions so that they will work both
463 with GNU gcc 2.96 and GNU gcc 3.01 compilers. Needs to be tested with
466 Revision 1.12 2001/08/24 21:06:37 nilsen
467 Added more documentation, fixed up some coding violations, and some
468 forward declorations.
470 Revision 1.11 2001/05/16 08:17:49 hristov
471 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)
473 Revision 1.10 2001/02/09 00:00:57 nilsen
474 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
475 bugs in iostream based streamers used to read and write .det files. Fixed
476 some detector sizes. Fixed bugs in some default-special constructors.
478 Revision 1.9 2001/02/03 00:00:30 nilsen
479 New version of AliITSgeom and related files. Now uses automatic streamers,
480 set up for new formatted .det file which includes detector information.
481 Additional smaller modifications are still to come.
484 //#include "AliITSgeomSSD75and275.h"
486 ClassImp(AliITSgeomSSD75and275)
488 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
489 ////////////////////////////////////////////////////////////////////////
490 // default constructor
491 ////////////////////////////////////////////////////////////////////////
493 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
495 // Default constructor for AliITSgeomSSD with strip angles of
496 // 75 miliradians and 275 miliradians. This constructor initlizes
497 // AliITSgeomSSD with the correct values. This is the miror image
498 // of the AliITSgeomSSD275and75 class.
499 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
500 // Size of sensitive detector area x,y(thickness),z
501 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
502 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
503 const Float_t kpitch = 0.0095;// cm anode separation.
504 const Int_t kNstrips = 768; // number of anode or cathode strips.
505 Float_t *leA,*leC; // array of low edges anode and cathorde.
508 leA = new Float_t[kNstrips+1];
509 leC = new Float_t[kNstrips+1];
511 leA[1] = -kpitch*(0.5*kNstrips-1);
513 leC[1] = kpitch*(0.5*kNstrips-1);
514 for(i=1;i<kNstrips;i++){
515 leA[i+1] = leA[i] + kpitch;
516 leC[i+1] = leC[i] - kpitch;
518 leA[kNstrips] = kDxyz[0];
519 leC[kNstrips] = -kDxyz[0];
520 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
521 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
522 kNstrips+1,leA,kNstrips+1,leC);
525 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
527 //________________________________________________________________________
528 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
529 ////////////////////////////////////////////////////////////////////////
530 // Standard output streaming function.
531 ////////////////////////////////////////////////////////////////////////
536 //----------------------------------------------------------------------
537 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
538 ////////////////////////////////////////////////////////////////////////
539 // Standard input streaming function.
540 ////////////////////////////////////////////////////////////////////////
545 //======================================================================