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 **************************************************************************/
19 #include "AliITSsegmentationSSD.h"
20 #include "AliITSgeom.h"
23 ClassImp(AliITSsegmentationSSD)
24 AliITSsegmentationSSD::AliITSsegmentationSSD(){
25 // default constructor
34 //------------------------------
35 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSgeom *geom){
40 cout<<"Dx="<<fDx<<endl;
46 cout<<"segmSSD - geom"<<endl;
49 //____________________________________________________________________________
50 AliITSsegmentationSSD& AliITSsegmentationSSD::operator=(AliITSsegmentationSSD &source){
52 if(this==&source) return *this;
53 this->fNstrips = source.fNstrips;
54 this->fStereoP = source.fStereoP;
55 this->fStereoN = source.fStereoN;
56 this->fStereoPl5 = source.fStereoPl5;
57 this->fStereoNl5 = source.fStereoNl5;
58 this->fStereoPl6 = source.fStereoPl6;
59 this->fStereoNl6 = source.fStereoNl6;
60 this->fLayer = source.fLayer;
61 this->fPitch = source.fPitch;
62 this->fDz = source.fDz;
63 this->fDx = source.fDx;
64 this->fDy = source.fDy;
65 this->fLayer = source.fLayer;
66 this->fGeom = source.fGeom; // copy only the pointer
67 this->fCorr = new TF1(*(source.fCorr)); // make a proper copy
71 //____________________________________________________________________________
72 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSsegmentationSSD &source){
76 //------------------------------
77 void AliITSsegmentationSSD::Init(){
78 // standard initalizer
80 //AliITSgeomSSD *gssd = (AliITSgeomSSD *) (fGeom->GetShape(5,1,1));
81 //const Float_t kconv=10000.;
83 fDx = 2.*kconv*gssd->GetDx();
84 fDz = 2.*kconv*gssd->GetDz();
85 fDy = 2.*kconv*gssd->GetDy();
92 //-------------------------------------------------------
93 void AliITSsegmentationSSD::Angles(Float_t &aP,Float_t &aN)
108 void AliITSsegmentationSSD::SetLayer(Int_t l)
114 //-------------------------------------------------------
115 void AliITSsegmentationSSD::GetPadIxz(Float_t x,Float_t z,Int_t &iP,Int_t &iN)
117 // returns P and N sided strip numbers for a given location.
119 // expects x, z in microns
121 Float_t tanP=TMath::Tan(fStereoP);
122 Float_t tanN=TMath::Tan(fStereoN);
123 //cout<<"1 segment::GetPad: xL,zL,fDx,fDz ="<<x<<","<<z<<","<<fDx<<","<<fDz<<endl;
124 //cout<<"2 segment: ? tanP,tanN ="<<tanP<<","<<tanN<<endl;
130 Float_t ldX = x1 - z1*tanP; // distance from left-down edge
131 iP = (Int_t)(ldX/fPitch);
133 iP = (iP>fNstrips)? -1: iP;
135 //cout<<"3 segment::GetPad: x1,tanP,ix1 ="<<ldX<<","<<tanP<<","<<iP<<endl;
137 ldX = x1 - tanN*(fDz - z1);
138 iN = (Int_t)(ldX/fPitch);
140 iN = (iN>fNstrips)? -1: iN;
142 //cout<<"4 segment::GetPad: x2,tanN,ix2 ="<<ldX<<","<<tanN<<","<<iN<<endl;
145 //-------------------------------------------------------
146 void AliITSsegmentationSSD::GetPadCxz(Int_t iP,Int_t iN,Float_t &x,Float_t &z)
148 // actually this is the GetCrossing(Float_t &,Float_t &)
150 // returns x, z in microns !
154 Float_t tanP=TMath::Tan(fStereoP);
155 Float_t tanN=TMath::Tan(fStereoN);
161 if(tanP + tanN == 0) {x=z=flag; return ;}
163 z = (z - x + tanN * fDz) / (tanP + tanN);
169 if ( ( z < -(fDz/2+dx) ) || ( z > (fDz/2+dx) ) ) {x=z=flag; return ;}
170 if ( ( x < -(fDx/2+dx) ) || ( x > (fDx/2+dx) ) ) {x=z=flag; return ;}