To new command line options were added the -acc and -sync. Giving the -acc argument
[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.);
5063dd34 615 TGeoVolume *v0APMTT = new TGeoVolume("V0APMT1", sV0APMTT, medV0APMAlum);
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
696 // Adding detectors to top volume
5063dd34 697 TGeoVolume *vZERO = new TGeoVolumeAssembly("VZERO");
698 vZERO->AddNode(v0RI,1,new TGeoTranslation(0, 0, -zdet));
699 vZERO->AddNode(v0LE,1,new TGeoTranslation(0, 0, +340));
700 top->AddNode(vZERO,1);
1a809d19 701}
45b81649 702
703//_____________________________________________________________________________
704void AliVZEROv7::AddAlignableVolumes() const
705{
706 //
707 // Create entries for alignable volumes associating the symbolic volume
708 // name with the corresponding volume path. Needs to be syncronized with
709 // eventual changes in the geometry.
710 //
711 TString vpC = "/ALIC_1/VZERO_1/V0RI_1";
712 TString vpA = "/ALIC_1/VZERO_1/V0LE_1";
713 TString snC = "VZERO/V0C";
714 TString snA = "VZERO/V0A";
715
716 if(!gGeoManager->SetAlignableEntry(snC.Data(),vpC.Data()))
717 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snC.Data(),vpC.Data()));
718 if(!gGeoManager->SetAlignableEntry(snA.Data(),vpA.Data()))
719 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snA.Data(),vpA.Data()));
720
721}
722
1a809d19 723//_____________________________________________________________________________
724void AliVZEROv7::CreateMaterials()
725{
726
727// Creates materials used for geometry
728
729 AliDebug(2,"Create materials");
730 // Parameters for simulation scope
731 Int_t fieldType = gAlice->Field()->Integ(); // Field type
732 Double_t maxField = gAlice->Field()->Max(); // Field max.
733 Double_t maxBending = 10; // Max Angle
734 Double_t maxStepSize = 0.01; // Max step size
735 Double_t maxEnergyLoss = 1; // Max Delta E
736 Double_t precision = 0.003; // Precision
737 Double_t minStepSize = 0.003; // Minimum step size
738
739 Int_t id;
740 Double_t a, z, radLength, absLength;
741 Float_t density, as[4], zs[4], ws[4];
742
743// Parameters for V0CPrePlates: Aluminium
744 a = 26.98;
745 z = 13.00;
746 density = 2.7;
747 radLength = 8.9;
748 absLength = 37.2;
749 id = 2;
750 AliMaterial( id, "V0CAlu", a, z, density, radLength, absLength, 0, 0);
751 AliMedium(id, "V0CAlu", id, 1, fieldType, maxField, maxBending, maxStepSize,
752 maxEnergyLoss, precision, minStepSize);
753
754// Parameters for V0CPlates: Carbon
755 a = 12.01;
756 z = 6.00;
757 density = 2.265;
758 radLength = 18.8;
759 absLength = 49.9;
760 id = 3;
761 AliMaterial(id, "V0CCar", a, z, density, radLength, absLength, 0, 0);
762 AliMedium(id, "V0CCar", id, 1, fieldType, maxField, maxBending, maxStepSize,
763 maxEnergyLoss, precision, minStepSize);
764
765// Parameters for V0Cscintillator: BC408
766 as[0] = 1.00794; as[1] = 12.011;
767 zs[0] = 1.; zs[1] = 6.;
768 ws[0] = 1.; ws[1] = 1.;
769 density = 1.032;
770 id = 4;
771 AliMixture(id, "V0CSci", as, zs, density, -2, ws);
772 AliMedium(id,"V0CSci", id, 1, fieldType, maxField, maxBending, maxStepSize,
773 maxEnergyLoss, precision, minStepSize);
774
775// Parameters for V0Ascintilator: BC404
776 as[0] = 1.00794; as[1] = 12.011;
777 zs[0] = 1.; zs[1] = 6.;
778 ws[0] = 5.21; ws[1] = 4.74;
779 density = 1.032;
780 id = 5;
781 AliMixture(id, "V0ASci", as, zs, density, -2, ws);
782 AliMedium(id, "V0ASci", id, 1, fieldType, maxField, maxBending, maxStepSize,
783 maxEnergyLoss, precision, minStepSize);
784
785// Parameters for V0ALuc: Lucita but for the simulation BC404
786 as[0] = 1.00794; as[1] = 12.011;
787 zs[0] = 1.; zs[1] = 6.;
788 ws[0] = 5.21; ws[1] = 4.74;
789 density = 1.032;
790 id = 6;
791 AliMixture(id, "V0ALuc", as, zs, density, -2, ws);
792 AliMedium(id, "V0ALuc", id, 1, fieldType, maxField, maxBending, maxStepSize,
793 maxEnergyLoss, precision, minStepSize);
794
795// Parameters for V0Aplate: EuroComposite - EC-PI 626 PS - AlMg3
796 as[0] = 26.982; as[1] = 24.305;
797 zs[0] = 13.; zs[1] = 12.;
798 ws[0] = 1.; ws[1] = 3.;
799 density = 3.034;
800 id = 7;
801 AliMixture(id, "V0APlaOu", as, zs, density, -2, ws);
802 AliMedium(id, "V0APlaOu", id, 1, fieldType, maxField, maxBending, maxStepSize,
803 maxEnergyLoss, precision, minStepSize);
804
805// Parameters for V0Aplate: EuroComposite - EC-PI 626 PS - EC-PI 6.4-42
806 as[0] = 1.00794; as[1] = 12.011;
807 zs[0] = 1.; zs[1] = 6.;
808 ws[0] = 5.21; ws[1] = 4.74;
809 density = 0.042;
810 id = 8;
811 AliMixture(id, "V0APlaIn", as, zs, density, -2, ws);
812 AliMedium(id, "V0APlaIn", id, 1, fieldType, maxField, maxBending, maxStepSize,
813 maxEnergyLoss, precision, minStepSize);
814
815// Parameters for V0Afiber: BC9929AMC Plastic Scintillating Fiber from Saint-Gobain
816 as[0] = 1.00794; as[1] = 12.011;
817 zs[0] = 1.; zs[1] = 6.;
818 ws[0] = 4.82; ws[1] = 4.85;
819 density = 1.05;
820 id = 9;
821 AliMixture(id, "V0AFib", as, zs, density, -2, ws);
822 AliMedium(id, "V0AFib", id, 1, fieldType, maxField, maxBending, maxStepSize,
823 maxEnergyLoss, precision, minStepSize);
824
825// Parameters for V0APMA: Aluminium
826 a = 26.98;
827 z = 13.00;
828 density = 2.7;
829 radLength = 8.9;
830 absLength = 37.2;
831 id = 10;
832 AliMaterial(id, "V0APMA", a, z, density, radLength, absLength, 0, 0);
833 AliMedium(id, "V0APMA", id, 1, fieldType, maxField, maxBending, maxStepSize,
834 maxEnergyLoss, precision, minStepSize);
835
836// Parameters for V0APMG: Glass for the simulation Aluminium
837 a = 26.98;
838 z = 13.00;
839 density = 2.7;
840 radLength = 8.9;
841 absLength = 37.2;
842 id = 11;
843 AliMaterial(id, "V0APMG", a, z, density, radLength, absLength, 0, 0);
844 AliMedium(id, "V0APMG", id, 1, fieldType, maxField, maxBending, maxStepSize,
845 maxEnergyLoss, precision, minStepSize);
846}
847
848//_____________________________________________________________________________
849void AliVZEROv7::DrawModule() const
850{
851// Drawing is done in DrawVZERO.C
852
853 AliDebug(2,"DrawModule");
854}
855
856
857//_____________________________________________________________________________
858void AliVZEROv7::DrawGeometry()
859{
860// Drawing of V0 geometry done in DrawV0.C
861
862 AliDebug(2,"DrawGeometry");
863}
864
865//_____________________________________________________________________________
866void AliVZEROv7::Init()
867{
868// Initialises version of the VZERO Detector given in Config
869// Just prints an information message
870
3e87825e 871// AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
872
873 AliDebug(1,"VZERO version 7 initialized");
1a809d19 874 AliVZERO::Init();
875}
876
877//_____________________________________________________________________________
878void AliVZEROv7::StepManager()
879{
880 // Step Manager, called at each step
881
882 Int_t copy;
883 static Int_t vol[4];
884 static Float_t hits[21];
885 static Float_t eloss, tlength;
f419b97e 886 static Int_t nPhotonsInStep = 0;
887 static Int_t nPhotons = 0;
888 static Int_t numStep = 0;
1a809d19 889 Int_t ringNumber;
890 Float_t destep, step;
891 numStep += 1;
892
893 // We keep only charged tracks :
894 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
895
896 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
897 vol[2] = gMC->CurrentVolID(copy);
898 vol[3] = copy;
899 static Int_t idV0R1 = gMC->VolId("V0R1");
900 static Int_t idV0L1 = gMC->VolId("V0L1");
901 static Int_t idV0R2 = gMC->VolId("V0R2");
902 static Int_t idV0L2 = gMC->VolId("V0L2");
903 static Int_t idV0R3 = gMC->VolId("V0R3");
904 static Int_t idV0L3 = gMC->VolId("V0L3");
905 static Int_t idV0R4 = gMC->VolId("V0R4");
906 static Int_t idV0L4 = gMC->VolId("V0L4");
907 static Int_t idV0R5 = gMC->VolId("V0R5");
908 static Int_t idV0R6 = gMC->VolId("V0R6");
742d6134 909 bool hitOnV0C = true;
1a809d19 910 double lightYield;
911 double lightAttenuation;
912 double nMeters;
913 double fibToPhot;
914 if ( gMC->CurrentVolID(copy) == idV0R1 || gMC->CurrentVolID(copy) == idV0L1 )
915 ringNumber = 1;
916 else if ( gMC->CurrentVolID(copy) == idV0R2 || gMC->CurrentVolID(copy) == idV0L2 )
917 ringNumber = 2;
918 else if ( gMC->CurrentVolID(copy) == idV0R3 || gMC->CurrentVolID(copy) == idV0R4
919 || gMC->CurrentVolID(copy) == idV0L3 ) ringNumber = 3;
920 else if ( gMC->CurrentVolID(copy) == idV0R5 || gMC->CurrentVolID(copy) == idV0R6
921 || gMC->CurrentVolID(copy) == idV0L4 ) ringNumber = 4;
922 else ringNumber = 0;
923 if (ringNumber) {
924 if (gMC->CurrentVolID(copy) == idV0L1 || gMC->CurrentVolID(copy) == idV0L2 ||
925 gMC->CurrentVolID(copy) == idV0L3 || gMC->CurrentVolID(copy) == idV0L4)
926 hitOnV0C = false;
927 destep = gMC->Edep();
928 step = gMC->TrackStep();
929 if (hitOnV0C) {
930 lightYield = fV0CLightYield;
931 lightAttenuation = fV0CLightAttenuation;
932 nMeters = fV0CnMeters;
933 fibToPhot = fV0CFibToPhot;
934 } else {
935 lightYield = fV0ALightYield;
936 lightAttenuation = fV0ALightAttenuation;
937 nMeters = fV0AnMeters;
5e44677e 938 fibToPhot = fV0AFibToPhot;
1a809d19 939 }
940 nPhotonsInStep = Int_t(destep / (lightYield *1e-9) );
941 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
942 eloss += destep;
943 tlength += step;
944 if ( gMC->IsTrackEntering() ) {
945 nPhotons = nPhotonsInStep;
946 gMC->TrackPosition(fTrackPosition);
947 gMC->TrackMomentum(fTrackMomentum);
948 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px()
949 + fTrackMomentum.Py() * fTrackMomentum.Py() );
950 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
951 hits[0] = fTrackPosition.X();
952 hits[1] = fTrackPosition.Y();
953 hits[2] = fTrackPosition.Z();
954 hits[3] = Float_t (gMC->TrackPid());
955 hits[4] = gMC->TrackTime();
956 hits[5] = gMC->TrackCharge();
957 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
958 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
959 hits[8] = ringNumber;
960 hits[9] = pt;
961 hits[10] = fTrackMomentum.P();
962 hits[11] = fTrackMomentum.Px();
963 hits[12] = fTrackMomentum.Py();
964 hits[13] = fTrackMomentum.Pz();
965 hits[14] = par->Vx();
966 hits[15] = par->Vy();
967 hits[16] = par->Vz();
968 tlength = 0.0;
969 eloss = 0.0;
742d6134 970
971 //////////////////////////
972 ///// Display V0A geometry
973 // if (!hitOnV0C) {
974 // FILE *of;
975 // of = fopen("V0A.out", "a");
976 // // x, y, z, ringnumber, cellid
977 // fprintf( of, "%f %f %f %f %d \n", hits[0], hits[1], hits[2], hits[8], GetCellId (vol, hits) );
978 // fclose(of);
979 // }
980 //////////////////////////
1a809d19 981 }
982 nPhotons = nPhotons + nPhotonsInStep;
983 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
984 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * lightAttenuation * nMeters));
985 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fibToPhot);
986 hits[17] = eloss;
987 hits[18] = tlength;
988 hits[19] = nPhotons;
989 hits[20] = GetCellId (vol, hits);
990 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
991 tlength = 0.0;
992 eloss = 0.0;
993 nPhotons = 0;
994 nPhotonsInStep = 0;
995 numStep = 0;
996 }
997 }
998}
999
1000//_____________________________________________________________________________
1001void AliVZEROv7::AddHit(Int_t track, Int_t *vol, Float_t *hits)
1002{
1003// Adds a VZERO hit
1004
1005 TClonesArray &lhits = *fHits;
1006 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
1007}
1008
1009//_____________________________________________________________________________
1010void AliVZEROv7::AddDigits(Int_t *tracks, Int_t* digits)
1011{
1012// Adds a VZERO digit
1013
1014 TClonesArray &ldigits = *fDigits;
1015 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
1016}
1017
1018//_____________________________________________________________________________
1019void AliVZEROv7::MakeBranch(Option_t *option)
1020{
1021// Creates new branches in the current Root Tree
1022
1023 char branchname[10];
1024 sprintf(branchname,"%s",GetName());
1025 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
1026 const char *cH = strstr(option,"H");
1027 if (fHits && TreeH() && cH) {
1028 TreeH()->Branch(branchname,&fHits, fBufferSize);
1029 AliDebug(2,Form("Making Branch %s for hits",branchname));
1030 }
1031 const char *cD = strstr(option,"D");
1032 if (fDigits && fLoader->TreeD() && cD) {
1033 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
1034 AliDebug(2,Form("Making Branch %s for digits",branchname));
1035 }
1036}
1037
1038//_____________________________________________________________________________
1039Int_t AliVZEROv7::GetCellId(Int_t *vol, Float_t *hits)
1040{
1041 // Returns Id of scintillator cell
1042 // Right side from 0 to 47
1043 // Left side from 48 to 79
1044 // hits[8] = ring number (1 to 4)
1045 // vol[1] = copy number (1 to 8)
1046
1047 Int_t index = vol[1];
5063dd34 1048 Int_t ringNumber = Int_t(hits[8]);
1a809d19 1049 fCellId = 0;
742d6134 1050
1a809d19 1051 Float_t phi = Float_t(TMath::ATan2(Double_t(hits[1]),Double_t(hits[0])) );
1052 Float_t kRaddeg = 180.0/TMath::Pi();
1053 phi = kRaddeg * phi;
1054
1055 if (index < 7) index = index + 8;
1056
1057 if (hits[2] < 0.0) {
5063dd34 1058 if(ringNumber < 3) {
1059 index = (index - 7) + ( ( ringNumber - 1 ) * 8);
1060 } else if (ringNumber >= 3) {
1a809d19 1061 if ( gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R3") || gMC->CurrentVolID(vol[1])
5063dd34 1062 == gMC->VolId("V0R5") ) index = (index*2-14)+((ringNumber-2)*16);
1a809d19 1063 if ( gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R4") || gMC->CurrentVolID(vol[1])
5063dd34 1064 == gMC->VolId("V0R6") ) index = (index*2-13)+((ringNumber-2)*16);
1a809d19 1065 }
1066 fCellId = index;
1067 } else if (hits[2] > 0.0) {
5063dd34 1068 index = (index - 7 + 48) + ( ( ringNumber - 1 ) * 8);
1a809d19 1069 fCellId = index;
1070 }
742d6134 1071
1a809d19 1072 return fCellId;
1073}