1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //////////////////////////////////////////////////////////////////////
19 // (V-zero) detector version 2 as designed by the Lyon group //
20 // All comments should be sent to Brigitte CHEYNIS : //
21 // b.cheynis@ipnl.in2p3.fr //
22 // Geometry of the 19th of april 2002 //
23 // (circular instead of trapezoidal shapes as in previous versions //
25 //////////////////////////////////////////////////////////////////////
28 #include <TGeometry.h>
42 #include <TClonesArray.h>
45 #include <Riostream.h>
47 #include "AliVZEROv2.h"
50 #include "AliVZEROhit.h"
51 #include "AliVZEROdigit.h"
52 #include <Riostream.h>
53 #include <Riostream.h>
57 #include "TObjectTable.h"
60 #include "TLorentzVector.h"
64 //--------------------------------------------------------------------
65 AliVZEROv2:: AliVZEROv2():AliVZERO()
70 //--------------------------------------------------------------------
71 AliVZEROv2::AliVZEROv2(const char *name, const char *title):
75 // Standard constructor for V-zeroR Detector (right part) version 0
81 for(i=0;i<30;i++) printf("*");
82 printf(" Create VZERO object ");
83 for(i=0;i<30;i++) printf("*");
88 //-------------------------------------------------------------------------
89 void AliVZEROv2::CreateGeometry()
92 // Creates the GEANT geometry of the V-zero Detector version 2
98 for(i=0;i<30;i++) printf("*");
99 printf(" Create VZERO Geometry ");
100 for(i=0;i<30;i++) printf("*");
104 Int_t *idtmed = fIdtmed->GetArray()-2999;
114 Float_t height1, height2, height3, height4, height5;
118 Float_t half_thick_qua;
122 Float_t pi = TMath::Pi();
125 height1 = 2.0; // height of cell 1, in cm
126 height2 = 3.2; // height of cell 2, in cm
127 height3 = 4.9; // height of cell 3, in cm
128 height4 = 7.5; // height of cell 4, in cm
129 height5 = 12.0; // height of cell 5, in cm
131 theta = pi/6.0/2.0; // half angular opening = 15 degrees
134 half_thick_qua = fThickness1/2.0; // half thickness of elementary cell (inner ring)
137 zdet = 86.9 +fThickness/2.0; // distance to vertex (along Z axis)
138 r0 = 4.0; // closest distance to center of the beam pipe
139 height = height1 + height2 + height3 + height4 + height5;
143 // Creation of mother volume V0LE - left part - :
144 // Entrance face at -350.0 cm ...
150 partube[2] = fThickness1/2.0;
152 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
155 // Creation of five rings - left part - :
156 // Entrance face at -350.0 cm ...
158 // Mother volume V0L0 in which will be set 5 scintillator cells
163 Float_t r0_left = 4.3;
164 Float_t height1_left = 2.6;
165 Float_t height2_left = 4.1;
166 Float_t height3_left = 6.4;
167 Float_t height4_left = 10.2;
168 Float_t height5_left = 16.9;
169 Float_t height_left = height1_left + height2_left + height3_left
170 + height4_left + height5_left;
171 Float_t r5_left = r0_left + height_left;
174 partubs[0] = r0_left;
175 partubs[1] = r5_left;
176 partubs[2] = fThickness1/2.0;
177 partubs[3] = 90.0-15.0;
178 partubs[4] = 120.0-15.0;
180 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
182 Float_t r1_left = r0_left + height1_left;
184 partubs[0] = r0_left;
185 partubs[1] = r1_left;
187 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
188 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
190 Float_t r2_left = r1_left + height2_left;
192 partubs[0] = r1_left;
193 partubs[1] = r2_left;
195 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
196 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
198 Float_t r3_left = r2_left + height3_left;
200 partubs[0] = r2_left;
201 partubs[1] = r3_left;
203 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
204 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
206 Float_t r4_left = r3_left + height4_left;
208 partubs[0] = r3_left;
209 partubs[1] = r4_left;
212 gMC->Gsvolu("V0L4","TUBS",idtmed[3005],partubs,5); // quartz volume
213 gMC->Gspos("V0L4",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
215 partubs[0] = r4_left;
216 partubs[1] = r5_left;
217 partubs[3] = 90.0-15.0;
218 partubs[4] = 120.0-30.0;
221 gMC->Gsvolu("V0L5","TUBS",idtmed[3005],partubs,5); // quartz volume
222 gMC->Gspos("V0L5",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
225 partubs[3] = 120.0-30.0;
226 partubs[4] = 120.0-15.0;
229 gMC->Gsvolu("V0L6","TUBS",idtmed[3005],partubs,5); // quartz volume
230 gMC->Gspos("V0L6",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
233 // Creation of mother volume V0RI - right part - :
236 partube[0] = r0 - 0.2;
237 partube[1] = r5 + 1.0;
238 partube[2] = fThickness/2.0;
241 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
243 // Creation of carbon lids (1 mm thick) to keep V0RI box shut...
248 partube[2] = +0.1/2.0;
251 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
252 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
253 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
255 // Creation of aluminum rings to maintain the V0RI pieces ...
257 partube[0] = r0 - 0.2;
259 partube[2] = +fThickness/2.0;
262 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
263 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
266 partube[1] = r5 + 1.0;
267 partube[2] = +fThickness/2.0;
270 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
271 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
273 // Mother volume V0R0 in which will be set 5 scintillator cells
278 partubs[2] = fThickness/2.0;
279 partubs[3] = 90.0-15.0;
280 partubs[4] = 120.0-15.0;
282 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
285 // Elementary cell of ring 1 :
286 // (the cells will be shifted by 3 mm to output fibers)
288 Float_t offset_fibers = 0.3;
289 Float_t offset = -fThickness/2.0 + 0.1;
290 Float_t r1 = r0 + height1;
294 partubs[2] = fThickness1/2.0;
296 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
297 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , 0.0, 0,"ONLY");
299 // Elementary cell of ring 2 :
301 Float_t r2 = r1 + height2;
306 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
307 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , offset_fibers, 0,"ONLY");
310 // Elementary cell of ring 3 :
312 Float_t r3 = r2 + height3;
317 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
318 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , 2.0 * offset_fibers, 0,"ONLY");
320 // Elementary cell of ring 4 :
322 Float_t r4 = r3 + height4 ;
327 gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5); // scintillator volume
328 gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 , 3.0 * offset_fibers, 0,"ONLY");
330 // Elementary cells of ring 5 :
334 partubs[3] = 90.0-15.0;
335 partubs[4] = 120.0-30.0;
338 gMC->Gsvolu("V0R5","TUBS",idtmed[3005],partubs,5); // scintillator volume
339 gMC->Gspos("V0R5",1,"V0R0", 0.0, 0.0 , 4.0 * offset_fibers, 0,"ONLY");
342 partubs[3] = 120.0-30.0;
343 partubs[4] = 120.0-15.0;
346 gMC->Gsvolu("V0R6","TUBS",idtmed[3005],partubs,5); // scintillator volume
347 gMC->Gspos("V0R6",1,"V0R0", 0.0, 0.0 , 4.0 * offset_fibers, 0,"ONLY");
350 Float_t phi_deg = 180./6.;
354 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
356 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
357 gMC->Gspos("V0R0",n_detec_R,"V0RI",0.0,
358 0.0,offset + half_thick_qua,idrotm[902],"ONLY");
363 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,zdet,0,"ONLY");
365 n_cells_R = (n_detec_R - 1) * 5;
367 printf(" Number of cells on Right side = %d\n", n_cells_R);
371 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
373 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
374 gMC->Gspos("V0L0",n_detec_L,"V0LE",0.0,
375 0.0,0.0,idrotm[902],"ONLY");
380 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,-350.0-fThickness1/2.0,0,"ONLY");
382 n_cells_L = (n_detec_L - 1) * 5;
384 printf(" Number of cells on Left side = %d\n\n", n_cells_L);
391 //_____________________________________________________________________________
392 void AliVZEROv2::BuildGeometry()
395 // Builds simple ROOT TNode geometry for event display
401 for(i=0;i<30;i++) printf("*");
402 printf(" VZERO BuildGeometry ");
403 for(i=0;i<30;i++) printf("*");
408 TNode *V0Rnode, *V0Rnode0, *V0Rnode6 , *V0Rnode7, *V0Rnode8, *V0Rnode9;
409 TNode *V0Rnode1, *V0Rnode2, *V0Rnode3, *V0Rnode4, *V0Rnode5;
410 TNode *V0Lnode, *V0Lnode0;
411 TNode *V0Lnode1, *V0Lnode2, *V0Lnode3, *V0Lnode4, *V0Lnode5, *V0Lnode6;
413 const int kColorVZERO = kGreen;
415 Top = gAlice->GetGeometry()->GetNode("alice");
417 Float_t height1, height2, height3, height4, height5;
421 Float_t half_thick_qua;
424 Float_t pi = TMath::Pi();
427 height1 = 2.0; // height of cell 1, in cm
428 height2 = 3.2; // height of cell 2, in cm
429 height3 = 4.9; // height of cell 3, in cm
430 height4 = 7.5; // height of cell 4, in cm
431 height5 = 12.0; // height of cell 5, in cm
435 half_thick_qua = fThickness1/2.0;
437 zdet = 86.9 +fThickness/2.0;
439 height = height1 + height2 + height3 + height4 + height5;
446 partube[0] = r0 - 0.2;
447 partube[1] = r5 + 1.0;
448 partube[2] = fThickness/2.0;
450 TTUBE *V0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
454 V0Rnode = new TNode("V0RI","V0RI",V0RI,0.0,0.0,+zdet,0);
456 V0Rnode->SetLineColor(kBlue);
457 fNodes->Add(V0Rnode);
459 V0Rnode->SetVisibility(2);
462 // Rondelles de carbone (epaisseur 1 mm) de maintien des cellules ...
467 partube[2] = +0.1/2.0;
469 TTUBE *V0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
472 V0Rnode6 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0, fThickness/2.0-partube[2],0);
473 V0Rnode6->SetLineColor(kYellow);
474 fNodes->Add(V0Rnode6);
476 V0Rnode7 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
477 V0Rnode7->SetLineColor(kYellow);
478 fNodes->Add(V0Rnode7);
480 partube[0] = r0 - 0.2;
482 partube[2] = +fThickness/2.0;
484 TTUBE *V0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
488 V0Rnode8 = new TNode("V0IR", "V0IR",V0IR,0.0,0.0,0.0,0);
489 V0Rnode8->SetLineColor(kYellow);
490 fNodes->Add(V0Rnode8);
493 partube[1] = r5 + 1.0;
494 partube[2] = +fThickness/2.0;
496 TTUBE *V0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
499 V0Rnode9 = new TNode("V0ER", "V0ER",V0ER,0.0,0.0,0.0,0);
500 V0Rnode9->SetLineColor(kYellow);
501 fNodes->Add(V0Rnode9);
507 partubs[2] = fThickness/2.0;
508 partubs[3] = 90.0-15.0;
509 partubs[4] = 120.0-15.0;
512 TTUBS *V0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
513 partubs[3], partubs[4]);
515 V0R0->SetNumberOfDivisions(ndiv);
516 V0R0->SetLineColor(7);
518 Float_t r1 = r0 + height1;
519 Float_t offset = - fThickness/2.0 + 0.1;
520 Float_t offset_fibers = 0.3;
524 partubs[2] = fThickness1/2.0;
526 TTUBS *V0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
527 partubs[3], partubs[4]);
529 V0R1->SetNumberOfDivisions(ndiv);
531 Float_t r2 = r1 + height2;
537 TTUBS *V0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
538 partubs[3], partubs[4]);
540 V0R2->SetNumberOfDivisions(ndiv);
542 Float_t r3 = r2 + height3;
548 TTUBS *V0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
549 partubs[3], partubs[4]);
550 V0R3->SetNumberOfDivisions(ndiv);
552 Float_t r4 = r3 + height4;
557 TTUBS *V0R4 = new TTUBS("V0R4", "V0R4", "void", partubs[0], partubs[1], partubs[2],
558 partubs[3], partubs[4]);
560 V0R4->SetNumberOfDivisions(ndiv);
564 partubs[3] = 90.0-15.0;
565 partubs[4] = 120.0-30.0;
567 TTUBS *V0R5 = new TTUBS("V0R5", "V0R5", "void", partubs[0], partubs[1], partubs[2],
568 partubs[3], partubs[4]);
571 V0R5->SetNumberOfDivisions(ndiv);
573 partubs[3] = 120.0-30.0;
574 partubs[4] = 120.0-15.0;
576 TTUBS *V0R6 = new TTUBS("V0R6", "V0R6", "void", partubs[0], partubs[1], partubs[2],
577 partubs[3], partubs[4]);
580 V0R6->SetNumberOfDivisions(ndiv);
584 Float_t phi_deg= 180./6.;
592 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
596 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
599 sprintf(NameNode,"SUBDER%d",n_detec_R);
602 V0Rnode0 = new TNode(NameNode,NameNode,V0R0,0.0,0.0, offset + half_thick_qua,mat920);
603 V0Rnode0->SetLineColor(kColorVZERO);
604 fNodes->Add(V0Rnode0);
607 sprintf(NameNode,"SUBDER%d",n_detec_R);
609 V0Rnode1 = new TNode(NameNode,NameNode,V0R1,0.0,0.0, 0.0,0);
610 V0Rnode1->SetLineColor(kColorVZERO);
611 fNodes->Add(V0Rnode1);
614 sprintf(NameNode,"SUBDER%d",n_detec_R);
616 V0Rnode2 = new TNode(NameNode,NameNode,V0R2,0.0,0.0, offset_fibers,0);
617 V0Rnode2->SetLineColor(kColorVZERO);
618 fNodes->Add(V0Rnode2);
622 sprintf(NameNode,"SUBDER%d",n_detec_R);
624 V0Rnode3 = new TNode(NameNode,NameNode,V0R3,0.0,0.0, 2.0*offset_fibers,0);
625 V0Rnode3->SetLineColor(kColorVZERO);
626 fNodes->Add(V0Rnode3);
629 sprintf(NameNode,"SUBDER%d",n_detec_R);
631 V0Rnode4 = new TNode(NameNode,NameNode,V0R4,0.0,0.0, 3.0*offset_fibers,0);
632 V0Rnode4->SetLineColor(kColorVZERO);
633 fNodes->Add(V0Rnode4);
636 sprintf(NameNode,"SUBDER%d",n_detec_R);
638 V0Rnode5 = new TNode(NameNode,NameNode,V0R5,0.0,0.0, 4.0*offset_fibers,0);
639 V0Rnode5->SetLineColor(kColorVZERO);
640 fNodes->Add(V0Rnode5);
643 sprintf(NameNode,"SUBDER%d",n_detec_R);
645 V0Rnode6 = new TNode(NameNode,NameNode,V0R6,0.0,0.0, 4.0*offset_fibers,0);
646 V0Rnode6->SetLineColor(kColorVZERO);
647 fNodes->Add(V0Rnode6);
650 V0Rnode0->SetVisibility(2);
656 // Left side of VZERO :
659 Float_t r0_left = 4.3;
660 Float_t height1_left = 2.6;
661 Float_t height2_left = 4.1;
662 Float_t height3_left = 6.4;
663 Float_t height4_left = 10.2;
664 Float_t height5_left = 16.9;
665 Float_t height_left = height1_left + height2_left + height3_left
666 + height4_left + height5_left;
667 Float_t r5_left = r0_left + height_left;
669 partube[0] = r0_left;
670 partube[1] = r5_left;
671 partube[2] = fThickness1/2.0;
673 TTUBE *V0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
677 V0Lnode = new TNode("V0LE","V0LE",V0LE,0.0,0.0,-350.0-fThickness1/2.0,0);
679 V0Lnode->SetLineColor(kBlue);
680 fNodes->Add(V0Lnode);
682 V0Lnode->SetVisibility(2);
684 partubs[0] = r0_left;
685 partubs[1] = r5_left;
686 partubs[2] = fThickness1/2.0;
687 partubs[3] = 90.0-15.0;
688 partubs[4] = 120.0-15.0;
690 TTUBS *V0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
691 partubs[3], partubs[4]);
693 V0L0->SetNumberOfDivisions(ndiv);
694 V0L0->SetLineColor(7);
697 offset_left = - fThickness1/2.0;
699 Float_t r1_left = r0_left + height1_left;
701 partubs[0] = r0_left;
702 partubs[1] = r1_left;
704 TTUBS *V0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
705 partubs[3], partubs[4]);
707 V0L1->SetNumberOfDivisions(ndiv);
709 Float_t r2_left = r1_left + height2_left;
711 partubs[0] = r1_left;
712 partubs[1] = r2_left;
714 TTUBS *V0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
715 partubs[3], partubs[4]);
717 V0L2->SetNumberOfDivisions(ndiv);
719 Float_t r3_left = r2_left + height3_left;
721 partubs[0] = r2_left;
722 partubs[1] = r3_left;
724 TTUBS *V0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
725 partubs[3], partubs[4]);
726 V0L3->SetNumberOfDivisions(ndiv);
728 Float_t r4_left = r3_left + height4_left;
730 partubs[0] = r3_left;
731 partubs[1] = r4_left;
733 TTUBS *V0L4 = new TTUBS("V0L4", "V0L4", "void", partubs[0], partubs[1], partubs[2],
734 partubs[3], partubs[4]);
736 V0L4->SetNumberOfDivisions(ndiv);
738 partubs[0] = r4_left;
739 partubs[1] = r5_left;
740 partubs[3] = 90.0-15.0;
741 partubs[4] = 120.0-30.0;
743 TTUBS *V0L5 = new TTUBS("V0L5", "V0L5", "void", partubs[0], partubs[1], partubs[2],
744 partubs[3], partubs[4]);
747 V0L5->SetNumberOfDivisions(ndiv);
749 partubs[3] = 120.0-30.0;
750 partubs[4] = 120.0-15.0;
752 TTUBS *V0L6 = new TTUBS("V0L6", "V0L6", "void", partubs[0], partubs[1], partubs[2],
753 partubs[3], partubs[4]);
756 V0L6->SetNumberOfDivisions(ndiv);
761 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
765 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
768 sprintf(NameNode,"SUBDEL%d",n_detec_L);
771 V0Lnode0 = new TNode(NameNode,NameNode,V0L0,0.0,0.0, offset_left + half_thick_qua,mat920);
772 V0Lnode0->SetLineColor(kColorVZERO);
773 fNodes->Add(V0Lnode0);
776 sprintf(NameNode,"SUBDEL%d",n_detec_L);
778 V0Lnode1 = new TNode(NameNode,NameNode,V0L1,0.0,0.0, 0.0,0);
779 V0Lnode1->SetLineColor(kColorVZERO);
780 fNodes->Add(V0Lnode1);
783 sprintf(NameNode,"SUBDEL%d",n_detec_L);
785 V0Lnode2 = new TNode(NameNode,NameNode,V0L2,0.0,0.0, 0.0,0);
786 V0Lnode2->SetLineColor(kColorVZERO);
787 fNodes->Add(V0Lnode2);
791 sprintf(NameNode,"SUBDEL%d",n_detec_L);
793 V0Lnode3 = new TNode(NameNode,NameNode,V0L3,0.0,0.0, 0.0,0);
794 V0Lnode3->SetLineColor(kColorVZERO);
795 fNodes->Add(V0Lnode3);
798 sprintf(NameNode,"SUBDEL%d",n_detec_L);
800 V0Lnode4 = new TNode(NameNode,NameNode,V0L4,0.0,0.0, 0.0,0);
801 V0Lnode4->SetLineColor(kColorVZERO);
802 fNodes->Add(V0Lnode4);
805 sprintf(NameNode,"SUBDEL%d",n_detec_L);
807 V0Lnode5 = new TNode(NameNode,NameNode,V0L5,0.0,0.0, 0.0,0);
808 V0Lnode5->SetLineColor(kColorVZERO);
809 fNodes->Add(V0Lnode5);
812 sprintf(NameNode,"SUBDEL%d",n_detec_L);
814 V0Lnode6 = new TNode(NameNode,NameNode,V0L6,0.0,0.0, 0.0,0);
815 V0Lnode6->SetLineColor(kColorVZERO);
816 fNodes->Add(V0Lnode6);
819 V0Lnode0->SetVisibility(2);
827 //------------------------------------------------------------------------
828 void AliVZEROv2::CreateMaterials()
833 for(i=0;i<30;i++) printf("*");
834 printf(" VZERO create materials ");
835 for(i=0;i<30;i++) printf("*");
839 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,
840 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
843 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,
844 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
846 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
847 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
850 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
851 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
853 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
856 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
859 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,
860 1e-4,1e-4,1e-4,1e-4 };
861 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
865 Int_t *idtmed = fIdtmed->GetArray()-2999;
867 // TGeant3 *geant3 = (TGeant3*) gMC;
869 // Parameters related to Quarz (SiO2) :
871 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
883 // Parameters related to aluminum sheets :
890 // Parameters related to scintillator CH :
892 Float_t ascin[2] = {1.00794,12.011};
893 Float_t zscin[2] = {1.,6.};
894 Float_t wscin[2] = {1.,1.};
895 Float_t denscin = 1.032;
897 // Definition of materials :
899 AliMaterial( 1, "AIR A$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
900 AliMaterial(11, "AIR I$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
901 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
902 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
903 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
904 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
906 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
909 Int_t ISXFLD = gAlice->Field()->Integ();
910 Float_t SXMGMX = gAlice->Field()->Max();
912 Float_t tmaxfd, stemax, deemax, epsil, stmin;
921 AliMedium(1, "ACTIVE AIR$", 1, 1, ISXFLD, SXMGMX,
922 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
926 AliMedium(11, "INACTIVE AIR$", 11, 0, ISXFLD, SXMGMX,
927 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
929 AliMedium(2, "CARBON$ ", 2, 1, ISXFLD, SXMGMX,
930 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
932 AliMedium(3, "QUARZ$", 3, 1, ISXFLD, SXMGMX,
933 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
935 AliMedium(4,"ALUMINUM1$",4, 1, ISXFLD, SXMGMX,
936 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
939 AliMedium(5,"ALUMINUM2$",5, 1, ISXFLD, SXMGMX,
940 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
942 AliMedium(6,"SCINTILLATOR$",6, 1, ISXFLD, SXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
944 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
945 gMC->Gstpar(idtmed[3000], "HADR", 1.);
946 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
947 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
949 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
950 gMC->Gstpar(idtmed[3001], "HADR", 1.);
951 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
952 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
954 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
955 gMC->Gstpar(idtmed[3002], "HADR", 1.);
956 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
957 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
958 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
959 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
961 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
962 gMC->Gstpar(idtmed[3003], "HADR", 1.);
963 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
964 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
966 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
967 gMC->Gstpar(idtmed[3004], "HADR", 1.);
968 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
969 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
970 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
971 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
973 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
974 gMC->Gstpar(idtmed[3005], "HADR", 1.);
975 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
976 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
977 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
978 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
981 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
982 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
984 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
985 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
989 //---------------------------------------------------------------------
990 void AliVZEROv2::DrawModule()
993 // Drawing is done in DrawVZERO.C
998 for(i=0;i<30;i++) printf("*");
999 printf(" VZERO DrawModule ");
1000 for(i=0;i<30;i++) printf("*");
1006 //-------------------------------------------------------------------
1007 void AliVZEROv2::Init()
1009 // Initialises version 1 of the VZERO Detector
1010 // Just prints an information message
1012 printf(" VZERO version %d initialized \n",IsVersion());
1014 // gMC->SetMaxStep(fMaxStepAlu);
1015 // gMC->SetMaxStep(fMaxStepQua);
1021 //-------------------------------------------------------------------
1023 void AliVZEROv2::StepManager()
1027 static Int_t vol[4];
1028 static Float_t hits[16];
1029 static Float_t eloss, tlength;
1036 Float_t kRaddeg = 180/TMath::Pi();
1040 Float_t destep, step;
1043 // We keep only charged tracks :
1045 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
1048 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
1049 vol[2] = gMC->CurrentVolID(copy);
1053 if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
1054 gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
1056 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
1057 gMC->CurrentVolID(copy) == gMC->VolId("V0L2") )
1059 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
1060 gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
1062 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
1063 gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
1065 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
1066 gMC->CurrentVolID(copy) == gMC->VolId("V0L5") ||
1067 gMC->CurrentVolID(copy) == gMC->VolId("V0L6") ||
1068 gMC->CurrentVolID(copy) == gMC->VolId("V0R6") )
1073 if ( RingNumber > 0.5 ) {
1075 destep = gMC->Edep();
1076 step = gMC->TrackStep();
1081 if ( gMC->IsTrackEntering() ) {
1083 gMC->TrackPosition(pos);
1085 gMC->TrackMomentum(mom);
1086 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1087 Double_t Pt = TMath::Sqrt(tc);
1088 Double_t Pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1089 theta = Float_t(TMath::ATan2(Pt,Double_t(mom[2])))*kRaddeg;
1090 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1092 ipart = gMC->TrackPid();
1099 hits[4] = gMC->TrackTime();
1100 hits[5] = gMC->TrackCharge();
1103 hits[8] = RingNumber;
1116 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1121 AddHit(gAlice->CurrentTrack(), vol, hits);
1132 //_____________________________________________________________________________
1133 void AliVZEROv2::AddHit(Int_t track, Int_t *vol, Float_t *hits)
1139 TClonesArray &lhits = *fHits;
1140 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
1143 //---------------------------------------------------------------------
1144 void AliVZEROv2::AddDigits(Int_t *tracks, Int_t* digits)
1147 TClonesArray &ldigits = *fDigits;
1148 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
1151 //---------------------------------------------------------------------
1152 void AliVZEROv2::MakeBranch(Option_t *option)
1155 // Creates new branches in the current Root Tree
1158 char branchname[10];
1159 sprintf(branchname,"%s",GetName());
1160 printf(" fBufferSize = %d \n",fBufferSize);
1162 const char *H = strstr(option,"H");
1164 if (fHits && gAlice->TreeH() && H) {
1165 gAlice->TreeH()->Branch(branchname,&fHits, fBufferSize);
1166 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1169 const char *D = strstr(option,"D");
1171 if (fDigits && gAlice->TreeD() && D) {
1172 gAlice->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1173 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);