]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSegmentationV02.cxx
kMAXZOOM global constant now in AliMUONConstants
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationV02.cxx
CommitLineData
4c039060 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$
a9e2aefa 18Revision 1.1.2.1 2000/06/09 21:37:56 morsch
19AliMUONSegmentationV02 code from AliMUONSegResV02.cxx
20
4c039060 21*/
22
a9e2aefa 23
24
a897a37a 25/////////////////////////////////////////////////////
26// Segmentation and Response classes version 02 //
27/////////////////////////////////////////////////////
28
a9e2aefa 29
30#include "AliMUONSegmentationV02.h"
a897a37a 31#include "iostream.h"
32
33//___________________________________________
a9e2aefa 34ClassImp(AliMUONSegmentationV02)
a897a37a 35
a9e2aefa 36void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2)
a897a37a 37{
a9e2aefa 38// Sets the padsize
39//
a897a37a 40 fDpy=p1;
41 fDpx=p2;
42}
43
a9e2aefa 44Int_t AliMUONSegmentationV02::Npx()
45// Returns maximum number if pads in x
46{return AliMUONSegmentationV01::Npy();}
a897a37a 47
a9e2aefa 48Int_t AliMUONSegmentationV02::Npy()
49// Returns maximum number if pads in y
50{return AliMUONSegmentationV01::Npx();}
a897a37a 51
52
a9e2aefa 53Float_t AliMUONSegmentationV02::Dpx(Int_t isec)
54// Returns pad-size in x
a897a37a 55{return fDpy;}
56
a9e2aefa 57Float_t AliMUONSegmentationV02::Dpy(Int_t isec)
58// Returns pad-size in y
a897a37a 59{return fDpxD[isec];}
a9e2aefa 60Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
61// Returns sector number for given pad position
62//
63{return AliMUONSegmentationV01::Sector(iy, ix);}
a897a37a 64
a9e2aefa 65void AliMUONSegmentationV02::
a897a37a 66
a897a37a 67GetPadIxy(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
a9e2aefa 68// Returns pad coordinates (ix,iy) for given real coordinates (x,y)
69//
a897a37a 70{
a9e2aefa 71AliMUONSegmentationV01::GetPadIxy(y, x, iy, ix);
a897a37a 72// printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
73}
74
a9e2aefa 75void AliMUONSegmentationV02::
a897a37a 76GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
a9e2aefa 77// Returns real coordinates (x,y) for given pad coordinates (ix,iy)
78//
a897a37a 79{
a9e2aefa 80 AliMUONSegmentationV01::GetPadCxy(iy, ix, y, x);
a897a37a 81}
a9e2aefa 82void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
a897a37a 83{
a9e2aefa 84 //
85 // Sets virtual pad coordinates, needed for evaluating pad response
86 // outside the tracking program
a897a37a 87 GetPadCxy(ix,iy,fx,fy);
88 fSector=Sector(ix,iy);
89}
90
91
92
a9e2aefa 93void AliMUONSegmentationV02::NextPad()
a897a37a 94{
a9e2aefa 95// Stepper for the iteration over pads
96//
a897a37a 97 //
98 // Step to next pad in integration region
99 Float_t xc,yc;
100 Int_t ixc;
101
102// step up
103 if (fy < fymax && fy != 0) {
104 if (fiy==-1) fiy++;
105 fiy++;
106// step right
107 } else if (fix != fixmax) {
108 if (fix==-1) fix++;
109 fix++;
110// get y-position of next row (yc), xc not used here
111 GetPadCxy(fix,fiy,xc,yc);
112// get x-pad coordiante for 1 pad in row (fix)
113 GetPadIxy(xc,fymin,ixc,fiy);
114 } else {
115 printf("\n Error: Stepping outside integration region\n ");
116 }
117 GetPadCxy(fix,fiy,fx,fy);
118 fSector=Sector(fix,fiy);
119 if (MorePads() &&
a9e2aefa 120 (fSector ==-1 || fSector==0 ))
a897a37a 121 NextPad();
122// printf("\n this pad %f %f %d %d \n",fx,fy,fix,fiy);
123
124}
125
a9e2aefa 126Int_t AliMUONSegmentationV02::MorePads()
127// Stopping condition for the iterator over pads
128//
a897a37a 129//
130// Are there more pads in the integration region
131{
132 if ((fy >= fymax && fix >= fixmax) || fx==0) {
133 return 0;
134 } else {
135 return 1;
136 }
137}
138
a9e2aefa 139void AliMUONSegmentationV02::
a897a37a 140Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
141{
a9e2aefa 142// Returns list of next neighbours for given Pad (iX, iY)
143//
144 Int_t n;
145 AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);
146 *Nlist=n;
a897a37a 147}
148
149
a9e2aefa 150
151