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 ---
54 #include "AliVZEROLoader.h"
55 #include "AliVZEROdigit.h"
56 #include "AliVZEROhit.h"
57 #include "AliVZEROv4.h"
61 //_____________________________________________________________________________
62 AliVZEROv4:: AliVZEROv4():AliVZERO()
64 // Standard default constructor
67 //_____________________________________________________________________________
68 AliVZEROv4::AliVZEROv4(const char *name, const char *title):
72 // Standard constructor for V-zero Detector version 2
74 AliDebug(2,"Create VZERO object");
76 fLightYield = 93.75; // Light yield in BC408 (93.75 eV per photon)
77 fLightAttenuation = 0.05; // Light attenuation in fiber (0.05 per meter)
78 fnMeters = 15.0; // Number of meters of clear fibers to PM
79 fFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
82 //_____________________________________________________________________________
83 void AliVZEROv4::CreateGeometry()
86 // Creates the GEANT geometry of the V-zero Detector version 3
88 AliDebug(2,"Create VZERO Geometry ");
90 Int_t *idtmed = fIdtmed->GetArray()-2999;
100 Float_t height1Right, height2Right, height3Right, height4Right;
104 Float_t halfThickQua;
107 Float_t r0Right, r4Right;
108 Float_t pi = TMath::Pi();
110 height1Right = 3.42; // height of cell 1, in cm
111 height2Right = 6.78; // height of cell 2, in cm
112 height3Right = 7.11; // height of cell 3, in cm
113 height4Right = 10.91; // height of cell 4, in cm
115 theta = pi/6.0/2.0; // half angular opening = 15 degrees
117 halfThickQua= fThickness1/2.0; // half thickness of elementary cell (inner ring)
119 // distance 0.6 cm in zdet accounts for the fact V0R box back lid sits 0.6 away from
120 // absorber nose sitting at 90 cm. Will use -zdet later...
121 // size of V0R box (fThickness) is increased by 1 mm as compared to version v2
123 fThickness = fThickness + 0.1;
124 zdet = 90.0 - 0.6 - fThickness/2.0; // distance to vertex (along Z axis)
125 r0Right = 4.05; // closest distance to center of the beam pipe
126 heightRight = height1Right + height2Right + height3Right + height4Right;
127 r4Right = r0Right + heightRight;
129 // Creation of mother volume v0LE - left part - :
130 // Entrance face at +350.0 cm (new coordinate system) ...
136 partube[2] = fThickness1/2.0;
138 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
140 // Creation of five rings - left part - :
141 // Entrance face at +350.0 cm (new coordinate system) ...
143 // Mother volume v0L0 in which will be set 5 scintillator cells
147 Float_t r0Left = 4.3;
148 Float_t height1Left = 3.6;
149 Float_t height2Left = 6.4;
150 Float_t height3Left = 14.9;
151 Float_t height4Left = 14.4;
152 Float_t heightLeft = height1Left + height2Left + height3Left + height4Left;
154 Float_t r4Left = r0Left + heightLeft;
158 partubs[2] = fThickness1/2.0;
159 partubs[3] = 90.0-15.0;
160 partubs[4] = 120.0-15.0;
162 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
164 Float_t r1Left = r0Left + height1Left;
169 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
170 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
172 Float_t r2Left = r1Left + height2Left;
177 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
178 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
180 Float_t r3Left = r2Left + height3Left;
185 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
186 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
191 gMC->Gsvolu("V0L4","TUBS",idtmed[3005],partubs,5); // quartz volume
192 gMC->Gspos("V0L4",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
194 // Creation of mother volume v0RI - right part - :
196 partube[0] = r0Right - 0.2;
197 partube[1] = r4Right + 1.0;
198 partube[2] = fThickness/2.0;
200 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
202 // Creation of carbon lids (3.5 mm thick) to keep v0RI box shut...
204 Float_t lidThickness = 0.35;
206 partube[0] = r0Right;
207 partube[1] = r4Right;
208 partube[2] = +lidThickness/2.0;
210 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
211 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
212 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
214 // Creation of aluminum rings to maintain the v0RI pieces ...
216 partube[0] = r0Right - 0.2;
217 partube[1] = r0Right;
218 partube[2] = +fThickness/2.0;
220 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
221 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
223 partube[0] = r4Right;
224 partube[1] = r4Right + 1.0;
225 partube[2] = +fThickness/2.0;
227 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
228 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
230 // Mother volume v0R0 in which will be set 4 scintillator cells
232 partubs[0] = r0Right;
233 partubs[1] = r4Right;
234 partubs[2] = fThickness/2.0;
235 partubs[3] = 90.0-15.0;
236 partubs[4] = 120.0-15.0;
238 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
240 // Elementary cell of ring 1 :
241 // (cells of ring 1 will be shifted by 1.7 cm towards vertex to output fibers)
243 Float_t offsetFibers = 1.7;
244 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
245 Float_t r1Right = r0Right + height1Right;
247 partubs[0] = r0Right;
248 partubs[1] = r1Right;
249 partubs[2] = fThickness1/2.0;
251 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
252 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , -offset + offsetFibers, 0,"ONLY");
254 // Elementary cell of ring 2 :
256 Float_t r2Right = r1Right + height2Right;
258 partubs[0] = r1Right;
259 partubs[1] = r2Right;
261 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
262 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
265 // Elementary cell of ring 3 :
267 Float_t r3Right = r2Right + height3Right;
269 partubs[0] = r2Right;
270 partubs[1] = r3Right;
272 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
273 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
275 // Elementary cell of ring 4 :
277 partubs[0] = r3Right;
278 partubs[1] = r4Right;
280 gMC->Gsvolu("V0R4","TUBS",idtmed[3005],partubs,5); // scintillator volume
281 gMC->Gspos("V0R4",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
283 Float_t phiDeg = 180./6.;
287 for(Float_t phi = 15.0 ; phi < 360.0; phi = phi + phiDeg)
289 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
290 gMC->Gspos("V0R0",ndetR,"V0RI",0.0,
291 0.0,0.0,idrotm[902],"ONLY");
295 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,-zdet,0,"ONLY");
297 ncellsR = (ndetR - 1) * 4;
298 AliInfo(Form("Number of cells on Right side = %d", ncellsR));
302 for(Float_t phi = 15.0 ; phi < 360.0; phi = phi + phiDeg)
304 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
305 gMC->Gspos("V0L0",ndetL,"V0LE",0.0,
306 0.0,0.0,idrotm[902],"ONLY");
310 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,350.0+fThickness1/2.0,0,"ONLY");
312 ncellsL = (ndetL - 1) * 4;
313 AliInfo(Form("Number of cells on Left side = %d", ncellsL));
317 //_____________________________________________________________________________
318 void AliVZEROv4::BuildGeometry()
321 // Builds simple ROOT TNode geometry for event display
323 AliDebug(2,"VZERO BuildGeometry ");
327 TNode *v0Rnode, *v0Rnode0, *v0Rnode6 , *v0Rnode7, *v0Rnode8, *v0Rnode9;
328 TNode *v0Rnode1, *v0Rnode2, *v0Rnode3, *v0Rnode4;
329 TNode *v0Lnode, *v0Lnode0;
330 TNode *v0Lnode1, *v0Lnode2, *v0Lnode3, *v0Lnode4;
332 const int kColorVZERO = kGreen;
334 top = gAlice->GetGeometry()->GetNode("alice");
336 Float_t height1Right, height2Right, height3Right, height4Right;
340 Float_t halfThickQua;
342 Float_t r0Right, r4Right;
343 Float_t pi = TMath::Pi();
345 height1Right = 3.42; // height of cell 1, in cm
346 height2Right = 6.78; // height of cell 2, in cm
347 height3Right = 7.11; // height of cell 3, in cm
348 height4Right = 10.91; // height of cell 4, in cm
352 halfThickQua = fThickness1/2.0;
354 zdet = 90.0 - 0.6 - fThickness/2.0;
356 heightRight = height1Right + height2Right + height3Right + height4Right;
357 r4Right = r0Right + heightRight;
363 partube[0] = r0Right - 0.2;
364 partube[1] = r4Right + 1.0;
365 partube[2] = fThickness/2.0;
367 TTUBE *v0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
371 v0Rnode = new TNode("V0RI","V0RI",v0RI,0.0,0.0,-zdet,0);
373 v0Rnode->SetLineColor(kYellow);
374 fNodes->Add(v0Rnode);
375 v0Rnode->SetVisibility(2);
377 // Rondelles de carbone (epaisseur 3.5 mm) de maintien des cellules ...
379 Float_t lidThickness = 0.35;
381 partube[0] = r0Right;
382 partube[1] = r4Right;
383 partube[2] = +lidThickness/2.0;
385 TTUBE *v0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
388 v0Rnode6 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0, fThickness/2.0-partube[2],0);
389 v0Rnode6->SetLineColor(kYellow);
390 fNodes->Add(v0Rnode6);
392 v0Rnode7 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
393 v0Rnode7->SetLineColor(kYellow);
394 fNodes->Add(v0Rnode7);
396 partube[0] = r0Right - 0.2;
397 partube[1] = r0Right;
398 partube[2] = +fThickness/2.0;
400 TTUBE *v0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
403 v0Rnode8 = new TNode("V0IR", "V0IR",v0IR,0.0,0.0,0.0,0);
404 v0Rnode8->SetLineColor(kYellow);
405 fNodes->Add(v0Rnode8);
407 partube[0] = r4Right;
408 partube[1] = r4Right + 1.0;
409 partube[2] = +fThickness/2.0;
411 TTUBE *v0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
414 v0Rnode9 = new TNode("V0ER", "V0ER",v0ER,0.0,0.0,0.0,0);
415 v0Rnode9->SetLineColor(kYellow);
416 fNodes->Add(v0Rnode9);
420 partubs[0] = r0Right;
421 partubs[1] = r4Right;
422 partubs[2] = fThickness/2.0;
423 partubs[3] = 90.0-15.0;
424 partubs[4] = 120.0-15.0;
426 TTUBS *v0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
427 partubs[3], partubs[4]);
429 v0R0->SetNumberOfDivisions(ndiv);
431 Float_t r1Right = r0Right + height1Right;
432 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
433 Float_t offsetFibers = 1.7;
435 partubs[0] = r0Right;
436 partubs[1] = r1Right;
437 partubs[2] = fThickness1/2.0;
439 TTUBS *v0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
440 partubs[3], partubs[4]);
442 v0R1->SetNumberOfDivisions(ndiv);
444 Float_t r2Right = r1Right + height2Right;
446 partubs[0] = r1Right;
447 partubs[1] = r2Right;
449 TTUBS *v0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
450 partubs[3], partubs[4]);
452 v0R2->SetNumberOfDivisions(ndiv);
454 Float_t r3Right = r2Right + height3Right;
456 partubs[0] = r2Right;
457 partubs[1] = r3Right;
459 TTUBS *v0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
460 partubs[3], partubs[4]);
461 v0R3->SetNumberOfDivisions(ndiv);
463 partubs[0] = r3Right;
464 partubs[1] = r4Right;
466 TTUBS *v0R4 = new TTUBS("V0R4", "V0R4", "void", partubs[0], partubs[1], partubs[2],
467 partubs[3], partubs[4]);
468 v0R4->SetNumberOfDivisions(ndiv);
471 Float_t phiDeg= 180./6.;
477 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
480 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
482 sprintf(nameNode,"SUBDER%d",ndetR);
485 v0Rnode0 = new TNode(nameNode,nameNode,v0R0,0.0,0.0, 0.0,mat920);
486 v0Rnode0->SetLineColor(kYellow);
487 fNodes->Add(v0Rnode0);
490 sprintf(nameNode,"SUBDER%d",ndetR);
492 v0Rnode1 = new TNode(nameNode,nameNode,v0R1,0.0,0.0, -offset+ offsetFibers ,0);
493 v0Rnode1->SetLineColor(kColorVZERO);
494 fNodes->Add(v0Rnode1);
497 sprintf(nameNode,"SUBDER%d",ndetR);
499 v0Rnode2 = new TNode(nameNode,nameNode,v0R2,0.0,0.0, -offset,0);
500 v0Rnode2->SetLineColor(kColorVZERO);
501 fNodes->Add(v0Rnode2);
504 sprintf(nameNode,"SUBDER%d",ndetR);
506 v0Rnode3 = new TNode(nameNode,nameNode,v0R3,0.0,0.0, -offset,0);
507 v0Rnode3->SetLineColor(kColorVZERO);
508 fNodes->Add(v0Rnode3);
511 sprintf(nameNode,"SUBDER%d",ndetR);
513 v0Rnode4 = new TNode(nameNode,nameNode,v0R4,0.0,0.0, -offset,0);
514 v0Rnode4->SetLineColor(kColorVZERO);
515 fNodes->Add(v0Rnode4);
518 v0Rnode0->SetVisibility(2);
521 // Left side of VZERO :
523 Float_t r0Left = 4.3;
524 Float_t height1Left = 3.6;
525 Float_t height2Left = 6.4;
526 Float_t height3Left = 14.9;
527 Float_t height4Left = 14.4;
528 Float_t heightLeft = height1Left + height2Left + height3Left + height4Left;
530 Float_t r4Left = r0Left + heightLeft;
534 partube[2] = fThickness1/2.0;
536 TTUBE *v0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
540 v0Lnode = new TNode("V0LE","V0LE",v0LE,0.0,0.0,350.0+fThickness1/2.0,0);
542 v0Lnode->SetLineColor(kBlue);
543 fNodes->Add(v0Lnode);
545 v0Lnode->SetVisibility(2);
549 partubs[2] = fThickness1/2.0;
550 partubs[3] = 90.0-15.0;
551 partubs[4] = 120.0-15.0;
553 TTUBS *v0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
554 partubs[3], partubs[4]);
556 v0L0->SetNumberOfDivisions(ndiv);
557 v0L0->SetLineColor(7);
560 offsetLeft = - fThickness1/2.0;
562 Float_t r1Left = r0Left + height1Left;
567 TTUBS *v0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
568 partubs[3], partubs[4]);
569 v0L1->SetNumberOfDivisions(ndiv);
571 Float_t r2Left = r1Left + height2Left;
576 TTUBS *v0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
577 partubs[3], partubs[4]);
578 v0L2->SetNumberOfDivisions(ndiv);
580 Float_t r3Left = r2Left + height3Left;
585 TTUBS *v0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
586 partubs[3], partubs[4]);
587 v0L3->SetNumberOfDivisions(ndiv);
592 TTUBS *v0L4 = new TTUBS("V0L4", "V0L4", "void", partubs[0], partubs[1], partubs[2],
593 partubs[3], partubs[4]);
594 v0L4->SetNumberOfDivisions(ndiv);
598 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
602 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
604 sprintf(nameNode,"SUBDEL%d",ndetL);
607 v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offsetLeft + halfThickQua,mat920);
608 v0Lnode0->SetLineColor(kColorVZERO);
609 fNodes->Add(v0Lnode0);
612 sprintf(nameNode,"SUBDEL%d",ndetL);
614 v0Lnode1 = new TNode(nameNode,nameNode,v0L1,0.0,0.0, 0.0,0);
615 v0Lnode1->SetLineColor(kColorVZERO);
616 fNodes->Add(v0Lnode1);
619 sprintf(nameNode,"SUBDEL%d",ndetL);
621 v0Lnode2 = new TNode(nameNode,nameNode,v0L2,0.0,0.0, 0.0,0);
622 v0Lnode2->SetLineColor(kColorVZERO);
623 fNodes->Add(v0Lnode2);
626 sprintf(nameNode,"SUBDEL%d",ndetL);
628 v0Lnode3 = new TNode(nameNode,nameNode,v0L3,0.0,0.0, 0.0,0);
629 v0Lnode3->SetLineColor(kColorVZERO);
630 fNodes->Add(v0Lnode3);
633 sprintf(nameNode,"SUBDEL%d",ndetL);
635 v0Lnode4 = new TNode(nameNode,nameNode,v0L4,0.0,0.0, 0.0,0);
636 v0Lnode4->SetLineColor(kColorVZERO);
637 fNodes->Add(v0Lnode4);
640 v0Lnode0->SetVisibility(2);
644 //_____________________________________________________________________________
645 void AliVZEROv4::CreateMaterials()
648 // Creates materials used for geometry
650 AliDebug(2,"VZERO create materials");
653 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,
654 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
657 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,
658 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
660 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
661 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
664 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
665 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
667 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
670 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
673 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,
674 1e-4,1e-4,1e-4,1e-4 };
675 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
679 Int_t *idtmed = fIdtmed->GetArray()-2999;
682 // Parameters related to Quarz (SiO2) :
684 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
696 // Parameters related to aluminum sheets :
703 // Parameters related to scintillator CH :
705 Float_t ascin[2] = {1.00794,12.011};
706 Float_t zscin[2] = {1.,6.};
707 Float_t wscin[2] = {1.,1.};
708 Float_t denscin = 1.032;
712 Float_t aAir[4]={12.,14.,16.,36.};
713 Float_t zAir[4]={6.,7.,8.,18.};
714 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
715 Float_t dAir = 1.20479E-3;
717 // Definition of materials :
721 AliMixture( 1, "AIR A$", aAir,zAir,dAir,4,wAir);
722 AliMixture(11, "AIR I$", aAir,zAir,dAir,4,wAir);
723 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
724 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
725 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
726 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
728 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
731 Int_t iSXFLD = gAlice->Field()->Integ();
732 Float_t sXMGMX = gAlice->Field()->Max();
734 Float_t tmaxfd, stemax, deemax, epsil, stmin;
743 AliMedium(1, "ACTIVE AIR$", 1, 1, iSXFLD, sXMGMX,
744 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
748 AliMedium(11, "INACTIVE AIR$", 11, 0, iSXFLD, sXMGMX,
749 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
751 AliMedium(2, "CARBON$ ", 2, 1, iSXFLD, sXMGMX,
752 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
754 AliMedium(3, "QUARZ$", 3, 1, iSXFLD, sXMGMX,
755 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
757 AliMedium(4,"ALUMINUM1$",4, 1, iSXFLD, sXMGMX,
758 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
761 AliMedium(5,"ALUMINUM2$",5, 1, iSXFLD, sXMGMX,
762 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
764 AliMedium(6,"SCINTILLATOR$",6, 1, iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
766 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
767 gMC->Gstpar(idtmed[3000], "HADR", 1.);
768 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
769 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
771 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
772 gMC->Gstpar(idtmed[3001], "HADR", 1.);
773 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
774 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
776 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
777 gMC->Gstpar(idtmed[3002], "HADR", 1.);
778 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
779 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
780 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
781 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
783 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
784 gMC->Gstpar(idtmed[3003], "HADR", 1.);
785 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
786 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
788 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
789 gMC->Gstpar(idtmed[3004], "HADR", 1.);
790 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
791 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
792 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
793 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
795 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
796 gMC->Gstpar(idtmed[3005], "HADR", 1.);
797 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
798 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
799 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
800 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
803 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
804 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
806 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
807 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
811 //_____________________________________________________________________________
812 void AliVZEROv4::DrawModule() const
815 // Drawing is done in DrawVZERO.C
817 AliDebug(2,"VZERO DrawModule");
820 //_____________________________________________________________________________
821 void AliVZEROv4::Init()
823 // Initialises version 2 of the VZERO Detector
824 // Just prints an information message
826 AliDebug(2,Form("VZERO version %d initialized",IsVersion()));
828 // gMC->SetMaxStep(fMaxStepAlu);
829 // gMC->SetMaxStep(fMaxStepQua);
834 //_____________________________________________________________________________
835 void AliVZEROv4::StepManager()
838 // Step Manager, called at each step
842 static Float_t hits[21];
843 static Float_t eloss, tlength;
844 static Int_t nPhotonsInStep;
845 static Int_t nPhotons;
846 static Int_t numStep;
848 Float_t destep, step;
852 // We keep only charged tracks :
854 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
856 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
857 vol[2] = gMC->CurrentVolID(copy);
860 static Int_t idV0R1 = gMC->VolId("V0R1");
861 static Int_t idV0L1 = gMC->VolId("V0L1");
862 static Int_t idV0R2 = gMC->VolId("V0R2");
863 static Int_t idV0L2 = gMC->VolId("V0L2");
864 static Int_t idV0R3 = gMC->VolId("V0R3");
865 static Int_t idV0L3 = gMC->VolId("V0L3");
866 static Int_t idV0R4 = gMC->VolId("V0R4");
867 static Int_t idV0L4 = gMC->VolId("V0L4");
869 if ( gMC->CurrentVolID(copy) == idV0R1 ||
870 gMC->CurrentVolID(copy) == idV0L1 )
872 else if ( gMC->CurrentVolID(copy) == idV0R2 ||
873 gMC->CurrentVolID(copy) == idV0L2 )
875 else if ( gMC->CurrentVolID(copy) == idV0R3 ||
876 gMC->CurrentVolID(copy) == idV0L3 )
878 else if ( gMC->CurrentVolID(copy) == idV0R4 ||
879 gMC->CurrentVolID(copy) == idV0L4 )
884 if ( ringNumber > 0.5 ) {
886 destep = gMC->Edep();
887 step = gMC->TrackStep();
889 nPhotonsInStep = Int_t(destep / (fLightYield *1e-9) );
890 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
895 if ( gMC->IsTrackEntering() ) {
897 nPhotons = nPhotonsInStep;
898 gMC->TrackPosition(fTrackPosition);
899 gMC->TrackMomentum(fTrackMomentum);
901 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px() +
902 fTrackMomentum.Py() * fTrackMomentum.Py() );
904 hits[0] = fTrackPosition.X();
905 hits[1] = fTrackPosition.Y();
906 hits[2] = fTrackPosition.Z();
907 hits[3] = Float_t (gMC->TrackPid());
909 hits[4] = gMC->TrackTime();
910 hits[5] = gMC->TrackCharge();
911 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
912 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
913 hits[8] = ringNumber;
916 hits[10] = fTrackMomentum.P();
917 hits[11] = fTrackMomentum.Px();
918 hits[12] = fTrackMomentum.Py();
919 hits[13] = fTrackMomentum.Pz();
921 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
922 hits[14] = par->Vx();
923 hits[15] = par->Vy();
924 hits[16] = par->Vz();
930 nPhotons = nPhotons + nPhotonsInStep;
932 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
934 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * fLightAttenuation * fnMeters));
935 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fFibToPhot);
940 hits[20] = GetCellId (vol, hits);
942 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
955 //_____________________________________________________________________________
956 void AliVZEROv4::AddHit(Int_t track, Int_t *vol, Float_t *hits)
961 TClonesArray &lhits = *fHits;
962 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
965 //_____________________________________________________________________________
966 void AliVZEROv4::AddDigits(Int_t *tracks, Int_t* digits)
969 // Adds a VZERO digit
971 TClonesArray &ldigits = *fDigits;
972 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
975 //_____________________________________________________________________________
976 void AliVZEROv4::MakeBranch(Option_t *option)
979 // Creates new branches in the current Root Tree
982 sprintf(branchname,"%s",GetName());
983 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
985 const char *cH = strstr(option,"H");
987 if (fHits && TreeH() && cH) {
988 TreeH()->Branch(branchname,&fHits, fBufferSize);
989 AliDebug(2,Form("Making Branch %s for hits",branchname));
992 const char *cD = strstr(option,"D");
994 if (fDigits && fLoader->TreeD() && cD) {
995 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
996 AliDebug(2,Form("Making Branch %s for digits",branchname));
1001 //_____________________________________________________________________________
1002 Int_t AliVZEROv4::GetCellId(Int_t *vol, Float_t *hits)
1005 // Returns Id of scintillator cell
1006 // Right side from 0 to 47
1007 // Left side from 48 to 95
1009 Int_t index = vol[1];
1012 if (index < 10) index = index + 12;
1014 if (hits[2] < 0.0) {
1015 index = (index - 10) + ( ( Int_t(hits[8]) - 1 ) * 12);
1018 else if (hits[2] > 0.0)
1020 index = (index + 38) + ( ( Int_t(hits[8]) - 1 ) * 12);