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.1.2.1 2000/06/09 21:51:03 morsch
19 Code from AliMUONSegResTrigger.cxx
26 Revision 1.1.2.4 2000/04/26 12:33:25 morsch
27 Minor changes in some methods (CP)
29 Revision 1.1.2.3 2000/03/20 18:14:16 morsch
32 Revision 1.1.2.2 2000/02/20 07:50:49 morsch
33 Bugs in Dpx, Dpy and ISector methods corrected (P.C.)
35 Revision 1.1.2.1 2000/02/17 14:33:49 morsch
36 Draft version from P. Crochet
40 #include "AliMUONSegmentationTriggerX.h"
44 #include "AliMUONChamber.h"
46 ClassImp(AliMUONSegmentationTriggerX)
48 void AliMUONSegmentationTriggerX::Init(AliMUONChamber* Chamber)
50 cout << "Initialize Trigger Chamber Geometry X " << "\n";
51 AliMUONSegmentationTrigger::Init(Chamber);
53 // calculate x & y position of X strips
54 for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
55 Float_t width=StripSizeX(fgNum[imodule]);
56 for (Int_t istrip=0; istrip<fgNstripx[imodule]; istrip++){
57 fXofxsmin[imodule][istrip] = fgXcmin[imodule]*fZscale;
58 fXofxsmax[imodule][istrip] = fgXcmax[imodule]*fZscale;
60 fYofxsmin[imodule][istrip] = (fgYcmin[imodule]+width*(istrip))*fZscale;
61 fYofxsmax[imodule][istrip] = (fgYcmin[imodule]+width*(istrip+1))*fZscale;
66 //------------------------------------------------------------------
67 void AliMUONSegmentationTriggerX::GetPadIxy(Float_t x,Float_t y,Int_t &ix,Int_t &iy){
68 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
69 // x,y = real coordinates; ix = module number , iy = strip number
72 for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
73 for (Int_t istrip=0; istrip<fgNstripx[imodule]; istrip++){
74 if (x>fXofxsmin[imodule][istrip]&&x<fXofxsmax[imodule][istrip]&&
75 y>fYofxsmin[imodule][istrip]&&y<fYofxsmax[imodule][istrip]){
83 //------------------------------------------------------------------
84 void AliMUONSegmentationTriggerX::GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y){
85 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
86 // ix = module number , iy = strip number; x,y = center of strip
90 for (Int_t imodule=0; imodule<fgNmodule; imodule++) {
91 if (fgNum[imodule]==ix){
92 x=fXofxsmin[imodule][iy]+(fXofxsmax[imodule][iy]-fXofxsmin[imodule][iy])/2.;
93 y=fYofxsmin[imodule][iy]+(fYofxsmax[imodule][iy]-fYofxsmin[imodule][iy])/2.;
98 //------------------------------------------------------------------
99 void AliMUONSegmentationTriggerX::SetPadSize(Float_t p1, Float_t p2)
107 //------------------------------------------------------------------
108 void AliMUONSegmentationTriggerX::
109 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
110 // Returns list of next neighbours for given Pad (ix, iy)
112 Int_t absiX=TMath::Abs(iX);
116 Int_t numModule=ModuleNumber(absiX);
118 if (iY<fgNstripx[numModule]-1) { // strip up in same module
124 if (iY>0) { // strip down in same module
126 Xlist[*Nlist-1]=absiX;
127 Ylist[*Nlist-1]=iY-1;
130 if (iX<0) { // left side of chamber
131 for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];}
136 //------------------------------------------------------------------
137 void AliMUONSegmentationTriggerX::SetPad(Int_t ix, Int_t iy)
139 // Sets virtual pad coordinates, needed for evaluating pad response
140 // outside the tracking program
141 GetPadCxy(ix,iy,fx,fy);
142 GetPadIxy(fx,fy,fix,fiy);
143 fSector=Sector(ix,iy);
146 //------------------------------------------------------------------
147 Int_t AliMUONSegmentationTriggerX::ISector()
150 //------------------------------------------------------------------
151 Int_t AliMUONSegmentationTriggerX::Ix()
154 //------------------------------------------------------------------
155 Int_t AliMUONSegmentationTriggerX::Iy()
158 //------------------------------------------------------------------
159 Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec)
160 { // returns x size of x strips for sector isec
164 } else if (isec==2) {
166 } else if (isec==3) {
168 } else if (isec==4) {
170 } else if (isec==5) {
172 } else if (isec==6) {
179 //------------------------------------------------------------------
180 Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec)
181 { // returns y size of x strips for sector isec
182 // cout << " In AliMUONSegmentationTriggerX::Dpx" << "\n";
185 return 1.0625*fZscale;
186 } else if (isec==2) {
187 return 1.0625*fZscale;
188 } else if (isec==3) {
189 return 1.0625*fZscale;
190 } else if (isec==4) {
191 return 2.125*fZscale;
192 } else if (isec==5) {
194 } else if (isec==6) {
201 //------------------------------------------------------------------
202 void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit)
203 { AliMUONSegmentationTrigger::SetHit(xhit,yhit);}
205 //------------------------------------------------------------------
206 Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy)
208 // Returns sector number for given module
210 Int_t absix=TMath::Abs(ix);
211 Int_t iwidth=Int_t(StripSizeX(absix));
215 } else if (absix==41||absix==61) {
217 } else if (iwidth==1) {
219 } else if (iwidth==2) {
221 } else if ((absix>=11&&absix<17)||(absix>=91&&absix<97)) {
223 } else if (iwidth==4) {
230 //------------------------------------------------------------------
231 void AliMUONSegmentationTriggerX::
232 IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width)
233 { // returns quantities needed to evaluate neighbour strip response
234 // cout << " In AliMUONSegmentationTriggerX::IntegrationLimits" << "\n";
236 Float_t xstrip,ystrip;
237 GetPadIxy(fxhit,fyhit,ix,iy);
238 GetPadCxy(ix,iy,xstrip,ystrip);
239 x1=fyhit; // hit y position
240 x2=ystrip; // y coordinate of the main strip
241 x3=fy; // current strip real y coordinate
242 width=StripSizeX(ix); // width of the main strip