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"
21 #include "AliITSgeomSSD.h"
23 ClassImp(AliITSsegmentationSSD)
24 AliITSsegmentationSSD::AliITSsegmentationSSD(){
25 // default constructor
33 //------------------------------
34 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSgeom *geom){
44 //____________________________________________________________________________
45 AliITSsegmentationSSD& AliITSsegmentationSSD::operator=(AliITSsegmentationSSD &source){
47 if(this==&source) return *this;
48 this->fNstrips = source.fNstrips;
49 this->fStereoP = source.fStereoP;
50 this->fStereoN = source.fStereoN;
51 this->fPitch = source.fPitch;
52 this->fDz = source.fDz;
53 this->fDx = source.fDx;
54 this->fDy = source.fDy;
55 this->fGeom = source.fGeom; // copy only the pointer
56 this->fCorr = new TF1(*(source.fCorr)); // make a proper copy
60 //____________________________________________________________________________
61 AliITSsegmentationSSD::AliITSsegmentationSSD(AliITSsegmentationSSD &source){
65 //------------------------------
66 void AliITSsegmentationSSD::Init(){
67 // standard initalizer
69 AliITSgeomSSD *gssd = (AliITSgeomSSD *) (fGeom->GetShape(5,1,1));
70 const Float_t kconv=10000.;
71 fDx = 2.*kconv*gssd->GetDx();
72 fDz = 2.*kconv*gssd->GetDz();
73 fDy = 2.*kconv*gssd->GetDy();
79 //-------------------------------------------------------
80 void AliITSsegmentationSSD::GetPadIxz(Float_t x,Float_t z,Int_t &iP,Int_t &iN)
82 // returns P and N sided strip numbers for a given location.
84 // expects x, z in microns
86 Float_t tanP=TMath::Tan(fStereoP);
87 Float_t tanN=TMath::Tan(fStereoN);
93 Float_t ldX = x1 - z1*tanP; // distance from left-down edge
94 iP = (Int_t)(ldX/fPitch);
96 iP = (iP>fNstrips)? -1: iP;
99 ldX = x1 - tanN*(fDz - z1);
100 iN = (Int_t)(ldX/fPitch);
102 iN = (iN>fNstrips)? -1: iN;
105 //-------------------------------------------------------
106 void AliITSsegmentationSSD::GetPadCxz(Int_t iP,Int_t iN,Float_t &x,Float_t &z)
108 // actually this is the GetCrossing(Float_t &,Float_t &)
110 // returns x, z in microns !
114 Float_t tanP=TMath::Tan(fStereoP);
115 Float_t tanN=TMath::Tan(fStereoN);
121 if(tanP + tanN == 0) {x=z=flag; return ;}
123 z = (z - x + tanN * fDz) / (tanP + tanN);
129 if ( ( z < -(fDz/2+dx) ) || ( z > (fDz/2+dx) ) ) {x=z=flag; return ;}
130 if ( ( x < -(fDx/2+dx) ) || ( x > (fDx/2+dx) ) ) {x=z=flag; return ;}