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 ////////////////////////////////////////////////////////////////////////
19 // This class is for the Silicon Strip Detector, SSD, specific geometry.
20 // It is being replaced by AliITSsegmentationSSD class. This file also
21 // constains classes derived from AliITSgeomSSD which do nothing but
22 // initilize this one with predefined values.
23 ////////////////////////////////////////////////////////////////////////
25 #include <Riostream.h>
30 #include "AliITSgeomSSD.h"
32 ClassImp(AliITSgeomSSD)
35 AliITSgeomSSD::AliITSgeomSSD():
49 // Default constructor
57 //----------------------------------------------------------------------
58 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
59 Int_t np,Float_t *p,Int_t nn,Float_t *n):
73 ////////////////////////////////////////////////////////////////////////
74 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
75 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
76 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
77 ///////////////////////////////////////////////////////////////////////
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 ///////////////////////////////////////////////////////////////////////
97 fTitle = "Active volume of SSD";
102 if(fLowEdgeP!=0) delete fLowEdgeP;
103 if(fLowEdgeN!=0) delete fLowEdgeN;
108 fLowEdgeP = new Float_t[fNp];
109 fLowEdgeN = new Float_t[fNn];
110 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
111 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
113 //______________________________________________________________________
114 AliITSgeomSSD::~AliITSgeomSSD(){
117 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
118 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
124 //______________________________________________________________________
125 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source) : TObject(source){
126 ////////////////////////////////////////////////////////////////////////
128 ////////////////////////////////////////////////////////////////////////
131 if(this == &source) return;
132 fName = source.fName;
133 fTitle = source.fTitle;
138 this->fNp = source.fNp;
139 this->fNn = source.fNn;
142 this->fAngleP = source.fAngleP;
143 this->fAngleN = source.fAngleN;
144 fLowEdgeP = new Float_t[fNp];
145 fLowEdgeN = new Float_t[fNn];
146 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
147 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
151 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
152 ////////////////////////////////////////////////////////////////////////
153 // assignment operator
154 ////////////////////////////////////////////////////////////////////////
157 if(this == &source) return *this;
158 fName = source.fName;
159 fTitle = source.fTitle;
164 this->fNp = source.fNp;
165 this->fNn = source.fNn;
168 this->fAngleP = source.fAngleP;
169 this->fAngleN = source.fAngleN;
170 fLowEdgeP = new Float_t[fNp];
171 fLowEdgeN = new Float_t[fNn];
172 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
173 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
176 //______________________________________________________________________
177 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
178 // Given a GEANT detector local coordinate, cm, this function returns
179 // the detector specific P and N side strip numbers.
181 // Float_t x Geant detector local x coordinate in cm
182 // Float_t z Geant detector local z coordinate in cm
184 // Int_t &a Detector anode strip number (P side)
185 // Int_t &c Detector cathode strip number (N side)
189 // project on to bonding edges.
190 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
191 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
192 if(d<fLowEdgeP[0]) i=-1;
193 else for(i=0;i<fNp;i++){
194 if(fLowEdgeP[i]<d) break;
197 if(b<fLowEdgeN[0]) i=-1;
198 else for(i=0;i<fNn;i++){
199 if(fLowEdgeN[i]<b) break;
204 //______________________________________________________________________
205 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
208 // use AliITSsegmentationSSD.
212 Error("Det2Locat","Use AliITSsegmentationSSD");
215 //______________________________________________________________________
216 void AliITSgeomSSD::Print(ostream *os) const {
217 ////////////////////////////////////////////////////////////////////////
218 // Standard output format for this class.
219 ////////////////////////////////////////////////////////////////////////
228 #if defined __ICC || defined __ECC || defined __xlC__
235 fmt = os->setf(ios::scientific); // set scientific floating point output
236 *os << "TBRIK" << " ";
237 *os << setprecision(16) << GetDx() << " ";
238 *os << setprecision(16) << GetDy() << " ";
239 *os << setprecision(16) << GetDz() << " ";
240 *os << fNp << " " << fNn << " ";
241 *os << setprecision(16) << fAngleP << " ";
242 *os << setprecision(16) << fAngleN << " ";
243 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
244 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
246 os->flags(fmt); // reset back to old formating.
249 //______________________________________________________________________
250 void AliITSgeomSSD::Read(istream *is){
251 ////////////////////////////////////////////////////////////////////////
252 // Standard input format for this class.
253 ////////////////////////////////////////////////////////////////////////
258 *is >> fDx >> fDy >> fDz;
260 *is >> fAngleP >> fAngleN;
261 if(fLowEdgeP !=0) delete fLowEdgeP;
262 if(fLowEdgeN !=0) delete fLowEdgeN;
263 fLowEdgeP = new Float_t[fNp];
264 fLowEdgeN = new Float_t[fNn];
265 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
266 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
269 //----------------------------------------------------------------------
270 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
271 ////////////////////////////////////////////////////////////////////////
272 // Standard output streaming function.
273 ////////////////////////////////////////////////////////////////////////
278 //----------------------------------------------------------------------
279 istream &operator>>(istream &is,AliITSgeomSSD &r){
280 ////////////////////////////////////////////////////////////////////////
281 // Standard input streaming function.
282 ////////////////////////////////////////////////////////////////////////
287 //======================================================================
289 ClassImp(AliITSgeomSSD175)
291 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
292 ////////////////////////////////////////////////////////////////////////
293 // default constructor
294 ////////////////////////////////////////////////////////////////////////
295 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
296 // Size of sensitive detector area x,y(thickness),z
297 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
298 const Float_t kpitch = 0.0095;// cm anode separation.
299 const Int_t kNstrips = 768; // number of anode or cathode strips.
300 Float_t *leA,*leC; // array of low edges anode and cathorde.
303 leA = new Float_t[kNstrips+1];
304 leC = new Float_t[kNstrips+1];
306 leA[1] = -kpitch*(0.5*kNstrips-1);
308 leC[1] = kpitch*(0.5*kNstrips-1);
309 for(i=1;i<kNstrips;i++){
310 leA[i+1] = leA[i] + kpitch;
311 leC[i+1] = leC[i] - kpitch;
313 leA[kNstrips] = kDxyz[0];
314 leC[kNstrips] = -kDxyz[0];
315 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
316 kNstrips+1,leA,kNstrips+1,leC);
320 //________________________________________________________________________
321 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
322 ////////////////////////////////////////////////////////////////////////
323 // Standard output streaming function.
324 ////////////////////////////////////////////////////////////////////////
329 //----------------------------------------------------------------------
330 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
331 ////////////////////////////////////////////////////////////////////////
332 // Standard input streaming function.
333 ////////////////////////////////////////////////////////////////////////
338 AliITSgeomSSD& AliITSgeomSSD175::operator=(const AliITSgeomSSD &source) {
339 ////////////////////////////////////////////////////////////////////////
340 // assignment operator
341 ////////////////////////////////////////////////////////////////////////
344 if(this == &source) return *this;
345 Error("AliITSgeomSSD175","Not allowed to make a = with "
346 "AliITSgeomSSD175 Using default creater instead");
350 //======================================================================
352 ClassImp(AliITSgeomSSD275and75)
354 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
355 ////////////////////////////////////////////////////////////////////////
356 // default constructor
357 ////////////////////////////////////////////////////////////////////////
359 //----------------------------------------------------------------------
360 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
362 // Default constructor for AliITSgeomSSD with strip angles of
363 // 275 miliradians and 75 miliradians. This constructor initlizes
364 // AliITSgeomSSD with the correct values. This is the miror image
365 // of the AliITSgeomSSD75and275 class.
366 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
367 // Size of sensitive detector area x,y(thickness),z
368 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
369 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
370 const Float_t kpitch = 0.0095;// cm anode separation.
371 const Int_t kNstrips = 768; // number of anode or cathode strips.
372 Float_t *leA,*leC; // array of low edges anode and cathorde.
376 Error("AliITSgeomSSD275and75",
377 "npar=%d<3. array par must be [3] or larger.",npar);
380 leA = new Float_t[kNstrips+1];
381 leC = new Float_t[kNstrips+1];
383 leA[1] = -kpitch*(0.5*kNstrips-1);
385 leC[1] = kpitch*(0.5*kNstrips-1);
386 for(i=1;i<kNstrips;i++){
387 leA[i+1] = leA[i] + kpitch;
388 leC[i+1] = leC[i] - kpitch;
390 leA[kNstrips] = kDxyz[0];
391 leC[kNstrips] = -kDxyz[0];
392 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
393 kNstrips+1,leA,kNstrips+1,leC);
397 //________________________________________________________________________
398 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
399 ////////////////////////////////////////////////////////////////////////
400 // Standard output streaming function.
401 ////////////////////////////////////////////////////////////////////////
406 //----------------------------------------------------------------------
407 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
408 ////////////////////////////////////////////////////////////////////////
409 // Standard input streaming function.
410 ////////////////////////////////////////////////////////////////////////
415 AliITSgeomSSD& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD &source) {
416 ////////////////////////////////////////////////////////////////////////
417 // assignment operator
418 ////////////////////////////////////////////////////////////////////////
421 if(this == &source) return *this;
422 Error("AliITSgeomSSD275and75","Not allowed to make a = with "
423 "AliITSgeomSSD275and75 Using default creater instead");
428 //======================================================================
430 ClassImp(AliITSgeomSSD75and275)
432 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
433 ////////////////////////////////////////////////////////////////////////
434 // default constructor
435 ////////////////////////////////////////////////////////////////////////
437 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
439 // Default constructor for AliITSgeomSSD with strip angles of
440 // 75 miliradians and 275 miliradians. This constructor initlizes
441 // AliITSgeomSSD with the correct values. This is the miror image
442 // of the AliITSgeomSSD275and75 class.
443 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
444 // Size of sensitive detector area x,y(thickness),z
445 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
446 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
447 const Float_t kpitch = 0.0095;// cm anode separation.
448 const Int_t kNstrips = 768; // number of anode or cathode strips.
449 Float_t *leA,*leC; // array of low edges anode and cathorde.
453 Error("AliITSgeomSSD75and275",
454 "npar=%d<3. array par must be [3] or larger.",npar);
457 leA = new Float_t[kNstrips+1];
458 leC = new Float_t[kNstrips+1];
460 leA[1] = -kpitch*(0.5*kNstrips-1);
462 leC[1] = kpitch*(0.5*kNstrips-1);
463 for(i=1;i<kNstrips;i++){
464 leA[i+1] = leA[i] + kpitch;
465 leC[i+1] = leC[i] - kpitch;
467 leA[kNstrips] = kDxyz[0];
468 leC[kNstrips] = -kDxyz[0];
469 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
470 kNstrips+1,leA,kNstrips+1,leC);
474 //________________________________________________________________________
475 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
476 ////////////////////////////////////////////////////////////////////////
477 // Standard output streaming function.
478 ////////////////////////////////////////////////////////////////////////
483 //----------------------------------------------------------------------
484 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
485 ////////////////////////////////////////////////////////////////////////
486 // Standard input streaming function.
487 ////////////////////////////////////////////////////////////////////////
492 AliITSgeomSSD& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD &source) {
493 ////////////////////////////////////////////////////////////////////////
494 // assignment operator
495 ////////////////////////////////////////////////////////////////////////
498 if(this == &source) return *this;
499 Error("AliITSgeomSSD75and275","Not allowed to make a = with "
500 "AliITSgeomSSD75and275 Using default creater instead");
505 //======================================================================