]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentationV02.cxx
Corrections to the custom Streamer
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationV02.cxx
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$
18 Revision 1.1.2.1  2000/06/09 21:37:56  morsch
19 AliMUONSegmentationV02 code  from  AliMUONSegResV02.cxx
20
21 */
22
23
24
25 /////////////////////////////////////////////////////
26 //  Segmentation and Response classes version 02   //
27 /////////////////////////////////////////////////////
28
29
30 #include "AliMUONSegmentationV02.h"
31 #include "iostream.h"
32
33 //___________________________________________
34 ClassImp(AliMUONSegmentationV02)
35
36 void AliMUONSegmentationV02::SetPadSize(Float_t p1, Float_t p2)
37 {
38 //  Sets the padsize 
39 //
40     fDpy=p1;
41     fDpx=p2;
42 }
43
44 Int_t AliMUONSegmentationV02::Npx()
45 // Returns maximum number if pads in x
46 {return AliMUONSegmentationV01::Npy();}
47
48 Int_t AliMUONSegmentationV02::Npy()
49 // Returns maximum number if pads in y
50 {return AliMUONSegmentationV01::Npx();}
51
52
53 Float_t AliMUONSegmentationV02::Dpx(Int_t isec)
54 // Returns pad-size in x
55 {return fDpy;}
56
57 Float_t AliMUONSegmentationV02::Dpy(Int_t isec)
58 // Returns pad-size in y
59 {return fDpxD[isec];}
60 Int_t AliMUONSegmentationV02::Sector(Int_t ix, Int_t iy)
61 // Returns sector number for given pad position
62 //
63 {return AliMUONSegmentationV01::Sector(iy, ix);}
64
65 void AliMUONSegmentationV02::
66
67 GetPadIxy(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
68 //  Returns pad coordinates (ix,iy) for given real coordinates (x,y)
69 //
70 {
71 AliMUONSegmentationV01::GetPadIxy(y, x, iy, ix);
72 // printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
73 }
74
75 void AliMUONSegmentationV02::
76 GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
77 //  Returns real coordinates (x,y) for given pad coordinates (ix,iy)
78 //
79 {
80     AliMUONSegmentationV01::GetPadCxy(iy, ix, y, x);
81 }
82 void AliMUONSegmentationV02::SetPad(Int_t ix,Int_t iy)
83 {
84     //
85     // Sets virtual pad coordinates, needed for evaluating pad response 
86     // outside the tracking program 
87     GetPadCxy(ix,iy,fx,fy);
88     fSector=Sector(ix,iy);    
89 }
90
91
92
93 void AliMUONSegmentationV02::NextPad()
94 {
95 // Stepper for the iteration over pads
96 //
97   // 
98   // Step to next pad in integration region
99     Float_t xc,yc;
100     Int_t   ixc;
101     
102 //  step up    
103     if (fy < fymax && fy != 0) {
104         if (fiy==-1) fiy++;
105         fiy++;
106 //  step right 
107     } else if (fix != fixmax) {
108         if (fix==-1) fix++;
109         fix++;
110 //      get y-position of next row (yc), xc not used here       
111         GetPadCxy(fix,fiy,xc,yc);
112 //      get x-pad coordiante for 1 pad in row (fix)
113         GetPadIxy(xc,fymin,ixc,fiy);
114     } else {
115         printf("\n Error: Stepping outside integration region\n ");
116     }
117     GetPadCxy(fix,fiy,fx,fy);
118     fSector=Sector(fix,fiy);
119     if (MorePads() && 
120         (fSector ==-1 || fSector==0 )) 
121         NextPad();
122 //    printf("\n this pad %f %f %d %d \n",fx,fy,fix,fiy);
123     
124 }
125
126 Int_t AliMUONSegmentationV02::MorePads()
127 // Stopping condition for the iterator over pads
128 //
129 //
130 // Are there more pads in the integration region
131 {
132     if ((fy >= fymax  && fix >= fixmax) || fx==0) {
133         return 0;
134     } else {
135         return 1;
136     }
137 }
138
139 void AliMUONSegmentationV02::
140 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
141 {
142 // Returns list of next neighbours for given Pad (iX, iY)
143 //
144     Int_t n;
145     AliMUONSegmentationV01::Neighbours(iY, iX, &n, Ylist, Xlist);
146     *Nlist=n;
147 }
148
149
150
151