Fixing copy/paste typo
[u/mrichter/AliRoot.git] / VZERO / AliVZEROv7.cxx
CommitLineData
1a809d19 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 7 as designed by the Lyon and //
21// Mexico groups and Carlos Perez Lara from Pontificia Universidad //
22// Catolica del Peru //
23// All comments should be sent to Brigitte CHEYNIS: //
24// b.cheynis@ipnl.in2p3.fr //
25// Geometry of April 2006 done with ROOT geometrical modeler //
26// V0R (now V0C) sits between Z values -89.5 and -84.8 cm //
27// V0L (now V0A) sits between Z values +338.5 and +342.5 cm //
28// New coordinate system has been implemented in october 2003 //
29// //
30///////////////////////////////////////////////////////////////////////
31
32// --- Standard libraries ---
33#include <Riostream.h>
1a809d19 34
35// --- ROOT libraries ---
36#include <TClonesArray.h>
1a809d19 37#include <TMath.h>
1a809d19 38#include <TVirtualMC.h>
39#include <TParticle.h>
40
41#include <TGeoManager.h>
42#include <TGeoMaterial.h>
43#include <TGeoMedium.h>
1a809d19 44#include <TGeoVolume.h>
45#include "TGeoTube.h"
46#include "TGeoArb8.h"
1a809d19 47#include "TGeoCompositeShape.h"
48
49// --- AliRoot header files ---
50#include "AliRun.h"
51#include "AliMC.h"
1a809d19 52#include "AliMagF.h"
53#include "AliVZEROLoader.h"
54#include "AliVZEROdigit.h"
55#include "AliVZEROhit.h"
56#include "AliVZEROv7.h"
57#include "AliLog.h"
58
59ClassImp(AliVZEROv7)
60
61//_____________________________________________________________________________
0b2bea8b 62AliVZEROv7:: AliVZEROv7():AliVZERO(),
63 fCellId(0),
64 fTrackPosition(),
65 fTrackMomentum(),
66 fV0CHeight1(2.5),
67 fV0CHeight2(4.4),
68 fV0CHeight3(7.4),
69 fV0CHeight4(12.5),
70 fV0CRMin(4.6),
71 fV0CRBox(38.0),
72 fV0CLidThickness(0.30),
73 fV0CCellThickness(2.00),
74 fV0CBoxThickness(4.70),
75 fV0COffsetFibers(1.0),
76 fV0CLightYield(93.75),
77 fV0CLightAttenuation(0.05),
78 fV0CnMeters(15.0),
79 fV0CFibToPhot(0.3),
80 fV0AR0(4.2),
81 fV0AR1(7.6),
82 fV0AR2(13.8),
83 fV0AR3(22.7),
84 fV0AR4(41.3),
85 fV0AR5(43.3),
86 fV0AR6(68.0),
87 fV0ASciWd(2.5),
88 fV0APlaWd(0.5),
89 fV0APlaAl(0.06),
90 fV0AOctWd(0.75),
91 fV0AFraWd(0.2),
92 fV0AOctH1(1.0),
93 fV0AOctH2(2.0),
94 fV0ABasHt(2.0),
95 fV0AFibRd(0.1),
96 fV0APlaEx(4.4),
97 fV0APMBWd(24.6),
98 fV0APMBHt(22.0),
99 fV0APMBTh(7.1),
100 fV0APMBWdW(0.3),
101 fV0APMBHtW(1.0),
102 fV0APMBAng(30.0),
103 fV0APMBThW(0.3),
104 fV0APMTR1(2.44),
105 fV0APMTR2(2.54),
106 fV0APMTR3(2.54),
107 fV0APMTR4(2.70),
108 fV0APMTH(10.0),
109 fV0APMTB(1.0),
110 fV0AnMeters(fV0AR6*0.01),
111 fV0ALightYield(93.75),
112 fV0ALightAttenuation(0.05),
113 fV0AFibToPhot(0.3),
114 fVersion(7)
1a809d19 115{
116// Standard default constructor
117}
118
119//_____________________________________________________________________________
0b2bea8b 120AliVZEROv7::AliVZEROv7(const char *name, const char *title):AliVZERO(name,title),
121 fCellId(0),
122 fTrackPosition(),
123 fTrackMomentum(),
124 fV0CHeight1(2.5),
125 fV0CHeight2(4.4),
126 fV0CHeight3(7.4),
127 fV0CHeight4(12.5),
128 fV0CRMin(4.6),
129 fV0CRBox(38.0),
130 fV0CLidThickness(0.30),
131 fV0CCellThickness(2.00),
132 fV0CBoxThickness(4.70),
133 fV0COffsetFibers(1.0),
134 fV0CLightYield(93.75),
135 fV0CLightAttenuation(0.05),
136 fV0CnMeters(15.0),
137 fV0CFibToPhot(0.3),
138 fV0AR0(4.2),
139 fV0AR1(7.6),
140 fV0AR2(13.8),
141 fV0AR3(22.7),
142 fV0AR4(41.3),
143 fV0AR5(43.3),
144 fV0AR6(68.0),
145 fV0ASciWd(2.5),
146 fV0APlaWd(0.5),
147 fV0APlaAl(0.06),
148 fV0AOctWd(0.75),
149 fV0AFraWd(0.2),
150 fV0AOctH1(1.0),
151 fV0AOctH2(2.0),
152 fV0ABasHt(2.0),
153 fV0AFibRd(0.1),
154 fV0APlaEx(4.4),
155 fV0APMBWd(24.6),
156 fV0APMBHt(22.0),
157 fV0APMBTh(7.1),
158 fV0APMBWdW(0.3),
159 fV0APMBHtW(1.0),
160 fV0APMBAng(30.0),
161 fV0APMBThW(0.3),
162 fV0APMTR1(2.44),
163 fV0APMTR2(2.54),
164 fV0APMTR3(2.54),
165 fV0APMTR4(2.70),
166 fV0APMTH(10.0),
167 fV0APMTB(1.0),
168 fV0AnMeters(fV0AR6*0.01),
169 fV0ALightYield(93.75),
170 fV0ALightAttenuation(0.05),
171 fV0AFibToPhot(0.3),
172 fVersion(7)
173
174
1a809d19 175{
176// Standard constructor for V-zero Detector version 7
177
178 AliDebug(2,"Create VZERO object ");
0b2bea8b 179
180// fVersion = 7; // version number
181
182// // V0C Parameters related to geometry: All in cm
183// fV0CHeight1 = 2.5; // height of cell 1
184// fV0CHeight2 = 4.4; // height of cell 2
185// fV0CHeight3 = 7.4; // height of cell 3
186// fV0CHeight4 = 12.5; // height of cell 4
187// fV0CRMin = 4.6; // inner radius of box
188// fV0CRBox = 38.0; // outer radius of box
189// fV0CLidThickness = 0.30; // thickness of Carbon lid
190// fV0CCellThickness = 2.00; // thickness of elementary cell
191// fV0CBoxThickness = 4.70; // thickness of V0C Box
192// fV0COffsetFibers = 1.0; // offset to output fibers
193// // V0C Parameters related to light output
194// fV0CLightYield = 93.75; // Light yield in BC408 (93.75 eV per photon)
195// fV0CLightAttenuation = 0.05; // Light attenuation in fiber (0.05 per meter)
196// fV0CnMeters = 15.0; // Number of meters of clear fibers to PM
197// fV0CFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
198//
199// // V0A Parameters related to geometry: All in cm
200// fV0AR0 = 4.2; // Radius of hole
201// fV0AR1 = 7.6; // Maximun radius of 1st cell
202// fV0AR2 = 13.8; // Maximun radius of 2nd cell
203// fV0AR3 = 22.7; // Maximun radius of 3rd cell
204// fV0AR4 = 41.3; // Maximun radius of 4th cell
205// fV0AR5 = 43.3; // Radius circunscrite to innermost octagon
206// fV0AR6 = 68.0; // Radius circunscrite to outtermost octagon
207// fV0ASciWd = 2.5; // Scintillator thickness
208// fV0APlaWd = 0.5; // Plates thinckness
209// fV0APlaAl = 0.06; // Plates AlMg3 thinckness
210// fV0AOctWd = 0.75; // Innermost octagon thickness
211// fV0AOctH1 = 1.0; // Height of innermost octagon
212// fV0AOctH2 = 2.0; // Height of outtermost octagon
213// fV0AFibRd = 0.1; // Radius of Fiber
214// fV0AFraWd = 0.2; // Support Frame thickness
215// fV0APMBWd = 24.6; // Width of PM Box
216// fV0APMBHt = 22.0; // Height of PM Box
217// fV0APMBTh = 7.1; // Thickness of PM Box
218// fV0APMBWdW = 0.3; // Thickness of PM Box Side1 Wall
219// fV0APMBHtW = 1.0; // Thickness of PM Box Side2 Wall
220// fV0APMBThW = 0.3; // Thickness of PM Box Top Wall
221// fV0APMBAng = 30.0; // Angle between PM Box and Support
222// fV0APMTR1 = 2.44; // PMT Glass
223// fV0APMTR2 = 2.54; // PMT Glass
224// fV0APMTR3 = 2.54; // PMT Cover
225// fV0APMTR4 = 2.70; // PMT Cover
226// fV0APMTH = 10.0; // PMT Height
227// fV0APMTB = 1.0; // PMT Basis
228// fV0APlaEx = 4.4; // Plates Extension height
229// fV0ABasHt = 2.0; // Basis Height
230// // V0A Parameters related to light output
231// fV0ALightYield = 93.75; // Light yield in BC404
232// fV0ALightAttenuation = 0.05; // Light attenuation in WLS fiber, per meter
233// fV0AnMeters = fV0AR6*0.01; // Tentative value, in meters
234// fV0AFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
1a809d19 235}
236//_____________________________________________________________________________
237
238void AliVZEROv7::BuildGeometry()
239{
240}
241
242//_____________________________________________________________________________
243void AliVZEROv7::CreateGeometry()
244{
245// Constructs TGeo geometry
246
247 AliDebug(2,"VZERO ConstructGeometry");
248 TGeoVolume *top = gGeoManager->GetVolume("ALIC");
249
250 ///////////////////////////////////////////////////////////////////////////
251 // Construct the geometry of V0C Detector. Brigitte CHEYNIS
252
253 const int kColorVZERO = kGreen;
254 TGeoMedium *medV0CAlu = gGeoManager->GetMedium("VZERO_V0CAlu");
255 TGeoMedium *medV0CCar = gGeoManager->GetMedium("VZERO_V0CCar");
256 TGeoMedium *medV0CSci = gGeoManager->GetMedium("VZERO_V0CSci");
257 TGeoVolume *v0RI = new TGeoVolumeAssembly("V0RI");
258 Float_t heightRight, r4Right;
259 Float_t zdet = 90.0 - 0.5 - fV0CBoxThickness/2.0;
260 heightRight = fV0CHeight1 + fV0CHeight2 + fV0CHeight3 + fV0CHeight4;
261 r4Right = fV0CRMin + heightRight + 3.0*0.2; // 3 spacings of 2mm between rings
262
263 // Creation of carbon lids (3.0 mm thick) to keep V0C box shut :
264 Float_t partube[3];
265 partube[0] = fV0CRMin;
266 partube[1] = fV0CRBox;
267 partube[2] = fV0CLidThickness/2.0;
268 TGeoTube *sV0CA = new TGeoTube("V0CA", partube[0], partube[1], partube[2]);
269 TGeoVolume *v0CA = new TGeoVolume("V0CA",sV0CA,medV0CCar);
270 TGeoTranslation *tr2 = new TGeoTranslation(0.,0., fV0CBoxThickness/2.0-partube[2]);
271 TGeoTranslation *tr3 = new TGeoTranslation(0.,0.,-fV0CBoxThickness/2.0+partube[2]);
272 v0RI->AddNode(v0CA,1,tr2);
273 v0RI->AddNode(v0CA,2,tr3);
274 v0CA->SetLineColor(kYellow);
275
276 // Creation of aluminum rings 3.0 mm thick to maintain the v0RI pieces :
277 partube[0] = fV0CRMin - 0.3;
278 partube[1] = fV0CRMin;
279 partube[2] = fV0CBoxThickness/2.0;
280 TGeoTube *sV0IR = new TGeoTube("V0IR", partube[0], partube[1], partube[2]);
281 TGeoVolume *v0IR = new TGeoVolume("V0IR",sV0IR,medV0CAlu);
282 v0RI->AddNode(v0IR,1,0);
283 v0IR->SetLineColor(kYellow);
284 partube[0] = fV0CRBox;
285 partube[1] = fV0CRBox + 0.3;
286 partube[2] = fV0CBoxThickness/2.0;
287 TGeoTube *sV0ER = new TGeoTube("V0ER", partube[0], partube[1], partube[2]);
288 TGeoVolume *v0ER = new TGeoVolume("V0ER",sV0ER,medV0CAlu);
289 v0RI->AddNode(v0ER,1,0);
290 v0ER->SetLineColor(kYellow);
291
292 // Creation of assembly V0R0 of scintillator cells within one sector
293 TGeoVolume *v0R0 = new TGeoVolumeAssembly("V0R0");
294
295 // Elementary cell of ring 1 - right part - :
296 // (cells of ring 1 will be shifted by 2.0 cm backwards to output fibers)
297 Float_t r1Right = fV0CRMin + fV0CHeight1;
298 Float_t offset = fV0CBoxThickness/2.0 - fV0CLidThickness - fV0CCellThickness/2.0;
299 Float_t partubs[5];
300 partubs[0] = fV0CRMin;
301 partubs[1] = r1Right;
302 partubs[2] = fV0CCellThickness/2.0;
303 partubs[3] = 90.0-22.5;
304 partubs[4] = 135.0-22.5;
305 TGeoTubeSeg *sV0R1 = new TGeoTubeSeg("V0R1", partubs[0], partubs[1], partubs[2],
306 partubs[3], partubs[4]);
307 TGeoVolume *v0R1 = new TGeoVolume("V0R1",sV0R1,medV0CSci);
308 TGeoTranslation *tr4 = new TGeoTranslation(0.,0.,-offset);
309 v0R0->AddNode(v0R1,1,tr4);
310 v0R1->SetLineColor(kColorVZERO);
311
312 // Elementary cell of ring 2 - right part - :
313 // (cells of ring 2 will be shifted by 1.0 cm backwards to output fibers)
314 Float_t r2Right = r1Right + fV0CHeight2;
315 partubs[0] = r1Right; // must be equal to 7.1
316 partubs[1] = r2Right; // must be equal to 11.5
317 TGeoTubeSeg *sV0R2 = new TGeoTubeSeg("V0R2", partubs[0], partubs[1], partubs[2],
318 partubs[3], partubs[4]);
319 TGeoVolume *v0R2 = new TGeoVolume("V0R2",sV0R2,medV0CSci);
320 TGeoTranslation *tr5 = new TGeoTranslation(0.0,0.2,-offset + fV0COffsetFibers);
321 v0R0->AddNode(v0R2,1,tr5);
322 v0R2->SetLineColor(kColorVZERO);
323
324 // Ring 3 - right part - :
325 r2Right = r2Right + 0.2;
326 Float_t r3Right = r2Right + fV0CHeight3;
327 partubs[0] = r2Right; // must be equal to 11.7
328 partubs[1] = r3Right; // must be equal to 19.1
329 partubs[3] = 90.0-22.5;
330 partubs[4] = 112.5-22.5;
331 TGeoTubeSeg *sV0R3 = new TGeoTubeSeg("V0R3", partubs[0], partubs[1], partubs[2],
332 partubs[3], partubs[4]);
333 TGeoVolume *v0R3 = new TGeoVolume("V0R3",sV0R3,medV0CSci);
334 TGeoTranslation *tr6 = new TGeoTranslation(0.,0.2,-offset + 2.0*fV0COffsetFibers);
335 v0R0->AddNode(v0R3,1,tr6);
336 v0R3->SetLineColor(kColorVZERO);
337 partubs[3] = 112.5-22.5;
338 partubs[4] = 135.0-22.5;
339 TGeoTubeSeg *sV0R4 = new TGeoTubeSeg("V0R4", partubs[0], partubs[1], partubs[2],
340 partubs[3], partubs[4]);
341 TGeoVolume *v0R4 = new TGeoVolume("V0R4",sV0R4,medV0CSci);
342 v0R0->AddNode(v0R4,1,tr6);
343 v0R4->SetLineColor(kColorVZERO);
344
345 // Ring 4 - right part - :
346 Float_t x = TMath::ATan(3.5/257.5) * ((180./TMath::Pi()));
347 r3Right = r3Right + 0.2 + 0.2; // + 0.2 because no shift in translation here !!
348 partubs[0] = r3Right; // must be equal to 19.5
349 partubs[1] = r4Right; // must be equal to 32.0
350 partubs[3] = 90.0-22.5+x;
351 partubs[4] = 112.5-22.5-x;
352 TGeoTubeSeg *sV0R5 = new TGeoTubeSeg("V0R5", partubs[0], partubs[1], partubs[2],
353 partubs[3], partubs[4]);
354 TGeoVolume *v0R5 = new TGeoVolume("V0R5",sV0R5,medV0CSci);
355 TGeoTranslation *tr7 = new TGeoTranslation(0.,0.0,-offset + 2.0*fV0COffsetFibers);
356 v0R0->AddNode(v0R5,1,tr7);
357 v0R5->SetLineColor(kColorVZERO);
358 partubs[3] = 112.5-22.5+x;
359 partubs[4] = 135.0-22.5-x;
360 TGeoTubeSeg *sV0R6 = new TGeoTubeSeg("V0R6", partubs[0], partubs[1], partubs[2],
361 partubs[3], partubs[4]);
362 TGeoVolume *v0R6 = new TGeoVolume("V0R6",sV0R6,medV0CSci);
363 v0R0->AddNode(v0R6,1,tr7);
364 v0R6->SetLineColor(kColorVZERO);
365 Float_t phi;
366 Float_t phiDeg= 180./4.;
367 Int_t nsecR = 1; // number of sectors in right part of V0
368 for (phi = 22.5; phi < 360.0; phi = phi + phiDeg) {
369 TGeoRotation *rot1 = new TGeoRotation("rot1", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
370 v0RI->AddNode(v0R0,nsecR,rot1);
371 nsecR++;
372 }
373
374 ///////////////////////////////////////////////////////////////////////////
375 // Construct the geometry of V0A Detector. Carlos PEREZ, PUCP
376
377 const int kV0AColorSci = 5;
378 const int kV0AColorPlaIn = 3;
379 const int kV0AColorPlaOu = 41;
380 const int kV0AColorOct = 7;
381 const int kV0AColorFra = 6;
382 const int kV0AColorFib = 11;
383 const int kV0AColorPMG = 1;
384 const int kV0AColorPMA = 2;
385 const int kV0AColorBas = 20;
386 TGeoMedium *medV0ASci = gGeoManager->GetMedium("VZERO_V0ASci");
387 TGeoMedium *medV0APlaIn = gGeoManager->GetMedium("VZERO_V0APlaIn");
388 TGeoMedium *medV0APlaOu = gGeoManager->GetMedium("VZERO_V0APlaOu");
389 TGeoMedium *medV0ASup = gGeoManager->GetMedium("VZERO_V0ALuc");
390 TGeoMedium *medV0AFra = gGeoManager->GetMedium("VZERO_V0ALuc");
391 TGeoMedium *medV0AFib = gGeoManager->GetMedium("VZERO_V0AFib");
392 TGeoMedium *medV0APMGlass = gGeoManager->GetMedium("VZERO_V0APMG");
393 TGeoMedium *medV0APMAlum = gGeoManager->GetMedium("VZERO_V0APMA");
394 TGeoMedium *medV0ABas = gGeoManager->GetMedium("VZERO_V0ALuc");
395 double pi = TMath::Pi();
396 double sin225 = TMath::Sin(pi/8.);
397 double cos225 = TMath::Cos(pi/8.);
398 double ctg225 = cos225/sin225;
399 double sin45 = TMath::Sin(pi/4.); // lucky: Sin45=Cos45
5063dd34 400 double v0APts[16];
1a809d19 401
402 ////////////////////////////
403 /// Definition of one sector
5063dd34 404 TGeoVolume *v0ASec = new TGeoVolumeAssembly("V0ASec");
1a809d19 405
406 /// For boolean sustraction
407 double preShape = 0.2;
408 for (int i=0;i<2;i++) {
5063dd34 409 v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.-preShape; v0APts[1+8*i] = -preShape;
410 v0APts[2+8*i] = fV0AR0-fV0AFraWd/2.-preShape; v0APts[3+8*i] = fV0AFraWd/2.;
411 v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.+preShape; v0APts[5+8*i] = fV0AFraWd/2.;
412 v0APts[6+8*i] = fV0AR4+fV0AFraWd/2.+preShape; v0APts[7+8*i] = -preShape;
1a809d19 413 }
5063dd34 414 new TGeoArb8("sV0ACha1",fV0ASciWd/1.5,v0APts);
1a809d19 415 for (int i=0;i<2;i++) {
5063dd34 416 v0APts[0+8*i] = fV0AR0*sin45-preShape;
417 v0APts[1+8*i] = (fV0AR0-fV0AFraWd)*sin45-preShape;
418 v0APts[2+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45-preShape;
419 v0APts[3+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45;
420 v0APts[4+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45+preShape;
421 v0APts[5+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45+2.*preShape;
422 v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45+preShape;
423 v0APts[7+8*i] = fV0AR4*sin45+preShape;
1a809d19 424 }
5063dd34 425 new TGeoArb8("sV0ACha2", fV0ASciWd/2.+2.*preShape, v0APts);
1a809d19 426 new TGeoCompositeShape("sV0ACha","sV0ACha1+sV0ACha2");
427
428 /// Frame
5063dd34 429 TGeoVolume *v0AFra = new TGeoVolumeAssembly("V0AFra");
1a809d19 430 for (int i=0;i<2;i++) {
5063dd34 431 v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[1+8*i] = 0.;
432 v0APts[2+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[3+8*i] = fV0AFraWd/2.;
433 v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[5+8*i] = fV0AFraWd/2.;
434 v0APts[6+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[7+8*i] = 0.;
1a809d19 435 }
5063dd34 436 TGeoArb8 *sV0AFraB1 = new TGeoArb8("sV0AFraB1",fV0ASciWd/2.,v0APts);
437 TGeoVolume *v0AFraB1 = new TGeoVolume("V0AFraB1",sV0AFraB1,medV0AFra);
1a809d19 438 for (int i=0;i<2;i++) {
5063dd34 439 v0APts[0+8*i] = fV0AR0*sin45;
440 v0APts[1+8*i] = (fV0AR0-fV0AFraWd)*sin45;
441 v0APts[2+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45;
442 v0APts[3+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45;
443 v0APts[4+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45;
444 v0APts[5+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45;
445 v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45;
446 v0APts[7+8*i] = fV0AR4*sin45;
1a809d19 447 }
5063dd34 448 TGeoArb8 *sV0AFraB2 = new TGeoArb8("sV0AFraB2", fV0ASciWd/2., v0APts);
449 TGeoVolume *v0AFraB2 = new TGeoVolume("V0AFraB2",sV0AFraB2,medV0AFra);
450 v0AFraB1->SetLineColor(kV0AColorFra); v0AFraB2->SetLineColor(kV0AColorFra);
451 v0AFra->AddNode(v0AFraB1,1);
452 v0AFra->AddNode(v0AFraB2,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
1a809d19 453 new TGeoTubeSeg( "sV0AFraR1b", fV0AR0-fV0AFraWd/2.,
454 fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
455 new TGeoTubeSeg( "sV0AFraR2b", fV0AR1-fV0AFraWd/2.,
456 fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
457 new TGeoTubeSeg( "sV0AFraR3b", fV0AR2-fV0AFraWd/2.,
458 fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
459 new TGeoTubeSeg( "sV0AFraR4b", fV0AR3-fV0AFraWd/2.,
460 fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
461 new TGeoTubeSeg( "sV0AFraR5b", fV0AR4-fV0AFraWd/2.,
462 fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
463 TGeoCompositeShape *sV0AFraR1 = new TGeoCompositeShape("sV0AFraR1","sV0AFraR1b-sV0ACha");
464 TGeoCompositeShape *sV0AFraR2 = new TGeoCompositeShape("sV0AFraR2","sV0AFraR2b-sV0ACha");
465 TGeoCompositeShape *sV0AFraR3 = new TGeoCompositeShape("sV0AFraR3","sV0AFraR3b-sV0ACha");
466 TGeoCompositeShape *sV0AFraR4 = new TGeoCompositeShape("sV0AFraR4","sV0AFraR4b-sV0ACha");
467 TGeoCompositeShape *sV0AFraR5 = new TGeoCompositeShape("sV0AFraR5","sV0AFraR5b-sV0ACha");
5063dd34 468 TGeoVolume *v0AFraR1 = new TGeoVolume("V0AFraR1",sV0AFraR1,medV0AFra);
469 TGeoVolume *v0AFraR2 = new TGeoVolume("V0AFraR2",sV0AFraR2,medV0AFra);
470 TGeoVolume *v0AFraR3 = new TGeoVolume("V0AFraR3",sV0AFraR3,medV0AFra);
471 TGeoVolume *v0AFraR4 = new TGeoVolume("V0AFraR4",sV0AFraR4,medV0AFra);
472 TGeoVolume *v0AFraR5 = new TGeoVolume("V0AFraR5",sV0AFraR5,medV0AFra);
473 v0AFraR1->SetLineColor(kV0AColorFra); v0AFraR2->SetLineColor(kV0AColorFra);
474 v0AFraR3->SetLineColor(kV0AColorFra); v0AFraR4->SetLineColor(kV0AColorFra);
475 v0AFraR5->SetLineColor(kV0AColorFra);
476 v0AFra->AddNode(v0AFraR1,1);
477 v0AFra->AddNode(v0AFraR2,1);
478 v0AFra->AddNode(v0AFraR3,1);
479 v0AFra->AddNode(v0AFraR4,1);
480 v0AFra->AddNode(v0AFraR5,1);
481 v0ASec->AddNode(v0AFra,1);
1a809d19 482
483 /// Sensitive scintilator
5063dd34 484 TGeoVolume *v0ASci = new TGeoVolumeAssembly("V0ASci");
1a809d19 485 new TGeoTubeSeg( "sV0AR1b", fV0AR0+fV0AFraWd/2.,
486 fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
487 new TGeoTubeSeg( "sV0AR2b", fV0AR1+fV0AFraWd/2.,
488 fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
489 new TGeoTubeSeg( "sV0AR3b", fV0AR2+fV0AFraWd/2.,
490 fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
491 new TGeoTubeSeg( "sV0AR4b", fV0AR3+fV0AFraWd/2.,
492 fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
493 TGeoCompositeShape *sV0AR1 = new TGeoCompositeShape("sV0AR1","sV0AR1b-sV0ACha");
494 TGeoCompositeShape *sV0AR2 = new TGeoCompositeShape("sV0AR2","sV0AR2b-sV0ACha");
495 TGeoCompositeShape *sV0AR3 = new TGeoCompositeShape("sV0AR3","sV0AR3b-sV0ACha");
496 TGeoCompositeShape *sV0AR4 = new TGeoCompositeShape("sV0AR4","sV0AR4b-sV0ACha");
5063dd34 497 TGeoVolume *v0L1 = new TGeoVolume("V0L1",sV0AR1,medV0ASci);
498 TGeoVolume *v0L2 = new TGeoVolume("V0L2",sV0AR2,medV0ASci);
499 TGeoVolume *v0L3 = new TGeoVolume("V0L3",sV0AR3,medV0ASci);
500 TGeoVolume *v0L4 = new TGeoVolume("V0L4",sV0AR4,medV0ASci);
501 v0L1->SetLineColor(kV0AColorSci); v0L2->SetLineColor(kV0AColorSci);
502 v0L3->SetLineColor(kV0AColorSci); v0L4->SetLineColor(kV0AColorSci);
742d6134 503 v0ASec->AddNode(v0L1,1);
504 v0ASec->AddNode(v0L2,1);
505 v0ASec->AddNode(v0L3,1);
506 v0ASec->AddNode(v0L4,1);
1a809d19 507
508 /// Non-sensitive scintilator
509 for (int i=0;i<2;i++) {
5063dd34 510 v0APts[0+8*i] = fV0AR4;
511 v0APts[1+8*i] = fV0AFraWd/2.;
512 v0APts[2+8*i] = fV0AR4*sin45;
513 v0APts[3+8*i] = (fV0AR4-fV0AFraWd)*sin45;
514 v0APts[4+8*i] = fV0AR5/cos225*sin45+fV0AFraWd/2.*sin225;
515 v0APts[5+8*i] = fV0AR5/cos225*sin45-fV0AFraWd/2.*cos225;
516 v0APts[6+8*i] = fV0AR5/cos225-fV0AFraWd/2./ctg225;
517 v0APts[7+8*i] = fV0AFraWd/2.;
1a809d19 518 }
5063dd34 519 new TGeoArb8("sV0AR5S1", fV0ASciWd/2., v0APts);
520 new TGeoTubeSeg("sV0AR5S2", fV0AR4-(v0APts[6]-v0APts[0]),
1a809d19 521 fV0AR4+fV0AFraWd/2., fV0ASciWd/2.+2*preShape, 0, 45);
522 TGeoCompositeShape *sV0AR5 = new TGeoCompositeShape("V0AR5","(sV0AR5S1 - sV0AR5S2)");
5063dd34 523 TGeoVolume *v0AR5 = new TGeoVolume("V0AR5",sV0AR5,medV0ASci);
524 v0AR5->SetLineColor(kV0AColorSci);
525 v0ASci->AddNode(v0AR5,1);
526 v0ASec->AddNode(v0ASci,1);
1a809d19 527
528 /// Segment of innermost octagon
5063dd34 529 TGeoVolume *v0ASup = new TGeoVolumeAssembly("V0ASup");
1a809d19 530 for (int i=0;i<2;i++) {
5063dd34 531 v0APts[0+8*i] = (fV0AR5-fV0AOctH1)/cos225; v0APts[1+8*i] = 0.;
532 v0APts[2+8*i] = (fV0AR5-fV0AOctH1)/cos225*sin45; v0APts[3+8*i] = (fV0AR5-fV0AOctH1)/cos225*sin45;
533 v0APts[4+8*i] = fV0AR5/cos225*sin45; v0APts[5+8*i] = fV0AR5/cos225*sin45;
534 v0APts[6+8*i] = fV0AR5/cos225; v0APts[7+8*i] = 0.;
1a809d19 535 }
5063dd34 536 TGeoArb8 *sV0AOct1 = new TGeoArb8("sV0AOct1", fV0AOctWd/2., v0APts);
537 TGeoVolume *v0AOct1 = new TGeoVolume("V0AOct1",sV0AOct1,medV0ASup);
538 v0AOct1->SetLineColor(kV0AColorOct);
539 v0ASup->AddNode(v0AOct1,1,new TGeoTranslation(0,0,(fV0ASciWd+fV0AOctWd)/2.));
540 v0ASup->AddNode(v0AOct1,2,new TGeoTranslation(0,0,-(fV0ASciWd+fV0AOctWd)/2.));
1a809d19 541
542 /// Segment of outtermost octagon
543 for (int i=0;i<2;i++) {
5063dd34 544 v0APts[0+8*i] = (fV0AR6-fV0AOctH2)/cos225; v0APts[1+8*i] = 0.;
545 v0APts[2+8*i] = (fV0AR6-fV0AOctH2)/cos225*sin45; v0APts[3+8*i] = (fV0AR6-fV0AOctH2)/cos225*sin45;
546 v0APts[4+8*i] = fV0AR6/cos225*sin45; v0APts[5+8*i] = fV0AR6/cos225*sin45;
547 v0APts[6+8*i] = fV0AR6/cos225; v0APts[7+8*i] = 0.;
1a809d19 548 }
5063dd34 549 TGeoArb8 *sV0AOct2 = new TGeoArb8("sV0AOct2", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
550 TGeoVolume *v0AOct2 = new TGeoVolume("V0AOct2", sV0AOct2,medV0ASup);
551 v0AOct2->SetLineColor(kV0AColorOct);
552 v0ASup->AddNode(v0AOct2,1);
553 v0ASec->AddNode(v0ASup,1);
1a809d19 554
555 /// Bunch of fibers
5063dd34 556 v0APts[ 0] = v0APts[ 2] = -12.5;
557 v0APts[ 1] = v0APts[ 7] = (fV0ASciWd+fV0AOctWd)/2.-0.01;
558 v0APts[ 3] = v0APts[ 5] = (fV0ASciWd+fV0AOctWd)/2.+0.01;
559 v0APts[ 4] = v0APts[ 6] = +12.5;
560 v0APts[ 8] = v0APts[10] = -0.5;
561 v0APts[ 9] = v0APts[15] = 0.;
562 v0APts[11] = v0APts[13] = 0.25;
563 v0APts[12] = v0APts[14] = +0.5;
564 TGeoArb8 *sV0AFib = new TGeoArb8("sV0AFib", (fV0AR6-fV0AR5-fV0AOctH2-0.006)/2., v0APts);
565 TGeoVolume *v0AFib1 = new TGeoVolume("V0AFib1",sV0AFib,medV0AFib);
566 TGeoVolume *v0AFib = new TGeoVolumeAssembly("V0AFib");
1a809d19 567 TGeoRotation *rot = new TGeoRotation("rot");
568 rot->RotateX(-90);
569 rot->RotateZ(-90.+22.5);
5063dd34 570 v0AFib->AddNode(v0AFib1,1,rot);
1a809d19 571 rot = new TGeoRotation("rot");
572 rot->RotateX(-90);
573 rot->RotateY(180);
574 rot->RotateZ(-90.+22.5);
5063dd34 575 v0AFib->SetLineColor(kV0AColorFib);
576 v0AFib->AddNode(v0AFib1,2,rot);
577 v0ASec->AddNode(v0AFib,1,new TGeoTranslation((fV0AR6-fV0AOctH2+fV0AR5)*cos225/2.,
1a809d19 578 (fV0AR6-fV0AOctH2+fV0AR5)*sin225/2., 0));
579
580 /// Plates
581 for (int i=0;i<2;i++) {
5063dd34 582 v0APts[0+8*i] = fV0AR0; v0APts[1+8*i] = 0.;
583 v0APts[2+8*i] = fV0AR0*sin45; v0APts[3+8*i] = fV0AR0*sin45;
584 v0APts[4+8*i] = fV0AR6/cos225 * sin45; v0APts[5+8*i] = fV0AR6/cos225*sin45;
585 v0APts[6+8*i] = fV0AR6/cos225; v0APts[7+8*i] = 0.;
1a809d19 586 }
5063dd34 587 TGeoArb8 *sV0APlaIn = new TGeoArb8("sV0APlaIn", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
588 TGeoVolume *v0APlaIn = new TGeoVolume("V0APlaIn", sV0APlaIn, medV0APlaIn);
589 TGeoArb8 *sV0APlaOu = new TGeoArb8("sV0APlaOu", fV0APlaAl/2., v0APts);
590 TGeoVolume *v0APlaOu = new TGeoVolume("V0APlaOu", sV0APlaOu, medV0APlaOu);
591 v0APlaIn->SetLineColor(kV0AColorPlaIn); v0APlaOu->SetLineColor(kV0AColorPlaOu);
592 TGeoVolume *v0APla = new TGeoVolumeAssembly("V0APla");
593 v0APla->AddNode(v0APlaIn,1);
594 v0APla->AddNode(v0APlaOu,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
595 v0APla->AddNode(v0APlaOu,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
596 v0ASec->AddNode(v0APla,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
597 v0ASec->AddNode(v0APla,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1a809d19 598
599 /// PMBox
5063dd34 600 TGeoVolume* v0APM = new TGeoVolumeAssembly("V0APM");
1a809d19 601 new TGeoBBox("sV0APMB1", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
602 new TGeoBBox("sV0APMB2", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
603 TGeoCompositeShape *sV0APMB = new TGeoCompositeShape("sV0APMB","sV0APMB1-sV0APMB2");
5063dd34 604 TGeoVolume *v0APMB = new TGeoVolume("V0APMB",sV0APMB, medV0APMAlum);
605 v0APMB->SetLineColor(kV0AColorPMA);
606 v0APM->AddNode(v0APMB,1);
1a809d19 607
608 /// PMTubes
609 TGeoTube *sV0APMT1 = new TGeoTube("sV0APMT1", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
5063dd34 610 TGeoVolume *v0APMT1 = new TGeoVolume("V0APMT1", sV0APMT1, medV0APMGlass);
1a809d19 611 TGeoTube *sV0APMT2 = new TGeoTube("sV0APMT2", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
5063dd34 612 TGeoVolume *v0APMT2 = new TGeoVolume("V0APMT2", sV0APMT2, medV0APMAlum);
613 TGeoVolume *v0APMT = new TGeoVolumeAssembly("V0APMT");
1a809d19 614 TGeoTube *sV0APMTT = new TGeoTube("sV0APMTT", 0., fV0APMTR4, fV0APMTB/2.);
558d06bf 615 TGeoVolume *v0APMTT = new TGeoVolume("V0APMTT", sV0APMTT, medV0APMAlum);
5063dd34 616 v0APMT1->SetLineColor(kV0AColorPMG);
617 v0APMT2->SetLineColor(kV0AColorPMA);
618 v0APMTT->SetLineColor(kV0AColorPMA);
1a809d19 619 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
5063dd34 620 v0APMT->AddNode(v0APMT1,1,rot);
621 v0APMT->AddNode(v0APMT2,1,rot);
622 v0APMT->AddNode(v0APMTT,1,new TGeoCombiTrans(0,-(fV0APMTH+fV0APMTB)/2.,0,rot));
1a809d19 623 double autoShift = (fV0APMBWd-2*fV0APMBWdW)/4.;
5063dd34 624 v0APM->AddNode(v0APMT, 1, new TGeoTranslation(-1.5*autoShift, 0, 0));
625 v0APM->AddNode(v0APMT, 2, new TGeoTranslation(-0.5*autoShift, 0, 0));
626 v0APM->AddNode(v0APMT, 3, new TGeoTranslation(+0.5*autoShift, 0, 0));
627 v0APM->AddNode(v0APMT, 4, new TGeoTranslation(+1.5*autoShift, 0, 0));
1a809d19 628
629 /// PM
630 rot = new TGeoRotation("rot");
631 rot->RotateX(90-fV0APMBAng);
632 rot->RotateZ(-90.+22.5);
633 double cosAngPMB = TMath::Cos(fV0APMBAng*TMath::DegToRad());
634 double sinAngPMB = TMath::Sin(fV0APMBAng*TMath::DegToRad());
635 double shiftZ = fV0APMBHt/2. * cosAngPMB
636 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB;
637 double shiftR = fV0AR6 + fV0APMBHt/2. * sinAngPMB + fV0APMBTh/2. * cosAngPMB;
5063dd34 638 v0ASec->AddNode(v0APM,1, new TGeoCombiTrans( shiftR*cos225, shiftR*sin225, shiftZ, rot));
1a809d19 639
640 /// End of sector definition
641 ////////////////////////////
642
643 /// Replicate sectors
644 TGeoVolume *v0LE = new TGeoVolumeAssembly("V0LE");
645 for(int i=0; i<8; i++) {
742d6134 646 TGeoRotation *rot = new TGeoRotation("rot", 90., i*45.+90, 90., 90.+i*45.+90, 0., 0.);
647 v0LE->AddNode(v0ASec,i+1,rot); /// modificacion +1 anhadido
1a809d19 648 }
649
650 /// Basis Construction
651 rot = new TGeoRotation("rot"); rot->RotateX(90-fV0APMBAng); rot->RotateZ(-22.5);
652 TGeoCombiTrans *pos1 = new TGeoCombiTrans("pos1", shiftR*sin225, shiftR*cos225, shiftZ, rot);
653 pos1->RegisterYourself();
654 for (int i=0;i<2;i++) {
5063dd34 655 v0APts[0+8*i] = fV0AR6/cos225*sin45; v0APts[1+8*i] = fV0AR6/cos225*sin45;
656 v0APts[2+8*i] = 0; v0APts[3+8*i] = fV0AR6/cos225;
657 v0APts[4+8*i] = 0; v0APts[5+8*i] = fV0AR6/cos225+fV0APlaEx;
658 v0APts[6+8*i] = fV0AR6/cos225-(fV0AR6/cos225+fV0APlaEx)/ctg225;
659 v0APts[7+8*i] = fV0AR6/cos225+fV0APlaEx;
1a809d19 660 }
5063dd34 661 new TGeoArb8("sV0APlaExIn1", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
662 new TGeoArb8("sV0APlaExOu1", fV0APlaAl/2., v0APts);
1a809d19 663 TGeoCompositeShape *sV0APlaExIn = new TGeoCompositeShape("sV0APlaExIn","sV0APlaExIn1-sV0APMB1:pos1");
5063dd34 664 TGeoVolume *v0APlaExIn = new TGeoVolume("V0APlaExIn", sV0APlaExIn, medV0APlaIn);
1a809d19 665 TGeoCompositeShape *sV0APlaExOu = new TGeoCompositeShape("sV0APlaExOu","sV0APlaExOu1-sV0APMB1:pos1");
5063dd34 666 TGeoVolume *v0APlaExOu = new TGeoVolume("V0APlaExOu", sV0APlaExOu, medV0APlaOu);
667 v0APlaExIn->SetLineColor(kV0AColorPlaIn); v0APlaExOu->SetLineColor(kV0AColorPlaOu);
668 TGeoVolume *v0APlaEx = new TGeoVolumeAssembly("V0APlaEx");
669 v0APlaEx->AddNode(v0APlaExIn,1);
670 v0APlaEx->AddNode(v0APlaExOu,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
671 v0APlaEx->AddNode(v0APlaExOu,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
1a809d19 672 for (int i=0;i<2;i++) {
5063dd34 673 v0APts[0+8*i] = fV0AR6/cos225-(fV0AR6/cos225+fV0APlaEx)/ctg225-fV0ABasHt*sin45;
674 v0APts[1+8*i] = fV0AR6/cos225+fV0APlaEx-fV0ABasHt*sin45;
675 v0APts[2+8*i] = 0; v0APts[3+8*i] = fV0AR6/cos225+fV0APlaEx-fV0ABasHt;
676 v0APts[4+8*i] = 0; v0APts[5+8*i] = fV0AR6/cos225+fV0APlaEx;
677 v0APts[6+8*i] = fV0AR6/cos225-(fV0AR6/cos225+fV0APlaEx)/ctg225;
678 v0APts[7+8*i] = fV0AR6/cos225+fV0APlaEx;
1a809d19 679 }
5063dd34 680 new TGeoArb8("sV0ABas1", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
1a809d19 681 TGeoCompositeShape *sV0ABas = new TGeoCompositeShape("sV0ABas","sV0ABas1-sV0APMB1:pos1");
5063dd34 682 TGeoVolume *v0ABas = new TGeoVolume("V0ABas", sV0ABas, medV0ABas);
683 v0ABas->SetLineColor(kV0AColorBas);
684 TGeoVolume *v0ABasis = new TGeoVolumeAssembly("V0ABasis");
1a809d19 685 rot = new TGeoRotation("rot",90.,180.,90.,90.,0.,0.);
5063dd34 686 v0ABasis->AddNode(v0APlaEx,1, new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
687 v0ABasis->AddNode(v0APlaEx,2, new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
688 v0ABasis->AddNode(v0APlaEx,3, new TGeoCombiTrans(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.,rot));
689 v0ABasis->AddNode(v0APlaEx,4, new TGeoCombiTrans(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.,rot));
690 v0ABasis->AddNode(v0ABas,1);
691 v0ABasis->AddNode(v0ABas,2,rot);
1a809d19 692 rot = new TGeoRotation("rot");
693 rot->RotateZ(180);
5063dd34 694 v0LE->AddNode(v0ABasis,1,rot);
1a809d19 695
edc39343 696 // Adding detectors to top volume
5063dd34 697 TGeoVolume *vZERO = new TGeoVolumeAssembly("VZERO");
698 vZERO->AddNode(v0RI,1,new TGeoTranslation(0, 0, -zdet));
edc39343 699 // V0A position according to TB decision 13/12/2005
700 vZERO->AddNode(v0LE,1,new TGeoTranslation(0, 0, +327.5));
5063dd34 701 top->AddNode(vZERO,1);
1a809d19 702}
45b81649 703
704//_____________________________________________________________________________
705void AliVZEROv7::AddAlignableVolumes() const
706{
707 //
708 // Create entries for alignable volumes associating the symbolic volume
709 // name with the corresponding volume path. Needs to be syncronized with
710 // eventual changes in the geometry.
711 //
712 TString vpC = "/ALIC_1/VZERO_1/V0RI_1";
713 TString vpA = "/ALIC_1/VZERO_1/V0LE_1";
714 TString snC = "VZERO/V0C";
715 TString snA = "VZERO/V0A";
716
717 if(!gGeoManager->SetAlignableEntry(snC.Data(),vpC.Data()))
718 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snC.Data(),vpC.Data()));
719 if(!gGeoManager->SetAlignableEntry(snA.Data(),vpA.Data()))
720 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snA.Data(),vpA.Data()));
721
722}
723
1a809d19 724//_____________________________________________________________________________
725void AliVZEROv7::CreateMaterials()
726{
727
728// Creates materials used for geometry
729
730 AliDebug(2,"Create materials");
731 // Parameters for simulation scope
732 Int_t fieldType = gAlice->Field()->Integ(); // Field type
733 Double_t maxField = gAlice->Field()->Max(); // Field max.
734 Double_t maxBending = 10; // Max Angle
735 Double_t maxStepSize = 0.01; // Max step size
736 Double_t maxEnergyLoss = 1; // Max Delta E
737 Double_t precision = 0.003; // Precision
738 Double_t minStepSize = 0.003; // Minimum step size
739
740 Int_t id;
741 Double_t a, z, radLength, absLength;
742 Float_t density, as[4], zs[4], ws[4];
743
744// Parameters for V0CPrePlates: Aluminium
745 a = 26.98;
746 z = 13.00;
747 density = 2.7;
748 radLength = 8.9;
749 absLength = 37.2;
750 id = 2;
751 AliMaterial( id, "V0CAlu", a, z, density, radLength, absLength, 0, 0);
752 AliMedium(id, "V0CAlu", id, 1, fieldType, maxField, maxBending, maxStepSize,
753 maxEnergyLoss, precision, minStepSize);
754
755// Parameters for V0CPlates: Carbon
756 a = 12.01;
757 z = 6.00;
758 density = 2.265;
759 radLength = 18.8;
760 absLength = 49.9;
761 id = 3;
762 AliMaterial(id, "V0CCar", a, z, density, radLength, absLength, 0, 0);
763 AliMedium(id, "V0CCar", id, 1, fieldType, maxField, maxBending, maxStepSize,
764 maxEnergyLoss, precision, minStepSize);
765
766// Parameters for V0Cscintillator: BC408
767 as[0] = 1.00794; as[1] = 12.011;
768 zs[0] = 1.; zs[1] = 6.;
769 ws[0] = 1.; ws[1] = 1.;
770 density = 1.032;
771 id = 4;
772 AliMixture(id, "V0CSci", as, zs, density, -2, ws);
773 AliMedium(id,"V0CSci", id, 1, fieldType, maxField, maxBending, maxStepSize,
774 maxEnergyLoss, precision, minStepSize);
775
776// Parameters for V0Ascintilator: BC404
777 as[0] = 1.00794; as[1] = 12.011;
778 zs[0] = 1.; zs[1] = 6.;
779 ws[0] = 5.21; ws[1] = 4.74;
780 density = 1.032;
781 id = 5;
782 AliMixture(id, "V0ASci", as, zs, density, -2, ws);
783 AliMedium(id, "V0ASci", id, 1, fieldType, maxField, maxBending, maxStepSize,
784 maxEnergyLoss, precision, minStepSize);
785
786// Parameters for V0ALuc: Lucita but for the simulation BC404
787 as[0] = 1.00794; as[1] = 12.011;
788 zs[0] = 1.; zs[1] = 6.;
789 ws[0] = 5.21; ws[1] = 4.74;
790 density = 1.032;
791 id = 6;
792 AliMixture(id, "V0ALuc", as, zs, density, -2, ws);
793 AliMedium(id, "V0ALuc", id, 1, fieldType, maxField, maxBending, maxStepSize,
794 maxEnergyLoss, precision, minStepSize);
795
796// Parameters for V0Aplate: EuroComposite - EC-PI 626 PS - AlMg3
797 as[0] = 26.982; as[1] = 24.305;
798 zs[0] = 13.; zs[1] = 12.;
799 ws[0] = 1.; ws[1] = 3.;
800 density = 3.034;
801 id = 7;
802 AliMixture(id, "V0APlaOu", as, zs, density, -2, ws);
803 AliMedium(id, "V0APlaOu", id, 1, fieldType, maxField, maxBending, maxStepSize,
804 maxEnergyLoss, precision, minStepSize);
805
806// Parameters for V0Aplate: EuroComposite - EC-PI 626 PS - EC-PI 6.4-42
807 as[0] = 1.00794; as[1] = 12.011;
808 zs[0] = 1.; zs[1] = 6.;
809 ws[0] = 5.21; ws[1] = 4.74;
810 density = 0.042;
811 id = 8;
812 AliMixture(id, "V0APlaIn", as, zs, density, -2, ws);
813 AliMedium(id, "V0APlaIn", id, 1, fieldType, maxField, maxBending, maxStepSize,
814 maxEnergyLoss, precision, minStepSize);
815
816// Parameters for V0Afiber: BC9929AMC Plastic Scintillating Fiber from Saint-Gobain
817 as[0] = 1.00794; as[1] = 12.011;
818 zs[0] = 1.; zs[1] = 6.;
819 ws[0] = 4.82; ws[1] = 4.85;
820 density = 1.05;
821 id = 9;
822 AliMixture(id, "V0AFib", as, zs, density, -2, ws);
823 AliMedium(id, "V0AFib", id, 1, fieldType, maxField, maxBending, maxStepSize,
824 maxEnergyLoss, precision, minStepSize);
825
826// Parameters for V0APMA: Aluminium
827 a = 26.98;
828 z = 13.00;
829 density = 2.7;
830 radLength = 8.9;
831 absLength = 37.2;
832 id = 10;
833 AliMaterial(id, "V0APMA", a, z, density, radLength, absLength, 0, 0);
834 AliMedium(id, "V0APMA", id, 1, fieldType, maxField, maxBending, maxStepSize,
835 maxEnergyLoss, precision, minStepSize);
836
837// Parameters for V0APMG: Glass for the simulation Aluminium
838 a = 26.98;
839 z = 13.00;
840 density = 2.7;
841 radLength = 8.9;
842 absLength = 37.2;
843 id = 11;
844 AliMaterial(id, "V0APMG", a, z, density, radLength, absLength, 0, 0);
845 AliMedium(id, "V0APMG", id, 1, fieldType, maxField, maxBending, maxStepSize,
846 maxEnergyLoss, precision, minStepSize);
847}
848
849//_____________________________________________________________________________
850void AliVZEROv7::DrawModule() const
851{
852// Drawing is done in DrawVZERO.C
853
854 AliDebug(2,"DrawModule");
855}
856
857
858//_____________________________________________________________________________
859void AliVZEROv7::DrawGeometry()
860{
861// Drawing of V0 geometry done in DrawV0.C
862
863 AliDebug(2,"DrawGeometry");
864}
865
866//_____________________________________________________________________________
867void AliVZEROv7::Init()
868{
869// Initialises version of the VZERO Detector given in Config
870// Just prints an information message
871
3e87825e 872// AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
873
874 AliDebug(1,"VZERO version 7 initialized");
1a809d19 875 AliVZERO::Init();
876}
877
878//_____________________________________________________________________________
879void AliVZEROv7::StepManager()
880{
881 // Step Manager, called at each step
882
883 Int_t copy;
884 static Int_t vol[4];
885 static Float_t hits[21];
886 static Float_t eloss, tlength;
f419b97e 887 static Int_t nPhotonsInStep = 0;
888 static Int_t nPhotons = 0;
889 static Int_t numStep = 0;
1a809d19 890 Int_t ringNumber;
891 Float_t destep, step;
892 numStep += 1;
893
894 // We keep only charged tracks :
895 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
896
897 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
898 vol[2] = gMC->CurrentVolID(copy);
899 vol[3] = copy;
900 static Int_t idV0R1 = gMC->VolId("V0R1");
901 static Int_t idV0L1 = gMC->VolId("V0L1");
902 static Int_t idV0R2 = gMC->VolId("V0R2");
903 static Int_t idV0L2 = gMC->VolId("V0L2");
904 static Int_t idV0R3 = gMC->VolId("V0R3");
905 static Int_t idV0L3 = gMC->VolId("V0L3");
906 static Int_t idV0R4 = gMC->VolId("V0R4");
907 static Int_t idV0L4 = gMC->VolId("V0L4");
908 static Int_t idV0R5 = gMC->VolId("V0R5");
909 static Int_t idV0R6 = gMC->VolId("V0R6");
742d6134 910 bool hitOnV0C = true;
1a809d19 911 double lightYield;
912 double lightAttenuation;
913 double nMeters;
914 double fibToPhot;
915 if ( gMC->CurrentVolID(copy) == idV0R1 || gMC->CurrentVolID(copy) == idV0L1 )
916 ringNumber = 1;
917 else if ( gMC->CurrentVolID(copy) == idV0R2 || gMC->CurrentVolID(copy) == idV0L2 )
918 ringNumber = 2;
919 else if ( gMC->CurrentVolID(copy) == idV0R3 || gMC->CurrentVolID(copy) == idV0R4
920 || gMC->CurrentVolID(copy) == idV0L3 ) ringNumber = 3;
921 else if ( gMC->CurrentVolID(copy) == idV0R5 || gMC->CurrentVolID(copy) == idV0R6
922 || gMC->CurrentVolID(copy) == idV0L4 ) ringNumber = 4;
923 else ringNumber = 0;
924 if (ringNumber) {
925 if (gMC->CurrentVolID(copy) == idV0L1 || gMC->CurrentVolID(copy) == idV0L2 ||
926 gMC->CurrentVolID(copy) == idV0L3 || gMC->CurrentVolID(copy) == idV0L4)
927 hitOnV0C = false;
928 destep = gMC->Edep();
929 step = gMC->TrackStep();
930 if (hitOnV0C) {
931 lightYield = fV0CLightYield;
932 lightAttenuation = fV0CLightAttenuation;
933 nMeters = fV0CnMeters;
934 fibToPhot = fV0CFibToPhot;
935 } else {
936 lightYield = fV0ALightYield;
937 lightAttenuation = fV0ALightAttenuation;
938 nMeters = fV0AnMeters;
5e44677e 939 fibToPhot = fV0AFibToPhot;
1a809d19 940 }
941 nPhotonsInStep = Int_t(destep / (lightYield *1e-9) );
942 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
943 eloss += destep;
944 tlength += step;
945 if ( gMC->IsTrackEntering() ) {
946 nPhotons = nPhotonsInStep;
947 gMC->TrackPosition(fTrackPosition);
948 gMC->TrackMomentum(fTrackMomentum);
949 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px()
950 + fTrackMomentum.Py() * fTrackMomentum.Py() );
951 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
952 hits[0] = fTrackPosition.X();
953 hits[1] = fTrackPosition.Y();
954 hits[2] = fTrackPosition.Z();
955 hits[3] = Float_t (gMC->TrackPid());
956 hits[4] = gMC->TrackTime();
957 hits[5] = gMC->TrackCharge();
958 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
959 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
960 hits[8] = ringNumber;
961 hits[9] = pt;
962 hits[10] = fTrackMomentum.P();
963 hits[11] = fTrackMomentum.Px();
964 hits[12] = fTrackMomentum.Py();
965 hits[13] = fTrackMomentum.Pz();
966 hits[14] = par->Vx();
967 hits[15] = par->Vy();
968 hits[16] = par->Vz();
969 tlength = 0.0;
970 eloss = 0.0;
742d6134 971
972 //////////////////////////
973 ///// Display V0A geometry
974 // if (!hitOnV0C) {
975 // FILE *of;
976 // of = fopen("V0A.out", "a");
977 // // x, y, z, ringnumber, cellid
978 // fprintf( of, "%f %f %f %f %d \n", hits[0], hits[1], hits[2], hits[8], GetCellId (vol, hits) );
979 // fclose(of);
980 // }
981 //////////////////////////
1a809d19 982 }
983 nPhotons = nPhotons + nPhotonsInStep;
984 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
985 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * lightAttenuation * nMeters));
986 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fibToPhot);
987 hits[17] = eloss;
988 hits[18] = tlength;
989 hits[19] = nPhotons;
990 hits[20] = GetCellId (vol, hits);
991 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
992 tlength = 0.0;
993 eloss = 0.0;
994 nPhotons = 0;
995 nPhotonsInStep = 0;
996 numStep = 0;
997 }
998 }
999}
1000
1001//_____________________________________________________________________________
1002void AliVZEROv7::AddHit(Int_t track, Int_t *vol, Float_t *hits)
1003{
1004// Adds a VZERO hit
1005
1006 TClonesArray &lhits = *fHits;
1007 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
1008}
1009
1010//_____________________________________________________________________________
1011void AliVZEROv7::AddDigits(Int_t *tracks, Int_t* digits)
1012{
1013// Adds a VZERO digit
1014
1015 TClonesArray &ldigits = *fDigits;
1016 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
1017}
1018
1019//_____________________________________________________________________________
1020void AliVZEROv7::MakeBranch(Option_t *option)
1021{
1022// Creates new branches in the current Root Tree
1023
1024 char branchname[10];
1025 sprintf(branchname,"%s",GetName());
1026 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
1027 const char *cH = strstr(option,"H");
1028 if (fHits && TreeH() && cH) {
1029 TreeH()->Branch(branchname,&fHits, fBufferSize);
1030 AliDebug(2,Form("Making Branch %s for hits",branchname));
1031 }
1032 const char *cD = strstr(option,"D");
1033 if (fDigits && fLoader->TreeD() && cD) {
1034 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1035 AliDebug(2,Form("Making Branch %s for digits",branchname));
1036 }
1037}
1038
1039//_____________________________________________________________________________
1040Int_t AliVZEROv7::GetCellId(Int_t *vol, Float_t *hits)
1041{
1042 // Returns Id of scintillator cell
1043 // Right side from 0 to 47
1044 // Left side from 48 to 79
1045 // hits[8] = ring number (1 to 4)
1046 // vol[1] = copy number (1 to 8)
1047
1048 Int_t index = vol[1];
5063dd34 1049 Int_t ringNumber = Int_t(hits[8]);
1a809d19 1050 fCellId = 0;
742d6134 1051
1a809d19 1052 Float_t phi = Float_t(TMath::ATan2(Double_t(hits[1]),Double_t(hits[0])) );
1053 Float_t kRaddeg = 180.0/TMath::Pi();
1054 phi = kRaddeg * phi;
1055
1056 if (index < 7) index = index + 8;
1057
1058 if (hits[2] < 0.0) {
5063dd34 1059 if(ringNumber < 3) {
1060 index = (index - 7) + ( ( ringNumber - 1 ) * 8);
1061 } else if (ringNumber >= 3) {
1a809d19 1062 if ( gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R3") || gMC->CurrentVolID(vol[1])
5063dd34 1063 == gMC->VolId("V0R5") ) index = (index*2-14)+((ringNumber-2)*16);
1a809d19 1064 if ( gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R4") || gMC->CurrentVolID(vol[1])
5063dd34 1065 == gMC->VolId("V0R6") ) index = (index*2-13)+((ringNumber-2)*16);
1a809d19 1066 }
1067 fCellId = index;
1068 } else if (hits[2] > 0.0) {
5063dd34 1069 index = (index - 7 + 48) + ( ( ringNumber - 1 ) * 8);
1a809d19 1070 fCellId = index;
1071 }
742d6134 1072
1a809d19 1073 return fCellId;
1074}