Use SetCerenkov to eliminate TGeant3 dependence.
[u/mrichter/AliRoot.git] / VZERO / AliVZEROv0.cxx
CommitLineData
47890cd3 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
47890cd3 17//////////////////////////////////////////////////////////////////////
18// //
19// (V-zero) detector version 0 as designed by the Lyon group //
20// All comments should be sent to Brigitte CHEYNIS : //
21// b.cheynis@ipnl.in2p3.fr //
61874e87 22// Geometrie du 25/02/2002 //
47890cd3 23// //
24//////////////////////////////////////////////////////////////////////
25
26#include <TMath.h>
27#include <TGeometry.h>
28#include <TTRD2.h>
29#include <TCONE.h>
30#include <TPGON.h>
31#include <TPCON.h>
32#include <TSPHE.h>
33#include <TTRAP.h>
34#include <TBRIK.h>
35#include <TBox.h>
36
37#include <TShape.h>
38#include <TNode.h>
39#include <TClonesArray.h>
40#include <TH1.h>
41#include <string.h>
42#include <iostream.h>
43
44#include "AliVZEROv0.h"
45#include "AliRun.h"
61874e87 46#include "AliMagF.h"
47890cd3 47#include "AliMC.h"
48#include "AliVZEROhit.h"
49#include "AliVZEROdigit.h"
50#include <iostream.h>
51#include <fstream.h>
52
47890cd3 53#include <stdlib.h>
54#include "TObjectTable.h"
55
56#include "AliConst.h"
57#include "ABSOSHILConst.h"
58#include "ABSOConst.h"
61874e87 59#include "TLorentzVector.h"
47890cd3 60
61ClassImp(AliVZEROv0)
62
63//--------------------------------------------------------------------
64AliVZEROv0:: AliVZEROv0():AliVZERO()
65{
61874e87 66
67
47890cd3 68}
69//--------------------------------------------------------------------
70AliVZEROv0::AliVZEROv0(const char *name, const char *title):
71 AliVZERO(name,title)
72{
73
74// Standard constructor for V-zeroR Detector (right part) version 0
75
76
77 Int_t i;
78
79 printf("\n");
61874e87 80 for(i=0;i<30;i++) printf("*");
81 printf(" Create VZERO object ");
82 for(i=0;i<30;i++) printf("*");
47890cd3 83 printf("\n");
84
85}
61874e87 86
47890cd3 87//-------------------------------------------------------------------------
88void AliVZEROv0::CreateGeometry()
89{
90
61874e87 91// Creates the Geant geometry of the V-zero Detector version 0
47890cd3 92
93
94 Int_t i;
95
96 printf("\n");
61874e87 97 for(i=0;i<30;i++) printf("*");
98 printf(" Create VZERO Geometry ");
99 for(i=0;i<30;i++) printf("*");
47890cd3 100 printf("\n");
101
102
103 Int_t *idtmed = fIdtmed->GetArray()-2999;
104
61874e87 105 Int_t n_detec_R = 1;
106 Int_t n_detec_L = 1;
107
108 Int_t n_cells_R = 1;
109 Int_t n_cells_L = 1;
110
47890cd3 111 Int_t idrotm[999];
112
113 Float_t height1, height2, height3, height4, height5;
114 Float_t height;
115 Float_t theta;
116 Float_t half_thick_alu;
117 Float_t half_thick_qua1,half_thick_qua2,half_thick_qua3;
118 Float_t half_thick_qua4,half_thick_qua5;
119 Float_t zdet;
120 Float_t r0, r5;
121 Float_t pi = TMath::Pi();
122 Float_t thick_alu;
123
61874e87 124 height1 = 2.0; // height of cell 1, in cm
125 height2 = 3.2; // height of cell 2, in cm
126 height3 = 4.9; // height of cell 3, in cm
127 height4 = 7.5; // height of cell 4, in cm
128 height5 = 12.0; // height of cell 5, in cm
47890cd3 129
61874e87 130 theta = pi/6.0/2.0; // half angular opening = 15 degrees
47890cd3 131 half_thick_alu = 0.0025; // half thickness of aluminum foil, in cm
132 thick_alu = 2.0 * half_thick_alu;
61874e87 133 fThickness1 = 2.5;
47890cd3 134 half_thick_qua1 = fThickness1/2.0; // half thickness of WRAPPED quartz cell (inner ring)
135 half_thick_qua2 = half_thick_qua1 - 0.25;
136 half_thick_qua3 = half_thick_qua2 - 0.25;
137 half_thick_qua4 = half_thick_qua3 - 0.25;
138 half_thick_qua5 = half_thick_qua4 - 0.25;
139
140 zdet = 86.9 +fThickness/2.0; // distance to vertex (along Z axis)
61874e87 141 r0 = 4.0; // closest distance to center of the beam pipe
47890cd3 142 height = height1 + height2 + height3 + height4 + height5;
143 r5 = r0 + height;
144
61874e87 145//............................................................................
146
147// Here I add the flange which is sitting on beam line
148// right in front of V0R detector, and which I found on CERN drawing
149// entitled : ALICE BEAM VACCUM CHAMBER - RB26 version III :
150
151// Float_t pflange[3];
152//
153// pflange[0] = 3.0;
154// pflange[1] = 5.675;
155// pflange[2] = 0.9;
156//
157// gMC->Gsvolu("QFA0","TUBE", idtmed[3003], pflange, 3);
158// gMC->Gspos("QFA0", 1 ,"alic", 0.0, 0.0, 85.0+0.9, 0, "ONLY");
159
160//............................................................................
161
47890cd3 162
61874e87 163// Creation of mother volume V0LE - left part - :
164// Face entree a -350.0 cm ...
165
166 Float_t partube[3];
167
168 partube[0] = 4.3;
169 partube[1] = 45.0;
170 partube[2] = fThickness1/2.0;
171
172 gMC->Gsvolu("V0LE","TUBE",idtmed[3002],partube,3);
173
174
175// Creation of five rings - left part - :
176// Face entree a -350.0 cm ...
177
178// Mother volume V0L0 in which will be set 5 quartz cells
179
180
181 Float_t par[11];
182
183 Float_t dist0_left;
184 Float_t r0_left = 4.3;
185 Float_t height1_left = 2.6;
186 Float_t height2_left = 4.1;
187 Float_t height3_left = 6.4;
188 Float_t height4_left = 10.2;
189 Float_t height5_left = 16.9;
190 Float_t height_left = height1_left + height2_left + height3_left
191 + height4_left + height5_left;
192 Float_t r5_left = r0_left + height_left;
193
194
195 dist0_left = r0_left + height_left / 2.0;
196 thick_alu = 2.0*half_thick_alu;
197
198 par[0] = half_thick_qua1;
199 par[1] = 0.0;
200 par[2] = 0.0;
201 par[3] = height_left / 2.0 ;
202 par[4] = TMath::Tan(theta) * r0_left;
203 par[5] = TMath::Tan(theta) * r5_left;
204 par[6] = 0.0;
205 par[7] = height_left / 2.0 ;
206 par[8] = TMath::Tan(theta) * r0_left;
207 par[9] = TMath::Tan(theta) * r5_left;
208 par[10] = 0.0;
209
210
211 gMC->Gsvolu("V0L0","TRAP",idtmed[3010],par,11); // air volume
212
213 Float_t dist1_left;
214 Float_t r1_left;
215 Float_t offset_left;
216
217 dist1_left = (- height_left + height1_left) /2.0;
218 r1_left = r0_left + height1_left;
219 offset_left = - fThickness1/2.0 + 0.1;
220
221 par[0] = half_thick_qua1 - thick_alu;
222 par[3] = height1_left / 2.0 - thick_alu;
223 par[4] = TMath::Tan(theta) * r0_left - thick_alu;
224 par[5] = TMath::Tan(theta) * r1_left- thick_alu;
225 par[7] = height1_left / 2.0 - thick_alu;
226 par[8] = TMath::Tan(theta) * r0_left - thick_alu;
227 par[9] = TMath::Tan(theta) * r1_left - thick_alu;
228
229
230 gMC->Gsvolu("V0L1","TRAP",idtmed[3002],par,11); // quartz volume
231 gMC->Gspos("V0L1",1,"V0L0", 0.0, dist1_left , 0.0, 0,"ONLY");
232
233 Float_t dist2_left;
234 Float_t r2_left;
235
236 dist2_left = (- height_left + height2_left) /2.0 + height1_left;
237 r2_left = r1_left + height2_left;
238
239 par[0] = half_thick_qua1 - thick_alu;
240 par[3] = height2_left / 2.0 - thick_alu;
241 par[4] = TMath::Tan(theta) * r1_left - thick_alu;
242 par[5] = TMath::Tan(theta) * r2_left - thick_alu;
243 par[7] = height2_left / 2.0 - thick_alu;
244 par[8] = TMath::Tan(theta) * r1_left - thick_alu;
245 par[9] = TMath::Tan(theta) * r2_left - thick_alu;
246
247 gMC->Gsvolu("V0L2","TRAP",idtmed[3002],par,11); // quartz volume
248 gMC->Gspos("V0L2",1,"V0L0", 0.0, dist2_left , 0.0, 0,"ONLY");
249
250
251 Float_t dist3_left;
252 Float_t r3_left;
253
254 dist3_left = (- height_left + height3_left) /2.0 + height1_left + height2_left;
255 r3_left = r2_left + height3_left;
256
257 par[0] = half_thick_qua1 - thick_alu;
258 par[3] = height3_left / 2.0 - thick_alu;
259 par[4] = TMath::Tan(theta) * r2_left - thick_alu;
260 par[5] = TMath::Tan(theta) * r3_left - thick_alu;
261 par[7] = height3_left / 2.0 - thick_alu;
262 par[8] = TMath::Tan(theta) * r2_left - thick_alu;
263 par[9] = TMath::Tan(theta) * r3_left - thick_alu;
264
265 gMC->Gsvolu("V0L3","TRAP",idtmed[3002],par,11); // quartz volume
266 gMC->Gspos("V0L3",1,"V0L0", 0.0, dist3_left , 0.0, 0,"ONLY");
267
268 Float_t dist4_left;
269 Float_t r4_left;
270
271 dist4_left = (- height_left + height4_left) /2.0 + height1_left
272 + height2_left + height3_left;
273 r4_left = r3_left + height4_left;
274
275 par[0] = half_thick_qua1 - thick_alu;
276 par[3] = height4_left / 2.0 - thick_alu;
277 par[4] = TMath::Tan(theta) * r3_left - thick_alu;
278 par[5] = TMath::Tan(theta) * r4_left - thick_alu;
279 par[7] = height4_left / 2.0 - thick_alu;
280 par[8] = TMath::Tan(theta) * r3_left - thick_alu;
281 par[9] = TMath::Tan(theta) * r4_left - thick_alu;
282
283 gMC->Gsvolu("V0L4","TRAP",idtmed[3002],par,11); // quartz volume
284 gMC->Gspos("V0L4",1,"V0L0", 0.0, dist4_left , 0.0, 0,"ONLY");
285
286
287 Float_t dist5_left;
288
289
290 dist5_left = (- height_left + height5_left) /2.0 + height1_left
291 + height2_left + height3_left + height4_left;
292
293
294 par[0] = half_thick_qua1 - thick_alu;
295 par[3] = height5_left / 2.0 - thick_alu;
296 par[4] = TMath::Tan(theta) * r4_left - thick_alu;
297 par[5] = TMath::Tan(theta) * r5_left - thick_alu;
298 par[7] = height5_left / 2.0 - thick_alu;
299 par[8] = TMath::Tan(theta) * r4_left - thick_alu;
300 par[9] = TMath::Tan(theta) * r5_left - thick_alu;
301
302 gMC->Gsvolu("V0L5","TRAP",idtmed[3002],par,11); // quartz volume
303 gMC->Gspos("V0L5",1,"V0L0", 0.0, dist5_left , 0.0, 0,"ONLY");
304
305
306//............................................................................
307
308// Creation of mother volume V0RI - right part - :
47890cd3 309
47890cd3 310
311 partube[0] = r0 - 0.2;
312 partube[1] = (r5 + 1.0) / TMath::Cos(theta);
313 partube[2] = fThickness/2.0;
314
315
316 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
317
318// Creation of carbon lids (1 mm thick) to keep V0RI box shut...
319
320 Float_t parbox[10];
321
322 parbox[0] = 0.;
323 parbox[1] = 360.;
61874e87 324 parbox[2] = 12;
47890cd3 325 parbox[3] = 2;
326 parbox[4] = -0.1/2.0;
327 parbox[5] = r0;
328 parbox[6] = r5;
329 parbox[7] = +0.1/2.0;
330 parbox[8] = r0;
331 parbox[9] = r5;
332
333
334 gMC->Gsvolu("V0CA","PGON",idtmed[3001],parbox,10);
335 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-parbox[7],0,"ONLY");
336 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+parbox[7],0,"ONLY");
337
338// Creation of aluminum rings to maintain the V0RI pieces ...
339
340 parbox[4] = -fThickness/2.0;
341 parbox[5] = r0 -0.2;
342 parbox[6] = r0;
343 parbox[7] = +fThickness/2.0;
344 parbox[8] = r0 -0.2;
345 parbox[9] = r0;
346
347 gMC->Gsvolu("V0IR","PGON",idtmed[3003],parbox,10);
348 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
349
350 parbox[4] = -fThickness/2.0;
351 parbox[5] = r5;
352 parbox[6] = r5 + 1.0;
353 parbox[7] = +fThickness/2.0;
354 parbox[8] = r5;
355 parbox[9] = r5 + 1.0;
356
357 gMC->Gsvolu("V0ER","PGON",idtmed[3003],parbox,10);
358 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
359
360// Mother volume V0R0 in which will be set 5 quartz cells
361// each one WRAPPED in reflecting aluminum :
362
61874e87 363 Float_t dist0;
47890cd3 364
365 dist0 = r0 + height / 2.0;
366 thick_alu = 2.0*half_thick_alu;
367
368 par[0] = half_thick_qua1;
369 par[1] = 0.0;
370 par[2] = 0.0;
371 par[3] = height / 2.0 ;
372 par[4] = TMath::Tan(theta) * r0;
373 par[5] = TMath::Tan(theta) * r5;
374 par[6] = 0.0;
375 par[7] = height / 2.0 ;
376 par[8] = TMath::Tan(theta) * r0;
377 par[9] = TMath::Tan(theta) * r5;
378 par[10] = 0.0;
379
380
381 gMC->Gsvolu("V0R0","TRAP",idtmed[3010],par,11); // air volume
382
383// Elementary cell of ring 1 :
384
385 Float_t dist1;
386 Float_t r1;
387 Float_t offset;
388
389 dist1 = (- height + height1) /2.0;
390 r1 = r0 + height1;
391 offset = - fThickness/2.0 + 0.1;
392
393 par[0] = half_thick_qua1 - thick_alu;
394 par[3] = height1 / 2.0 - thick_alu;
395 par[4] = TMath::Tan(theta) * r0 - thick_alu;
396 par[5] = TMath::Tan(theta) * r1- thick_alu;
397 par[7] = height1 / 2.0 - thick_alu;
398 par[8] = TMath::Tan(theta) * r0 - thick_alu;
399 par[9] = TMath::Tan(theta) * r1 - thick_alu;
400
401
402 gMC->Gsvolu("V0R1","TRAP",idtmed[3002],par,11); // quartz volume
403 gMC->Gspos("V0R1",1,"V0R0", 0.0, dist1 , 0.0, 0,"ONLY");
404
405 par[0] = half_thick_alu;
406
407 gMC->Gsvolu("V0A1","TRAP",idtmed[3004],par,11); // aluminum trap-shaped foil
408 gMC->Gspos("V0A1",1,"V0R1",0.0,0.0, - half_thick_qua1 + half_thick_alu,0,"ONLY");
409 gMC->Gspos("V0A1",2,"V0R1",0.0,0.0, + half_thick_qua1 - half_thick_alu,0,"ONLY");
410
411 parbox[0] = half_thick_alu;
412 parbox[1] = height1 / TMath::Cos(theta)/ 2.0;
413 parbox[2] = half_thick_qua1;
414
415 gMC->Gsvolu("V0A2","BOX",idtmed[3004],parbox,3); // aluminum rectangular foil
61874e87 416 Float_t theta_deg = 180./6./2.0;
47890cd3 417 Float_t h1;
418 h1 = TMath::Tan(theta) * (r0 + height1/2.0);
419 AliMatrix(idrotm[911],90.0,+theta_deg,90.0,90.+theta_deg,0.0,0.);
420 gMC->Gspos("V0A2",1,"V0R1",-h1 + half_thick_alu,0.0,0.0,idrotm[911],"ONLY");
421 AliMatrix(idrotm[912],90.0,-theta_deg,90.0,90.-theta_deg,0.0,0.);
422 gMC->Gspos("V0A2",2,"V0R1",+h1 - half_thick_alu,0.0,0.0,idrotm[912],"ONLY");
423
424 parbox[0] = TMath::Tan(theta) * r0;
425 parbox[1] = half_thick_alu;
426 parbox[2] = half_thick_qua1;
427 gMC->Gsvolu("V0A3","BOX",idtmed[3004],parbox,3);
428 gMC->Gspos("V0A3",1,"V0R1",0.0, - (height1/2.0) + half_thick_alu ,0.0,0,"ONLY");
429
430
431 parbox[0] = TMath::Tan(theta) * (r0 + height1);
432 parbox[1] = half_thick_alu;
433 parbox[2] = half_thick_qua1;
434 gMC->Gsvolu("V0A4","BOX",idtmed[3004],parbox,3);
435 gMC->Gspos("V0A4",1,"V0R1",0.0, (height1/2.0) - half_thick_alu,0.0,0,"ONLY");
436
437
438// Elementary cell of ring 2 :
439
440 Float_t dist2;
441 Float_t r2;
442
443 dist2 = (- height + height2) /2.0 + height1;
444 r2 = r1 + height2;
445
446 par[0] = half_thick_qua2 - thick_alu;
447 par[3] = height2 / 2.0 - thick_alu;
448 par[4] = TMath::Tan(theta) * r1 - thick_alu;
449 par[5] = TMath::Tan(theta) * r2 - thick_alu;
450 par[7] = height2 / 2.0 - thick_alu;
451 par[8] = TMath::Tan(theta) * r1 - thick_alu;
452 par[9] = TMath::Tan(theta) * r2 - thick_alu;
453
454 gMC->Gsvolu("V0R2","TRAP",idtmed[3002],par,11); // quartz volume
455 gMC->Gspos("V0R2",1,"V0R0", 0.0, dist2 , - half_thick_qua1 + half_thick_qua2, 0,"ONLY");
456
457 par[0] = half_thick_alu;
458
459 gMC->Gsvolu("V0B1","TRAP",idtmed[3004],par,11); // aluminum trap-shaped foil
460 gMC->Gspos("V0B1",1,"V0R2",0.0,0.0, - half_thick_qua2 + half_thick_alu,0,"ONLY");
461 gMC->Gspos("V0B1",2,"V0R2",0.0,0.0, + half_thick_qua2 - half_thick_alu,0,"ONLY");
462
463 parbox[0] = half_thick_alu;
464 parbox[1] = height2 / TMath::Cos(theta)/ 2.0;
465 parbox[2] = half_thick_qua2;
466
467 gMC->Gsvolu("V0B2","BOX",idtmed[3004],parbox,3); // aluminum rectangular foil
468 Float_t h2;
469 h2 = TMath::Tan(theta) * (r0 + height1 + height2/2.0);
470 gMC->Gspos("V0B2",1,"V0R2",-h2 + half_thick_alu,0.0,0.0,idrotm[911],"ONLY");
471 gMC->Gspos("V0B2",2,"V0R2",+h2 - half_thick_alu,0.0,0.0,idrotm[912],"ONLY");
472
473 parbox[0] = TMath::Tan(theta) * (r0 + height1);
474 parbox[1] = half_thick_alu;
475 parbox[2] = half_thick_qua2;
476 gMC->Gsvolu("V0B3","BOX",idtmed[3004],parbox,3);
477 gMC->Gspos("V0B3",1,"V0R2",0.0, - (height2/2.0) + half_thick_alu ,0.0,0,"ONLY");
478
479
480 parbox[0] = TMath::Tan(theta) * (r0 + height1 + height2);
481 parbox[1] = half_thick_alu;
482 parbox[2] = half_thick_qua2;
483 gMC->Gsvolu("V0B4","BOX",idtmed[3004],parbox,3);
484 gMC->Gspos("V0B4",1,"V0R2",0.0, (height2/2.0) - half_thick_alu,0.0,0,"ONLY");
485
486
487// Elementary cell ring 3 :
488
489 Float_t dist3;
490 Float_t r3;
491
492 dist3 = (- height + height3) /2.0 + height1 + height2;
493 r3 = r2 + height3;
494
495 par[0] = half_thick_qua3 - thick_alu;
496 par[3] = height3 / 2.0 - thick_alu;
497 par[4] = TMath::Tan(theta) * r2 - thick_alu;
498 par[5] = TMath::Tan(theta) * r3 - thick_alu;
499 par[7] = height3 / 2.0 - thick_alu;
500 par[8] = TMath::Tan(theta) * r2 - thick_alu;
501 par[9] = TMath::Tan(theta) * r3 - thick_alu;
502
503 gMC->Gsvolu("V0R3","TRAP",idtmed[3002],par,11); // quartz volume
504 gMC->Gspos("V0R3",1,"V0R0", 0.0, dist3 , - half_thick_qua1 + half_thick_qua3, 0,"ONLY");
505
506
507 par[0] = half_thick_alu;
508
509 gMC->Gsvolu("V0C1","TRAP",idtmed[3004],par,11); // aluminum trap-shaped foil
510 gMC->Gspos("V0C1",1,"V0R3",0.0,0.0, - half_thick_qua3 + half_thick_alu,0,"ONLY");
511 gMC->Gspos("V0C1",2,"V0R3",0.0,0.0, + half_thick_qua3 - half_thick_alu,0,"ONLY");
512
513 parbox[0] = half_thick_alu;
514 parbox[1] = height3 / TMath::Cos(theta)/ 2.0;
515 parbox[2] = half_thick_qua3;
516
517 gMC->Gsvolu("V0C2","BOX",idtmed[3004],parbox,3); // aluminum rectangular foil
518 Float_t h3;
519 h3 = TMath::Tan(theta) * (r0 + height1 + height2 + height3/2.0);
520 gMC->Gspos("V0C2",1,"V0R3",-h3 + half_thick_alu,0.0,0.0,idrotm[911],"ONLY");
521 gMC->Gspos("V0C2",2,"V0R3",+h3 - half_thick_alu,0.0,0.0,idrotm[912],"ONLY");
522
523 parbox[0] = TMath::Tan(theta) * (r0 + height1 + height2);
524 parbox[1] = half_thick_alu;
525 parbox[2] = half_thick_qua3;
526 gMC->Gsvolu("V0C3","BOX",idtmed[3004],parbox,3);
527 gMC->Gspos("V0C3",1,"V0R3",0.0, - (height3/2.0) + half_thick_alu ,0.0,0,"ONLY");
528
529
530 parbox[0] = TMath::Tan(theta) * (r0 + height1 + height2 + height3);
531 parbox[1] = half_thick_alu;
532 parbox[2] = half_thick_qua3;
533 gMC->Gsvolu("V0C4","BOX",idtmed[3004],parbox,3);
534 gMC->Gspos("V0C4",1,"V0R3",0.0, (height3/2.0) - half_thick_alu,0.0,0,"ONLY");
535
536
537// Elementary cell ring 4 :
538
539 Float_t dist4;
540 Float_t r4;
541
542 dist4 = (- height + height4) /2.0 + height1 + height2 + height3;
543 r4 = r3 + height4;
544
545 par[0] = half_thick_qua4 - thick_alu;
546 par[3] = height4 / 2.0 - thick_alu;
547 par[4] = TMath::Tan(theta) * r3 - thick_alu;
548 par[5] = TMath::Tan(theta) * r4 - thick_alu;
549 par[7] = height4 / 2.0 - thick_alu;
550 par[8] = TMath::Tan(theta) * r3 - thick_alu;
551 par[9] = TMath::Tan(theta) * r4 - thick_alu;
552
553 gMC->Gsvolu("V0R4","TRAP",idtmed[3002],par,11); // quartz volume
554 gMC->Gspos("V0R4",1,"V0R0", 0.0, dist4 , - half_thick_qua1 + half_thick_qua4, 0,"ONLY");
555
556
557 par[0] = half_thick_alu;
558
559 gMC->Gsvolu("V0D1","TRAP",idtmed[3004],par,11); // aluminum trap-shaped foil
560 gMC->Gspos("V0D1",1,"V0R4",0.0,0.0, - half_thick_qua4 + half_thick_alu,0,"ONLY");
561 gMC->Gspos("V0D1",2,"V0R4",0.0,0.0, + half_thick_qua4 - half_thick_alu,0,"ONLY");
562
563 parbox[0] = half_thick_alu;
564 parbox[1] = height4 / TMath::Cos(theta)/ 2.0;
565 parbox[2] = half_thick_qua4;
566
567 gMC->Gsvolu("V0D2","BOX",idtmed[3004],parbox,3); // aluminum rectangular foil
568 Float_t h4;
569 h4 = TMath::Tan(theta) * (r0 + height1 + height2 + height3 + height4/2.0);
570 gMC->Gspos("V0D2",1,"V0R4",-h4 + half_thick_alu,0.0,0.0,idrotm[911],"ONLY");
571 gMC->Gspos("V0D2",2,"V0R4",+h4 - half_thick_alu,0.0,0.0,idrotm[912],"ONLY");
572
573 parbox[0] = TMath::Tan(theta) * (r0 + height1 + height2 + height3);
574 parbox[1] = half_thick_alu;
575 parbox[2] = half_thick_qua4;
576 gMC->Gsvolu("V0D3","BOX",idtmed[3004],parbox,3);
577 gMC->Gspos("V0D3",1,"V0R4",0.0, - (height4/2.0) + half_thick_alu ,0.0,0,"ONLY");
578
579
580 parbox[0] = TMath::Tan(theta) * (r0 + height1 + height2 + height3 + height4);
581 parbox[1] = half_thick_alu;
582 parbox[2] = half_thick_qua4;
583 gMC->Gsvolu("V0D4","BOX",idtmed[3004],parbox,3);
584 gMC->Gspos("V0D4",1,"V0R4",0.0, (height4/2.0) - half_thick_alu,0.0,0,"ONLY");
585
586
587// Elementary cell ring 5 :
588
589 Float_t dist5;
590
591 dist5 = (- height + height5) /2.0 + height1 + height2 + height3 + height4;
592
593 par[0] = half_thick_qua5 - thick_alu;
594 par[3] = height5 / 2.0 - thick_alu;
595 par[4] = TMath::Tan(theta) * r4 - thick_alu;
596 par[5] = TMath::Tan(theta) * r5 - thick_alu;
597 par[7] = height5 / 2.0 - thick_alu;
598 par[8] = TMath::Tan(theta) * r4 - thick_alu;
599 par[9] = TMath::Tan(theta) * r5 - thick_alu;
600
601 gMC->Gsvolu("V0R5","TRAP",idtmed[3002],par,11); // quartz volume
602 gMC->Gspos("V0R5",1,"V0R0", 0.0, dist5 , - half_thick_qua1 + half_thick_qua5, 0,"ONLY");
603
604
605 par[0] = half_thick_alu;
606
607 gMC->Gsvolu("V0E1","TRAP",idtmed[3004],par,11); // aluminum trap-shaped foil
608 gMC->Gspos("V0E1",1,"V0R5",0.0,0.0, - half_thick_qua5 + half_thick_alu,0,"ONLY");
609 gMC->Gspos("V0E1",2,"V0R5",0.0,0.0, + half_thick_qua5 - half_thick_alu,0,"ONLY");
610
611 parbox[0] = half_thick_alu;
612 parbox[1] = height5 / TMath::Cos(theta)/ 2.0;
613 parbox[2] = half_thick_qua5;
614
615 gMC->Gsvolu("V0E2","BOX",idtmed[3004],parbox,3); // aluminum rectangular foil
616 Float_t h5;
617 h5 = TMath::Tan(theta) * (r0 + height1 + height2 + height3 + height4 + height5/2.0);
618 gMC->Gspos("V0E2",1,"V0R5",-h5 + half_thick_alu,0.0,0.0,idrotm[911],"ONLY");
619 gMC->Gspos("V0E2",2,"V0R5",+h5 - half_thick_alu,0.0,0.0,idrotm[912],"ONLY");
620
621 parbox[0] = TMath::Tan(theta) * (r0 + height1 + height2 + height3 + height4);
622 parbox[1] = half_thick_alu;
623 parbox[2] = half_thick_qua5;
624 gMC->Gsvolu("V0E3","BOX",idtmed[3004],parbox,3);
625 gMC->Gspos("V0E3",1,"V0R5",0.0, - (height5/2.0) + half_thick_alu ,0.0,0,"ONLY");
626
627
628 parbox[0] = TMath::Tan(theta) * r5;
629 parbox[1] = half_thick_alu;
630 parbox[2] = half_thick_qua5;
631 gMC->Gsvolu("V0E4","BOX",idtmed[3004],parbox,3);
632 gMC->Gspos("V0E4",1,"V0R5",0.0, (height5/2.0) - half_thick_alu,0.0,0,"ONLY");
633
634
635 Float_t phi_rad ;
61874e87 636 Float_t phi_deg = 180./6.;
47890cd3 637
61874e87 638 // Partie de droite :
639
640 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
47890cd3 641 {
642 phi_rad = phi*pi/180.;
643 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
61874e87 644 gMC->Gspos("V0R0",n_detec_R,"V0RI",-dist0*TMath::Sin(phi_rad),
47890cd3 645 dist0*TMath::Cos(phi_rad),offset + half_thick_qua1,idrotm[902],"ONLY");
61874e87 646 n_detec_R++;
47890cd3 647 }
648
649
650 gMC->Gspos("V0RI",1,"alic",0.0,0.0,zdet,0,"ONLY");
651
61874e87 652 n_cells_R = (n_detec_R - 1) * 5;
47890cd3 653 printf(" \n\n\n");
61874e87 654 printf(" Number of cells on Right side = %d\n", n_cells_R);
655
656// Partie de gauche :
657
658 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
659 {
660 phi_rad = phi*pi/180.;
661 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
662 gMC->Gspos("V0L0",n_detec_L,"V0LE",-dist0_left*TMath::Sin(phi_rad),
663 dist0_left*TMath::Cos(phi_rad),offset_left + half_thick_qua1,idrotm[902],"ONLY");
664 n_detec_L++;
665 }
666
667
668 gMC->Gspos("V0LE",1,"alic",0.0,0.0,-350.0-fThickness1/2.0,0,"ONLY");
669
670 n_cells_L = (n_detec_L - 1) * 5;
671 printf(" \n\n\n");
672 printf(" Number of cells on Left side = %d\n\n", n_cells_L);
673
47890cd3 674
675}
676
677
61874e87 678
47890cd3 679//_____________________________________________________________________________
680void AliVZEROv0::BuildGeometry()
681{
682
683 // Builds simple ROOT TNode geometry for event display
61874e87 684
47890cd3 685
686 Int_t i;
687
688 printf("\n");
61874e87 689 for(i=0;i<30;i++) printf("*");
47890cd3 690 printf(" VZERO BuildGeometry ");
61874e87 691 for(i=0;i<30;i++) printf("*");
47890cd3 692 printf("\n");
693
61874e87 694 TNode *Top;
695
47890cd3 696 TNode *V0Rnode, *V0Rnode0, *V0Rnode6 , *V0Rnode7, *V0Rnode8, *V0Rnode9;
697 TNode *V0Rnode1, *V0Rnode2, *V0Rnode3, *V0Rnode4, *V0Rnode5;
61874e87 698 TNode *V0Lnode, *V0Lnode0;
699 TNode *V0Lnode1, *V0Lnode2, *V0Lnode3, *V0Lnode4, *V0Lnode5;
700
47890cd3 701 const int kColorVZERO = kGreen;
61874e87 702
47890cd3 703 Top = gAlice->GetGeometry()->GetNode("alice");
704
705 Float_t height1, height2, height3, height4, height5;
706 Float_t height;
707 Float_t theta;
708 Float_t half_thick_alu;
709 Float_t half_thick_qua1,half_thick_qua2,half_thick_qua3;
710 Float_t half_thick_qua4,half_thick_qua5;
711 Float_t zdet;
712 Float_t r0, r5;
713 Float_t pi = TMath::Pi();
714 Float_t thick_alu;
715
61874e87 716// height1 = 1.9;
717// height2 = 3.7;
718// height3 = 6.2;
719// height4 = 10.5;
720// height5 = 10.5;
721
722 height1 = 2.0; // height of cell 1, in cm
723 height2 = 3.2; // height of cell 2, in cm
724 height3 = 4.9; // height of cell 3, in cm
725 height4 = 7.5; // height of cell 4, in cm
726 height5 = 12.0; // height of cell 5, in cm
47890cd3 727
61874e87 728 theta = pi/6.0/2.0;
47890cd3 729 half_thick_alu = 0.0025;
730 thick_alu = 2.0 * half_thick_alu;
731 half_thick_qua1 = fThickness1/2.0;
732 half_thick_qua2 = half_thick_qua1 - 0.25;
733 half_thick_qua3 = half_thick_qua2 - 0.25;
734 half_thick_qua4 = half_thick_qua3 - 0.25;
735 half_thick_qua5 = half_thick_qua4 - 0.25;
736
737 zdet = 86.9 +fThickness/2.0;
61874e87 738 r0 = 4.0;
47890cd3 739 height = height1 + height2 + height3 + height4 + height5;
740 r5 = r0 + height;
741
742 Float_t partube[3];
743
744 partube[0] = r0 - 0.2;
745 partube[1] = (r5 + 1.0) / TMath::Cos(theta);
746 partube[2] = fThickness/2.0;
747
748 TTUBE *V0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
749
750 Top->cd();
751
752 V0Rnode = new TNode("V0RI","V0RI",V0RI,0.0,0.0,+zdet,0);
753
754 V0Rnode->SetLineColor(kBlue);
755 fNodes->Add(V0Rnode);
756
757 V0Rnode->SetVisibility(2);
61874e87 758
47890cd3 759
760// Rondelles de carbone (epaisseur 1 mm) de maintien des cellules ...
761
762
763 Float_t parbox[10];
764
765 parbox[0] = 0.;
766 parbox[1] = 360.;
61874e87 767 parbox[2] = 12;
47890cd3 768 parbox[3] = 2;
769 parbox[4] = -0.1/2.0;
770 parbox[5] = r0;
771 parbox[6] = r5;
772 parbox[7] = +0.1/2.0;
773 parbox[8] = r0;
774 parbox[9] = r5;
775
776
777 TPGON *V0CA = new TPGON("V0CA", "V0CA", "void",parbox[0], parbox[1],
778 parbox[2],parbox[3]);
779
780 V0CA->DefineSection( 0, parbox[4], parbox[5], parbox[6] );
781 V0CA->DefineSection( 1, parbox[7], parbox[8], parbox[9] );
782
783 V0Rnode->cd();
784 V0Rnode6 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0, fThickness/2.0-parbox[7],0);
785 V0Rnode6->SetLineColor(kYellow);
786 fNodes->Add(V0Rnode6);
787 V0Rnode->cd();
788 V0Rnode7 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0,-fThickness/2.0+parbox[7],0);
789 V0Rnode7->SetLineColor(kYellow);
790 fNodes->Add(V0Rnode7);
791
792 parbox[4] = -fThickness/2.0;
793 parbox[5] = r0 - 0.2;
794 parbox[6] = r0;
795 parbox[7] = +fThickness/2.0;
796 parbox[8] = r0 - 0.2;
797 parbox[9] = r0;
798
799 TPGON *V0IR = new TPGON("V0IR","V0IR","void", parbox[0], parbox[1],
800 parbox[2],parbox[3]);
801 V0IR->DefineSection( 0, parbox[4], parbox[5], parbox[6] );
802 V0IR->DefineSection( 1, parbox[7], parbox[8], parbox[9] );
803
804 V0Rnode->cd();
805 V0Rnode8 = new TNode("V0IR", "V0IR",V0IR,0.0,0.0,0.0,0);
806 V0Rnode8->SetLineColor(kYellow);
807 fNodes->Add(V0Rnode8);
808
809 parbox[4] = -fThickness/2.0;
810 parbox[5] = r5;
811 parbox[6] = r5 + 1.0;
812 parbox[7] = +fThickness/2.0;
813 parbox[8] = r5;
814 parbox[9] = r5 + 1.0;
815
816 TPGON *V0ER = new TPGON("V0ER","V0ER","void", parbox[0], parbox[1],
817 parbox[2],parbox[3]);
818 V0ER->DefineSection( 0, parbox[4], parbox[5], parbox[6] );
819 V0ER->DefineSection( 1, parbox[7], parbox[8], parbox[9] );
820
821 V0Rnode->cd();
822 V0Rnode9 = new TNode("V0ER", "V0ER",V0ER,0.0,0.0,0.0,0);
823 V0Rnode9->SetLineColor(kYellow);
824 fNodes->Add(V0Rnode9);
825
826 Float_t dist0;
827 Float_t par[11];
828
829 dist0 = r0 + height / 2.0;
830 thick_alu = 2.0*half_thick_alu;
831
832 par[0] = half_thick_qua1;
833 par[1] = 0.0;
834 par[2] = 0.0;
835 par[3] = height / 2.0 ;
836 par[4] = TMath::Tan(theta) * r0;
837 par[5] = TMath::Tan(theta) * r5;
838 par[6] = 0.0;
839 par[7] = height / 2.0 ;
840 par[8] = TMath::Tan(theta) * r0;
841 par[9] = TMath::Tan(theta) * r5;
842 par[10] = 0.0;
843
844 TTRAP *V0R0 = new TTRAP("V0R0", "V0R0", "void", par[0], par[1], par[2], par[3],
845 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
846
847 Float_t dist1;
848 Float_t r1;
849 Float_t offset;
850
851 dist1 = (- height + height1) /2.0;
852 r1 = r0 + height1;
853 offset = - fThickness/2.0 + 0.1;
854
855 par[0] = half_thick_qua1 - thick_alu;
856 par[3] = height1 / 2.0 - thick_alu;
857 par[4] = TMath::Tan(theta) * r0 - thick_alu;
858 par[5] = TMath::Tan(theta) * r1- thick_alu;
859 par[7] = height1 / 2.0 - thick_alu;
860 par[8] = TMath::Tan(theta) * r0 - thick_alu;
861 par[9] = TMath::Tan(theta) * r1 - thick_alu;
862
863 TTRAP *V0R1 = new TTRAP("V0R1", "V0R1", "void", par[0], par[1], par[2], par[3],
864 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
865
866
867 Float_t dist2;
868 Float_t r2;
869
870 dist2 = (- height + height2) /2.0 + height1;
871 r2 = r1 + height2;
872
873 par[0] = half_thick_qua2 - thick_alu;
874 par[3] = height2 / 2.0 - thick_alu;
875 par[4] = TMath::Tan(theta) * r1 - thick_alu;
876 par[5] = TMath::Tan(theta) * r2 - thick_alu;
877 par[7] = height2 / 2.0 - thick_alu;
878 par[8] = TMath::Tan(theta) * r1 - thick_alu;
879 par[9] = TMath::Tan(theta) * r2 - thick_alu;
880
881
882 TTRAP *V0R2 = new TTRAP("V0R2", "V0R2", "void", par[0], par[1], par[2], par[3],
883 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
884
885
886 Float_t dist3;
887 Float_t r3;
888
889 dist3 = (- height + height3) /2.0 + height1 + height2;
890 r3 = r2 + height3;
891
892 par[0] = half_thick_qua3 - thick_alu;
893 par[3] = height3 / 2.0 - thick_alu;
894 par[4] = TMath::Tan(theta) * r2 - thick_alu;
895 par[5] = TMath::Tan(theta) * r3 - thick_alu;
896 par[7] = height3 / 2.0 - thick_alu;
897 par[8] = TMath::Tan(theta) * r2 - thick_alu;
898 par[9] = TMath::Tan(theta) * r3 - thick_alu;
899
900
901 TTRAP *V0R3 = new TTRAP("V0R3", "V0R3", "void", par[0], par[1], par[2], par[3],
902 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
903
904
905 Float_t dist4;
906 Float_t r4;
907
908 dist4 = (- height + height4) /2.0 + height1 + height2 + height3;
909 r4 = r3 + height4;
910
911 par[0] = half_thick_qua4 - thick_alu;
912 par[3] = height4 / 2.0 - thick_alu;
913 par[4] = TMath::Tan(theta) * r3 - thick_alu;
914 par[5] = TMath::Tan(theta) * r4 - thick_alu;
915 par[7] = height4 / 2.0 - thick_alu;
916 par[8] = TMath::Tan(theta) * r3 - thick_alu;
917 par[9] = TMath::Tan(theta) * r4 - thick_alu;
918
919
920 TTRAP *V0R4 = new TTRAP("V0R4", "V0R4", "void", par[0], par[1], par[2], par[3],
921 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
922
923
924 Float_t dist5;
925
926 dist5 = (- height + height5) /2.0 + height1 + height2 + height3 + height4;
927
928 par[0] = half_thick_qua5 - thick_alu;
929 par[3] = height5 / 2.0 - thick_alu;
930 par[4] = TMath::Tan(theta) * r4 - thick_alu;
931 par[5] = TMath::Tan(theta) * r5 - thick_alu;
932 par[7] = height5 / 2.0 - thick_alu;
933 par[8] = TMath::Tan(theta) * r4 - thick_alu;
934 par[9] = TMath::Tan(theta) * r5 - thick_alu;
935
936
937 TTRAP *V0R5 = new TTRAP("V0R5", "V0R5", "void", par[0], par[1], par[2], par[3],
938 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
939
940
941 Float_t phi;
61874e87 942 Float_t phi_deg= 180./6.;
47890cd3 943 Float_t phi_rad;
944 Float_t xdet,ydet;
61874e87 945 Int_t n_detec_R = 1;
946
47890cd3 947 char NameNode[12];
948
949
61874e87 950 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
47890cd3 951 {
952
953 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
954
955 phi_rad = phi*pi/180.;
956 xdet = dist0*TMath::Sin(phi_rad);
957 ydet = dist0*TMath::Cos(phi_rad);
958
959
61874e87 960 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 961
962 V0Rnode->cd();
963 V0Rnode0 = new TNode(NameNode,NameNode,V0R0,-xdet,ydet, offset + half_thick_qua1,mat920);
964 V0Rnode0->SetLineColor(kColorVZERO);
965 fNodes->Add(V0Rnode0);
61874e87 966 n_detec_R++;
47890cd3 967
61874e87 968 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 969 V0Rnode0->cd();
970 V0Rnode1 = new TNode(NameNode,NameNode,V0R1,0.0,dist1, 0.0,0);
971 V0Rnode1->SetLineColor(kColorVZERO);
972 fNodes->Add(V0Rnode1);
61874e87 973 n_detec_R++;
47890cd3 974
61874e87 975 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 976 V0Rnode0->cd();
977 V0Rnode2 = new TNode(NameNode,NameNode,V0R2,0.0,dist2, - half_thick_qua1 + half_thick_qua2,0);
978 V0Rnode2->SetLineColor(kColorVZERO);
979 fNodes->Add(V0Rnode2);
61874e87 980 n_detec_R++;
47890cd3 981
982
61874e87 983 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 984 V0Rnode0->cd();
985 V0Rnode3 = new TNode(NameNode,NameNode,V0R3,0.0,dist3, - half_thick_qua1 + half_thick_qua3,0);
986 V0Rnode3->SetLineColor(kColorVZERO);
987 fNodes->Add(V0Rnode3);
61874e87 988 n_detec_R++;
47890cd3 989
61874e87 990 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 991 V0Rnode0->cd();
992 V0Rnode4 = new TNode(NameNode,NameNode,V0R4,0.0,dist4, - half_thick_qua1 + half_thick_qua4,0);
993 V0Rnode4->SetLineColor(kColorVZERO);
994 fNodes->Add(V0Rnode4);
61874e87 995 n_detec_R++;
47890cd3 996
61874e87 997 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 998 V0Rnode0->cd();
999 V0Rnode5 = new TNode(NameNode,NameNode,V0R5,0.0,dist5, - half_thick_qua1 + half_thick_qua5,0);
1000 V0Rnode5->SetLineColor(kColorVZERO);
1001 fNodes->Add(V0Rnode5);
61874e87 1002 n_detec_R++;
47890cd3 1003
1004 V0Rnode0->SetVisibility(2);
1005
1006 }
47890cd3 1007
47890cd3 1008
61874e87 1009// Left side of VZERO :
47890cd3 1010
47890cd3 1011
61874e87 1012 Float_t dist0_left;
1013 Float_t r0_left = 4.3;
1014 Float_t height1_left = 2.6;
1015 Float_t height2_left = 4.1;
1016 Float_t height3_left = 6.4;
1017 Float_t height4_left = 10.2;
1018 Float_t height5_left = 16.9;
1019 Float_t height_left = height1_left + height2_left + height3_left
1020 + height4_left + height5_left;
1021 Float_t r5_left = r0_left + height_left;
47890cd3 1022
61874e87 1023 partube[0] = r0_left;
1024 partube[1] = (r5_left) / TMath::Cos(theta);
1025 partube[2] = fThickness1/2.0;
47890cd3 1026
61874e87 1027 TTUBE *V0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
1028
1029 Top->cd();
1030
1031 V0Lnode = new TNode("V0LE","V0LE",V0LE,0.0,0.0,-350.0-fThickness1/2.0,0);
1032
1033 V0Lnode->SetLineColor(kBlue);
1034 fNodes->Add(V0Lnode);
1035
1036 V0Lnode->SetVisibility(2);
1037
1038 dist0_left = r0_left + height_left / 2.0;
1039 thick_alu = 2.0*half_thick_alu;
1040
1041 par[0] = half_thick_qua1;
1042 par[1] = 0.0;
1043 par[2] = 0.0;
1044 par[3] = height_left / 2.0 ;
1045 par[4] = TMath::Tan(theta) * r0_left;
1046 par[5] = TMath::Tan(theta) * r5_left;
1047 par[6] = 0.0;
1048 par[7] = height_left / 2.0 ;
1049 par[8] = TMath::Tan(theta) * r0_left;
1050 par[9] = TMath::Tan(theta) * r5_left;
1051 par[10] = 0.0;
1052
1053 TTRAP *V0L0 = new TTRAP("V0L0", "V0L0", "void", par[0], par[1], par[2], par[3],
1054 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
1055
1056
1057 Float_t dist1_left;
1058 Float_t r1_left;
1059 Float_t offset_left;
1060
1061 dist1_left = (- height_left + height1_left) /2.0;
1062 r1_left = r0_left + height1_left;
1063 offset_left = - fThickness1/2.0 + 0.1;
1064
1065 par[0] = half_thick_qua1 - thick_alu;
1066 par[3] = height1_left / 2.0 - thick_alu;
1067 par[4] = TMath::Tan(theta) * r0_left - thick_alu;
1068 par[5] = TMath::Tan(theta) * r1_left- thick_alu;
1069 par[7] = height1_left / 2.0 - thick_alu;
1070 par[8] = TMath::Tan(theta) * r0_left - thick_alu;
1071 par[9] = TMath::Tan(theta) * r1_left - thick_alu;
1072
1073 TTRAP *V0L1 = new TTRAP("V0L1", "V0L1", "void", par[0], par[1], par[2], par[3],
1074 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
47890cd3 1075
61874e87 1076 Float_t dist2_left;
1077 Float_t r2_left;
47890cd3 1078
61874e87 1079 dist2_left = (- height_left + height2_left) /2.0 + height1_left;
1080 r2_left = r1_left + height2_left;
1081
1082 par[0] = half_thick_qua1 - thick_alu;
1083 par[3] = height2_left / 2.0 - thick_alu;
1084 par[4] = TMath::Tan(theta) * r1_left - thick_alu;
1085 par[5] = TMath::Tan(theta) * r2_left - thick_alu;
1086 par[7] = height2_left / 2.0 - thick_alu;
1087 par[8] = TMath::Tan(theta) * r1_left - thick_alu;
1088 par[9] = TMath::Tan(theta) * r2_left - thick_alu;
47890cd3 1089
61874e87 1090 TTRAP *V0L2 = new TTRAP("V0L2", "V0L2", "void", par[0], par[1], par[2], par[3],
1091 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
47890cd3 1092
47890cd3 1093
61874e87 1094
1095 Float_t dist3_left;
1096 Float_t r3_left;
1097
1098 dist3_left = (- height_left + height3_left) /2.0 + height1_left + height2_left;
1099 r3_left = r2_left + height3_left;
1100
1101 par[0] = half_thick_qua1 - thick_alu;
1102 par[3] = height3_left / 2.0 - thick_alu;
1103 par[4] = TMath::Tan(theta) * r2_left - thick_alu;
1104 par[5] = TMath::Tan(theta) * r3_left - thick_alu;
1105 par[7] = height3_left / 2.0 - thick_alu;
1106 par[8] = TMath::Tan(theta) * r2_left - thick_alu;
1107 par[9] = TMath::Tan(theta) * r3_left - thick_alu;
1108
1109 TTRAP *V0L3 = new TTRAP("V0L3", "V0L3", "void", par[0], par[1], par[2], par[3],
1110 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
1111
1112
1113 Float_t dist4_left;
1114 Float_t r4_left;
1115
1116 dist4_left = (- height_left + height4_left) /2.0 + height1_left
1117 + height2_left + height3_left;
1118 r4_left = r3_left + height4_left;
1119
1120 par[0] = half_thick_qua1 - thick_alu;
1121 par[3] = height4_left / 2.0 - thick_alu;
1122 par[4] = TMath::Tan(theta) * r3_left - thick_alu;
1123 par[5] = TMath::Tan(theta) * r4_left - thick_alu;
1124 par[7] = height4_left / 2.0 - thick_alu;
1125 par[8] = TMath::Tan(theta) * r3_left - thick_alu;
1126 par[9] = TMath::Tan(theta) * r4_left - thick_alu;
1127
1128 TTRAP *V0L4 = new TTRAP("V0L4", "V0L4", "void", par[0], par[1], par[2], par[3],
1129 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
1130
47890cd3 1131
61874e87 1132 Float_t dist5_left;
47890cd3 1133
61874e87 1134
1135 dist5_left = (- height_left + height5_left) /2.0 + height1_left
1136 + height2_left + height3_left + height4_left;
47890cd3 1137
61874e87 1138
1139 par[0] = half_thick_qua1 - thick_alu;
1140 par[3] = height5_left / 2.0 - thick_alu;
1141 par[4] = TMath::Tan(theta) * r4_left - thick_alu;
1142 par[5] = TMath::Tan(theta) * r5_left - thick_alu;
1143 par[7] = height5_left / 2.0 - thick_alu;
1144 par[8] = TMath::Tan(theta) * r4_left - thick_alu;
1145 par[9] = TMath::Tan(theta) * r5_left - thick_alu;
1146
1147 TTRAP *V0L5 = new TTRAP("V0L5", "V0L5", "void", par[0], par[1], par[2], par[3],
1148 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
47890cd3 1149
47890cd3 1150
61874e87 1151 Int_t n_detec_L = 1;
1152
1153 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
1154 {
47890cd3 1155
61874e87 1156 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
47890cd3 1157
61874e87 1158 phi_rad = phi*pi/180.;
1159 xdet = dist0_left*TMath::Sin(phi_rad);
1160 ydet = dist0_left*TMath::Cos(phi_rad);
1161
1162
1163 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1164
1165 V0Lnode->cd();
1166 V0Lnode0 = new TNode(NameNode,NameNode,V0L0,-xdet,ydet, offset_left + half_thick_qua1,mat920);
1167 V0Lnode0->SetLineColor(kColorVZERO);
1168 fNodes->Add(V0Lnode0);
1169 n_detec_L++;
1170
1171 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1172 V0Lnode0->cd();
1173 V0Lnode1 = new TNode(NameNode,NameNode,V0L1,0.0,dist1_left, 0.0,0);
1174 V0Lnode1->SetLineColor(kColorVZERO);
1175 fNodes->Add(V0Lnode1);
1176 n_detec_L++;
1177
1178 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1179 V0Lnode0->cd();
1180 V0Lnode2 = new TNode(NameNode,NameNode,V0L2,0.0,dist2_left, 0.0,0);
1181 V0Lnode2->SetLineColor(kColorVZERO);
1182 fNodes->Add(V0Lnode2);
1183 n_detec_L++;
1184
1185
1186 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1187 V0Lnode0->cd();
1188 V0Lnode3 = new TNode(NameNode,NameNode,V0L3,0.0,dist3_left, 0.0,0);
1189 V0Lnode3->SetLineColor(kColorVZERO);
1190 fNodes->Add(V0Lnode3);
1191 n_detec_L++;
1192
1193 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1194 V0Lnode0->cd();
1195 V0Lnode4 = new TNode(NameNode,NameNode,V0L4,0.0,dist4_left, 0.0,0);
1196 V0Lnode4->SetLineColor(kColorVZERO);
1197 fNodes->Add(V0Lnode4);
1198 n_detec_L++;
47890cd3 1199
61874e87 1200 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1201 V0Lnode0->cd();
1202 V0Lnode5 = new TNode(NameNode,NameNode,V0L5,0.0,dist5_left, 0.0,0);
1203 V0Lnode5->SetLineColor(kColorVZERO);
1204 fNodes->Add(V0Lnode5);
1205 n_detec_L++;
47890cd3 1206
61874e87 1207 V0Lnode0->SetVisibility(2);
47890cd3 1208
61874e87 1209 }
47890cd3 1210
61874e87 1211
1212}
47890cd3 1213
1214
1215//------------------------------------------------------------------------
1216void AliVZEROv0::CreateMaterials()
1217{
61874e87 1218 Int_t i;
47890cd3 1219
61874e87 1220 printf("\n");
1221 for(i=0;i<30;i++) printf("*");
1222 printf(" VZERO create materials ");
1223 for(i=0;i<30;i++) printf("*");
1224 printf("\n");
1225
47890cd3 1226
47890cd3 1227 Float_t ppckov[14] = { 5.5e-9, 5.7e-9, 5.9e-9, 6.1e-9, 6.3e-9, 6.5e-9, 6.7e-9,
1228 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
61874e87 1229
1230
1231 Float_t ppckov_alu[14] = { 5.5e-9, 5.7e-9, 5.9e-9, 6.1e-9, 6.3e-9, 6.5e-9, 6.7e-9,
1232 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
47890cd3 1233
1234 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
1235 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
61874e87 1236 1.662295, 1.68337 };
47890cd3 1237
1238 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
1239 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
1240
1241 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1242
1243
1244 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
61874e87 1245
1246
47890cd3 1247 Float_t absco_alu[14] = { 1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,1e-4,
1248 1e-4,1e-4,1e-4,1e-4 };
1249 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
61874e87 1250
47890cd3 1251
1252 Int_t *idtmed = fIdtmed->GetArray()-2999;
1253
47890cd3 1254
1255// Parameters related to Quarz (SiO2) :
1256
1257 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
1258 Int_t nlmatqua;
1259
1260 aqua[0] = 28.09;
1261 aqua[1] = 16.;
1262 zqua[0] = 14.;
1263 zqua[1] = 8.;
1264 densqua = 2.64;
1265 nlmatqua = -2;
1266 wmatqua[0] = 1.;
1267 wmatqua[1] = 2.;
1268
1269// Parameters related to aluminum sheets :
1270
1271 Float_t aal = 26.98;
1272 Float_t zal = 13.00;
1273 Float_t densal= 2.7;
1274 Float_t radlal= 8.9;
1275
1276// Parameters related to scintillator CH :
1277
1278 Float_t ascin[2] = {1.01,12.01};
1279 Float_t zscin[2] = {1,6};
1280 Float_t wscin[2] = {1,1};
1281 Float_t denscin = 1.03;
1282
1283// Definition of materials :
1284
61874e87 1285 AliMaterial( 1, "AIR A$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
1286 AliMaterial(11, "AIR I$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
1287 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
47890cd3 1288 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
61874e87 1289 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
1290 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
47890cd3 1291
1292
1293 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
1294
1295
1296 Int_t ISXFLD = gAlice->Field()->Integ();
1297 Float_t SXMGMX = gAlice->Field()->Max();
1298
1299 Float_t tmaxfd, stemax, deemax, epsil, stmin;
1300
61874e87 1301 tmaxfd = 10.;
1302 stemax = 0.1;
1303 deemax = 0.1;
1304 epsil = 0.001;
1305 stmin = 0.001;
1306
1307 printf(" \n");
1308 printf(" StepQua, StepAlu = %f %f \n",fMaxStepQua,fMaxStepAlu);
1309 printf(" DeStepQua, DeStepAlu = %f %f \n",fMaxDestepQua,fMaxDestepAlu);
1310 printf(" \n");
1311
47890cd3 1312
1313// Active Air :
61874e87 1314 AliMedium(1, "ACTIVE AIR$", 1, 1, ISXFLD, SXMGMX,
1315 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
47890cd3 1316
1317// Inactive air :
1318
61874e87 1319 AliMedium(11, "INACTIVE AIR$", 11, 0, ISXFLD, SXMGMX,
1320 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
47890cd3 1321
61874e87 1322 AliMedium(2, "CARBON$ ", 2, 1, ISXFLD, SXMGMX,
1323 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
47890cd3 1324
61874e87 1325 AliMedium(3, "QUARZ$", 3, 1, ISXFLD, SXMGMX,
1326 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
47890cd3 1327
61874e87 1328 AliMedium(4,"ALUMINUM1$",4, 1, ISXFLD, SXMGMX,
1329 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
1330
1331
1332 AliMedium(5,"ALUMINUM2$",5, 1, ISXFLD, SXMGMX,
1333 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
1334
1335 AliMedium(6,"SCINTILLATOR$",6, 1, ISXFLD, SXMGMX, 10., .01, 1., .003, .003, 0, 0);
47890cd3 1336
1337 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
1338 gMC->Gstpar(idtmed[3000], "HADR", 1.);
1339 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
1340 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
1341
1342 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
1343 gMC->Gstpar(idtmed[3001], "HADR", 1.);
1344 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
1345 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
1346
1347 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
1348 gMC->Gstpar(idtmed[3002], "HADR", 1.);
1349 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
61874e87 1350 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
1351 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
1352 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
47890cd3 1353
1354 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
1355 gMC->Gstpar(idtmed[3003], "HADR", 1.);
1356 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
1357 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
1358
1359 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
1360 gMC->Gstpar(idtmed[3004], "HADR", 1.);
1361 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
1362 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
61874e87 1363 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
1364 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
47890cd3 1365
1366 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
1367 gMC->Gstpar(idtmed[3005], "HADR", 1.);
1368 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
1369 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
1370
7f40b0b2 1371 gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
1372 gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
47890cd3 1373
61874e87 1374
47890cd3 1375}
1376//---------------------------------------------------------------------
1377void AliVZEROv0::DrawModule()
1378{
1379
1380// Drawing is done in DrawVZERO.C
1381
1382 Int_t i;
1383
1384 printf("\n");
61874e87 1385 for(i=0;i<30;i++) printf("*");
47890cd3 1386 printf(" VZERO DrawModule ");
61874e87 1387 for(i=0;i<30;i++) printf("*");
47890cd3 1388 printf("\n");
1389
1390
1391}
1392
1393//-------------------------------------------------------------------
1394void AliVZEROv0::Init()
1395{
1396// Initialises version 0 of the VZERO Detector
1397// Just prints an information message
1398
61874e87 1399 printf(" VZERO version %d initialized \n",IsVersion());
47890cd3 1400
61874e87 1401// gMC->SetMaxStep(fMaxStepAlu);
1402// gMC->SetMaxStep(fMaxStepQua);
1403
1404// AliVZERO::Init();
1405
47890cd3 1406}
1407
1408//-------------------------------------------------------------------
1409
1410void AliVZEROv0::StepManager()
1411{
1412
61874e87 1413// (Very)Minimal version of StepManager
1414
1415
1416 Int_t copy;
1417 static Int_t vol[4];
1418 static Float_t hits[15];
47890cd3 1419
1420 TLorentzVector pos;
47890cd3 1421
61874e87 1422 TLorentzVector mom;
47890cd3 1423 Float_t theta;
1424 Float_t phi;
47890cd3 1425 Float_t kRaddeg = 180/TMath::Pi();
61874e87 1426 Float_t RingNumber;
1427
1428 Int_t ipart;
47890cd3 1429
61874e87 1430
1431// TGeant3 *geant3 = (TGeant3*) gMC;
1432// Int_t Nphot = geant3->Gckin2()->ngphot;
47890cd3 1433
61874e87 1434
1435// Only charged tracks :
47890cd3 1436
61874e87 1437 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
1438
1439
47890cd3 1440 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
1441 vol[2] = gMC->CurrentVolID(copy);
1442 vol[3] = copy;
1443
61874e87 1444 if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
1445 gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
1446 RingNumber = 1.0;
1447 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
1448 gMC->CurrentVolID(copy) == gMC->VolId("V0L2") )
1449 RingNumber = 2.0;
1450 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
1451 gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
1452 RingNumber = 3.0;
1453 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
1454 gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
1455 RingNumber = 4.0;
1456 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
1457 gMC->CurrentVolID(copy) == gMC->VolId("V0L5") )
1458 RingNumber = 5.0;
1459 else
1460 RingNumber = 0.0;
1461
1462 if (gMC->IsTrackEntering() && RingNumber > 0.5) {
1463
1464 gMC->TrackPosition(pos);
1465
1466 gMC->TrackMomentum(mom);
1467 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1468 Double_t Pt = TMath::Sqrt(tc);
1469 Double_t Pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
47890cd3 1470
61874e87 1471 theta = Float_t(TMath::ATan2(Pt,Double_t(mom[2])))*kRaddeg;
1472 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1473
1474 ipart = gMC->TrackPid();
1475
1476 hits[0] = pos[0];
1477 hits[1] = pos[1];
1478 hits[2] = pos[2];
1479 hits[3] = ipart;
1480
1481// Float_t ttime = gMC->TrackTime();
1482// hits[4] = ttime*1e9;
1483
1484 hits[4] = gMC->TrackTime();
1485 hits[5] = gMC->TrackCharge();
1486 hits[6] = theta;
1487 hits[7] = phi;
1488 hits[8] = RingNumber;
1489
1490 hits[9] = Pt;
1491 hits[10] = Pmom;
1492 hits[11] = mom[0];
1493 hits[12] = mom[1];
1494 hits[13] = mom[2];
1495
1496
1497 AddHit(gAlice->CurrentTrack(), vol, hits);
1498
1499 }
1500
47890cd3 1501}
1502
61874e87 1503//_____________________________________________________________________________
1504void AliVZEROv0::AddHit(Int_t track, Int_t *vol, Float_t *hits)
47890cd3 1505{
61874e87 1506 //
1507 // Add a VZERO hit
1508 //
47890cd3 1509
61874e87 1510 TClonesArray &lhits = *fHits;
1511 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
47890cd3 1512}
1513
1514//---------------------------------------------------------------------
61874e87 1515void AliVZEROv0::AddDigits(Int_t *tracks, Int_t* digits)
47890cd3 1516{
1517
1518 TClonesArray &ldigits = *fDigits;
47890cd3 1519 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
47890cd3 1520}
1521
47890cd3 1522//---------------------------------------------------------------------
1523void AliVZEROv0::MakeBranch(Option_t *option)
1524{
1525
1526 // Creates new branches in the current Root Tree
1527
1528
1529 char branchname[10];
1530 sprintf(branchname,"%s",GetName());
61874e87 1531 printf(" fBufferSize = %d \n",fBufferSize);
47890cd3 1532
1533 char *H = strstr(option,"H");
1534
1535 if (fHits && gAlice->TreeH() && H) {
1536 gAlice->TreeH()->Branch(branchname,&fHits, fBufferSize);
1537 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1538 }
1539
1540 char *D = strstr(option,"D");
1541 //
1542 if (fDigits && gAlice->TreeD() && D) {
1543 gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1544 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);
61874e87 1545 }
1546
47890cd3 1547}