]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSegmentationV05.cxx
Add input file name as a parameter, default is galice.root
[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 /*
17 $Log$
18 Revision 1.6  2000/12/21 22:12:41  morsch
19 Clean-up of coding rule violations,
20
21 Revision 1.5  2000/10/18 11:42:06  morsch
22 - AliMUONRawCluster contains z-position.
23 - Some clean-up of useless print statements during initialisations.
24
25 Revision 1.4  2000/10/03 21:48:07  morsch
26 Adopt to const declaration of some of the methods in AliSegmentation.
27
28 Revision 1.3  2000/06/29 12:34:09  morsch
29 AliMUONSegmentation class has been made independent of AliMUONChamber. This makes
30 it usable with any other geometry class. The link to the object to which it belongs is
31 established via an index. This assumes that there exists a global geometry manager
32 from which the pointer to the parent object can be obtained (in our case gAlice).
33
34 Revision 1.2  2000/06/15 07:58:48  morsch
35 Code from MUON-dev joined
36
37 Revision 1.1.2.1  2000/06/09 21:38:46  morsch
38 AliMUONSegmentationV05 code  from  AliMUONSegResV05.cxx
39
40 */
41
42 /////////////////////////////////////////////////////
43 //  Segmentation and Response classes version 05   //
44 /////////////////////////////////////////////////////
45
46
47 #include "AliMUONSegmentationV05.h"
48 #include "AliMUON.h"
49 #include "AliMUONChamber.h"
50 #include "AliRun.h"
51
52 #include <TMath.h>
53 //___________________________________________
54 ClassImp(AliMUONSegmentationV05)
55
56
57 void AliMUONSegmentationV05::Init(Int_t chamber)
58 {
59 //
60 //  Fill the arrays fCx (x-contour) and fNpxS (ix-contour) for each sector
61 //  These arrays help in converting from real to pad co-ordinates and
62 //  vice versa
63 //
64 //  Segmentation is defined by rectangular modules approximating
65 //  concentric circles as shown below
66 //
67
68   //printf("\n Initialise Segmentation V05 \n");
69
70
71 //  PCB module size in cm
72     const Float_t kDxPCB=40, kDyPCB=40;
73 //  PCB distribution (7 rows with 1+3 segmentation regions)
74     const Int_t kpcb[7][4] = {{1, 2, 2, 2}, 
75                               {0, 3, 2, 2}, 
76                               {0, 2, 2, 2}, 
77                               {0, 0, 3, 3}, 
78                               {0, 0, 2, 3}, 
79                               {0, 0, 0, 4}, 
80                               {0, 0, 0, 3}};
81     
82     
83 //
84 //                             3 3 3 | 3 3 3
85 //                           3 3 3 3 | 3 3 3 3
86 //                         3 3 3 2 2 | 2 2 3 3 3
87 //                       3 3 3 2 2 2 | 2 2 2 3 3 3
88 //                       3 3 2 2 1 1 | 1 1 2 2 3 3      
89 //                     3 3 2 2 1 1 1 | 1 1 1 2 2 3 3
90 //                     3 3 2 2 1 1 0 | 0 1 1 2 2 3 3
91 //                    ------------------------------
92 //                     3 3 2 2 1 1 0 | 0 1 1 2 2 3 3
93 //                     3 3 2 2 1 1 1 | 1 1 1 2 2 3 3
94 //                       3 3 2 2 1 1 | 1 1 2 2 3 3      
95 //                       3 3 3 2 2 2 | 2 2 2 3 3 3                      
96 //                         3 3 3 2 2 | 2 2 3 3 3
97 //                           3 3 3 3 | 3 3 3 3
98 //                             3 3 3 | 3 3 3
99 //
100 // number of pad rows per PCB
101 //    
102     Int_t nPyPCB=Int_t(kDyPCB/fDpy);
103 //
104 // maximum number of pad rows    
105     fNpy=7*nPyPCB;
106 //
107 //  Calculate padsize along x
108     (*fDpxD)[fNsec-1]=fDpx;
109     if (fNsec > 1) {
110         for (Int_t i=fNsec-2; i>=0; i--){
111             (*fDpxD)[i]=(*fDpxD)[fNsec-1]/(*fNDiv)[i];
112         }
113     }
114 //
115 // fill the arrays defining the pad segmentation boundaries
116 //
117 //  loop over pcb module rows
118     Int_t iy=0;
119     for (Int_t irow=0; irow<7; irow++) {
120 //  
121 //  loop over pads along the anode wires
122         for (Int_t i=0; i<=nPyPCB; i++) {
123 //  iy counts the padrow
124             iy++;
125 //  Loop over sectors (isec=0 is the dead space surounding the beam pipe)
126             for (Int_t isec=0; isec<4; isec++) {
127                 if (isec==0) {
128                     fNpxS[0][iy]=kpcb[irow][0]*Int_t(kDxPCB/(*fDpxD)[0]);
129                     fCx[0][iy]=kpcb[irow][0]*kDxPCB;
130                 } else {
131                     fNpxS[isec][iy]=fNpxS[isec-1][iy]
132                         +kpcb[irow][isec]*Int_t(kDxPCB/(*fDpxD)[isec]);
133
134                     fCx[isec][iy]=fCx[isec-1][iy]
135                     +kpcb[irow][isec]*kDxPCB;
136                 }
137             } // sectors
138         } // pad raws in module
139     } // PCB rows
140
141     AliMUON *pMUON  = (AliMUON *) gAlice->GetModule("MUON");
142     fChamber=&(pMUON->Chamber(chamber));
143     fZ = fChamber->Z();
144 }
145
146 void AliMUONSegmentationV05::GiveTestPoints(Int_t &n, Float_t *x, Float_t *y) const
147 {
148 // Returns test point on the pad plane.
149 // Used during determination of the segmoid correction of the COG-method
150     n=1;
151     x[0]=(fCx[1][1]+fCx[0][1])/2/TMath::Sqrt(2.);
152     y[0]=x[0];
153 }
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170