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 #include "AliITSsegmentationSSD.h"
19 #include "AliITSgeom.h"
22 ClassImp(AliITSsegmentationSSD)
23 AliITSsegmentationSSD::AliITSsegmentationSSD(){
24 // default constructor
32 //------------------------------
33 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSgeom *geom){
43 //____________________________________________________________________________
44 AliITSsegmentationSSD& AliITSsegmentationSSD::operator=(AliITSsegmentationSSD &source){
46 if(this==&source) return *this;
47 this->fNstrips = source.fNstrips;
48 this->fStereoP = source.fStereoP;
49 this->fStereoN = source.fStereoN;
50 this->fPitch = source.fPitch;
51 this->fDz = source.fDz;
52 this->fDx = source.fDx;
53 this->fDy = source.fDy;
54 this->fGeom = source.fGeom; // copy only the pointer
55 this->fCorr = new TF1(*(source.fCorr)); // make a proper copy
59 //____________________________________________________________________________
60 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSsegmentationSSD &source){
64 //------------------------------
65 void AliITSsegmentationSSD::Init(){
66 // standard initalizer
68 AliITSgeomSSD *gssd = (AliITSgeomSSD *) (fGeom->GetShape(5,1,1));
69 const Float_t kconv=10000.;
70 fDx = 2.*kconv*gssd->GetDx();
71 fDz = 2.*kconv*gssd->GetDz();
72 fDy = 2.*kconv*gssd->GetDy();
78 //-------------------------------------------------------
79 void AliITSsegmentationSSD::GetPadIxz(Float_t x,Float_t z,Int_t &iP,Int_t &iN)
81 // returns P and N sided strip numbers for a given location.
83 // expects x, z in microns
85 Float_t tanP=TMath::Tan(fStereoP);
86 Float_t tanN=TMath::Tan(fStereoN);
92 Float_t ldX = x1 - z1*tanP; // distance from left-down edge
93 iP = (Int_t)(ldX/fPitch);
95 iP = (iP>fNstrips)? -1: iP;
98 ldX = x1 - tanN*(fDz - z1);
99 iN = (Int_t)(ldX/fPitch);
101 iN = (iN>fNstrips)? -1: iN;
104 //-------------------------------------------------------
105 void AliITSsegmentationSSD::GetPadCxz(Int_t iP,Int_t iN,Float_t &x,Float_t &z)
107 // actually this is the GetCrossing(Float_t &,Float_t &)
109 // returns x, z in microns !
113 Float_t tanP=TMath::Tan(fStereoP);
114 Float_t tanN=TMath::Tan(fStereoN);
120 if(tanP + tanN == 0) {x=z=flag; return ;}
122 z = (z - x + tanN * fDz) / (tanP + tanN);
128 if ( ( z < -(fDz/2+dx) ) || ( z > (fDz/2+dx) ) ) {x=z=flag; return ;}
129 if ( ( x < -(fDx/2+dx) ) || ( x > (fDx/2+dx) ) ) {x=z=flag; return ;}