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.10 2001/02/09 00:00:57 nilsen
19 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
20 bugs in iostream based streamers used to read and write .det files. Fixed
21 some detector sizes. Fixed bugs in some default-special constructors.
23 Revision 1.9 2001/02/03 00:00:30 nilsen
24 New version of AliITSgeom and related files. Now uses automatic streamers,
25 set up for new formatted .det file which includes detector information.
26 Additional smaller modifications are still to come.
28 Revision 1.8 2000/10/02 16:32:43 barbera
29 Forward declaration added
31 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
32 Forward declaration added
34 Revision 1.7 2000/07/10 16:07:18 fca
35 Release version of ITS code
37 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
38 Fixed up the comments/documentation
40 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
41 This is the version of the files after the merging done in December 1999.
42 See the ReadMe110100.txt file for details
44 Revision 1.2 1999/09/29 09:24:20 fca
45 Introduction of the Copyright and cvs Log
54 #include "AliITSgeomSSD.h"
56 ClassImp(AliITSgeomSSD)
59 AliITSgeomSSD::AliITSgeomSSD(){
60 // Default constructor
69 //----------------------------------------------------------------------
70 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
71 Int_t np,Float_t *p,Int_t nn,Float_t *n){
72 ////////////////////////////////////////////////////////////////////////
73 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
74 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
75 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
76 ///////////////////////////////////////////////////////////////////////
84 ResetSSD(box,ap,an,np,p,nn,n);
86 //----------------------------------------------------------------------
87 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
88 Int_t np,Float_t *p,Int_t nn,Float_t *n){
89 ////////////////////////////////////////////////////////////////////////
90 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
91 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
92 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
93 ///////////////////////////////////////////////////////////////////////
96 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
97 box[0],box[1],box[2]);
98 // if(fLowEdgeP!=0) delete fLowEdgeP;
99 // if(fLowEdgeN!=0) delete fLowEdgeN;
104 fLowEdgeP = new Float_t[fNp];
105 fLowEdgeN = new Float_t[fNn];
106 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
107 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
109 //______________________________________________________________________
110 AliITSgeomSSD::~AliITSgeomSSD(){
113 delete fLowEdgeP; fLowEdgeP = 0;
114 delete fLowEdgeN; fLowEdgeN = 0;
115 delete fShapeSSD; fShapeSSD = 0;
121 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
122 ////////////////////////////////////////////////////////////////////////
124 ////////////////////////////////////////////////////////////////////////
127 if(this == &source) return;
128 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
129 this->fNp = source.fNp;
130 this->fNn = source.fNn;
133 this->fAngleP = source.fAngleP;
134 this->fAngleN = source.fAngleN;
135 fLowEdgeP = new Float_t[fNp];
136 fLowEdgeN = new Float_t[fNn];
137 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
138 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
142 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
143 ////////////////////////////////////////////////////////////////////////
144 // assignment operator
145 ////////////////////////////////////////////////////////////////////////
148 if(this == &source) return *this;
149 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
150 this->fNp = source.fNp;
151 this->fNn = source.fNn;
154 this->fAngleP = source.fAngleP;
155 this->fAngleN = source.fAngleN;
156 fLowEdgeP = new Float_t[fNp];
157 fLowEdgeN = new Float_t[fNn];
158 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
159 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
162 //______________________________________________________________________
163 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
167 // project on to bonding edges.
168 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
169 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
170 if(d<fLowEdgeP[0]) i=-1;
171 else for(i=0;i<fNp;i++){
172 if(fLowEdgeP[i]<d) break;
175 if(b<fLowEdgeN[0]) i=-1;
176 else for(i=0;i<fNn;i++){
177 if(fLowEdgeN[i]<b) break;
182 //______________________________________________________________________
183 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
189 //______________________________________________________________________
190 void AliITSgeomSSD::Print(ostream *os) const {
191 ////////////////////////////////////////////////////////////////////////
192 // Standard output format for this class.
193 ////////////////////////////////////////////////////////////////////////
197 fmt = os->setf(ios::scientific); // set scientific floating point output
198 *os << "TBRIK" << " ";
199 *os << setprecision(16) << GetDx() << " ";
200 *os << setprecision(16) << GetDy() << " ";
201 *os << setprecision(16) << GetDz() << " ";
202 *os << fNp << " " << fNn << " ";
203 *os << setprecision(16) << fAngleP << " ";
204 *os << setprecision(16) << fAngleN << " ";
205 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
206 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
208 os->flags(fmt); // reset back to old formating.
211 //______________________________________________________________________
212 void AliITSgeomSSD::Read(istream *is){
213 ////////////////////////////////////////////////////////////////////////
214 // Standard input format for this class.
215 ////////////////////////////////////////////////////////////////////////
221 *is >> dx >> dy >> dz;
222 if(fShapeSSD!=0) delete fShapeSSD;
223 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
226 *is >> fAngleP >> fAngleN;
227 if(fLowEdgeP !=0) delete fLowEdgeP;
228 if(fLowEdgeN !=0) delete fLowEdgeN;
229 fLowEdgeP = new Float_t[fNp];
230 fLowEdgeN = new Float_t[fNn];
231 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
232 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
235 //----------------------------------------------------------------------
236 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
237 ////////////////////////////////////////////////////////////////////////
238 // Standard output streaming function.
239 ////////////////////////////////////////////////////////////////////////
244 //----------------------------------------------------------------------
245 istream &operator>>(istream &is,AliITSgeomSSD &r){
246 ////////////////////////////////////////////////////////////////////////
247 // Standard input streaming function.
248 ////////////////////////////////////////////////////////////////////////
253 //======================================================================
256 Revision 1.10 2001/02/09 00:00:57 nilsen
257 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
258 bugs in iostream based streamers used to read and write .det files. Fixed
259 some detector sizes. Fixed bugs in some default-special constructors.
261 Revision 1.9 2001/02/03 00:00:30 nilsen
262 New version of AliITSgeom and related files. Now uses automatic streamers,
263 set up for new formatted .det file which includes detector information.
264 Additional smaller modifications are still to come.
268 //#include "AliITSgeomSSD175.h"
270 ClassImp(AliITSgeomSSD175)
272 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
273 ////////////////////////////////////////////////////////////////////////
274 // default constructor
275 ////////////////////////////////////////////////////////////////////////
276 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
277 // Size of sensitive detector area x,y(thickness),z
278 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
279 const Float_t kpitch = 0.0095;// cm anode separation.
280 const Int_t kNstrips = 768; // number of anode or cathode strips.
281 Float_t *leA,*leC; // array of low edges anode and cathorde.
284 leA = new Float_t[kNstrips+1];
285 leC = new Float_t[kNstrips+1];
287 leA[1] = -kpitch*(0.5*kNstrips-1);
289 leC[1] = kpitch*(0.5*kNstrips-1);
290 for(i=1;i<kNstrips;i++){
291 leA[i+1] = leA[i] + kpitch;
292 leC[i+1] = leC[i] - kpitch;
294 leA[kNstrips] = kDxyz[0];
295 leC[kNstrips] = -kDxyz[0];
296 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
297 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
298 kNstrips+1,leA,kNstrips+1,leC);
301 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
303 //________________________________________________________________________
304 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
305 ////////////////////////////////////////////////////////////////////////
306 // Standard output streaming function.
307 ////////////////////////////////////////////////////////////////////////
312 //----------------------------------------------------------------------
313 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
314 ////////////////////////////////////////////////////////////////////////
315 // Standard input streaming function.
316 ////////////////////////////////////////////////////////////////////////
321 //======================================================================
324 Revision 1.10 2001/02/09 00:00:57 nilsen
325 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
326 bugs in iostream based streamers used to read and write .det files. Fixed
327 some detector sizes. Fixed bugs in some default-special constructors.
329 Revision 1.9 2001/02/03 00:00:30 nilsen
330 New version of AliITSgeom and related files. Now uses automatic streamers,
331 set up for new formatted .det file which includes detector information.
332 Additional smaller modifications are still to come.
336 //#include "AliITSgeomSSD275and75.h"
338 ClassImp(AliITSgeomSSD275and75)
340 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
341 ////////////////////////////////////////////////////////////////////////
342 // default constructor
343 ////////////////////////////////////////////////////////////////////////
345 //----------------------------------------------------------------------
346 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
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 kangleA = 0.0275; // angle in rad. of anode and cathodes
351 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
352 const Float_t kpitch = 0.0095;// cm anode separation.
353 const Int_t kNstrips = 768; // number of anode or cathode strips.
354 Float_t *leA,*leC; // array of low edges anode and cathorde.
357 leA = new Float_t[kNstrips+1];
358 leC = new Float_t[kNstrips+1];
360 leA[1] = -kpitch*(0.5*kNstrips-1);
362 leC[1] = kpitch*(0.5*kNstrips-1);
363 for(i=1;i<kNstrips;i++){
364 leA[i+1] = leA[i] + kpitch;
365 leC[i+1] = leC[i] - kpitch;
367 leA[kNstrips] = kDxyz[0];
368 leC[kNstrips] = -kDxyz[0];
369 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
370 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
371 kNstrips+1,leA,kNstrips+1,leC);
374 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
376 //________________________________________________________________________
377 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
378 ////////////////////////////////////////////////////////////////////////
379 // Standard output streaming function.
380 ////////////////////////////////////////////////////////////////////////
385 //----------------------------------------------------------------------
386 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
387 ////////////////////////////////////////////////////////////////////////
388 // Standard input streaming function.
389 ////////////////////////////////////////////////////////////////////////
394 //======================================================================
397 Revision 1.10 2001/02/09 00:00:57 nilsen
398 Fixed compatibility problem with HP unix {ios::fmtflags -> Int_t}. Fixed
399 bugs in iostream based streamers used to read and write .det files. Fixed
400 some detector sizes. Fixed bugs in some default-special constructors.
402 Revision 1.9 2001/02/03 00:00:30 nilsen
403 New version of AliITSgeom and related files. Now uses automatic streamers,
404 set up for new formatted .det file which includes detector information.
405 Additional smaller modifications are still to come.
408 //#include "AliITSgeomSSD75and275.h"
410 ClassImp(AliITSgeomSSD75and275)
412 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
413 ////////////////////////////////////////////////////////////////////////
414 // default constructor
415 ////////////////////////////////////////////////////////////////////////
417 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
419 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
420 // Size of sensitive detector area x,y(thickness),z
421 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
422 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
423 const Float_t kpitch = 0.0095;// cm anode separation.
424 const Int_t kNstrips = 768; // number of anode or cathode strips.
425 Float_t *leA,*leC; // array of low edges anode and cathorde.
428 leA = new Float_t[kNstrips+1];
429 leC = new Float_t[kNstrips+1];
431 leA[1] = -kpitch*(0.5*kNstrips-1);
433 leC[1] = kpitch*(0.5*kNstrips-1);
434 for(i=1;i<kNstrips;i++){
435 leA[i+1] = leA[i] + kpitch;
436 leC[i+1] = leC[i] - kpitch;
438 leA[kNstrips] = kDxyz[0];
439 leC[kNstrips] = -kDxyz[0];
440 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
441 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
442 kNstrips+1,leA,kNstrips+1,leC);
445 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
447 //________________________________________________________________________
448 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
449 ////////////////////////////////////////////////////////////////////////
450 // Standard output streaming function.
451 ////////////////////////////////////////////////////////////////////////
456 //----------------------------------------------------------------------
457 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
458 ////////////////////////////////////////////////////////////////////////
459 // Standard input streaming function.
460 ////////////////////////////////////////////////////////////////////////
465 //======================================================================