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){
46 //____________________________________________________________________________
47 AliITSsegmentationSSD& AliITSsegmentationSSD::operator=(AliITSsegmentationSSD &source){
49 if(this==&source) return *this;
50 this->fNstrips = source.fNstrips;
51 this->fStereoP = source.fStereoP;
52 this->fStereoN = source.fStereoN;
53 this->fStereoPl5 = source.fStereoPl5;
54 this->fStereoNl5 = source.fStereoNl5;
55 this->fStereoPl6 = source.fStereoPl6;
56 this->fStereoNl6 = source.fStereoNl6;
57 this->fLayer = source.fLayer;
58 this->fPitch = source.fPitch;
59 this->fDz = source.fDz;
60 this->fDx = source.fDx;
61 this->fDy = source.fDy;
62 this->fLayer = source.fLayer;
63 this->fGeom = source.fGeom; // copy only the pointer
64 this->fCorr = new TF1(*(source.fCorr)); // make a proper copy
68 //____________________________________________________________________________
69 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSsegmentationSSD &source){
73 //------------------------------
74 void AliITSsegmentationSSD::Init(){
75 // standard initalizer
82 //-------------------------------------------------------
83 void AliITSsegmentationSSD::Angles(Float_t &aP,Float_t &aN)
98 void AliITSsegmentationSSD::SetLayer(Int_t l)
104 //-------------------------------------------------------
105 void AliITSsegmentationSSD::GetPadIxz(Float_t x,Float_t z,Int_t &iP,Int_t &iN)
107 // returns P and N sided strip numbers for a given location.
109 // expects x, z in microns
111 Float_t StereoP, StereoN;
112 Angles(StereoP,StereoN);
113 Float_t tanP=TMath::Tan(StereoP);
114 Float_t tanN=TMath::Tan(StereoN);
118 Float_t ldX = x1 - z1*tanP; // distance from left-down edge
119 iP = (Int_t)(ldX/fPitch);
121 iP = (iP>fNstrips)? -1: iP;
123 ldX = x1 - tanN*(fDz - z1);
124 iN = (Int_t)(ldX/fPitch);
126 iN = (iN>fNstrips)? -1: iN;
129 //-------------------------------------------------------
130 void AliITSsegmentationSSD::GetPadCxz(Int_t iP,Int_t iN,Float_t &x,Float_t &z)
132 // actually this is the GetCrossing(Float_t &,Float_t &)
134 // returns local x, z in microns !
136 Float_t Dx = fDx; // detector size in x direction, microns
137 Float_t Dz = fDz; // detector size in z direction, microns
138 Float_t xP; // x coordinate in the P side from the first P strip
139 Float_t xN; // x coordinate in the N side from the first N strip
140 Float_t StereoP, StereoN;
141 Angles(StereoP,StereoN);
142 Float_t kP=TMath::Tan(StereoP);
143 Float_t kN=TMath::Tan(StereoN);
147 x = xP + kP*(Dz*kN-xP+xN)/(kP+kN);
148 z = (Dz*kN-xP+xN)/(kP+kN);
151 //if(TMath::Abs(z) > Dz/2) cout<<"Warning, wrong z local ="<<z<<endl;
152 // Check that zL is inside the detector for the
153 // correspondent xP and xN coordinates