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