]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSegmentationV02.cxx
Clean-up of coding rule violations,
[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$
de05461e 18Revision 1.6 2000/10/18 08:41:32 morsch
19Make NextPad() and MorePads() to iterate until the end.
20
d7d176c9 21Revision 1.5 2000/10/03 21:48:07 morsch
22Adopt to const declaration of some of the methods in AliSegmentation.
23
c3eff6ad 24Revision 1.4 2000/10/02 16:58:29 egangler
25Cleaning of the code :
26-> coding conventions
27-> void Streamers
28-> some useless includes removed or replaced by "class" statement
29
ecfa008b 30Revision 1.3 2000/07/03 11:54:57 morsch
31AliMUONSegmentation and AliMUONHitMap have been replaced by AliSegmentation and AliHitMap in STEER
32The methods GetPadIxy and GetPadXxy of AliMUONSegmentation have changed name to GetPadI and GetPadC.
33
a30a000f 34Revision 1.2 2000/06/15 07:58:48 morsch
35Code from MUON-dev joined
36
a9e2aefa 37Revision 1.1.2.1 2000/06/09 21:37:56 morsch
38AliMUONSegmentationV02 code from AliMUONSegResV02.cxx
39
4c039060 40*/
41
a9e2aefa 42
43
a897a37a 44/////////////////////////////////////////////////////
45// Segmentation and Response classes version 02 //
46/////////////////////////////////////////////////////
47
a9e2aefa 48
49#include "AliMUONSegmentationV02.h"
a897a37a 50#include "iostream.h"
51
52//___________________________________________
a9e2aefa 53ClassImp(AliMUONSegmentationV02)
a897a37a 54
a9e2aefa 55void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2)
a897a37a 56{
a9e2aefa 57// Sets the padsize
58//
a897a37a 59 fDpy=p1;
60 fDpx=p2;
61}
62
c3eff6ad 63Int_t AliMUONSegmentationV02::Npx() const
a9e2aefa 64// Returns maximum number if pads in x
65{return AliMUONSegmentationV01::Npy();}
a897a37a 66
c3eff6ad 67Int_t AliMUONSegmentationV02::Npy() const
a9e2aefa 68// Returns maximum number if pads in y
69{return AliMUONSegmentationV01::Npx();}
a897a37a 70
71
c3eff6ad 72Float_t AliMUONSegmentationV02::Dpx(Int_t isec) const
a9e2aefa 73// Returns pad-size in x
a897a37a 74{return fDpy;}
75
c3eff6ad 76Float_t AliMUONSegmentationV02::Dpy(Int_t isec) const
a9e2aefa 77// Returns pad-size in y
c3eff6ad 78{return (*fDpxD)[isec];}
79
80Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
a9e2aefa 81// Returns sector number for given pad position
82//
83{return AliMUONSegmentationV01::Sector(iy, ix);}
a897a37a 84
a9e2aefa 85void AliMUONSegmentationV02::
c3eff6ad 86GetPadI(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
a9e2aefa 87// Returns pad coordinates (ix,iy) for given real coordinates (x,y)
88//
a897a37a 89{
c3eff6ad 90AliMUONSegmentationV01::GetPadI(y, x, iy, ix);
a897a37a 91// printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
92}
93
a9e2aefa 94void AliMUONSegmentationV02::
c3eff6ad 95GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
de05461e 96{
a9e2aefa 97// Returns real coordinates (x,y) for given pad coordinates (ix,iy)
98//
de05461e 99
a30a000f 100 AliMUONSegmentationV01::GetPadC(iy, ix, y, x);
a897a37a 101}
a9e2aefa 102void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
a897a37a 103{
a9e2aefa 104 //
105 // Sets virtual pad coordinates, needed for evaluating pad response
106 // outside the tracking program
ecfa008b 107 GetPadC(ix,iy,fX,fY);
a897a37a 108 fSector=Sector(ix,iy);
109}
110
111
112
a9e2aefa 113void AliMUONSegmentationV02::NextPad()
a897a37a 114{
a9e2aefa 115// Stepper for the iteration over pads
116//
a897a37a 117 //
118 // Step to next pad in integration region
119 Float_t xc,yc;
120 Int_t ixc;
121
122// step up
ecfa008b 123 if (fY < fYmax && fY != 0) {
124 if (fIy==-1) fIy++;
125 fIy++;
a897a37a 126// step right
ecfa008b 127 } else if (fIx != fIxmax) {
128 if (fIx==-1) fIx++;
129 fIx++;
a897a37a 130// get y-position of next row (yc), xc not used here
ecfa008b 131 GetPadC(fIx,fIy,xc,yc);
132// get x-pad coordiante for 1 pad in row (fIx)
133 GetPadI(xc,fYmin,ixc,fIy);
a897a37a 134 } else {
d7d176c9 135 fIx=fIy=-1;
a897a37a 136 }
ecfa008b 137 GetPadC(fIx,fIy,fX,fY);
138 fSector=Sector(fIx,fIy);
a897a37a 139 if (MorePads() &&
a9e2aefa 140 (fSector ==-1 || fSector==0 ))
a897a37a 141 NextPad();
ecfa008b 142// printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
a897a37a 143
144}
145
a9e2aefa 146Int_t AliMUONSegmentationV02::MorePads()
de05461e 147{
a9e2aefa 148// Stopping condition for the iterator over pads
149//
a897a37a 150//
151// Are there more pads in the integration region
de05461e 152
d7d176c9 153 return (fIx != -1 || fIy != -1);
154/*
ecfa008b 155 if ((fY >= fYmax && fIx >= fIxmax) || fX==0) {
a897a37a 156 return 0;
157 } else {
158 return 1;
159 }
d7d176c9 160*/
a897a37a 161}
162
a9e2aefa 163void AliMUONSegmentationV02::
c3eff6ad 164Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
a897a37a 165{
a9e2aefa 166// Returns list of next neighbours for given Pad (iX, iY)
167//
168 Int_t n;
169 AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);
170 *Nlist=n;
a897a37a 171}
172
173
a9e2aefa 174
175