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 3 as designed by the Lyon group //
21 // All comments should be sent to Brigitte CHEYNIS : //
22 // b.cheynis@ipnl.in2p3.fr //
23 // Geometry of the 4th of december 2003 //
24 // (now 3 rings instead of 5 rings as in previous versions -budget //
25 // cuts !! - therefore changes in cell dimensions and offsets) //
26 // previous ring 1 and ring 2 become now ring 1 //
27 // previous ring 3 and ring 4 become now ring 2 //
28 // previous ring 5 becomes now ring 3 - both for Left and Right //
29 // V0R (now V0C) sits between Z values -89.4 and -84.9 cm //
30 // V0L (now V0A) sits between Z values +350.0 and +352.0 cm //
31 // New coordinate system has been implemented in october 2003 //
33 //////////////////////////////////////////////////////////////////////
35 // --- Standard libraries ---
36 #include <Riostream.h>
40 // --- ROOT libraries ---
41 #include <TClonesArray.h>
42 #include <TGeometry.h>
43 #include <TLorentzVector.h>
46 #include <TObjectTable.h>
49 #include <TVirtualMC.h>
50 #include <TParticle.h>
52 // --- AliRoot header files ---
57 #include "AliVZEROLoader.h"
58 #include "AliVZEROdigit.h"
59 #include "AliVZEROhit.h"
60 #include "AliVZEROv3.h"
64 //_____________________________________________________________________________
65 AliVZEROv3:: AliVZEROv3():AliVZERO()
67 // Standard default constructor
70 //_____________________________________________________________________________
71 AliVZEROv3::AliVZEROv3(const char *name, const char *title):
75 // Standard constructor for V-zero Detector version 2
80 for(i=0;i<26;i++) printf("*");
81 printf(" Create VZERO object ");
82 for(i=0;i<26;i++) printf("*");
86 fLightAttenuation = 0.05;
92 //_____________________________________________________________________________
93 void AliVZEROv3::CreateGeometry()
96 // Creates the GEANT geometry of the V-zero Detector version 3
101 for(i=0;i<26;i++) printf("*");
102 printf(" Create VZERO Geometry ");
103 for(i=0;i<26;i++) printf("*");
106 Int_t *idtmed = fIdtmed->GetArray()-2999;
116 Float_t height1Right, height2Right, height3Right;
120 Float_t halfThickQua;
123 Float_t r0Right, r3Right;
124 Float_t pi = TMath::Pi();
126 height1Right = 1.82 + 3.81; // height of cell 1, in cm
127 height2Right = 4.72 + 7.12; // height of cell 2, in cm
128 height3Right = 10.83; // height of cell 3, in cm
130 theta = pi/6.0/2.0; // half angular opening = 15 degrees
132 halfThickQua= fThickness1/2.0; // half thickness of elementary cell (inner ring)
134 // distance 0.6 cm in zdet accounts for the fact V0R box back lid sits 0.6 away from
135 // absorber nose sitting at 90 cm. Will use -zdet later...
136 // size of V0R box (fThickness) is increased by 1 mm as compared to version v2
138 fThickness = fThickness + 0.1;
139 zdet = 90.0 - 0.6 - fThickness/2.0; // distance to vertex (along Z axis)
140 r0Right = 4.05; // closest distance to center of the beam pipe
141 heightRight = height1Right + height2Right + height3Right;
142 r3Right = r0Right + heightRight;
144 // Creation of mother volume v0LE - left part - :
145 // Entrance face at +350.0 cm (new coordinate system) ...
151 partube[2] = fThickness1/2.0;
153 gMC->Gsvolu("V0LE","TUBE",idtmed[3005],partube,3);
155 // Creation of five rings - left part - :
156 // Entrance face at +350.0 cm (new coordinate system) ...
158 // Mother volume v0L0 in which will be set 5 scintillator cells
162 Float_t r0Left = 4.3;
163 Float_t height1Left = 2.6 + 4.1; // previous ring 1 + ring 2
164 Float_t height2Left = 6.4 + 10.2; // previous ring 3 + ring 4
165 Float_t height3Left = 16.9;
166 Float_t heightLeft = height1Left + height2Left + height3Left;
168 Float_t r3Left = r0Left + heightLeft;
172 partubs[2] = fThickness1/2.0;
173 partubs[3] = 90.0-15.0;
174 partubs[4] = 120.0-15.0;
176 gMC->Gsvolu("V0L0","TUBS",idtmed[3010],partubs,5); // air volume
178 Float_t r1Left = r0Left + height1Left;
183 gMC->Gsvolu("V0L1","TUBS",idtmed[3005],partubs,5); // quartz volume
184 gMC->Gspos("V0L1",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
186 Float_t r2Left = r1Left + height2Left;
191 gMC->Gsvolu("V0L2","TUBS",idtmed[3005],partubs,5); // quartz volume
192 gMC->Gspos("V0L2",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
197 gMC->Gsvolu("V0L3","TUBS",idtmed[3005],partubs,5); // quartz volume
198 gMC->Gspos("V0L3",1,"V0L0", 0.0, 0.0 , 0.0, 0,"ONLY");
201 // Creation of mother volume v0RI - right part - :
203 partube[0] = r0Right - 0.2;
204 partube[1] = r3Right + 1.0;
205 partube[2] = fThickness/2.0;
207 gMC->Gsvolu("V0RI","TUBE",idtmed[3010],partube,3);
209 // Creation of carbon lids (3.5 mm thick) to keep v0RI box shut...
211 Float_t lidThickness = 0.35;
213 partube[0] = r0Right;
214 partube[1] = r3Right;
215 partube[2] = +lidThickness/2.0;
217 gMC->Gsvolu("V0CA","TUBE",idtmed[3001],partube,3);
218 gMC->Gspos("V0CA",1,"V0RI",0.0,0.0, fThickness/2.0-partube[2],0,"ONLY");
219 gMC->Gspos("V0CA",2,"V0RI",0.0,0.0,-fThickness/2.0+partube[2],0,"ONLY");
221 // Creation of aluminum rings to maintain the v0RI pieces ...
223 partube[0] = r0Right - 0.2;
224 partube[1] = r0Right;
225 partube[2] = +fThickness/2.0;
227 gMC->Gsvolu("V0IR","TUBE",idtmed[3003],partube,3);
228 gMC->Gspos("V0IR",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
230 partube[0] = r3Right;
231 partube[1] = r3Right + 1.0;
232 partube[2] = +fThickness/2.0;
234 gMC->Gsvolu("V0ER","TUBE",idtmed[3003],partube,3);
235 gMC->Gspos("V0ER",1,"V0RI",0.0,0.0,0.0,0,"ONLY");
237 // Mother volume v0R0 in which will be set 3 scintillator cells
239 partubs[0] = r0Right;
240 partubs[1] = r3Right;
241 partubs[2] = fThickness/2.0;
242 partubs[3] = 90.0-15.0;
243 partubs[4] = 120.0-15.0;
245 gMC->Gsvolu("V0R0","TUBS",idtmed[3010],partubs,5); // air volume
247 // Elementary cell of ring 1 :
248 // (cells of ring 1 will be shifted by 1.7 cm towards vertex to output fibers)
250 Float_t offsetFibers = 1.7;
251 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
252 Float_t r1Right = r0Right + height1Right;
254 partubs[0] = r0Right;
255 partubs[1] = r1Right;
256 partubs[2] = fThickness1/2.0;
258 gMC->Gsvolu("V0R1","TUBS",idtmed[3005],partubs,5); // scintillator volume
259 gMC->Gspos("V0R1",1,"V0R0", 0.0, 0.0 , -offset + offsetFibers, 0,"ONLY");
261 // Elementary cell of ring 2 :
263 Float_t r2Right = r1Right + height2Right;
265 partubs[0] = r1Right;
266 partubs[1] = r2Right;
268 gMC->Gsvolu("V0R2","TUBS",idtmed[3005],partubs,5); // scintillator volume
269 gMC->Gspos("V0R2",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
272 // Elementary cell of ring 3 :
274 partubs[0] = r2Right;
275 partubs[1] = r3Right;
277 gMC->Gsvolu("V0R3","TUBS",idtmed[3005],partubs,5); // scintillator volume
278 gMC->Gspos("V0R3",1,"V0R0", 0.0, 0.0 , -offset, 0,"ONLY");
281 Float_t phiDeg = 180./6.;
285 for(Float_t phi = 15.0 ; phi < 360.0; phi = phi + phiDeg)
287 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
288 gMC->Gspos("V0R0",ndetR,"V0RI",0.0,
289 0.0,0.0,idrotm[902],"ONLY");
293 gMC->Gspos("V0RI",1,"ALIC",0.0,0.0,-zdet,0,"ONLY");
295 ncellsR = (ndetR - 1) * 3;
296 printf(" Number of cells on Right side = %d\n", ncellsR);
300 for(Float_t phi = 15.0 ; phi < 360.0; phi = phi + phiDeg)
302 AliMatrix(idrotm[902], 90.0, phi, 90.0, 90.0 +phi, 0.0 , 0.0);
303 gMC->Gspos("V0L0",ndetL,"V0LE",0.0,
304 0.0,0.0,idrotm[902],"ONLY");
308 gMC->Gspos("V0LE",1,"ALIC",0.0,0.0,350.0+fThickness1/2.0,0,"ONLY");
310 ncellsL = (ndetL - 1) * 3;
311 printf(" Number of cells on Left side = %d\n", ncellsL);
312 for(i=0;i<75;i++) printf("*");
317 //_____________________________________________________________________________
318 void AliVZEROv3::BuildGeometry()
321 // Builds simple ROOT TNode geometry for event display
326 for(i=0;i<30;i++) printf("*");
327 printf(" VZERO BuildGeometry ");
328 for(i=0;i<30;i++) printf("*");
333 TNode *v0Rnode, *v0Rnode0, *v0Rnode6 , *v0Rnode7, *v0Rnode8, *v0Rnode9;
334 TNode *v0Rnode1, *v0Rnode2, *v0Rnode3;
335 TNode *v0Lnode, *v0Lnode0;
336 TNode *v0Lnode1, *v0Lnode2, *v0Lnode3;
338 const int kColorVZERO = kGreen;
340 top = gAlice->GetGeometry()->GetNode("alice");
342 Float_t height1Right, height2Right, height3Right;
346 Float_t halfThickQua;
348 Float_t r0Right, r3Right;
349 Float_t pi = TMath::Pi();
351 height1Right = 1.82 + 3.81; // height of cell 1, in cm
352 height2Right = 4.72 + 7.12; // height of cell 2, in cm
353 height3Right = 10.83; // height of cell 3, in cm
357 halfThickQua = fThickness1/2.0;
359 zdet = 90.0 - 0.6 - fThickness/2.0;
361 heightRight = height1Right + height2Right + height3Right;
362 r3Right = r0Right + heightRight;
368 partube[0] = r0Right - 0.2;
369 partube[1] = r3Right + 1.0;
370 partube[2] = fThickness/2.0;
372 TTUBE *v0RI = new TTUBE("V0RI", "V0RI", "void", partube[0], partube[1], partube[2]);
376 v0Rnode = new TNode("V0RI","V0RI",v0RI,0.0,0.0,-zdet,0);
378 v0Rnode->SetLineColor(kYellow);
379 fNodes->Add(v0Rnode);
380 v0Rnode->SetVisibility(2);
382 // Rondelles de carbone (epaisseur 3.5 mm) de maintien des cellules ...
384 Float_t lidThickness = 0.35;
386 partube[0] = r0Right;
387 partube[1] = r3Right;
388 partube[2] = +lidThickness/2.0;
390 TTUBE *v0CA = new TTUBE("V0CA", "V0CA", "void",partube[0], partube[1], partube[2]);
393 v0Rnode6 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0, fThickness/2.0-partube[2],0);
394 v0Rnode6->SetLineColor(kYellow);
395 fNodes->Add(v0Rnode6);
397 v0Rnode7 = new TNode("V0CA", "V0CA",v0CA,0.0,0.0,-fThickness/2.0+partube[2],0);
398 v0Rnode7->SetLineColor(kYellow);
399 fNodes->Add(v0Rnode7);
401 partube[0] = r0Right - 0.2;
402 partube[1] = r0Right;
403 partube[2] = +fThickness/2.0;
405 TTUBE *v0IR = new TTUBE("V0IR","V0IR","void", partube[0], partube[1], partube[2]);
408 v0Rnode8 = new TNode("V0IR", "V0IR",v0IR,0.0,0.0,0.0,0);
409 v0Rnode8->SetLineColor(kYellow);
410 fNodes->Add(v0Rnode8);
412 partube[0] = r3Right;
413 partube[1] = r3Right + 1.0;
414 partube[2] = +fThickness/2.0;
416 TTUBE *v0ER = new TTUBE("V0ER","V0ER","void", partube[0], partube[1], partube[2]);
419 v0Rnode9 = new TNode("V0ER", "V0ER",v0ER,0.0,0.0,0.0,0);
420 v0Rnode9->SetLineColor(kYellow);
421 fNodes->Add(v0Rnode9);
425 partubs[0] = r0Right;
426 partubs[1] = r3Right;
427 partubs[2] = fThickness/2.0;
428 partubs[3] = 90.0-15.0;
429 partubs[4] = 120.0-15.0;
431 TTUBS *v0R0 = new TTUBS("V0R0", "V0R0", "void",partubs[0], partubs[1], partubs[2],
432 partubs[3], partubs[4]);
434 v0R0->SetNumberOfDivisions(ndiv);
436 Float_t r1Right = r0Right + height1Right;
437 Float_t offset = fThickness/2.0 - lidThickness - fThickness1/2.0;
438 Float_t offsetFibers = 1.7;
440 partubs[0] = r0Right;
441 partubs[1] = r1Right;
442 partubs[2] = fThickness1/2.0;
444 TTUBS *v0R1 = new TTUBS("V0R1", "V0R1", "void", partubs[0], partubs[1], partubs[2],
445 partubs[3], partubs[4]);
447 v0R1->SetNumberOfDivisions(ndiv);
449 Float_t r2Right = r1Right + height2Right;
451 partubs[0] = r1Right;
452 partubs[1] = r2Right;
454 TTUBS *v0R2 = new TTUBS("V0R2", "V0R2", "void", partubs[0], partubs[1], partubs[2],
455 partubs[3], partubs[4]);
457 v0R2->SetNumberOfDivisions(ndiv);
459 partubs[0] = r2Right;
460 partubs[1] = r3Right;
462 TTUBS *v0R3 = new TTUBS("V0R3", "V0R3", "void", partubs[0], partubs[1], partubs[2],
463 partubs[3], partubs[4]);
464 v0R3->SetNumberOfDivisions(ndiv);
467 Float_t phiDeg= 180./6.;
473 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
477 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
479 sprintf(nameNode,"SUBDER%d",ndetR);
482 v0Rnode0 = new TNode(nameNode,nameNode,v0R0,0.0,0.0, 0.0,mat920);
483 v0Rnode0->SetLineColor(kYellow);
484 fNodes->Add(v0Rnode0);
487 sprintf(nameNode,"SUBDER%d",ndetR);
489 v0Rnode1 = new TNode(nameNode,nameNode,v0R1,0.0,0.0, -offset+ offsetFibers ,0);
490 v0Rnode1->SetLineColor(kColorVZERO);
491 fNodes->Add(v0Rnode1);
494 sprintf(nameNode,"SUBDER%d",ndetR);
496 v0Rnode2 = new TNode(nameNode,nameNode,v0R2,0.0,0.0, -offset,0);
497 v0Rnode2->SetLineColor(kColorVZERO);
498 fNodes->Add(v0Rnode2);
501 sprintf(nameNode,"SUBDER%d",ndetR);
503 v0Rnode3 = new TNode(nameNode,nameNode,v0R3,0.0,0.0, -offset,0);
504 v0Rnode3->SetLineColor(kColorVZERO);
505 fNodes->Add(v0Rnode3);
508 v0Rnode0->SetVisibility(2);
512 // Left side of VZERO :
514 Float_t r0Left = 4.3;
515 Float_t height1Left = 2.6 + 4.1;
516 Float_t height2Left = 6.4 + 10.2;
517 Float_t height3Left = 16.9;
518 Float_t heightLeft = height1Left + height2Left + height3Left;
520 Float_t r3Left = r0Left + heightLeft;
524 partube[2] = fThickness1/2.0;
526 TTUBE *v0LE = new TTUBE("V0LE", "V0LE", "void", partube[0], partube[1], partube[2]);
530 v0Lnode = new TNode("V0LE","V0LE",v0LE,0.0,0.0,350.0+fThickness1/2.0,0);
532 v0Lnode->SetLineColor(kBlue);
533 fNodes->Add(v0Lnode);
535 v0Lnode->SetVisibility(2);
539 partubs[2] = fThickness1/2.0;
540 partubs[3] = 90.0-15.0;
541 partubs[4] = 120.0-15.0;
543 TTUBS *v0L0 = new TTUBS("V0L0", "V0L0", "void", partubs[0], partubs[1], partubs[2],
544 partubs[3], partubs[4]);
546 v0L0->SetNumberOfDivisions(ndiv);
547 v0L0->SetLineColor(7);
550 offsetLeft = - fThickness1/2.0;
552 Float_t r1Left = r0Left + height1Left;
557 TTUBS *v0L1 = new TTUBS("V0L1", "V0L1", "void", partubs[0], partubs[1], partubs[2],
558 partubs[3], partubs[4]);
559 v0L1->SetNumberOfDivisions(ndiv);
561 Float_t r2Left = r1Left + height2Left;
566 TTUBS *v0L2 = new TTUBS("V0L2", "V0L2", "void", partubs[0], partubs[1], partubs[2],
567 partubs[3], partubs[4]);
568 v0L2->SetNumberOfDivisions(ndiv);
573 TTUBS *v0L3 = new TTUBS("V0L3", "V0L3", "void", partubs[0], partubs[1], partubs[2],
574 partubs[3], partubs[4]);
575 v0L3->SetNumberOfDivisions(ndiv);
579 for (phi = 15.0; phi < 360.0; phi = phi + phiDeg)
583 TRotMatrix* mat920 = new TRotMatrix("rot920","rot920", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
586 sprintf(nameNode,"SUBDEL%d",ndetL);
589 v0Lnode0 = new TNode(nameNode,nameNode,v0L0,0.0,0.0, offsetLeft + halfThickQua,mat920);
590 v0Lnode0->SetLineColor(kColorVZERO);
591 fNodes->Add(v0Lnode0);
594 sprintf(nameNode,"SUBDEL%d",ndetL);
596 v0Lnode1 = new TNode(nameNode,nameNode,v0L1,0.0,0.0, 0.0,0);
597 v0Lnode1->SetLineColor(kColorVZERO);
598 fNodes->Add(v0Lnode1);
601 sprintf(nameNode,"SUBDEL%d",ndetL);
603 v0Lnode2 = new TNode(nameNode,nameNode,v0L2,0.0,0.0, 0.0,0);
604 v0Lnode2->SetLineColor(kColorVZERO);
605 fNodes->Add(v0Lnode2);
608 sprintf(nameNode,"SUBDEL%d",ndetL);
610 v0Lnode3 = new TNode(nameNode,nameNode,v0L3,0.0,0.0, 0.0,0);
611 v0Lnode3->SetLineColor(kColorVZERO);
612 fNodes->Add(v0Lnode3);
615 v0Lnode0->SetVisibility(2);
621 //_____________________________________________________________________________
622 void AliVZEROv3::CreateMaterials()
625 // Creates materials used for geometry
630 for(i=0;i<25;i++) printf("*");
631 printf(" VZERO create materials ");
632 for(i=0;i<26;i++) printf("*");
636 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,
637 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
640 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,
641 6.9e-9, 7.1e-9, 7.3e-9, 7.5e-9, 7.7e-9, 7.9e-9, 8.1e-9 };
643 Float_t rindex_quarz[14] = { 1.52398, 1.53090, 1.53835, 1.54641, 1.55513, 1.56458,
644 1.57488, 1.58611, 1.59842, 1.61197, 1.62696, 1.64362,
647 Float_t absco_quarz[14] = { 105.8, 45.656, 35.665, 28.598, 25.007, 21.04, 17.525,
648 14.177, 9.282, 4.0925, 1.149, 0.3627, 0.1497, 0.05 };
650 Float_t effic_all[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
653 Float_t rindex_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
656 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,
657 1e-4,1e-4,1e-4,1e-4 };
658 Float_t effic_alu[14] = { 1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1.,1. };
662 Int_t *idtmed = fIdtmed->GetArray()-2999;
665 // Parameters related to Quarz (SiO2) :
667 Float_t aqua[2], zqua[2], densqua, wmatqua[2];
679 // Parameters related to aluminum sheets :
686 // Parameters related to scintillator CH :
688 Float_t ascin[2] = {1.00794,12.011};
689 Float_t zscin[2] = {1.,6.};
690 Float_t wscin[2] = {1.,1.};
691 Float_t denscin = 1.032;
695 Float_t aAir[4]={12.,14.,16.,36.};
696 Float_t zAir[4]={6.,7.,8.,18.};
697 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
698 Float_t dAir = 1.20479E-3;
700 // Definition of materials :
704 AliMixture( 1, "AIR A$", aAir,zAir,dAir,4,wAir);
705 AliMixture(11, "AIR I$", aAir,zAir,dAir,4,wAir);
706 AliMaterial( 2, "CARBON$" , 12.01, 6.0, 2.265, 18.8, 49.9, 0, 0);
707 AliMixture( 3, "QUA", aqua, zqua, densqua, nlmatqua, wmatqua);
708 AliMaterial( 4, "ALUMINIUM1$", 26.98, 13., 2.7, 8.9, 37.2, 0, 0);
709 AliMaterial( 5, "ALUMINIUM2$", aal, zal, densal, radlal, 0, 0, 0);
711 AliMixture( 6, "Scintillator$",ascin,zscin,denscin,-2,wscin);
714 Int_t iSXFLD = gAlice->Field()->Integ();
715 Float_t sXMGMX = gAlice->Field()->Max();
717 Float_t tmaxfd, stemax, deemax, epsil, stmin;
726 AliMedium(1, "ACTIVE AIR$", 1, 1, iSXFLD, sXMGMX,
727 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
731 AliMedium(11, "INACTIVE AIR$", 11, 0, iSXFLD, sXMGMX,
732 10.0, 1.0, 0.1, 0.1, 10.0, 0, 0) ;
734 AliMedium(2, "CARBON$ ", 2, 1, iSXFLD, sXMGMX,
735 tmaxfd, stemax, deemax, epsil, stmin, 0, 0);
737 AliMedium(3, "QUARZ$", 3, 1, iSXFLD, sXMGMX,
738 tmaxfd, fMaxStepQua, fMaxDestepQua, epsil, stmin, 0, 0);
740 AliMedium(4,"ALUMINUM1$",4, 1, iSXFLD, sXMGMX,
741 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
744 AliMedium(5,"ALUMINUM2$",5, 1, iSXFLD, sXMGMX,
745 tmaxfd, fMaxStepAlu, fMaxDestepAlu, epsil, stmin, 0, 0);
747 AliMedium(6,"SCINTILLATOR$",6, 1, iSXFLD, sXMGMX, 10.0, 0.1, 0.1, 0.003, 0.003, 0, 0);
749 gMC->Gstpar(idtmed[3000], "LOSS", 1.); // [3000] = air ACTIF [3010] = air INACTIF
750 gMC->Gstpar(idtmed[3000], "HADR", 1.);
751 gMC->Gstpar(idtmed[3000], "DCAY", 1.);
752 gMC->Gstpar(idtmed[3000], "DRAY", 1.);
754 gMC->Gstpar(idtmed[3001], "LOSS", 1.); // [3001] = carbon
755 gMC->Gstpar(idtmed[3001], "HADR", 1.);
756 gMC->Gstpar(idtmed[3001], "DCAY", 1.);
757 gMC->Gstpar(idtmed[3001], "DRAY", 1.);
759 gMC->Gstpar(idtmed[3002], "LOSS", 1.); // [3002] = quartz
760 gMC->Gstpar(idtmed[3002], "HADR", 1.);
761 gMC->Gstpar(idtmed[3002], "DCAY", 1.);
762 gMC->Gstpar(idtmed[3002], "DRAY", 1.);
763 gMC->Gstpar(idtmed[3002], "CUTGAM",0.5E-4) ;
764 gMC->Gstpar(idtmed[3002], "CUTELE",1.0E-4) ;
766 gMC->Gstpar(idtmed[3003], "LOSS", 1.); // [3003] = normal aluminum
767 gMC->Gstpar(idtmed[3003], "HADR", 1.);
768 gMC->Gstpar(idtmed[3003], "DCAY", 1.);
769 gMC->Gstpar(idtmed[3003], "DRAY", 1.);
771 gMC->Gstpar(idtmed[3004], "LOSS", 1.); // [3004] = reflecting aluminum
772 gMC->Gstpar(idtmed[3004], "HADR", 1.);
773 gMC->Gstpar(idtmed[3004], "DCAY", 1.);
774 gMC->Gstpar(idtmed[3004], "DRAY", 1.);
775 gMC->Gstpar(idtmed[3004], "CUTGAM",0.5E-4) ;
776 gMC->Gstpar(idtmed[3004], "CUTELE",1.0E-4) ;
778 gMC->Gstpar(idtmed[3005], "LOSS", 1.); // [3005] = scintillator
779 gMC->Gstpar(idtmed[3005], "HADR", 1.);
780 gMC->Gstpar(idtmed[3005], "DCAY", 1.);
781 gMC->Gstpar(idtmed[3005], "DRAY", 1.);
782 gMC->Gstpar(idtmed[3005], "CUTGAM",0.5E-4) ;
783 gMC->Gstpar(idtmed[3005], "CUTELE",1.0E-4) ;
786 // geant3->Gsckov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
787 // geant3->Gsckov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
789 // gMC->SetCerenkov(idtmed[3002], 14, ppckov, absco_quarz, effic_all,rindex_quarz);
790 // gMC->SetCerenkov(idtmed[3004], 14, ppckov_alu, absco_alu, effic_alu, rindex_alu);
794 //_____________________________________________________________________________
795 void AliVZEROv3::DrawModule()
798 // Drawing is done in DrawVZERO.C
803 for(i=0;i<30;i++) printf("*");
804 printf(" VZERO DrawModule ");
805 for(i=0;i<30;i++) printf("*");
811 //_____________________________________________________________________________
812 void AliVZEROv3::Init()
814 // Initialises version 2 of the VZERO Detector
815 // Just prints an information message
817 printf(" VZERO version %d initialized \n",IsVersion());
819 // gMC->SetMaxStep(fMaxStepAlu);
820 // gMC->SetMaxStep(fMaxStepQua);
827 //_____________________________________________________________________________
828 void AliVZEROv3::StepManager()
831 // Step Manager, called at each step
835 static Float_t hits[21];
836 static Float_t eloss, tlength;
837 static Int_t nPhotonsInStep;
838 static Int_t nPhotons;
839 static Int_t numStep;
841 Float_t destep, step;
845 // We keep only charged tracks :
847 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
849 static Int_t idV0R1 = gMC->VolId("V0R1");
850 static Int_t idV0L1 = gMC->VolId("V0L1");
851 static Int_t idV0R2 = gMC->VolId("V0R2");
852 static Int_t idV0L2 = gMC->VolId("V0L2");
853 static Int_t idV0R3 = gMC->VolId("V0R3");
854 static Int_t idV0L3 = gMC->VolId("V0L3");
856 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
857 vol[2] = gMC->CurrentVolID(copy);
860 if ( gMC->CurrentVolID(copy) == idV0R1 ||
861 gMC->CurrentVolID(copy) == idV0L1 )
863 else if ( gMC->CurrentVolID(copy) == idV0R2 ||
864 gMC->CurrentVolID(copy) == idV0L2 )
866 else if ( gMC->CurrentVolID(copy) == idV0R3 ||
867 gMC->CurrentVolID(copy) == idV0L3 )
872 if ( ringNumber > 0.5 ) {
874 destep = gMC->Edep();
875 step = gMC->TrackStep();
877 nPhotonsInStep = Int_t(destep / (fLightYield *1e-9) );
878 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
883 if ( gMC->IsTrackEntering() ) {
885 nPhotons = nPhotonsInStep;
886 gMC->TrackPosition(fTrackPosition);
887 gMC->TrackMomentum(fTrackMomentum);
889 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px() +
890 fTrackMomentum.Py() * fTrackMomentum.Py() );
892 hits[0] = fTrackPosition.X();
893 hits[1] = fTrackPosition.Y();
894 hits[2] = fTrackPosition.Z();
895 hits[3] = Float_t (gMC->TrackPid());
897 hits[4] = gMC->TrackTime();
898 hits[5] = gMC->TrackCharge();
899 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
900 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
901 hits[8] = ringNumber;
904 hits[10] = fTrackMomentum.P();
905 hits[11] = fTrackMomentum.Px();
906 hits[12] = fTrackMomentum.Py();
907 hits[13] = fTrackMomentum.Pz();
909 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
910 hits[14] = par->Vx();
911 hits[15] = par->Vy();
912 hits[16] = par->Vz();
919 nPhotons = nPhotons + nPhotonsInStep;
921 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
923 nPhotons = nPhotons - Int_t( (Float_t(nPhotons) * fLightAttenuation * fnMeters) );
924 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fFibToPhot );
929 hits[20] = GetCellId (vol, hits);
931 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
944 //_____________________________________________________________________________
945 void AliVZEROv3::AddHit(Int_t track, Int_t *vol, Float_t *hits)
950 TClonesArray &lhits = *fHits;
951 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
954 //_____________________________________________________________________________
955 void AliVZEROv3::AddDigits(Int_t *tracks, Int_t* digits)
958 // Adds a VZERO digit
960 TClonesArray &ldigits = *fDigits;
961 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
964 //_____________________________________________________________________________
965 void AliVZEROv3::MakeBranch(Option_t *option)
968 // Creates new branches in the current Root Tree
971 sprintf(branchname,"%s",GetName());
972 printf(" fBufferSize = %d \n",fBufferSize);
974 const char *cH = strstr(option,"H");
976 if (fHits && TreeH() && cH) {
977 TreeH()->Branch(branchname,&fHits, fBufferSize);
978 printf("* AliDetector::MakeBranch * Making Branch %s for hits\n",branchname);
981 const char *cD = strstr(option,"D");
983 if (fDigits && fLoader->TreeD() && cD) {
984 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
985 printf("* AliDetector::MakeBranch * Making Branch %s for digits\n",branchname);
990 //_____________________________________________________________________________
991 Int_t AliVZEROv3::GetCellId(Int_t *vol, Float_t *hits)
994 // Returns Id of scintillator cell
995 // Right side from 0 to 35
996 // Left side from 36 to 71
998 Int_t index = vol[1];
1001 if (index < 10) index = index + 12;
1003 if (hits[2] < 0.0) {
1004 index = (index - 10) + ( ( Int_t(hits[8]) - 1 ) * 12);
1007 else if (hits[2] > 0.0)
1009 index = (index + 26) + ( ( Int_t(hits[8]) - 1 ) * 12);