]>
Commit | Line | Data |
---|---|---|
237c933d | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
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 | **************************************************************************/ | |
15 | ||
edf34242 | 16 | |
237c933d | 17 | #include "AliRICHSegmentationV0.h" |
18 | ||
19 | ||
20 | ClassImp(AliRICHSegmentationV0) | |
21 | ||
5a0c129b | 22 | //________________________________________________________________________________ |
23 | AliRICHSegmentationV0::AliRICHSegmentationV0() | |
24 | { | |
25 | ||
26 | // Default constructor for AliRICHSegmentationV0 (no dead zones) | |
27 | ||
28 | fNpx=144; | |
29 | fNpy=160; | |
30 | fDeadZone=0; | |
31 | fSector=-1; | |
edf34242 | 32 | fCorr = 0; |
5a0c129b | 33 | } |
34 | ||
a2f7eaf6 | 35 | void AliRICHSegmentationV0::Init(Int_t id) |
237c933d | 36 | { |
37 | ||
38 | // Initialisation of chambers | |
942194a4 | 39 | id++;//to remove warning |
5a0c129b | 40 | Float_t csi_length = fNpy*fDpy + fDeadZone; |
41 | Float_t csi_width = fNpx*fDpx + 2*fDeadZone; | |
42 | ||
43 | fPadPlane_Width = (csi_width - 2*fDeadZone)/3; | |
44 | fPadPlane_Length = (csi_length - fDeadZone)/2; | |
237c933d | 45 | } |
46 | ||
47 | ||
a2f7eaf6 | 48 | Float_t AliRICHSegmentationV0::GetAnod(Float_t xhit) const |
237c933d | 49 | { |
50 | ||
51 | // Get anod wire closer to hit | |
52 | ||
53 | Float_t wire= (xhit>0)? Int_t(xhit/fWireD)+0.5:Int_t(xhit/fWireD)-0.5; | |
54 | return fWireD*wire; | |
55 | } | |
56 | ||
57 | void AliRICHSegmentationV0::SetPadSize(Float_t p1, Float_t p2) | |
58 | { | |
59 | ||
60 | // Set the pad size | |
61 | ||
62 | fDpx=p1; | |
63 | fDpy=p2; | |
64 | } | |
a2f7eaf6 | 65 | void AliRICHSegmentationV0::GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy) |
c712cb2f | 66 | {// returns pad coordinates (ix,iy) for given real coordinates (x,y) |
237c933d | 67 | ix = (x>0)? Int_t(x/fDpx)+1 : Int_t(x/fDpx); |
68 | iy = (y>0)? Int_t(y/fDpy)+1 : Int_t(y/fDpy); | |
69 | if (iy > fNpy) iy= fNpy; | |
70 | if (iy < -fNpy) iy=-fNpy; | |
71 | if (ix > fNpx) ix= fNpx; | |
72 | if (ix < -fNpx) ix=-fNpx; | |
73 | } | |
c712cb2f | 74 | void AliRICHSegmentationV0::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y) |
75 | {// returns real coordinates (x,y) for given pad coordinates (ix,iy) | |
237c933d | 76 | x = (ix>0) ? Float_t(ix*fDpx)-fDpx/2. : Float_t(ix*fDpx)-fDpx/2.; |
77 | y = (iy>0) ? Float_t(iy*fDpy)-fDpy/2. : Float_t(iy*fDpy)-fDpy/2.; | |
78 | } | |
79 | ||
c712cb2f | 80 | void AliRICHSegmentationV0::SetHit(Float_t xhit, Float_t yhit) |
81 | {// Find the wire position (center of charge distribution) | |
72e468a5 | 82 | fXhit=xhit; |
83 | fYhit=yhit; | |
237c933d | 84 | } |
85 | ||
c712cb2f | 86 | void AliRICHSegmentationV0::SetPad(Int_t ix, Int_t iy) |
87 | {// Move to pad ix, iy | |
237c933d | 88 | |
a2f7eaf6 | 89 | GetPadC(ix,iy,fX,fY); |
237c933d | 90 | } |
91 | ||
92 | ||
93 | ||
c712cb2f | 94 | void AliRICHSegmentationV0::FirstPad(Float_t xhit, Float_t yhit, Float_t dx, Float_t dy) |
237c933d | 95 | { |
96 | ||
237c933d | 97 | // Find the wire position (center of charge distribution) |
98 | Float_t x0a=GetAnod(xhit); | |
72e468a5 | 99 | fXhit=x0a; |
100 | fYhit=yhit; | |
237c933d | 101 | // and take fNsigma*sigma around this center |
102 | Float_t x01=x0a - dx; | |
103 | Float_t x02=x0a + dx; | |
104 | Float_t y01=yhit - dy; | |
105 | Float_t y02=yhit + dy; | |
237c933d | 106 | // find the pads over which the charge distributes |
a2f7eaf6 | 107 | GetPadI(x01,y01,fIxmin,fIymin); |
108 | GetPadI(x02,y02,fIxmax,fIymax); | |
237c933d | 109 | // Set current pad to lower left corner |
72e468a5 | 110 | fIx=fIxmin; |
111 | fIy=fIymin; | |
c712cb2f | 112 | GetPadC(fIx,fIy,fX,fY); |
237c933d | 113 | } |
114 | ||
115 | void AliRICHSegmentationV0::NextPad() | |
116 | { | |
237c933d | 117 | // Step to next pad in integration region |
72e468a5 | 118 | if (fIx <= fIxmax) { |
72e468a5 | 119 | fIx++; |
120 | } else if (fIy <= fIymax) { | |
72e468a5 | 121 | fIx=fIxmin; |
122 | fIy++; | |
237c933d | 123 | } else { |
124 | printf("\n Error: Stepping outside integration region\n "); | |
125 | } | |
a2f7eaf6 | 126 | GetPadC(fIx,fIy,fX,fY); |
237c933d | 127 | } |
128 | ||
129 | Int_t AliRICHSegmentationV0::MorePads() | |
c712cb2f | 130 | {// Are there more pads in the integration region |
72e468a5 | 131 | if (fIx >= fIxmax && fIy >= fIymax) { |
237c933d | 132 | return 0; |
133 | } else { | |
237c933d | 134 | return 1; |
135 | } | |
136 | } | |
c712cb2f | 137 | //__________________________________________________________________________________________________ |
237c933d | 138 | void AliRICHSegmentationV0::SigGenInit(Float_t x,Float_t y,Float_t) |
c712cb2f | 139 | {// Initialises pad and wire position during stepping |
72e468a5 | 140 | fXt =x; |
141 | fYt =y; | |
a2f7eaf6 | 142 | GetPadI(x,y,fIxt,fIyt); |
72e468a5 | 143 | fIwt= (x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1 ; |
237c933d | 144 | } |
145 | ||
146 | Int_t AliRICHSegmentationV0::SigGenCond(Float_t x,Float_t y,Float_t) | |
c712cb2f | 147 | {// Signal will be generated if particle crosses pad boundary or |
237c933d | 148 | // boundary between two wires. |
149 | Int_t ixt, iyt; | |
a2f7eaf6 | 150 | GetPadI(x,y,ixt,iyt); |
237c933d | 151 | Int_t iwt=(x>0) ? Int_t(x/fWireD)+1 : Int_t(x/fWireD)-1; |
152 | ||
72e468a5 | 153 | if ((ixt != fIxt) || (iyt !=fIyt) || (iwt != fIwt)) { |
237c933d | 154 | return 1; |
155 | } else { | |
156 | return 0; | |
157 | } | |
158 | } | |
c712cb2f | 159 | void AliRICHSegmentationV0::IntegrationLimits(Float_t& x1,Float_t& x2,Float_t& y1, Float_t& y2) |
160 | {// Calculate the integration limits | |
72e468a5 | 161 | x1=fXhit-fX-fDpx/2.; |
237c933d | 162 | x2=x1+fDpx; |
72e468a5 | 163 | y1=fYhit-fY-fDpy/2.; |
237c933d | 164 | y2=y1+fDpy; |
165 | } | |
166 | ||
c712cb2f | 167 | void AliRICHSegmentationV0::Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[7], Int_t Ylist[7]) |
237c933d | 168 | { |
169 | //Is used for the cluster finder, include diagonal elements | |
170 | ||
171 | *Nlist=4;Xlist[0]=Xlist[1]=iX;Xlist[2]=iX-1;Xlist[3]=iX+1; | |
172 | Ylist[0]=iY-1;Ylist[1]=iY+1;Ylist[2]=Ylist[3]=iY; | |
237c933d | 173 | } |
174 | ||
cc23c5c6 | 175 | Float_t AliRICHSegmentationV0::Distance2AndOffset(Int_t iX, Int_t iY, Float_t X, Float_t Y,Int_t *dummy) |
176 | {// Returns the square of the distance between 1 pad labelled by its Channel numbers and a coordinate | |
177 | dummy=0; | |
237c933d | 178 | Float_t x,y; |
a2f7eaf6 | 179 | GetPadC(iX,iY,x,y); |
237c933d | 180 | return (x-X)*(x-X) + (y-Y)*(y-Y); |
181 | } | |
182 | ||
a2f7eaf6 | 183 | void AliRICHSegmentationV0::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const |
237c933d | 184 | { |
185 | ||
186 | // Test | |
187 | ||
188 | n=1; | |
189 | x[0]=0.; | |
190 | y[0]=x[0]; | |
191 | } | |
192 | ||
a2f7eaf6 | 193 | void AliRICHSegmentationV0::Draw(const char* opt) const |
237c933d | 194 | { |
cc23c5c6 | 195 | Info("Draw","%s",opt); |
237c933d | 196 | |
197 | } |