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