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