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.11 2001/05/16 08:17:49 hristov
19 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)
21 Revision 1.10 2001/02/09 00:00:57 nilsen
22 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
23 bugs in iostream based streamers used to read and write .det files. Fixed
24 some detector sizes. Fixed bugs in some default-special constructors.
26 Revision 1.9 2001/02/03 00:00:30 nilsen
27 New version of AliITSgeom and related files. Now uses automatic streamers,
28 set up for new formatted .det file which includes detector information.
29 Additional smaller modifications are still to come.
31 Revision 1.8 2000/10/02 16:32:43 barbera
32 Forward declaration added
34 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
35 Forward declaration added
37 Revision 1.7 2000/07/10 16:07:18 fca
38 Release version of ITS code
40 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
41 Fixed up the comments/documentation
43 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
44 This is the version of the files after the merging done in December 1999.
45 See the ReadMe110100.txt file for details
47 Revision 1.2 1999/09/29 09:24:20 fca
48 Introduction of the Copyright and cvs Log
52 ////////////////////////////////////////////////////////////////////////
53 // This class is for the Silicon Strip Detector, SSD, specific geometry.
54 // It is being replaced by AliITSsegmentationSSD class. This file also
55 // constains classes derived from AliITSgeomSSD which do nothing but
56 // initilize this one with predefined values.
57 ////////////////////////////////////////////////////////////////////////
65 #include "AliITSgeomSSD.h"
67 ClassImp(AliITSgeomSSD)
70 AliITSgeomSSD::AliITSgeomSSD(){
71 // Default constructor
80 //----------------------------------------------------------------------
81 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
82 Int_t np,Float_t *p,Int_t nn,Float_t *n){
83 ////////////////////////////////////////////////////////////////////////
84 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
85 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
86 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
87 ///////////////////////////////////////////////////////////////////////
95 ResetSSD(box,ap,an,np,p,nn,n);
97 //----------------------------------------------------------------------
98 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
99 Int_t np,Float_t *p,Int_t nn,Float_t *n){
100 ////////////////////////////////////////////////////////////////////////
101 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
102 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
103 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
104 ///////////////////////////////////////////////////////////////////////
107 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
108 box[0],box[1],box[2]);
109 // if(fLowEdgeP!=0) delete fLowEdgeP;
110 // if(fLowEdgeN!=0) delete fLowEdgeN;
115 fLowEdgeP = new Float_t[fNp];
116 fLowEdgeN = new Float_t[fNn];
117 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
118 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
120 //______________________________________________________________________
121 AliITSgeomSSD::~AliITSgeomSSD(){
124 delete fLowEdgeP; fLowEdgeP = 0;
125 delete fLowEdgeN; fLowEdgeN = 0;
126 delete fShapeSSD; fShapeSSD = 0;
132 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
133 ////////////////////////////////////////////////////////////////////////
135 ////////////////////////////////////////////////////////////////////////
138 if(this == &source) return;
139 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
140 this->fNp = source.fNp;
141 this->fNn = source.fNn;
144 this->fAngleP = source.fAngleP;
145 this->fAngleN = source.fAngleN;
146 fLowEdgeP = new Float_t[fNp];
147 fLowEdgeN = new Float_t[fNn];
148 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
149 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
153 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
154 ////////////////////////////////////////////////////////////////////////
155 // assignment operator
156 ////////////////////////////////////////////////////////////////////////
159 if(this == &source) return *this;
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];
173 //______________________________________________________________________
174 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
175 // Given a GEANT detector local coordinate, cm, this function returns
176 // the detector specific P and N side strip numbers.
178 // Float_t x Geant detector local x coordinate in cm
179 // Float_t z Geant detector local z coordinate in cm
181 // Int_t &a Detector anode strip number (P side)
182 // Int_t &c Detector cathode strip number (N side)
186 // project on to bonding edges.
187 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
188 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
189 if(d<fLowEdgeP[0]) i=-1;
190 else for(i=0;i<fNp;i++){
191 if(fLowEdgeP[i]<d) break;
194 if(b<fLowEdgeN[0]) i=-1;
195 else for(i=0;i<fNn;i++){
196 if(fLowEdgeN[i]<b) break;
201 //______________________________________________________________________
202 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
208 //______________________________________________________________________
209 void AliITSgeomSSD::Print(ostream *os) const {
210 ////////////////////////////////////////////////////////////////////////
211 // Standard output format for this class.
212 ////////////////////////////////////////////////////////////////////////
216 fmt = os->setf(ios::scientific); // set scientific floating point output
217 *os << "TBRIK" << " ";
218 *os << setprecision(16) << GetDx() << " ";
219 *os << setprecision(16) << GetDy() << " ";
220 *os << setprecision(16) << GetDz() << " ";
221 *os << fNp << " " << fNn << " ";
222 *os << setprecision(16) << fAngleP << " ";
223 *os << setprecision(16) << fAngleN << " ";
224 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
225 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
227 os->flags(fmt); // reset back to old formating.
230 //______________________________________________________________________
231 void AliITSgeomSSD::Read(istream *is){
232 ////////////////////////////////////////////////////////////////////////
233 // Standard input format for this class.
234 ////////////////////////////////////////////////////////////////////////
240 *is >> dx >> dy >> dz;
241 if(fShapeSSD!=0) delete fShapeSSD;
242 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
245 *is >> fAngleP >> fAngleN;
246 if(fLowEdgeP !=0) delete fLowEdgeP;
247 if(fLowEdgeN !=0) delete fLowEdgeN;
248 fLowEdgeP = new Float_t[fNp];
249 fLowEdgeN = new Float_t[fNn];
250 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
251 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
254 //----------------------------------------------------------------------
255 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
256 ////////////////////////////////////////////////////////////////////////
257 // Standard output streaming function.
258 ////////////////////////////////////////////////////////////////////////
263 //----------------------------------------------------------------------
264 istream &operator>>(istream &is,AliITSgeomSSD &r){
265 ////////////////////////////////////////////////////////////////////////
266 // Standard input streaming function.
267 ////////////////////////////////////////////////////////////////////////
272 //======================================================================
275 Revision 1.11 2001/05/16 08:17:49 hristov
276 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)
278 Revision 1.10 2001/02/09 00:00:57 nilsen
279 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
280 bugs in iostream based streamers used to read and write .det files. Fixed
281 some detector sizes. Fixed bugs in some default-special constructors.
283 Revision 1.9 2001/02/03 00:00:30 nilsen
284 New version of AliITSgeom and related files. Now uses automatic streamers,
285 set up for new formatted .det file which includes detector information.
286 Additional smaller modifications are still to come.
290 //#include "AliITSgeomSSD175.h"
292 ClassImp(AliITSgeomSSD175)
294 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
295 ////////////////////////////////////////////////////////////////////////
296 // default constructor
297 ////////////////////////////////////////////////////////////////////////
298 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
299 // Size of sensitive detector area x,y(thickness),z
300 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
301 const Float_t kpitch = 0.0095;// cm anode separation.
302 const Int_t kNstrips = 768; // number of anode or cathode strips.
303 Float_t *leA,*leC; // array of low edges anode and cathorde.
306 leA = new Float_t[kNstrips+1];
307 leC = new Float_t[kNstrips+1];
309 leA[1] = -kpitch*(0.5*kNstrips-1);
311 leC[1] = kpitch*(0.5*kNstrips-1);
312 for(i=1;i<kNstrips;i++){
313 leA[i+1] = leA[i] + kpitch;
314 leC[i+1] = leC[i] - kpitch;
316 leA[kNstrips] = kDxyz[0];
317 leC[kNstrips] = -kDxyz[0];
318 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
319 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
320 kNstrips+1,leA,kNstrips+1,leC);
323 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
325 //________________________________________________________________________
326 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
327 ////////////////////////////////////////////////////////////////////////
328 // Standard output streaming function.
329 ////////////////////////////////////////////////////////////////////////
334 //----------------------------------------------------------------------
335 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
336 ////////////////////////////////////////////////////////////////////////
337 // Standard input streaming function.
338 ////////////////////////////////////////////////////////////////////////
343 //======================================================================
346 Revision 1.11 2001/05/16 08:17:49 hristov
347 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)
349 Revision 1.10 2001/02/09 00:00:57 nilsen
350 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
351 bugs in iostream based streamers used to read and write .det files. Fixed
352 some detector sizes. Fixed bugs in some default-special constructors.
354 Revision 1.9 2001/02/03 00:00:30 nilsen
355 New version of AliITSgeom and related files. Now uses automatic streamers,
356 set up for new formatted .det file which includes detector information.
357 Additional smaller modifications are still to come.
361 //#include "AliITSgeomSSD275and75.h"
363 ClassImp(AliITSgeomSSD275and75)
365 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
366 ////////////////////////////////////////////////////////////////////////
367 // default constructor
368 ////////////////////////////////////////////////////////////////////////
370 //----------------------------------------------------------------------
371 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
373 // Default constructor for AliITSgeomSSD with strip angles of
374 // 275 miliradians and 75 miliradians. This constructor initlizes
375 // AliITSgeomSSD with the correct values. This is the miror image
376 // of the AliITSgeomSSD75and275 class.
377 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
378 // Size of sensitive detector area x,y(thickness),z
379 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
380 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
381 const Float_t kpitch = 0.0095;// cm anode separation.
382 const Int_t kNstrips = 768; // number of anode or cathode strips.
383 Float_t *leA,*leC; // array of low edges anode and cathorde.
386 leA = new Float_t[kNstrips+1];
387 leC = new Float_t[kNstrips+1];
389 leA[1] = -kpitch*(0.5*kNstrips-1);
391 leC[1] = kpitch*(0.5*kNstrips-1);
392 for(i=1;i<kNstrips;i++){
393 leA[i+1] = leA[i] + kpitch;
394 leC[i+1] = leC[i] - kpitch;
396 leA[kNstrips] = kDxyz[0];
397 leC[kNstrips] = -kDxyz[0];
398 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
399 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
400 kNstrips+1,leA,kNstrips+1,leC);
403 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
405 //________________________________________________________________________
406 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
407 ////////////////////////////////////////////////////////////////////////
408 // Standard output streaming function.
409 ////////////////////////////////////////////////////////////////////////
414 //----------------------------------------------------------------------
415 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
416 ////////////////////////////////////////////////////////////////////////
417 // Standard input streaming function.
418 ////////////////////////////////////////////////////////////////////////
423 //======================================================================
426 Revision 1.11 2001/05/16 08:17:49 hristov
427 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)
429 Revision 1.10 2001/02/09 00:00:57 nilsen
430 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
431 bugs in iostream based streamers used to read and write .det files. Fixed
432 some detector sizes. Fixed bugs in some default-special constructors.
434 Revision 1.9 2001/02/03 00:00:30 nilsen
435 New version of AliITSgeom and related files. Now uses automatic streamers,
436 set up for new formatted .det file which includes detector information.
437 Additional smaller modifications are still to come.
440 //#include "AliITSgeomSSD75and275.h"
442 ClassImp(AliITSgeomSSD75and275)
444 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
445 ////////////////////////////////////////////////////////////////////////
446 // default constructor
447 ////////////////////////////////////////////////////////////////////////
449 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
451 // Default constructor for AliITSgeomSSD with strip angles of
452 // 75 miliradians and 275 miliradians. This constructor initlizes
453 // AliITSgeomSSD with the correct values. This is the miror image
454 // of the AliITSgeomSSD275and75 class.
455 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
456 // Size of sensitive detector area x,y(thickness),z
457 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
458 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
459 const Float_t kpitch = 0.0095;// cm anode separation.
460 const Int_t kNstrips = 768; // number of anode or cathode strips.
461 Float_t *leA,*leC; // array of low edges anode and cathorde.
464 leA = new Float_t[kNstrips+1];
465 leC = new Float_t[kNstrips+1];
467 leA[1] = -kpitch*(0.5*kNstrips-1);
469 leC[1] = kpitch*(0.5*kNstrips-1);
470 for(i=1;i<kNstrips;i++){
471 leA[i+1] = leA[i] + kpitch;
472 leC[i+1] = leC[i] - kpitch;
474 leA[kNstrips] = kDxyz[0];
475 leC[kNstrips] = -kDxyz[0];
476 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
477 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
478 kNstrips+1,leA,kNstrips+1,leC);
481 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
483 //________________________________________________________________________
484 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
485 ////////////////////////////////////////////////////////////////////////
486 // Standard output streaming function.
487 ////////////////////////////////////////////////////////////////////////
492 //----------------------------------------------------------------------
493 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
494 ////////////////////////////////////////////////////////////////////////
495 // Standard input streaming function.
496 ////////////////////////////////////////////////////////////////////////
501 //======================================================================