]> git.uio.no Git - u/mrichter/AliRoot.git/blame - VZERO/AliVZEROv6.cxx
Removal of AliMCQA and of TreeH method on AliDetector
[u/mrichter/AliRoot.git] / VZERO / AliVZEROv6.cxx
CommitLineData
c985a636 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18//////////////////////////////////////////////////////////////////////
19// //
20// (V-zero) detector version 6 as designed by the Lyon group //
21// All comments should be sent to Brigitte CHEYNIS : //
22// b.cheynis@ipnl.in2p3.fr //
23// Geometry of september 2005 done with ROOT geometrical modeler // //
24// V0R (now V0C) sits between Z values -89.5 and -84.8 cm //
25// V0L (now V0A) sits between Z values +339.0 and +341.0 cm //
26// New coordinate system has been implemented in october 2003 //
27// //
28//////////////////////////////////////////////////////////////////////
29
c985a636 30#include "AliVZEROv6.h"
c985a636 31
32ClassImp(AliVZEROv6)
33
34//_____________________________________________________________________________
0b2bea8b 35AliVZEROv6:: AliVZEROv6():AliVZERO(),
36 fCellId(0),
37 fTrackPosition(),
38 fTrackMomentum(),
39 fV0CHeight1(2.5),
40 fV0CHeight2(4.4),
41 fV0CHeight3(7.4),
42 fV0CHeight4(12.5),
43 fV0CRMin(4.6),
44 fV0CRBox(38.0),
45 fV0CLidThickness(0.30),
46 fV0CCellThickness(2.00),
47 fV0CBoxThickness(4.70),
48 fV0COffsetFibers(1.0),
49 fV0AHeight1(3.3),
50 fV0AHeight2(6.2),
51 fV0AHeight3(8.9),
52 fV0AHeight4(20.9),
53 fV0ARMin(4.30),
54 fV0ACellThickness(2.00),
55 fLightYield(93.75),
56 fLightAttenuation(0.05),
57 fnMeters(15.0),
58 fFibToPhot(0.3),
59 fVersion(6)
c985a636 60{
61// Standard default constructor
62}
63
64//_____________________________________________________________________________
65AliVZEROv6::AliVZEROv6(const char *name, const char *title):
0b2bea8b 66 AliVZERO(name,title),
67 fCellId(0),
68 fTrackPosition(),
69 fTrackMomentum(),
70 fV0CHeight1(2.5),
71 fV0CHeight2(4.4),
72 fV0CHeight3(7.4),
73 fV0CHeight4(12.5),
74 fV0CRMin(4.6),
75 fV0CRBox(38.0),
76 fV0CLidThickness(0.30),
77 fV0CCellThickness(2.00),
78 fV0CBoxThickness(4.70),
79 fV0COffsetFibers(1.0),
80 fV0AHeight1(3.3),
81 fV0AHeight2(6.2),
82 fV0AHeight3(8.9),
83 fV0AHeight4(20.9),
84 fV0ARMin(4.30),
85 fV0ACellThickness(2.00),
86 fLightYield(93.75),
87 fLightAttenuation(0.05),
88 fnMeters(15.0),
89 fFibToPhot(0.3),
90 fVersion(6)
c985a636 91{
92
93// Standard constructor for V-zero Detector version 6
94
95 AliDebug(2,"Create VZERO object ");
96
97 fVersion = 6; // version number
98
99// Parameters related to geometry :
100// V0 part in front of muon arm absorber
101
0b2bea8b 102// fV0CHeight1 = 2.5; // height of cell 1, in cm
103// fV0CHeight2 = 4.4; // height of cell 2, in cm
104// fV0CHeight3 = 7.4; // height of cell 3, in cm
105// fV0CHeight4 = 12.5; // height of cell 4, in cm
106// fV0CRMin = 4.6;
107// fV0CRBox = 38.0; // outer radius of box, in cm
108// fV0CLidThickness = 0.30; // thickness of Carbon lid
109// fV0CCellThickness = 2.00; // thickness of elementary cell
110// fV0CBoxThickness = 4.70; // thickness of V0C Box
111// fV0COffsetFibers = 1.0; // offset to output fibers, in cm
c985a636 112
113// V0 part on the other side with respect to Interaction Point
114
0b2bea8b 115// fV0AHeight1 = 3.3; // height of cell 1, in cm
116// fV0AHeight2 = 6.2; // height of cell 2, in cm
117// fV0AHeight3 = 8.9; // height of cell 3, in cm
118// fV0AHeight4 = 20.9; // height of cell 4, in cm
119// fV0ARMin = 4.30;
120// fV0ACellThickness = 2.00; // thickness of elementary cell
121//
c985a636 122// Parameters related to light output :
123
0b2bea8b 124// fLightYield = 93.75; // Light yield in BC408 (93.75 eV per photon)
125// fLightAttenuation = 0.05; // Light attenuation in fiber (0.05 per meter)
126// fnMeters = 15.0; // Number of meters of clear fibers to PM
127// fFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
c985a636 128}
129
c985a636 130//_____________________________________________________________________________
131void AliVZEROv6::CreateGeometry()
132{
133
134// Constructs TGeo geometry
135
136 const int kColorVZERO = kGreen;
137
138 AliDebug(2,"VZERO ConstructGeometry");
139
54aa7396 140// TGeoMedium *medAir = gGeoManager->GetMedium("VZERO_Air");
c985a636 141 TGeoMedium *medAlu = gGeoManager->GetMedium("VZERO_Aluminum");
142 TGeoMedium *medCar = gGeoManager->GetMedium("VZERO_Carbon");
143 TGeoMedium *medSci = gGeoManager->GetMedium("VZERO_Scintillator");
144
145 TGeoVolume *top = gGeoManager->GetVolume("ALIC");
146
c985a636 147 Float_t heightRight, r4Right;
148
149 Float_t zdet = 90.0 - 0.5 - fV0CBoxThickness/2.0;
150 heightRight = fV0CHeight1 + fV0CHeight2 + fV0CHeight3 + fV0CHeight4;
151 r4Right = fV0CRMin + heightRight + 3.0*0.2; // 3 spacings of 2mm between rings
c985a636 152
54aa7396 153// Creation of assembly V0RI - right part - :
c985a636 154
54aa7396 155 TGeoVolume *v0RI = new TGeoVolumeAssembly("V0RI");
c985a636 156 TGeoTranslation *tr1 = new TGeoTranslation(0.,0.,-zdet);
157 top->AddNode(v0RI,1,tr1);
c985a636 158
159// Creation of carbon lids (3.0 mm thick) to keep V0C box shut :
54aa7396 160
161 Float_t partube[3];
c985a636 162
163 partube[0] = fV0CRMin;
164 partube[1] = fV0CRBox;
165 partube[2] = fV0CLidThickness/2.0;
166
167 TGeoTube *sV0CA = new TGeoTube("V0CA", partube[0], partube[1], partube[2]);
168 TGeoVolume *v0CA = new TGeoVolume("V0CA",sV0CA,medCar);
169 TGeoTranslation *tr2 = new TGeoTranslation(0.,0., fV0CBoxThickness/2.0-partube[2]);
170 TGeoTranslation *tr3 = new TGeoTranslation(0.,0.,-fV0CBoxThickness/2.0+partube[2]);
171 v0RI->AddNode(v0CA,1,tr2);
172 v0RI->AddNode(v0CA,2,tr3);
173 v0CA->SetLineColor(kYellow);
174
175// Creation of aluminum rings 3.0 mm thick to maintain the v0RI pieces :
176
177 partube[0] = fV0CRMin - 0.3;
178 partube[1] = fV0CRMin;
179 partube[2] = fV0CBoxThickness/2.0;
180
181 TGeoTube *sV0IR = new TGeoTube("V0IR", partube[0], partube[1], partube[2]);
182 TGeoVolume *v0IR = new TGeoVolume("V0IR",sV0IR,medAlu);
183 v0RI->AddNode(v0IR,1,0);
184 v0IR->SetLineColor(kYellow);
185
186 partube[0] = fV0CRBox;
187 partube[1] = fV0CRBox + 0.3;
188 partube[2] = fV0CBoxThickness/2.0;
189
190 TGeoTube *sV0ER = new TGeoTube("V0ER", partube[0], partube[1], partube[2]);
191 TGeoVolume *v0ER = new TGeoVolume("V0ER",sV0ER,medAlu);
192 v0RI->AddNode(v0ER,1,0);
193 v0ER->SetLineColor(kYellow);
194
54aa7396 195// Creation of assembly V0R0 of scintillator cells within one sector
c985a636 196
54aa7396 197 TGeoVolume *v0R0 = new TGeoVolumeAssembly("V0R0");
c985a636 198
199// Elementary cell of ring 1 - right part - :
200// (cells of ring 1 will be shifted by 2.0 cm backwards to output fibers)
201
202 Float_t r1Right = fV0CRMin + fV0CHeight1;
54aa7396 203 Float_t offset = fV0CBoxThickness/2.0 - fV0CLidThickness - fV0CCellThickness/2.0;
204
205 Float_t partubs[5];
206
c985a636 207 partubs[0] = fV0CRMin;
208 partubs[1] = r1Right;
209 partubs[2] = fV0CCellThickness/2.0;
54aa7396 210 partubs[3] = 90.0-22.5;
211 partubs[4] = 135.0-22.5;
212
c985a636 213 TGeoTubeSeg *sV0R1 = new TGeoTubeSeg("V0R1", partubs[0], partubs[1], partubs[2],
214 partubs[3], partubs[4]);
215 TGeoVolume *v0R1 = new TGeoVolume("V0R1",sV0R1,medSci);
216 TGeoTranslation *tr4 = new TGeoTranslation(0.,0.,-offset);
217 v0R0->AddNode(v0R1,1,tr4);
218 v0R1->SetLineColor(kColorVZERO);
219
220// Elementary cell of ring 2 - right part - :
221// (cells of ring 2 will be shifted by 1.0 cm backwards to output fibers)
222
223 Float_t r2Right = r1Right + fV0CHeight2;
224
225 partubs[0] = r1Right; // must be equal to 7.1
226 partubs[1] = r2Right; // must be equal to 11.5
227 TGeoTubeSeg *sV0R2 = new TGeoTubeSeg("V0R2", partubs[0], partubs[1], partubs[2],
228 partubs[3], partubs[4]);
229 TGeoVolume *v0R2 = new TGeoVolume("V0R2",sV0R2,medSci);
230 TGeoTranslation *tr5 = new TGeoTranslation(0.0,0.2,-offset + fV0COffsetFibers);
231 v0R0->AddNode(v0R2,1,tr5);
232 v0R2->SetLineColor(kColorVZERO);
233
234// Ring 3 - right part - :
235
236// Float_t x = TMath::ATan(1.0/156.0) * ((180./TMath::Pi()));
237
238 r2Right = r2Right + 0.2;
239 Float_t r3Right = r2Right + fV0CHeight3;
54aa7396 240// printf(" r2 = %f, r3 = %f \n\n", r2Right,r3Right);
c985a636 241
242 partubs[0] = r2Right; // must be equal to 11.7
243 partubs[1] = r3Right; // must be equal to 19.1
244 partubs[3] = 90.0-22.5;
245 partubs[4] = 112.5-22.5;
246
247 TGeoTubeSeg *sV0R3 = new TGeoTubeSeg("V0R3", partubs[0], partubs[1], partubs[2],
248 partubs[3], partubs[4]);
249 TGeoVolume *v0R3 = new TGeoVolume("V0R3",sV0R3,medSci);
250 TGeoTranslation *tr6 = new TGeoTranslation(0.,0.2,-offset + 2.0*fV0COffsetFibers);
251 v0R0->AddNode(v0R3,1,tr6);
252 v0R3->SetLineColor(kColorVZERO);
253
254 partubs[3] = 112.5-22.5;
255 partubs[4] = 135.0-22.5;
256
257 TGeoTubeSeg *sV0R4 = new TGeoTubeSeg("V0R4", partubs[0], partubs[1], partubs[2],
258 partubs[3], partubs[4]);
259 TGeoVolume *v0R4 = new TGeoVolume("V0R4",sV0R4,medSci);
260 v0R0->AddNode(v0R4,1,tr6);
261 v0R4->SetLineColor(kColorVZERO);
262
263// Ring 4 - right part - :
264
265 Float_t x = TMath::ATan(3.5/257.5) * ((180./TMath::Pi()));
266 r3Right = r3Right + 0.2 + 0.2; // + 0.2 because no shift in translation here !!
267
268 partubs[0] = r3Right; // must be equal to 19.5
269 partubs[1] = r4Right; // must be equal to 32.0
270 partubs[3] = 90.0-22.5+x;
271 partubs[4] = 112.5-22.5-x;
272
273 TGeoTubeSeg *sV0R5 = new TGeoTubeSeg("V0R5", partubs[0], partubs[1], partubs[2],
274 partubs[3], partubs[4]);
275 TGeoVolume *v0R5 = new TGeoVolume("V0R5",sV0R5,medSci);
276 TGeoTranslation *tr7 = new TGeoTranslation(0.,0.0,-offset + 2.0*fV0COffsetFibers);
277 v0R0->AddNode(v0R5,1,tr7);
278 v0R5->SetLineColor(kColorVZERO);
279
280 partubs[3] = 112.5-22.5+x;
281 partubs[4] = 135.0-22.5-x;
282
283 TGeoTubeSeg *sV0R6 = new TGeoTubeSeg("V0R6", partubs[0], partubs[1], partubs[2],
284 partubs[3], partubs[4]);
285 TGeoVolume *v0R6 = new TGeoVolume("V0R6",sV0R6,medSci);
286 v0R0->AddNode(v0R6,1,tr7);
287 v0R6->SetLineColor(kColorVZERO);
288
289 Float_t phi;
290 Float_t phiDeg= 180./4.;
291
292 Int_t nsecR = 1; // number of sectors in right part of V0
293 Int_t ncellsR; // number of scintillating cells
294
295 for (phi = 22.5; phi < 360.0; phi = phi + phiDeg)
296
297 {
298 TGeoRotation *rot1 = new TGeoRotation("rot1", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
299
300 v0RI->AddNode(v0R0,nsecR,rot1);
301 nsecR++;
302 }
303
304 ncellsR = (nsecR - 1) * 6; // 6 cells per sector (2 cells in ring 3 and 4)
305 AliInfo(Form("Number of cells on Right side - V0C = %d", ncellsR));
306
54aa7396 307// Creation of assembly v0LE - left part - :
c985a636 308// Entrance face at +339.0 cm (new coordinate system) ...
309
310 Float_t heightLeft = fV0AHeight1 + fV0AHeight2 + fV0AHeight3 + fV0AHeight4;
311 Float_t r4Left = fV0ARMin + heightLeft;
54aa7396 312
313 TGeoVolume *v0LE = new TGeoVolumeAssembly("V0LE");
314
c985a636 315 TGeoTranslation *tr8 = new TGeoTranslation(0.,0.,339.0 + fV0ACellThickness/2.0);
316 top->AddNode(v0LE,1,tr8);
54aa7396 317
318// Creation of assembly V0L0 of scintillator cells within one sector
319
320 TGeoVolume *v0L0 = new TGeoVolumeAssembly("V0L0");
c985a636 321
322 Float_t offsetLeft;
323 offsetLeft = - fV0ACellThickness/2.0;
324
325 Float_t r1Left = fV0ARMin + fV0AHeight1;
326
327 partubs[0] = fV0ARMin;
328 partubs[1] = r1Left;
54aa7396 329 partubs[2] = fV0ACellThickness/2.0;
330 partubs[3] = 90.0-22.5;
331 partubs[4] = 135.0-22.5;
332
c985a636 333 TGeoTubeSeg *sV0L1 = new TGeoTubeSeg("V0L1", partubs[0], partubs[1], partubs[2],
334 partubs[3], partubs[4]);
335 TGeoVolume *v0L1 = new TGeoVolume("V0L1",sV0L1,medSci);
336 v0L0->AddNode(v0L1,1,gGeoIdentity);
337 v0L1->SetLineColor(kColorVZERO);
338 v0L1->SetVisibility(kTRUE);
339
340 Float_t r2Left = r1Left + fV0AHeight2;
341
342 partubs[0] = r1Left;
343 partubs[1] = r2Left;
344
345 TGeoTubeSeg *sV0L2 = new TGeoTubeSeg("V0L2", partubs[0], partubs[1], partubs[2],
346 partubs[3], partubs[4]);
347 TGeoVolume *v0L2 = new TGeoVolume("V0L2",sV0L2,medSci);
348 v0L0->AddNode(v0L2,1,gGeoIdentity);
349 v0L2->SetLineColor(kColorVZERO);
350 v0L2->SetVisibility(kTRUE);
351
352 Float_t r3Left = r2Left + fV0AHeight3;
353
354 partubs[0] = r2Left;
355 partubs[1] = r3Left;
356
357 TGeoTubeSeg *sV0L3 = new TGeoTubeSeg("V0L3", partubs[0], partubs[1], partubs[2],
358 partubs[3], partubs[4]);
359 TGeoVolume *v0L3 = new TGeoVolume("V0L3",sV0L3,medSci);
360 v0L0->AddNode(v0L3,1,gGeoIdentity);
361 v0L3->SetLineColor(kColorVZERO);
362 v0L3->SetVisibility(kTRUE);
363
364 partubs[0] = r3Left;
365 partubs[1] = r4Left;
366
367 TGeoTubeSeg *sV0L4 = new TGeoTubeSeg("V0L4", partubs[0], partubs[1], partubs[2],
368 partubs[3], partubs[4]);
369 TGeoVolume *v0L4 = new TGeoVolume("V0L4",sV0L4,medSci);
370 v0L0->AddNode(v0L4,1,gGeoIdentity);
371 v0L4->SetLineColor(kColorVZERO);
372 v0L4->SetVisibility(kTRUE);
373
374 Int_t nsecL = 1; // number of sectors in left part of V0
375 Int_t ncellsL; // number of scintillating cells
376
377 for (phi = 22.5; phi < 360.0; phi = phi + phiDeg)
378
379 {
380 TGeoRotation *rot1 = new TGeoRotation("rot1", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
381 v0LE->AddNode(v0L0,nsecL,rot1);
382 nsecL++;
383 }
384
385 ncellsL = (nsecL - 1) * 4; // 4 cells per sector
386 AliInfo(Form("Number of cells on Left side - V0A = %d\n", ncellsL));
16056ba5 387
388 gGeoManager->SetTopVolume(top);
c985a636 389 gGeoManager->CloseGeometry();
390// gGeoManager-> SetVisLevel(4);
c985a636 391}
392
393//_____________________________________________________________________________
394void AliVZEROv6::CreateMaterials()
395{
396
397// Creates materials used for geometry
398
399 AliDebug(2,"Create materials");
400
401// Int_t *idtmed = fIdtmed->GetArray()-2999;
402
403 Int_t fieldType = gAlice->Field()->Integ(); // Field type
54aa7396 404 Double_t maxField = gAlice->Field()->Max(); // Field max.
c985a636 405 Double_t maxBending = 0; // Max Angle
406 Double_t maxStepSize = 0.001; // Max step size
407 Double_t maxEnergyLoss = 1; // Max Delta E
408 Double_t precision = 0.001; // Precision
409 Double_t minStepSize = 0.001; // Minimum step size
410 Int_t id;
411 Double_t a, z, density, radLength, absLength;
412 Float_t tmaxfd, stemax, deemax, epsil, stmin;
413
414 a = 0.0; z = 0.0;
54aa7396 415 density = 0.0;
416 radLength = 0.0;
417 absLength = 999.0;
418 tmaxfd = 10.;
419 stemax = 0.1;
420 deemax = 0.1;
421 epsil = 0.001;
422 stmin = 0.001;
c985a636 423
424// Parameters for Air (= 0.01% C + 75% N + 23% O + 1% Ar )
425
426 Float_t aa[] = { 12.0107, 14.0067, 15.9994, 39.948 };
427 Float_t za[] = { 6., 7., 8., 18. };
428 Float_t wa[] = { 0.000124, 0.755267, 0.231781, 0.012827 };
429 density = 0.00120479;
430 maxBending = 1;
431 maxStepSize = .001;
432 precision = .001;
433 minStepSize = .001;
434 id = 1;
435 AliMixture(id, "Air", aa, za, density, 4, wa);
436 AliMedium(id, "Air", id, 1, fieldType, maxField, maxBending,
437 maxStepSize, maxEnergyLoss, precision, minStepSize);
438
439// Parameters for Aluminum
440
441 a = 26.98;
442 z = 13.00;
443 density = 2.7;
444 radLength = 8.9;
445 maxBending = 10;
446 maxStepSize = .01;
447 precision = .003;
448 minStepSize = .003;
449 id = 2;
450 AliMaterial( id, "Aluminum", a, z, density, radLength, 37.2, 0, 0);
451 AliMedium(id, "Aluminum", id, 1, fieldType, maxField, maxBending,
452 maxStepSize, maxEnergyLoss, precision, minStepSize);
453
454// Parameters for Carbon
455
456 a = 12.01;
457 z = 6.00;
458 density = 2.265;
459 radLength = 18.8;
460 id = 3;
461 AliMaterial(id, "Carbon", a, z, density, radLength, 49.9, 0, 0);
462 AliMedium(id, "Carbon", id, 1, fieldType, maxField, maxBending,
463 maxStepSize, maxEnergyLoss, precision, minStepSize);
464
465// Parameters for scintillator
466
467 Float_t as[] = { 1.00794, 12.011};
468 Float_t zs[] = { 1., 6.};
469 Float_t ws[] = { 1., 1.};
470 density = 1.032;
471 maxBending = 10;
472 maxStepSize = .01;
473 precision = .003;
474 minStepSize = .003;
475 id = 4;
476 AliMixture(id, "Scintillator", as, zs, density, -2, ws);
477 AliMedium(id, "Scintillator", id, 1, fieldType, maxField, maxBending,
478 maxStepSize,maxEnergyLoss,precision,minStepSize);
479
480
481}
482
483//_____________________________________________________________________________
484void AliVZEROv6::DrawModule() const
485{
486
487// Drawing is done in DrawVZERO.C
488
489 AliDebug(2,"DrawModule");
490}
491
492
493//_____________________________________________________________________________
494void AliVZEROv6::DrawGeometry()
495{
496
497// Drawing of V0 geometry done in DrawV0.C
498
499 AliDebug(2,"DrawGeometry");
500
501// Here is DrawV0.C :
502
503// void DrawV0()
504// {
505// TGeoVolume *top = gGeoManager->GetMasterVolume();
506// gGeoManager->SetNsegments(80);
507// Int_t nd = top->GetNdaughters();
508// for (Int_t i=0; i<nd; i++) top->GetNode(i)->GetVolume()->InvisibleAll();
509// TGeoVolume *v0ri = gGeoManager->GetVolume("V0RI");
510// TGeoVolume *v0le = gGeoManager->GetVolume("V0LE");
511// v0ri->SetVisibility(kTRUE);
512// v0ri->VisibleDaughters(kTRUE);
513// v0le->SetVisibility(kTRUE);
514// v0le->VisibleDaughters(kTRUE);
515// top->SetVisibility(kTRUE);
516// top->Draw();
517// }
518
519}
520
521//_____________________________________________________________________________
522void AliVZEROv6::Init()
523{
524// Initialises version of the VZERO Detector given in Config
525// Just prints an information message
526
527 AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
528
529 AliVZERO::Init();
530}
531
532//_____________________________________________________________________________
533void AliVZEROv6::StepManager()
534{
535
536// Step Manager, called at each step
537
538 Int_t copy;
539 static Int_t vol[4];
540 static Float_t hits[21];
541 static Float_t eloss, tlength;
542 static Int_t nPhotonsInStep;
543 static Int_t nPhotons;
544 static Int_t numStep;
545 Float_t ringNumber;
546 Float_t destep, step;
547
548 numStep += 1;
549
550// We keep only charged tracks :
551
552 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
553
554 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
555 vol[2] = gMC->CurrentVolID(copy);
556 vol[3] = copy;
557
558 static Int_t idV0R1 = gMC->VolId("V0R1");
559 static Int_t idV0L1 = gMC->VolId("V0L1");
560 static Int_t idV0R2 = gMC->VolId("V0R2");
561 static Int_t idV0L2 = gMC->VolId("V0L2");
562 static Int_t idV0R3 = gMC->VolId("V0R3");
563 static Int_t idV0L3 = gMC->VolId("V0L3");
564 static Int_t idV0R4 = gMC->VolId("V0R4");
565 static Int_t idV0L4 = gMC->VolId("V0L4");
566 static Int_t idV0R5 = gMC->VolId("V0R5");
567 static Int_t idV0R6 = gMC->VolId("V0R6");
568
569 if ( gMC->CurrentVolID(copy) == idV0R1 ||
570 gMC->CurrentVolID(copy) == idV0L1 )
571 ringNumber = 1.0;
572 else if ( gMC->CurrentVolID(copy) == idV0R2 ||
573 gMC->CurrentVolID(copy) == idV0L2 )
574 ringNumber = 2.0;
575 else if ( gMC->CurrentVolID(copy) == idV0R3 ||
576 gMC->CurrentVolID(copy) == idV0R4 ||
577 gMC->CurrentVolID(copy) == idV0L3 )
578 ringNumber = 3.0;
579 else if ( gMC->CurrentVolID(copy) == idV0R5 ||
580 gMC->CurrentVolID(copy) == idV0R6 ||
581 gMC->CurrentVolID(copy) == idV0L4 )
582 ringNumber = 4.0;
583 else
584 ringNumber = 0.0;
585
586
587 if ( ringNumber > 0.5 ) {
588
589 destep = gMC->Edep();
590 step = gMC->TrackStep();
591
592 nPhotonsInStep = Int_t(destep / (fLightYield *1e-9) );
593 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
594
595 eloss += destep;
596 tlength += step;
597
598 if ( gMC->IsTrackEntering() ) {
599
600 nPhotons = nPhotonsInStep;
601 gMC->TrackPosition(fTrackPosition);
602 gMC->TrackMomentum(fTrackMomentum);
603
604 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px() +
605 fTrackMomentum.Py() * fTrackMomentum.Py() );
606
607 hits[0] = fTrackPosition.X();
608 hits[1] = fTrackPosition.Y();
609 hits[2] = fTrackPosition.Z();
610 hits[3] = Float_t (gMC->TrackPid());
611
612 hits[4] = gMC->TrackTime();
613 hits[5] = gMC->TrackCharge();
614 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
615 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
616 hits[8] = ringNumber;
617
618 hits[9] = pt;
619 hits[10] = fTrackMomentum.P();
620 hits[11] = fTrackMomentum.Px();
621 hits[12] = fTrackMomentum.Py();
622 hits[13] = fTrackMomentum.Pz();
623
624 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
625 hits[14] = par->Vx();
626 hits[15] = par->Vy();
627 hits[16] = par->Vz();
628
629 tlength = 0.0;
630 eloss = 0.0;
631 }
632
633 nPhotons = nPhotons + nPhotonsInStep;
634
635 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
636
637 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * fLightAttenuation * fnMeters));
638 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fFibToPhot);
639
640 hits[17] = eloss;
641 hits[18] = tlength;
642 hits[19] = nPhotons;
643 hits[20] = GetCellId (vol, hits);
54aa7396 644
c985a636 645 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
646
647 tlength = 0.0;
648 eloss = 0.0;
649 nPhotons = 0;
650 nPhotonsInStep = 0;
651
652 numStep = 0;
653 }
654 }
655
656}
657
658//_____________________________________________________________________________
659void AliVZEROv6::AddHit(Int_t track, Int_t *vol, Float_t *hits)
660{
661
662// Adds a VZERO hit
663
664 TClonesArray &lhits = *fHits;
665 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
666}
667
668//_____________________________________________________________________________
669void AliVZEROv6::AddDigits(Int_t *tracks, Int_t* digits)
670{
671
672// Adds a VZERO digit
673
674 TClonesArray &ldigits = *fDigits;
675 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
676}
677
678//_____________________________________________________________________________
679void AliVZEROv6::MakeBranch(Option_t *option)
680{
681
682// Creates new branches in the current Root Tree
683
684 char branchname[10];
685 sprintf(branchname,"%s",GetName());
686 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
687
688 const char *cH = strstr(option,"H");
689
cb5b8b21 690 if (fHits && fLoader->TreeH() && cH) {
691 fLoader->TreeH()->Branch(branchname,&fHits, fBufferSize);
c985a636 692 AliDebug(2,Form("Making Branch %s for hits",branchname));
693 }
694
695 const char *cD = strstr(option,"D");
696
697 if (fDigits && fLoader->TreeD() && cD) {
698 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
699 AliDebug(2,Form("Making Branch %s for digits",branchname));
700 }
701
702}
703
704//_____________________________________________________________________________
705Int_t AliVZEROv6::GetCellId(Int_t *vol, Float_t *hits)
706{
707
708 // Returns Id of scintillator cell
709 // Right side from 0 to 47
710 // Left side from 48 to 95
711
712 // hits[8] = ring number (1 to 4)
713 // vol[1] = copy number (1 to 8)
714
715 Int_t index = vol[1];
83f1e436 716 Int_t ringNumber = Int_t(hits[8]);
c985a636 717 fCellId = 0;
718
719// cout << "volID = " << vol[0] << " copy = " << vol[1] << endl;
720// cout << "X = " << hits[0] << " Y = " << hits[1] << endl;
721
722 Float_t phi = Float_t(TMath::ATan2(Double_t(hits[1]),Double_t(hits[0])) );
c985a636 723 phi = kRaddeg * phi;
724
725 if (index < 7) index = index + 8;
726
727 if (hits[2] < 0.0) {
83f1e436 728 if(ringNumber < 3) {
729 index = (index - 7) + ( ( ringNumber - 1 ) * 8);}
730 else if(ringNumber >= 3){
c985a636 731 if(gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R3")||
732 gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R5") )
83f1e436 733 {index = (index*2 - 14) + ( ( ringNumber - 2 ) * 16); }
c985a636 734 if(gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R4")||
735 gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R6") )
83f1e436 736 {index = (index*2 - 13) + ( ( ringNumber - 2 ) * 16); }
c985a636 737 }
738 fCellId = index;
739 }
740
741 else if (hits[2] > 0.0){
83f1e436 742 index = (index - 7 + 48) + ( ( ringNumber - 1 ) * 8);
c985a636 743 fCellId = index;}
744
83f1e436 745// cout << " ring = " << ringNumber << " phi = "<< phi << endl;
c985a636 746// cout << " cellID = " << fCellId << endl;
747// cout << "**********" << endl;
748
749 return fCellId;
750
751
752}