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>
40 #include <TGeometry.h>
41 #include <TLorentzVector.h>
44 #include <TObjectTable.h>
47 #include <TVirtualMC.h>
48 #include <TParticle.h>
50 // --- AliRoot header files ---
55 #include "AliVZEROLoader.h"
56 #include "AliVZEROdigit.h"
57 #include "AliVZEROhit.h"
58 #include "AliVZEROv2.h"
62 //_____________________________________________________________________________
63 AliVZEROv2:: AliVZEROv2():AliVZERO()
65 // Standard default constructor
68 //_____________________________________________________________________________
69 AliVZEROv2::AliVZEROv2(const char *name, const char *title):
73 // Standard constructor for V-zero Detector version 2
78 for(i=0;i<26;i++) printf("*");
79 printf(" Create VZERO object ");
80 for(i=0;i<26;i++) printf("*");
85 //_____________________________________________________________________________
86 void AliVZEROv2::CreateGeometry()
89 // Creates the GEANT geometry of the V-zero Detector version 2
94 for(i=0;i<26;i++) printf("*");
95 printf(" Create VZERO Geometry ");
96 for(i=0;i<26;i++) printf("*");
99 Int_t *idtmed = fIdtmed->GetArray()-2999;
109 Float_t height1, height2, height3, height4, height5;
113 Float_t halfThickQua;
117 Float_t pi = TMath::Pi();
119 height1 = 1.82; // height of cell 1, in cm
120 height2 = 3.81; // height of cell 2, in cm
121 height3 = 4.72; // height of cell 3, in cm
122 height4 = 7.12; // height of cell 4, in cm
123 height5 = 10.83; // height of cell 5, in cm
125 theta = pi/6.0/2.0; // half angular opening = 15 degrees
127 halfThickQua= fThickness1/2.0; // half thickness of elementary cell (inner ring)
129 // distance 0.6 cm in zdet accounts for the fact V0R box back lid sits 0.6 away from
130 // absorber nose sitting at 90 cm. Will use -zdet later...
132 zdet = 90.0 - 0.6 -fThickness/2.0; // distance to vertex (along Z axis)
133 r0 = 4.05; // closest distance to center of the beam pipe
134 height = height1 + height2 + height3 + height4 + height5;
137 // Creation of mother volume v0LE - left part - :
138 // Entrance face at +350.0 cm (new coordinate system) ...
144 partube[2] = fThickness1/2.0;
146 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
148 // Creation of five rings - left part - :
149 // Entrance face at +350.0 cm (new coordinate system) ...
151 // Mother volume v0L0 in which will be set 5 scintillator cells
155 Float_t r0Left = 4.3;
156 Float_t height1Left = 2.6;
157 Float_t height2Left = 4.1;
158 Float_t height3Left = 6.4;
159 Float_t height4Left = 10.2;
160 Float_t height5Left = 16.9;
161 Float_t heightLeft = height1Left + height2Left + height3Left
162 + height4Left + height5Left;
163 Float_t r5Left = r0Left + heightLeft;
167 partubs[2] = fThickness1/2.0;
168 partubs[3] = 90.0-15.0;
169 partubs[4] = 120.0-15.0;
171 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
173 Float_t r1Left = r0Left + height1Left;
178 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
179 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
181 Float_t r2Left = r1Left + height2Left;
186 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
187 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
189 Float_t r3Left = r2Left + height3Left;
194 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
195 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
197 Float_t r4Left = r3Left + height4Left;
202 gMC->Gsvolu("V0L4","TUBS",idtmed[3005],partubs,5); // quartz volume
203 gMC->Gspos("V0L4",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
207 partubs[3] = 90.0-15.0;
208 partubs[4] = 120.0-30.0;
210 gMC->Gsvolu("V0L5","TUBS",idtmed[3005],partubs,5); // quartz volume
211 gMC->Gspos("V0L5",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
213 partubs[3] = 120.0-30.0;
214 partubs[4] = 120.0-15.0;
216 gMC->Gsvolu("V0L6","TUBS",idtmed[3005],partubs,5); // quartz volume
217 gMC->Gspos("V0L6",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
220 // Creation of mother volume v0RI - right part - :
222 partube[0] = r0 - 0.2;
223 partube[1] = r5 + 1.0;
224 partube[2] = fThickness/2.0;
226 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
228 // Creation of carbon lids (2 mm thick) to keep v0RI box shut...
230 Float_t lidThickness = 0.2;
234 partube[2] = +lidThickness/2.0;
236 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
237 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
238 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
240 // Creation of aluminum rings to maintain the v0RI pieces ...
242 partube[0] = r0 - 0.2;
244 partube[2] = +fThickness/2.0;
246 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
247 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
250 partube[1] = r5 + 1.0;
251 partube[2] = +fThickness/2.0;
253 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
254 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
256 // Mother volume v0R0 in which will be set 5 scintillator cells
260 partubs[2] = fThickness/2.0;
261 partubs[3] = 90.0-15.0;
262 partubs[4] = 120.0-15.0;
264 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
266 // Elementary cell of ring 1 :
267 // (cells 2 and 3 will be shifted by 1 cm to output fibers)
269 Float_t offsetFibers = 1.0;
270 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
271 Float_t r1 = r0 + height1;
275 partubs[2] = fThickness1/2.0;
277 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
278 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
280 // Elementary cell of ring 2 :
282 Float_t r2 = r1 + height2;
287 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
288 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , -offset + offsetFibers, 0,"ONLY");
291 // Elementary cell of ring 3 :
293 Float_t r3 = r2 + height3;
298 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
299 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
301 // Elementary cell of ring 4 :
303 Float_t r4 = r3 + height4 ;
308 gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5); // scintillator volume
309 gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
311 // Elementary cells of ring 5 :
315 partubs[3] = 90.0-15.0;
316 partubs[4] = 120.0-30.0;
318 gMC->Gsvolu("V0R5","TUBS",idtmed[3005],partubs,5); // scintillator volume
319 gMC->Gspos("V0R5",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
321 partubs[3] = 120.0-30.0;
322 partubs[4] = 120.0-15.0;
324 gMC->Gsvolu("V0R6","TUBS",idtmed[3005],partubs,5); // scintillator volume
325 gMC->Gspos("V0R6",1,"V0R0", 0.0, 0.0 , -offset + 2.0 * offsetFibers, 0,"ONLY");
327 Float_t phiDeg = 180./6.;
331 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phiDeg)
333 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
334 gMC->Gspos("V0R0",ndetR,"V0RI",0.0,
335 0.0,0.0,idrotm[902],"ONLY");
339 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,-zdet,0,"ONLY");
341 ncellsR = (ndetR - 1) * 6;
342 printf(" Number of cells on Right side = %d\n", ncellsR);
346 for(Float_t phi = 15.0; phi < 360.0; phi = phi + phiDeg)
348 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
349 gMC->Gspos("V0L0",ndetL,"V0LE",0.0,
350 0.0,0.0,idrotm[902],"ONLY");
354 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,350.0+fThickness1/2.0,0,"ONLY");
356 ncellsL = (ndetL - 1) * 6;
357 printf(" Number of cells on Left side = %d\n", ncellsL);
358 for(i=0;i<75;i++) printf("*");
363 //_____________________________________________________________________________
364 void AliVZEROv2::BuildGeometry()
367 // Builds simple ROOT TNode geometry for event display
372 for(i=0;i<30;i++) printf("*");
373 printf(" VZERO BuildGeometry ");
374 for(i=0;i<30;i++) printf("*");
379 TNode *v0Rnode, *v0Rnode0, *v0Rnode6 , *v0Rnode7, *v0Rnode8, *v0Rnode9;
380 TNode *v0Rnode1, *v0Rnode2, *v0Rnode3, *v0Rnode4, *v0Rnode5;
381 TNode *v0Lnode, *v0Lnode0;
382 TNode *v0Lnode1, *v0Lnode2, *v0Lnode3, *v0Lnode4, *v0Lnode5, *v0Lnode6;
384 const int kColorVZERO = kGreen;
386 top = gAlice->GetGeometry()->GetNode("alice");
388 Float_t height1, height2, height3, height4, height5;
392 Float_t halfThickQua;
395 Float_t pi = TMath::Pi();
397 height1 = 1.82; // height of cell 1, in cm
398 height2 = 3.81; // height of cell 2, in cm
399 height3 = 4.72; // height of cell 3, in cm
400 height4 = 7.12; // height of cell 4, in cm
401 height5 = 10.83; // height of cell 5, in cm
405 halfThickQua = fThickness1/2.0;
407 zdet = 90.0 - 0.6 - fThickness/2.0;
409 height = height1 + height2 + height3 + height4 + height5;
416 partube[0] = r0 - 0.2;
417 partube[1] = r5 + 1.0;
418 partube[2] = fThickness/2.0;
420 TTUBE *v0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
424 v0Rnode = new TNode("V0RI","V0RI",v0RI,0.0,0.0,-zdet,0);
426 v0Rnode->SetLineColor(kYellow);
427 fNodes->Add(v0Rnode);
428 v0Rnode->SetVisibility(2);
430 // Rondelles de carbone (epaisseur 2 mm) de maintien des cellules ...
432 Float_t lidThickness = 0.2;
436 partube[2] = +lidThickness/2.0;
438 TTUBE *v0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
441 v0Rnode6 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0, fThickness/2.0-partube[2],0);
442 v0Rnode6->SetLineColor(kYellow);
443 fNodes->Add(v0Rnode6);
445 v0Rnode7 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
446 v0Rnode7->SetLineColor(kYellow);
447 fNodes->Add(v0Rnode7);
449 partube[0] = r0 - 0.2;
451 partube[2] = +fThickness/2.0;
453 TTUBE *v0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
456 v0Rnode8 = new TNode("V0IR", "V0IR",v0IR,0.0,0.0,0.0,0);
457 v0Rnode8->SetLineColor(kYellow);
458 fNodes->Add(v0Rnode8);
461 partube[1] = r5 + 1.0;
462 partube[2] = +fThickness/2.0;
464 TTUBE *v0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
467 v0Rnode9 = new TNode("V0ER", "V0ER",v0ER,0.0,0.0,0.0,0);
468 v0Rnode9->SetLineColor(kYellow);
469 fNodes->Add(v0Rnode9);
475 partubs[2] = fThickness/2.0;
476 partubs[3] = 90.0-15.0;
477 partubs[4] = 120.0-15.0;
479 TTUBS *v0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
480 partubs[3], partubs[4]);
482 v0R0->SetNumberOfDivisions(ndiv);
484 Float_t r1 = r0 + height1;
485 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
486 Float_t offsetFibers = 1.0;
490 partubs[2] = fThickness1/2.0;
492 TTUBS *v0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
493 partubs[3], partubs[4]);
495 v0R1->SetNumberOfDivisions(ndiv);
497 Float_t r2 = r1 + height2;
502 TTUBS *v0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
503 partubs[3], partubs[4]);
505 v0R2->SetNumberOfDivisions(ndiv);
507 Float_t r3 = r2 + height3;
512 TTUBS *v0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
513 partubs[3], partubs[4]);
514 v0R3->SetNumberOfDivisions(ndiv);
516 Float_t r4 = r3 + height4;
521 TTUBS *v0R4 = new TTUBS("V0R4", "V0R4", "void", partubs[0], partubs[1], partubs[2],
522 partubs[3], partubs[4]);
524 v0R4->SetNumberOfDivisions(ndiv);
528 partubs[3] = 90.0-15.0;
529 partubs[4] = 120.0-30.0;
531 TTUBS *v0R5 = new TTUBS("V0R5", "V0R5", "void", partubs[0], partubs[1], partubs[2],
532 partubs[3], partubs[4]);
534 v0R5->SetNumberOfDivisions(ndiv);
536 partubs[3] = 120.0-30.0;
537 partubs[4] = 120.0-15.0;
539 TTUBS *v0R6 = new TTUBS("V0R6", "V0R6", "void", partubs[0], partubs[1], partubs[2],
540 partubs[3], partubs[4]);
542 v0R6->SetNumberOfDivisions(ndiv);
545 Float_t phiDeg= 180./6.;
551 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
555 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
557 sprintf(nameNode,"SUBDER%d",ndetR);
560 v0Rnode0 = new TNode(nameNode,nameNode,v0R0,0.0,0.0, 0.0,mat920);
561 v0Rnode0->SetLineColor(kYellow);
562 fNodes->Add(v0Rnode0);
565 sprintf(nameNode,"SUBDER%d",ndetR);
567 v0Rnode1 = new TNode(nameNode,nameNode,v0R1,0.0,0.0, -offset,0);
568 v0Rnode1->SetLineColor(kColorVZERO);
569 fNodes->Add(v0Rnode1);
572 sprintf(nameNode,"SUBDER%d",ndetR);
574 v0Rnode2 = new TNode(nameNode,nameNode,v0R2,0.0,0.0, -offset + offsetFibers,0);
575 v0Rnode2->SetLineColor(kColorVZERO);
576 fNodes->Add(v0Rnode2);
579 sprintf(nameNode,"SUBDER%d",ndetR);
581 v0Rnode3 = new TNode(nameNode,nameNode,v0R3,0.0,0.0, -offset + 2.0*offsetFibers,0);
582 v0Rnode3->SetLineColor(kColorVZERO);
583 fNodes->Add(v0Rnode3);
586 sprintf(nameNode,"SUBDER%d",ndetR);
588 v0Rnode4 = new TNode(nameNode,nameNode,v0R4,0.0,0.0, -offset + 2.0*offsetFibers,0);
589 v0Rnode4->SetLineColor(kColorVZERO);
590 fNodes->Add(v0Rnode4);
593 sprintf(nameNode,"SUBDER%d",ndetR);
595 v0Rnode5 = new TNode(nameNode,nameNode,v0R5,0.0,0.0, -offset + 2.0*offsetFibers,0);
596 v0Rnode5->SetLineColor(kColorVZERO);
597 fNodes->Add(v0Rnode5);
600 sprintf(nameNode,"SUBDER%d",ndetR);
602 v0Rnode6 = new TNode(nameNode,nameNode,v0R6,0.0,0.0, -offset + 2.0*offsetFibers,0);
603 v0Rnode6->SetLineColor(kColorVZERO);
604 fNodes->Add(v0Rnode6);
607 v0Rnode0->SetVisibility(2);
611 // Left side of VZERO :
613 Float_t r0Left = 4.3;
614 Float_t height1Left = 2.6;
615 Float_t height2Left = 4.1;
616 Float_t height3Left = 6.4;
617 Float_t height4Left = 10.2;
618 Float_t height5Left = 16.9;
619 Float_t heightLeft = height1Left + height2Left + height3Left
620 + height4Left + height5Left;
621 Float_t r5Left = r0Left + heightLeft;
625 partube[2] = fThickness1/2.0;
627 TTUBE *v0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
631 v0Lnode = new TNode("V0LE","V0LE",v0LE,0.0,0.0,350.0+fThickness1/2.0,0);
633 v0Lnode->SetLineColor(kBlue);
634 fNodes->Add(v0Lnode);
636 v0Lnode->SetVisibility(2);
640 partubs[2] = fThickness1/2.0;
641 partubs[3] = 90.0-15.0;
642 partubs[4] = 120.0-15.0;
644 TTUBS *v0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
645 partubs[3], partubs[4]);
647 v0L0->SetNumberOfDivisions(ndiv);
648 v0L0->SetLineColor(7);
651 offsetLeft = - fThickness1/2.0;
653 Float_t r1Left = r0Left + height1Left;
658 TTUBS *v0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
659 partubs[3], partubs[4]);
661 v0L1->SetNumberOfDivisions(ndiv);
663 Float_t r2Left = r1Left + height2Left;
668 TTUBS *v0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
669 partubs[3], partubs[4]);
671 v0L2->SetNumberOfDivisions(ndiv);
673 Float_t r3Left = r2Left + height3Left;
678 TTUBS *v0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
679 partubs[3], partubs[4]);
680 v0L3->SetNumberOfDivisions(ndiv);
682 Float_t r4Left = r3Left + height4Left;
687 TTUBS *v0L4 = new TTUBS("V0L4", "V0L4", "void", partubs[0], partubs[1], partubs[2],
688 partubs[3], partubs[4]);
690 v0L4->SetNumberOfDivisions(ndiv);
694 partubs[3] = 90.0-15.0;
695 partubs[4] = 120.0-30.0;
697 TTUBS *v0L5 = new TTUBS("V0L5", "V0L5", "void", partubs[0], partubs[1], partubs[2],
698 partubs[3], partubs[4]);
701 v0L5->SetNumberOfDivisions(ndiv);
703 partubs[3] = 120.0-30.0;
704 partubs[4] = 120.0-15.0;
706 TTUBS *v0L6 = new TTUBS("V0L6", "V0L6", "void", partubs[0], partubs[1], partubs[2],
707 partubs[3], partubs[4]);
709 v0L6->SetNumberOfDivisions(ndiv);
713 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
717 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
720 sprintf(nameNode,"SUBDEL%d",ndetL);
723 v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offsetLeft + halfThickQua,mat920);
724 v0Lnode0->SetLineColor(kColorVZERO);
725 fNodes->Add(v0Lnode0);
728 sprintf(nameNode,"SUBDEL%d",ndetL);
730 v0Lnode1 = new TNode(nameNode,nameNode,v0L1,0.0,0.0, 0.0,0);
731 v0Lnode1->SetLineColor(kColorVZERO);
732 fNodes->Add(v0Lnode1);
735 sprintf(nameNode,"SUBDEL%d",ndetL);
737 v0Lnode2 = new TNode(nameNode,nameNode,v0L2,0.0,0.0, 0.0,0);
738 v0Lnode2->SetLineColor(kColorVZERO);
739 fNodes->Add(v0Lnode2);
743 sprintf(nameNode,"SUBDEL%d",ndetL);
745 v0Lnode3 = new TNode(nameNode,nameNode,v0L3,0.0,0.0, 0.0,0);
746 v0Lnode3->SetLineColor(kColorVZERO);
747 fNodes->Add(v0Lnode3);
750 sprintf(nameNode,"SUBDEL%d",ndetL);
752 v0Lnode4 = new TNode(nameNode,nameNode,v0L4,0.0,0.0, 0.0,0);
753 v0Lnode4->SetLineColor(kColorVZERO);
754 fNodes->Add(v0Lnode4);
757 sprintf(nameNode,"SUBDEL%d",ndetL);
759 v0Lnode5 = new TNode(nameNode,nameNode,v0L5,0.0,0.0, 0.0,0);
760 v0Lnode5->SetLineColor(kColorVZERO);
761 fNodes->Add(v0Lnode5);
764 sprintf(nameNode,"SUBDEL%d",ndetL);
766 v0Lnode6 = new TNode(nameNode,nameNode,v0L6,0.0,0.0, 0.0,0);
767 v0Lnode6->SetLineColor(kColorVZERO);
768 fNodes->Add(v0Lnode6);
771 v0Lnode0->SetVisibility(2);
777 //_____________________________________________________________________________
778 void AliVZEROv2::CreateMaterials()
781 // Creates materials used for geometry
786 for(i=0;i<25;i++) printf("*");
787 printf(" VZERO create materials ");
788 for(i=0;i<26;i++) printf("*");
792 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,
793 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
796 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,
797 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
799 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
800 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
803 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
804 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
806 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
809 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
812 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,
813 1e-4,1e-4,1e-4,1e-4 };
814 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
818 Int_t *idtmed = fIdtmed->GetArray()-2999;
821 // Parameters related to Quarz (SiO2) :
823 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
835 // Parameters related to aluminum sheets :
842 // Parameters related to scintillator CH :
844 Float_t ascin[2] = {1.00794,12.011};
845 Float_t zscin[2] = {1.,6.};
846 Float_t wscin[2] = {1.,1.};
847 Float_t denscin = 1.032;
851 Float_t aAir[4]={12.,14.,16.,36.};
852 Float_t zAir[4]={6.,7.,8.,18.};
853 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
854 Float_t dAir = 1.20479E-3;
856 // Definition of materials :
858 AliMixture( 1, "AIR A$", aAir,zAir,dAir,4,wAir);
859 AliMixture(11, "AIR I$", aAir,zAir,dAir,4,wAir);
860 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
861 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
862 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
863 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
865 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
868 Int_t iSXFLD = gAlice->Field()->Integ();
869 Float_t sXMGMX = gAlice->Field()->Max();
871 Float_t tmaxfd, stemax, deemax, epsil, stmin;
880 AliMedium(1, "ACTIVE AIR$", 1, 1, iSXFLD, sXMGMX,
881 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
885 AliMedium(11, "INACTIVE AIR$", 11, 0, iSXFLD, sXMGMX,
886 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
888 AliMedium(2, "CARBON$ ", 2, 1, iSXFLD, sXMGMX,
889 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
891 AliMedium(3, "QUARZ$", 3, 1, iSXFLD, sXMGMX,
892 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
894 AliMedium(4,"ALUMINUM1$",4, 1, iSXFLD, sXMGMX,
895 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
898 AliMedium(5,"ALUMINUM2$",5, 1, iSXFLD, sXMGMX,
899 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
901 AliMedium(6,"SCINTILLATOR$",6, 1, iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
903 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
904 gMC->Gstpar(idtmed[3000], "HADR", 1.);
905 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
906 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
908 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
909 gMC->Gstpar(idtmed[3001], "HADR", 1.);
910 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
911 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
913 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
914 gMC->Gstpar(idtmed[3002], "HADR", 1.);
915 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
916 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
917 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
918 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
920 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
921 gMC->Gstpar(idtmed[3003], "HADR", 1.);
922 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
923 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
925 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
926 gMC->Gstpar(idtmed[3004], "HADR", 1.);
927 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
928 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
929 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
930 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
932 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
933 gMC->Gstpar(idtmed[3005], "HADR", 1.);
934 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
935 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
936 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
937 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
940 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
941 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
943 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
944 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
948 //_____________________________________________________________________________
949 void AliVZEROv2::DrawModule()
952 // Drawing is done in DrawVZERO.C
957 for(i=0;i<30;i++) printf("*");
958 printf(" VZERO DrawModule ");
959 for(i=0;i<30;i++) printf("*");
965 //_____________________________________________________________________________
966 void AliVZEROv2::Init()
968 // Initialises version 2 of the VZERO Detector
969 // Just prints an information message
971 printf(" VZERO version %d initialized \n",IsVersion());
973 // gMC->SetMaxStep(fMaxStepAlu);
974 // gMC->SetMaxStep(fMaxStepQua);
981 //_____________________________________________________________________________
982 void AliVZEROv2::StepManager()
985 // Step Manager, called at each step
989 static Float_t hits[19];
990 static Float_t eloss, tlength;
997 Float_t kRaddeg = 180.0/TMath::Pi();
1001 Float_t destep, step;
1004 // We keep only charged tracks :
1006 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
1009 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
1010 vol[2] = gMC->CurrentVolID(copy);
1013 static Int_t idV0R1 = gMC->VolId("V0R1");
1014 static Int_t idV0L1 = gMC->VolId("V0L1");
1015 static Int_t idV0R2 = gMC->VolId("V0R2");
1016 static Int_t idV0L2 = gMC->VolId("V0L2");
1017 static Int_t idV0R3 = gMC->VolId("V0R3");
1018 static Int_t idV0L3 = gMC->VolId("V0L3");
1019 static Int_t idV0R4 = gMC->VolId("V0R4");
1020 static Int_t idV0L4 = gMC->VolId("V0L4");
1021 static Int_t idV0R5 = gMC->VolId("V0R5");
1022 static Int_t idV0L5 = gMC->VolId("V0L5");
1023 static Int_t idV0R6 = gMC->VolId("V0R6");
1024 static Int_t idV0L6 = gMC->VolId("V0L6");
1026 if ( gMC->CurrentVolID(copy) == idV0R1 ||
1027 gMC->CurrentVolID(copy) == idV0L1 )
1029 else if ( gMC->CurrentVolID(copy) == idV0R2 ||
1030 gMC->CurrentVolID(copy) == idV0L2 )
1032 else if ( gMC->CurrentVolID(copy) == idV0R3 ||
1033 gMC->CurrentVolID(copy) == idV0L3 )
1035 else if ( gMC->CurrentVolID(copy) == idV0R4 ||
1036 gMC->CurrentVolID(copy) == idV0L4 )
1038 else if ( gMC->CurrentVolID(copy) == idV0R5 ||
1039 gMC->CurrentVolID(copy) == idV0L5 ||
1040 gMC->CurrentVolID(copy) == idV0R6 ||
1041 gMC->CurrentVolID(copy) == idV0L6 )
1046 if ( ringNumber > 0.5 ) {
1048 destep = gMC->Edep();
1049 step = gMC->TrackStep();
1053 if ( gMC->IsTrackEntering() ) {
1055 gMC->TrackPosition(pos);
1057 gMC->TrackMomentum(mom);
1058 Double_t tc = mom[0]*mom[0]+mom[1]*mom[1];
1059 Double_t pt = TMath::Sqrt(tc);
1060 Double_t pmom = TMath::Sqrt(tc+mom[2]*mom[2]);
1061 theta = Float_t(TMath::ATan2(pt,Double_t(mom[2])))*kRaddeg;
1062 phi = Float_t(TMath::ATan2(Double_t(pos[1]),Double_t(pos[0])))*kRaddeg;
1064 ////////////////////////////////////////////////////////////////////////////
1065 Float_t angle1 = Float_t(TMath::ATan2(Double_t(pos[1]),Double_t(pos[0])))*kRaddeg;
1066 if(angle1 < 0.0) angle1 = angle1 + 360.0;
1067 printf(" RingNumber, copy, phi1 = %f %d %f \n\n", ringNumber,vol[1],angle1);
1068 ////////////////////////////////////////////////////////////////////////////
1071 ipart = gMC->TrackPid();
1076 hits[3] = Float_t (ipart);
1078 hits[4] = gMC->TrackTime();
1079 hits[5] = gMC->TrackCharge();
1082 hits[8] = ringNumber;
1090 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
1091 hits[14] = par->Vx();
1092 hits[15] = par->Vy();
1093 hits[16] = par->Vz();
1100 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
1105 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
1115 //_____________________________________________________________________________
1116 void AliVZEROv2::AddHit(Int_t track, Int_t *vol, Float_t *hits)
1121 TClonesArray &lhits = *fHits;
1122 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
1125 //_____________________________________________________________________________
1126 void AliVZEROv2::AddDigits(Int_t *tracks, Int_t* digits)
1129 // Adds a VZERO digit
1131 TClonesArray &ldigits = *fDigits;
1132 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
1135 //_____________________________________________________________________________
1136 void AliVZEROv2::MakeBranch(Option_t *option)
1139 // Creates new branches in the current Root Tree
1141 char branchname[10];
1142 sprintf(branchname,"%s",GetName());
1143 printf(" fBufferSize = %d \n",fBufferSize);
1145 const char *cH = strstr(option,"H");
1147 if (fHits && TreeH() && cH) {
1148 TreeH()->Branch(branchname,&fHits, fBufferSize);
1149 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1152 const char *cD = strstr(option,"D");
1154 if (fDigits && fLoader->TreeD() && cD) {
1155 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1156 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);