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 fName(source.fName),fTitle(source.fTitle),fMat(source.fMat),fDx(source.fDx),fDy(source.fDy),fDz(source.fDz),fNp(source.fNp),fNn(source.fNn),fLowEdgeP(0),fLowEdgeN(0),fAngleP(source.fAngleP),fAngleN(source.fAngleN){
127 ////////////////////////////////////////////////////////////////////////
129 ////////////////////////////////////////////////////////////////////////
132 fLowEdgeP = new Float_t[fNp];
133 fLowEdgeN = new Float_t[fNn];
134 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
135 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
139 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
140 ////////////////////////////////////////////////////////////////////////
141 // assignment operator
142 ////////////////////////////////////////////////////////////////////////
144 this->~AliITSgeomSSD();
145 new(this) AliITSgeomSSD(source);
149 //______________________________________________________________________
150 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
151 // Given a GEANT detector local coordinate, cm, this function returns
152 // the detector specific P and N side strip numbers.
154 // Float_t x Geant detector local x coordinate in cm
155 // Float_t z Geant detector local z coordinate in cm
157 // Int_t &a Detector anode strip number (P side)
158 // Int_t &c Detector cathode strip number (N side)
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){
181 // use AliITSsegmentationSSD.
185 Error("Det2Locat","Use AliITSsegmentationSSD");
188 //______________________________________________________________________
189 void AliITSgeomSSD::Print(ostream *os) const {
190 ////////////////////////////////////////////////////////////////////////
191 // Standard output format for this class.
192 ////////////////////////////////////////////////////////////////////////
201 #if defined __ICC || defined __ECC || defined __xlC__
208 fmt = os->setf(ios::scientific); // set scientific floating point output
209 *os << "TBRIK" << " ";
210 *os << setprecision(16) << GetDx() << " ";
211 *os << setprecision(16) << GetDy() << " ";
212 *os << setprecision(16) << GetDz() << " ";
213 *os << fNp << " " << fNn << " ";
214 *os << setprecision(16) << fAngleP << " ";
215 *os << setprecision(16) << fAngleN << " ";
216 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
217 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
219 os->flags(fmt); // reset back to old formating.
222 //______________________________________________________________________
223 void AliITSgeomSSD::Read(istream *is){
224 ////////////////////////////////////////////////////////////////////////
225 // Standard input format for this class.
226 ////////////////////////////////////////////////////////////////////////
231 *is >> fDx >> fDy >> fDz;
233 *is >> fAngleP >> fAngleN;
234 if(fLowEdgeP !=0) delete fLowEdgeP;
235 if(fLowEdgeN !=0) delete fLowEdgeN;
236 fLowEdgeP = new Float_t[fNp];
237 fLowEdgeN = new Float_t[fNn];
238 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
239 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
242 //----------------------------------------------------------------------
243 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
244 ////////////////////////////////////////////////////////////////////////
245 // Standard output streaming function.
246 ////////////////////////////////////////////////////////////////////////
251 //----------------------------------------------------------------------
252 istream &operator>>(istream &is,AliITSgeomSSD &r){
253 ////////////////////////////////////////////////////////////////////////
254 // Standard input streaming function.
255 ////////////////////////////////////////////////////////////////////////
260 //======================================================================
262 ClassImp(AliITSgeomSSD175)
264 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
265 ////////////////////////////////////////////////////////////////////////
266 // default constructor
267 ////////////////////////////////////////////////////////////////////////
268 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
269 // Size of sensitive detector area x,y(thickness),z
270 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
271 const Float_t kpitch = 0.0095;// cm anode separation.
272 const Int_t kNstrips = 768; // number of anode or cathode strips.
273 Float_t *leA,*leC; // array of low edges anode and cathorde.
276 leA = new Float_t[kNstrips+1];
277 leC = new Float_t[kNstrips+1];
279 leA[1] = -kpitch*(0.5*kNstrips-1);
281 leC[1] = kpitch*(0.5*kNstrips-1);
282 for(i=1;i<kNstrips;i++){
283 leA[i+1] = leA[i] + kpitch;
284 leC[i+1] = leC[i] - kpitch;
286 leA[kNstrips] = kDxyz[0];
287 leC[kNstrips] = -kDxyz[0];
288 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
289 kNstrips+1,leA,kNstrips+1,leC);
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 AliITSgeomSSD& AliITSgeomSSD175::operator=(const AliITSgeomSSD &source) {
312 ////////////////////////////////////////////////////////////////////////
313 // assignment operator
314 ////////////////////////////////////////////////////////////////////////
317 if(this == &source) return *this;
318 Error("AliITSgeomSSD175","Not allowed to make a = with "
319 "AliITSgeomSSD175 Using default creater instead");
323 //======================================================================
325 ClassImp(AliITSgeomSSD275and75)
327 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
328 ////////////////////////////////////////////////////////////////////////
329 // default constructor
330 ////////////////////////////////////////////////////////////////////////
332 //----------------------------------------------------------------------
333 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
335 // Default constructor for AliITSgeomSSD with strip angles of
336 // 275 miliradians and 75 miliradians. This constructor initlizes
337 // AliITSgeomSSD with the correct values. This is the miror image
338 // of the AliITSgeomSSD75and275 class.
339 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
340 // Size of sensitive detector area x,y(thickness),z
341 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
342 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
343 const Float_t kpitch = 0.0095;// cm anode separation.
344 const Int_t kNstrips = 768; // number of anode or cathode strips.
345 Float_t *leA,*leC; // array of low edges anode and cathorde.
349 Error("AliITSgeomSSD275and75",
350 "npar=%d<3. array par must be [3] or larger.",npar);
353 leA = new Float_t[kNstrips+1];
354 leC = new Float_t[kNstrips+1];
356 leA[1] = -kpitch*(0.5*kNstrips-1);
358 leC[1] = kpitch*(0.5*kNstrips-1);
359 for(i=1;i<kNstrips;i++){
360 leA[i+1] = leA[i] + kpitch;
361 leC[i+1] = leC[i] - kpitch;
363 leA[kNstrips] = kDxyz[0];
364 leC[kNstrips] = -kDxyz[0];
365 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
366 kNstrips+1,leA,kNstrips+1,leC);
370 //________________________________________________________________________
371 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
372 ////////////////////////////////////////////////////////////////////////
373 // Standard output streaming function.
374 ////////////////////////////////////////////////////////////////////////
379 //----------------------------------------------------------------------
380 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
381 ////////////////////////////////////////////////////////////////////////
382 // Standard input streaming function.
383 ////////////////////////////////////////////////////////////////////////
388 AliITSgeomSSD& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD &source) {
389 ////////////////////////////////////////////////////////////////////////
390 // assignment operator
391 ////////////////////////////////////////////////////////////////////////
394 if(this == &source) return *this;
395 Error("AliITSgeomSSD275and75","Not allowed to make a = with "
396 "AliITSgeomSSD275and75 Using default creater instead");
401 //======================================================================
403 ClassImp(AliITSgeomSSD75and275)
405 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
406 ////////////////////////////////////////////////////////////////////////
407 // default constructor
408 ////////////////////////////////////////////////////////////////////////
410 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
412 // Default constructor for AliITSgeomSSD with strip angles of
413 // 75 miliradians and 275 miliradians. This constructor initlizes
414 // AliITSgeomSSD with the correct values. This is the miror image
415 // of the AliITSgeomSSD275and75 class.
416 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
417 // Size of sensitive detector area x,y(thickness),z
418 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
419 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
420 const Float_t kpitch = 0.0095;// cm anode separation.
421 const Int_t kNstrips = 768; // number of anode or cathode strips.
422 Float_t *leA,*leC; // array of low edges anode and cathorde.
426 Error("AliITSgeomSSD75and275",
427 "npar=%d<3. array par must be [3] or larger.",npar);
430 leA = new Float_t[kNstrips+1];
431 leC = new Float_t[kNstrips+1];
433 leA[1] = -kpitch*(0.5*kNstrips-1);
435 leC[1] = kpitch*(0.5*kNstrips-1);
436 for(i=1;i<kNstrips;i++){
437 leA[i+1] = leA[i] + kpitch;
438 leC[i+1] = leC[i] - kpitch;
440 leA[kNstrips] = kDxyz[0];
441 leC[kNstrips] = -kDxyz[0];
442 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
443 kNstrips+1,leA,kNstrips+1,leC);
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 AliITSgeomSSD& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD &source) {
466 ////////////////////////////////////////////////////////////////////////
467 // assignment operator
468 ////////////////////////////////////////////////////////////////////////
471 if(this == &source) return *this;
472 Error("AliITSgeomSSD75and275","Not allowed to make a = with "
473 "AliITSgeomSSD75and275 Using default creater instead");
478 //======================================================================