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.5 2000/07/03 11:54:57 morsch
19 AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
20 The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
22 Revision 1.4 2000/06/29 12:34:09 morsch
23 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
24 it usable with any other geometry class. The link to the object to which it belongs is
25 established via an index. This assumes that there exists a global geometry manager
26 from which the pointer to the parent object can be obtained (in our case gAlice).
28 Revision 1.3 2000/06/26 10:01:26 pcrochet
29 global variables removed
31 Revision 1.2 2000/06/15 07:58:48 morsch
32 Code from MUON-dev joined
34 Revision 1.1.2.1 2000/06/09 21:51:03 morsch
35 Code from AliMUONSegResTrigger.cxx
43 Revision 1.1.2.4 2000/04/26 12:33:25 morsch
44 Minor changes in some methods (CP)
46 Revision 1.1.2.3 2000/03/20 18:14:16 morsch
49 Revision 1.1.2.2 2000/02/20 07:50:49 morsch
50 Bugs in Dpx, Dpy and ISector methods corrected (P.C.)
52 Revision 1.1.2.1 2000/02/17 14:33:49 morsch
53 Draft version from P. Crochet
57 #include "AliMUONSegmentationTriggerX.h"
58 #include "AliMUONTriggerConstants.h"
62 #include "AliMUONChamber.h"
64 ClassImp(AliMUONSegmentationTriggerX)
66 //------------------------------------------------------------------
67 void AliMUONSegmentationTriggerX::Init(Int_t chamber)
69 // intialize X segmentation
70 cout << "Initialize Trigger Chamber Geometry X " << "\n";
71 AliMUONSegmentationTrigger::Init(chamber);
73 // calculate x & y position of X strips
74 Int_t nModule=AliMUONTriggerConstants::Nmodule();
75 for (Int_t imodule=0; imodule<nModule; imodule++) {
76 Float_t width=StripSizeX(AliMUONTriggerConstants::ModuleId(imodule));
77 Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
78 for (Int_t istrip=0; istrip<nStrip; istrip++){
79 fXofxsmin[imodule][istrip] = AliMUONTriggerConstants::XcMin(imodule)*fZscale;
80 fXofxsmax[imodule][istrip] = AliMUONTriggerConstants::XcMax(imodule)*fZscale;
82 fYofxsmin[imodule][istrip] = (fYcmin[imodule]+width*(istrip))*fZscale;
83 fYofxsmax[imodule][istrip] = (fYcmin[imodule]+width*(istrip+1))*fZscale;
88 //------------------------------------------------------------------
89 void AliMUONSegmentationTriggerX::GetPadI(Float_t x,Float_t y,Int_t &ix,Int_t &iy){
90 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
91 // x,y = real coordinates; ix = module number , iy = strip number
94 Int_t nModule=AliMUONTriggerConstants::Nmodule();
95 for (Int_t imodule=0; imodule<nModule; imodule++) {
96 Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
97 for (Int_t istrip=0; istrip<nStrip; istrip++){
98 if (x>fXofxsmin[imodule][istrip]&&x<fXofxsmax[imodule][istrip]&&
99 y>fYofxsmin[imodule][istrip]&&y<fYofxsmax[imodule][istrip]){
100 ix = AliMUONTriggerConstants::ModuleId(imodule);
107 //------------------------------------------------------------------
108 void AliMUONSegmentationTriggerX::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y){
109 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
110 // ix = module number , iy = strip number; x,y = center of strip
113 Int_t nModule=AliMUONTriggerConstants::Nmodule();
115 for (Int_t imodule=0; imodule<nModule; imodule++) {
116 if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
117 x=fXofxsmin[imodule][iy]+(fXofxsmax[imodule][iy]-fXofxsmin[imodule][iy])/2.;
118 y=fYofxsmin[imodule][iy]+(fYofxsmax[imodule][iy]-fYofxsmin[imodule][iy])/2.;
123 //------------------------------------------------------------------
124 void AliMUONSegmentationTriggerX::SetPadSize(Float_t p1, Float_t p2)
132 //------------------------------------------------------------------
133 void AliMUONSegmentationTriggerX::
134 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2]){
135 // Returns list of next neighbours for given Pad (ix, iy)
137 Int_t absiX=TMath::Abs(iX);
141 Int_t numModule=ModuleNumber(absiX);
143 if (iY<AliMUONTriggerConstants::NstripX(numModule)-1) { // strip up in same module
149 if (iY>0) { // strip down in same module
151 Xlist[*Nlist-1]=absiX;
152 Ylist[*Nlist-1]=iY-1;
155 if (iX<0) { // left side of chamber
156 for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];}
161 //------------------------------------------------------------------
162 void AliMUONSegmentationTriggerX::SetPad(Int_t ix, Int_t iy)
164 // Sets virtual pad coordinates, needed for evaluating pad response
165 // outside the tracking program
166 GetPadC(ix,iy,fX,fY);
167 GetPadI(fX,fY,fIx,fIy);
168 fSector=Sector(ix,iy);
171 //------------------------------------------------------------------
172 Int_t AliMUONSegmentationTriggerX::ISector()
175 //------------------------------------------------------------------
176 Int_t AliMUONSegmentationTriggerX::Ix()
179 //------------------------------------------------------------------
180 Int_t AliMUONSegmentationTriggerX::Iy()
183 //------------------------------------------------------------------
184 Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec)
186 // returns x size of x strips for sector isec
190 } else if (isec==2) {
192 } else if (isec==3) {
194 } else if (isec==4) {
196 } else if (isec==5) {
198 } else if (isec==6) {
205 //------------------------------------------------------------------
206 Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec)
208 // returns y size of x strips for sector isec
211 return 1.0625*fZscale;
212 } else if (isec==2) {
213 return 1.0625*fZscale;
214 } else if (isec==3) {
215 return 1.0625*fZscale;
216 } else if (isec==4) {
217 return 2.125*fZscale;
218 } else if (isec==5) {
220 } else if (isec==6) {
227 //------------------------------------------------------------------
228 void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit)
230 // set hit during disIntegration
231 AliMUONSegmentationTrigger::SetHit(xhit,yhit);
234 //------------------------------------------------------------------
235 Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy)
237 // Returns sector number for given module
240 Int_t absix=TMath::Abs(ix);
241 Int_t iwidth=Int_t(StripSizeX(absix));
245 } else if (absix==41||absix==61) {
247 } else if (iwidth==1) {
249 } else if (iwidth==2) {
251 } else if ((absix>=11&&absix<17)||(absix>=91&&absix<97)) {
253 } else if (iwidth==4) {
260 //------------------------------------------------------------------
261 void AliMUONSegmentationTriggerX::
262 IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width)
264 // returns quantities needed to evaluate neighbour strip response
267 Float_t xstrip,ystrip;
268 GetPadI(fXhit,fYhit,ix,iy);
269 GetPadC(ix,iy,xstrip,ystrip);
270 x1=fYhit; // hit y position
271 x2=ystrip; // y coordinate of the main strip
272 x3=fY; // current strip real y coordinate
273 width=StripSizeX(ix); // width of the main strip