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 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 //
28 //////////////////////////////////////////////////////////////////////
30 #include "AliVZEROv6.h"
34 //_____________________________________________________________________________
35 AliVZEROv6:: AliVZEROv6():AliVZERO(),
45 fV0CLidThickness(0.30),
46 fV0CCellThickness(2.00),
47 fV0CBoxThickness(4.70),
48 fV0COffsetFibers(1.0),
54 fV0ACellThickness(2.00),
56 fLightAttenuation(0.05),
61 // Standard default constructor
64 //_____________________________________________________________________________
65 AliVZEROv6::AliVZEROv6(const char *name, const char *title):
76 fV0CLidThickness(0.30),
77 fV0CCellThickness(2.00),
78 fV0CBoxThickness(4.70),
79 fV0COffsetFibers(1.0),
85 fV0ACellThickness(2.00),
87 fLightAttenuation(0.05),
93 // Standard constructor for V-zero Detector version 6
95 AliDebug(2,"Create VZERO object ");
97 fVersion = 6; // version number
99 // Parameters related to geometry :
100 // V0 part in front of muon arm absorber
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
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
113 // V0 part on the other side with respect to Interaction Point
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
120 // fV0ACellThickness = 2.00; // thickness of elementary cell
122 // Parameters related to light output :
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
130 //_____________________________________________________________________________
131 void AliVZEROv6::CreateGeometry()
134 // Constructs TGeo geometry
136 const int kColorVZERO = kGreen;
138 AliDebug(2,"VZERO ConstructGeometry");
140 // TGeoMedium *medAir = gGeoManager->GetMedium("VZERO_Air");
141 TGeoMedium *medAlu = gGeoManager->GetMedium("VZERO_Aluminum");
142 TGeoMedium *medCar = gGeoManager->GetMedium("VZERO_Carbon");
143 TGeoMedium *medSci = gGeoManager->GetMedium("VZERO_Scintillator");
145 TGeoVolume *top = gGeoManager->GetVolume("ALIC");
147 Float_t heightRight, r4Right;
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
153 // Creation of assembly V0RI - right part - :
155 TGeoVolume *v0RI = new TGeoVolumeAssembly("V0RI");
156 TGeoTranslation *tr1 = new TGeoTranslation(0.,0.,-zdet);
157 top->AddNode(v0RI,1,tr1);
159 // Creation of carbon lids (3.0 mm thick) to keep V0C box shut :
163 partube[0] = fV0CRMin;
164 partube[1] = fV0CRBox;
165 partube[2] = fV0CLidThickness/2.0;
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);
175 // Creation of aluminum rings 3.0 mm thick to maintain the v0RI pieces :
177 partube[0] = fV0CRMin - 0.3;
178 partube[1] = fV0CRMin;
179 partube[2] = fV0CBoxThickness/2.0;
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);
186 partube[0] = fV0CRBox;
187 partube[1] = fV0CRBox + 0.3;
188 partube[2] = fV0CBoxThickness/2.0;
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);
195 // Creation of assembly V0R0 of scintillator cells within one sector
197 TGeoVolume *v0R0 = new TGeoVolumeAssembly("V0R0");
199 // Elementary cell of ring 1 - right part - :
200 // (cells of ring 1 will be shifted by 2.0 cm backwards to output fibers)
202 Float_t r1Right = fV0CRMin + fV0CHeight1;
203 Float_t offset = fV0CBoxThickness/2.0 - fV0CLidThickness - fV0CCellThickness/2.0;
207 partubs[0] = fV0CRMin;
208 partubs[1] = r1Right;
209 partubs[2] = fV0CCellThickness/2.0;
210 partubs[3] = 90.0-22.5;
211 partubs[4] = 135.0-22.5;
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);
220 // Elementary cell of ring 2 - right part - :
221 // (cells of ring 2 will be shifted by 1.0 cm backwards to output fibers)
223 Float_t r2Right = r1Right + fV0CHeight2;
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);
234 // Ring 3 - right part - :
236 // Float_t x = TMath::ATan(1.0/156.0) * ((180./TMath::Pi()));
238 r2Right = r2Right + 0.2;
239 Float_t r3Right = r2Right + fV0CHeight3;
240 // printf(" r2 = %f, r3 = %f \n\n", r2Right,r3Right);
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;
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);
254 partubs[3] = 112.5-22.5;
255 partubs[4] = 135.0-22.5;
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);
263 // Ring 4 - right part - :
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 !!
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;
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);
280 partubs[3] = 112.5-22.5+x;
281 partubs[4] = 135.0-22.5-x;
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);
290 Float_t phiDeg= 180./4.;
292 Int_t nsecR = 1; // number of sectors in right part of V0
293 Int_t ncellsR; // number of scintillating cells
295 for (phi = 22.5; phi < 360.0; phi = phi + phiDeg)
298 TGeoRotation *rot1 = new TGeoRotation("rot1", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
300 v0RI->AddNode(v0R0,nsecR,rot1);
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));
307 // Creation of assembly v0LE - left part - :
308 // Entrance face at +339.0 cm (new coordinate system) ...
310 Float_t heightLeft = fV0AHeight1 + fV0AHeight2 + fV0AHeight3 + fV0AHeight4;
311 Float_t r4Left = fV0ARMin + heightLeft;
313 TGeoVolume *v0LE = new TGeoVolumeAssembly("V0LE");
315 TGeoTranslation *tr8 = new TGeoTranslation(0.,0.,339.0 + fV0ACellThickness/2.0);
316 top->AddNode(v0LE,1,tr8);
318 // Creation of assembly V0L0 of scintillator cells within one sector
320 TGeoVolume *v0L0 = new TGeoVolumeAssembly("V0L0");
323 offsetLeft = - fV0ACellThickness/2.0;
325 Float_t r1Left = fV0ARMin + fV0AHeight1;
327 partubs[0] = fV0ARMin;
329 partubs[2] = fV0ACellThickness/2.0;
330 partubs[3] = 90.0-22.5;
331 partubs[4] = 135.0-22.5;
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);
340 Float_t r2Left = r1Left + fV0AHeight2;
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);
352 Float_t r3Left = r2Left + fV0AHeight3;
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);
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);
374 Int_t nsecL = 1; // number of sectors in left part of V0
375 Int_t ncellsL; // number of scintillating cells
377 for (phi = 22.5; phi < 360.0; phi = phi + phiDeg)
380 TGeoRotation *rot1 = new TGeoRotation("rot1", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
381 v0LE->AddNode(v0L0,nsecL,rot1);
385 ncellsL = (nsecL - 1) * 4; // 4 cells per sector
386 AliInfo(Form("Number of cells on Left side - V0A = %d\n", ncellsL));
388 gGeoManager->SetTopVolume(top);
389 gGeoManager->CloseGeometry();
390 // gGeoManager-> SetVisLevel(4);
393 //_____________________________________________________________________________
394 void AliVZEROv6::CreateMaterials()
397 // Creates materials used for geometry
399 AliDebug(2,"Create materials");
401 // Int_t *idtmed = fIdtmed->GetArray()-2999;
403 Int_t fieldType = gAlice->Field()->Integ(); // Field type
404 Double_t maxField = gAlice->Field()->Max(); // Field max.
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
411 Double_t a, z, density, radLength, absLength;
412 Float_t tmaxfd, stemax, deemax, epsil, stmin;
424 // Parameters for Air (= 0.01% C + 75% N + 23% O + 1% Ar )
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;
435 AliMixture(id, "Air", aa, za, density, 4, wa);
436 AliMedium(id, "Air", id, 1, fieldType, maxField, maxBending,
437 maxStepSize, maxEnergyLoss, precision, minStepSize);
439 // Parameters for Aluminum
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);
454 // Parameters for Carbon
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);
465 // Parameters for scintillator
467 Float_t as[] = { 1.00794, 12.011};
468 Float_t zs[] = { 1., 6.};
469 Float_t ws[] = { 1., 1.};
476 AliMixture(id, "Scintillator", as, zs, density, -2, ws);
477 AliMedium(id, "Scintillator", id, 1, fieldType, maxField, maxBending,
478 maxStepSize,maxEnergyLoss,precision,minStepSize);
483 //_____________________________________________________________________________
484 void AliVZEROv6::DrawModule() const
487 // Drawing is done in DrawVZERO.C
489 AliDebug(2,"DrawModule");
493 //_____________________________________________________________________________
494 void AliVZEROv6::DrawGeometry()
497 // Drawing of V0 geometry done in DrawV0.C
499 AliDebug(2,"DrawGeometry");
501 // Here is DrawV0.C :
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);
521 //_____________________________________________________________________________
522 void AliVZEROv6::Init()
524 // Initialises version of the VZERO Detector given in Config
525 // Just prints an information message
527 AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
532 //_____________________________________________________________________________
533 void AliVZEROv6::StepManager()
536 // Step Manager, called at each step
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;
546 Float_t destep, step;
550 // We keep only charged tracks :
552 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
554 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
555 vol[2] = gMC->CurrentVolID(copy);
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");
569 if ( gMC->CurrentVolID(copy) == idV0R1 ||
570 gMC->CurrentVolID(copy) == idV0L1 )
572 else if ( gMC->CurrentVolID(copy) == idV0R2 ||
573 gMC->CurrentVolID(copy) == idV0L2 )
575 else if ( gMC->CurrentVolID(copy) == idV0R3 ||
576 gMC->CurrentVolID(copy) == idV0R4 ||
577 gMC->CurrentVolID(copy) == idV0L3 )
579 else if ( gMC->CurrentVolID(copy) == idV0R5 ||
580 gMC->CurrentVolID(copy) == idV0R6 ||
581 gMC->CurrentVolID(copy) == idV0L4 )
587 if ( ringNumber > 0.5 ) {
589 destep = gMC->Edep();
590 step = gMC->TrackStep();
592 nPhotonsInStep = Int_t(destep / (fLightYield *1e-9) );
593 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
598 if ( gMC->IsTrackEntering() ) {
600 nPhotons = nPhotonsInStep;
601 gMC->TrackPosition(fTrackPosition);
602 gMC->TrackMomentum(fTrackMomentum);
604 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px() +
605 fTrackMomentum.Py() * fTrackMomentum.Py() );
607 hits[0] = fTrackPosition.X();
608 hits[1] = fTrackPosition.Y();
609 hits[2] = fTrackPosition.Z();
610 hits[3] = Float_t (gMC->TrackPid());
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;
619 hits[10] = fTrackMomentum.P();
620 hits[11] = fTrackMomentum.Px();
621 hits[12] = fTrackMomentum.Py();
622 hits[13] = fTrackMomentum.Pz();
624 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
625 hits[14] = par->Vx();
626 hits[15] = par->Vy();
627 hits[16] = par->Vz();
633 nPhotons = nPhotons + nPhotonsInStep;
635 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
637 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * fLightAttenuation * fnMeters));
638 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fFibToPhot);
643 hits[20] = GetCellId (vol, hits);
645 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
658 //_____________________________________________________________________________
659 void AliVZEROv6::AddHit(Int_t track, Int_t *vol, Float_t *hits)
664 TClonesArray &lhits = *fHits;
665 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
668 //_____________________________________________________________________________
669 void AliVZEROv6::AddDigits(Int_t *tracks, Int_t* digits)
672 // Adds a VZERO digit
674 TClonesArray &ldigits = *fDigits;
675 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
678 //_____________________________________________________________________________
679 void AliVZEROv6::MakeBranch(Option_t *option)
682 // Creates new branches in the current Root Tree
685 sprintf(branchname,"%s",GetName());
686 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
688 const char *cH = strstr(option,"H");
690 if (fHits && fLoader->TreeH() && cH) {
691 fLoader->TreeH()->Branch(branchname,&fHits, fBufferSize);
692 AliDebug(2,Form("Making Branch %s for hits",branchname));
695 const char *cD = strstr(option,"D");
697 if (fDigits && fLoader->TreeD() && cD) {
698 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
699 AliDebug(2,Form("Making Branch %s for digits",branchname));
704 //_____________________________________________________________________________
705 Int_t AliVZEROv6::GetCellId(Int_t *vol, Float_t *hits)
708 // Returns Id of scintillator cell
709 // Right side from 0 to 47
710 // Left side from 48 to 95
712 // hits[8] = ring number (1 to 4)
713 // vol[1] = copy number (1 to 8)
715 Int_t index = vol[1];
716 Int_t ringNumber = Int_t(hits[8]);
719 // cout << "volID = " << vol[0] << " copy = " << vol[1] << endl;
720 // cout << "X = " << hits[0] << " Y = " << hits[1] << endl;
722 Float_t phi = Float_t(TMath::ATan2(Double_t(hits[1]),Double_t(hits[0])) );
725 if (index < 7) index = index + 8;
729 index = (index - 7) + ( ( ringNumber - 1 ) * 8);}
730 else if(ringNumber >= 3){
731 if(gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R3")||
732 gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R5") )
733 {index = (index*2 - 14) + ( ( ringNumber - 2 ) * 16); }
734 if(gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R4")||
735 gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R6") )
736 {index = (index*2 - 13) + ( ( ringNumber - 2 ) * 16); }
741 else if (hits[2] > 0.0){
742 index = (index - 7 + 48) + ( ( ringNumber - 1 ) * 8);
745 // cout << " ring = " << ringNumber << " phi = "<< phi << endl;
746 // cout << " cellID = " << fCellId << endl;
747 // cout << "**********" << endl;