]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentationV05.cxx
Coding violations...
[u/mrichter/AliRoot.git] / MUON / AliMUONSegmentationV05.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 /* $Id$ */
17
18 /////////////////////////////////////////////////////
19 //  Segmentation and Response classes version 05   //
20 /////////////////////////////////////////////////////
21
22 #include <TMath.h>
23 #include <TArrayF.h>
24
25 #include "AliMUONSegmentationV05.h"
26 #include "AliMUON.h"
27 #include "AliMUONChamber.h"
28 #include "AliRun.h"
29
30 //___________________________________________
31 ClassImp(AliMUONSegmentationV05)
32
33
34 AliMUONSegmentationV05::AliMUONSegmentationV05()
35   : AliMUONSegmentationV02()
36 {
37 // Constructor
38 }
39
40 void AliMUONSegmentationV05::Init(Int_t chamber)
41 {
42 //
43 //  Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector
44 //  These arrays help in converting from real to pad co-ordinates and
45 //  vice versa
46 //
47 //  Segmentation is defined by rectangular modules approximating
48 //  concentric circles as shown below
49 //
50
51   //printf("\n Initialise Segmentation V05 \n");
52
53
54 //  PCB module size in cm
55     const Float_t kDxPCB=40, kDyPCB=40;
56 //  PCB distribution (7 rows with 1+3 segmentation regions)
57     const Int_t kpcb[7][4] = {{1, 2, 2, 2}, 
58                               {0, 3, 2, 2}, 
59                               {0, 2, 2, 2}, 
60                               {0, 0, 3, 3}, 
61                               {0, 0, 2, 3}, 
62                               {0, 0, 0, 4}, 
63                               {0, 0, 0, 3}};
64     
65     
66 //
67 //                             3 3 3 | 3 3 3
68 //                           3 3 3 3 | 3 3 3 3
69 //                         3 3 3 2 2 | 2 2 3 3 3
70 //                       3 3 3 2 2 2 | 2 2 2 3 3 3
71 //                       3 3 2 2 1 1 | 1 1 2 2 3 3      
72 //                     3 3 2 2 1 1 1 | 1 1 1 2 2 3 3
73 //                     3 3 2 2 1 1 0 | 0 1 1 2 2 3 3
74 //                    ------------------------------
75 //                     3 3 2 2 1 1 0 | 0 1 1 2 2 3 3
76 //                     3 3 2 2 1 1 1 | 1 1 1 2 2 3 3
77 //                       3 3 2 2 1 1 | 1 1 2 2 3 3      
78 //                       3 3 3 2 2 2 | 2 2 2 3 3 3                      
79 //                         3 3 3 2 2 | 2 2 3 3 3
80 //                           3 3 3 3 | 3 3 3 3
81 //                             3 3 3 | 3 3 3
82 //
83 // number of pad rows per PCB
84 //    
85     Int_t nPyPCB=Int_t(kDyPCB/fDpy);
86 //
87 // maximum number of pad rows    
88     fNpy=7*nPyPCB;
89 //
90 //  Calculate padsize along x
91     (*fDpxD)[fNsec-1]=fDpx;
92     if (fNsec > 1) {
93         for (Int_t i=fNsec-2; i>=0; i--){
94             (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i];
95         }
96     }
97 //
98 // fill the arrays defining the pad segmentation boundaries
99 //
100 //  loop over pcb module rows
101     Int_t iy=0;
102     for (Int_t irow=0; irow<7; irow++) {
103 //  
104 //  loop over pads along the anode wires
105         for (Int_t i=0; i<=nPyPCB; i++) {
106 //  iy counts the padrow
107             iy++;
108 //  Loop over sectors (isec=0 is the dead space surounding the beam pipe)
109             for (Int_t isec=0; isec<4; isec++) {
110                 if (isec==0) {
111                     fNpxS[0][iy]=kpcb[irow][0]*Int_t(kDxPCB/(*fDpxD)[0]);
112                     fCx[0][iy]=kpcb[irow][0]*kDxPCB;
113                 } else {
114                     fNpxS[isec][iy]=fNpxS[isec-1][iy]
115                         +kpcb[irow][isec]*Int_t(kDxPCB/(*fDpxD)[isec]);
116
117                     fCx[isec][iy]=fCx[isec-1][iy]
118                     +kpcb[irow][isec]*kDxPCB;
119                 }
120             } // sectors
121         } // pad raws in module
122     } // PCB rows
123
124     AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
125     fChamber=&(pMUON->Chamber(chamber));
126     fZ = fChamber->Z();
127 }
128
129 void AliMUONSegmentationV05::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const
130 {
131 // Returns test point on the pad plane.
132 // Used during determination of the segmoid correction of the COG-method
133     n=1;
134     x[0]=(fCx[1][1]+fCx[0][1])/2/TMath::Sqrt(2.);
135     y[0]=x[0];
136 }
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153