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 **************************************************************************/
16 #include "AliRICHSegmentationV1.h"
18 ClassImp(AliRICHSegmentationV1)
19 //__________________________________________________________________________________________________
20 AliRICHSegmentationV1::AliRICHSegmentationV1()
21 {// Default constructor for AliRICHSegmantionV1 (with dead zones)
23 fNpx=144; // number of pads along X direction
24 fNpy=160; // number of pads along Y direction
25 fDeadZone=3.0; // space between CsI photocathods in cm
26 fDpx=0.84; // pad width in cm
27 fDpy=0.80; // pad heights in cm
30 Init(0); // ??? remove 0
32 //__________________________________________________________________________________________________
33 void AliRICHSegmentationV1::Init(Int_t /*id*/)
34 {//Recalculates all the values after some of them have been changed
36 Float_t csi_length = fNpy*fDpy + fDeadZone;
37 Float_t csi_width = fNpx*fDpx + 2*fDeadZone;
39 fPadPlane_Width = (csi_width - 2*fDeadZone)/3;
40 fPadPlane_Length = (csi_length - fDeadZone)/2;
42 //__________________________________________________________________________________________________
43 Int_t AliRICHSegmentationV1::Sector(Float_t x, Float_t y)
44 {// Calculate in which sector is the hit
48 //Parametrized definition
52 if (x> fPadPlane_Width/2 +fDeadZone)
54 if ( x<fPadPlane_Width/2 +fDeadZone + fPadPlane_Width)
57 if (x< fPadPlane_Width/2)
59 if (x> -( fPadPlane_Width/2))
62 if (x< -( fPadPlane_Width/2 +fDeadZone))
64 if (x> -( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width))
68 else if (y>fDeadZone/2)
70 if (x> fPadPlane_Width/2 +fDeadZone)
72 if (x< fPadPlane_Width/2 +fDeadZone + fPadPlane_Width)
75 if (x< fPadPlane_Width/2)
77 if (x> -( fPadPlane_Width/2))
80 if (x< -( fPadPlane_Width/2 +fDeadZone))
82 if (x> -( fPadPlane_Width/2 +fDeadZone + fPadPlane_Width))
89 //__________________________________________________________________________________________________
90 void AliRICHSegmentationV1::GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
93 ix=9999; //PH Fake values which should not be returned
96 Int_t sector=Sector(x,y);
101 ix = Int_t ((x-fDeadZone)/fDpx);
102 iy = Int_t ((y+fDeadZone/2)/fDpy)-1;
106 ix = Int_t ((x-fDeadZone)/fDpx);
107 iy = Int_t ((y-fDeadZone/2)/fDpy);
111 ix = (x>=0)? ix = Int_t (x/fDpx) : ix = Int_t (x/fDpx)-1;
112 iy = Int_t ((y+fDeadZone/2)/fDpy)-1;
116 ix = (x>=0)? ix = Int_t (x/fDpx) : ix = Int_t (x/fDpx)-1;
117 iy = Int_t ((y-fDeadZone/2)/fDpy);
121 ix = Int_t ((x+fDeadZone)/fDpx)-1;
122 iy = Int_t ((y+fDeadZone/2)/fDpy)-1;
126 ix = Int_t ((x+fDeadZone)/fDpx)-1;
127 iy = Int_t ((y-fDeadZone/2)/fDpy);
137 if (iy > fNpy) iy= fNpy;
138 if (iy < -fNpy) iy=-fNpy;
139 if (ix > fNpx) ix= fNpx;
140 if (ix < -fNpx) ix=-fNpx;
142 //__________________________________________________________________________________________________
143 void AliRICHSegmentationV1::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
144 {// returns real coordinates (x,y) for given pad coordinates (ix,iy)
148 Float_t padplane_width = fNpx/3;
154 if (ix >= padplane_width/2)
157 if (ix< padplane_width/2)
159 if (ix >= -(padplane_width/2))
164 if (ix < -(padplane_width/2))
172 if (ix >= padplane_width/2)
175 if (ix< padplane_width/2)
177 if (ix >= -(padplane_width/2))
182 if (ix < -(padplane_width/2))
189 //x = (ix>0) ? Float_t(ix*fDpx)-fDpx/2. : Float_t(ix*fDpx)-fDpx/2.;
190 //y = (iy>0) ? Float_t(iy*fDpy)-fDpy/2. : Float_t(iy*fDpy)-fDpy/2.;
191 x = Float_t(ix)*fDpx+fDpx/2+fDeadZone;
192 y = Float_t(iy)*fDpy+fDpy/2-fDeadZone/2;
196 x = Float_t(ix)*fDpx+fDpx/2+fDeadZone;
197 y = Float_t(iy)*fDpy+fDpy/2+fDeadZone/2;
201 x = (ix>=0) ? x = Float_t(ix)*fDpx+fDpx/2 : x = Float_t(ix)*fDpx+fDpx/2;
202 y = Float_t(iy)*fDpy+fDpy/2-fDeadZone/2;
206 x = (ix>=0) ? x = Float_t(ix)*fDpx+fDpx/2 : x = Float_t(ix)*fDpx+fDpx/2;
207 y = Float_t(iy)*fDpy+fDpy/2+fDeadZone/2;
211 x = Float_t(ix)*fDpx+fDpx/2-fDeadZone;
212 y = Float_t(iy)*fDpy+fDpy/2-fDeadZone/2;
216 x = Float_t(ix)*fDpx+fDpx/2-fDeadZone;
217 y = Float_t(iy)*fDpy+fDpy/2+fDeadZone/2;
220 //__________________________________________________________________________________________________
221 void AliRICHSegmentationV1::IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2)