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.12 2001/08/24 21:06:37 nilsen
19 Added more documentation, fixed up some coding violations, and some
22 Revision 1.11 2001/05/16 08:17:49 hristov
23 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)
25 Revision 1.10 2001/02/09 00:00:57 nilsen
26 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
27 bugs in iostream based streamers used to read and write .det files. Fixed
28 some detector sizes. Fixed bugs in some default-special constructors.
30 Revision 1.9 2001/02/03 00:00:30 nilsen
31 New version of AliITSgeom and related files. Now uses automatic streamers,
32 set up for new formatted .det file which includes detector information.
33 Additional smaller modifications are still to come.
35 Revision 1.8 2000/10/02 16:32:43 barbera
36 Forward declaration added
38 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
39 Forward declaration added
41 Revision 1.7 2000/07/10 16:07:18 fca
42 Release version of ITS code
44 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
45 Fixed up the comments/documentation
47 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
48 This is the version of the files after the merging done in December 1999.
49 See the ReadMe110100.txt file for details
51 Revision 1.2 1999/09/29 09:24:20 fca
52 Introduction of the Copyright and cvs Log
56 ////////////////////////////////////////////////////////////////////////
57 // This class is for the Silicon Strip Detector, SSD, specific geometry.
58 // It is being replaced by AliITSsegmentationSSD class. This file also
59 // constains classes derived from AliITSgeomSSD which do nothing but
60 // initilize this one with predefined values.
61 ////////////////////////////////////////////////////////////////////////
69 #include "AliITSgeomSSD.h"
71 ClassImp(AliITSgeomSSD)
74 AliITSgeomSSD::AliITSgeomSSD(){
75 // Default constructor
84 //----------------------------------------------------------------------
85 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
86 Int_t np,Float_t *p,Int_t nn,Float_t *n){
87 ////////////////////////////////////////////////////////////////////////
88 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
89 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
90 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
91 ///////////////////////////////////////////////////////////////////////
99 ResetSSD(box,ap,an,np,p,nn,n);
101 //----------------------------------------------------------------------
102 void AliITSgeomSSD::ResetSSD(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 Filler. *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 ///////////////////////////////////////////////////////////////////////
111 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
112 box[0],box[1],box[2]);
113 // if(fLowEdgeP!=0) delete fLowEdgeP;
114 // if(fLowEdgeN!=0) delete fLowEdgeN;
119 fLowEdgeP = new Float_t[fNp];
120 fLowEdgeN = new Float_t[fNn];
121 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
122 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
124 //______________________________________________________________________
125 AliITSgeomSSD::~AliITSgeomSSD(){
128 delete fLowEdgeP; fLowEdgeP = 0;
129 delete fLowEdgeN; fLowEdgeN = 0;
130 delete fShapeSSD; fShapeSSD = 0;
136 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
137 ////////////////////////////////////////////////////////////////////////
139 ////////////////////////////////////////////////////////////////////////
142 if(this == &source) return;
143 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
144 this->fNp = source.fNp;
145 this->fNn = source.fNn;
148 this->fAngleP = source.fAngleP;
149 this->fAngleN = source.fAngleN;
150 fLowEdgeP = new Float_t[fNp];
151 fLowEdgeN = new Float_t[fNn];
152 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
153 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
157 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
158 ////////////////////////////////////////////////////////////////////////
159 // assignment operator
160 ////////////////////////////////////////////////////////////////////////
163 if(this == &source) return *this;
164 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
165 this->fNp = source.fNp;
166 this->fNn = source.fNn;
169 this->fAngleP = source.fAngleP;
170 this->fAngleN = source.fAngleN;
171 fLowEdgeP = new Float_t[fNp];
172 fLowEdgeN = new Float_t[fNn];
173 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
174 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
177 //______________________________________________________________________
178 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
179 // Given a GEANT detector local coordinate, cm, this function returns
180 // the detector specific P and N side strip numbers.
182 // Float_t x Geant detector local x coordinate in cm
183 // Float_t z Geant detector local z coordinate in cm
185 // Int_t &a Detector anode strip number (P side)
186 // Int_t &c Detector cathode strip number (N side)
190 // project on to bonding edges.
191 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
192 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
193 if(d<fLowEdgeP[0]) i=-1;
194 else for(i=0;i<fNp;i++){
195 if(fLowEdgeP[i]<d) break;
198 if(b<fLowEdgeN[0]) i=-1;
199 else for(i=0;i<fNn;i++){
200 if(fLowEdgeN[i]<b) break;
205 //______________________________________________________________________
206 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
212 //______________________________________________________________________
213 void AliITSgeomSSD::Print(ostream *os) const {
214 ////////////////////////////////////////////////////////////////////////
215 // Standard output format for this class.
216 ////////////////////////////////////////////////////////////////////////
228 fmt = os->setf(ios::scientific); // set scientific floating point output
229 *os << "TBRIK" << " ";
230 *os << setprecision(16) << GetDx() << " ";
231 *os << setprecision(16) << GetDy() << " ";
232 *os << setprecision(16) << GetDz() << " ";
233 *os << fNp << " " << fNn << " ";
234 *os << setprecision(16) << fAngleP << " ";
235 *os << setprecision(16) << fAngleN << " ";
236 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
237 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
239 os->flags(fmt); // reset back to old formating.
242 //______________________________________________________________________
243 void AliITSgeomSSD::Read(istream *is){
244 ////////////////////////////////////////////////////////////////////////
245 // Standard input format for this class.
246 ////////////////////////////////////////////////////////////////////////
252 *is >> dx >> dy >> dz;
253 if(fShapeSSD!=0) delete fShapeSSD;
254 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
257 *is >> fAngleP >> fAngleN;
258 if(fLowEdgeP !=0) delete fLowEdgeP;
259 if(fLowEdgeN !=0) delete fLowEdgeN;
260 fLowEdgeP = new Float_t[fNp];
261 fLowEdgeN = new Float_t[fNn];
262 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
263 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
266 //----------------------------------------------------------------------
267 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
268 ////////////////////////////////////////////////////////////////////////
269 // Standard output streaming function.
270 ////////////////////////////////////////////////////////////////////////
275 //----------------------------------------------------------------------
276 istream &operator>>(istream &is,AliITSgeomSSD &r){
277 ////////////////////////////////////////////////////////////////////////
278 // Standard input streaming function.
279 ////////////////////////////////////////////////////////////////////////
284 //======================================================================
287 Revision 1.12 2001/08/24 21:06:37 nilsen
288 Added more documentation, fixed up some coding violations, and some
289 forward declorations.
291 Revision 1.11 2001/05/16 08:17:49 hristov
292 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)
294 Revision 1.10 2001/02/09 00:00:57 nilsen
295 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
296 bugs in iostream based streamers used to read and write .det files. Fixed
297 some detector sizes. Fixed bugs in some default-special constructors.
299 Revision 1.9 2001/02/03 00:00:30 nilsen
300 New version of AliITSgeom and related files. Now uses automatic streamers,
301 set up for new formatted .det file which includes detector information.
302 Additional smaller modifications are still to come.
306 //#include "AliITSgeomSSD175.h"
308 ClassImp(AliITSgeomSSD175)
310 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
311 ////////////////////////////////////////////////////////////////////////
312 // default constructor
313 ////////////////////////////////////////////////////////////////////////
314 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
315 // Size of sensitive detector area x,y(thickness),z
316 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
317 const Float_t kpitch = 0.0095;// cm anode separation.
318 const Int_t kNstrips = 768; // number of anode or cathode strips.
319 Float_t *leA,*leC; // array of low edges anode and cathorde.
322 leA = new Float_t[kNstrips+1];
323 leC = new Float_t[kNstrips+1];
325 leA[1] = -kpitch*(0.5*kNstrips-1);
327 leC[1] = kpitch*(0.5*kNstrips-1);
328 for(i=1;i<kNstrips;i++){
329 leA[i+1] = leA[i] + kpitch;
330 leC[i+1] = leC[i] - kpitch;
332 leA[kNstrips] = kDxyz[0];
333 leC[kNstrips] = -kDxyz[0];
334 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
335 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
336 kNstrips+1,leA,kNstrips+1,leC);
339 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
341 //________________________________________________________________________
342 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
343 ////////////////////////////////////////////////////////////////////////
344 // Standard output streaming function.
345 ////////////////////////////////////////////////////////////////////////
350 //----------------------------------------------------------------------
351 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
352 ////////////////////////////////////////////////////////////////////////
353 // Standard input streaming function.
354 ////////////////////////////////////////////////////////////////////////
359 //======================================================================
362 Revision 1.12 2001/08/24 21:06:37 nilsen
363 Added more documentation, fixed up some coding violations, and some
364 forward declorations.
366 Revision 1.11 2001/05/16 08:17:49 hristov
367 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)
369 Revision 1.10 2001/02/09 00:00:57 nilsen
370 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
371 bugs in iostream based streamers used to read and write .det files. Fixed
372 some detector sizes. Fixed bugs in some default-special constructors.
374 Revision 1.9 2001/02/03 00:00:30 nilsen
375 New version of AliITSgeom and related files. Now uses automatic streamers,
376 set up for new formatted .det file which includes detector information.
377 Additional smaller modifications are still to come.
381 //#include "AliITSgeomSSD275and75.h"
383 ClassImp(AliITSgeomSSD275and75)
385 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
386 ////////////////////////////////////////////////////////////////////////
387 // default constructor
388 ////////////////////////////////////////////////////////////////////////
390 //----------------------------------------------------------------------
391 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
393 // Default constructor for AliITSgeomSSD with strip angles of
394 // 275 miliradians and 75 miliradians. This constructor initlizes
395 // AliITSgeomSSD with the correct values. This is the miror image
396 // of the AliITSgeomSSD75and275 class.
397 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
398 // Size of sensitive detector area x,y(thickness),z
399 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
400 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
401 const Float_t kpitch = 0.0095;// cm anode separation.
402 const Int_t kNstrips = 768; // number of anode or cathode strips.
403 Float_t *leA,*leC; // array of low edges anode and cathorde.
406 leA = new Float_t[kNstrips+1];
407 leC = new Float_t[kNstrips+1];
409 leA[1] = -kpitch*(0.5*kNstrips-1);
411 leC[1] = kpitch*(0.5*kNstrips-1);
412 for(i=1;i<kNstrips;i++){
413 leA[i+1] = leA[i] + kpitch;
414 leC[i+1] = leC[i] - kpitch;
416 leA[kNstrips] = kDxyz[0];
417 leC[kNstrips] = -kDxyz[0];
418 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
419 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
420 kNstrips+1,leA,kNstrips+1,leC);
423 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
425 //________________________________________________________________________
426 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
427 ////////////////////////////////////////////////////////////////////////
428 // Standard output streaming function.
429 ////////////////////////////////////////////////////////////////////////
434 //----------------------------------------------------------------------
435 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
436 ////////////////////////////////////////////////////////////////////////
437 // Standard input streaming function.
438 ////////////////////////////////////////////////////////////////////////
443 //======================================================================
446 Revision 1.12 2001/08/24 21:06:37 nilsen
447 Added more documentation, fixed up some coding violations, and some
448 forward declorations.
450 Revision 1.11 2001/05/16 08:17:49 hristov
451 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)
453 Revision 1.10 2001/02/09 00:00:57 nilsen
454 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
455 bugs in iostream based streamers used to read and write .det files. Fixed
456 some detector sizes. Fixed bugs in some default-special constructors.
458 Revision 1.9 2001/02/03 00:00:30 nilsen
459 New version of AliITSgeom and related files. Now uses automatic streamers,
460 set up for new formatted .det file which includes detector information.
461 Additional smaller modifications are still to come.
464 //#include "AliITSgeomSSD75and275.h"
466 ClassImp(AliITSgeomSSD75and275)
468 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
469 ////////////////////////////////////////////////////////////////////////
470 // default constructor
471 ////////////////////////////////////////////////////////////////////////
473 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
475 // Default constructor for AliITSgeomSSD with strip angles of
476 // 75 miliradians and 275 miliradians. This constructor initlizes
477 // AliITSgeomSSD with the correct values. This is the miror image
478 // of the AliITSgeomSSD275and75 class.
479 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
480 // Size of sensitive detector area x,y(thickness),z
481 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
482 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
483 const Float_t kpitch = 0.0095;// cm anode separation.
484 const Int_t kNstrips = 768; // number of anode or cathode strips.
485 Float_t *leA,*leC; // array of low edges anode and cathorde.
488 leA = new Float_t[kNstrips+1];
489 leC = new Float_t[kNstrips+1];
491 leA[1] = -kpitch*(0.5*kNstrips-1);
493 leC[1] = kpitch*(0.5*kNstrips-1);
494 for(i=1;i<kNstrips;i++){
495 leA[i+1] = leA[i] + kpitch;
496 leC[i+1] = leC[i] - kpitch;
498 leA[kNstrips] = kDxyz[0];
499 leC[kNstrips] = -kDxyz[0];
500 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
501 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
502 kNstrips+1,leA,kNstrips+1,leC);
505 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
507 //________________________________________________________________________
508 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
509 ////////////////////////////////////////////////////////////////////////
510 // Standard output streaming function.
511 ////////////////////////////////////////////////////////////////////////
516 //----------------------------------------------------------------------
517 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
518 ////////////////////////////////////////////////////////////////////////
519 // Standard input streaming function.
520 ////////////////////////////////////////////////////////////////////////
525 //======================================================================