]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegResV02.cxx
Introducing Copyright include file
[u/mrichter/AliRoot.git] / MUON / AliMUONSegResV02.cxx
1 /////////////////////////////////////////////////////
2 //  Segmentation and Response classes version 02   //
3 /////////////////////////////////////////////////////
4
5 #include <TTUBE.h>
6 #include <TNode.h> 
7 #include <TRandom.h> 
8 #include "AliMUONSegResV02.h"
9 #include "AliRun.h"
10 #include "AliMC.h"
11 #include "iostream.h"
12
13 //___________________________________________
14 ClassImp(AliMUONsegmentationV02)
15
16 void AliMUONsegmentationV02::SetPADSIZ(Float_t p1, Float_t p2)
17 {
18     fDpy=p1;
19     fDpx=p2;
20 }
21
22 Int_t AliMUONsegmentationV02::Npx()
23 {return AliMUONsegmentationV01::Npy();}
24
25 Int_t AliMUONsegmentationV02::Npy()
26 {return AliMUONsegmentationV01::Npx();}
27
28
29 Float_t AliMUONsegmentationV02::Dpx(Int_t)
30 {return fDpy;}
31
32 Float_t AliMUONsegmentationV02::Dpy(Int_t isec)
33 {return fDpxD[isec];}
34
35 Int_t AliMUONsegmentationV02::Sector(Int_t ix, Int_t iy)
36 {return AliMUONsegmentationV01::Sector(iy, ix);}
37
38 void AliMUONsegmentationV02::
39 GetPadIxy(Float_t x, Float_t y, Int_t &ix, Int_t &iy)
40 {
41 AliMUONsegmentationV01::GetPadIxy(y, x, iy, ix);
42 // printf("\n x,y,ix,iy %f %f %d %d", x,y,ix,iy);
43 }
44
45 void AliMUONsegmentationV02::
46 GetPadCxy(Int_t ix, Int_t iy, Float_t &x, Float_t &y)
47 {
48     AliMUONsegmentationV01::GetPadCxy(iy, ix, y, x);
49 //    printf("\n ix,iy,x,y %d %d %f %f ", ix,iy,x,y);
50 }
51 void    AliMUONsegmentationV02::SetPad(Int_t ix,Int_t iy)
52 {
53     GetPadCxy(ix,iy,fx,fy);
54     fSector=Sector(ix,iy);    
55 }
56
57
58
59 void AliMUONsegmentationV02::NextPad()
60 {
61   // 
62   // Step to next pad in integration region
63     Float_t xc,yc;
64     Int_t   ixc;
65     
66 //  step up    
67     if (fy < fymax && fy != 0) {
68         if (fiy==-1) fiy++;
69         fiy++;
70 //  step right 
71     } else if (fix != fixmax) {
72         if (fix==-1) fix++;
73         fix++;
74 //      get y-position of next row (yc), xc not used here       
75         GetPadCxy(fix,fiy,xc,yc);
76 //      get x-pad coordiante for 1 pad in row (fix)
77         GetPadIxy(xc,fymin,ixc,fiy);
78     } else {
79         printf("\n Error: Stepping outside integration region\n ");
80     }
81     GetPadCxy(fix,fiy,fx,fy);
82     fSector=Sector(fix,fiy);
83     if (MorePads() && 
84         (fSector ==-1 || fSector==0 || 
85          TMath::Abs(fx)<1.5 || TMath::Abs(fy)<1.5)) 
86         NextPad();
87 //    printf("\n this pad %f %f %d %d \n",fx,fy,fix,fiy);
88     
89 }
90
91 Int_t AliMUONsegmentationV02::MorePads()
92 //
93 // Are there more pads in the integration region
94 {
95     if ((fy >= fymax  && fix >= fixmax) || fx==0) {
96         return 0;
97     } else {
98         return 1;
99     }
100 }
101
102 void AliMUONsegmentationV02::
103 Neighbours(Int_t iX, Int_t iY, Int_t* Nlist, Int_t Xlist[10], Int_t Ylist[10])
104 {
105     Int_t N;
106     AliMUONsegmentationV01::Neighbours(iY, iX, &N, Ylist, Xlist);
107     *Nlist=N;
108 }
109
110