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(){
36 // Default constructor
45 //----------------------------------------------------------------------
46 AliITSgeomSSD::AliITSgeomSSD(const Float_t *box,Float_t ap,Float_t an,
47 Int_t np,Float_t *p,Int_t nn,Float_t *n){
48 ////////////////////////////////////////////////////////////////////////
49 // Standard Constructor. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
50 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
51 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
52 ///////////////////////////////////////////////////////////////////////
60 ResetSSD(box,ap,an,np,p,nn,n);
62 //----------------------------------------------------------------------
63 void AliITSgeomSSD::ResetSSD(const Float_t *box,Float_t ap,Float_t an,
64 Int_t np,Float_t *p,Int_t nn,Float_t *n){
65 ////////////////////////////////////////////////////////////////////////
66 // Standard Filler. *box={dx,dy,dz}, ap=anode angle, an=cathode angle,
67 // nn= number of cathodes+1,*n= array of cathode low edges+highest edge,
68 // np= number of anodes+1, *p= array of anode low edges+lighest edge.
69 ///////////////////////////////////////////////////////////////////////
72 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
73 box[0],box[1],box[2]);
74 // if(fLowEdgeP!=0) delete fLowEdgeP;
75 // if(fLowEdgeN!=0) delete fLowEdgeN;
80 fLowEdgeP = new Float_t[fNp];
81 fLowEdgeN = new Float_t[fNn];
82 for(i=0;i<fNp;i++) fLowEdgeP[i] = p[i];
83 for(i=0;i<fNn;i++) fLowEdgeN[i] = n[i];
85 //______________________________________________________________________
86 AliITSgeomSSD::~AliITSgeomSSD(){
89 if(fLowEdgeP) delete [] fLowEdgeP; fLowEdgeP = 0;
90 if(fLowEdgeN) delete [] fLowEdgeN; fLowEdgeN = 0;
91 if(fShapeSSD) delete fShapeSSD; fShapeSSD = 0;
97 AliITSgeomSSD::AliITSgeomSSD(const AliITSgeomSSD &source){
98 ////////////////////////////////////////////////////////////////////////
100 ////////////////////////////////////////////////////////////////////////
103 if(this == &source) return;
104 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
105 this->fNp = source.fNp;
106 this->fNn = source.fNn;
109 this->fAngleP = source.fAngleP;
110 this->fAngleN = source.fAngleN;
111 fLowEdgeP = new Float_t[fNp];
112 fLowEdgeN = new Float_t[fNn];
113 for(i=0;i<fNp;i++) this->fLowEdgeP[i] = source.fLowEdgeP[i];
114 for(i=0;i<fNn;i++) this->fLowEdgeN[i] = source.fLowEdgeN[i];
118 AliITSgeomSSD& AliITSgeomSSD::operator=(const AliITSgeomSSD &source) {
119 ////////////////////////////////////////////////////////////////////////
120 // assignment operator
121 ////////////////////////////////////////////////////////////////////////
124 if(this == &source) return *this;
125 this->fShapeSSD = new TBRIK(*(source.fShapeSSD));
126 this->fNp = source.fNp;
127 this->fNn = source.fNn;
130 this->fAngleP = source.fAngleP;
131 this->fAngleN = source.fAngleN;
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];
138 //______________________________________________________________________
139 void AliITSgeomSSD::Local2Det(Float_t x,Float_t z,Int_t &a,Int_t &c){
140 // Given a GEANT detector local coordinate, cm, this function returns
141 // the detector specific P and N side strip numbers.
143 // Float_t x Geant detector local x coordinate in cm
144 // Float_t z Geant detector local z coordinate in cm
146 // Int_t &a Detector anode strip number (P side)
147 // Int_t &c Detector cathode strip number (N side)
151 // project on to bonding edges.
152 d = x*TMath::Cos(fAngleP)+z*TMath::Sin(fAngleP);
153 b = x*TMath::Cos(fAngleN)+z*TMath::Sin(fAngleN);
154 if(d<fLowEdgeP[0]) i=-1;
155 else for(i=0;i<fNp;i++){
156 if(fLowEdgeP[i]<d) break;
159 if(b<fLowEdgeN[0]) i=-1;
160 else for(i=0;i<fNn;i++){
161 if(fLowEdgeN[i]<b) break;
166 //______________________________________________________________________
167 void AliITSgeomSSD::Det2Local(Int_t a,Int_t c,Float_t &x,Float_t &z){
173 //______________________________________________________________________
174 void AliITSgeomSSD::Print(ostream *os) const {
175 ////////////////////////////////////////////////////////////////////////
176 // Standard output format for this class.
177 ////////////////////////////////////////////////////////////////////////
186 #if defined __ICC || defined __ECC
193 fmt = os->setf(ios::scientific); // set scientific floating point output
194 *os << "TBRIK" << " ";
195 *os << setprecision(16) << GetDx() << " ";
196 *os << setprecision(16) << GetDy() << " ";
197 *os << setprecision(16) << GetDz() << " ";
198 *os << fNp << " " << fNn << " ";
199 *os << setprecision(16) << fAngleP << " ";
200 *os << setprecision(16) << fAngleN << " ";
201 for(i=0;i<fNp;i++) *os << setprecision(16) << fLowEdgeP[i] << " ";
202 for(i=0;i<fNn;i++) *os << setprecision(16) << fLowEdgeN[i] << " ";
204 os->flags(fmt); // reset back to old formating.
207 //______________________________________________________________________
208 void AliITSgeomSSD::Read(istream *is){
209 ////////////////////////////////////////////////////////////////////////
210 // Standard input format for this class.
211 ////////////////////////////////////////////////////////////////////////
217 *is >> dx >> dy >> dz;
218 if(fShapeSSD!=0) delete fShapeSSD;
219 fShapeSSD = new TBRIK("ActiveSSD","Active volume of SSD","SSD SI DET",
222 *is >> fAngleP >> fAngleN;
223 if(fLowEdgeP !=0) delete fLowEdgeP;
224 if(fLowEdgeN !=0) delete fLowEdgeN;
225 fLowEdgeP = new Float_t[fNp];
226 fLowEdgeN = new Float_t[fNn];
227 for(i=0;i<fNp;i++) *is >> fLowEdgeP[i];
228 for(i=0;i<fNn;i++) *is >> fLowEdgeN[i];
231 //----------------------------------------------------------------------
232 ostream &operator<<(ostream &os,AliITSgeomSSD &p){
233 ////////////////////////////////////////////////////////////////////////
234 // Standard output streaming function.
235 ////////////////////////////////////////////////////////////////////////
240 //----------------------------------------------------------------------
241 istream &operator>>(istream &is,AliITSgeomSSD &r){
242 ////////////////////////////////////////////////////////////////////////
243 // Standard input streaming function.
244 ////////////////////////////////////////////////////////////////////////
249 //======================================================================
251 ClassImp(AliITSgeomSSD175)
253 AliITSgeomSSD175::AliITSgeomSSD175() : AliITSgeomSSD(){
254 ////////////////////////////////////////////////////////////////////////
255 // default constructor
256 ////////////////////////////////////////////////////////////////////////
257 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
258 // Size of sensitive detector area x,y(thickness),z
259 const Float_t kangle = 0.0175; // angle in rad. of anode and cathodes
260 const Float_t kpitch = 0.0095;// cm anode separation.
261 const Int_t kNstrips = 768; // number of anode or cathode strips.
262 Float_t *leA,*leC; // array of low edges anode and cathorde.
265 leA = new Float_t[kNstrips+1];
266 leC = new Float_t[kNstrips+1];
268 leA[1] = -kpitch*(0.5*kNstrips-1);
270 leC[1] = kpitch*(0.5*kNstrips-1);
271 for(i=1;i<kNstrips;i++){
272 leA[i+1] = leA[i] + kpitch;
273 leC[i+1] = leC[i] - kpitch;
275 leA[kNstrips] = kDxyz[0];
276 leC[kNstrips] = -kDxyz[0];
277 // cout << "AliITSgeomSSD175 default creator called: start" << endl;
278 AliITSgeomSSD::ResetSSD(kDxyz,kangle,-kangle,
279 kNstrips+1,leA,kNstrips+1,leC);
282 // cout << "AliITSgeomSSD175 default creator called: end" << endl;
284 //________________________________________________________________________
285 ostream &operator<<(ostream &os,AliITSgeomSSD175 &p){
286 ////////////////////////////////////////////////////////////////////////
287 // Standard output streaming function.
288 ////////////////////////////////////////////////////////////////////////
293 //----------------------------------------------------------------------
294 istream &operator>>(istream &is,AliITSgeomSSD175 &r){
295 ////////////////////////////////////////////////////////////////////////
296 // Standard input streaming function.
297 ////////////////////////////////////////////////////////////////////////
302 //======================================================================
304 ClassImp(AliITSgeomSSD275and75)
306 AliITSgeomSSD275and75::AliITSgeomSSD275and75() : AliITSgeomSSD(){
307 ////////////////////////////////////////////////////////////////////////
308 // default constructor
309 ////////////////////////////////////////////////////////////////////////
311 //----------------------------------------------------------------------
312 AliITSgeomSSD275and75::AliITSgeomSSD275and75(Int_t npar,Float_t *par) :
314 // Default constructor for AliITSgeomSSD with strip angles of
315 // 275 miliradians and 75 miliradians. This constructor initlizes
316 // AliITSgeomSSD with the correct values. This is the miror image
317 // of the AliITSgeomSSD75and275 class.
318 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
319 // Size of sensitive detector area x,y(thickness),z
320 const Float_t kangleA = 0.0275; // angle in rad. of anode and cathodes
321 const Float_t kangleC = 0.0075; // angle in rad. of anode and cathodes
322 const Float_t kpitch = 0.0095;// cm anode separation.
323 const Int_t kNstrips = 768; // number of anode or cathode strips.
324 Float_t *leA,*leC; // array of low edges anode and cathorde.
327 leA = new Float_t[kNstrips+1];
328 leC = new Float_t[kNstrips+1];
330 leA[1] = -kpitch*(0.5*kNstrips-1);
332 leC[1] = kpitch*(0.5*kNstrips-1);
333 for(i=1;i<kNstrips;i++){
334 leA[i+1] = leA[i] + kpitch;
335 leC[i+1] = leC[i] - kpitch;
337 leA[kNstrips] = kDxyz[0];
338 leC[kNstrips] = -kDxyz[0];
339 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
340 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
341 kNstrips+1,leA,kNstrips+1,leC);
344 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
346 //________________________________________________________________________
347 ostream &operator<<(ostream &os,AliITSgeomSSD275and75 &p){
348 ////////////////////////////////////////////////////////////////////////
349 // Standard output streaming function.
350 ////////////////////////////////////////////////////////////////////////
355 //----------------------------------------------------------------------
356 istream &operator>>(istream &is,AliITSgeomSSD275and75 &r){
357 ////////////////////////////////////////////////////////////////////////
358 // Standard input streaming function.
359 ////////////////////////////////////////////////////////////////////////
364 //======================================================================
366 ClassImp(AliITSgeomSSD75and275)
368 AliITSgeomSSD75and275::AliITSgeomSSD75and275() : AliITSgeomSSD(){
369 ////////////////////////////////////////////////////////////////////////
370 // default constructor
371 ////////////////////////////////////////////////////////////////////////
373 AliITSgeomSSD75and275::AliITSgeomSSD75and275(Int_t npar,Float_t *par) :
375 // Default constructor for AliITSgeomSSD with strip angles of
376 // 75 miliradians and 275 miliradians. This constructor initlizes
377 // AliITSgeomSSD with the correct values. This is the miror image
378 // of the AliITSgeomSSD275and75 class.
379 const Float_t kDxyz[] ={3.6500,0.0150,2.000};//cm. (Geant 3.12 units)
380 // Size of sensitive detector area x,y(thickness),z
381 const Float_t kangleA = 0.0075; // angle in rad. of anode and cathodes
382 const Float_t kangleC = 0.0275; // angle in rad. of anode and cathodes
383 const Float_t kpitch = 0.0095;// cm anode separation.
384 const Int_t kNstrips = 768; // number of anode or cathode strips.
385 Float_t *leA,*leC; // array of low edges anode and cathorde.
388 leA = new Float_t[kNstrips+1];
389 leC = new Float_t[kNstrips+1];
391 leA[1] = -kpitch*(0.5*kNstrips-1);
393 leC[1] = kpitch*(0.5*kNstrips-1);
394 for(i=1;i<kNstrips;i++){
395 leA[i+1] = leA[i] + kpitch;
396 leC[i+1] = leC[i] - kpitch;
398 leA[kNstrips] = kDxyz[0];
399 leC[kNstrips] = -kDxyz[0];
400 // cout << "AliITSgeomSSD275and75 default creator called: start" << endl;
401 AliITSgeomSSD::ResetSSD(par,kangleA,kangleC,
402 kNstrips+1,leA,kNstrips+1,leC);
405 // cout << "AliITSgeomSSD275and75 default creator called: end" << endl;
407 //________________________________________________________________________
408 ostream &operator<<(ostream &os,AliITSgeomSSD75and275 &p){
409 ////////////////////////////////////////////////////////////////////////
410 // Standard output streaming function.
411 ////////////////////////////////////////////////////////////////////////
416 //----------------------------------------------------------------------
417 istream &operator>>(istream &is,AliITSgeomSSD75and275 &r){
418 ////////////////////////////////////////////////////////////////////////
419 // Standard input streaming function.
420 ////////////////////////////////////////////////////////////////////////
425 //======================================================================