]>
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$ | |
70479d0e | 18 | Revision 1.7 2001/05/16 14:57:17 alibrary |
19 | New files for folders and Stack | |
20 | ||
9e1a0ddb | 21 | Revision 1.6 2000/11/12 17:17:03 pcrochet |
22 | BuildGeometry of AliMUON for trigger chambers delegated to AliMUONSegmentationTriggerX (same strategy as for tracking chambers) | |
23 | ||
5fd73042 | 24 | Revision 1.5 2000/10/02 16:58:29 egangler |
25 | Cleaning of the code : | |
26 | -> coding conventions | |
27 | -> void Streamers | |
28 | -> some useless includes removed or replaced by "class" statement | |
29 | ||
ecfa008b | 30 | Revision 1.4 2000/06/29 12:34:09 morsch |
31 | AliMUONSegmentation class has been made independent of AliMUONChamber. This makes | |
32 | it usable with any other geometry class. The link to the object to which it belongs is | |
33 | established via an index. This assumes that there exists a global geometry manager | |
34 | from which the pointer to the parent object can be obtained (in our case gAlice). | |
35 | ||
d81db581 | 36 | Revision 1.3 2000/06/26 10:00:14 pcrochet |
37 | global variables removed, problem with HP compiler solved (PH) | |
38 | ||
0c19630f | 39 | Revision 1.2 2000/06/15 07:58:48 morsch |
40 | Code from MUON-dev joined | |
41 | ||
a9e2aefa | 42 | Revision 1.1.2.1 2000/06/09 21:47:24 morsch |
43 | Code from AliMUONSegResTrigger.cxx | |
44 | ||
45 | */ | |
46 | ||
47 | /* | |
48 | old Log: | |
49 | AliMUONSegResTrigger.cxx,v $ | |
50 | Revision 1.1.2.3 2000/04/26 12:32:39 morsch | |
51 | Mods by P. Crochet: | |
52 | - adapted to the new Trigger chamber geometry | |
53 | - method SetZScale removed | |
54 | ||
55 | Revision 1.1.2.2 2000/02/21 16:13:33 morsch | |
56 | Full cluster simulation activated by uncommenting corresponding lines in IntXY() | |
57 | ||
58 | Revision 1.1.2.1 2000/02/17 14:32:40 morsch | |
59 | Draft version from P. Crochet | |
60 | ||
61 | */ | |
62 | ||
63 | #include "AliMUONSegmentationTrigger.h" | |
0c19630f | 64 | #include "AliMUONTriggerConstants.h" |
d81db581 | 65 | #include "AliRun.h" |
66 | #include "AliMUON.h" | |
a9e2aefa | 67 | #include <TMath.h> |
68 | #include <TRandom.h> | |
69 | #include <TArc.h> | |
70 | #include "AliMUONChamber.h" | |
70479d0e | 71 | #include <Riostream.h> |
5fd73042 | 72 | |
a9e2aefa | 73 | ClassImp(AliMUONSegmentationTrigger) |
74 | ||
0c19630f | 75 | //------------------------------------------------------------------ |
d81db581 | 76 | void AliMUONSegmentationTrigger::Init(Int_t chamber) |
a9e2aefa | 77 | { |
78 | // initialize Module geometry | |
d81db581 | 79 | AliMUON *pMUON = (AliMUON *) gAlice->GetModule("MUON"); |
80 | AliMUONChamber* iChamber=&(pMUON->Chamber(chamber)); | |
81 | ||
9e1a0ddb | 82 | if(pMUON->GetDebug()) cout << ClassName() << ": Initialize Trigger Chamber Module Geometry " << "\n"; |
83 | ||
d81db581 | 84 | Float_t zPos=iChamber->Z(); |
a9e2aefa | 85 | Float_t z1Pos=1603.5; |
86 | fZscale = zPos/z1Pos; | |
87 | ||
a9e2aefa | 88 | Float_t y1Cmin[126]; |
89 | Float_t y1Cmax[126]; | |
90 | ||
91 | Float_t dz=7.2; | |
92 | Float_t z1PosPlus=z1Pos+dz/2.; | |
93 | Float_t z1PosMinus=z1Pos-dz/2.; | |
94 | ||
95 | Float_t z1pm=z1PosPlus/z1PosMinus; | |
96 | Float_t z1mp=z1PosMinus/z1PosPlus; | |
97 | ||
9e1a0ddb | 98 | if(pMUON->GetDebug()) cout << ClassName() << ": fZscale = " << fZscale << "\n"; |
0c19630f | 99 | |
100 | // calculate yCmin and fYcmax | |
101 | Int_t i; | |
102 | for (i=62; i>=0; i--) { | |
103 | Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left | |
104 | if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==5) { // start with middle chamber | |
105 | if (AliMUONTriggerConstants::ModuleId(i)==51) { // special case (empty module) | |
106 | fYcmin[i]=fYcmax[i]=fYcmin[j]=fYcmax[j]=0.; | |
a9e2aefa | 107 | } else { |
108 | y1Cmin[i]=y1Cmin[j]=-34; | |
109 | y1Cmax[i]=y1Cmax[j]=34; | |
0c19630f | 110 | fYcmin[i]=fYcmin[j]=-34.; |
111 | ||
112 | fYcmax[i]=fYcmax[j]=34.; | |
a9e2aefa | 113 | } |
0c19630f | 114 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==4) { // up |
115 | if (AliMUONTriggerConstants::ModuleId(i)!=41) { | |
a9e2aefa | 116 | y1Cmin[i]=y1Cmax[i+7]*z1pm; |
117 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 118 | fYcmin[i]=y1Cmin[i]; |
119 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 120 | |
121 | y1Cmin[j]=y1Cmax[j+7]*z1mp; | |
122 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 123 | fYcmin[j]=y1Cmin[j]; |
124 | fYcmax[j]=fYcmin[j]+68.; | |
a9e2aefa | 125 | } else { |
126 | y1Cmin[i]=y1Cmin[ModuleNumber(42)]+17; | |
127 | y1Cmax[i]=y1Cmin[i]+51.; | |
0c19630f | 128 | fYcmin[i]=y1Cmin[i]; |
129 | fYcmax[i]=fYcmin[i]+51.; | |
a9e2aefa | 130 | |
131 | y1Cmin[j]=y1Cmin[ModuleNumber(-42)]+17; | |
132 | y1Cmax[j]=y1Cmin[j]+51.; | |
0c19630f | 133 | fYcmin[j]=y1Cmin[j]; |
134 | fYcmax[j]=fYcmin[j]+51.; | |
a9e2aefa | 135 | } |
0c19630f | 136 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==3) { |
a9e2aefa | 137 | y1Cmin[i]=y1Cmax[i+7]*z1mp; |
138 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 139 | fYcmin[i]=y1Cmin[i]; |
140 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 141 | |
142 | y1Cmin[j]=y1Cmax[j+7]*z1pm; | |
143 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 144 | fYcmin[j]=y1Cmin[j]; |
145 | fYcmax[j]=fYcmin[j]+68.; | |
146 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==2) { | |
a9e2aefa | 147 | y1Cmin[i]=y1Cmax[i+7]*z1pm; |
148 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 149 | fYcmin[i]=y1Cmin[i]; |
150 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 151 | |
152 | y1Cmin[j]=y1Cmax[j+7]*z1mp; | |
153 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 154 | fYcmin[j]=y1Cmin[j]; |
155 | fYcmax[j]=fYcmin[j]+68.; | |
156 | } else if (Int_t(AliMUONTriggerConstants::ModuleId(i)/10)==1) { | |
a9e2aefa | 157 | y1Cmin[i]=y1Cmax[i+7]*z1mp; |
158 | y1Cmax[i]=y1Cmin[i]+68.; | |
0c19630f | 159 | fYcmin[i]=y1Cmin[i]; |
160 | fYcmax[i]=fYcmin[i]+68.; | |
a9e2aefa | 161 | |
162 | y1Cmin[j]=y1Cmax[j+7]*z1pm; | |
163 | y1Cmax[j]=y1Cmin[j]+68.; | |
0c19630f | 164 | fYcmin[j]=y1Cmin[j]; |
165 | fYcmax[j]=fYcmin[j]+68.; | |
a9e2aefa | 166 | } |
167 | } | |
168 | ||
0c19630f | 169 | for (i=0; i<63; i++) { // second loop (fill lower part) |
170 | Int_t j=ModuleNumber(-AliMUONTriggerConstants::ModuleId(i)); // i == right, j == left | |
171 | if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==6) { | |
172 | fYcmin[i]=-fYcmax[i-14]; | |
173 | fYcmax[i]=-fYcmin[i-14]; | |
174 | fYcmin[j]=-fYcmax[j-14]; | |
175 | fYcmax[j]=-fYcmin[j-14]; | |
176 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==7) { | |
177 | fYcmin[i]=-fYcmax[i-28]; | |
178 | fYcmax[i]=-fYcmin[i-28]; | |
179 | fYcmin[j]=-fYcmax[j-28]; | |
180 | fYcmax[j]=-fYcmin[j-28]; | |
181 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==8) { | |
182 | fYcmin[i]=-fYcmax[i-42]; | |
183 | fYcmax[i]=-fYcmin[i-42]; | |
184 | fYcmin[j]=-fYcmax[j-42]; | |
185 | fYcmax[j]=-fYcmin[j-42]; | |
186 | } else if (TMath::Abs(Int_t(AliMUONTriggerConstants::ModuleId(i)/10))==9) { | |
187 | fYcmin[i]=-fYcmax[i-56]; | |
188 | fYcmax[i]=-fYcmin[i-56]; | |
189 | fYcmin[j]=-fYcmax[j-56]; | |
190 | fYcmax[j]=-fYcmin[j-56]; | |
a9e2aefa | 191 | } |
192 | } | |
193 | ||
a9e2aefa | 194 | fNpx=124; |
195 | fNpy=64; | |
196 | ||
5fd73042 | 197 | // Set parent chamber number |
198 | fChamber=&(pMUON->Chamber(chamber)); | |
199 | fId=chamber; | |
200 | ||
9e1a0ddb | 201 | if(pMUON->GetDebug()) cout << ClassName() << ": ---------------------------------------------------- \n"; |
a9e2aefa | 202 | |
203 | } | |
204 | ||
205 | //------------------------------------------------------------------ | |
206 | Int_t AliMUONSegmentationTrigger::ModuleNumber(Int_t imodule){ | |
207 | // returns module number (from 0 to 126) corresponding to module imodule | |
208 | Int_t imod=0; | |
0c19630f | 209 | for (Int_t i=0; i<AliMUONTriggerConstants::Nmodule(); i++) { |
210 | if (AliMUONTriggerConstants::ModuleId(i)==imodule) { | |
a9e2aefa | 211 | imod=i; |
212 | break; | |
213 | } | |
214 | } | |
215 | return imod; | |
216 | } | |
217 | ||
218 | //------------------------------------------------------------------ | |
219 | Float_t AliMUONSegmentationTrigger::StripSizeX(Int_t imodule){ | |
220 | // Returns x-strip size for given module imodule | |
221 | ||
222 | Int_t absimodule=TMath::Abs(imodule); | |
223 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 224 | if (absimodule==51) { |
a9e2aefa | 225 | return 0; |
226 | } else { | |
0c19630f | 227 | return TMath::Abs((fYcmax[moduleNum]-fYcmin[moduleNum])/ |
228 | AliMUONTriggerConstants::NstripX(moduleNum)); | |
229 | } | |
a9e2aefa | 230 | } |
231 | ||
232 | //------------------------------------------------------------------ | |
233 | Float_t AliMUONSegmentationTrigger::StripSizeY(Int_t imodule){ | |
234 | // Returns y-strip size for given module imodule | |
235 | ||
236 | Int_t absimodule=TMath::Abs(imodule); | |
237 | Int_t moduleNum=ModuleNumber(imodule); | |
0c19630f | 238 | if (absimodule==51) { |
a9e2aefa | 239 | return 0; |
240 | } else { | |
0c19630f | 241 | return TMath::Abs((AliMUONTriggerConstants::XcMax(moduleNum) - |
242 | AliMUONTriggerConstants::XcMin(moduleNum)) / | |
243 | AliMUONTriggerConstants::NstripY(moduleNum)); | |
a9e2aefa | 244 | } |
245 | } | |
246 | ||
247 | //------------------------------------------------------------------ | |
248 | void AliMUONSegmentationTrigger::SetHit(Float_t xhit, Float_t yhit) | |
249 | { | |
250 | // Sets virtual hit position, needed for evaluating pad response | |
251 | // outside the tracking program | |
252 | ||
ecfa008b | 253 | fXhit=xhit; |
254 | fYhit=yhit; | |
a9e2aefa | 255 | } |
0c19630f | 256 | |
257 | ||
258 | ||
259 | ||
260 | ||
261 | ||
262 | ||
263 | ||
264 |