]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSegmentationTriggerY.cxx
Only getters to parameters declared constant.
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationTriggerY.cxx
CommitLineData
a9e2aefa 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
16/*
17$Log$
ecfa008b 18Revision 1.5 2000/07/03 11:54:57 morsch
19AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
20The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
21
a30a000f 22Revision 1.4 2000/06/29 12:34:09 morsch
23AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
24it usable with any other geometry class. The link to the object to which it belongs is
25established via an index. This assumes that there exists a global geometry manager
26from which the pointer to the parent object can be obtained (in our case gAlice).
27
d81db581 28Revision 1.3 2000/06/26 10:01:26 pcrochet
29global variables removed
30
3f2cdba8 31Revision 1.2 2000/06/15 07:58:48 morsch
32Code from MUON-dev joined
33
a9e2aefa 34Revision 1.1.2.1 2000/06/09 21:51:58 morsch
35Code from AliMUONSegResTriggerY.cxx
36
37*/
38
3f2cdba8 39
a9e2aefa 40/*
41Old Log:
42Revision 1.1.2.4 2000/05/05 10:17:04 morsch
43Y strip numerotation changed (CP)
44
45Revision 1.1.2.3 2000/04/26 12:33:40 morsch
46Minor changes in some methods (CP)
47
48Revision 1.1.2.2 2000/02/20 07:49:50 morsch
49Bugs in Dpx, Dpy and ISector methods corrected (P.C.)
50
51Revision 1.1.2.1 2000/02/17 14:34:57 morsch
52Draft version from P. Crochet
53
54*/
55
56#include "AliMUONSegmentationTriggerY.h"
3f2cdba8 57#include "AliMUONTriggerConstants.h"
a9e2aefa 58#include "TMath.h"
59#include "TRandom.h"
60#include "TArc.h"
61#include "AliMUONChamber.h"
62#include <iostream.h>
63ClassImp(AliMUONSegmentationTriggerY)
64
3f2cdba8 65//------------------------------------------------------------------
d81db581 66void AliMUONSegmentationTriggerY::Init(Int_t chamber)
a9e2aefa 67{
3f2cdba8 68// intialize Y segmentation
a9e2aefa 69 cout << "Initialize Trigger Chamber Geometry Y " << "\n";
d81db581 70 AliMUONSegmentationTrigger::Init(chamber);
a9e2aefa 71
72// calculate x & y position of Y strips
3f2cdba8 73 Int_t nModule=AliMUONTriggerConstants::Nmodule();
74 for (Int_t imodule=0; imodule<nModule; imodule++) {
75 Float_t width=StripSizeY(AliMUONTriggerConstants::ModuleId(imodule));
76 Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule);
77 for (Int_t istrip=0; istrip<nStrip; istrip++){
a9e2aefa 78 if (imodule<63) {
3f2cdba8 79 fXofysmin[imodule][istrip]=
80 (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip))*fZscale;
81 fXofysmax[imodule][istrip]=
82 (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip+1))*fZscale;
a9e2aefa 83 } else {
84 fXofysmin[imodule][istrip]=-1.*fXofysmax[imodule-63][istrip];
85 fXofysmax[imodule][istrip]=-1.*fXofysmin[imodule-63][istrip];
86 }
3f2cdba8 87 fYofysmin[imodule][istrip] = fYcmin[imodule]*fZscale;
88 fYofysmax[imodule][istrip] = fYcmax[imodule]*fZscale;
a9e2aefa 89 }
90 }
91
92}
93
94//------------------------------------------------------------------
a30a000f 95void AliMUONSegmentationTriggerY::GetPadI(Float_t x,Float_t y,Int_t &ix,Int_t &iy){
a9e2aefa 96// Returns pad coordinates (ix,iy) for given real coordinates (x,y)
97// x,y = real coordinates; ix = module number , iy = strip number
98
99 ix = 0;
100 iy = 0;
3f2cdba8 101 Int_t nModule=AliMUONTriggerConstants::Nmodule();
102 for (Int_t imodule=0; imodule<nModule; imodule++) {
103 Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule);
104 for (Int_t istrip=0; istrip<nStrip; istrip++){
a9e2aefa 105 if (x>fXofysmin[imodule][istrip]&&x<fXofysmax[imodule][istrip]&&
106 y>fYofysmin[imodule][istrip]&&y<fYofysmax[imodule][istrip]){
3f2cdba8 107 ix = AliMUONTriggerConstants::ModuleId(imodule);
a9e2aefa 108 iy = istrip;
109 }
110 }
111 }
112}
113
114//------------------------------------------------------------------
a30a000f 115void AliMUONSegmentationTriggerY::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y){
a9e2aefa 116// Returns real coordinates (x,y) for given pad coordinates (ix,iy)
117// ix = module number , iy = strip number; x,y = center of strip
118 x = 0.;
119 y = 0.;
3f2cdba8 120 Int_t nModule=AliMUONTriggerConstants::Nmodule();
121 for (Int_t imodule=0; imodule<nModule; imodule++) {
122 if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
a9e2aefa 123 x=fXofysmin[imodule][iy]+(fXofysmax[imodule][iy]-fXofysmin[imodule][iy])/2.;
124 y=fYofysmin[imodule][iy]+(fYofysmax[imodule][iy]-fYofysmin[imodule][iy])/2.;
125 }
126 }
127}
128
129//------------------------------------------------------------------
130void AliMUONSegmentationTriggerY::SetPadSize(Float_t p1, Float_t p2)
131{
132// Sets the padsize
133//
134 fDpx=p1;
135 fDpy=p2;
136}
137
138//------------------------------------------------------------------
139void AliMUONSegmentationTriggerY::
140Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
141// Returns list of next neighbours for given Pad (ix, iy)
142 Int_t absiX=TMath::Abs(iX);
143 *Nlist = 0;
144
145 if (absiX!=0) {
146 Int_t numModule=ModuleNumber(absiX);
147
3f2cdba8 148 if (iY==AliMUONTriggerConstants::NstripY(numModule)-1) { // strip right
a9e2aefa 149 if (absiX%10!=7) {
150 *Nlist=1;
151 Xlist[0]=absiX+1;
152 Ylist[0]=0;
153 }
154 } else {
155 *Nlist=1;
156 Xlist[0]=absiX;
157 Ylist[0]=iY+1;
158 }
159
160 if (iY==0) { // strip left
161 if (absiX%10!=1&&absiX!=52) {
162 *Nlist=*Nlist+1;
163 Xlist[*Nlist-1]=absiX-1;
3f2cdba8 164 Ylist[*Nlist-1]=AliMUONTriggerConstants::NstripY(numModule-1)-1;
a9e2aefa 165 }
166 } else {
167 *Nlist=*Nlist+1;
168 Xlist[*Nlist-1]=absiX;
169 Ylist[*Nlist-1]=iY-1;
170 }
171
172 if (iX<0) { // left side of chamber
173 for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];}
174 }
175 }
176}
177
178//------------------------------------------------------------------
179void AliMUONSegmentationTriggerY::SetPad(Int_t ix, Int_t iy)
180{
181 // Sets virtual pad coordinates, needed for evaluating pad response
182 // outside the tracking program
ecfa008b 183 GetPadC(ix,iy,fX,fY);
184 GetPadI(fX,fY,fIx,fIy);
a9e2aefa 185 fSector=Sector(ix,iy);
186}
187
188//------------------------------------------------------------------
189Int_t AliMUONSegmentationTriggerY::ISector()
190{ return fSector;}
191
192//------------------------------------------------------------------
193Int_t AliMUONSegmentationTriggerY::Ix()
ecfa008b 194{ return fIx;}
a9e2aefa 195
196//------------------------------------------------------------------
197Int_t AliMUONSegmentationTriggerY::Iy()
ecfa008b 198{ return fIy;}
a9e2aefa 199
200//------------------------------------------------------------------
201Float_t AliMUONSegmentationTriggerY::Dpx(Int_t isec)
3f2cdba8 202{
203// returns x size of y strips for sector isec
a9e2aefa 204 if (isec==1) {
205 return 2.125*fZscale;
206 } else if (isec==2) {
207 return 2.125*fZscale;
208 } else if (isec==3) {
209 return 2.125*fZscale;
210 } else if (isec==4) {
211 return 4.25*fZscale;
212 } else {
213 return 0.;
214 }
215}
216
217//------------------------------------------------------------------
218Float_t AliMUONSegmentationTriggerY::Dpy(Int_t isec)
3f2cdba8 219{
220// returns y size of y strips for sector isec
a9e2aefa 221 if (isec==1) {
222 return 68.0*fZscale;
223 } else if (isec==2) {
224 return 51.0*fZscale;
225 } else if (isec==3) {
226 return 68.0*fZscale;
227 } else if (isec==4) {
228 return 68.0*fZscale;
229 } else if (isec==5) {
230 return 68.0*fZscale;
231 } else {
232 return 0.;
233 }
234
235}
236
237//------------------------------------------------------------------
238void AliMUONSegmentationTriggerY::SetHit(Float_t xhit, Float_t yhit)
3f2cdba8 239{
240// set hits during diintegration
241 AliMUONSegmentationTrigger::SetHit(xhit,yhit);
242}
a9e2aefa 243
244//------------------------------------------------------------------
245Int_t AliMUONSegmentationTriggerY::Sector(Int_t ix, Int_t iy)
246{
247// Returns sector number for given module
248//
249 Int_t absix=TMath::Abs(ix);
250 Int_t iwidth=Int_t(StripSizeY(absix));
3f2cdba8 251
a9e2aefa 252 if (absix==52) {
253 return 1;
254 } else if (absix==41||absix==61) {
255 return 2;
256 } else if (iwidth==2) {
257 return 3;
258 } else if (iwidth==4) {
259 return 4;
260 } else {
261 return 0;
262 }
263}
264
265//------------------------------------------------------------------
266void AliMUONSegmentationTriggerY::
267IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width)
268{
269// returns quantities needed to evaluate neighbour strip response
270 Int_t ix,iy;
271 Float_t xstrip,ystrip;
ecfa008b 272 GetPadI(fXhit,fYhit,ix,iy);
a30a000f 273 GetPadC(ix,iy,xstrip,ystrip);
ecfa008b 274 x1=fXhit; // hit x position
a9e2aefa 275 x2=xstrip; // x coordinate of the main strip
ecfa008b 276 x3=fX; // current strip real x coordinate
a9e2aefa 277 width=StripSizeY(ix); // width of the main strip
278}
279
280
281
282