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