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.9 2001/02/03 00:00:30 nilsen
19 New version of AliITSgeom and related files. Now uses automatic streamers,
20 set up for new formatted .det file which includes detector information.
21 Additional smaller modifications are still to come.
23 Revision 1.8 2000/10/02 16:32:43 barbera
24 Forward declaration added
26 Revision 1.2.4.8 2000/10/02 15:53:49 barbera
27 Forward declaration added
29 Revision 1.7 2000/07/10 16:07:18 fca
30 Release version of ITS code
32 Revision 1.2.4.2 2000/03/04 23:55:59 nilsen
33 Fixed up the comments/documentation
35 Revision 1.2.4.1 2000/01/12 19:03:32 nilsen
36 This is the version of the files after the merging done in December 1999.
37 See the ReadMe110100.txt file for details
39 Revision 1.2 1999/09/29 09:24:20 fca
40 Introduction of the Copyright and cvs Log
49 #include "AliITSgeomSSD.h"
51 ClassImp(AliITSgeomSSD)
54 AliITSgeomSSD::AliITSgeomSSD(){
55 // Default constructor
64 //----------------------------------------------------------------------
65 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
66 Int_t np,Float_t *p,Int_t nn,Float_t *n){
67 ////////////////////////////////////////////////////////////////////////
68 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
69 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
70 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
71 ///////////////////////////////////////////////////////////////////////
79 ResetSSD(box,ap,an,np,p,nn,n);
81 //----------------------------------------------------------------------
82 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
83 Int_t np,Float_t *p,Int_t nn,Float_t *n){
84 ////////////////////////////////////////////////////////////////////////
85 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
86 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
87 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
88 ///////////////////////////////////////////////////////////////////////
91 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
92 box[0],box[1],box[2]);
93 // if(fLowEdgeP!=0) delete fLowEdgeP;
94 // if(fLowEdgeN!=0) delete fLowEdgeN;
99 fLowEdgeP = new Float_t[fNp];
100 fLowEdgeN = new Float_t[fNn];
101 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
102 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
104 //______________________________________________________________________
105 AliITSgeomSSD::~AliITSgeomSSD(){
108 delete fLowEdgeP; fLowEdgeP = 0;
109 delete fLowEdgeN; fLowEdgeN = 0;
110 delete fShapeSSD; fShapeSSD = 0;
116 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
117 ////////////////////////////////////////////////////////////////////////
119 ////////////////////////////////////////////////////////////////////////
122 if(this == &source) return;
123 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
124 this->fNp = source.fNp;
125 this->fNn = source.fNn;
128 this->fAngleP = source.fAngleP;
129 this->fAngleN = source.fAngleN;
130 fLowEdgeP = new Float_t[fNp];
131 fLowEdgeN = new Float_t[fNn];
132 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
133 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
137 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
138 ////////////////////////////////////////////////////////////////////////
139 // assignment operator
140 ////////////////////////////////////////////////////////////////////////
143 if(this == &source) return *this;
144 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
145 this->fNp = source.fNp;
146 this->fNn = source.fNn;
149 this->fAngleP = source.fAngleP;
150 this->fAngleN = source.fAngleN;
151 fLowEdgeP = new Float_t[fNp];
152 fLowEdgeN = new Float_t[fNn];
153 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
154 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
157 //______________________________________________________________________
158 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
162 // project on to bonding edges.
163 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
164 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
165 if(d<fLowEdgeP[0]) i=-1;
166 else for(i=0;i<fNp;i++){
167 if(fLowEdgeP[i]<d) break;
170 if(b<fLowEdgeN[0]) i=-1;
171 else for(i=0;i<fNn;i++){
172 if(fLowEdgeN[i]<b) break;
177 //______________________________________________________________________
178 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
184 //______________________________________________________________________
185 void AliITSgeomSSD::Print(ostream *os) const {
186 ////////////////////////////////////////////////////////////////////////
187 // Standard output format for this class.
188 ////////////////////////////////////////////////////////////////////////
192 fmt = os->setf(ios::scientific); // set scientific floating point output
193 *os << "TBRIK" << " ";
194 *os << setprecision(16) << GetDx() << " ";
195 *os << setprecision(16) << GetDy() << " ";
196 *os << setprecision(16) << GetDz() << " ";
197 *os << fNp << " " << fNn << " ";
198 *os << setprecision(16) << fAngleP << " ";
199 *os << setprecision(16) << fAngleN << " ";
200 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
201 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
203 os->flags(fmt); // reset back to old formating.
206 //______________________________________________________________________
207 void AliITSgeomSSD::Read(istream *is){
208 ////////////////////////////////////////////////////////////////////////
209 // Standard input format for this class.
210 ////////////////////////////////////////////////////////////////////////
216 *is >> dx >> dy >> dz;
217 if(fShapeSSD!=0) delete fShapeSSD;
218 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
221 *is >> fAngleP >> fAngleN;
222 if(fLowEdgeP !=0) delete fLowEdgeP;
223 if(fLowEdgeN !=0) delete fLowEdgeN;
224 fLowEdgeP = new Float_t[fNp];
225 fLowEdgeN = new Float_t[fNn];
226 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
227 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
230 //----------------------------------------------------------------------
231 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
232 ////////////////////////////////////////////////////////////////////////
233 // Standard output streaming function.
234 ////////////////////////////////////////////////////////////////////////
239 //----------------------------------------------------------------------
240 istream &operator>>(istream &is,AliITSgeomSSD &r){
241 ////////////////////////////////////////////////////////////////////////
242 // Standard input streaming function.
243 ////////////////////////////////////////////////////////////////////////
248 //======================================================================
251 Revision 1.9 2001/02/03 00:00:30 nilsen
252 New version of AliITSgeom and related files. Now uses automatic streamers,
253 set up for new formatted .det file which includes detector information.
254 Additional smaller modifications are still to come.
258 //#include "AliITSgeomSSD175.h"
260 ClassImp(AliITSgeomSSD175)
262 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
263 ////////////////////////////////////////////////////////////////////////
264 // default constructor
265 ////////////////////////////////////////////////////////////////////////
266 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
267 // Size of sensitive detector area x,y(thickness),z
268 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
269 const Float_t kpitch = 0.0095;// cm anode separation.
270 const Int_t kNstrips = 768; // number of anode or cathode strips.
271 Float_t *leA,*leC; // array of low edges anode and cathorde.
274 leA = new Float_t[kNstrips+1];
275 leC = new Float_t[kNstrips+1];
277 leA[1] = -kpitch*(0.5*kNstrips-1);
279 leC[1] = kpitch*(0.5*kNstrips-1);
280 for(i=1;i<kNstrips;i++){
281 leA[i+1] = leA[i] + kpitch;
282 leC[i+1] = leC[i] - kpitch;
284 leA[kNstrips] = kDxyz[0];
285 leC[kNstrips] = -kDxyz[0];
286 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
287 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
288 kNstrips+1,leA,kNstrips+1,leC);
291 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
293 //________________________________________________________________________
294 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
295 ////////////////////////////////////////////////////////////////////////
296 // Standard output streaming function.
297 ////////////////////////////////////////////////////////////////////////
302 //----------------------------------------------------------------------
303 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
304 ////////////////////////////////////////////////////////////////////////
305 // Standard input streaming function.
306 ////////////////////////////////////////////////////////////////////////
311 //======================================================================
314 Revision 1.9 2001/02/03 00:00:30 nilsen
315 New version of AliITSgeom and related files. Now uses automatic streamers,
316 set up for new formatted .det file which includes detector information.
317 Additional smaller modifications are still to come.
321 //#include "AliITSgeomSSD275and75.h"
323 ClassImp(AliITSgeomSSD275and75)
325 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
326 ////////////////////////////////////////////////////////////////////////
327 // default constructor
328 ////////////////////////////////////////////////////////////////////////
329 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
330 // Size of sensitive detector area x,y(thickness),z
331 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
332 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
333 const Float_t kpitch = 0.0095;// cm anode separation.
334 const Int_t kNstrips = 768; // number of anode or cathode strips.
335 Float_t *leA,*leC; // array of low edges anode and cathorde.
338 leA = new Float_t[kNstrips+1];
339 leC = new Float_t[kNstrips+1];
341 leA[1] = -kpitch*(0.5*kNstrips-1);
343 leC[1] = kpitch*(0.5*kNstrips-1);
344 for(i=1;i<kNstrips;i++){
345 leA[i+1] = leA[i] + kpitch;
346 leC[i+1] = leC[i] - kpitch;
348 leA[kNstrips] = kDxyz[0];
349 leC[kNstrips] = -kDxyz[0];
350 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
351 AliITSgeomSSD::ResetSSD(kDxyz,kangleA,kangleC,
352 kNstrips+1,leA,kNstrips+1,leC);
355 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
357 //________________________________________________________________________
358 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
359 ////////////////////////////////////////////////////////////////////////
360 // Standard output streaming function.
361 ////////////////////////////////////////////////////////////////////////
366 //----------------------------------------------------------------------
367 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
368 ////////////////////////////////////////////////////////////////////////
369 // Standard input streaming function.
370 ////////////////////////////////////////////////////////////////////////
375 //======================================================================
378 Revision 1.9 2001/02/03 00:00:30 nilsen
379 New version of AliITSgeom and related files. Now uses automatic streamers,
380 set up for new formatted .det file which includes detector information.
381 Additional smaller modifications are still to come.
384 //#include "AliITSgeomSSD75and275.h"
386 ClassImp(AliITSgeomSSD75and275)
388 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
389 ////////////////////////////////////////////////////////////////////////
390 // default constructor
391 ////////////////////////////////////////////////////////////////////////
392 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
393 // Size of sensitive detector area x,y(thickness),z
394 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
395 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
396 const Float_t kpitch = 0.0095;// cm anode separation.
397 const Int_t kNstrips = 768; // number of anode or cathode strips.
398 Float_t *leA,*leC; // array of low edges anode and cathorde.
401 leA = new Float_t[kNstrips+1];
402 leC = new Float_t[kNstrips+1];
404 leA[1] = -kpitch*(0.5*kNstrips-1);
406 leC[1] = kpitch*(0.5*kNstrips-1);
407 for(i=1;i<kNstrips;i++){
408 leA[i+1] = leA[i] + kpitch;
409 leC[i+1] = leC[i] - kpitch;
411 leA[kNstrips] = kDxyz[0];
412 leC[kNstrips] = -kDxyz[0];
413 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
414 AliITSgeomSSD::ResetSSD(kDxyz,kangleA,kangleC,
415 kNstrips+1,leA,kNstrips+1,leC);
418 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
420 //________________________________________________________________________
421 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
422 ////////////////////////////////////////////////////////////////////////
423 // Standard output streaming function.
424 ////////////////////////////////////////////////////////////////////////
429 //----------------------------------------------------------------------
430 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
431 ////////////////////////////////////////////////////////////////////////
432 // Standard input streaming function.
433 ////////////////////////////////////////////////////////////////////////
438 //======================================================================