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:03 morsch
41 Code from AliMUONSegResTrigger.cxx
49 Revision 1.1.2.4 2000/04/26 12:33:25 morsch
50 Minor changes in some methods (CP)
52 Revision 1.1.2.3 2000/03/20 18:14:16 morsch
55 Revision 1.1.2.2 2000/02/20 07:50:49 morsch
56 Bugs in Dpx, Dpy and ISector methods corrected (P.C.)
58 Revision 1.1.2.1 2000/02/17 14:33:49 morsch
59 Draft version from P. Crochet
63 #include "AliMUONSegmentationTriggerX.h"
64 #include "AliMUONTriggerConstants.h"
68 #include "AliMUONChamber.h"
70 ClassImp(AliMUONSegmentationTriggerX)
72 //------------------------------------------------------------------
73 void AliMUONSegmentationTriggerX::Init(Int_t chamber)
75 // intialize X segmentation
76 cout << "Initialize Trigger Chamber Geometry X " << "\n";
77 AliMUONSegmentationTrigger::Init(chamber);
79 // calculate x & y position of X strips
80 Int_t nModule=AliMUONTriggerConstants::Nmodule();
81 for (Int_t imodule=0; imodule<nModule; imodule++) {
82 Float_t width=StripSizeX(AliMUONTriggerConstants::ModuleId(imodule));
83 Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
84 for (Int_t istrip=0; istrip<nStrip; istrip++){
85 fXofxsmin[imodule][istrip] = AliMUONTriggerConstants::XcMin(imodule)*fZscale;
86 fXofxsmax[imodule][istrip] = AliMUONTriggerConstants::XcMax(imodule)*fZscale;
88 fYofxsmin[imodule][istrip] = (fYcmin[imodule]+width*(istrip))*fZscale;
89 fYofxsmax[imodule][istrip] = (fYcmin[imodule]+width*(istrip+1))*fZscale;
94 //------------------------------------------------------------------
95 void AliMUONSegmentationTriggerX::GetPadI(Float_t x,Float_t y,Int_t &ix,Int_t &iy)
97 // Returns pad coordinates (ix,iy) for given real coordinates (x,y)
98 // x,y = real coordinates; ix = module number , iy = strip number
101 Int_t nModule=AliMUONTriggerConstants::Nmodule();
102 for (Int_t imodule=0; imodule<nModule; imodule++) {
103 Int_t nStrip=AliMUONTriggerConstants::NstripX(imodule);
104 for (Int_t istrip=0; istrip<nStrip; istrip++){
105 if (x>fXofxsmin[imodule][istrip]&&x<fXofxsmax[imodule][istrip]&&
106 y>fYofxsmin[imodule][istrip]&&y<fYofxsmax[imodule][istrip]){
107 ix = AliMUONTriggerConstants::ModuleId(imodule);
114 //------------------------------------------------------------------
115 void AliMUONSegmentationTriggerX::GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
117 // Returns real coordinates (x,y) for given pad coordinates (ix,iy)
118 // ix = module number , iy = strip number; x,y = center of strip
121 Int_t nModule=AliMUONTriggerConstants::Nmodule();
123 for (Int_t imodule=0; imodule<nModule; imodule++) {
124 if (AliMUONTriggerConstants::ModuleId(imodule)==ix){
125 x=fXofxsmin[imodule][iy]+(fXofxsmax[imodule][iy]-fXofxsmin[imodule][iy])/2.;
126 y=fYofxsmin[imodule][iy]+(fYofxsmax[imodule][iy]-fYofxsmin[imodule][iy])/2.;
131 //------------------------------------------------------------------
132 void AliMUONSegmentationTriggerX::SetPadSize(Float_t p1, Float_t p2)
140 //------------------------------------------------------------------
141 void AliMUONSegmentationTriggerX::
142 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[2], Int_t Ylist[2])
144 // Returns list of next neighbours for given Pad (ix, iy)
146 Int_t absiX=TMath::Abs(iX);
150 Int_t numModule=ModuleNumber(absiX);
152 if (iY<AliMUONTriggerConstants::NstripX(numModule)-1) { // strip up in same module
158 if (iY>0) { // strip down in same module
160 Xlist[*Nlist-1]=absiX;
161 Ylist[*Nlist-1]=iY-1;
164 if (iX<0) { // left side of chamber
165 for (Int_t i=0; i<*Nlist; i++) {Xlist[i]=-Xlist[i];}
170 //------------------------------------------------------------------
171 void AliMUONSegmentationTriggerX::SetPad(Int_t ix, Int_t iy)
173 // Sets virtual pad coordinates, needed for evaluating pad response
174 // outside the tracking program
175 GetPadC(ix,iy,fX,fY);
176 GetPadI(fX,fY,fIx,fIy);
177 fSector=Sector(ix,iy);
180 //------------------------------------------------------------------
181 Int_t AliMUONSegmentationTriggerX::ISector()
184 //------------------------------------------------------------------
185 Int_t AliMUONSegmentationTriggerX::Ix()
188 //------------------------------------------------------------------
190 Int_t AliMUONSegmentationTriggerX::Iy()
193 //------------------------------------------------------------------
194 Float_t AliMUONSegmentationTriggerX::Dpx(Int_t isec) const
196 // returns x size of x strips for sector isec
200 } else if (isec==2) {
202 } else if (isec==3) {
204 } else if (isec==4) {
206 } else if (isec==5) {
208 } else if (isec==6) {
215 //------------------------------------------------------------------
216 Float_t AliMUONSegmentationTriggerX::Dpy(Int_t isec) const
218 // returns y size of x strips for sector isec
221 return 1.0625*fZscale;
222 } else if (isec==2) {
223 return 1.0625*fZscale;
224 } else if (isec==3) {
225 return 1.0625*fZscale;
226 } else if (isec==4) {
227 return 2.125*fZscale;
228 } else if (isec==5) {
230 } else if (isec==6) {
237 //------------------------------------------------------------------
238 void AliMUONSegmentationTriggerX::SetHit(Float_t xhit, Float_t yhit)
240 // set hit during disIntegration
241 AliMUONSegmentationTrigger::SetHit(xhit,yhit);
244 //------------------------------------------------------------------
245 Int_t AliMUONSegmentationTriggerX::Sector(Int_t ix, Int_t iy)
247 // Returns sector number for given module
250 Int_t absix=TMath::Abs(ix);
251 Int_t iwidth=Int_t(StripSizeX(absix));
255 } else if (absix==41||absix==61) {
257 } else if (iwidth==1) {
259 } else if (iwidth==2) {
261 } else if ((absix>=11&&absix<17)||(absix>=91&&absix<97)) {
263 } else if (iwidth==4) {
270 //------------------------------------------------------------------
271 void AliMUONSegmentationTriggerX::
272 IntegrationLimits(Float_t& x1, Float_t& x2, Float_t& x3, Float_t& width)
274 // returns quantities needed to evaluate neighbour strip response
277 Float_t xstrip,ystrip;
278 GetPadI(fXhit,fYhit,ix,iy);
279 GetPadC(ix,iy,xstrip,ystrip);
280 x1=fYhit; // hit y position
281 x2=ystrip; // y coordinate of the main strip
282 x3=fY; // current strip real y coordinate
283 width=StripSizeX(ix); // width of the main strip