]>
Commit | Line | Data |
---|---|---|
a9e2aefa | 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$ | |
0c19630f | 18 | Revision 1.2 2000/06/15 07:58:48 morsch |
19 | Code from MUON-dev joined | |
20 | ||
a9e2aefa | 21 | Revision 1.1.2.1 2000/06/09 21:47:24 morsch |
22 | Code from AliMUONSegResTrigger.cxx | |
23 | ||
24 | */ | |
25 | ||
26 | /* | |
27 | old Log: | |
28 | AliMUONSegResTrigger.cxx,v $ | |
29 | Revision 1.1.2.3 2000/04/26 12:32:39 morsch | |
30 | Mods by P. Crochet: | |
31 | - adapted to the new Trigger chamber geometry | |
32 | - method SetZScale removed | |
33 | ||
34 | Revision 1.1.2.2 2000/02/21 16:13:33 morsch | |
35 | Full cluster simulation activated by uncommenting corresponding lines in IntXY() | |
36 | ||
37 | Revision 1.1.2.1 2000/02/17 14:32:40 morsch | |
38 | Draft version from P. Crochet | |
39 | ||
40 | */ | |
41 | ||
42 | #include "AliMUONSegmentationTrigger.h" | |
0c19630f | 43 | #include "AliMUONTriggerConstants.h" |
a9e2aefa | 44 | #include <TMath.h> |
45 | #include <TRandom.h> | |
46 | #include <TArc.h> | |
47 | #include "AliMUONChamber.h" | |
48 | #include <iostream.h> | |
49 | ||
50 | ClassImp(AliMUONSegmentationTrigger) | |
51 | ||
0c19630f | 52 | //------------------------------------------------------------------ |
a9e2aefa | 53 | void AliMUONSegmentationTrigger::Init(AliMUONChamber* Chamber) |
54 | { | |
55 | // initialize Module geometry | |
56 | cout << "Initialize Trigger Chamber Module Geometry " << "\n"; | |
57 | ||
58 | Float_t zPos=Chamber->Z(); | |
59 | Float_t z1Pos=1603.5; | |
60 | fZscale = zPos/z1Pos; | |
61 | ||
a9e2aefa | 62 | Float_t y1Cmin[126]; |
63 | Float_t y1Cmax[126]; | |
64 | ||
65 | Float_t dz=7.2; | |
66 | Float_t z1PosPlus=z1Pos+dz/2.; | |
67 | Float_t z1PosMinus=z1Pos-dz/2.; | |
68 | ||
69 | Float_t z1pm=z1PosPlus/z1PosMinus; | |
70 | Float_t z1mp=z1PosMinus/z1PosPlus; | |
71 | ||
72 | cout << " fZscale = " << fZscale << "\n"; | |
0c19630f | 73 | |
74 | // calculate yCmin and fYcmax | |
75 | Int_t i; | |
76 | for (i=62; i>=0; i--) { | |
77 | Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left | |
78 | if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber | |
79 | if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module) | |
80 | fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.; | |
a9e2aefa | 81 | } else { |
82 | y1Cmin[i]=y1Cmin[j]=-34; | |
83 | y1Cmax[i]=y1Cmax[j]=34; | |
0c19630f | 84 | fYcmin[i]=fYcmin[j]=-34.; |
85 | ||
86 | fYcmax[i]=fYcmax[j]=34.; | |
a9e2aefa | 87 | } |
0c19630f | 88 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up |
89 | if (AliMUONTriggerConstants::ModuleId(i)!=41) { | |
a9e2aefa | 90 | y1Cmin[i]=y1Cmax[i+7]*z1pm; |
91 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 92 | fYcmin[i]=y1Cmin[i]; |
93 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 94 | |
95 | y1Cmin[j]=y1Cmax[j+7]*z1mp; | |
96 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 97 | fYcmin[j]=y1Cmin[j]; |
98 | fYcmax[j]=fYcmin[j]+68.; | |
a9e2aefa | 99 | } else { |
100 | y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17; | |
101 | y1Cmax[i]=y1Cmin[i]+51.; | |
0c19630f | 102 | fYcmin[i]=y1Cmin[i]; |
103 | fYcmax[i]=fYcmin[i]+51.; | |
a9e2aefa | 104 | |
105 | y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17; | |
106 | y1Cmax[j]=y1Cmin[j]+51.; | |
0c19630f | 107 | fYcmin[j]=y1Cmin[j]; |
108 | fYcmax[j]=fYcmin[j]+51.; | |
a9e2aefa | 109 | } |
0c19630f | 110 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { |
a9e2aefa | 111 | y1Cmin[i]=y1Cmax[i+7]*z1mp; |
112 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 113 | fYcmin[i]=y1Cmin[i]; |
114 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 115 | |
116 | y1Cmin[j]=y1Cmax[j+7]*z1pm; | |
117 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 118 | fYcmin[j]=y1Cmin[j]; |
119 | fYcmax[j]=fYcmin[j]+68.; | |
120 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) { | |
a9e2aefa | 121 | y1Cmin[i]=y1Cmax[i+7]*z1pm; |
122 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 123 | fYcmin[i]=y1Cmin[i]; |
124 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 125 | |
126 | y1Cmin[j]=y1Cmax[j+7]*z1mp; | |
127 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 128 | fYcmin[j]=y1Cmin[j]; |
129 | fYcmax[j]=fYcmin[j]+68.; | |
130 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) { | |
a9e2aefa | 131 | y1Cmin[i]=y1Cmax[i+7]*z1mp; |
132 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 133 | fYcmin[i]=y1Cmin[i]; |
134 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 135 | |
136 | y1Cmin[j]=y1Cmax[j+7]*z1pm; | |
137 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 138 | fYcmin[j]=y1Cmin[j]; |
139 | fYcmax[j]=fYcmin[j]+68.; | |
a9e2aefa | 140 | } |
141 | } | |
142 | ||
0c19630f | 143 | for (i=0; i<63; i++) { // second loop (fill lower part) |
144 | Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left | |
145 | if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) { | |
146 | fYcmin[i]=-fYcmax[i-14]; | |
147 | fYcmax[i]=-fYcmin[i-14]; | |
148 | fYcmin[j]=-fYcmax[j-14]; | |
149 | fYcmax[j]=-fYcmin[j-14]; | |
150 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) { | |
151 | fYcmin[i]=-fYcmax[i-28]; | |
152 | fYcmax[i]=-fYcmin[i-28]; | |
153 | fYcmin[j]=-fYcmax[j-28]; | |
154 | fYcmax[j]=-fYcmin[j-28]; | |
155 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) { | |
156 | fYcmin[i]=-fYcmax[i-42]; | |
157 | fYcmax[i]=-fYcmin[i-42]; | |
158 | fYcmin[j]=-fYcmax[j-42]; | |
159 | fYcmax[j]=-fYcmin[j-42]; | |
160 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) { | |
161 | fYcmin[i]=-fYcmax[i-56]; | |
162 | fYcmax[i]=-fYcmin[i-56]; | |
163 | fYcmin[j]=-fYcmax[j-56]; | |
164 | fYcmax[j]=-fYcmin[j-56]; | |
a9e2aefa | 165 | } |
166 | } | |
167 | ||
a9e2aefa | 168 | fNpx=124; |
169 | fNpy=64; | |
170 | ||
171 | cout << "---------------------------------------------------- \n"; | |
172 | ||
173 | } | |
174 | ||
175 | //------------------------------------------------------------------ | |
176 | Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){ | |
177 | // returns module number (from 0 to 126) corresponding to module imodule | |
178 | Int_t imod=0; | |
0c19630f | 179 | for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) { |
180 | if (AliMUONTriggerConstants::ModuleId(i)==imodule) { | |
a9e2aefa | 181 | imod=i; |
182 | break; | |
183 | } | |
184 | } | |
185 | return imod; | |
186 | } | |
187 | ||
188 | //------------------------------------------------------------------ | |
189 | Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){ | |
190 | // Returns x-strip size for given module imodule | |
191 | ||
192 | Int_t absimodule=TMath::Abs(imodule); | |
193 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 194 | if (absimodule==51) { |
a9e2aefa | 195 | return 0; |
196 | } else { | |
0c19630f | 197 | return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/ |
198 | AliMUONTriggerConstants::NstripX(moduleNum)); | |
199 | } | |
a9e2aefa | 200 | } |
201 | ||
202 | //------------------------------------------------------------------ | |
203 | Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){ | |
204 | // Returns y-strip size for given module imodule | |
205 | ||
206 | Int_t absimodule=TMath::Abs(imodule); | |
207 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 208 | if (absimodule==51) { |
a9e2aefa | 209 | return 0; |
210 | } else { | |
0c19630f | 211 | return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - |
212 | AliMUONTriggerConstants::XcMin(moduleNum)) / | |
213 | AliMUONTriggerConstants::NstripY(moduleNum)); | |
a9e2aefa | 214 | } |
215 | } | |
216 | ||
217 | //------------------------------------------------------------------ | |
218 | void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit) | |
219 | { | |
220 | // Sets virtual hit position, needed for evaluating pad response | |
221 | // outside the tracking program | |
222 | ||
223 | fxhit=xhit; | |
224 | fyhit=yhit; | |
225 | } | |
0c19630f | 226 | |
227 | ||
228 | ||
229 | ||
230 | ||
231 | ||
232 | ||
233 | ||
234 |