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 ////////////////////////////////////////////////////////////////////////
27 #include <Riostream.h>
32 #include "AliITSgeomSSD.h"
34 ClassImp(AliITSgeomSSD)
37 AliITSgeomSSD::AliITSgeomSSD():
51 // Default constructor
59 //----------------------------------------------------------------------
60 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
61 Int_t np,Float_t *p,Int_t nn,Float_t *n):
75 ////////////////////////////////////////////////////////////////////////
76 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
77 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
78 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
79 ///////////////////////////////////////////////////////////////////////
86 ResetSSD(box,ap,an,np,p,nn,n);
88 //----------------------------------------------------------------------
89 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
90 Int_t np,Float_t *p,Int_t nn,Float_t *n){
91 ////////////////////////////////////////////////////////////////////////
92 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
93 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
94 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
95 ///////////////////////////////////////////////////////////////////////
99 fTitle = "Active volume of SSD";
104 if(fLowEdgeP!=0) delete fLowEdgeP;
105 if(fLowEdgeN!=0) delete fLowEdgeN;
110 fLowEdgeP = new Float_t[fNp];
111 fLowEdgeN = new Float_t[fNn];
112 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
113 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
115 //______________________________________________________________________
116 AliITSgeomSSD::~AliITSgeomSSD(){
119 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
120 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
126 //______________________________________________________________________
127 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source) : TObject(source),
128 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){
129 ////////////////////////////////////////////////////////////////////////
131 ////////////////////////////////////////////////////////////////////////
134 fLowEdgeP = new Float_t[fNp];
135 fLowEdgeN = new Float_t[fNn];
136 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
137 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
141 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
142 ////////////////////////////////////////////////////////////////////////
143 // assignment operator
144 ////////////////////////////////////////////////////////////////////////
146 this->~AliITSgeomSSD();
147 new(this) AliITSgeomSSD(source);
151 //______________________________________________________________________
152 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
153 // Given a GEANT detector local coordinate, cm, this function returns
154 // the detector specific P and N side strip numbers.
156 // Float_t x Geant detector local x coordinate in cm
157 // Float_t z Geant detector local z coordinate in cm
159 // Int_t &a Detector anode strip number (P side)
160 // Int_t &c Detector cathode strip number (N side)
164 // project on to bonding edges.
165 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
166 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
167 if(d<fLowEdgeP[0]) i=-1;
168 else for(i=0;i<fNp;i++){
169 if(fLowEdgeP[i]<d) break;
172 if(b<fLowEdgeN[0]) i=-1;
173 else for(i=0;i<fNn;i++){
174 if(fLowEdgeN[i]<b) break;
179 //______________________________________________________________________
180 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
183 // use AliITSsegmentationSSD.
187 Error("Det2Locat","Use AliITSsegmentationSSD");
190 //______________________________________________________________________
191 void AliITSgeomSSD::Print(ostream *os) const {
192 ////////////////////////////////////////////////////////////////////////
193 // Standard output format for this class.
194 ////////////////////////////////////////////////////////////////////////
203 #if defined __ICC || defined __ECC || defined __xlC__
210 fmt = os->setf(ios::scientific); // set scientific floating point output
211 *os << "TBRIK" << " ";
212 *os << setprecision(16) << GetDx() << " ";
213 *os << setprecision(16) << GetDy() << " ";
214 *os << setprecision(16) << GetDz() << " ";
215 *os << fNp << " " << fNn << " ";
216 *os << setprecision(16) << fAngleP << " ";
217 *os << setprecision(16) << fAngleN << " ";
218 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
219 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
221 os->flags(fmt); // reset back to old formating.
224 //______________________________________________________________________
225 void AliITSgeomSSD::Read(istream *is){
226 ////////////////////////////////////////////////////////////////////////
227 // Standard input format for this class.
228 ////////////////////////////////////////////////////////////////////////
233 *is >> fDx >> fDy >> fDz;
235 *is >> fAngleP >> fAngleN;
236 if(fLowEdgeP !=0) delete fLowEdgeP;
237 if(fLowEdgeN !=0) delete fLowEdgeN;
238 fLowEdgeP = new Float_t[fNp];
239 fLowEdgeN = new Float_t[fNn];
240 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
241 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
244 //----------------------------------------------------------------------
245 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
246 ////////////////////////////////////////////////////////////////////////
247 // Standard output streaming function.
248 ////////////////////////////////////////////////////////////////////////
253 //----------------------------------------------------------------------
254 istream &operator>>(istream &is,AliITSgeomSSD &r){
255 ////////////////////////////////////////////////////////////////////////
256 // Standard input streaming function.
257 ////////////////////////////////////////////////////////////////////////
262 //======================================================================
264 ClassImp(AliITSgeomSSD175)
266 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
267 ////////////////////////////////////////////////////////////////////////
268 // default constructor
269 ////////////////////////////////////////////////////////////////////////
270 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
271 // Size of sensitive detector area x,y(thickness),z
272 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
273 const Float_t kpitch = 0.0095;// cm anode separation.
274 const Int_t kNstrips = 768; // number of anode or cathode strips.
275 Float_t *leA,*leC; // array of low edges anode and cathorde.
278 leA = new Float_t[kNstrips+1];
279 leC = new Float_t[kNstrips+1];
281 leA[1] = -kpitch*(0.5*kNstrips-1);
283 leC[1] = kpitch*(0.5*kNstrips-1);
284 for(i=1;i<kNstrips;i++){
285 leA[i+1] = leA[i] + kpitch;
286 leC[i+1] = leC[i] - kpitch;
288 leA[kNstrips] = kDxyz[0];
289 leC[kNstrips] = -kDxyz[0];
290 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
291 kNstrips+1,leA,kNstrips+1,leC);
295 //________________________________________________________________________
296 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
297 ////////////////////////////////////////////////////////////////////////
298 // Standard output streaming function.
299 ////////////////////////////////////////////////////////////////////////
304 //----------------------------------------------------------------------
305 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
306 ////////////////////////////////////////////////////////////////////////
307 // Standard input streaming function.
308 ////////////////////////////////////////////////////////////////////////
313 AliITSgeomSSD& AliITSgeomSSD175::operator=(const AliITSgeomSSD &source) {
314 ////////////////////////////////////////////////////////////////////////
315 // assignment operator
316 ////////////////////////////////////////////////////////////////////////
319 if(this == &source) return *this;
320 Error("AliITSgeomSSD175","Not allowed to make a = with "
321 "AliITSgeomSSD175 Using default creater instead");
325 //======================================================================
327 ClassImp(AliITSgeomSSD275and75)
329 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
330 ////////////////////////////////////////////////////////////////////////
331 // default constructor
332 ////////////////////////////////////////////////////////////////////////
334 //----------------------------------------------------------------------
335 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
337 // Default constructor for AliITSgeomSSD with strip angles of
338 // 275 miliradians and 75 miliradians. This constructor initlizes
339 // AliITSgeomSSD with the correct values. This is the miror image
340 // of the AliITSgeomSSD75and275 class.
341 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
342 // Size of sensitive detector area x,y(thickness),z
343 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
344 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
345 const Float_t kpitch = 0.0095;// cm anode separation.
346 const Int_t kNstrips = 768; // number of anode or cathode strips.
347 Float_t *leA,*leC; // array of low edges anode and cathorde.
351 Error("AliITSgeomSSD275and75",
352 "npar=%d<3. array par must be [3] or larger.",npar);
355 leA = new Float_t[kNstrips+1];
356 leC = new Float_t[kNstrips+1];
358 leA[1] = -kpitch*(0.5*kNstrips-1);
360 leC[1] = kpitch*(0.5*kNstrips-1);
361 for(i=1;i<kNstrips;i++){
362 leA[i+1] = leA[i] + kpitch;
363 leC[i+1] = leC[i] - kpitch;
365 leA[kNstrips] = kDxyz[0];
366 leC[kNstrips] = -kDxyz[0];
367 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
368 kNstrips+1,leA,kNstrips+1,leC);
372 //________________________________________________________________________
373 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
374 ////////////////////////////////////////////////////////////////////////
375 // Standard output streaming function.
376 ////////////////////////////////////////////////////////////////////////
381 //----------------------------------------------------------------------
382 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
383 ////////////////////////////////////////////////////////////////////////
384 // Standard input streaming function.
385 ////////////////////////////////////////////////////////////////////////
390 AliITSgeomSSD& AliITSgeomSSD275and75::operator=(const AliITSgeomSSD &source) {
391 ////////////////////////////////////////////////////////////////////////
392 // assignment operator
393 ////////////////////////////////////////////////////////////////////////
396 if(this == &source) return *this;
397 Error("AliITSgeomSSD275and75","Not allowed to make a = with "
398 "AliITSgeomSSD275and75 Using default creater instead");
403 //======================================================================
405 ClassImp(AliITSgeomSSD75and275)
407 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
408 ////////////////////////////////////////////////////////////////////////
409 // default constructor
410 ////////////////////////////////////////////////////////////////////////
412 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
414 // Default constructor for AliITSgeomSSD with strip angles of
415 // 75 miliradians and 275 miliradians. This constructor initlizes
416 // AliITSgeomSSD with the correct values. This is the miror image
417 // of the AliITSgeomSSD275and75 class.
418 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
419 // Size of sensitive detector area x,y(thickness),z
420 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
421 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
422 const Float_t kpitch = 0.0095;// cm anode separation.
423 const Int_t kNstrips = 768; // number of anode or cathode strips.
424 Float_t *leA,*leC; // array of low edges anode and cathorde.
428 Error("AliITSgeomSSD75and275",
429 "npar=%d<3. array par must be [3] or larger.",npar);
432 leA = new Float_t[kNstrips+1];
433 leC = new Float_t[kNstrips+1];
435 leA[1] = -kpitch*(0.5*kNstrips-1);
437 leC[1] = kpitch*(0.5*kNstrips-1);
438 for(i=1;i<kNstrips;i++){
439 leA[i+1] = leA[i] + kpitch;
440 leC[i+1] = leC[i] - kpitch;
442 leA[kNstrips] = kDxyz[0];
443 leC[kNstrips] = -kDxyz[0];
444 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
445 kNstrips+1,leA,kNstrips+1,leC);
449 //________________________________________________________________________
450 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
451 ////////////////////////////////////////////////////////////////////////
452 // Standard output streaming function.
453 ////////////////////////////////////////////////////////////////////////
458 //----------------------------------------------------------------------
459 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
460 ////////////////////////////////////////////////////////////////////////
461 // Standard input streaming function.
462 ////////////////////////////////////////////////////////////////////////
467 AliITSgeomSSD& AliITSgeomSSD75and275::operator=(const AliITSgeomSSD &source) {
468 ////////////////////////////////////////////////////////////////////////
469 // assignment operator
470 ////////////////////////////////////////////////////////////////////////
473 if(this == &source) return *this;
474 Error("AliITSgeomSSD75and275","Not allowed to make a = with "
475 "AliITSgeomSSD75and275 Using default creater instead");
480 //======================================================================