]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUONSegmentationV02.cxx
Transition to NewIO
[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
88cb7938 16/* $Id$ */
a9e2aefa 17
a897a37a 18/////////////////////////////////////////////////////
19// Segmentation and Response classes version 02 //
20/////////////////////////////////////////////////////
21
a9e2aefa 22
23#include "AliMUONSegmentationV02.h"
70479d0e 24#include "Riostream.h"
a897a37a 25
26//___________________________________________
a9e2aefa 27ClassImp(AliMUONSegmentationV02)
a897a37a 28
e9e4cdf2 29
30AliMUONSegmentationV02::AliMUONSegmentationV02(Int_t nsec):
31 AliMUONSegmentationV01(nsec)
32{
33// Non default constructor
34}
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
c3eff6ad 44Int_t AliMUONSegmentationV02::Npx() const
a9e2aefa 45// Returns maximum number if pads in x
46{return AliMUONSegmentationV01::Npy();}
a897a37a 47
c3eff6ad 48Int_t AliMUONSegmentationV02::Npy() const
a9e2aefa 49// Returns maximum number if pads in y
50{return AliMUONSegmentationV01::Npx();}
a897a37a 51
52
c3eff6ad 53Float_t AliMUONSegmentationV02::Dpx(Int_t isec) const
a9e2aefa 54// Returns pad-size in x
a897a37a 55{return fDpy;}
56
c3eff6ad 57Float_t AliMUONSegmentationV02::Dpy(Int_t isec) const
a9e2aefa 58// Returns pad-size in y
c3eff6ad 59{return (*fDpxD)[isec];}
60
61Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
a9e2aefa 62// Returns sector number for given pad position
63//
64{return AliMUONSegmentationV01::Sector(iy, ix);}
a897a37a 65
a9e2aefa 66void AliMUONSegmentationV02::
c3eff6ad 67GetPadI(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{
c3eff6ad 71AliMUONSegmentationV01::GetPadI(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::
c3eff6ad 76GetPadC(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
de05461e 77{
a9e2aefa 78// Returns real coordinates (x,y) for given pad coordinates (ix,iy)
79//
de05461e 80
a30a000f 81 AliMUONSegmentationV01::GetPadC(iy, ix, y, x);
a897a37a 82}
a9e2aefa 83void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
a897a37a 84{
a9e2aefa 85 //
86 // Sets virtual pad coordinates, needed for evaluating pad response
87 // outside the tracking program
ecfa008b 88 GetPadC(ix,iy,fX,fY);
a897a37a 89 fSector=Sector(ix,iy);
90}
91
92
93
a9e2aefa 94void AliMUONSegmentationV02::NextPad()
a897a37a 95{
a9e2aefa 96// Stepper for the iteration over pads
97//
a897a37a 98 //
99 // Step to next pad in integration region
100 Float_t xc,yc;
101 Int_t ixc;
102
103// step up
ecfa008b 104 if (fY < fYmax && fY != 0) {
105 if (fIy==-1) fIy++;
106 fIy++;
a897a37a 107// step right
ecfa008b 108 } else if (fIx != fIxmax) {
109 if (fIx==-1) fIx++;
110 fIx++;
a897a37a 111// get y-position of next row (yc), xc not used here
ecfa008b 112 GetPadC(fIx,fIy,xc,yc);
113// get x-pad coordiante for 1 pad in row (fIx)
114 GetPadI(xc,fYmin,ixc,fIy);
a897a37a 115 } else {
d7d176c9 116 fIx=fIy=-1;
a897a37a 117 }
ecfa008b 118 GetPadC(fIx,fIy,fX,fY);
119 fSector=Sector(fIx,fIy);
a897a37a 120 if (MorePads() &&
a9e2aefa 121 (fSector ==-1 || fSector==0 ))
a897a37a 122 NextPad();
ecfa008b 123// printf("\n this pad %f %f %d %d \n",fX,fY,fIx,fIy);
a897a37a 124
125}
126
a9e2aefa 127Int_t AliMUONSegmentationV02::MorePads()
de05461e 128{
a9e2aefa 129// Stopping condition for the iterator over pads
130//
a897a37a 131//
132// Are there more pads in the integration region
de05461e 133
d7d176c9 134 return (fIx != -1 || fIy != -1);
135/*
ecfa008b 136 if ((fY >= fYmax && fIx >= fIxmax) || fX==0) {
a897a37a 137 return 0;
138 } else {
139 return 1;
140 }
d7d176c9 141*/
a897a37a 142}
143
a9e2aefa 144void AliMUONSegmentationV02::
c3eff6ad 145Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
a897a37a 146{
a9e2aefa 147// Returns list of next neighbours for given Pad (iX, iY)
148//
149 Int_t n;
150 AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);
151 *Nlist=n;
a897a37a 152}
153
154
a9e2aefa 155
156