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 26th of november 2003 //
24 // (circular instead of trapezoidal shapes as in previous versions //
25 // plus changes in cell dimensions and offsets) : //
26 // Scintillating cells are now 2 cm thick instead of 0.7 cm //
27 // V0R sits between Z values -89.4 and -85.0 cm //
28 // V0L sits between Z values +350.0 and +352.0 cm //
29 // New coordinate system has been implemented in october 2003 //
31 //////////////////////////////////////////////////////////////////////
33 // --- Standard libraries ---
34 #include <Riostream.h>
38 // --- ROOT libraries ---
39 #include <TClonesArray.h>
41 #include <TGeometry.h>
42 #include <TLorentzVector.h>
45 #include <TObjectTable.h>
48 #include <TVirtualMC.h>
49 #include <TParticle.h>
51 // --- AliRoot header files ---
56 #include "AliVZEROLoader.h"
57 #include "AliVZEROdigit.h"
58 #include "AliVZEROhit.h"
59 #include "AliVZEROv2.h"
63 //_____________________________________________________________________________
64 AliVZEROv2:: AliVZEROv2():AliVZERO()
66 // Standard default constructor
69 //_____________________________________________________________________________
70 AliVZEROv2::AliVZEROv2(const char *name, const char *title):
74 // Standard constructor for V-zero Detector version 2
79 for(i=0;i<26;i++) printf("*");
80 printf(" Create VZERO object ");
81 for(i=0;i<26;i++) printf("*");
86 //_____________________________________________________________________________
87 void AliVZEROv2::CreateGeometry()
90 // Creates the GEANT geometry of the V-zero Detector version 2
95 for(i=0;i<26;i++) printf("*");
96 printf(" Create VZERO Geometry ");
97 for(i=0;i<26;i++) printf("*");
100 Int_t *idtmed = fIdtmed->GetArray()-2999;
110 Float_t height1, height2, height3, height4, height5;
114 Float_t halfThickQua;
118 Float_t pi = TMath::Pi();
120 height1 = 1.82; // height of cell 1, in cm
121 height2 = 3.81; // height of cell 2, in cm
122 height3 = 4.72; // height of cell 3, in cm
123 height4 = 7.12; // height of cell 4, in cm
124 height5 = 10.83; // height of cell 5, in cm
126 theta = pi/6.0/2.0; // half angular opening = 15 degrees
128 halfThickQua= fThickness1/2.0; // half thickness of elementary cell (inner ring)
130 // distance 0.6 cm in zdet accounts for the fact V0R box back lid sits 0.6 away from
131 // absorber nose sitting at 90 cm. Will use -zdet later...
133 zdet = 90.0 - 0.6 -fThickness/2.0; // distance to vertex (along Z axis)
134 r0 = 4.05; // closest distance to center of the beam pipe
135 height = height1 + height2 + height3 + height4 + height5;
138 // Creation of mother volume v0LE - left part - :
139 // Entrance face at +350.0 cm (new coordinate system) ...
145 partube[2] = fThickness1/2.0;
147 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
149 // Creation of five rings - left part - :
150 // Entrance face at +350.0 cm (new coordinate system) ...
152 // Mother volume v0L0 in which will be set 5 scintillator cells
156 Float_t r0Left = 4.3;
157 Float_t height1Left = 2.6;
158 Float_t height2Left = 4.1;
159 Float_t height3Left = 6.4;
160 Float_t height4Left = 10.2;
161 Float_t height5Left = 16.9;
162 Float_t heightLeft = height1Left + height2Left + height3Left
163 + height4Left + height5Left;
164 Float_t r5Left = r0Left + heightLeft;
168 partubs[2] = fThickness1/2.0;
169 partubs[3] = 90.0-15.0;
170 partubs[4] = 120.0-15.0;
172 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
174 Float_t r1Left = r0Left + height1Left;
179 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
180 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
182 Float_t r2Left = r1Left + height2Left;
187 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
188 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
190 Float_t r3Left = r2Left + height3Left;
195 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
196 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
198 Float_t r4Left = r3Left + height4Left;
203 gMC->Gsvolu("V0L4","TUBS",idtmed[3005],partubs,5); // quartz volume
204 gMC->Gspos("V0L4",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
208 partubs[3] = 90.0-15.0;
209 partubs[4] = 120.0-30.0;
211 gMC->Gsvolu("V0L5","TUBS",idtmed[3005],partubs,5); // quartz volume
212 gMC->Gspos("V0L5",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
214 partubs[3] = 120.0-30.0;
215 partubs[4] = 120.0-15.0;
217 gMC->Gsvolu("V0L6","TUBS",idtmed[3005],partubs,5); // quartz volume
218 gMC->Gspos("V0L6",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
221 // Creation of mother volume v0RI - right part - :
223 partube[0] = r0 - 0.2;
224 partube[1] = r5 + 1.0;
225 partube[2] = fThickness/2.0;
227 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
229 // Creation of carbon lids (2 mm thick) to keep v0RI box shut...
231 Float_t lidThickness = 0.2;
235 partube[2] = +lidThickness/2.0;
237 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
238 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
239 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
241 // Creation of aluminum rings to maintain the v0RI pieces ...
243 partube[0] = r0 - 0.2;
245 partube[2] = +fThickness/2.0;
247 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
248 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
251 partube[1] = r5 + 1.0;
252 partube[2] = +fThickness/2.0;
254 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
255 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
257 // Mother volume v0R0 in which will be set 5 scintillator cells
261 partubs[2] = fThickness/2.0;
262 partubs[3] = 90.0-15.0;
263 partubs[4] = 120.0-15.0;
265 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
267 // Elementary cell of ring 1 :
268 // (cells 2 and 3 will be shifted by 1 cm to output fibers)
270 Float_t offsetFibers = 1.0;
271 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
272 Float_t r1 = r0 + height1;
276 partubs[2] = fThickness1/2.0;
278 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
279 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
281 // Elementary cell of ring 2 :
283 Float_t r2 = r1 + height2;
288 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
289 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , -offset + offsetFibers, 0,"ONLY");
292 // Elementary cell of ring 3 :
294 Float_t r3 = r2 + height3;
299 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
300 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
302 // Elementary cell of ring 4 :
304 Float_t r4 = r3 + height4 ;
309 gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5); // scintillator volume
310 gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
312 // Elementary cells of ring 5 :
316 partubs[3] = 90.0-15.0;
317 partubs[4] = 120.0-30.0;
319 gMC->Gsvolu("V0R5","TUBS",idtmed[3005],partubs,5); // scintillator volume
320 gMC->Gspos("V0R5",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
322 partubs[3] = 120.0-30.0;
323 partubs[4] = 120.0-15.0;
325 gMC->Gsvolu("V0R6","TUBS",idtmed[3005],partubs,5); // scintillator volume
326 gMC->Gspos("V0R6",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
328 Float_t phiDeg = 180./6.;
332 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phiDeg)
334 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
335 gMC->Gspos("V0R0",ndetR,"V0RI",0.0,
336 0.0,0.0,idrotm[902],"ONLY");
340 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,-zdet,0,"ONLY");
342 ncellsR = (ndetR - 1) * 6;
343 printf(" Number of cells on Right side = %d\n", ncellsR);
347 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phiDeg)
349 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
350 gMC->Gspos("V0L0",ndetL,"V0LE",0.0,
351 0.0,0.0,idrotm[902],"ONLY");
355 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,350.0+fThickness1/2.0,0,"ONLY");
357 ncellsL = (ndetL - 1) * 6;
358 printf(" Number of cells on Left side = %d\n", ncellsL);
359 for(i=0;i<75;i++) printf("*");
364 //_____________________________________________________________________________
365 void AliVZEROv2::BuildGeometry()
368 // Builds simple ROOT TNode geometry for event display
373 for(i=0;i<30;i++) printf("*");
374 printf(" VZERO BuildGeometry ");
375 for(i=0;i<30;i++) printf("*");
380 TNode *v0Rnode, *v0Rnode0, *v0Rnode6 , *v0Rnode7, *v0Rnode8, *v0Rnode9;
381 TNode *v0Rnode1, *v0Rnode2, *v0Rnode3, *v0Rnode4, *v0Rnode5;
382 TNode *v0Lnode, *v0Lnode0;
383 TNode *v0Lnode1, *v0Lnode2, *v0Lnode3, *v0Lnode4, *v0Lnode5, *v0Lnode6;
385 const int kColorVZERO = kGreen;
387 top = gAlice->GetGeometry()->GetNode("alice");
389 Float_t height1, height2, height3, height4, height5;
393 Float_t halfThickQua;
396 Float_t pi = TMath::Pi();
398 height1 = 1.82; // height of cell 1, in cm
399 height2 = 3.81; // height of cell 2, in cm
400 height3 = 4.72; // height of cell 3, in cm
401 height4 = 7.12; // height of cell 4, in cm
402 height5 = 10.83; // height of cell 5, in cm
406 halfThickQua = fThickness1/2.0;
408 zdet = 90.0 - 0.6 - fThickness/2.0;
410 height = height1 + height2 + height3 + height4 + height5;
417 partube[0] = r0 - 0.2;
418 partube[1] = r5 + 1.0;
419 partube[2] = fThickness/2.0;
421 TTUBE *v0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
425 v0Rnode = new TNode("V0RI","V0RI",v0RI,0.0,0.0,-zdet,0);
427 v0Rnode->SetLineColor(kYellow);
428 fNodes->Add(v0Rnode);
429 v0Rnode->SetVisibility(2);
431 // Rondelles de carbone (epaisseur 2 mm) de maintien des cellules ...
433 Float_t lidThickness = 0.2;
437 partube[2] = +lidThickness/2.0;
439 TTUBE *v0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
442 v0Rnode6 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0, fThickness/2.0-partube[2],0);
443 v0Rnode6->SetLineColor(kYellow);
444 fNodes->Add(v0Rnode6);
446 v0Rnode7 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
447 v0Rnode7->SetLineColor(kYellow);
448 fNodes->Add(v0Rnode7);
450 partube[0] = r0 - 0.2;
452 partube[2] = +fThickness/2.0;
454 TTUBE *v0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
457 v0Rnode8 = new TNode("V0IR", "V0IR",v0IR,0.0,0.0,0.0,0);
458 v0Rnode8->SetLineColor(kYellow);
459 fNodes->Add(v0Rnode8);
462 partube[1] = r5 + 1.0;
463 partube[2] = +fThickness/2.0;
465 TTUBE *v0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
468 v0Rnode9 = new TNode("V0ER", "V0ER",v0ER,0.0,0.0,0.0,0);
469 v0Rnode9->SetLineColor(kYellow);
470 fNodes->Add(v0Rnode9);
476 partubs[2] = fThickness/2.0;
477 partubs[3] = 90.0-15.0;
478 partubs[4] = 120.0-15.0;
480 TTUBS *v0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
481 partubs[3], partubs[4]);
483 v0R0->SetNumberOfDivisions(ndiv);
485 Float_t r1 = r0 + height1;
486 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
487 Float_t offsetFibers = 1.0;
491 partubs[2] = fThickness1/2.0;
493 TTUBS *v0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
494 partubs[3], partubs[4]);
496 v0R1->SetNumberOfDivisions(ndiv);
498 Float_t r2 = r1 + height2;
503 TTUBS *v0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
504 partubs[3], partubs[4]);
506 v0R2->SetNumberOfDivisions(ndiv);
508 Float_t r3 = r2 + height3;
513 TTUBS *v0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
514 partubs[3], partubs[4]);
515 v0R3->SetNumberOfDivisions(ndiv);
517 Float_t r4 = r3 + height4;
522 TTUBS *v0R4 = new TTUBS("V0R4", "V0R4", "void", partubs[0], partubs[1], partubs[2],
523 partubs[3], partubs[4]);
525 v0R4->SetNumberOfDivisions(ndiv);
529 partubs[3] = 90.0-15.0;
530 partubs[4] = 120.0-30.0;
532 TTUBS *v0R5 = new TTUBS("V0R5", "V0R5", "void", partubs[0], partubs[1], partubs[2],
533 partubs[3], partubs[4]);
535 v0R5->SetNumberOfDivisions(ndiv);
537 partubs[3] = 120.0-30.0;
538 partubs[4] = 120.0-15.0;
540 TTUBS *v0R6 = new TTUBS("V0R6", "V0R6", "void", partubs[0], partubs[1], partubs[2],
541 partubs[3], partubs[4]);
543 v0R6->SetNumberOfDivisions(ndiv);
546 Float_t phiDeg= 180./6.;
552 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
556 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
558 sprintf(nameNode,"SUBDER%d",ndetR);
561 v0Rnode0 = new TNode(nameNode,nameNode,v0R0,0.0,0.0, 0.0,mat920);
562 v0Rnode0->SetLineColor(kYellow);
563 fNodes->Add(v0Rnode0);
566 sprintf(nameNode,"SUBDER%d",ndetR);
568 v0Rnode1 = new TNode(nameNode,nameNode,v0R1,0.0,0.0, -offset,0);
569 v0Rnode1->SetLineColor(kColorVZERO);
570 fNodes->Add(v0Rnode1);
573 sprintf(nameNode,"SUBDER%d",ndetR);
575 v0Rnode2 = new TNode(nameNode,nameNode,v0R2,0.0,0.0, -offset + offsetFibers,0);
576 v0Rnode2->SetLineColor(kColorVZERO);
577 fNodes->Add(v0Rnode2);
580 sprintf(nameNode,"SUBDER%d",ndetR);
582 v0Rnode3 = new TNode(nameNode,nameNode,v0R3,0.0,0.0, -offset + 2.0*offsetFibers,0);
583 v0Rnode3->SetLineColor(kColorVZERO);
584 fNodes->Add(v0Rnode3);
587 sprintf(nameNode,"SUBDER%d",ndetR);
589 v0Rnode4 = new TNode(nameNode,nameNode,v0R4,0.0,0.0, -offset + 2.0*offsetFibers,0);
590 v0Rnode4->SetLineColor(kColorVZERO);
591 fNodes->Add(v0Rnode4);
594 sprintf(nameNode,"SUBDER%d",ndetR);
596 v0Rnode5 = new TNode(nameNode,nameNode,v0R5,0.0,0.0, -offset + 2.0*offsetFibers,0);
597 v0Rnode5->SetLineColor(kColorVZERO);
598 fNodes->Add(v0Rnode5);
601 sprintf(nameNode,"SUBDER%d",ndetR);
603 v0Rnode6 = new TNode(nameNode,nameNode,v0R6,0.0,0.0, -offset + 2.0*offsetFibers,0);
604 v0Rnode6->SetLineColor(kColorVZERO);
605 fNodes->Add(v0Rnode6);
608 v0Rnode0->SetVisibility(2);
612 // Left side of VZERO :
614 Float_t r0Left = 4.3;
615 Float_t height1Left = 2.6;
616 Float_t height2Left = 4.1;
617 Float_t height3Left = 6.4;
618 Float_t height4Left = 10.2;
619 Float_t height5Left = 16.9;
620 Float_t heightLeft = height1Left + height2Left + height3Left
621 + height4Left + height5Left;
622 Float_t r5Left = r0Left + heightLeft;
626 partube[2] = fThickness1/2.0;
628 TTUBE *v0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
632 v0Lnode = new TNode("V0LE","V0LE",v0LE,0.0,0.0,350.0+fThickness1/2.0,0);
634 v0Lnode->SetLineColor(kBlue);
635 fNodes->Add(v0Lnode);
637 v0Lnode->SetVisibility(2);
641 partubs[2] = fThickness1/2.0;
642 partubs[3] = 90.0-15.0;
643 partubs[4] = 120.0-15.0;
645 TTUBS *v0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
646 partubs[3], partubs[4]);
648 v0L0->SetNumberOfDivisions(ndiv);
649 v0L0->SetLineColor(7);
652 offsetLeft = - fThickness1/2.0;
654 Float_t r1Left = r0Left + height1Left;
659 TTUBS *v0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
660 partubs[3], partubs[4]);
662 v0L1->SetNumberOfDivisions(ndiv);
664 Float_t r2Left = r1Left + height2Left;
669 TTUBS *v0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
670 partubs[3], partubs[4]);
672 v0L2->SetNumberOfDivisions(ndiv);
674 Float_t r3Left = r2Left + height3Left;
679 TTUBS *v0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
680 partubs[3], partubs[4]);
681 v0L3->SetNumberOfDivisions(ndiv);
683 Float_t r4Left = r3Left + height4Left;
688 TTUBS *v0L4 = new TTUBS("V0L4", "V0L4", "void", partubs[0], partubs[1], partubs[2],
689 partubs[3], partubs[4]);
691 v0L4->SetNumberOfDivisions(ndiv);
695 partubs[3] = 90.0-15.0;
696 partubs[4] = 120.0-30.0;
698 TTUBS *v0L5 = new TTUBS("V0L5", "V0L5", "void", partubs[0], partubs[1], partubs[2],
699 partubs[3], partubs[4]);
702 v0L5->SetNumberOfDivisions(ndiv);
704 partubs[3] = 120.0-30.0;
705 partubs[4] = 120.0-15.0;
707 TTUBS *v0L6 = new TTUBS("V0L6", "V0L6", "void", partubs[0], partubs[1], partubs[2],
708 partubs[3], partubs[4]);
710 v0L6->SetNumberOfDivisions(ndiv);
714 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
718 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
721 sprintf(nameNode,"SUBDEL%d",ndetL);
724 v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offsetLeft + halfThickQua,mat920);
725 v0Lnode0->SetLineColor(kColorVZERO);
726 fNodes->Add(v0Lnode0);
729 sprintf(nameNode,"SUBDEL%d",ndetL);
731 v0Lnode1 = new TNode(nameNode,nameNode,v0L1,0.0,0.0, 0.0,0);
732 v0Lnode1->SetLineColor(kColorVZERO);
733 fNodes->Add(v0Lnode1);
736 sprintf(nameNode,"SUBDEL%d",ndetL);
738 v0Lnode2 = new TNode(nameNode,nameNode,v0L2,0.0,0.0, 0.0,0);
739 v0Lnode2->SetLineColor(kColorVZERO);
740 fNodes->Add(v0Lnode2);
744 sprintf(nameNode,"SUBDEL%d",ndetL);
746 v0Lnode3 = new TNode(nameNode,nameNode,v0L3,0.0,0.0, 0.0,0);
747 v0Lnode3->SetLineColor(kColorVZERO);
748 fNodes->Add(v0Lnode3);
751 sprintf(nameNode,"SUBDEL%d",ndetL);
753 v0Lnode4 = new TNode(nameNode,nameNode,v0L4,0.0,0.0, 0.0,0);
754 v0Lnode4->SetLineColor(kColorVZERO);
755 fNodes->Add(v0Lnode4);
758 sprintf(nameNode,"SUBDEL%d",ndetL);
760 v0Lnode5 = new TNode(nameNode,nameNode,v0L5,0.0,0.0, 0.0,0);
761 v0Lnode5->SetLineColor(kColorVZERO);
762 fNodes->Add(v0Lnode5);
765 sprintf(nameNode,"SUBDEL%d",ndetL);
767 v0Lnode6 = new TNode(nameNode,nameNode,v0L6,0.0,0.0, 0.0,0);
768 v0Lnode6->SetLineColor(kColorVZERO);
769 fNodes->Add(v0Lnode6);
772 v0Lnode0->SetVisibility(2);
778 //_____________________________________________________________________________
779 void AliVZEROv2::CreateMaterials()
782 // Creates materials used for geometry
787 for(i=0;i<25;i++) printf("*");
788 printf(" VZERO create materials ");
789 for(i=0;i<26;i++) printf("*");
793 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,
794 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
797 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,
798 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
800 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
801 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
804 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
805 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
807 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
810 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
813 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,
814 1e-4,1e-4,1e-4,1e-4 };
815 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
819 Int_t *idtmed = fIdtmed->GetArray()-2999;
821 // TGeant3 *geant3 = (TGeant3*) gMC;
823 // Parameters related to Quarz (SiO2) :
825 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
837 // Parameters related to aluminum sheets :
844 // Parameters related to scintillator CH :
846 Float_t ascin[2] = {1.00794,12.011};
847 Float_t zscin[2] = {1.,6.};
848 Float_t wscin[2] = {1.,1.};
849 Float_t denscin = 1.032;
853 Float_t aAir[4]={12.,14.,16.,36.};
854 Float_t zAir[4]={6.,7.,8.,18.};
855 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
856 Float_t dAir = 1.20479E-3;
858 // Definition of materials :
860 AliMixture( 1, "AIR A$", aAir,zAir,dAir,4,wAir);
861 AliMixture(11, "AIR I$", aAir,zAir,dAir,4,wAir);
862 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
863 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
864 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
865 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
867 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
870 Int_t iSXFLD = gAlice->Field()->Integ();
871 Float_t sXMGMX = gAlice->Field()->Max();
873 Float_t tmaxfd, stemax, deemax, epsil, stmin;
882 AliMedium(1, "ACTIVE AIR$", 1, 1, iSXFLD, sXMGMX,
883 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
887 AliMedium(11, "INACTIVE AIR$", 11, 0, iSXFLD, sXMGMX,
888 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
890 AliMedium(2, "CARBON$ ", 2, 1, iSXFLD, sXMGMX,
891 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
893 AliMedium(3, "QUARZ$", 3, 1, iSXFLD, sXMGMX,
894 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
896 AliMedium(4,"ALUMINUM1$",4, 1, iSXFLD, sXMGMX,
897 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
900 AliMedium(5,"ALUMINUM2$",5, 1, iSXFLD, sXMGMX,
901 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
903 AliMedium(6,"SCINTILLATOR$",6, 1, iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
905 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
906 gMC->Gstpar(idtmed[3000], "HADR", 1.);
907 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
908 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
910 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
911 gMC->Gstpar(idtmed[3001], "HADR", 1.);
912 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
913 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
915 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
916 gMC->Gstpar(idtmed[3002], "HADR", 1.);
917 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
918 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
919 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
920 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
922 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
923 gMC->Gstpar(idtmed[3003], "HADR", 1.);
924 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
925 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
927 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
928 gMC->Gstpar(idtmed[3004], "HADR", 1.);
929 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
930 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
931 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
932 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
934 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
935 gMC->Gstpar(idtmed[3005], "HADR", 1.);
936 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
937 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
938 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
939 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
942 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
943 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
945 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
946 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
950 //_____________________________________________________________________________
951 void AliVZEROv2::DrawModule()
954 // Drawing is done in DrawVZERO.C
959 for(i=0;i<30;i++) printf("*");
960 printf(" VZERO DrawModule ");
961 for(i=0;i<30;i++) printf("*");
967 //_____________________________________________________________________________
968 void AliVZEROv2::Init()
970 // Initialises version 2 of the VZERO Detector
971 // Just prints an information message
973 printf(" VZERO version %d initialized \n",IsVersion());
975 // gMC->SetMaxStep(fMaxStepAlu);
976 // gMC->SetMaxStep(fMaxStepQua);
983 //_____________________________________________________________________________
984 void AliVZEROv2::StepManager()
987 // Step Manager, called at each step
991 static Float_t hits[19];
992 static Float_t eloss, tlength;
999 Float_t kRaddeg = 180.0/TMath::Pi();
1003 Float_t destep, step;
1006 // We keep only charged tracks :
1008 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
1011 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
1012 vol[2] = gMC->CurrentVolID(copy);
1016 if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
1017 gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
1019 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
1020 gMC->CurrentVolID(copy) == gMC->VolId("V0L2") )
1022 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
1023 gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
1025 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
1026 gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
1028 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R5") ||
1029 gMC->CurrentVolID(copy) == gMC->VolId("V0L5") ||
1030 gMC->CurrentVolID(copy) == gMC->VolId("V0L6") ||
1031 gMC->CurrentVolID(copy) == gMC->VolId("V0R6") )
1036 if ( ringNumber > 0.5 ) {
1038 destep = gMC->Edep();
1039 step = gMC->TrackStep();
1043 if ( gMC->IsTrackEntering() ) {
1045 gMC->TrackPosition(pos);
1047 gMC->TrackMomentum(mom);
1048 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1049 Double_t pt = TMath::Sqrt(tc);
1050 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1051 theta = Float_t(TMath::ATan2(pt,Double_t(mom[2])))*kRaddeg;
1052 phi = Float_t(TMath::ATan2(Double_t(pos[1]),Double_t(pos[0])))*kRaddeg;
1054 ////////////////////////////////////////////////////////////////////////////
1055 Float_t angle1 = Float_t(TMath::ATan2(Double_t(pos[1]),Double_t(pos[0])))*kRaddeg;
1056 if(angle1 < 0.0) angle1 = angle1 + 360.0;
1057 printf(" RingNumber, copy, phi1 = %f %d %f \n\n", ringNumber,vol[1],angle1);
1058 ////////////////////////////////////////////////////////////////////////////
1061 ipart = gMC->TrackPid();
1066 hits[3] = Float_t (ipart);
1068 hits[4] = gMC->TrackTime();
1069 hits[5] = gMC->TrackCharge();
1072 hits[8] = ringNumber;
1080 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
1081 hits[14] = par->Vx();
1082 hits[15] = par->Vy();
1083 hits[16] = par->Vz();
1090 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1095 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
1105 //_____________________________________________________________________________
1106 void AliVZEROv2::AddHit(Int_t track, Int_t *vol, Float_t *hits)
1111 TClonesArray &lhits = *fHits;
1112 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
1115 //_____________________________________________________________________________
1116 void AliVZEROv2::AddDigits(Int_t *tracks, Int_t* digits)
1119 // Adds a VZERO digit
1121 TClonesArray &ldigits = *fDigits;
1122 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
1125 //_____________________________________________________________________________
1126 void AliVZEROv2::MakeBranch(Option_t *option)
1129 // Creates new branches in the current Root Tree
1131 char branchname[10];
1132 sprintf(branchname,"%s",GetName());
1133 printf(" fBufferSize = %d \n",fBufferSize);
1135 const char *cH = strstr(option,"H");
1137 if (fHits && TreeH() && cH) {
1138 TreeH()->Branch(branchname,&fHits, fBufferSize);
1139 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1142 const char *cD = strstr(option,"D");
1144 if (fDigits && fLoader->TreeD() && cD) {
1145 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1146 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);