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 4 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 24th of february 2004 //
24 // (now 4 rings instead of 3 rings as in previous version) //
25 // V0R (now V0C) sits between Z values -89.4 and -84.9 cm //
26 // V0L (now V0A) sits between Z values +350.0 and +352.0 cm //
27 // New coordinate system has been implemented in october 2003 //
29 //////////////////////////////////////////////////////////////////////
31 // --- Standard libraries ---
32 #include <Riostream.h>
36 // --- ROOT libraries ---
37 #include <TClonesArray.h>
38 #include <TGeometry.h>
39 #include <TLorentzVector.h>
42 #include <TObjectTable.h>
45 #include <TVirtualMC.h>
46 #include <TParticle.h>
48 // --- AliRoot header files ---
53 #include "AliVZEROLoader.h"
54 #include "AliVZEROdigit.h"
55 #include "AliVZEROhit.h"
56 #include "AliVZEROv4.h"
60 //_____________________________________________________________________________
61 AliVZEROv4:: AliVZEROv4():AliVZERO()
63 // Standard default constructor
66 //_____________________________________________________________________________
67 AliVZEROv4::AliVZEROv4(const char *name, const char *title):
71 // Standard constructor for V-zero Detector version 2
76 for(i=0;i<26;i++) printf("*");
77 printf(" Create VZERO object ");
78 for(i=0;i<26;i++) printf("*");
81 fLightYield = 93.75; // Light yield in BC408 (93.75 eV per photon)
82 fLightAttenuation = 0.05; // Light attenuation in fiber (0.05 per meter)
83 fnMeters = 15.0; // Number of meters of clear fibers to PM
84 fFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
87 //_____________________________________________________________________________
88 void AliVZEROv4::CreateGeometry()
91 // Creates the GEANT geometry of the V-zero Detector version 3
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 height1Right, height2Right, height3Right, height4Right;
115 Float_t halfThickQua;
118 Float_t r0Right, r4Right;
119 Float_t pi = TMath::Pi();
121 height1Right = 3.42; // height of cell 1, in cm
122 height2Right = 6.78; // height of cell 2, in cm
123 height3Right = 7.11; // height of cell 3, in cm
124 height4Right = 10.91; // height of cell 4, 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...
132 // size of V0R box (fThickness) is increased by 1 mm as compared to version v2
134 fThickness = fThickness + 0.1;
135 zdet = 90.0 - 0.6 - fThickness/2.0; // distance to vertex (along Z axis)
136 r0Right = 4.05; // closest distance to center of the beam pipe
137 heightRight = height1Right + height2Right + height3Right + height4Right;
138 r4Right = r0Right + heightRight;
140 // Creation of mother volume v0LE - left part - :
141 // Entrance face at +350.0 cm (new coordinate system) ...
147 partube[2] = fThickness1/2.0;
149 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
151 // Creation of five rings - left part - :
152 // Entrance face at +350.0 cm (new coordinate system) ...
154 // Mother volume v0L0 in which will be set 5 scintillator cells
158 Float_t r0Left = 4.3;
159 Float_t height1Left = 3.6;
160 Float_t height2Left = 6.4;
161 Float_t height3Left = 14.9;
162 Float_t height4Left = 14.4;
163 Float_t heightLeft = height1Left + height2Left + height3Left + height4Left;
165 Float_t r4Left = r0Left + heightLeft;
169 partubs[2] = fThickness1/2.0;
170 partubs[3] = 90.0-15.0;
171 partubs[4] = 120.0-15.0;
173 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
175 Float_t r1Left = r0Left + height1Left;
180 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
181 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
183 Float_t r2Left = r1Left + height2Left;
188 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
189 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
191 Float_t r3Left = r2Left + height3Left;
196 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
197 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
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");
205 // Creation of mother volume v0RI - right part - :
207 partube[0] = r0Right - 0.2;
208 partube[1] = r4Right + 1.0;
209 partube[2] = fThickness/2.0;
211 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
213 // Creation of carbon lids (3.5 mm thick) to keep v0RI box shut...
215 Float_t lidThickness = 0.35;
217 partube[0] = r0Right;
218 partube[1] = r4Right;
219 partube[2] = +lidThickness/2.0;
221 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
222 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
223 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
225 // Creation of aluminum rings to maintain the v0RI pieces ...
227 partube[0] = r0Right - 0.2;
228 partube[1] = r0Right;
229 partube[2] = +fThickness/2.0;
231 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
232 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
234 partube[0] = r4Right;
235 partube[1] = r4Right + 1.0;
236 partube[2] = +fThickness/2.0;
238 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
239 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
241 // Mother volume v0R0 in which will be set 4 scintillator cells
243 partubs[0] = r0Right;
244 partubs[1] = r4Right;
245 partubs[2] = fThickness/2.0;
246 partubs[3] = 90.0-15.0;
247 partubs[4] = 120.0-15.0;
249 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
251 // Elementary cell of ring 1 :
252 // (cells of ring 1 will be shifted by 1.7 cm towards vertex to output fibers)
254 Float_t offsetFibers = 1.7;
255 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
256 Float_t r1Right = r0Right + height1Right;
258 partubs[0] = r0Right;
259 partubs[1] = r1Right;
260 partubs[2] = fThickness1/2.0;
262 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
263 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , -offset + offsetFibers, 0,"ONLY");
265 // Elementary cell of ring 2 :
267 Float_t r2Right = r1Right + height2Right;
269 partubs[0] = r1Right;
270 partubs[1] = r2Right;
272 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
273 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
276 // Elementary cell of ring 3 :
278 Float_t r3Right = r2Right + height3Right;
280 partubs[0] = r2Right;
281 partubs[1] = r3Right;
283 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
284 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
286 // Elementary cell of ring 4 :
288 partubs[0] = r3Right;
289 partubs[1] = r4Right;
291 gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5); // scintillator volume
292 gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
294 Float_t phiDeg = 180./6.;
298 for(Float_t phi = 15.0 ; phi < 360.0; phi = phi + phiDeg)
300 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
301 gMC->Gspos("V0R0",ndetR,"V0RI",0.0,
302 0.0,0.0,idrotm[902],"ONLY");
306 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,-zdet,0,"ONLY");
308 ncellsR = (ndetR - 1) * 4;
309 printf(" Number of cells on Right side = %d\n", ncellsR);
313 for(Float_t phi = 15.0 ; phi < 360.0; phi = phi + phiDeg)
315 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
316 gMC->Gspos("V0L0",ndetL,"V0LE",0.0,
317 0.0,0.0,idrotm[902],"ONLY");
321 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,350.0+fThickness1/2.0,0,"ONLY");
323 ncellsL = (ndetL - 1) * 4;
324 printf(" Number of cells on Left side = %d\n", ncellsL);
325 for(i=0;i<75;i++) printf("*");
330 //_____________________________________________________________________________
331 void AliVZEROv4::BuildGeometry()
334 // Builds simple ROOT TNode geometry for event display
339 for(i=0;i<30;i++) printf("*");
340 printf(" VZERO BuildGeometry ");
341 for(i=0;i<30;i++) printf("*");
346 TNode *v0Rnode, *v0Rnode0, *v0Rnode6 , *v0Rnode7, *v0Rnode8, *v0Rnode9;
347 TNode *v0Rnode1, *v0Rnode2, *v0Rnode3, *v0Rnode4;
348 TNode *v0Lnode, *v0Lnode0;
349 TNode *v0Lnode1, *v0Lnode2, *v0Lnode3, *v0Lnode4;
351 const int kColorVZERO = kGreen;
353 top = gAlice->GetGeometry()->GetNode("alice");
355 Float_t height1Right, height2Right, height3Right, height4Right;
359 Float_t halfThickQua;
361 Float_t r0Right, r4Right;
362 Float_t pi = TMath::Pi();
364 height1Right = 3.42; // height of cell 1, in cm
365 height2Right = 6.78; // height of cell 2, in cm
366 height3Right = 7.11; // height of cell 3, in cm
367 height4Right = 10.91; // height of cell 4, in cm
371 halfThickQua = fThickness1/2.0;
373 zdet = 90.0 - 0.6 - fThickness/2.0;
375 heightRight = height1Right + height2Right + height3Right + height4Right;
376 r4Right = r0Right + heightRight;
382 partube[0] = r0Right - 0.2;
383 partube[1] = r4Right + 1.0;
384 partube[2] = fThickness/2.0;
386 TTUBE *v0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
390 v0Rnode = new TNode("V0RI","V0RI",v0RI,0.0,0.0,-zdet,0);
392 v0Rnode->SetLineColor(kYellow);
393 fNodes->Add(v0Rnode);
394 v0Rnode->SetVisibility(2);
396 // Rondelles de carbone (epaisseur 3.5 mm) de maintien des cellules ...
398 Float_t lidThickness = 0.35;
400 partube[0] = r0Right;
401 partube[1] = r4Right;
402 partube[2] = +lidThickness/2.0;
404 TTUBE *v0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
407 v0Rnode6 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0, fThickness/2.0-partube[2],0);
408 v0Rnode6->SetLineColor(kYellow);
409 fNodes->Add(v0Rnode6);
411 v0Rnode7 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
412 v0Rnode7->SetLineColor(kYellow);
413 fNodes->Add(v0Rnode7);
415 partube[0] = r0Right - 0.2;
416 partube[1] = r0Right;
417 partube[2] = +fThickness/2.0;
419 TTUBE *v0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
422 v0Rnode8 = new TNode("V0IR", "V0IR",v0IR,0.0,0.0,0.0,0);
423 v0Rnode8->SetLineColor(kYellow);
424 fNodes->Add(v0Rnode8);
426 partube[0] = r4Right;
427 partube[1] = r4Right + 1.0;
428 partube[2] = +fThickness/2.0;
430 TTUBE *v0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
433 v0Rnode9 = new TNode("V0ER", "V0ER",v0ER,0.0,0.0,0.0,0);
434 v0Rnode9->SetLineColor(kYellow);
435 fNodes->Add(v0Rnode9);
439 partubs[0] = r0Right;
440 partubs[1] = r4Right;
441 partubs[2] = fThickness/2.0;
442 partubs[3] = 90.0-15.0;
443 partubs[4] = 120.0-15.0;
445 TTUBS *v0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
446 partubs[3], partubs[4]);
448 v0R0->SetNumberOfDivisions(ndiv);
450 Float_t r1Right = r0Right + height1Right;
451 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
452 Float_t offsetFibers = 1.7;
454 partubs[0] = r0Right;
455 partubs[1] = r1Right;
456 partubs[2] = fThickness1/2.0;
458 TTUBS *v0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
459 partubs[3], partubs[4]);
461 v0R1->SetNumberOfDivisions(ndiv);
463 Float_t r2Right = r1Right + height2Right;
465 partubs[0] = r1Right;
466 partubs[1] = r2Right;
468 TTUBS *v0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
469 partubs[3], partubs[4]);
471 v0R2->SetNumberOfDivisions(ndiv);
473 Float_t r3Right = r2Right + height3Right;
475 partubs[0] = r2Right;
476 partubs[1] = r3Right;
478 TTUBS *v0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
479 partubs[3], partubs[4]);
480 v0R3->SetNumberOfDivisions(ndiv);
482 partubs[0] = r3Right;
483 partubs[1] = r4Right;
485 TTUBS *v0R4 = new TTUBS("V0R4", "V0R4", "void", partubs[0], partubs[1], partubs[2],
486 partubs[3], partubs[4]);
487 v0R4->SetNumberOfDivisions(ndiv);
490 Float_t phiDeg= 180./6.;
496 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
499 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
501 sprintf(nameNode,"SUBDER%d",ndetR);
504 v0Rnode0 = new TNode(nameNode,nameNode,v0R0,0.0,0.0, 0.0,mat920);
505 v0Rnode0->SetLineColor(kYellow);
506 fNodes->Add(v0Rnode0);
509 sprintf(nameNode,"SUBDER%d",ndetR);
511 v0Rnode1 = new TNode(nameNode,nameNode,v0R1,0.0,0.0, -offset+ offsetFibers ,0);
512 v0Rnode1->SetLineColor(kColorVZERO);
513 fNodes->Add(v0Rnode1);
516 sprintf(nameNode,"SUBDER%d",ndetR);
518 v0Rnode2 = new TNode(nameNode,nameNode,v0R2,0.0,0.0, -offset,0);
519 v0Rnode2->SetLineColor(kColorVZERO);
520 fNodes->Add(v0Rnode2);
523 sprintf(nameNode,"SUBDER%d",ndetR);
525 v0Rnode3 = new TNode(nameNode,nameNode,v0R3,0.0,0.0, -offset,0);
526 v0Rnode3->SetLineColor(kColorVZERO);
527 fNodes->Add(v0Rnode3);
530 sprintf(nameNode,"SUBDER%d",ndetR);
532 v0Rnode4 = new TNode(nameNode,nameNode,v0R4,0.0,0.0, -offset,0);
533 v0Rnode4->SetLineColor(kColorVZERO);
534 fNodes->Add(v0Rnode4);
537 v0Rnode0->SetVisibility(2);
540 // Left side of VZERO :
542 Float_t r0Left = 4.3;
543 Float_t height1Left = 3.6;
544 Float_t height2Left = 6.4;
545 Float_t height3Left = 14.9;
546 Float_t height4Left = 14.4;
547 Float_t heightLeft = height1Left + height2Left + height3Left + height4Left;
549 Float_t r4Left = r0Left + heightLeft;
553 partube[2] = fThickness1/2.0;
555 TTUBE *v0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
559 v0Lnode = new TNode("V0LE","V0LE",v0LE,0.0,0.0,350.0+fThickness1/2.0,0);
561 v0Lnode->SetLineColor(kBlue);
562 fNodes->Add(v0Lnode);
564 v0Lnode->SetVisibility(2);
568 partubs[2] = fThickness1/2.0;
569 partubs[3] = 90.0-15.0;
570 partubs[4] = 120.0-15.0;
572 TTUBS *v0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
573 partubs[3], partubs[4]);
575 v0L0->SetNumberOfDivisions(ndiv);
576 v0L0->SetLineColor(7);
579 offsetLeft = - fThickness1/2.0;
581 Float_t r1Left = r0Left + height1Left;
586 TTUBS *v0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
587 partubs[3], partubs[4]);
588 v0L1->SetNumberOfDivisions(ndiv);
590 Float_t r2Left = r1Left + height2Left;
595 TTUBS *v0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
596 partubs[3], partubs[4]);
597 v0L2->SetNumberOfDivisions(ndiv);
599 Float_t r3Left = r2Left + height3Left;
604 TTUBS *v0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
605 partubs[3], partubs[4]);
606 v0L3->SetNumberOfDivisions(ndiv);
611 TTUBS *v0L4 = new TTUBS("V0L4", "V0L4", "void", partubs[0], partubs[1], partubs[2],
612 partubs[3], partubs[4]);
613 v0L4->SetNumberOfDivisions(ndiv);
617 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
621 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
623 sprintf(nameNode,"SUBDEL%d",ndetL);
626 v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offsetLeft + halfThickQua,mat920);
627 v0Lnode0->SetLineColor(kColorVZERO);
628 fNodes->Add(v0Lnode0);
631 sprintf(nameNode,"SUBDEL%d",ndetL);
633 v0Lnode1 = new TNode(nameNode,nameNode,v0L1,0.0,0.0, 0.0,0);
634 v0Lnode1->SetLineColor(kColorVZERO);
635 fNodes->Add(v0Lnode1);
638 sprintf(nameNode,"SUBDEL%d",ndetL);
640 v0Lnode2 = new TNode(nameNode,nameNode,v0L2,0.0,0.0, 0.0,0);
641 v0Lnode2->SetLineColor(kColorVZERO);
642 fNodes->Add(v0Lnode2);
645 sprintf(nameNode,"SUBDEL%d",ndetL);
647 v0Lnode3 = new TNode(nameNode,nameNode,v0L3,0.0,0.0, 0.0,0);
648 v0Lnode3->SetLineColor(kColorVZERO);
649 fNodes->Add(v0Lnode3);
652 sprintf(nameNode,"SUBDEL%d",ndetL);
654 v0Lnode4 = new TNode(nameNode,nameNode,v0L4,0.0,0.0, 0.0,0);
655 v0Lnode4->SetLineColor(kColorVZERO);
656 fNodes->Add(v0Lnode4);
659 v0Lnode0->SetVisibility(2);
663 //_____________________________________________________________________________
664 void AliVZEROv4::CreateMaterials()
667 // Creates materials used for geometry
672 for(i=0;i<25;i++) printf("*");
673 printf(" VZERO create materials ");
674 for(i=0;i<26;i++) printf("*");
678 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,
679 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
682 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,
683 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
685 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
686 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
689 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
690 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
692 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
695 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
698 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,
699 1e-4,1e-4,1e-4,1e-4 };
700 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
704 Int_t *idtmed = fIdtmed->GetArray()-2999;
707 // Parameters related to Quarz (SiO2) :
709 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
721 // Parameters related to aluminum sheets :
728 // Parameters related to scintillator CH :
730 Float_t ascin[2] = {1.00794,12.011};
731 Float_t zscin[2] = {1.,6.};
732 Float_t wscin[2] = {1.,1.};
733 Float_t denscin = 1.032;
737 Float_t aAir[4]={12.,14.,16.,36.};
738 Float_t zAir[4]={6.,7.,8.,18.};
739 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
740 Float_t dAir = 1.20479E-3;
742 // Definition of materials :
746 AliMixture( 1, "AIR A$", aAir,zAir,dAir,4,wAir);
747 AliMixture(11, "AIR I$", aAir,zAir,dAir,4,wAir);
748 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
749 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
750 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
751 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
753 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
756 Int_t iSXFLD = gAlice->Field()->Integ();
757 Float_t sXMGMX = gAlice->Field()->Max();
759 Float_t tmaxfd, stemax, deemax, epsil, stmin;
768 AliMedium(1, "ACTIVE AIR$", 1, 1, iSXFLD, sXMGMX,
769 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
773 AliMedium(11, "INACTIVE AIR$", 11, 0, iSXFLD, sXMGMX,
774 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
776 AliMedium(2, "CARBON$ ", 2, 1, iSXFLD, sXMGMX,
777 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
779 AliMedium(3, "QUARZ$", 3, 1, iSXFLD, sXMGMX,
780 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
782 AliMedium(4,"ALUMINUM1$",4, 1, iSXFLD, sXMGMX,
783 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
786 AliMedium(5,"ALUMINUM2$",5, 1, iSXFLD, sXMGMX,
787 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
789 AliMedium(6,"SCINTILLATOR$",6, 1, iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
791 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
792 gMC->Gstpar(idtmed[3000], "HADR", 1.);
793 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
794 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
796 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
797 gMC->Gstpar(idtmed[3001], "HADR", 1.);
798 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
799 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
801 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
802 gMC->Gstpar(idtmed[3002], "HADR", 1.);
803 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
804 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
805 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
806 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
808 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
809 gMC->Gstpar(idtmed[3003], "HADR", 1.);
810 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
811 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
813 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
814 gMC->Gstpar(idtmed[3004], "HADR", 1.);
815 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
816 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
817 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
818 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
820 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
821 gMC->Gstpar(idtmed[3005], "HADR", 1.);
822 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
823 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
824 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
825 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
828 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
829 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
831 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
832 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
836 //_____________________________________________________________________________
837 void AliVZEROv4::DrawModule()
840 // Drawing is done in DrawVZERO.C
845 for(i=0;i<30;i++) printf("*");
846 printf(" VZERO DrawModule ");
847 for(i=0;i<30;i++) printf("*");
851 //_____________________________________________________________________________
852 void AliVZEROv4::Init()
854 // Initialises version 2 of the VZERO Detector
855 // Just prints an information message
857 printf(" VZERO version %d initialized \n",IsVersion());
859 // gMC->SetMaxStep(fMaxStepAlu);
860 // gMC->SetMaxStep(fMaxStepQua);
865 //_____________________________________________________________________________
866 void AliVZEROv4::StepManager()
869 // Step Manager, called at each step
873 static Float_t hits[21];
874 static Float_t eloss, tlength;
875 static Int_t nPhotonsInStep;
876 static Int_t nPhotons;
877 static Int_t numStep;
879 Float_t destep, step;
883 // We keep only charged tracks :
885 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
887 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
888 vol[2] = gMC->CurrentVolID(copy);
891 if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R1") ||
892 gMC->CurrentVolID(copy) == gMC->VolId("V0L1") )
894 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R2") ||
895 gMC->CurrentVolID(copy) == gMC->VolId("V0L2") )
897 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R3") ||
898 gMC->CurrentVolID(copy) == gMC->VolId("V0L3") )
900 else if ( gMC->CurrentVolID(copy) == gMC->VolId("V0R4") ||
901 gMC->CurrentVolID(copy) == gMC->VolId("V0L4") )
906 if ( ringNumber > 0.5 ) {
908 destep = gMC->Edep();
909 step = gMC->TrackStep();
911 nPhotonsInStep = Int_t(destep / (fLightYield *1e-9) );
912 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
917 if ( gMC->IsTrackEntering() ) {
919 nPhotons = nPhotonsInStep;
920 gMC->TrackPosition(fTrackPosition);
921 gMC->TrackMomentum(fTrackMomentum);
923 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px() +
924 fTrackMomentum.Py() * fTrackMomentum.Py() );
926 hits[0] = fTrackPosition.X();
927 hits[1] = fTrackPosition.Y();
928 hits[2] = fTrackPosition.Z();
929 hits[3] = Float_t (gMC->TrackPid());
931 hits[4] = gMC->TrackTime();
932 hits[5] = gMC->TrackCharge();
933 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
934 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
935 hits[8] = ringNumber;
938 hits[10] = fTrackMomentum.P();
939 hits[11] = fTrackMomentum.Px();
940 hits[12] = fTrackMomentum.Py();
941 hits[13] = fTrackMomentum.Pz();
943 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
944 hits[14] = par->Vx();
945 hits[15] = par->Vy();
946 hits[16] = par->Vz();
952 nPhotons = nPhotons + nPhotonsInStep;
954 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
956 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * fLightAttenuation * fnMeters));
957 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fFibToPhot);
962 hits[20] = GetCellId (vol, hits);
964 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
977 //_____________________________________________________________________________
978 void AliVZEROv4::AddHit(Int_t track, Int_t *vol, Float_t *hits)
983 TClonesArray &lhits = *fHits;
984 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
987 //_____________________________________________________________________________
988 void AliVZEROv4::AddDigits(Int_t *tracks, Int_t* digits)
991 // Adds a VZERO digit
993 TClonesArray &ldigits = *fDigits;
994 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
997 //_____________________________________________________________________________
998 void AliVZEROv4::MakeBranch(Option_t *option)
1001 // Creates new branches in the current Root Tree
1003 char branchname[10];
1004 sprintf(branchname,"%s",GetName());
1005 printf(" fBufferSize = %d \n",fBufferSize);
1007 const char *cH = strstr(option,"H");
1009 if (fHits && TreeH() && cH) {
1010 TreeH()->Branch(branchname,&fHits, fBufferSize);
1011 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
1014 const char *cD = strstr(option,"D");
1016 if (fDigits && fLoader->TreeD() && cD) {
1017 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1018 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);
1023 //_____________________________________________________________________________
1024 Int_t AliVZEROv4::GetCellId(Int_t *vol, Float_t *hits)
1027 // Returns Id of scintillator cell
1028 // Right side from 0 to 47
1029 // Left side from 48 to 95
1031 Int_t index = vol[1];
1034 if (index < 10) index = index + 12;
1036 if (hits[2] < 0.0) {
1037 index = (index - 10) + ( ( Int_t(hits[8]) - 1 ) * 12);
1040 else if (hits[2] > 0.0)
1042 index = (index + 38) + ( ( Int_t(hits[8]) - 1 ) * 12);