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