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 **************************************************************************/
18 //////////////////////////////////////////////////////////////////////
20 // (V-zero) detector version 2 as designed by the Lyon group //
21 // All comments should be sent to Brigitte CHEYNIS : //
22 // b.cheynis@ipnl.in2p3.fr //
23 // Geometry of the 4th of november 2002 //
24 // (circular instead of trapezoidal shapes as in previous versions //
25 // plus changes in cell dimensions and offsets) //
27 //////////////////////////////////////////////////////////////////////
29 #include <Riostream.h>
36 #include <TClonesArray.h>
38 #include <TGeometry.h>
40 #include <TLorentzVector.h>
43 #include <TObjectTable.h>
52 #include <TVirtualMC.h>
53 #include <TParticle.h>
55 #include "AliLoader.h"
58 #include "AliVZEROdigit.h"
59 #include "AliVZEROhit.h"
60 #include "AliVZEROv2.h"
65 //--------------------------------------------------------------------
66 AliVZEROv2:: AliVZEROv2():AliVZERO()
70 //--------------------------------------------------------------------
71 AliVZEROv2::AliVZEROv2(const char *name, const char *title):
75 // Standard constructor for V-zeroR Detector (right part) version 0
80 for(i=0;i<26;i++) printf("*");
81 printf(" Create VZERO object ");
82 for(i=0;i<26;i++) printf("*");
87 //-------------------------------------------------------------------------
88 void AliVZEROv2::CreateGeometry()
91 // Creates the GEANT geometry of the V-zero Detector version 2
96 for(i=0;i<26;i++) printf("*");
97 printf(" Create VZERO Geometry ");
98 for(i=0;i<26;i++) printf("*");
101 Int_t *idtmed = fIdtmed->GetArray()-2999;
111 Float_t height1, height2, height3, height4, height5;
115 Float_t half_thick_qua;
119 Float_t pi = TMath::Pi();
121 height1 = 1.82; // height of cell 1, in cm
122 height2 = 3.81; // height of cell 2, in cm
123 height3 = 4.72; // height of cell 3, in cm
124 height4 = 7.12; // height of cell 4, in cm
125 height5 = 10.83; // height of cell 5, in cm
127 theta = pi/6.0/2.0; // half angular opening = 15 degrees
129 half_thick_qua = fThickness1/2.0; // half thickness of elementary cell (inner ring)
131 zdet = 90.0 - 0.6 -fThickness/2.0; // distance to vertex (along Z axis)
132 r0 = 4.05; // closest distance to center of the beam pipe
133 height = height1 + height2 + height3 + height4 + height5;
136 // Creation of mother volume V0LE - left part - :
137 // Entrance face at -350.0 cm ...
143 partube[2] = fThickness1/2.0;
145 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
147 // Creation of five rings - left part - :
148 // Entrance face at -350.0 cm ...
150 // Mother volume V0L0 in which will be set 5 scintillator cells
154 Float_t r0_left = 4.3;
155 Float_t height1_left = 2.6;
156 Float_t height2_left = 4.1;
157 Float_t height3_left = 6.4;
158 Float_t height4_left = 10.2;
159 Float_t height5_left = 16.9;
160 Float_t height_left = height1_left + height2_left + height3_left
161 + height4_left + height5_left;
162 Float_t r5_left = r0_left + height_left;
164 partubs[0] = r0_left;
165 partubs[1] = r5_left;
166 partubs[2] = fThickness1/2.0;
167 partubs[3] = 90.0-15.0;
168 partubs[4] = 120.0-15.0;
170 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
172 Float_t r1_left = r0_left + height1_left;
174 partubs[0] = r0_left;
175 partubs[1] = r1_left;
177 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
178 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
180 Float_t r2_left = r1_left + height2_left;
182 partubs[0] = r1_left;
183 partubs[1] = r2_left;
185 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
186 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
188 Float_t r3_left = r2_left + height3_left;
190 partubs[0] = r2_left;
191 partubs[1] = r3_left;
193 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
194 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
196 Float_t r4_left = r3_left + height4_left;
198 partubs[0] = r3_left;
199 partubs[1] = r4_left;
201 gMC->Gsvolu("V0L4","TUBS",idtmed[3005],partubs,5); // quartz volume
202 gMC->Gspos("V0L4",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
204 partubs[0] = r4_left;
205 partubs[1] = r5_left;
206 partubs[3] = 90.0-15.0;
207 partubs[4] = 120.0-30.0;
209 gMC->Gsvolu("V0L5","TUBS",idtmed[3005],partubs,5); // quartz volume
210 gMC->Gspos("V0L5",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
212 partubs[3] = 120.0-30.0;
213 partubs[4] = 120.0-15.0;
215 gMC->Gsvolu("V0L6","TUBS",idtmed[3005],partubs,5); // quartz volume
216 gMC->Gspos("V0L6",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
219 // Creation of mother volume V0RI - right part - :
221 partube[0] = r0 - 0.2;
222 partube[1] = r5 + 1.0;
223 partube[2] = fThickness/2.0;
225 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
227 // Creation of carbon lids (3 mm thick) to keep V0RI box shut...
231 partube[2] = +0.3/2.0;
233 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
234 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
235 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
237 // Creation of aluminum rings to maintain the V0RI pieces ...
239 partube[0] = r0 - 0.2;
241 partube[2] = +fThickness/2.0;
243 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
244 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
247 partube[1] = r5 + 1.0;
248 partube[2] = +fThickness/2.0;
250 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
251 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
253 // Mother volume V0R0 in which will be set 5 scintillator cells
257 partubs[2] = fThickness/2.0;
258 partubs[3] = 90.0-15.0;
259 partubs[4] = 120.0-15.0;
261 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
263 // Elementary cell of ring 1 :
264 // (the cells will be shifted by 3 mm to output fibers)
266 Float_t offset_fibers = 0.7;
267 Float_t offset = fThickness/2.0 - 0.3 - fThickness1/2.0;
268 Float_t r1 = r0 + height1;
272 partubs[2] = fThickness1/2.0;
274 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
275 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , offset, 0,"ONLY");
277 // Elementary cell of ring 2 :
279 Float_t r2 = r1 + height2;
284 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
285 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , offset - offset_fibers, 0,"ONLY");
288 // Elementary cell of ring 3 :
290 Float_t r3 = r2 + height3;
295 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
296 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , offset - 2.0 * offset_fibers, 0,"ONLY");
298 // Elementary cell of ring 4 :
300 Float_t r4 = r3 + height4 ;
305 gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5); // scintillator volume
306 gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 , offset - 3.0 * offset_fibers, 0,"ONLY");
308 // Elementary cells of ring 5 :
312 partubs[3] = 90.0-15.0;
313 partubs[4] = 120.0-30.0;
315 gMC->Gsvolu("V0R5","TUBS",idtmed[3005],partubs,5); // scintillator volume
316 gMC->Gspos("V0R5",1,"V0R0", 0.0, 0.0 , offset - 4.0 * offset_fibers, 0,"ONLY");
318 partubs[3] = 120.0-30.0;
319 partubs[4] = 120.0-15.0;
321 gMC->Gsvolu("V0R6","TUBS",idtmed[3005],partubs,5); // scintillator volume
322 gMC->Gspos("V0R6",1,"V0R0", 0.0, 0.0 , offset - 4.0 * offset_fibers, 0,"ONLY");
324 Float_t phi_deg = 180./6.;
328 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
330 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
331 gMC->Gspos("V0R0",n_detec_R,"V0RI",0.0,
332 0.0,0.0,idrotm[902],"ONLY");
336 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,zdet,0,"ONLY");
338 n_cells_R = (n_detec_R - 1) * 6;
339 printf(" Number of cells on Right side = %d\n", n_cells_R);
343 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phi_deg)
345 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
346 gMC->Gspos("V0L0",n_detec_L,"V0LE",0.0,
347 0.0,0.0,idrotm[902],"ONLY");
351 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,-350.0-fThickness1/2.0,0,"ONLY");
353 n_cells_L = (n_detec_L - 1) * 6;
354 printf(" Number of cells on Left side = %d\n", n_cells_L);
355 for(i=0;i<75;i++) printf("*");
360 //_____________________________________________________________________________
361 void AliVZEROv2::BuildGeometry()
364 // Builds simple ROOT TNode geometry for event display
369 for(i=0;i<30;i++) printf("*");
370 printf(" VZERO BuildGeometry ");
371 for(i=0;i<30;i++) printf("*");
376 TNode *V0Rnode, *V0Rnode0, *V0Rnode6 , *V0Rnode7, *V0Rnode8, *V0Rnode9;
377 TNode *V0Rnode1, *V0Rnode2, *V0Rnode3, *V0Rnode4, *V0Rnode5;
378 TNode *V0Lnode, *V0Lnode0;
379 TNode *V0Lnode1, *V0Lnode2, *V0Lnode3, *V0Lnode4, *V0Lnode5, *V0Lnode6;
381 const int kColorVZERO = kGreen;
383 Top = gAlice->GetGeometry()->GetNode("alice");
385 Float_t height1, height2, height3, height4, height5;
389 Float_t half_thick_qua;
392 Float_t pi = TMath::Pi();
394 height1 = 1.82; // height of cell 1, in cm
395 height2 = 3.81; // height of cell 2, in cm
396 height3 = 4.72; // height of cell 3, in cm
397 height4 = 7.12; // height of cell 4, in cm
398 height5 = 10.83; // height of cell 5, in cm
402 half_thick_qua = fThickness1/2.0;
404 zdet = 90.0 - 0.6 - fThickness/2.0;
406 height = height1 + height2 + height3 + height4 + height5;
413 partube[0] = r0 - 0.2;
414 partube[1] = r5 + 1.0;
415 partube[2] = fThickness/2.0;
417 TTUBE *V0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
421 V0Rnode = new TNode("V0RI","V0RI",V0RI,0.0,0.0,+zdet,0);
423 V0Rnode->SetLineColor(kYellow);
424 fNodes->Add(V0Rnode);
425 V0Rnode->SetVisibility(2);
427 // Rondelles de carbone (epaisseur 3 mm) de maintien des cellules ...
431 partube[2] = +0.3/2.0;
433 TTUBE *V0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
436 V0Rnode6 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0, fThickness/2.0-partube[2],0);
437 V0Rnode6->SetLineColor(kYellow);
438 fNodes->Add(V0Rnode6);
440 V0Rnode7 = new TNode("V0CA", "V0CA",V0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
441 V0Rnode7->SetLineColor(kYellow);
442 fNodes->Add(V0Rnode7);
444 partube[0] = r0 - 0.2;
446 partube[2] = +fThickness/2.0;
448 TTUBE *V0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
451 V0Rnode8 = new TNode("V0IR", "V0IR",V0IR,0.0,0.0,0.0,0);
452 V0Rnode8->SetLineColor(kYellow);
453 fNodes->Add(V0Rnode8);
456 partube[1] = r5 + 1.0;
457 partube[2] = +fThickness/2.0;
459 TTUBE *V0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
462 V0Rnode9 = new TNode("V0ER", "V0ER",V0ER,0.0,0.0,0.0,0);
463 V0Rnode9->SetLineColor(kYellow);
464 fNodes->Add(V0Rnode9);
470 partubs[2] = fThickness/2.0;
471 partubs[3] = 90.0-15.0;
472 partubs[4] = 120.0-15.0;
474 TTUBS *V0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
475 partubs[3], partubs[4]);
477 V0R0->SetNumberOfDivisions(ndiv);
479 Float_t r1 = r0 + height1;
480 Float_t offset = fThickness/2.0 - 0.3 - fThickness1/2.0;
481 Float_t offset_fibers = 0.7;
485 partubs[2] = fThickness1/2.0;
487 TTUBS *V0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
488 partubs[3], partubs[4]);
490 V0R1->SetNumberOfDivisions(ndiv);
492 Float_t r2 = r1 + height2;
497 TTUBS *V0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
498 partubs[3], partubs[4]);
500 V0R2->SetNumberOfDivisions(ndiv);
502 Float_t r3 = r2 + height3;
507 TTUBS *V0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
508 partubs[3], partubs[4]);
509 V0R3->SetNumberOfDivisions(ndiv);
511 Float_t r4 = r3 + height4;
516 TTUBS *V0R4 = new TTUBS("V0R4", "V0R4", "void", partubs[0], partubs[1], partubs[2],
517 partubs[3], partubs[4]);
519 V0R4->SetNumberOfDivisions(ndiv);
523 partubs[3] = 90.0-15.0;
524 partubs[4] = 120.0-30.0;
526 TTUBS *V0R5 = new TTUBS("V0R5", "V0R5", "void", partubs[0], partubs[1], partubs[2],
527 partubs[3], partubs[4]);
529 V0R5->SetNumberOfDivisions(ndiv);
531 partubs[3] = 120.0-30.0;
532 partubs[4] = 120.0-15.0;
534 TTUBS *V0R6 = new TTUBS("V0R6", "V0R6", "void", partubs[0], partubs[1], partubs[2],
535 partubs[3], partubs[4]);
537 V0R6->SetNumberOfDivisions(ndiv);
540 Float_t phi_deg= 180./6.;
546 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
550 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
552 sprintf(NameNode,"SUBDER%d",n_detec_R);
555 V0Rnode0 = new TNode(NameNode,NameNode,V0R0,0.0,0.0, 0.0,mat920);
556 V0Rnode0->SetLineColor(kYellow);
557 fNodes->Add(V0Rnode0);
560 sprintf(NameNode,"SUBDER%d",n_detec_R);
562 V0Rnode1 = new TNode(NameNode,NameNode,V0R1,0.0,0.0, offset,0);
563 V0Rnode1->SetLineColor(kColorVZERO);
564 fNodes->Add(V0Rnode1);
567 sprintf(NameNode,"SUBDER%d",n_detec_R);
569 V0Rnode2 = new TNode(NameNode,NameNode,V0R2,0.0,0.0, offset - offset_fibers,0);
570 V0Rnode2->SetLineColor(kColorVZERO);
571 fNodes->Add(V0Rnode2);
574 sprintf(NameNode,"SUBDER%d",n_detec_R);
576 V0Rnode3 = new TNode(NameNode,NameNode,V0R3,0.0,0.0, offset - 2.0*offset_fibers,0);
577 V0Rnode3->SetLineColor(kColorVZERO);
578 fNodes->Add(V0Rnode3);
581 sprintf(NameNode,"SUBDER%d",n_detec_R);
583 V0Rnode4 = new TNode(NameNode,NameNode,V0R4,0.0,0.0, offset - 3.0*offset_fibers,0);
584 V0Rnode4->SetLineColor(kColorVZERO);
585 fNodes->Add(V0Rnode4);
588 sprintf(NameNode,"SUBDER%d",n_detec_R);
590 V0Rnode5 = new TNode(NameNode,NameNode,V0R5,0.0,0.0, offset - 4.0*offset_fibers,0);
591 V0Rnode5->SetLineColor(kColorVZERO);
592 fNodes->Add(V0Rnode5);
595 sprintf(NameNode,"SUBDER%d",n_detec_R);
597 V0Rnode6 = new TNode(NameNode,NameNode,V0R6,0.0,0.0, offset - 4.0*offset_fibers,0);
598 V0Rnode6->SetLineColor(kColorVZERO);
599 fNodes->Add(V0Rnode6);
602 V0Rnode0->SetVisibility(2);
606 // Left side of VZERO :
608 Float_t r0_left = 4.3;
609 Float_t height1_left = 2.6;
610 Float_t height2_left = 4.1;
611 Float_t height3_left = 6.4;
612 Float_t height4_left = 10.2;
613 Float_t height5_left = 16.9;
614 Float_t height_left = height1_left + height2_left + height3_left
615 + height4_left + height5_left;
616 Float_t r5_left = r0_left + height_left;
618 partube[0] = r0_left;
619 partube[1] = r5_left;
620 partube[2] = fThickness1/2.0;
622 TTUBE *V0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
626 V0Lnode = new TNode("V0LE","V0LE",V0LE,0.0,0.0,-350.0-fThickness1/2.0,0);
628 V0Lnode->SetLineColor(kBlue);
629 fNodes->Add(V0Lnode);
631 V0Lnode->SetVisibility(2);
633 partubs[0] = r0_left;
634 partubs[1] = r5_left;
635 partubs[2] = fThickness1/2.0;
636 partubs[3] = 90.0-15.0;
637 partubs[4] = 120.0-15.0;
639 TTUBS *V0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
640 partubs[3], partubs[4]);
642 V0L0->SetNumberOfDivisions(ndiv);
643 V0L0->SetLineColor(7);
646 offset_left = - fThickness1/2.0;
648 Float_t r1_left = r0_left + height1_left;
650 partubs[0] = r0_left;
651 partubs[1] = r1_left;
653 TTUBS *V0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
654 partubs[3], partubs[4]);
656 V0L1->SetNumberOfDivisions(ndiv);
658 Float_t r2_left = r1_left + height2_left;
660 partubs[0] = r1_left;
661 partubs[1] = r2_left;
663 TTUBS *V0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
664 partubs[3], partubs[4]);
666 V0L2->SetNumberOfDivisions(ndiv);
668 Float_t r3_left = r2_left + height3_left;
670 partubs[0] = r2_left;
671 partubs[1] = r3_left;
673 TTUBS *V0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
674 partubs[3], partubs[4]);
675 V0L3->SetNumberOfDivisions(ndiv);
677 Float_t r4_left = r3_left + height4_left;
679 partubs[0] = r3_left;
680 partubs[1] = r4_left;
682 TTUBS *V0L4 = new TTUBS("V0L4", "V0L4", "void", partubs[0], partubs[1], partubs[2],
683 partubs[3], partubs[4]);
685 V0L4->SetNumberOfDivisions(ndiv);
687 partubs[0] = r4_left;
688 partubs[1] = r5_left;
689 partubs[3] = 90.0-15.0;
690 partubs[4] = 120.0-30.0;
692 TTUBS *V0L5 = new TTUBS("V0L5", "V0L5", "void", partubs[0], partubs[1], partubs[2],
693 partubs[3], partubs[4]);
696 V0L5->SetNumberOfDivisions(ndiv);
698 partubs[3] = 120.0-30.0;
699 partubs[4] = 120.0-15.0;
701 TTUBS *V0L6 = new TTUBS("V0L6", "V0L6", "void", partubs[0], partubs[1], partubs[2],
702 partubs[3], partubs[4]);
704 V0L6->SetNumberOfDivisions(ndiv);
708 for (phi = 15.0; phi < 360.0; phi = phi + phi_deg)
712 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
715 sprintf(NameNode,"SUBDEL%d",n_detec_L);
718 V0Lnode0 = new TNode(NameNode,NameNode,V0L0,0.0,0.0, offset_left + half_thick_qua,mat920);
719 V0Lnode0->SetLineColor(kColorVZERO);
720 fNodes->Add(V0Lnode0);
723 sprintf(NameNode,"SUBDEL%d",n_detec_L);
725 V0Lnode1 = new TNode(NameNode,NameNode,V0L1,0.0,0.0, 0.0,0);
726 V0Lnode1->SetLineColor(kColorVZERO);
727 fNodes->Add(V0Lnode1);
730 sprintf(NameNode,"SUBDEL%d",n_detec_L);
732 V0Lnode2 = new TNode(NameNode,NameNode,V0L2,0.0,0.0, 0.0,0);
733 V0Lnode2->SetLineColor(kColorVZERO);
734 fNodes->Add(V0Lnode2);
738 sprintf(NameNode,"SUBDEL%d",n_detec_L);
740 V0Lnode3 = new TNode(NameNode,NameNode,V0L3,0.0,0.0, 0.0,0);
741 V0Lnode3->SetLineColor(kColorVZERO);
742 fNodes->Add(V0Lnode3);
745 sprintf(NameNode,"SUBDEL%d",n_detec_L);
747 V0Lnode4 = new TNode(NameNode,NameNode,V0L4,0.0,0.0, 0.0,0);
748 V0Lnode4->SetLineColor(kColorVZERO);
749 fNodes->Add(V0Lnode4);
752 sprintf(NameNode,"SUBDEL%d",n_detec_L);
754 V0Lnode5 = new TNode(NameNode,NameNode,V0L5,0.0,0.0, 0.0,0);
755 V0Lnode5->SetLineColor(kColorVZERO);
756 fNodes->Add(V0Lnode5);
759 sprintf(NameNode,"SUBDEL%d",n_detec_L);
761 V0Lnode6 = new TNode(NameNode,NameNode,V0L6,0.0,0.0, 0.0,0);
762 V0Lnode6->SetLineColor(kColorVZERO);
763 fNodes->Add(V0Lnode6);
766 V0Lnode0->SetVisibility(2);
772 //------------------------------------------------------------------------
773 void AliVZEROv2::CreateMaterials()
778 for(i=0;i<25;i++) printf("*");
779 printf(" VZERO create materials ");
780 for(i=0;i<26;i++) printf("*");
784 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,
785 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
788 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,
789 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
791 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
792 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
795 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
796 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
798 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
801 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
804 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,
805 1e-4,1e-4,1e-4,1e-4 };
806 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
810 Int_t *idtmed = fIdtmed->GetArray()-2999;
812 // TGeant3 *geant3 = (TGeant3*) gMC;
814 // Parameters related to Quarz (SiO2) :
816 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
828 // Parameters related to aluminum sheets :
835 // Parameters related to scintillator CH :
837 Float_t ascin[2] = {1.00794,12.011};
838 Float_t zscin[2] = {1.,6.};
839 Float_t wscin[2] = {1.,1.};
840 Float_t denscin = 1.032;
842 // Definition of materials :
844 AliMaterial( 1, "AIR A$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
845 AliMaterial(11, "AIR I$", 14.61, 7.3, .001205, 30420., 67500, 0, 0);
846 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
847 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
848 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
849 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
851 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
854 Int_t ISXFLD = gAlice->Field()->Integ();
855 Float_t SXMGMX = gAlice->Field()->Max();
857 Float_t tmaxfd, stemax, deemax, epsil, stmin;
866 AliMedium(1, "ACTIVE AIR$", 1, 1, ISXFLD, SXMGMX,
867 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
871 AliMedium(11, "INACTIVE AIR$", 11, 0, ISXFLD, SXMGMX,
872 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
874 AliMedium(2, "CARBON$ ", 2, 1, ISXFLD, SXMGMX,
875 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
877 AliMedium(3, "QUARZ$", 3, 1, ISXFLD, SXMGMX,
878 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
880 AliMedium(4,"ALUMINUM1$",4, 1, ISXFLD, SXMGMX,
881 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
884 AliMedium(5,"ALUMINUM2$",5, 1, ISXFLD, SXMGMX,
885 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
887 AliMedium(6,"SCINTILLATOR$",6, 1, ISXFLD, SXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
889 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
890 gMC->Gstpar(idtmed[3000], "HADR", 1.);
891 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
892 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
894 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
895 gMC->Gstpar(idtmed[3001], "HADR", 1.);
896 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
897 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
899 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
900 gMC->Gstpar(idtmed[3002], "HADR", 1.);
901 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
902 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
903 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
904 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
906 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
907 gMC->Gstpar(idtmed[3003], "HADR", 1.);
908 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
909 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
911 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
912 gMC->Gstpar(idtmed[3004], "HADR", 1.);
913 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
914 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
915 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
916 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
918 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
919 gMC->Gstpar(idtmed[3005], "HADR", 1.);
920 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
921 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
922 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
923 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
926 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
927 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
929 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
930 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
934 //---------------------------------------------------------------------
935 void AliVZEROv2::DrawModule()
938 // Drawing is done in DrawVZERO.C
943 for(i=0;i<30;i++) printf("*");
944 printf(" VZERO DrawModule ");
945 for(i=0;i<30;i++) printf("*");
951 //-------------------------------------------------------------------
952 void AliVZEROv2::Init()
954 // Initialises version 1 of the VZERO Detector
955 // Just prints an information message
957 printf(" VZERO version %d initialized \n",IsVersion());
959 // gMC->SetMaxStep(fMaxStepAlu);
960 // gMC->SetMaxStep(fMaxStepQua);
966 //-------------------------------------------------------------------
968 void AliVZEROv2::StepManager()
973 static Float_t hits[19];
974 static Float_t eloss, tlength;
981 Float_t kRaddeg = 180/TMath::Pi();
985 Float_t destep, step;
988 // We keep only charged tracks :
990 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
993 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
994 vol[2] = gMC->CurrentVolID(copy);
998 if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
999 gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
1001 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
1002 gMC->CurrentVolID(copy) == gMC->VolId("V0L2") )
1004 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
1005 gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
1007 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
1008 gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
1010 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
1011 gMC->CurrentVolID(copy) == gMC->VolId("V0L5") ||
1012 gMC->CurrentVolID(copy) == gMC->VolId("V0L6") ||
1013 gMC->CurrentVolID(copy) == gMC->VolId("V0R6") )
1018 if ( RingNumber > 0.5 ) {
1020 destep = gMC->Edep();
1021 step = gMC->TrackStep();
1026 if ( gMC->IsTrackEntering() ) {
1028 gMC->TrackPosition(pos);
1030 gMC->TrackMomentum(mom);
1031 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1032 Double_t Pt = TMath::Sqrt(tc);
1033 Double_t Pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1034 theta = Float_t(TMath::ATan2(Pt,Double_t(mom[2])))*kRaddeg;
1035 phi = Float_t(TMath::ATan2(Double_t(mom[1]),Double_t(mom[0])))*kRaddeg;
1037 ipart = gMC->TrackPid();
1042 hits[3] = Float_t (ipart);
1044 hits[4] = gMC->TrackTime();
1045 hits[5] = gMC->TrackCharge();
1048 hits[8] = RingNumber;
1056 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
1057 hits[14] = par->Vx();
1058 hits[15] = par->Vy();
1059 hits[16] = par->Vz();
1066 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1071 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
1082 //_____________________________________________________________________________
1083 void AliVZEROv2::AddHit(Int_t track, Int_t *vol, Float_t *hits)
1089 TClonesArray &lhits = *fHits;
1090 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
1093 //---------------------------------------------------------------------
1094 void AliVZEROv2::AddDigits(Int_t *tracks, Int_t* digits)
1097 TClonesArray &ldigits = *fDigits;
1098 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
1101 //---------------------------------------------------------------------
1102 void AliVZEROv2::MakeBranch(Option_t *option)
1105 // Creates new branches in the current Root Tree
1108 char branchname[10];
1109 sprintf(branchname,"%s",GetName());
1110 printf(" fBufferSize = %d \n",fBufferSize);
1112 const char *H = strstr(option,"H");
1114 if (fHits && TreeH() && H) {
1115 TreeH()->Branch(branchname,&fHits, fBufferSize);
1116 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1119 const char *D = strstr(option,"D");
1121 if (fDigits && fLoader->TreeD() && D) {
1122 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1123 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);