]>
Commit | Line | Data |
---|---|---|
fb7a1f55 | 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$ | |
778e67bd | 18 | Revision 1.6 2002/07/26 06:21:12 gamez |
19 | CRT3 volume taken as sensitive volume | |
20 | ||
67721dc4 | 21 | Revision 1.5 2002/07/25 12:52:34 morsch |
22 | AddHit call only if hit has been defined. | |
23 | ||
bd1047f8 | 24 | Revision 1.4 2002/07/12 12:57:29 gamez |
25 | Division of CRT1 corrected | |
26 | ||
7cedada3 | 27 | Revision 1.3.2.1 2002/07/12 12:32:50 gamez |
28 | Division of CRT1 corrected | |
29 | ||
30 | Revision 1.3 2002/07/10 15:57:04 gamez | |
31 | CreateHall() removed, and new Molasse volumes | |
32 | ||
6e9adb00 | 33 | Revision 1.2 2002/07/09 08:45:35 hristov |
34 | Old style include files needed on HP (aCC) | |
35 | ||
b73f53b3 | 36 | Revision 1.1 2002/06/16 17:08:19 hristov |
37 | First version of CRT | |
38 | ||
fb7a1f55 | 39 | |
40 | */ | |
41 | ||
42 | /////////////////////////////////////////////////////////////////////////////// | |
43 | // // | |
6e9adb00 | 44 | // ALICE Cosmic Ray Trigger // |
fb7a1f55 | 45 | // // |
6e9adb00 | 46 | // This class contains the functions for version 0 of the ALICE Cosmic Ray // |
778e67bd | 47 | // Trigger. This version will be used to simulation comic rays in alice // |
48 | // with all the detectors. // | |
fb7a1f55 | 49 | // |
50 | // Authors: | |
51 | // | |
52 | // Arturo Fernandez <afernand@fcfm.buap.mx> | |
53 | // Enrique Gamez <egamez@fcfm.buap.mx> | |
54 | // | |
55 | // Universidad Autonoma de Puebla | |
56 | // | |
57 | // | |
58 | //Begin_Html | |
59 | /* | |
60 | <img src="picts/AliCRTv0Class.gif"> | |
61 | </pre> | |
62 | <br clear=left> | |
63 | <p>The responsible person for this module is | |
64 | <a href="mailto:egamez@fcfm.buap.mx">Enrique Gamez</a>. | |
65 | </font> | |
66 | <pre> | |
67 | */ | |
68 | //End_Html | |
69 | // // | |
70 | /////////////////////////////////////////////////////////////////////////////// | |
71 | ||
b73f53b3 | 72 | #include <iostream.h> |
fb7a1f55 | 73 | |
fb7a1f55 | 74 | #include <TGeometry.h> |
778e67bd | 75 | #include <TBRIK.h> |
fb7a1f55 | 76 | #include <TNode.h> |
77 | #include <TLorentzVector.h> | |
78 | ||
fb7a1f55 | 79 | #include "AliRun.h" |
80 | #include "AliMC.h" | |
81 | #include "AliMagF.h" | |
82 | #include "AliConst.h" | |
83 | #include "AliPDG.h" | |
84 | ||
778e67bd | 85 | #include "AliCRTv0.h" |
86 | #include "AliCRTConstants.h" | |
87 | ||
fb7a1f55 | 88 | ClassImp(AliCRTv0) |
89 | ||
90 | //_____________________________________________________________________________ | |
91 | AliCRTv0::AliCRTv0() : AliCRT() | |
92 | { | |
93 | // | |
778e67bd | 94 | // Default constructor for CRT v0 |
fb7a1f55 | 95 | // |
fb7a1f55 | 96 | } |
97 | ||
98 | //_____________________________________________________________________________ | |
99 | AliCRTv0::AliCRTv0(const char *name, const char *title) | |
100 | : AliCRT(name,title) | |
101 | { | |
102 | // | |
778e67bd | 103 | // Standard constructor for CRT v0 |
fb7a1f55 | 104 | // |
105 | //Begin_Html | |
106 | /* | |
107 | <img src="picts/AliCRTv0.gif"> | |
108 | */ | |
109 | //End_Html | |
110 | } | |
111 | ||
778e67bd | 112 | //_____________________________________________________________________________ |
113 | AliCRTv0::AliCRTv0(const AliCRTv0& crt) | |
114 | { | |
115 | // | |
116 | // Copy ctor. | |
117 | // | |
118 | crt.Copy(*this); | |
119 | } | |
120 | ||
121 | //_____________________________________________________________________________ | |
122 | AliCRTv0& AliCRTv0::operator= (const AliCRTv0& crt) | |
123 | { | |
124 | // | |
125 | // Asingment operator. | |
126 | // | |
127 | crt.Copy(*this); | |
128 | return *this; | |
129 | } | |
130 | ||
fb7a1f55 | 131 | //_____________________________________________________________________________ |
132 | void AliCRTv0::BuildGeometry() | |
133 | { | |
778e67bd | 134 | // |
135 | // Create the ROOT TNode geometry for the CRT | |
136 | // | |
137 | ||
138 | TNode *node, *top; | |
139 | ||
140 | const Int_t kColorCRT = kRed; | |
141 | ||
142 | // Find the top node alice. | |
143 | top = gAlice->GetGeometry()->GetNode("alice"); | |
144 | ||
145 | new TBRIK("S_CRT_A", "CRT box", "void", | |
146 | AliCRTConstants::fgActiveAreaLenght/2., | |
147 | AliCRTConstants::fgActiveAreaHeight/2., | |
148 | AliCRTConstants::fgActiveAreaWidth/2.); | |
149 | ||
150 | ||
151 | new TRotMatrix("Left", "Left", 90., 315., 90., 45., 0., 337.5); | |
152 | new TRotMatrix("Right", "Right", 90., 45., 90., 315., 180., 202.5); | |
153 | new TRotMatrix("Up", "Up", 90., 0., 90., 90., 0., 90.); | |
154 | top->cd(); | |
155 | ||
156 | // | |
157 | // Put 4 modules on the top of the magnet | |
158 | Float_t box = AliCRTConstants::fgCageWidth/2.; | |
159 | top->cd(); | |
160 | node = new TNode("upper1", "upper1", "S_CRT_A", 0., 790., 3.*box, "Up"); | |
161 | node->SetLineColor(kColorCRT); | |
162 | fNodes->Add(node); | |
163 | ||
164 | top->cd(); | |
165 | node = new TNode("upper2", "upper2", "S_CRT_A", 0., 790., box, "Up"); | |
166 | node->SetLineColor(kColorCRT); | |
167 | fNodes->Add(node); | |
168 | ||
169 | top->cd(); | |
170 | node = new TNode("upper3", "upper3", "S_CRT_A", 0., 790., -1.*box, "Up"); | |
171 | node->SetLineColor(kColorCRT); | |
172 | fNodes->Add(node); | |
173 | ||
174 | top->cd(); | |
175 | node = new TNode("upper4", "upper4", "S_CRT_A", 0., 790., -3.*box, "Up"); | |
176 | node->SetLineColor(kColorCRT); | |
177 | fNodes->Add(node); | |
178 | ||
179 | ||
180 | // Modules on the left side. | |
181 | Float_t xtragap = 10.; | |
182 | Float_t initXside = (790.+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side | |
183 | Float_t initYside = (790.+xtragap)*TMath::Cos(2*22.5*kDegrad); | |
184 | top->cd(); | |
185 | node = new TNode("upper5", "upper5", "S_CRT_A", initXside, initYside, 3.*box, "Left"); | |
186 | node->SetLineColor(kColorCRT); | |
187 | fNodes->Add(node); | |
188 | ||
189 | top->cd(); | |
190 | node = new TNode("upper6", "upper6", "S_CRT_A", initXside, initYside, box, "Left"); | |
191 | node->SetLineColor(kColorCRT); | |
192 | fNodes->Add(node); | |
193 | ||
194 | top->cd(); | |
195 | node = new TNode("upper7", "upper7", "S_CRT_A", initXside, initYside, -1.*box, "Left"); | |
196 | node->SetLineColor(kColorCRT); | |
197 | fNodes->Add(node); | |
198 | ||
199 | top->cd(); | |
200 | node = new TNode("upper8", "upper8", "S_CRT_A", initXside, initYside, -3.*box, "Left"); | |
201 | node->SetLineColor(kColorCRT); | |
202 | fNodes->Add(node); | |
203 | ||
204 | ||
205 | // Modules on the right side. | |
206 | top->cd(); | |
207 | node = new TNode("upper9", "upper9", "S_CRT_A", -initXside, initYside, 3.*box, "Right"); | |
208 | node->SetLineColor(kColorCRT); | |
209 | fNodes->Add(node); | |
210 | ||
211 | top->cd(); | |
212 | node = new TNode("upper10", "upper10", "S_CRT_A", -initXside, initYside, box, "Right"); | |
213 | node->SetLineColor(kColorCRT); | |
214 | fNodes->Add(node); | |
215 | ||
216 | top->cd(); | |
217 | node = new TNode("upper11","upper11", "S_CRT_A", -initXside, initYside, -1.*box, "Right"); | |
218 | node->SetLineColor(kColorCRT); | |
219 | fNodes->Add(node); | |
220 | ||
221 | top->cd(); | |
222 | node = new TNode("upper12","upper12", "S_CRT_A", -initXside, initYside, -3.*box, "Right"); | |
223 | node->SetLineColor(kColorCRT); | |
224 | fNodes->Add(node); | |
225 | ||
fb7a1f55 | 226 | |
227 | } | |
228 | ||
229 | //_____________________________________________________________________________ | |
230 | void AliCRTv0::CreateGeometry() | |
231 | { | |
232 | // | |
233 | // Create geometry for the CRT array | |
234 | // | |
778e67bd | 235 | Int_t idrotm[2499]; // The rotation matrix. |
236 | ||
237 | Int_t * idtmed = fIdtmed->GetArray() - 1099 ; | |
238 | ||
239 | // | |
240 | // Molasse | |
241 | CreateMolasse(); | |
242 | ||
243 | // | |
244 | // Scintillators | |
245 | ||
246 | Float_t box[3]; | |
247 | box[0] = AliCRTConstants::fgCageLenght/2.; // Half Length of the box along the X axis, cm. | |
248 | box[1] = AliCRTConstants::fgCageHeight/2.; // Half Length of the box along the Y axis, cm. | |
249 | box[2] = AliCRTConstants::fgCageWidth/2.; // Half Length of the box along the Z axis, cm. | |
250 | ||
251 | ||
252 | // Define the Scintillators. as a big box. | |
253 | Float_t scint[3]; | |
254 | scint[0] = AliCRTConstants::fgActiveAreaLenght/2.; // Half Length in X | |
255 | scint[1] = AliCRTConstants::fgActiveAreaHeight/2.; // Half Length in Y | |
256 | scint[2] = AliCRTConstants::fgActiveAreaWidth/2.; // Half Length in Z | |
257 | gMC->Gsvolu("CRT1", "BOX ", idtmed[1112], scint, 3); // Scintillators | |
258 | ||
259 | // | |
260 | // Define the coordinates where the draw will begin. | |
261 | // | |
262 | ||
263 | // | |
264 | // -- X axis. | |
265 | // we'll start dawing from the center. | |
266 | Float_t initX = 0.; | |
267 | ||
268 | // | |
269 | // -- Y axis | |
270 | Float_t gapY = 30.; // 30 cms. above the barrel. | |
271 | // For the height we staimate the from the center of the ceiling, | |
272 | // if were a cilinder, must be about 280cm. | |
273 | Float_t barrel = 790.; // Barrel radius. | |
274 | Float_t height = barrel + gapY - 30.; | |
275 | Float_t initY = height; | |
276 | ||
277 | // | |
278 | // -- Z axis. | |
279 | // we'll start dawing from the center. | |
280 | ||
281 | // | |
282 | // Put 4 modules on the top of the magnet | |
283 | Int_t step = 4; | |
284 | for ( Int_t i = 1 ; i <= 4 ; i++ ) { | |
285 | gMC->Gspos("CRT1", i, "ALIC", initX, initY, (i-step)*box[2], 0, "ONLY"); | |
286 | step--; | |
287 | } | |
288 | ||
289 | // Modules on the barrel sides. | |
290 | // Because the openenig angle for each face is 22.5, and if we want to | |
291 | // put the modules right in the middle | |
292 | Float_t xtragap = 10.; | |
293 | Float_t initXside = (height+xtragap)*TMath::Sin(2*22.5*kDegrad); //rigth side | |
294 | Float_t initYside = (height+xtragap)*TMath::Cos(2*22.5*kDegrad); | |
295 | ||
296 | // Put 4 modules on the left side of the magnet | |
297 | // The rotation matrix parameters, for the left side. | |
298 | AliMatrix(idrotm[232], 90., 315., 90., 45., 0., 337.5); | |
299 | Int_t stepl = 4; | |
300 | for ( Int_t i = 1 ; i <= 4 ; i++ ) { | |
301 | gMC->Gspos("CRT1", i+4, "ALIC", initXside, initYside, (i-stepl)*box[2], | |
302 | idrotm[232], "ONLY"); | |
303 | stepl--; | |
304 | } | |
305 | ||
306 | // Put 4 modules on the right side of the magnet | |
307 | // The rotation matrix parameters for the right side. | |
308 | AliMatrix(idrotm[231], 90., 45., 90., 315., 180., 202.5); | |
309 | Int_t stepr = 4; | |
310 | for ( Int_t i = 1 ; i <= 4 ; i++ ) { | |
311 | gMC->Gspos("CRT1", i+8, "ALIC", -initXside, initYside, (i-stepr)*box[2], | |
312 | idrotm[231], "ONLY"); | |
313 | stepr--; | |
314 | } | |
fb7a1f55 | 315 | |
778e67bd | 316 | // Divide the modules in 2 planes. |
317 | //gMC->Gsdvn("CRT2", "CRT1", 2, 2); | |
318 | // Now divide each plane in 8 palettes | |
319 | //gMC->Gsdvn("CRT3", "CRT2", 8, 3); | |
320 | ||
321 | } | |
322 | ||
323 | //_____________________________________________________________________________ | |
324 | void AliCRTv0::CreateMolasse() | |
325 | { | |
fb7a1f55 | 326 | Int_t idrotm[2499]; // The rotation matrix. |
327 | ||
fb7a1f55 | 328 | Int_t * idtmed = fIdtmed->GetArray() - 1099 ; |
329 | ||
6e9adb00 | 330 | // |
331 | // Molasse | |
332 | // | |
333 | ||
334 | // Exactly above the hall | |
335 | Float_t tspar[5]; | |
336 | tspar[0] = 1170.; | |
337 | tspar[1] = 1170. + 375.; | |
338 | tspar[2] = (1900.+1150.)/2.+100.; | |
339 | tspar[3] = 0.; | |
340 | tspar[4] = 180.; | |
7cedada3 | 341 | gMC->Gsvolu("CMO1", "TUBS", idtmed[1123], tspar, 5); |
6e9adb00 | 342 | gMC->Gspos("CMO1", 1, "ALIC", 0., 500., 1900.-tspar[2]+400., 0, "MANY"); |
343 | ||
344 | Float_t tbox[3]; | |
345 | tbox[0] = 1250.; | |
346 | tbox[1] = (4420. - 1670.)/2.; | |
347 | tbox[2] = (1900.+1150.)/2. + 200.; | |
7cedada3 | 348 | gMC->Gsvolu("CM12", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 349 | gMC->Gspos("CM12", 1, "ALIC", 0., 4420. -tbox[1], 1900.-tbox[2]+400., 0, "MANY"); |
350 | ||
351 | AliMatrix(idrotm[2003], 0., 0., 90., 0., 90., 90.); | |
352 | // Along the PM25 | |
353 | Float_t tube[3]; | |
354 | tube[0] = 455. + 100.; | |
355 | tube[1] = 555. + 375.; | |
356 | tube[2] = (5150. - 1166.)/2.; | |
7cedada3 | 357 | gMC->Gsvolu("CMO2", "TUBE", idtmed[1123], tube, 3); |
6e9adb00 | 358 | gMC->Gspos("CMO2", 1, "ALIC", -2100., 4420.-tube[2], 0., idrotm[2003], "MANY"); |
359 | ||
360 | ||
361 | // Along the PGC2 | |
362 | tube[0] = 650.; | |
363 | tube[1] = 2987.7; | |
364 | tube[2] = (5150. - 690.)/2.; | |
7cedada3 | 365 | gMC->Gsvolu("CMO3", "TUBE", idtmed[1123], tube, 3); |
6e9adb00 | 366 | gMC->Gspos("CMO3", 1, "ALIC", 375., 4420.-tube[2], 1900.+2987.7, idrotm[2003], "MANY"); |
367 | // Behind the PGC2 up to the end of the M. volume. | |
368 | tbox[0] = 12073.; | |
369 | tbox[1] = 2575. + 95.; | |
778e67bd | 370 | tbox[2] = (12073. - 1900.-2987.7-650.)/2.; |
7cedada3 | 371 | gMC->Gsvolu("CMO7", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 372 | gMC->Gspos("CMO7", 1, "ALIC", 0., 4420.-tbox[1], 1900.+2987.7+650.+tbox[2], 0, "MANY"); |
373 | ||
374 | // Along the PX24 , upper part. | |
375 | tube[0] = 1250.; | |
376 | tube[1] = 2300; | |
377 | tube[2] = 2575. - 1300. + 95.; | |
7cedada3 | 378 | gMC->Gsvolu("CMO4", "TUBE", idtmed[1123], tube, 3); |
6e9adb00 | 379 | gMC->Gspos("CMO4", 1, "ALIC", 0., 404.+1300.+tube[2], -2300., idrotm[2003], "MANY"); |
380 | ||
381 | // Along the PX24 , lower part | |
382 | tspar[0] = 1250.; | |
383 | tspar[1] = 2300; | |
384 | tspar[2] = 1300.; | |
385 | tspar[3] = kRaddeg*TMath::ASin(1070./1150.); | |
386 | tspar[4] = 360. - tspar[3]; | |
7cedada3 | 387 | gMC->Gsvolu("CMO5", "TUBS", idtmed[1123], tspar, 5); |
6e9adb00 | 388 | gMC->Gspos("CMO5", 1, "ALIC", 0., 404., -2300., idrotm[2003], "MANY"); |
389 | // behind the PX24 | |
390 | tbox[0] = 12073.; | |
391 | tbox[1] = 2575. + 95.; | |
392 | tbox[2] = 8523./2.; | |
7cedada3 | 393 | gMC->Gsvolu("CMO6", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 394 | gMC->Gspos("CMO6", 1, "ALIC", 0., 4420.-tbox[1], -3550.-tbox[2], 0, "MANY"); |
395 | ||
396 | ||
397 | // On the right side of th hall | |
398 | tbox[0] = (12073. - 1250.)/2.; | |
399 | tbox[1] = 2575. + 95.; | |
400 | tbox[2] = (8437.7+650.)/2.; | |
7cedada3 | 401 | gMC->Gsvolu("CMO8", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 402 | gMC->Gspos("CMO8", 1, "ALIC", 1250.+tbox[0], 4420.-tbox[1], -3550.+tbox[2], 0, "MANY"); |
403 | ||
404 | // on the left side of the hall, behind | |
405 | tbox[0] = (12073. - 2755.)/2.; | |
406 | tbox[1] = 2575. + 95.; | |
407 | tbox[2] = (8437.7+650.)/2.; | |
7cedada3 | 408 | gMC->Gsvolu("CMO9", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 409 | gMC->Gspos("CMO9", 1, "ALIC", -2755.-tbox[0], 4420.-tbox[1], -3550.+tbox[2], 0, "MANY"); |
410 | ||
411 | ||
412 | // Molasse betwen the PX24 & PM25 on the left side. | |
413 | tbox[0] = (2755. - 1250.)/2.; | |
414 | tbox[1] = 2575. + 95.; | |
415 | tbox[2] = (3550. - 555.)/2.; | |
7cedada3 | 416 | gMC->Gsvolu("CM10", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 417 | gMC->Gspos("CM10", 1, "ALIC", -1250.-tbox[0], 4420.-tbox[1], -tbox[2]-555., 0, "MANY"); |
418 | ||
419 | ||
420 | // Molasse betwen the PGC2 & PM25 on the left side. | |
421 | tbox[0] = (2755. - 1250.)/2.; | |
422 | tbox[1] = 2575. + 95.; | |
423 | tbox[2] = (1900.+2987.7 - 555. + 650.)/2.; | |
7cedada3 | 424 | gMC->Gsvolu("CM11", "BOX", idtmed[1123], tbox, 3); |
6e9adb00 | 425 | gMC->Gspos("CM11", 1, "ALIC", -1250.-tbox[0], 4420.-tbox[1], 555.+tbox[2], 0, "MANY"); |
426 | ||
fb7a1f55 | 427 | |
778e67bd | 428 | } |
429 | ||
430 | //_____________________________________________________________________________ | |
431 | void AliCRTv0::CreateShafts() | |
432 | { | |
433 | // | |
434 | // | |
435 | // | |
436 | Int_t idrotm[2499]; // The rotation matrix. | |
fb7a1f55 | 437 | |
778e67bd | 438 | Int_t * idtmed = fIdtmed->GetArray() - 1099 ; |
fb7a1f55 | 439 | |
778e67bd | 440 | // HAll ceiling |
441 | Float_t ptubs[5]; | |
442 | ptubs[0] = 1070.; | |
443 | ptubs[1] = 1170.; | |
444 | ptubs[2] = 1900.; | |
445 | ptubs[3] = 0.; | |
446 | ptubs[4] = 180.; | |
447 | gMC->Gsvolu("CHC1", "TUBS", idtmed[1116], ptubs, 5); | |
448 | gMC->Gspos("CHC1", 1, "ALIC", 0., 500., 0., 0, "ONLY"); | |
fb7a1f55 | 449 | |
450 | ||
451 | // | |
778e67bd | 452 | // Acces shafts |
fb7a1f55 | 453 | // |
778e67bd | 454 | AliMatrix(idrotm[2001], 0., 0., 90., 0., 90., 90.); |
455 | ||
456 | // PX24 | |
457 | ptubs[0] = 1150.; | |
458 | ptubs[1] = 1250.; | |
459 | ptubs[2] = 1300.; | |
460 | ptubs[3] = kRaddeg*TMath::ASin(1070./ptubs[0]); | |
461 | ptubs[4] = 360 - ptubs[3]; | |
462 | gMC->Gsvolu("CSF1", "TUBS", idtmed[1116], ptubs, 5); | |
463 | gMC->Gspos("CSF1", 1, "ALIC", 0., 404., -2300., idrotm[2001], "MANY"); | |
464 | ||
465 | Float_t ptube[3]; | |
466 | ptube[0] = ptubs[0]; | |
467 | ptube[1] = ptubs[1]; | |
468 | ptube[2] = 2575. - ptubs[2] + 95.; | |
469 | gMC->Gsvolu("CSF2", "TUBE", idtmed[1116], ptube, 3); | |
470 | gMC->Gspos("CSF2", 1, "ALIC", 0., 404.+ptubs[2]+ptube[2], -2300., idrotm[2001], "MANY"); | |
471 | ||
472 | // Concrete walls along the shaft | |
473 | Float_t pbox[3]; | |
474 | pbox[0] = 585./2.; | |
475 | pbox[1] = 2575. + 95.; | |
476 | pbox[2] = 20.; | |
477 | gMC->Gsvolu("CSW1", "BOX", idtmed[1116], pbox, 3); | |
478 | gMC->Gspos("CSW1", 1, "ALIC", -290-pbox[0], 404.-1300.+pbox[1], -3450.+210.*2, 0, "MANY"); | |
479 | ||
fb7a1f55 | 480 | // |
778e67bd | 481 | pbox[0] = 750./2.; |
482 | pbox[1] = 2575. + 95.; | |
483 | pbox[2] = 20.; | |
484 | gMC->Gsvolu("CSW3", "BOX", idtmed[1116], pbox, 3); | |
485 | gMC->Gspos("CSW3", 1, "ALIC", 420.-290.+pbox[0], 404.-1300.+pbox[1], -3450.+210.*2, 0, "MANY"); | |
486 | ||
fb7a1f55 | 487 | // |
778e67bd | 488 | pbox[0] = 60.; |
489 | pbox[1] = 2575. + 95.; | |
490 | pbox[2] = 210.; | |
491 | gMC->Gsvolu("CSW2", "BOX", idtmed[1116], pbox, 3); | |
492 | gMC->Gspos("CSW2", 1, "ALIC", -290-pbox[0], 404.-1300.+pbox[1], -3450.+pbox[2], 0, "MANY"); | |
493 | gMC->Gspos("CSW2", 2, "ALIC", 420.-290.+pbox[0], 404.-1300.+pbox[1], -3450.+pbox[2], 0, "MANY"); | |
494 | ||
495 | ||
496 | // | |
497 | pbox[0] = 1000.; | |
498 | pbox[1] = 80.; | |
499 | pbox[2] = 200.; | |
500 | gMC->Gsvolu("CSP1", "BOX", idtmed[1116], pbox, 3); | |
501 | gMC->Gspos("CSP1", 1, "ALIC", 0., 2600.-700., -1150-pbox[2], 0, "MANY"); | |
502 | ||
fb7a1f55 | 503 | // |
778e67bd | 504 | pbox[0] = 340.8; |
505 | pbox[1] = 300./2.; | |
506 | pbox[2] = 460./2.; | |
507 | gMC->Gsvolu("CSP2", "BOX", idtmed[1116], pbox, 3); | |
508 | gMC->Gspos("CSP2", 1, "ALIC", 0., 2950.-700., -3450+pbox[2], 0, "MANY"); | |
509 | ||
fb7a1f55 | 510 | // |
778e67bd | 511 | pbox[0] = 600.; |
512 | pbox[1] = 150.; | |
513 | pbox[2] = 75.; | |
514 | gMC->Gsvolu("CSP3", "BOX", idtmed[1116], pbox, 3); | |
515 | gMC->Gspos("CSP3", 1, "ALIC", 0., 2950.-700., -1150.-210.-pbox[2], 0, "MANY"); | |
516 | ||
517 | // | |
518 | pbox[0] = 600.; | |
519 | pbox[1] = 250.; | |
520 | pbox[2] = 38.; | |
521 | gMC->Gsvolu("CSP4", "BOX", idtmed[1116], pbox, 3); | |
522 | gMC->Gspos("CSP4", 1, "ALIC", 0., 2950.-700.+155.+pbox[1], -1150.-210.-pbox[2], 0, "MANY"); | |
523 | ||
524 | ||
525 | // Shielding plug | |
526 | pbox[0] = 850.; | |
527 | pbox[1] = 90.; | |
528 | pbox[2] = 720.; | |
529 | gMC->Gsvolu("CSP5", "BOX", idtmed[1116], pbox, 3); | |
530 | gMC->Gspos("CSP5", 1, "ALIC", 0., 2950.-700., -3450.+460.+pbox[2], 0, "MANY"); | |
531 | ||
532 | // | |
533 | pbox[0] = 80.; | |
534 | pbox[1] = 150.; | |
535 | pbox[2] = 720.; | |
536 | gMC->Gsvolu("CSP6", "BOX", idtmed[1116], pbox, 3); | |
537 | gMC->Gspos("CSP6", 1, "ALIC", 1150.-600., 2950.-700., -3450.+460.+pbox[2], 0, "MANY"); | |
538 | gMC->Gspos("CSP6", 2, "ALIC", -1150.+600., 2950.-700., -3450.+460.+pbox[2], 0, "MANY"); | |
539 | ||
540 | ||
541 | // | |
542 | pbox[0] = 130.; | |
543 | pbox[1] = 60.; | |
544 | pbox[2] = 750.; | |
545 | gMC->Gsvolu("CSP7", "BOX", idtmed[1116], pbox, 3); | |
546 | gMC->Gspos("CSP7", 1, "ALIC", 850.+pbox[0], 2950.-700.+100., -3450.+460.+pbox[2], 0, "MANY"); | |
547 | gMC->Gspos("CSP7", 2, "ALIC", -850.-pbox[0], 2950.-700.+100., -3450.+460.+pbox[2], 0, "MANY"); | |
548 | ||
549 | ||
550 | // PM25 Acces Shaft | |
551 | ptube[0] = 910./2.; | |
552 | ptube[1] = ptube[0] + 100.; | |
553 | ptube[2] = (5150. - 1166.)/2.; | |
554 | gMC->Gsvolu("CSF3", "TUBE", idtmed[1116], ptube, 3); | |
555 | gMC->Gspos("CSF3", 1, "ALIC", -2100., AliCRTConstants::fgDepth-ptube[2], 0., idrotm[2001], "MANY"); | |
556 | ||
557 | // PGC2 Access Shaft | |
558 | ptube[0] = 1100./2.; | |
559 | ptube[1] = ptube[0] + 100.; | |
560 | ptube[2] = (5150. - 690.)/2.; | |
561 | gMC->Gsvolu("CSF4", "TUBE", idtmed[1116], ptube, 3); | |
562 | gMC->Gspos("CSF4", 1, "ALIC", 375., AliCRTConstants::fgDepth-ptube[2], 1900.+2987.7, idrotm[2001], "MANY"); | |
fb7a1f55 | 563 | |
564 | } | |
565 | ||
fb7a1f55 | 566 | //_____________________________________________________________________________ |
778e67bd | 567 | |
fb7a1f55 | 568 | void AliCRTv0::CreateMaterials() |
569 | { | |
fb7a1f55 | 570 | // Use the standard materials. |
778e67bd | 571 | AliCRT::CreateMaterials(); |
fb7a1f55 | 572 | } |
573 | ||
574 | ||
575 | //_____________________________________________________________________________ | |
576 | void AliCRTv0::DrawDetector() | |
fb7a1f55 | 577 | { |
578 | // | |
579 | // Draw a shaded view of the L3 magnet | |
580 | // | |
581 | cout << "AliCRTv0::DrawModule() : Drawing the module" << endl; | |
582 | ||
583 | gMC->Gsatt("*", "seen", -1); | |
584 | gMC->Gsatt("alic", "seen", 0); | |
585 | ||
6e9adb00 | 586 | gMC->Gsatt("ALIC","seen",0); |
fb7a1f55 | 587 | gMC->Gsatt("L3MO","seen",1); // L3 Magnet |
6e9adb00 | 588 | gMC->Gsatt("CRT1","seen",1); // Scintillators |
589 | ||
590 | // Draw the molasse volumes | |
591 | gMC->Gsatt("CMO1","seen",0); // Exactly above the HALL | |
592 | gMC->Gsatt("CMO2","seen",0); // Molasse, along the PM25 | |
593 | gMC->Gsatt("CMO3","seen",0); // molasse along the PGC2 | |
594 | gMC->Gsatt("CMO4","seen",0); // Molasse, behind the PX24 upper part | |
595 | gMC->Gsatt("CMO5","seen",0); // molasse behind px24, lower part | |
596 | gMC->Gsatt("CMO6","seen",0); // behind the PX24 | |
597 | gMC->Gsatt("CMO7","seen",0); // behind the PGC2 | |
598 | gMC->Gsatt("CMO8","seen",0); // on the right side. | |
599 | gMC->Gsatt("CMO9","seen",0); // on the left side. | |
600 | gMC->Gsatt("CM10","seen",0); // betwen PX24 & PM25. | |
601 | gMC->Gsatt("CM11","seen",0); // betwen PGC2 & PM25. | |
602 | gMC->Gsatt("CM12","seen",0); // box above the hall. | |
fb7a1f55 | 603 | |
604 | gMC->Gdopt("hide", "on"); | |
605 | gMC->Gdopt("edge","off"); | |
606 | gMC->Gdopt("shad", "on"); | |
607 | gMC->Gsatt("*", "fill", 7); | |
608 | gMC->SetClipBox("ALIC", 0, 3000, -3000, 3000, -6000, 6000); | |
609 | gMC->DefaultRange(); | |
610 | gMC->Gdraw("alic", 40, 30, 0, 10, 9.5, .009, .009); | |
611 | gMC->Gdhead(1111, "View of CRT(ACORDE)"); | |
612 | gMC->Gdman(18, 4, "MAN"); | |
613 | ||
614 | ||
615 | } | |
616 | ||
617 | //_____________________________________________________________________________ | |
618 | void AliCRTv0::Init() | |
619 | { | |
620 | // | |
621 | // Initialise L3 magnet after it has been built | |
622 | Int_t i; | |
623 | // | |
624 | if(fDebug) { | |
625 | printf("\n%s: ",ClassName()); | |
626 | for(i=0;i<35;i++) printf("*"); | |
627 | printf(" CRTv0_INIT "); | |
628 | for(i=0;i<35;i++) printf("*"); | |
629 | printf("\n%s: ",ClassName()); | |
630 | // | |
631 | // Here the CRTv0 initialisation code (if any!) | |
632 | for(i=0;i<80;i++) printf("*"); | |
633 | printf("\n"); | |
634 | } | |
635 | ||
636 | } | |
637 | ||
638 | //_____________________________________________________________________________ | |
639 | void AliCRTv0::StepManager() | |
640 | { | |
641 | // | |
67721dc4 | 642 | // Called for every step in the Cosmic Ray Trigger |
fb7a1f55 | 643 | // |
67721dc4 | 644 | static Int_t vol[5]; |
778e67bd | 645 | Int_t copy; |
67721dc4 | 646 | Int_t ipart; |
647 | TLorentzVector pos; | |
648 | TLorentzVector mom; | |
649 | ||
778e67bd | 650 | static Float_t hits[13]; |
651 | Int_t tracknumber = gAlice->CurrentTrack(); | |
67721dc4 | 652 | |
778e67bd | 653 | static Float_t eloss; |
654 | static Float_t tlength; | |
655 | Float_t theta; | |
656 | Float_t phi; | |
67721dc4 | 657 | |
778e67bd | 658 | if ( !gMC->IsTrackAlive() ) return; |
bd1047f8 | 659 | |
778e67bd | 660 | if (gMC->IsNewTrack()) { |
661 | // Reset the deposited energy | |
662 | eloss = 0.; | |
663 | } | |
664 | ||
665 | eloss += gMC->Edep(); // Store the energy loss along the trajectory. | |
666 | tlength += gMC->TrackStep(); | |
bd1047f8 | 667 | |
778e67bd | 668 | if (gMC->IsTrackEntering() && (strcmp(gMC->CurrentVolName(),"CM12") == 0) ) { |
67721dc4 | 669 | |
778e67bd | 670 | // Get current particle id (ipart), track position (pos) and momentum (mom) |
671 | gMC->TrackPosition(pos); | |
672 | gMC->TrackMomentum(mom); | |
673 | ipart = gMC->TrackPid(); | |
674 | ||
675 | Double_t tc = mom[0]*mom[0]+mom[1]*mom[1]; | |
676 | Double_t pt = TMath::Sqrt(tc); | |
677 | theta = Float_t(TMath::ATan2(pt,Double_t(mom[2])))*kRaddeg; | |
678 | phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg; | |
679 | ||
680 | ||
681 | vol[0] = gMC->CurrentVolOffID(1, vol[1]); | |
682 | vol[2] = gMC->CurrentVolID(copy); | |
683 | vol[3] = copy; | |
684 | ||
67721dc4 | 685 | hits[0] = 0.f; // (fnmou) |
686 | hits[1] = (Float_t)ipart; // (fId) | |
687 | ||
688 | hits[2] = pos[0]; // X coordinate (fX) | |
689 | hits[3] = pos[1]; // Y coordinate (fY) | |
690 | hits[4] = pos[2]; // Z coordinate (fZ) | |
691 | hits[5] = mom[0]; // Px (fpxug) | |
692 | hits[6] = mom[1]; // Py (fpyug) | |
693 | hits[7] = mom[2]; // Pz (fpzug) | |
694 | ||
695 | hits[8] = gMC->GetMedium();//layer(flay) | |
778e67bd | 696 | hits[9] = theta; // arrival angle |
697 | hits[10] = phi; // | |
698 | hits[11] = eloss; // Energy loss | |
699 | hits[12] = tlength; // Trajectory lenght | |
700 | hits[13] = (Float_t)tracknumber; | |
67721dc4 | 701 | |
702 | AddHit(gAlice->CurrentTrack(),vol, hits); | |
778e67bd | 703 | |
67721dc4 | 704 | } |
705 | ||
706 | } | |
778e67bd | 707 |