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 **************************************************************************/
18 Revision 1.6 2000/10/02 16:58:29 egangler
19 Cleaning of the code :
22 -> some useless includes removed or replaced by "class" statement
24 Revision 1.5 2000/07/03 11:54:57 morsch
25 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
26 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
28 Revision 1.4 2000/06/29 12:34:09 morsch
29 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
30 it usable with any other geometry class. The link to the object to which it belongs is
31 established via an index. This assumes that there exists a global geometry manager
32 from which the pointer to the parent object can be obtained (in our case gAlice).
34 Revision 1.3 2000/06/26 10:01:26 pcrochet
35 global variables removed
37 Revision 1.2 2000/06/15 07:58:48 morsch
38 Code from MUON-dev joined
40 Revision 1.1.2.1 2000/06/09 21:51:58 morsch
41 Code from AliMUONSegResTriggerY.cxx
48 Revision 1.1.2.4 2000/05/05 10:17:04 morsch
49 Y strip numerotation changed (CP)
51 Revision 1.1.2.3 2000/04/26 12:33:40 morsch
52 Minor changes in some methods (CP)
54 Revision 1.1.2.2 2000/02/20 07:49:50 morsch
55 Bugs in Dpx, Dpy and ISector methods corrected (P.C.)
57 Revision 1.1.2.1 2000/02/17 14:34:57 morsch
58 Draft version from P. Crochet
62 #include "AliMUONSegmentationTriggerY.h"
63 #include "AliMUONTriggerConstants.h"
67 #include "AliMUONChamber.h"
69 ClassImp(AliMUONSegmentationTriggerY)
71 //------------------------------------------------------------------
72 void AliMUONSegmentationTriggerY::Init(Int_t chamber)
74 // intialize Y segmentation
75 cout << "Initialize Trigger Chamber Geometry Y " << "\n";
76 AliMUONSegmentationTrigger::Init(chamber);
78 // calculate x & y position of Y strips
79 Int_t nModule=AliMUONTriggerConstants::Nmodule();
80 for (Int_t imodule=0; imodule<nModule; imodule++) {
81 Float_t width=StripSizeY(AliMUONTriggerConstants::ModuleId(imodule));
82 Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule);
83 for (Int_t istrip=0; istrip<nStrip; istrip++){
85 fXofysmin[imodule][istrip]=
86 (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip))*fZscale;
87 fXofysmax[imodule][istrip]=
88 (AliMUONTriggerConstants::XcMin(imodule)+width*(istrip+1))*fZscale;
90 fXofysmin[imodule][istrip]=-1.*fXofysmax[imodule-63][istrip];
91 fXofysmax[imodule][istrip]=-1.*fXofysmin[imodule-63][istrip];
93 fYofysmin[imodule][istrip] = fYcmin[imodule]*fZscale;
94 fYofysmax[imodule][istrip] = fYcmax[imodule]*fZscale;
100 //------------------------------------------------------------------
101 void AliMUONSegmentationTriggerY::GetPadI(Float_t x,Float_t y,Int_t &ix,Int_t &iy)
103 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
104 // x,y = real coordinates; ix = module number , iy = strip number
108 Int_t nModule=AliMUONTriggerConstants::Nmodule();
109 for (Int_t imodule=0; imodule<nModule; imodule++) {
110 Int_t nStrip=AliMUONTriggerConstants::NstripY(imodule);
111 for (Int_t istrip=0; istrip<nStrip; istrip++){
112 if (x>fXofysmin[imodule][istrip]&&x<fXofysmax[imodule][istrip]&&
113 y>fYofysmin[imodule][istrip]&&y<fYofysmax[imodule][istrip]){
114 ix = AliMUONTriggerConstants::ModuleId(imodule);
121 //------------------------------------------------------------------
122 void AliMUONSegmentationTriggerY::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
124 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
125 // ix = module number , iy = strip number; x,y = center of strip
128 Int_t nModule=AliMUONTriggerConstants::Nmodule();
129 for (Int_t imodule=0; imodule<nModule; imodule++) {
130 if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
131 x=fXofysmin[imodule][iy]+(fXofysmax[imodule][iy]-fXofysmin[imodule][iy])/2.;
132 y=fYofysmin[imodule][iy]+(fYofysmax[imodule][iy]-fYofysmin[imodule][iy])/2.;
137 //------------------------------------------------------------------
138 void AliMUONSegmentationTriggerY::SetPadSize(Float_t p1, Float_t p2)
146 //------------------------------------------------------------------
147 void AliMUONSegmentationTriggerY::
148 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2])
150 // Returns list of next neighbours for given Pad (ix, iy)
151 Int_t absiX=TMath::Abs(iX);
155 Int_t numModule=ModuleNumber(absiX);
157 if (iY==AliMUONTriggerConstants::NstripY(numModule)-1) { // strip right
169 if (iY==0) { // strip left
170 if (absiX%10!=1&&absiX!=52) {
172 Xlist[*Nlist-1]=absiX-1;
173 Ylist[*Nlist-1]=AliMUONTriggerConstants::NstripY(numModule-1)-1;
177 Xlist[*Nlist-1]=absiX;
178 Ylist[*Nlist-1]=iY-1;
181 if (iX<0) { // left side of chamber
182 for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];}
187 //------------------------------------------------------------------
188 void AliMUONSegmentationTriggerY::SetPad(Int_t ix, Int_t iy)
190 // Sets virtual pad coordinates, needed for evaluating pad response
191 // outside the tracking program
192 GetPadC(ix,iy,fX,fY);
193 GetPadI(fX,fY,fIx,fIy);
194 fSector=Sector(ix,iy);
197 //------------------------------------------------------------------
198 Int_t AliMUONSegmentationTriggerY::ISector()
201 //------------------------------------------------------------------
203 Int_t AliMUONSegmentationTriggerY::Ix()
206 //------------------------------------------------------------------
208 Int_t AliMUONSegmentationTriggerY::Iy()
211 //------------------------------------------------------------------
212 Float_t AliMUONSegmentationTriggerY::Dpx(Int_t isec) const
214 // returns x size of y strips for sector isec
216 return 2.125*fZscale;
217 } else if (isec==2) {
218 return 2.125*fZscale;
219 } else if (isec==3) {
220 return 2.125*fZscale;
221 } else if (isec==4) {
228 //------------------------------------------------------------------
229 Float_t AliMUONSegmentationTriggerY::Dpy(Int_t isec) const
231 // returns y size of y strips for sector isec
234 } else if (isec==2) {
236 } else if (isec==3) {
238 } else if (isec==4) {
240 } else if (isec==5) {
248 //------------------------------------------------------------------
249 void AliMUONSegmentationTriggerY::SetHit(Float_t xhit, Float_t yhit)
251 // set hits during diintegration
252 AliMUONSegmentationTrigger::SetHit(xhit,yhit);
255 //------------------------------------------------------------------
256 Int_t AliMUONSegmentationTriggerY::Sector(Int_t ix, Int_t iy)
258 // Returns sector number for given module
260 Int_t absix=TMath::Abs(ix);
261 Int_t iwidth=Int_t(StripSizeY(absix));
265 } else if (absix==41||absix==61) {
267 } else if (iwidth==2) {
269 } else if (iwidth==4) {
276 //------------------------------------------------------------------
277 void AliMUONSegmentationTriggerY::
278 IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width)
280 // returns quantities needed to evaluate neighbour strip response
282 Float_t xstrip,ystrip;
283 GetPadI(fXhit,fYhit,ix,iy);
284 GetPadC(ix,iy,xstrip,ystrip);
285 x1=fXhit; // hit x position
286 x2=xstrip; // x coordinate of the main strip
287 x3=fX; // current strip real x coordinate
288 width=StripSizeY(ix); // width of the main strip