Using ALIC instead of alic (I.Hrivnacova)
[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);
a35deab8 158// gMC->Gspos("QFA0", 1 ,"ALIC", 0.0, 0.0, 85.0+0.9, 0, "ONLY");
61874e87 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
a35deab8 649 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,zdet,0,"ONLY");
47890cd3 650
61874e87 651 n_cells_R = (n_detec_R - 1) * 5;
47890cd3 652 printf(" \n\n\n");
61874e87 653 printf(" Number of cells on Right side = %d\n", n_cells_R);
654
655// Partie de gauche :
656
657 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
658 {
659 phi_rad = phi*pi/180.;
660 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
661 gMC->Gspos("V0L0",n_detec_L,"V0LE",-dist0_left*TMath::Sin(phi_rad),
662 dist0_left*TMath::Cos(phi_rad),offset_left + half_thick_qua1,idrotm[902],"ONLY");
663 n_detec_L++;
664 }
665
666
a35deab8 667 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,-350.0-fThickness1/2.0,0,"ONLY");
61874e87 668
669 n_cells_L = (n_detec_L - 1) * 5;
670 printf(" \n\n\n");
671 printf(" Number of cells on Left side = %d\n\n", n_cells_L);
672
47890cd3 673
674}
675
676
61874e87 677
47890cd3 678//_____________________________________________________________________________
679void AliVZEROv0::BuildGeometry()
680{
681
682 // Builds simple ROOT TNode geometry for event display
61874e87 683
47890cd3 684
685 Int_t i;
686
687 printf("\n");
61874e87 688 for(i=0;i<30;i++) printf("*");
47890cd3 689 printf(" VZERO BuildGeometry ");
61874e87 690 for(i=0;i<30;i++) printf("*");
47890cd3 691 printf("\n");
692
61874e87 693 TNode *Top;
694
47890cd3 695 TNode *V0Rnode, *V0Rnode0, *V0Rnode6 , *V0Rnode7, *V0Rnode8, *V0Rnode9;
696 TNode *V0Rnode1, *V0Rnode2, *V0Rnode3, *V0Rnode4, *V0Rnode5;
61874e87 697 TNode *V0Lnode, *V0Lnode0;
698 TNode *V0Lnode1, *V0Lnode2, *V0Lnode3, *V0Lnode4, *V0Lnode5;
699
47890cd3 700 const int kColorVZERO = kGreen;
61874e87 701
47890cd3 702 Top = gAlice->GetGeometry()->GetNode("alice");
703
704 Float_t height1, height2, height3, height4, height5;
705 Float_t height;
706 Float_t theta;
707 Float_t half_thick_alu;
708 Float_t half_thick_qua1,half_thick_qua2,half_thick_qua3;
709 Float_t half_thick_qua4,half_thick_qua5;
710 Float_t zdet;
711 Float_t r0, r5;
712 Float_t pi = TMath::Pi();
713 Float_t thick_alu;
714
61874e87 715// height1 = 1.9;
716// height2 = 3.7;
717// height3 = 6.2;
718// height4 = 10.5;
719// height5 = 10.5;
720
721 height1 = 2.0; // height of cell 1, in cm
722 height2 = 3.2; // height of cell 2, in cm
723 height3 = 4.9; // height of cell 3, in cm
724 height4 = 7.5; // height of cell 4, in cm
725 height5 = 12.0; // height of cell 5, in cm
47890cd3 726
61874e87 727 theta = pi/6.0/2.0;
47890cd3 728 half_thick_alu = 0.0025;
729 thick_alu = 2.0 * half_thick_alu;
730 half_thick_qua1 = fThickness1/2.0;
731 half_thick_qua2 = half_thick_qua1 - 0.25;
732 half_thick_qua3 = half_thick_qua2 - 0.25;
733 half_thick_qua4 = half_thick_qua3 - 0.25;
734 half_thick_qua5 = half_thick_qua4 - 0.25;
735
736 zdet = 86.9 +fThickness/2.0;
61874e87 737 r0 = 4.0;
47890cd3 738 height = height1 + height2 + height3 + height4 + height5;
739 r5 = r0 + height;
740
741 Float_t partube[3];
742
743 partube[0] = r0 - 0.2;
744 partube[1] = (r5 + 1.0) / TMath::Cos(theta);
745 partube[2] = fThickness/2.0;
746
747 TTUBE *V0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
748
749 Top->cd();
750
751 V0Rnode = new TNode("V0RI","V0RI",V0RI,0.0,0.0,+zdet,0);
752
753 V0Rnode->SetLineColor(kBlue);
754 fNodes->Add(V0Rnode);
755
756 V0Rnode->SetVisibility(2);
61874e87 757
47890cd3 758
759// Rondelles de carbone (epaisseur 1 mm) de maintien des cellules ...
760
761
762 Float_t parbox[10];
763
764 parbox[0] = 0.;
765 parbox[1] = 360.;
61874e87 766 parbox[2] = 12;
47890cd3 767 parbox[3] = 2;
768 parbox[4] = -0.1/2.0;
769 parbox[5] = r0;
770 parbox[6] = r5;
771 parbox[7] = +0.1/2.0;
772 parbox[8] = r0;
773 parbox[9] = r5;
774
775
776 TPGON *V0CA = new TPGON("V0CA", "V0CA", "void",parbox[0], parbox[1],
777 parbox[2],parbox[3]);
778
779 V0CA->DefineSection( 0, parbox[4], parbox[5], parbox[6] );
780 V0CA->DefineSection( 1, parbox[7], parbox[8], parbox[9] );
781
782 V0Rnode->cd();
783 V0Rnode6 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0, fThickness/2.0-parbox[7],0);
784 V0Rnode6->SetLineColor(kYellow);
785 fNodes->Add(V0Rnode6);
786 V0Rnode->cd();
787 V0Rnode7 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0,-fThickness/2.0+parbox[7],0);
788 V0Rnode7->SetLineColor(kYellow);
789 fNodes->Add(V0Rnode7);
790
791 parbox[4] = -fThickness/2.0;
792 parbox[5] = r0 - 0.2;
793 parbox[6] = r0;
794 parbox[7] = +fThickness/2.0;
795 parbox[8] = r0 - 0.2;
796 parbox[9] = r0;
797
798 TPGON *V0IR = new TPGON("V0IR","V0IR","void", parbox[0], parbox[1],
799 parbox[2],parbox[3]);
800 V0IR->DefineSection( 0, parbox[4], parbox[5], parbox[6] );
801 V0IR->DefineSection( 1, parbox[7], parbox[8], parbox[9] );
802
803 V0Rnode->cd();
804 V0Rnode8 = new TNode("V0IR", "V0IR",V0IR,0.0,0.0,0.0,0);
805 V0Rnode8->SetLineColor(kYellow);
806 fNodes->Add(V0Rnode8);
807
808 parbox[4] = -fThickness/2.0;
809 parbox[5] = r5;
810 parbox[6] = r5 + 1.0;
811 parbox[7] = +fThickness/2.0;
812 parbox[8] = r5;
813 parbox[9] = r5 + 1.0;
814
815 TPGON *V0ER = new TPGON("V0ER","V0ER","void", parbox[0], parbox[1],
816 parbox[2],parbox[3]);
817 V0ER->DefineSection( 0, parbox[4], parbox[5], parbox[6] );
818 V0ER->DefineSection( 1, parbox[7], parbox[8], parbox[9] );
819
820 V0Rnode->cd();
821 V0Rnode9 = new TNode("V0ER", "V0ER",V0ER,0.0,0.0,0.0,0);
822 V0Rnode9->SetLineColor(kYellow);
823 fNodes->Add(V0Rnode9);
824
825 Float_t dist0;
826 Float_t par[11];
827
828 dist0 = r0 + height / 2.0;
829 thick_alu = 2.0*half_thick_alu;
830
831 par[0] = half_thick_qua1;
832 par[1] = 0.0;
833 par[2] = 0.0;
834 par[3] = height / 2.0 ;
835 par[4] = TMath::Tan(theta) * r0;
836 par[5] = TMath::Tan(theta) * r5;
837 par[6] = 0.0;
838 par[7] = height / 2.0 ;
839 par[8] = TMath::Tan(theta) * r0;
840 par[9] = TMath::Tan(theta) * r5;
841 par[10] = 0.0;
842
843 TTRAP *V0R0 = new TTRAP("V0R0", "V0R0", "void", par[0], par[1], par[2], par[3],
844 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
845
846 Float_t dist1;
847 Float_t r1;
848 Float_t offset;
849
850 dist1 = (- height + height1) /2.0;
851 r1 = r0 + height1;
852 offset = - fThickness/2.0 + 0.1;
853
854 par[0] = half_thick_qua1 - thick_alu;
855 par[3] = height1 / 2.0 - thick_alu;
856 par[4] = TMath::Tan(theta) * r0 - thick_alu;
857 par[5] = TMath::Tan(theta) * r1- thick_alu;
858 par[7] = height1 / 2.0 - thick_alu;
859 par[8] = TMath::Tan(theta) * r0 - thick_alu;
860 par[9] = TMath::Tan(theta) * r1 - thick_alu;
861
862 TTRAP *V0R1 = new TTRAP("V0R1", "V0R1", "void", par[0], par[1], par[2], par[3],
863 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
864
865
866 Float_t dist2;
867 Float_t r2;
868
869 dist2 = (- height + height2) /2.0 + height1;
870 r2 = r1 + height2;
871
872 par[0] = half_thick_qua2 - thick_alu;
873 par[3] = height2 / 2.0 - thick_alu;
874 par[4] = TMath::Tan(theta) * r1 - thick_alu;
875 par[5] = TMath::Tan(theta) * r2 - thick_alu;
876 par[7] = height2 / 2.0 - thick_alu;
877 par[8] = TMath::Tan(theta) * r1 - thick_alu;
878 par[9] = TMath::Tan(theta) * r2 - thick_alu;
879
880
881 TTRAP *V0R2 = new TTRAP("V0R2", "V0R2", "void", par[0], par[1], par[2], par[3],
882 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
883
884
885 Float_t dist3;
886 Float_t r3;
887
888 dist3 = (- height + height3) /2.0 + height1 + height2;
889 r3 = r2 + height3;
890
891 par[0] = half_thick_qua3 - thick_alu;
892 par[3] = height3 / 2.0 - thick_alu;
893 par[4] = TMath::Tan(theta) * r2 - thick_alu;
894 par[5] = TMath::Tan(theta) * r3 - thick_alu;
895 par[7] = height3 / 2.0 - thick_alu;
896 par[8] = TMath::Tan(theta) * r2 - thick_alu;
897 par[9] = TMath::Tan(theta) * r3 - thick_alu;
898
899
900 TTRAP *V0R3 = new TTRAP("V0R3", "V0R3", "void", par[0], par[1], par[2], par[3],
901 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
902
903
904 Float_t dist4;
905 Float_t r4;
906
907 dist4 = (- height + height4) /2.0 + height1 + height2 + height3;
908 r4 = r3 + height4;
909
910 par[0] = half_thick_qua4 - thick_alu;
911 par[3] = height4 / 2.0 - thick_alu;
912 par[4] = TMath::Tan(theta) * r3 - thick_alu;
913 par[5] = TMath::Tan(theta) * r4 - thick_alu;
914 par[7] = height4 / 2.0 - thick_alu;
915 par[8] = TMath::Tan(theta) * r3 - thick_alu;
916 par[9] = TMath::Tan(theta) * r4 - thick_alu;
917
918
919 TTRAP *V0R4 = new TTRAP("V0R4", "V0R4", "void", par[0], par[1], par[2], par[3],
920 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
921
922
923 Float_t dist5;
924
925 dist5 = (- height + height5) /2.0 + height1 + height2 + height3 + height4;
926
927 par[0] = half_thick_qua5 - thick_alu;
928 par[3] = height5 / 2.0 - thick_alu;
929 par[4] = TMath::Tan(theta) * r4 - thick_alu;
930 par[5] = TMath::Tan(theta) * r5 - thick_alu;
931 par[7] = height5 / 2.0 - thick_alu;
932 par[8] = TMath::Tan(theta) * r4 - thick_alu;
933 par[9] = TMath::Tan(theta) * r5 - thick_alu;
934
935
936 TTRAP *V0R5 = new TTRAP("V0R5", "V0R5", "void", par[0], par[1], par[2], par[3],
937 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
938
939
940 Float_t phi;
61874e87 941 Float_t phi_deg= 180./6.;
47890cd3 942 Float_t phi_rad;
943 Float_t xdet,ydet;
61874e87 944 Int_t n_detec_R = 1;
945
47890cd3 946 char NameNode[12];
947
948
61874e87 949 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
47890cd3 950 {
951
952 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
953
954 phi_rad = phi*pi/180.;
955 xdet = dist0*TMath::Sin(phi_rad);
956 ydet = dist0*TMath::Cos(phi_rad);
957
958
61874e87 959 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 960
961 V0Rnode->cd();
962 V0Rnode0 = new TNode(NameNode,NameNode,V0R0,-xdet,ydet, offset + half_thick_qua1,mat920);
963 V0Rnode0->SetLineColor(kColorVZERO);
964 fNodes->Add(V0Rnode0);
61874e87 965 n_detec_R++;
47890cd3 966
61874e87 967 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 968 V0Rnode0->cd();
969 V0Rnode1 = new TNode(NameNode,NameNode,V0R1,0.0,dist1, 0.0,0);
970 V0Rnode1->SetLineColor(kColorVZERO);
971 fNodes->Add(V0Rnode1);
61874e87 972 n_detec_R++;
47890cd3 973
61874e87 974 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 975 V0Rnode0->cd();
976 V0Rnode2 = new TNode(NameNode,NameNode,V0R2,0.0,dist2, - half_thick_qua1 + half_thick_qua2,0);
977 V0Rnode2->SetLineColor(kColorVZERO);
978 fNodes->Add(V0Rnode2);
61874e87 979 n_detec_R++;
47890cd3 980
981
61874e87 982 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 983 V0Rnode0->cd();
984 V0Rnode3 = new TNode(NameNode,NameNode,V0R3,0.0,dist3, - half_thick_qua1 + half_thick_qua3,0);
985 V0Rnode3->SetLineColor(kColorVZERO);
986 fNodes->Add(V0Rnode3);
61874e87 987 n_detec_R++;
47890cd3 988
61874e87 989 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 990 V0Rnode0->cd();
991 V0Rnode4 = new TNode(NameNode,NameNode,V0R4,0.0,dist4, - half_thick_qua1 + half_thick_qua4,0);
992 V0Rnode4->SetLineColor(kColorVZERO);
993 fNodes->Add(V0Rnode4);
61874e87 994 n_detec_R++;
47890cd3 995
61874e87 996 sprintf(NameNode,"SUBDER%d",n_detec_R);
47890cd3 997 V0Rnode0->cd();
998 V0Rnode5 = new TNode(NameNode,NameNode,V0R5,0.0,dist5, - half_thick_qua1 + half_thick_qua5,0);
999 V0Rnode5->SetLineColor(kColorVZERO);
1000 fNodes->Add(V0Rnode5);
61874e87 1001 n_detec_R++;
47890cd3 1002
1003 V0Rnode0->SetVisibility(2);
1004
1005 }
47890cd3 1006
47890cd3 1007
61874e87 1008// Left side of VZERO :
47890cd3 1009
47890cd3 1010
61874e87 1011 Float_t dist0_left;
1012 Float_t r0_left = 4.3;
1013 Float_t height1_left = 2.6;
1014 Float_t height2_left = 4.1;
1015 Float_t height3_left = 6.4;
1016 Float_t height4_left = 10.2;
1017 Float_t height5_left = 16.9;
1018 Float_t height_left = height1_left + height2_left + height3_left
1019 + height4_left + height5_left;
1020 Float_t r5_left = r0_left + height_left;
47890cd3 1021
61874e87 1022 partube[0] = r0_left;
1023 partube[1] = (r5_left) / TMath::Cos(theta);
1024 partube[2] = fThickness1/2.0;
47890cd3 1025
61874e87 1026 TTUBE *V0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
1027
1028 Top->cd();
1029
1030 V0Lnode = new TNode("V0LE","V0LE",V0LE,0.0,0.0,-350.0-fThickness1/2.0,0);
1031
1032 V0Lnode->SetLineColor(kBlue);
1033 fNodes->Add(V0Lnode);
1034
1035 V0Lnode->SetVisibility(2);
1036
1037 dist0_left = r0_left + height_left / 2.0;
1038 thick_alu = 2.0*half_thick_alu;
1039
1040 par[0] = half_thick_qua1;
1041 par[1] = 0.0;
1042 par[2] = 0.0;
1043 par[3] = height_left / 2.0 ;
1044 par[4] = TMath::Tan(theta) * r0_left;
1045 par[5] = TMath::Tan(theta) * r5_left;
1046 par[6] = 0.0;
1047 par[7] = height_left / 2.0 ;
1048 par[8] = TMath::Tan(theta) * r0_left;
1049 par[9] = TMath::Tan(theta) * r5_left;
1050 par[10] = 0.0;
1051
1052 TTRAP *V0L0 = new TTRAP("V0L0", "V0L0", "void", par[0], par[1], par[2], par[3],
1053 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
1054
1055
1056 Float_t dist1_left;
1057 Float_t r1_left;
1058 Float_t offset_left;
1059
1060 dist1_left = (- height_left + height1_left) /2.0;
1061 r1_left = r0_left + height1_left;
1062 offset_left = - fThickness1/2.0 + 0.1;
1063
1064 par[0] = half_thick_qua1 - thick_alu;
1065 par[3] = height1_left / 2.0 - thick_alu;
1066 par[4] = TMath::Tan(theta) * r0_left - thick_alu;
1067 par[5] = TMath::Tan(theta) * r1_left- thick_alu;
1068 par[7] = height1_left / 2.0 - thick_alu;
1069 par[8] = TMath::Tan(theta) * r0_left - thick_alu;
1070 par[9] = TMath::Tan(theta) * r1_left - thick_alu;
1071
1072 TTRAP *V0L1 = new TTRAP("V0L1", "V0L1", "void", par[0], par[1], par[2], par[3],
1073 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
47890cd3 1074
61874e87 1075 Float_t dist2_left;
1076 Float_t r2_left;
47890cd3 1077
61874e87 1078 dist2_left = (- height_left + height2_left) /2.0 + height1_left;
1079 r2_left = r1_left + height2_left;
1080
1081 par[0] = half_thick_qua1 - thick_alu;
1082 par[3] = height2_left / 2.0 - thick_alu;
1083 par[4] = TMath::Tan(theta) * r1_left - thick_alu;
1084 par[5] = TMath::Tan(theta) * r2_left - thick_alu;
1085 par[7] = height2_left / 2.0 - thick_alu;
1086 par[8] = TMath::Tan(theta) * r1_left - thick_alu;
1087 par[9] = TMath::Tan(theta) * r2_left - thick_alu;
47890cd3 1088
61874e87 1089 TTRAP *V0L2 = new TTRAP("V0L2", "V0L2", "void", par[0], par[1], par[2], par[3],
1090 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
47890cd3 1091
47890cd3 1092
61874e87 1093
1094 Float_t dist3_left;
1095 Float_t r3_left;
1096
1097 dist3_left = (- height_left + height3_left) /2.0 + height1_left + height2_left;
1098 r3_left = r2_left + height3_left;
1099
1100 par[0] = half_thick_qua1 - thick_alu;
1101 par[3] = height3_left / 2.0 - thick_alu;
1102 par[4] = TMath::Tan(theta) * r2_left - thick_alu;
1103 par[5] = TMath::Tan(theta) * r3_left - thick_alu;
1104 par[7] = height3_left / 2.0 - thick_alu;
1105 par[8] = TMath::Tan(theta) * r2_left - thick_alu;
1106 par[9] = TMath::Tan(theta) * r3_left - thick_alu;
1107
1108 TTRAP *V0L3 = new TTRAP("V0L3", "V0L3", "void", par[0], par[1], par[2], par[3],
1109 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
1110
1111
1112 Float_t dist4_left;
1113 Float_t r4_left;
1114
1115 dist4_left = (- height_left + height4_left) /2.0 + height1_left
1116 + height2_left + height3_left;
1117 r4_left = r3_left + height4_left;
1118
1119 par[0] = half_thick_qua1 - thick_alu;
1120 par[3] = height4_left / 2.0 - thick_alu;
1121 par[4] = TMath::Tan(theta) * r3_left - thick_alu;
1122 par[5] = TMath::Tan(theta) * r4_left - thick_alu;
1123 par[7] = height4_left / 2.0 - thick_alu;
1124 par[8] = TMath::Tan(theta) * r3_left - thick_alu;
1125 par[9] = TMath::Tan(theta) * r4_left - thick_alu;
1126
1127 TTRAP *V0L4 = new TTRAP("V0L4", "V0L4", "void", par[0], par[1], par[2], par[3],
1128 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
1129
47890cd3 1130
61874e87 1131 Float_t dist5_left;
47890cd3 1132
61874e87 1133
1134 dist5_left = (- height_left + height5_left) /2.0 + height1_left
1135 + height2_left + height3_left + height4_left;
47890cd3 1136
61874e87 1137
1138 par[0] = half_thick_qua1 - thick_alu;
1139 par[3] = height5_left / 2.0 - thick_alu;
1140 par[4] = TMath::Tan(theta) * r4_left - thick_alu;
1141 par[5] = TMath::Tan(theta) * r5_left - thick_alu;
1142 par[7] = height5_left / 2.0 - thick_alu;
1143 par[8] = TMath::Tan(theta) * r4_left - thick_alu;
1144 par[9] = TMath::Tan(theta) * r5_left - thick_alu;
1145
1146 TTRAP *V0L5 = new TTRAP("V0L5", "V0L5", "void", par[0], par[1], par[2], par[3],
1147 par[4], par[5], par[6], par[7], par[8], par[9], par[10]);
47890cd3 1148
47890cd3 1149
61874e87 1150 Int_t n_detec_L = 1;
1151
1152 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
1153 {
47890cd3 1154
61874e87 1155 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
47890cd3 1156
61874e87 1157 phi_rad = phi*pi/180.;
1158 xdet = dist0_left*TMath::Sin(phi_rad);
1159 ydet = dist0_left*TMath::Cos(phi_rad);
1160
1161
1162 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1163
1164 V0Lnode->cd();
1165 V0Lnode0 = new TNode(NameNode,NameNode,V0L0,-xdet,ydet, offset_left + half_thick_qua1,mat920);
1166 V0Lnode0->SetLineColor(kColorVZERO);
1167 fNodes->Add(V0Lnode0);
1168 n_detec_L++;
1169
1170 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1171 V0Lnode0->cd();
1172 V0Lnode1 = new TNode(NameNode,NameNode,V0L1,0.0,dist1_left, 0.0,0);
1173 V0Lnode1->SetLineColor(kColorVZERO);
1174 fNodes->Add(V0Lnode1);
1175 n_detec_L++;
1176
1177 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1178 V0Lnode0->cd();
1179 V0Lnode2 = new TNode(NameNode,NameNode,V0L2,0.0,dist2_left, 0.0,0);
1180 V0Lnode2->SetLineColor(kColorVZERO);
1181 fNodes->Add(V0Lnode2);
1182 n_detec_L++;
1183
1184
1185 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1186 V0Lnode0->cd();
1187 V0Lnode3 = new TNode(NameNode,NameNode,V0L3,0.0,dist3_left, 0.0,0);
1188 V0Lnode3->SetLineColor(kColorVZERO);
1189 fNodes->Add(V0Lnode3);
1190 n_detec_L++;
1191
1192 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1193 V0Lnode0->cd();
1194 V0Lnode4 = new TNode(NameNode,NameNode,V0L4,0.0,dist4_left, 0.0,0);
1195 V0Lnode4->SetLineColor(kColorVZERO);
1196 fNodes->Add(V0Lnode4);
1197 n_detec_L++;
47890cd3 1198
61874e87 1199 sprintf(NameNode,"SUBDEL%d",n_detec_L);
1200 V0Lnode0->cd();
1201 V0Lnode5 = new TNode(NameNode,NameNode,V0L5,0.0,dist5_left, 0.0,0);
1202 V0Lnode5->SetLineColor(kColorVZERO);
1203 fNodes->Add(V0Lnode5);
1204 n_detec_L++;
47890cd3 1205
61874e87 1206 V0Lnode0->SetVisibility(2);
47890cd3 1207
61874e87 1208 }
47890cd3 1209
61874e87 1210
1211}
47890cd3 1212
1213
1214//------------------------------------------------------------------------
1215void AliVZEROv0::CreateMaterials()
1216{
61874e87 1217 Int_t i;
47890cd3 1218
61874e87 1219 printf("\n");
1220 for(i=0;i<30;i++) printf("*");
1221 printf(" VZERO create materials ");
1222 for(i=0;i<30;i++) printf("*");
1223 printf("\n");
1224
47890cd3 1225
47890cd3 1226 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,
1227 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
61874e87 1228
1229
1230 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,
1231 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
47890cd3 1232
1233 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
1234 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
61874e87 1235 1.662295, 1.68337 };
47890cd3 1236
1237 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
1238 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
1239
1240 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
1241
1242
1243 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
61874e87 1244
1245
47890cd3 1246 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,
1247 1e-4,1e-4,1e-4,1e-4 };
1248 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
61874e87 1249
47890cd3 1250
1251 Int_t *idtmed = fIdtmed->GetArray()-2999;
1252
47890cd3 1253
1254// Parameters related to Quarz (SiO2) :
1255
1256 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
1257 Int_t nlmatqua;
1258
1259 aqua[0] = 28.09;
1260 aqua[1] = 16.;
1261 zqua[0] = 14.;
1262 zqua[1] = 8.;
1263 densqua = 2.64;
1264 nlmatqua = -2;
1265 wmatqua[0] = 1.;
1266 wmatqua[1] = 2.;
1267
1268// Parameters related to aluminum sheets :
1269
1270 Float_t aal = 26.98;
1271 Float_t zal = 13.00;
1272 Float_t densal= 2.7;
1273 Float_t radlal= 8.9;
1274
1275// Parameters related to scintillator CH :
1276
1277 Float_t ascin[2] = {1.01,12.01};
1278 Float_t zscin[2] = {1,6};
1279 Float_t wscin[2] = {1,1};
1280 Float_t denscin = 1.03;
1281
1282// Definition of materials :
1283
61874e87 1284 AliMaterial( 1, "AIR A$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
1285 AliMaterial(11, "AIR I$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
1286 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
47890cd3 1287 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
61874e87 1288 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
1289 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
47890cd3 1290
1291
1292 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
1293
1294
1295 Int_t ISXFLD = gAlice->Field()->Integ();
1296 Float_t SXMGMX = gAlice->Field()->Max();
1297
1298 Float_t tmaxfd, stemax, deemax, epsil, stmin;
1299
61874e87 1300 tmaxfd = 10.;
1301 stemax = 0.1;
1302 deemax = 0.1;
1303 epsil = 0.001;
1304 stmin = 0.001;
1305
1306 printf(" \n");
1307 printf(" StepQua, StepAlu = %f %f \n",fMaxStepQua,fMaxStepAlu);
1308 printf(" DeStepQua, DeStepAlu = %f %f \n",fMaxDestepQua,fMaxDestepAlu);
1309 printf(" \n");
1310
47890cd3 1311
1312// Active Air :
61874e87 1313 AliMedium(1, "ACTIVE AIR$", 1, 1, ISXFLD, SXMGMX,
1314 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
47890cd3 1315
1316// Inactive air :
1317
61874e87 1318 AliMedium(11, "INACTIVE AIR$", 11, 0, ISXFLD, SXMGMX,
1319 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
47890cd3 1320
61874e87 1321 AliMedium(2, "CARBON$ ", 2, 1, ISXFLD, SXMGMX,
1322 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
47890cd3 1323
61874e87 1324 AliMedium(3, "QUARZ$", 3, 1, ISXFLD, SXMGMX,
1325 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
47890cd3 1326
61874e87 1327 AliMedium(4,"ALUMINUM1$",4, 1, ISXFLD, SXMGMX,
1328 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
1329
1330
1331 AliMedium(5,"ALUMINUM2$",5, 1, ISXFLD, SXMGMX,
1332 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
1333
1334 AliMedium(6,"SCINTILLATOR$",6, 1, ISXFLD, SXMGMX, 10., .01, 1., .003, .003, 0, 0);
47890cd3 1335
1336 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
1337 gMC->Gstpar(idtmed[3000], "HADR", 1.);
1338 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
1339 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
1340
1341 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
1342 gMC->Gstpar(idtmed[3001], "HADR", 1.);
1343 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
1344 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
1345
1346 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
1347 gMC->Gstpar(idtmed[3002], "HADR", 1.);
1348 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
61874e87 1349 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
1350 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
1351 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
47890cd3 1352
1353 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
1354 gMC->Gstpar(idtmed[3003], "HADR", 1.);
1355 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
1356 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
1357
1358 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
1359 gMC->Gstpar(idtmed[3004], "HADR", 1.);
1360 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
1361 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
61874e87 1362 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
1363 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
47890cd3 1364
1365 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
1366 gMC->Gstpar(idtmed[3005], "HADR", 1.);
1367 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
1368 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
1369
7f40b0b2 1370 gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
1371 gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
47890cd3 1372
61874e87 1373
47890cd3 1374}
1375//---------------------------------------------------------------------
1376void AliVZEROv0::DrawModule()
1377{
1378
1379// Drawing is done in DrawVZERO.C
1380
1381 Int_t i;
1382
1383 printf("\n");
61874e87 1384 for(i=0;i<30;i++) printf("*");
47890cd3 1385 printf(" VZERO DrawModule ");
61874e87 1386 for(i=0;i<30;i++) printf("*");
47890cd3 1387 printf("\n");
1388
1389
1390}
1391
1392//-------------------------------------------------------------------
1393void AliVZEROv0::Init()
1394{
1395// Initialises version 0 of the VZERO Detector
1396// Just prints an information message
1397
61874e87 1398 printf(" VZERO version %d initialized \n",IsVersion());
47890cd3 1399
61874e87 1400// gMC->SetMaxStep(fMaxStepAlu);
1401// gMC->SetMaxStep(fMaxStepQua);
1402
1403// AliVZERO::Init();
1404
47890cd3 1405}
1406
1407//-------------------------------------------------------------------
1408
1409void AliVZEROv0::StepManager()
1410{
1411
61874e87 1412// (Very)Minimal version of StepManager
1413
1414
1415 Int_t copy;
1416 static Int_t vol[4];
1417 static Float_t hits[15];
47890cd3 1418
1419 TLorentzVector pos;
47890cd3 1420
61874e87 1421 TLorentzVector mom;
47890cd3 1422 Float_t theta;
1423 Float_t phi;
47890cd3 1424 Float_t kRaddeg = 180/TMath::Pi();
61874e87 1425 Float_t RingNumber;
1426
1427 Int_t ipart;
47890cd3 1428
61874e87 1429
1430// TGeant3 *geant3 = (TGeant3*) gMC;
1431// Int_t Nphot = geant3->Gckin2()->ngphot;
47890cd3 1432
61874e87 1433
1434// Only charged tracks :
47890cd3 1435
61874e87 1436 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
1437
1438
47890cd3 1439 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
1440 vol[2] = gMC->CurrentVolID(copy);
1441 vol[3] = copy;
1442
61874e87 1443 if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
1444 gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
1445 RingNumber = 1.0;
1446 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
1447 gMC->CurrentVolID(copy) == gMC->VolId("V0L2") )
1448 RingNumber = 2.0;
1449 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
1450 gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
1451 RingNumber = 3.0;
1452 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
1453 gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
1454 RingNumber = 4.0;
1455 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
1456 gMC->CurrentVolID(copy) == gMC->VolId("V0L5") )
1457 RingNumber = 5.0;
1458 else
1459 RingNumber = 0.0;
1460
1461 if (gMC->IsTrackEntering() && RingNumber > 0.5) {
1462
1463 gMC->TrackPosition(pos);
1464
1465 gMC->TrackMomentum(mom);
1466 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1467 Double_t Pt = TMath::Sqrt(tc);
1468 Double_t Pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
47890cd3 1469
61874e87 1470 theta = Float_t(TMath::ATan2(Pt,Double_t(mom[2])))*kRaddeg;
1471 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1472
1473 ipart = gMC->TrackPid();
1474
1475 hits[0] = pos[0];
1476 hits[1] = pos[1];
1477 hits[2] = pos[2];
1478 hits[3] = ipart;
1479
1480// Float_t ttime = gMC->TrackTime();
1481// hits[4] = ttime*1e9;
1482
1483 hits[4] = gMC->TrackTime();
1484 hits[5] = gMC->TrackCharge();
1485 hits[6] = theta;
1486 hits[7] = phi;
1487 hits[8] = RingNumber;
1488
1489 hits[9] = Pt;
1490 hits[10] = Pmom;
1491 hits[11] = mom[0];
1492 hits[12] = mom[1];
1493 hits[13] = mom[2];
1494
1495
1496 AddHit(gAlice->CurrentTrack(), vol, hits);
1497
1498 }
1499
47890cd3 1500}
1501
61874e87 1502//_____________________________________________________________________________
1503void AliVZEROv0::AddHit(Int_t track, Int_t *vol, Float_t *hits)
47890cd3 1504{
61874e87 1505 //
1506 // Add a VZERO hit
1507 //
47890cd3 1508
61874e87 1509 TClonesArray &lhits = *fHits;
1510 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
47890cd3 1511}
1512
1513//---------------------------------------------------------------------
61874e87 1514void AliVZEROv0::AddDigits(Int_t *tracks, Int_t* digits)
47890cd3 1515{
1516
1517 TClonesArray &ldigits = *fDigits;
47890cd3 1518 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
47890cd3 1519}
1520
47890cd3 1521//---------------------------------------------------------------------
1522void AliVZEROv0::MakeBranch(Option_t *option)
1523{
1524
1525 // Creates new branches in the current Root Tree
1526
1527
1528 char branchname[10];
1529 sprintf(branchname,"%s",GetName());
61874e87 1530 printf(" fBufferSize = %d \n",fBufferSize);
47890cd3 1531
660318ca 1532 const char *H = strstr(option,"H");
47890cd3 1533
1534 if (fHits && gAlice->TreeH() && H) {
1535 gAlice->TreeH()->Branch(branchname,&fHits, fBufferSize);
1536 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1537 }
1538
660318ca 1539 const char *D = strstr(option,"D");
47890cd3 1540 //
1541 if (fDigits && gAlice->TreeD() && D) {
1542 gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1543 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);
61874e87 1544 }
1545
47890cd3 1546}