]> git.uio.no Git - u/mrichter/AliRoot.git/blame - VZERO/AliVZEROv7.cxx
Setting also MC info to CF manager
[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///////////////////////////////////////////////////////////////////////
11ea46b9 19// //
1a809d19 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 //
a8b5076e 26// V0R (now V0C) sits between Z values -89.5 and -84.8 cm //
27// V0L (now V0A) sits between Z values +325.0 and +330.0 cm //
1a809d19 28// New coordinate system has been implemented in october 2003 //
11ea46b9 29// Revision of the V0A part by Lizardo Valencia in July 2008 //
1a809d19 30// //
11ea46b9 31///////////////////////////////////////////////////////////////////////
1a809d19 32
33// --- Standard libraries ---
34#include <Riostream.h>
1a809d19 35
36// --- ROOT libraries ---
37#include <TClonesArray.h>
f7a1cc68 38#include <TGeoGlobalMagField.h>
1a809d19 39#include <TMath.h>
1a809d19 40#include <TParticle.h>
f7a1cc68 41#include <TVirtualMC.h>
1a809d19 42
43#include <TGeoManager.h>
268f57b1 44#include <TGeoMatrix.h>
1a809d19 45#include <TGeoMaterial.h>
46#include <TGeoMedium.h>
1a809d19 47#include <TGeoVolume.h>
48#include "TGeoTube.h"
49#include "TGeoArb8.h"
1a809d19 50#include "TGeoCompositeShape.h"
51
52// --- AliRoot header files ---
53#include "AliRun.h"
54#include "AliMC.h"
1a809d19 55#include "AliMagF.h"
56#include "AliVZEROLoader.h"
57#include "AliVZEROdigit.h"
58#include "AliVZEROhit.h"
59#include "AliVZEROv7.h"
60#include "AliLog.h"
7b1a8873 61#include "AliTrackReference.h"
1a809d19 62
63ClassImp(AliVZEROv7)
64
65//_____________________________________________________________________________
0b2bea8b 66AliVZEROv7:: AliVZEROv7():AliVZERO(),
67 fCellId(0),
68 fTrackPosition(),
69 fTrackMomentum(),
70 fV0CHeight1(2.5),
71 fV0CHeight2(4.4),
72 fV0CHeight3(7.4),
73 fV0CHeight4(12.5),
74 fV0CRMin(4.6),
75 fV0CRBox(38.0),
76 fV0CLidThickness(0.30),
77 fV0CCellThickness(2.00),
78 fV0CBoxThickness(4.70),
79 fV0COffsetFibers(1.0),
80 fV0CLightYield(93.75),
81 fV0CLightAttenuation(0.05),
82 fV0CnMeters(15.0),
83 fV0CFibToPhot(0.3),
a32c7883 84 fV0AR0(4.2),
0b2bea8b 85 fV0AR1(7.6),
86 fV0AR2(13.8),
87 fV0AR3(22.7),
88 fV0AR4(41.3),
89 fV0AR5(43.3),
11ea46b9 90 fV0AR6(72.6),
91 fV0AR7(92.0), // Distance from origin to outtermost intersection sector7 and sector8
0b2bea8b 92 fV0ASciWd(2.5),
93 fV0APlaWd(0.5),
94 fV0APlaAl(0.06),
95 fV0AOctWd(0.75),
96 fV0AFraWd(0.2),
97 fV0AOctH1(1.0),
98 fV0AOctH2(2.0),
99 fV0ABasHt(2.0),
100 fV0AFibRd(0.1),
101 fV0APlaEx(4.4),
102 fV0APMBWd(24.6),
103 fV0APMBHt(22.0),
104 fV0APMBTh(7.1),
105 fV0APMBWdW(0.3),
106 fV0APMBHtW(1.0),
107 fV0APMBAng(30.0),
108 fV0APMBThW(0.3),
109 fV0APMTR1(2.44),
110 fV0APMTR2(2.54),
111 fV0APMTR3(2.54),
112 fV0APMTR4(2.70),
113 fV0APMTH(10.0),
114 fV0APMTB(1.0),
e279cdd5 115 fV0AFEEBWd(26.5),
116 fV0AFEEBHt(20.5),
117 fV0AFEEBTh(7.5),
0b2bea8b 118 fV0AnMeters(fV0AR6*0.01),
119 fV0ALightYield(93.75),
a8b5076e 120 fV0ALightAttenuation(0.05),
0b2bea8b 121 fV0AFibToPhot(0.3),
122 fVersion(7)
1a809d19 123{
124// Standard default constructor
125}
126
127//_____________________________________________________________________________
0b2bea8b 128AliVZEROv7::AliVZEROv7(const char *name, const char *title):AliVZERO(name,title),
129 fCellId(0),
130 fTrackPosition(),
131 fTrackMomentum(),
132 fV0CHeight1(2.5),
133 fV0CHeight2(4.4),
134 fV0CHeight3(7.4),
135 fV0CHeight4(12.5),
136 fV0CRMin(4.6),
137 fV0CRBox(38.0),
138 fV0CLidThickness(0.30),
139 fV0CCellThickness(2.00),
140 fV0CBoxThickness(4.70),
141 fV0COffsetFibers(1.0),
142 fV0CLightYield(93.75),
143 fV0CLightAttenuation(0.05),
144 fV0CnMeters(15.0),
145 fV0CFibToPhot(0.3),
146 fV0AR0(4.2),
147 fV0AR1(7.6),
148 fV0AR2(13.8),
149 fV0AR3(22.7),
150 fV0AR4(41.3),
151 fV0AR5(43.3),
11ea46b9 152 fV0AR6(72.6),
153 fV0AR7(92.0), // Distance from origin to outtermost intersection of sector7 and sector8
0b2bea8b 154 fV0ASciWd(2.5),
155 fV0APlaWd(0.5),
156 fV0APlaAl(0.06),
157 fV0AOctWd(0.75),
158 fV0AFraWd(0.2),
159 fV0AOctH1(1.0),
160 fV0AOctH2(2.0),
161 fV0ABasHt(2.0),
162 fV0AFibRd(0.1),
163 fV0APlaEx(4.4),
164 fV0APMBWd(24.6),
165 fV0APMBHt(22.0),
166 fV0APMBTh(7.1),
167 fV0APMBWdW(0.3),
168 fV0APMBHtW(1.0),
169 fV0APMBAng(30.0),
170 fV0APMBThW(0.3),
171 fV0APMTR1(2.44),
172 fV0APMTR2(2.54),
173 fV0APMTR3(2.54),
174 fV0APMTR4(2.70),
175 fV0APMTH(10.0),
176 fV0APMTB(1.0),
e279cdd5 177 fV0AFEEBWd(26.5),
178 fV0AFEEBHt(20.5),
179 fV0AFEEBTh(7.5),
0b2bea8b 180 fV0AnMeters(fV0AR6*0.01),
181 fV0ALightYield(93.75),
182 fV0ALightAttenuation(0.05),
183 fV0AFibToPhot(0.3),
184 fVersion(7)
185
186
1a809d19 187{
188// Standard constructor for V-zero Detector version 7
189
190 AliDebug(2,"Create VZERO object ");
0b2bea8b 191
192// fVersion = 7; // version number
193
194// // V0C Parameters related to geometry: All in cm
195// fV0CHeight1 = 2.5; // height of cell 1
196// fV0CHeight2 = 4.4; // height of cell 2
197// fV0CHeight3 = 7.4; // height of cell 3
198// fV0CHeight4 = 12.5; // height of cell 4
199// fV0CRMin = 4.6; // inner radius of box
200// fV0CRBox = 38.0; // outer radius of box
201// fV0CLidThickness = 0.30; // thickness of Carbon lid
202// fV0CCellThickness = 2.00; // thickness of elementary cell
203// fV0CBoxThickness = 4.70; // thickness of V0C Box
204// fV0COffsetFibers = 1.0; // offset to output fibers
205// // V0C Parameters related to light output
206// fV0CLightYield = 93.75; // Light yield in BC408 (93.75 eV per photon)
207// fV0CLightAttenuation = 0.05; // Light attenuation in fiber (0.05 per meter)
208// fV0CnMeters = 15.0; // Number of meters of clear fibers to PM
209// fV0CFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
210//
211// // V0A Parameters related to geometry: All in cm
212// fV0AR0 = 4.2; // Radius of hole
213// fV0AR1 = 7.6; // Maximun radius of 1st cell
214// fV0AR2 = 13.8; // Maximun radius of 2nd cell
215// fV0AR3 = 22.7; // Maximun radius of 3rd cell
216// fV0AR4 = 41.3; // Maximun radius of 4th cell
217// fV0AR5 = 43.3; // Radius circunscrite to innermost octagon
218// fV0AR6 = 68.0; // Radius circunscrite to outtermost octagon
219// fV0ASciWd = 2.5; // Scintillator thickness
220// fV0APlaWd = 0.5; // Plates thinckness
221// fV0APlaAl = 0.06; // Plates AlMg3 thinckness
222// fV0AOctWd = 0.75; // Innermost octagon thickness
223// fV0AOctH1 = 1.0; // Height of innermost octagon
224// fV0AOctH2 = 2.0; // Height of outtermost octagon
225// fV0AFibRd = 0.1; // Radius of Fiber
226// fV0AFraWd = 0.2; // Support Frame thickness
227// fV0APMBWd = 24.6; // Width of PM Box
228// fV0APMBHt = 22.0; // Height of PM Box
229// fV0APMBTh = 7.1; // Thickness of PM Box
230// fV0APMBWdW = 0.3; // Thickness of PM Box Side1 Wall
231// fV0APMBHtW = 1.0; // Thickness of PM Box Side2 Wall
232// fV0APMBThW = 0.3; // Thickness of PM Box Top Wall
233// fV0APMBAng = 30.0; // Angle between PM Box and Support
234// fV0APMTR1 = 2.44; // PMT Glass
235// fV0APMTR2 = 2.54; // PMT Glass
236// fV0APMTR3 = 2.54; // PMT Cover
237// fV0APMTR4 = 2.70; // PMT Cover
238// fV0APMTH = 10.0; // PMT Height
239// fV0APMTB = 1.0; // PMT Basis
240// fV0APlaEx = 4.4; // Plates Extension height
241// fV0ABasHt = 2.0; // Basis Height
242// // V0A Parameters related to light output
243// fV0ALightYield = 93.75; // Light yield in BC404
244// fV0ALightAttenuation = 0.05; // Light attenuation in WLS fiber, per meter
245// fV0AnMeters = fV0AR6*0.01; // Tentative value, in meters
246// fV0AFibToPhot = 0.3; // Attenuation at fiber-photocathode interface
1a809d19 247}
1a809d19 248
1a809d19 249//_____________________________________________________________________________
250void AliVZEROv7::CreateGeometry()
251{
252// Constructs TGeo geometry
253
254 AliDebug(2,"VZERO ConstructGeometry");
255 TGeoVolume *top = gGeoManager->GetVolume("ALIC");
256
257 ///////////////////////////////////////////////////////////////////////////
258 // Construct the geometry of V0C Detector. Brigitte CHEYNIS
259
260 const int kColorVZERO = kGreen;
261 TGeoMedium *medV0CAlu = gGeoManager->GetMedium("VZERO_V0CAlu");
262 TGeoMedium *medV0CCar = gGeoManager->GetMedium("VZERO_V0CCar");
263 TGeoMedium *medV0CSci = gGeoManager->GetMedium("VZERO_V0CSci");
264 TGeoVolume *v0RI = new TGeoVolumeAssembly("V0RI");
265 Float_t heightRight, r4Right;
266 Float_t zdet = 90.0 - 0.5 - fV0CBoxThickness/2.0;
267 heightRight = fV0CHeight1 + fV0CHeight2 + fV0CHeight3 + fV0CHeight4;
268 r4Right = fV0CRMin + heightRight + 3.0*0.2; // 3 spacings of 2mm between rings
269
270 // Creation of carbon lids (3.0 mm thick) to keep V0C box shut :
271 Float_t partube[3];
272 partube[0] = fV0CRMin;
273 partube[1] = fV0CRBox;
274 partube[2] = fV0CLidThickness/2.0;
275 TGeoTube *sV0CA = new TGeoTube("V0CA", partube[0], partube[1], partube[2]);
276 TGeoVolume *v0CA = new TGeoVolume("V0CA",sV0CA,medV0CCar);
277 TGeoTranslation *tr2 = new TGeoTranslation(0.,0., fV0CBoxThickness/2.0-partube[2]);
278 TGeoTranslation *tr3 = new TGeoTranslation(0.,0.,-fV0CBoxThickness/2.0+partube[2]);
279 v0RI->AddNode(v0CA,1,tr2);
280 v0RI->AddNode(v0CA,2,tr3);
281 v0CA->SetLineColor(kYellow);
282
283 // Creation of aluminum rings 3.0 mm thick to maintain the v0RI pieces :
284 partube[0] = fV0CRMin - 0.3;
285 partube[1] = fV0CRMin;
286 partube[2] = fV0CBoxThickness/2.0;
287 TGeoTube *sV0IR = new TGeoTube("V0IR", partube[0], partube[1], partube[2]);
288 TGeoVolume *v0IR = new TGeoVolume("V0IR",sV0IR,medV0CAlu);
289 v0RI->AddNode(v0IR,1,0);
290 v0IR->SetLineColor(kYellow);
291 partube[0] = fV0CRBox;
292 partube[1] = fV0CRBox + 0.3;
293 partube[2] = fV0CBoxThickness/2.0;
294 TGeoTube *sV0ER = new TGeoTube("V0ER", partube[0], partube[1], partube[2]);
295 TGeoVolume *v0ER = new TGeoVolume("V0ER",sV0ER,medV0CAlu);
296 v0RI->AddNode(v0ER,1,0);
297 v0ER->SetLineColor(kYellow);
298
299 // Creation of assembly V0R0 of scintillator cells within one sector
300 TGeoVolume *v0R0 = new TGeoVolumeAssembly("V0R0");
301
302 // Elementary cell of ring 1 - right part - :
303 // (cells of ring 1 will be shifted by 2.0 cm backwards to output fibers)
304 Float_t r1Right = fV0CRMin + fV0CHeight1;
305 Float_t offset = fV0CBoxThickness/2.0 - fV0CLidThickness - fV0CCellThickness/2.0;
306 Float_t partubs[5];
307 partubs[0] = fV0CRMin;
308 partubs[1] = r1Right;
309 partubs[2] = fV0CCellThickness/2.0;
310 partubs[3] = 90.0-22.5;
311 partubs[4] = 135.0-22.5;
312 TGeoTubeSeg *sV0R1 = new TGeoTubeSeg("V0R1", partubs[0], partubs[1], partubs[2],
313 partubs[3], partubs[4]);
314 TGeoVolume *v0R1 = new TGeoVolume("V0R1",sV0R1,medV0CSci);
315 TGeoTranslation *tr4 = new TGeoTranslation(0.,0.,-offset);
316 v0R0->AddNode(v0R1,1,tr4);
317 v0R1->SetLineColor(kColorVZERO);
318
319 // Elementary cell of ring 2 - right part - :
320 // (cells of ring 2 will be shifted by 1.0 cm backwards to output fibers)
321 Float_t r2Right = r1Right + fV0CHeight2;
322 partubs[0] = r1Right; // must be equal to 7.1
323 partubs[1] = r2Right; // must be equal to 11.5
324 TGeoTubeSeg *sV0R2 = new TGeoTubeSeg("V0R2", partubs[0], partubs[1], partubs[2],
325 partubs[3], partubs[4]);
326 TGeoVolume *v0R2 = new TGeoVolume("V0R2",sV0R2,medV0CSci);
327 TGeoTranslation *tr5 = new TGeoTranslation(0.0,0.2,-offset + fV0COffsetFibers);
328 v0R0->AddNode(v0R2,1,tr5);
329 v0R2->SetLineColor(kColorVZERO);
330
331 // Ring 3 - right part - :
332 r2Right = r2Right + 0.2;
333 Float_t r3Right = r2Right + fV0CHeight3;
334 partubs[0] = r2Right; // must be equal to 11.7
335 partubs[1] = r3Right; // must be equal to 19.1
336 partubs[3] = 90.0-22.5;
337 partubs[4] = 112.5-22.5;
338 TGeoTubeSeg *sV0R3 = new TGeoTubeSeg("V0R3", partubs[0], partubs[1], partubs[2],
339 partubs[3], partubs[4]);
340 TGeoVolume *v0R3 = new TGeoVolume("V0R3",sV0R3,medV0CSci);
341 TGeoTranslation *tr6 = new TGeoTranslation(0.,0.2,-offset + 2.0*fV0COffsetFibers);
342 v0R0->AddNode(v0R3,1,tr6);
343 v0R3->SetLineColor(kColorVZERO);
344 partubs[3] = 112.5-22.5;
345 partubs[4] = 135.0-22.5;
346 TGeoTubeSeg *sV0R4 = new TGeoTubeSeg("V0R4", partubs[0], partubs[1], partubs[2],
347 partubs[3], partubs[4]);
348 TGeoVolume *v0R4 = new TGeoVolume("V0R4",sV0R4,medV0CSci);
349 v0R0->AddNode(v0R4,1,tr6);
350 v0R4->SetLineColor(kColorVZERO);
351
352 // Ring 4 - right part - :
353 Float_t x = TMath::ATan(3.5/257.5) * ((180./TMath::Pi()));
354 r3Right = r3Right + 0.2 + 0.2; // + 0.2 because no shift in translation here !!
355 partubs[0] = r3Right; // must be equal to 19.5
356 partubs[1] = r4Right; // must be equal to 32.0
357 partubs[3] = 90.0-22.5+x;
358 partubs[4] = 112.5-22.5-x;
359 TGeoTubeSeg *sV0R5 = new TGeoTubeSeg("V0R5", partubs[0], partubs[1], partubs[2],
360 partubs[3], partubs[4]);
361 TGeoVolume *v0R5 = new TGeoVolume("V0R5",sV0R5,medV0CSci);
362 TGeoTranslation *tr7 = new TGeoTranslation(0.,0.0,-offset + 2.0*fV0COffsetFibers);
363 v0R0->AddNode(v0R5,1,tr7);
364 v0R5->SetLineColor(kColorVZERO);
365 partubs[3] = 112.5-22.5+x;
366 partubs[4] = 135.0-22.5-x;
367 TGeoTubeSeg *sV0R6 = new TGeoTubeSeg("V0R6", partubs[0], partubs[1], partubs[2],
368 partubs[3], partubs[4]);
369 TGeoVolume *v0R6 = new TGeoVolume("V0R6",sV0R6,medV0CSci);
370 v0R0->AddNode(v0R6,1,tr7);
371 v0R6->SetLineColor(kColorVZERO);
372 Float_t phi;
373 Float_t phiDeg= 180./4.;
374 Int_t nsecR = 1; // number of sectors in right part of V0
375 for (phi = 22.5; phi < 360.0; phi = phi + phiDeg) {
376 TGeoRotation *rot1 = new TGeoRotation("rot1", 90.0, +phi, 90., 90.+phi, 0.0, 0.0 );
377 v0RI->AddNode(v0R0,nsecR,rot1);
378 nsecR++;
379 }
380
381 ///////////////////////////////////////////////////////////////////////////
382 // Construct the geometry of V0A Detector. Carlos PEREZ, PUCP
5ff8773f 383 // Revision by Lizardo VALENCIA, UNAM Mexico in July 2008
1a809d19 384
385 const int kV0AColorSci = 5;
386 const int kV0AColorPlaIn = 3;
387 const int kV0AColorPlaOu = 41;
388 const int kV0AColorOct = 7;
389 const int kV0AColorFra = 6;
390 const int kV0AColorFib = 11;
391 const int kV0AColorPMG = 1;
392 const int kV0AColorPMA = 2;
1a809d19 393 TGeoMedium *medV0ASci = gGeoManager->GetMedium("VZERO_V0ASci");
394 TGeoMedium *medV0APlaIn = gGeoManager->GetMedium("VZERO_V0APlaIn");
395 TGeoMedium *medV0APlaOu = gGeoManager->GetMedium("VZERO_V0APlaOu");
396 TGeoMedium *medV0ASup = gGeoManager->GetMedium("VZERO_V0ALuc");
397 TGeoMedium *medV0AFra = gGeoManager->GetMedium("VZERO_V0ALuc");
398 TGeoMedium *medV0AFib = gGeoManager->GetMedium("VZERO_V0AFib");
399 TGeoMedium *medV0APMGlass = gGeoManager->GetMedium("VZERO_V0APMG");
400 TGeoMedium *medV0APMAlum = gGeoManager->GetMedium("VZERO_V0APMA");
1a809d19 401 double pi = TMath::Pi();
402 double sin225 = TMath::Sin(pi/8.);
403 double cos225 = TMath::Cos(pi/8.);
1a809d19 404 double sin45 = TMath::Sin(pi/4.); // lucky: Sin45=Cos45
11ea46b9 405 double cos45 = TMath::Cos(pi/4.);
5063dd34 406 double v0APts[16];
11ea46b9 407 double sin654 = TMath::Sin(1.14);
408 double cos654 = TMath::Cos(1.14);
f316b8fc 409
1a809d19 410 ////////////////////////////
11ea46b9 411 /// Definition sector 1
5063dd34 412 TGeoVolume *v0ASec = new TGeoVolumeAssembly("V0ASec");
a8b5076e 413
1a809d19 414 /// For boolean sustraction
415 double preShape = 0.2;
416 for (int i=0;i<2;i++) {
5063dd34 417 v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.-preShape; v0APts[1+8*i] = -preShape;
418 v0APts[2+8*i] = fV0AR0-fV0AFraWd/2.-preShape; v0APts[3+8*i] = fV0AFraWd/2.;
419 v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.+preShape; v0APts[5+8*i] = fV0AFraWd/2.;
420 v0APts[6+8*i] = fV0AR4+fV0AFraWd/2.+preShape; v0APts[7+8*i] = -preShape;
1a809d19 421 }
5063dd34 422 new TGeoArb8("sV0ACha1",fV0ASciWd/1.5,v0APts);
1a809d19 423 for (int i=0;i<2;i++) {
5063dd34 424 v0APts[0+8*i] = fV0AR0*sin45-preShape;
425 v0APts[1+8*i] = (fV0AR0-fV0AFraWd)*sin45-preShape;
426 v0APts[2+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45-preShape;
427 v0APts[3+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45;
428 v0APts[4+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45+preShape;
429 v0APts[5+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45+2.*preShape;
430 v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45+preShape;
431 v0APts[7+8*i] = fV0AR4*sin45+preShape;
1a809d19 432 }
5063dd34 433 new TGeoArb8("sV0ACha2", fV0ASciWd/2.+2.*preShape, v0APts);
11ea46b9 434 new TGeoCompositeShape("sV0ACha12","sV0ACha1+sV0ACha2");
435 new TGeoTube("sV0ANail1SciHole", 0.0, 0.4, 1.65);
436 TGeoTranslation *pos1 = new TGeoTranslation("pos1", 42.9, 0.51, 0.0);
437 pos1->RegisterYourself();
438 new TGeoTube("sV0ANail2SciHole", 0.0, 0.4, 1.65);
a8b5076e 439 TGeoTranslation *pos2 = new TGeoTranslation("pos2", 30.73,29.98,0.0);
11ea46b9 440 pos2->RegisterYourself();
441 new TGeoCompositeShape("sV0ANailsSciHoles","sV0ANail1SciHole:pos1+sV0ANail2SciHole:pos2");
442 new TGeoCompositeShape("sV0ACha","sV0ACha12+sV0ANailsSciHoles");
a8b5076e 443 new TGeoTubeSeg("sV0AFicR5", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 0, 45);
444
1a809d19 445 /// Frame
5063dd34 446 TGeoVolume *v0AFra = new TGeoVolumeAssembly("V0AFra");
1a809d19 447 for (int i=0;i<2;i++) {
5063dd34 448 v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[1+8*i] = 0.;
449 v0APts[2+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[3+8*i] = fV0AFraWd/2.;
450 v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[5+8*i] = fV0AFraWd/2.;
451 v0APts[6+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[7+8*i] = 0.;
1a809d19 452 }
5063dd34 453 TGeoArb8 *sV0AFraB1 = new TGeoArb8("sV0AFraB1",fV0ASciWd/2.,v0APts);
454 TGeoVolume *v0AFraB1 = new TGeoVolume("V0AFraB1",sV0AFraB1,medV0AFra);
1a809d19 455 for (int i=0;i<2;i++) {
5063dd34 456 v0APts[0+8*i] = fV0AR0*sin45;
457 v0APts[1+8*i] = (fV0AR0-fV0AFraWd)*sin45;
458 v0APts[2+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45;
459 v0APts[3+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45;
460 v0APts[4+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45;
461 v0APts[5+8*i] = (fV0AR4+fV0AFraWd/2.)*sin45;
462 v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45;
463 v0APts[7+8*i] = fV0AR4*sin45;
1a809d19 464 }
5063dd34 465 TGeoArb8 *sV0AFraB2 = new TGeoArb8("sV0AFraB2", fV0ASciWd/2., v0APts);
466 TGeoVolume *v0AFraB2 = new TGeoVolume("V0AFraB2",sV0AFraB2,medV0AFra);
467 v0AFraB1->SetLineColor(kV0AColorFra); v0AFraB2->SetLineColor(kV0AColorFra);
468 v0AFra->AddNode(v0AFraB1,1);
a8b5076e 469 v0AFra->AddNode(v0AFraB2,1);
1a809d19 470 new TGeoTubeSeg( "sV0AFraR1b", fV0AR0-fV0AFraWd/2.,
471 fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
472 new TGeoTubeSeg( "sV0AFraR2b", fV0AR1-fV0AFraWd/2.,
473 fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
474 new TGeoTubeSeg( "sV0AFraR3b", fV0AR2-fV0AFraWd/2.,
475 fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
476 new TGeoTubeSeg( "sV0AFraR4b", fV0AR3-fV0AFraWd/2.,
477 fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
478 new TGeoTubeSeg( "sV0AFraR5b", fV0AR4-fV0AFraWd/2.,
479 fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 0, 45);
480 TGeoCompositeShape *sV0AFraR1 = new TGeoCompositeShape("sV0AFraR1","sV0AFraR1b-sV0ACha");
481 TGeoCompositeShape *sV0AFraR2 = new TGeoCompositeShape("sV0AFraR2","sV0AFraR2b-sV0ACha");
482 TGeoCompositeShape *sV0AFraR3 = new TGeoCompositeShape("sV0AFraR3","sV0AFraR3b-sV0ACha");
483 TGeoCompositeShape *sV0AFraR4 = new TGeoCompositeShape("sV0AFraR4","sV0AFraR4b-sV0ACha");
484 TGeoCompositeShape *sV0AFraR5 = new TGeoCompositeShape("sV0AFraR5","sV0AFraR5b-sV0ACha");
5063dd34 485 TGeoVolume *v0AFraR1 = new TGeoVolume("V0AFraR1",sV0AFraR1,medV0AFra);
486 TGeoVolume *v0AFraR2 = new TGeoVolume("V0AFraR2",sV0AFraR2,medV0AFra);
487 TGeoVolume *v0AFraR3 = new TGeoVolume("V0AFraR3",sV0AFraR3,medV0AFra);
488 TGeoVolume *v0AFraR4 = new TGeoVolume("V0AFraR4",sV0AFraR4,medV0AFra);
489 TGeoVolume *v0AFraR5 = new TGeoVolume("V0AFraR5",sV0AFraR5,medV0AFra);
490 v0AFraR1->SetLineColor(kV0AColorFra); v0AFraR2->SetLineColor(kV0AColorFra);
491 v0AFraR3->SetLineColor(kV0AColorFra); v0AFraR4->SetLineColor(kV0AColorFra);
492 v0AFraR5->SetLineColor(kV0AColorFra);
a8b5076e 493 v0AFra->AddNode(v0AFraR1,1);
5063dd34 494 v0AFra->AddNode(v0AFraR2,1);
11ea46b9 495 v0AFra->AddNode(v0AFraR3,1);
5063dd34 496 v0AFra->AddNode(v0AFraR4,1);
497 v0AFra->AddNode(v0AFraR5,1);
498 v0ASec->AddNode(v0AFra,1);
a32c7883 499
1a809d19 500 /// Sensitive scintilator
5063dd34 501 TGeoVolume *v0ASci = new TGeoVolumeAssembly("V0ASci");
1a809d19 502 new TGeoTubeSeg( "sV0AR1b", fV0AR0+fV0AFraWd/2.,
503 fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
504 new TGeoTubeSeg( "sV0AR2b", fV0AR1+fV0AFraWd/2.,
505 fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
506 new TGeoTubeSeg( "sV0AR3b", fV0AR2+fV0AFraWd/2.,
507 fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
508 new TGeoTubeSeg( "sV0AR4b", fV0AR3+fV0AFraWd/2.,
509 fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 0, 45);
510 TGeoCompositeShape *sV0AR1 = new TGeoCompositeShape("sV0AR1","sV0AR1b-sV0ACha");
511 TGeoCompositeShape *sV0AR2 = new TGeoCompositeShape("sV0AR2","sV0AR2b-sV0ACha");
512 TGeoCompositeShape *sV0AR3 = new TGeoCompositeShape("sV0AR3","sV0AR3b-sV0ACha");
513 TGeoCompositeShape *sV0AR4 = new TGeoCompositeShape("sV0AR4","sV0AR4b-sV0ACha");
5063dd34 514 TGeoVolume *v0L1 = new TGeoVolume("V0L1",sV0AR1,medV0ASci);
515 TGeoVolume *v0L2 = new TGeoVolume("V0L2",sV0AR2,medV0ASci);
516 TGeoVolume *v0L3 = new TGeoVolume("V0L3",sV0AR3,medV0ASci);
517 TGeoVolume *v0L4 = new TGeoVolume("V0L4",sV0AR4,medV0ASci);
518 v0L1->SetLineColor(kV0AColorSci); v0L2->SetLineColor(kV0AColorSci);
519 v0L3->SetLineColor(kV0AColorSci); v0L4->SetLineColor(kV0AColorSci);
742d6134 520 v0ASec->AddNode(v0L1,1);
521 v0ASec->AddNode(v0L2,1);
522 v0ASec->AddNode(v0L3,1);
a8b5076e 523 v0ASec->AddNode(v0L4,1);
11ea46b9 524
a8b5076e 525 /// Segment of octagon
1a809d19 526 for (int i=0;i<2;i++) {
11ea46b9 527 v0APts[0+8*i] = fV0AR6-fV0AOctH2; v0APts[1+8*i] = 0.;
528 v0APts[2+8*i] = (fV0AR6-fV0AOctH2)*sin45; v0APts[3+8*i] = (fV0AR6-fV0AOctH2)*sin45;
529 v0APts[4+8*i] = fV0AR6*sin45; v0APts[5+8*i] = fV0AR6*sin45;
530 v0APts[6+8*i] = fV0AR6; v0APts[7+8*i] = 0.;
1a809d19 531 }
5063dd34 532 TGeoArb8 *sV0AOct2 = new TGeoArb8("sV0AOct2", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
533 TGeoVolume *v0AOct2 = new TGeoVolume("V0AOct2", sV0AOct2,medV0ASup);
534 v0AOct2->SetLineColor(kV0AColorOct);
a8b5076e 535 TGeoVolume *v0ASup = new TGeoVolumeAssembly("V0ASup");
5063dd34 536 v0ASup->AddNode(v0AOct2,1);
537 v0ASec->AddNode(v0ASup,1);
1a809d19 538
11ea46b9 539 //Bunch of fibers
a8b5076e 540 v0APts[ 0] = v0APts[ 2] = -13.0;
5063dd34 541 v0APts[ 1] = v0APts[ 7] = (fV0ASciWd+fV0AOctWd)/2.-0.01;
542 v0APts[ 3] = v0APts[ 5] = (fV0ASciWd+fV0AOctWd)/2.+0.01;
a8b5076e 543 v0APts[ 4] = v0APts[ 6] = +13.0;
11ea46b9 544 v0APts[ 8] = v0APts[10] = -10.0;
5063dd34 545 v0APts[ 9] = v0APts[15] = 0.;
546 v0APts[11] = v0APts[13] = 0.25;
11ea46b9 547 v0APts[12] = v0APts[14] = +10.0;
a8b5076e 548 new TGeoArb8("sV0AFib1", 11.5, v0APts);
1a809d19 549 TGeoRotation *rot = new TGeoRotation("rot");
550 rot->RotateX(-90);
551 rot->RotateZ(-90.+22.5);
a8b5076e 552 TGeoCombiTrans *fibpos1 = new TGeoCombiTrans("fibpos1", (fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. - 3.8, (fV0AR6-fV0AOctH2+fV0AR5)*sin225/2.-1.8, 0, rot);
553 fibpos1->RegisterYourself();
554 TGeoCompositeShape *sV0AFib1Hole = new TGeoCompositeShape("sV0AFib1Hole","sV0AFib1:fibpos1-sV0AFicR5");
555 TGeoVolume *v0AFib1Hole = new TGeoVolume("V0AFib1Hole",sV0AFib1Hole,medV0AFib);
556 v0AFib1Hole->SetLineColor(kV0AColorFib);
557 new TGeoArb8("sV0AFib2", 11.5, v0APts);
1a809d19 558 rot = new TGeoRotation("rot");
559 rot->RotateX(-90);
560 rot->RotateY(180);
561 rot->RotateZ(-90.+22.5);
a8b5076e 562 TGeoCombiTrans *fibpos2 = new TGeoCombiTrans("fibpos2", (fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. - 3.8, (fV0AR6-fV0AOctH2+fV0AR5)*sin225/2.-1.8, 0, rot);
563 fibpos2->RegisterYourself();
564 TGeoCompositeShape *sV0AFib2Hole = new TGeoCompositeShape("sV0AFib2Hole","sV0AFib2:fibpos2-sV0AFicR5");
565 TGeoVolume *v0AFib2Hole = new TGeoVolume("V0AFib2Hole",sV0AFib2Hole,medV0AFib);
566 v0AFib2Hole->SetLineColor(kV0AColorFib);
567 TGeoVolume *v0AFib = new TGeoVolumeAssembly("V0AFib");
568 v0AFib->AddNode(v0AFib1Hole,1);
569 v0AFib->AddNode(v0AFib2Hole,1);
570 v0ASec->AddNode(v0AFib,1);
11ea46b9 571
a8b5076e 572 /// Plates
11ea46b9 573 new TGeoTube("sV0ANail1PlaInHole", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
574 new TGeoTube("sV0ANail2PlaInHole", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
575 new TGeoCompositeShape("sV0ANailsPlaInHoles","sV0ANail1PlaInHole:pos1+sV0ANail2PlaInHole:pos2");
576 new TGeoTube("sV0ANail1PlaOuHole", 0.0, 0.4, (fV0APlaAl)/2.);
577 new TGeoTube("sV0ANail2PlaOuHole", 0.0, 0.4, (fV0APlaAl)/2.);
578 new TGeoCompositeShape("sV0ANailsPlaOuHoles","sV0ANail1PlaOuHole:pos1+sV0ANail2PlaOuHole:pos2");
1a809d19 579 for (int i=0;i<2;i++) {
5063dd34 580 v0APts[0+8*i] = fV0AR0; v0APts[1+8*i] = 0.;
581 v0APts[2+8*i] = fV0AR0*sin45; v0APts[3+8*i] = fV0AR0*sin45;
11ea46b9 582 v0APts[4+8*i] = fV0AR6 * sin45; v0APts[5+8*i] = fV0AR6*sin45;
583 v0APts[6+8*i] = fV0AR6; v0APts[7+8*i] = 0.;
1a809d19 584 }
11ea46b9 585 new TGeoArb8("sV0APlaIn", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
586 TGeoCompositeShape *sV0APlaInNailsHoles = new TGeoCompositeShape("sV0APlaInNailsHoles","sV0APlaIn-sV0ANailsPlaInHoles");
587 TGeoVolume *v0APlaInNailsHoles = new TGeoVolume("V0APlaInNailsHoles", sV0APlaInNailsHoles, medV0APlaIn);
588 new TGeoArb8("sV0APlaOu", fV0APlaAl/2., v0APts);
589 TGeoCompositeShape *sV0APlaOuNailsHoles = new TGeoCompositeShape("sV0APlaOuNailsHoles","sV0APlaOu-sV0ANailsPlaOuHoles");
590 TGeoVolume *v0APlaOuNailsHoles = new TGeoVolume("V0APlaOuNailsHoles", sV0APlaOuNailsHoles, medV0APlaOu);
591 v0APlaInNailsHoles->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles->SetLineColor(kV0AColorPlaOu);
5063dd34 592 TGeoVolume *v0APla = new TGeoVolumeAssembly("V0APla");
11ea46b9 593 v0APla->AddNode(v0APlaInNailsHoles,1);
594 v0APla->AddNode(v0APlaOuNailsHoles,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
595 v0APla->AddNode(v0APlaOuNailsHoles,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
5063dd34 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.));
a8b5076e 598
599 /// Non-sensitive scintilator
600 new TGeoTubeSeg("sV0AR5S2", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 0, 45);
601 TGeoCompositeShape *sV0AR5 = new TGeoCompositeShape("V0AR5","sV0AR5S2 - sV0ACha");
602 TGeoVolume *v0AR5 = new TGeoVolume("V0AR5",sV0AR5,medV0ASci);
603 v0AR5->SetLineColor(kV0AColorSci);
604 v0ASci->AddNode(v0AR5,1);
605 v0ASec->AddNode(v0ASci,1);
11ea46b9 606
607 // Aluminium nails
608 TGeoTube *sV0ANail1 = new TGeoTube("sV0ANail1", 0.0, 0.4, 5.09/2.);
609 TGeoVolume *v0ANail1 = new TGeoVolume("V0ANail1", sV0ANail1, medV0APMAlum);
610 v0ANail1->SetLineColor(kV0AColorPMA);// this is the color for aluminium
611 v0ASec->AddNode(v0ANail1,1,new TGeoTranslation(42.9, 0.51, 0.0));
612 TGeoTube *sV0ANail2 = new TGeoTube("sV0ANail2", 0.0, 0.4, 5.09/2.);
613 TGeoVolume *v0ANail2 = new TGeoVolume("V0ANail2", sV0ANail2, medV0APMAlum);
614 v0ANail2->SetLineColor(kV0AColorPMA);
a32c7883 615 v0ASec->AddNode(v0ANail2,1,new TGeoTranslation(30.73,29.98,0.0));
a8b5076e 616
617 /// Replicate sectors and adding sector to v0LE volume
1a809d19 618 TGeoVolume *v0LE = new TGeoVolumeAssembly("V0LE");
11ea46b9 619 for(int i=0; i<4; i++) {
aa6dd630 620 TGeoRotation *rotation = new TGeoRotation("rotation", 90., i*45., 90., 90.+i*45., 0., 0.);
621 v0LE->AddNode(v0ASec,i+1,rotation);
1a809d19 622 }
11ea46b9 623
624 //Upper supports
625 for (int i=0;i<2;i++){
a8b5076e 626 v0APts[0+8*i] = 0.0; v0APts[1+8*i] = 45.5;
627 v0APts[2+8*i] = 0.0; v0APts[3+8*i] = 70.4;
11ea46b9 628 v0APts[4+8*i] = 4.0; v0APts[5+8*i] = 68.9;
629 v0APts[6+8*i] = 4.0; v0APts[7+8*i] = 45.5;
630 }
a8b5076e 631 TGeoArb8 *sV0ASuppur = new TGeoArb8("sV0ASuppur", 1.65, v0APts);
11ea46b9 632 TGeoVolume *v0ASuppur = new TGeoVolume("V0ASuppur", sV0ASuppur, medV0ASup);
633 v0ASuppur->SetLineColor(kV0AColorOct);
634 v0LE->AddNode(v0ASuppur,1);
635 for (int i=0;i<2;i++){
a32c7883 636 v0APts[0+8*i] = -0.0; v0APts[1+8*i] = 70.4;
637 v0APts[2+8*i] = -0.0; v0APts[3+8*i] = 45.5;
638 v0APts[4+8*i] = -4.0; v0APts[5+8*i] = 45.5;
639 v0APts[6+8*i] = -4.0; v0APts[7+8*i] = 68.9;
11ea46b9 640 }
a8b5076e 641 TGeoArb8 *sV0ASuppul = new TGeoArb8("sV0ASuppul", 1.65, v0APts);
11ea46b9 642 TGeoVolume *v0ASuppul = new TGeoVolume("V0ASuppul", sV0ASuppul, medV0ASup);
643 v0ASuppul->SetLineColor(kV0AColorOct);
644 v0LE->AddNode(v0ASuppul,1);
e279cdd5 645
646 // PMBoxes and FEEBoxes for sector 1
647
648 /// PMBox
649 TGeoVolume* v0APM = new TGeoVolumeAssembly("V0APM");
650 new TGeoBBox("sV0APMB1", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
651 new TGeoBBox("sV0APMB2", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
652 TGeoCompositeShape *sV0APMB = new TGeoCompositeShape("sV0APMB","sV0APMB1-sV0APMB2");
653 TGeoVolume *v0APMB = new TGeoVolume("V0APMB",sV0APMB, medV0APMAlum);
654 v0APMB->SetLineColor(kV0AColorPMA);
655 v0APM->AddNode(v0APMB,1);
656
657 /// PMTubes
658 TGeoTube *sV0APMT1 = new TGeoTube("sV0APMT1", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
659 TGeoVolume *v0APMT1 = new TGeoVolume("V0APMT1", sV0APMT1, medV0APMGlass);
660 TGeoTube *sV0APMT2 = new TGeoTube("sV0APMT2", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
661 TGeoVolume *v0APMT2 = new TGeoVolume("V0APMT2", sV0APMT2, medV0APMAlum);
662 TGeoVolume *v0APMT = new TGeoVolumeAssembly("V0APMT");
663 TGeoTube *sV0APMTT = new TGeoTube("sV0APMTT", 0., fV0APMTR4, fV0APMTB/2.);
664 TGeoVolume *v0APMTT = new TGeoVolume("V0APMTT", sV0APMTT, medV0APMAlum);
665 v0APMT1->SetLineColor(kV0AColorPMG);
666 v0APMT2->SetLineColor(kV0AColorPMA);
667 v0APMTT->SetLineColor(kV0AColorPMA);
668 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
669 v0APMT->AddNode(v0APMT1,1,rot);
670 v0APMT->AddNode(v0APMT2,1,rot);
671 v0APMT->AddNode(v0APMTT,1,new TGeoCombiTrans(0,-(fV0APMTH+fV0APMTB)/2.,0,rot));
672 double autoShift = (fV0APMBWd-2*fV0APMBWdW)/4.;
673 v0APM->AddNode(v0APMT, 1, new TGeoTranslation(-1.5*autoShift, 0, 0));
674 v0APM->AddNode(v0APMT, 2, new TGeoTranslation(-0.5*autoShift, 0, 0));
675 v0APM->AddNode(v0APMT, 3, new TGeoTranslation(+0.5*autoShift, 0, 0));
676 v0APM->AddNode(v0APMT, 4, new TGeoTranslation(+1.5*autoShift, 0, 0));
677
678 /// PM
679 rot = new TGeoRotation("rot");
680 rot->RotateX(90-fV0APMBAng);
681 rot->RotateZ(-90.+22.5);
682 double cosAngPMB = TMath::Cos(fV0APMBAng*TMath::DegToRad());
683 double sinAngPMB = TMath::Sin(fV0APMBAng*TMath::DegToRad());
684 double shiftZ = fV0APMBHt/2. * cosAngPMB
685 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB;
686 double shiftR = fV0AR6 + fV0AOctH2 + fV0APlaAl;
687 v0LE->AddNode(v0APM,1, new TGeoCombiTrans( shiftR*cos225 - 3.8, shiftR*sin225 + 12.0, shiftZ, rot));
688
689
690 //FEEBox
691 TGeoVolume* v0AFEE = new TGeoVolumeAssembly("V0AFEE");
692 new TGeoBBox("sV0AFEEB1", fV0AFEEBWd/2., fV0AFEEBHt/2., fV0AFEEBTh/2.);
693 new TGeoBBox("sV0AFEEB2", fV0AFEEBWd/2.-fV0APMBWdW, fV0AFEEBHt/2.-fV0APMBHtW, fV0AFEEBTh/2.-fV0APMBThW);
694 TGeoCompositeShape *sV0AFEEB = new TGeoCompositeShape("sV0AFEEB","sV0AFEEB1-sV0AFEEB2");
695 TGeoVolume *v0AFEEB = new TGeoVolume("V0AFEEB",sV0AFEEB, medV0APMAlum);
696 v0AFEEB->SetLineColor(kV0AColorPMA);
697 v0AFEE->AddNode(v0AFEEB,1);
698
699 //FEE
700 rot = new TGeoRotation("rot");
701 rot->RotateX(90);
702 rot->RotateZ(-90.0+22.5);
703 double cosAngFEEB = TMath::Cos(fV0APMBAng*TMath::DegToRad());
704 double sinAngFEEB = TMath::Sin(fV0APMBAng*TMath::DegToRad());
705 double FEEshiftZ = fV0AFEEBHt/2. * cosAngFEEB - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0AFEEBTh/2. * sinAngFEEB;
706 double FEEshiftR = fV0AR6 + fV0AOctH2 + fV0APlaAl;
707 v0LE->AddNode(v0AFEE,1, new TGeoCombiTrans( FEEshiftR*cos225+2.0, fV0AFEEBHt/2. + fV0AFEEBTh/2., FEEshiftZ + 8.0, rot));
708
709 // PMBoxes and FEEBoxes for sector 2
710
711 /// PMBox
712 TGeoVolume* v0APM2 = new TGeoVolumeAssembly("V0APM2");
713 new TGeoBBox("sV0APMB12", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
714 new TGeoBBox("sV0APMB22", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
715 TGeoCompositeShape *sV0APMB2 = new TGeoCompositeShape("sV0APMB2","sV0APMB12-sV0APMB22");
716 TGeoVolume *v0APMB2 = new TGeoVolume("V0APMB2",sV0APMB2, medV0APMAlum);
717 v0APMB2->SetLineColor(kV0AColorPMA);
718 v0APM2->AddNode(v0APMB,1);
719
720 /// PMTubes
721 TGeoTube *sV0APMT12 = new TGeoTube("sV0APMT12", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
722 TGeoVolume *v0APMT12 = new TGeoVolume("V0APMT12", sV0APMT12, medV0APMGlass);
723 TGeoTube *sV0APMT22 = new TGeoTube("sV0APMT22", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
724 TGeoVolume *v0APMT22 = new TGeoVolume("V0APMT22", sV0APMT22, medV0APMAlum);
725 TGeoVolume *v0APMT222 = new TGeoVolumeAssembly("V0APMT222");
726 TGeoTube *sV0APMTT2 = new TGeoTube("sV0APMTT2", 0., fV0APMTR4, fV0APMTB/2.);
727 TGeoVolume *v0APMTT2 = new TGeoVolume("V0APMTT2", sV0APMTT2, medV0APMAlum);
728 v0APMT12->SetLineColor(kV0AColorPMG);
729 v0APMT22->SetLineColor(kV0AColorPMA);
730 v0APMTT2->SetLineColor(kV0AColorPMA);
731 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
732 v0APMT222->AddNode(v0APMT12,1,rot);
733 v0APMT222->AddNode(v0APMT22,1,rot);
734 v0APMT222->AddNode(v0APMTT2,1,new TGeoCombiTrans(0,-(fV0APMTH+fV0APMTB)/2.,0,rot));
735 double autoShift2 = (fV0APMBWd-2*fV0APMBWdW)/4.;
736 v0APM2->AddNode(v0APMT222, 1, new TGeoTranslation(-1.5*autoShift2, 0, 0));
737 v0APM2->AddNode(v0APMT222, 2, new TGeoTranslation(-0.5*autoShift2, 0, 0));
738 v0APM2->AddNode(v0APMT222, 3, new TGeoTranslation(+0.5*autoShift2, 0, 0));
739 v0APM2->AddNode(v0APMT222, 4, new TGeoTranslation(+1.5*autoShift2, 0, 0));
740
741 /// PM
742 rot = new TGeoRotation("rot");
743 rot->RotateX(90-fV0APMBAng);
744 rot->RotateZ(-90.+22.5+22.5+22.5);
745 double cosAngPMB2 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
746 double sinAngPMB2 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
747 double shiftZ2 = fV0APMBHt/2. * cosAngPMB2
748 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB2;
749 double shiftR2 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
750 v0LE->AddNode(v0APM2,1, new TGeoCombiTrans( shiftR2*cos225 - 52.0, shiftR2*sin225 + 46.5, shiftZ2, rot));
751
752
753 //FEEBox
754 TGeoVolume* v0AFEE2 = new TGeoVolumeAssembly("V0AFEE2");
755 new TGeoBBox("sV0AFEEB12", fV0AFEEBWd/2., fV0AFEEBHt/2., fV0AFEEBTh/2.);
756 new TGeoBBox("sV0AFEEB22", fV0AFEEBWd/2.-fV0APMBWdW, fV0AFEEBHt/2.-fV0APMBHtW, fV0AFEEBTh/2.-fV0APMBThW);
757 TGeoCompositeShape *sV0AFEEB2 = new TGeoCompositeShape("sV0AFEEB2","sV0AFEEB12-sV0AFEEB22");
758 TGeoVolume *v0AFEEB2 = new TGeoVolume("V0AFEEB2",sV0AFEEB2, medV0APMAlum);
759 v0AFEEB2->SetLineColor(kV0AColorPMA);
760 v0AFEE2->AddNode(v0AFEEB2,1);
761
762 //FEE
763 rot = new TGeoRotation("rot");
764 rot->RotateX(90);
765 rot->RotateZ(-90.0+22.5+22.5+22.5);
766 double cosAngFEEB2 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
767 double sinAngFEEB2 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
768 double FEEshiftZ2 = fV0AFEEBHt/2. * cosAngFEEB2 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0AFEEBTh/2. * sinAngFEEB2;
769 double FEEshiftR2 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
770 v0LE->AddNode(v0AFEE2,1, new TGeoCombiTrans( FEEshiftR2*cos225 - 28.0, fV0AFEEBHt + fV0AFEEBTh + 32.0, FEEshiftZ2 + 8.0, rot));
771
772 // PMBoxes and FEEBoxes for sector 3
773
774 /// PMBox
775 TGeoVolume* v0APM3 = new TGeoVolumeAssembly("V0APM3");
776 new TGeoBBox("sV0APMB13", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
777 new TGeoBBox("sV0APMB23", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
778 TGeoCompositeShape *sV0APMB3 = new TGeoCompositeShape("sV0APMB3","sV0APMB13-sV0APMB23");
779 TGeoVolume *v0APMB3 = new TGeoVolume("V0APMB3",sV0APMB3, medV0APMAlum);
780 v0APMB3->SetLineColor(kV0AColorPMA);
781 v0APM3->AddNode(v0APMB,1);
782
783 /// PMTubes
784 TGeoTube *sV0APMT13 = new TGeoTube("sV0APMT13", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
785 TGeoVolume *v0APMT13 = new TGeoVolume("V0APMT13", sV0APMT13, medV0APMGlass);
786 TGeoTube *sV0APMT23 = new TGeoTube("sV0APMT23", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
787 TGeoVolume *v0APMT23 = new TGeoVolume("V0APMT23", sV0APMT23, medV0APMAlum);
788 TGeoVolume *v0APMT3 = new TGeoVolumeAssembly("V0APMT3");
789 TGeoTube *sV0APMTT3 = new TGeoTube("sV0APMTT3", 0., fV0APMTR4, fV0APMTB/2.);
790 TGeoVolume *v0APMTT3 = new TGeoVolume("V0APMTT3", sV0APMTT3, medV0APMAlum);
791 v0APMT13->SetLineColor(kV0AColorPMG);
792 v0APMT23->SetLineColor(kV0AColorPMA);
793 v0APMTT3->SetLineColor(kV0AColorPMA);
794 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
795 v0APMT3->AddNode(v0APMT13,1,rot);
796 v0APMT3->AddNode(v0APMT23,1,rot);
797 v0APMT3->AddNode(v0APMTT3,1,new TGeoCombiTrans(0,-(fV0APMTH+fV0APMTB)/2.,0,rot));
798 double autoShift3 = (fV0APMBWd-2*fV0APMBWdW)/4.;
799 v0APM3->AddNode(v0APMT3, 1, new TGeoTranslation(-1.5*autoShift3, 0, 0));
800 v0APM3->AddNode(v0APMT3, 2, new TGeoTranslation(-0.5*autoShift3, 0, 0));
801 v0APM3->AddNode(v0APMT3, 3, new TGeoTranslation(+0.5*autoShift3, 0, 0));
802 v0APM3->AddNode(v0APMT3, 4, new TGeoTranslation(+1.5*autoShift3, 0, 0));
803
804 /// PM
805 rot = new TGeoRotation("rot");
806 rot->RotateX(90-fV0APMBAng);
807 rot->RotateZ(90.-22.5-22.5-22.5);
808 double cosAngPMB3 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
809 double sinAngPMB3 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
810 double shiftZ3 = fV0APMBHt/2. * cosAngPMB3
811 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB3;
812 double shiftR3 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
813 v0LE->AddNode(v0APM3,1, new TGeoCombiTrans( -shiftR3*cos225 + 52.0, shiftR3*sin225 + 46.5, shiftZ3, rot));
814
815
816 //FEEBox
817 TGeoVolume* v0AFEE3 = new TGeoVolumeAssembly("V0AFEE3");
818 new TGeoBBox("sV0AFEEB13", fV0AFEEBWd/2., fV0AFEEBHt/2., fV0AFEEBTh/2.);
819 new TGeoBBox("sV0AFEEB3", fV0AFEEBWd/2.-fV0APMBWdW, fV0AFEEBHt/2.-fV0APMBHtW, fV0AFEEBTh/2.-fV0APMBThW);
820 TGeoCompositeShape *sV0AFEEB3 = new TGeoCompositeShape("sV0AFEEB3","sV0AFEEB13-sV0AFEEB23");
821 TGeoVolume *v0AFEEB3 = new TGeoVolume("V0AFEEB3",sV0AFEEB3, medV0APMAlum);
822 v0AFEEB3->SetLineColor(kV0AColorPMA);
823 v0AFEE3->AddNode(v0AFEEB2,1);
824
825 //FEE
826 rot = new TGeoRotation("rot");
827 rot->RotateX(90);
828 rot->RotateZ(90.0-22.5-22.5-22.5);
829 double cosAngFEEB3 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
830 double sinAngFEEB3 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
831 double FEEshiftZ3 = fV0AFEEBHt/2. * cosAngFEEB3 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0AFEEBTh/2. * sinAngFEEB3;
832 double FEEshiftR3 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
833 v0LE->AddNode(v0AFEE3,1, new TGeoCombiTrans( -FEEshiftR3*cos225 + 28.0, fV0AFEEBHt + fV0AFEEBTh + 32.0, FEEshiftZ3 + 8.0, rot));
834
835 // PMBoxes and FEEBoxes for sector 4
836
837 /// PMBox
838 TGeoVolume* v0APM4 = new TGeoVolumeAssembly("V0APM4");
839 new TGeoBBox("sV0APMB14", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
840 new TGeoBBox("sV0APMB24", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
841 TGeoCompositeShape *sV0APMB4 = new TGeoCompositeShape("sV0APMB4","sV0APMB14-sV0APMB24");
842 TGeoVolume *v0APMB4 = new TGeoVolume("V0APMB4",sV0APMB4, medV0APMAlum);
843 v0APMB4->SetLineColor(kV0AColorPMA);
844 v0APM4->AddNode(v0APMB4,1);
845
846 /// PMTubes
847 TGeoTube *sV0APMT14 = new TGeoTube("sV0APMT14", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
848 TGeoVolume *v0APMT14 = new TGeoVolume("V0APMT14", sV0APMT14, medV0APMGlass);
849 TGeoTube *sV0APMT24 = new TGeoTube("sV0APMT24", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
850 TGeoVolume *v0APMT24 = new TGeoVolume("V0APMT24", sV0APMT24, medV0APMAlum);
851 TGeoVolume *v0APMT4 = new TGeoVolumeAssembly("V0APMT4");
852 TGeoTube *sV0APMTT4 = new TGeoTube("sV0APMTT4", 0., fV0APMTR4, fV0APMTB/2.);
853 TGeoVolume *v0APMTT4 = new TGeoVolume("V0APMTT4", sV0APMTT4, medV0APMAlum);
854 v0APMT14->SetLineColor(kV0AColorPMG);
855 v0APMT24->SetLineColor(kV0AColorPMA);
856 v0APMTT4->SetLineColor(kV0AColorPMA);
857 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
858 v0APMT4->AddNode(v0APMT14,1,rot);
859 v0APMT4->AddNode(v0APMT24,1,rot);
860 v0APMT4->AddNode(v0APMTT4,1,new TGeoCombiTrans(0,-(fV0APMTH+fV0APMTB)/2.,0,rot));
861 double autoShift4 = (fV0APMBWd-2*fV0APMBWdW)/4.;
862 v0APM4->AddNode(v0APMT4, 1, new TGeoTranslation(-1.5*autoShift4, 0, 0));
863 v0APM4->AddNode(v0APMT4, 2, new TGeoTranslation(-0.5*autoShift4, 0, 0));
864 v0APM4->AddNode(v0APMT4, 3, new TGeoTranslation(+0.5*autoShift4, 0, 0));
865 v0APM4->AddNode(v0APMT4, 4, new TGeoTranslation(+1.5*autoShift4, 0, 0));
866
867 /// PM
868 rot = new TGeoRotation("rot");
869 rot->RotateX(90-fV0APMBAng);
870 rot->RotateZ(+90.-22.5);
871 double cosAngPMB4 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
872 double sinAngPMB4 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
873 double shiftZ4 = fV0APMBHt/2. * cosAngPMB4
874 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB4;
875 double shiftR4 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
876 v0LE->AddNode(v0APM4,1, new TGeoCombiTrans( -shiftR4*cos225 + 3.8, shiftR4*sin225 + 12.0, shiftZ4, rot));
877
878
879 //FEEBox
880 TGeoVolume* v0AFEE4 = new TGeoVolumeAssembly("V0AFEE4");
881 new TGeoBBox("sV0AFEEB14", fV0AFEEBWd/2., fV0AFEEBHt/2., fV0AFEEBTh/2.);
882 new TGeoBBox("sV0AFEEB24", fV0AFEEBWd/2.-fV0APMBWdW, fV0AFEEBHt/2.-fV0APMBHtW, fV0AFEEBTh/2.-fV0APMBThW);
883 TGeoCompositeShape *sV0AFEEB4 = new TGeoCompositeShape("sV0AFEEB4","sV0AFEEB14-sV0AFEEB24");
884 TGeoVolume *v0AFEEB4 = new TGeoVolume("V0AFEEB4",sV0AFEEB4, medV0APMAlum);
885 v0AFEEB4->SetLineColor(kV0AColorPMA);
886 v0AFEE4->AddNode(v0AFEEB,1);
887
888 //FEE
889 rot = new TGeoRotation("rot");
890 rot->RotateX(90);
891 rot->RotateZ(+90.0-22.5);
892 double cosAngFEEB4 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
893 double sinAngFEEB4 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
894 double FEEshiftZ4 = fV0AFEEBHt/2. * cosAngFEEB4 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0AFEEBTh/2. * sinAngFEEB4;
895 double FEEshiftR4 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
896 v0LE->AddNode(v0AFEE4,1, new TGeoCombiTrans( -FEEshiftR4*cos225-2.0, fV0AFEEBHt/2. + fV0AFEEBTh/2., FEEshiftZ4 + 8.0, rot));
897
1a809d19 898
11ea46b9 899
a8b5076e 900 //Definition of sector 5
901 TGeoVolume *v0ASec5 = new TGeoVolumeAssembly("V0ASec5");
11ea46b9 902
a8b5076e 903 /// For boolean sustraction
11ea46b9 904 double preShape5 = 0.2;
905 for (int i=0;i<2;i++) {
a32c7883 906 v0APts[0+8*i] = -fV0AR0+fV0AFraWd/2.; v0APts[1+8*i] = fV0AFraWd/2.;
907 v0APts[2+8*i] = -fV0AR0+fV0AFraWd/2.; v0APts[3+8*i] = -2*preShape5;
908 v0APts[4+8*i] = -fV0AR4-fV0AFraWd/2.-preShape5; v0APts[5+8*i] = -2*preShape5;
909 v0APts[6+8*i] = -fV0AR4-fV0AFraWd/2.-preShape5; v0APts[7+8*i] = fV0AFraWd/2.;
11ea46b9 910 }
911 new TGeoArb8("sV0ACha15",fV0ASciWd/1.5,v0APts);
912 for (int i=0;i<2;i++) {
a8b5076e 913 v0APts[0+8*i] = -fV0AR0*cos45+preShape;
914 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape;
915 v0APts[2+8*i] = -(fV0AR0-fV0AFraWd/2.)*cos45+preShape;
916 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
917 v0APts[4+8*i] = -(fV0AR4+fV0AFraWd/2.)*cos45-preShape;
918 v0APts[5+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-2.*preShape;
919 v0APts[6+8*i] = -(fV0AR4+fV0AFraWd)*cos45-preShape;
920 v0APts[7+8*i] = -fV0AR4*sin45-preShape;
11ea46b9 921 }
922 new TGeoArb8("sV0ACha25", fV0ASciWd/2.+2.*preShape5, v0APts);
923 new TGeoCompositeShape("sV0ACha125","sV0ACha15+sV0ACha25");
924 new TGeoTube("sV0ANail15Hole", 0.0, 0.4, 1.65);
925 TGeoTranslation *pos15 = new TGeoTranslation("pos15", -42.9, -0.51, 0.0);
926 pos15->RegisterYourself();
927 new TGeoTube("sV0ANail25Hole", 0.0, 0.4, 1.65);
a8b5076e 928 TGeoTranslation *pos25 = new TGeoTranslation("pos25",-30.8,-30.04,0.0);
11ea46b9 929 pos25->RegisterYourself();
a8b5076e 930 TGeoTranslation *pos35 = new TGeoTranslation("pos35",-30.05,-30.79,0.0);
11ea46b9 931 pos35->RegisterYourself();
a8b5076e 932 new TGeoCompositeShape("sV0ANailsHoles5","sV0ANail15Hole:pos15+sV0ANail25Hole:pos25");
11ea46b9 933 new TGeoCompositeShape("sV0ACha5","sV0ACha125+sV0ANailsHoles5");
a8b5076e 934 new TGeoTubeSeg("sV0AFicR55", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2. +2*preShape, 180.0, 225.0);
935 new TGeoTube("sV0ANail1PlaInHole5", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
936 new TGeoTube("sV0ANail2PlaInHole5", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
937 new TGeoTube("sV0ANail3PlaInHole5", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
938 new TGeoCompositeShape("sV0ANailsPlaInHoles5","sV0ANail1PlaInHole5:pos15+sV0ANail2PlaInHole5:pos25+sV0ANail3PlaInHole5:pos35");
939 new TGeoTube("sV0ANail1PlaOuHole5", 0.0, 0.4, (fV0APlaAl)/2.);
940 new TGeoTube("sV0ANail2PlaOuHole5", 0.0, 0.4, (fV0APlaAl)/2.);
941 new TGeoTube("sV0ANail3PlaOuHole5", 0.0, 0.4, (fV0APlaAl)/2.);
942 new TGeoCompositeShape("sV0ANailsPlaOuHoles5","sV0ANail1PlaOuHole5:pos15+sV0ANail2PlaOuHole5:pos25+sV0ANail3PlaOuHole5:pos35");
11ea46b9 943
944 /// Frame
945 TGeoVolume *v0AFra5 = new TGeoVolumeAssembly("V0AFra5");
a32c7883 946 for (int i=0;i<2;i++) {
a8b5076e 947 v0APts[0+8*i] = -fV0AR0+fV0AFraWd/2.; v0APts[1+8*i] = 0.0;
a32c7883 948 v0APts[2+8*i] = -fV0AR0+fV0AFraWd/2.; v0APts[3+8*i] = -fV0AFraWd/8.;
949 v0APts[4+8*i] = -fV0AR4-fV0AFraWd/2.; v0APts[5+8*i] = -fV0AFraWd/8.;
a8b5076e 950 v0APts[6+8*i] = -fV0AR4-fV0AFraWd/2.; v0APts[7+8*i] = 0.0;
951 }
11ea46b9 952 TGeoArb8 *sV0AFraB15 = new TGeoArb8("sV0AFraB15",fV0ASciWd/2.,v0APts);
953 TGeoVolume *v0AFraB15 = new TGeoVolume("V0AFraB15",sV0AFraB15,medV0AFra);
954 for (int i=0;i<2;i++) {
a8b5076e 955 v0APts[0+8*i] = -fV0AR0*cos45;
956 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd)*sin45;
957 v0APts[2+8*i] = -(fV0AR0-fV0AFraWd/2.)*cos45;
958 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
959 v0APts[4+8*i] = -(fV0AR4+fV0AFraWd/2.)*cos45;
960 v0APts[5+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45;
961 v0APts[6+8*i] = -(fV0AR4+fV0AFraWd)*cos45;
962 v0APts[7+8*i] = -fV0AR4*sin45;
11ea46b9 963 }
964 TGeoArb8 *sV0AFraB25 = new TGeoArb8("sV0AFraB25", fV0ASciWd/2., v0APts);
965 TGeoVolume *v0AFraB25 = new TGeoVolume("V0AFraB25",sV0AFraB25,medV0AFra);
966 v0AFraB15->SetLineColor(kV0AColorFra); v0AFraB25->SetLineColor(kV0AColorFra);
967 v0AFra5->AddNode(v0AFraB15,1);
968 v0AFra5->AddNode(v0AFraB25,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
969 new TGeoTubeSeg( "sV0AFraR1b5", fV0AR0-fV0AFraWd/2.,
a8b5076e 970 fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 971 new TGeoTubeSeg( "sV0AFraR2b5", fV0AR1-fV0AFraWd/2.,
a8b5076e 972 fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 973 new TGeoTubeSeg( "sV0AFraR3b5", fV0AR2-fV0AFraWd/2.,
a8b5076e 974 fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 975 new TGeoTubeSeg( "sV0AFraR4b5", fV0AR3-fV0AFraWd/2.,
a8b5076e 976 fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 977 new TGeoTubeSeg( "sV0AFraR5b5", fV0AR4-fV0AFraWd/2.,
a8b5076e 978 fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 979 TGeoCompositeShape *sV0AFraR15 = new TGeoCompositeShape("sV0AFraR15","sV0AFraR1b5-sV0ACha5");
980 TGeoCompositeShape *sV0AFraR25 = new TGeoCompositeShape("sV0AFraR25","sV0AFraR2b5-sV0ACha5");
981 TGeoCompositeShape *sV0AFraR35 = new TGeoCompositeShape("sV0AFraR35","sV0AFraR3b5-sV0ACha5");
982 TGeoCompositeShape *sV0AFraR45 = new TGeoCompositeShape("sV0AFraR45","sV0AFraR4b5-sV0ACha5");
983 TGeoCompositeShape *sV0AFraR55 = new TGeoCompositeShape("sV0AFraR55","sV0AFraR5b5-sV0ACha5");
984 TGeoVolume *v0AFraR15 = new TGeoVolume("V0AFraR15",sV0AFraR15,medV0AFra);
985 TGeoVolume *v0AFraR25 = new TGeoVolume("V0AFraR25",sV0AFraR25,medV0AFra);
986 TGeoVolume *v0AFraR35 = new TGeoVolume("V0AFraR35",sV0AFraR35,medV0AFra);
987 TGeoVolume *v0AFraR45 = new TGeoVolume("V0AFraR45",sV0AFraR45,medV0AFra);
988 TGeoVolume *v0AFraR55 = new TGeoVolume("V0AFraR55",sV0AFraR55,medV0AFra);
989 v0AFraR15->SetLineColor(kV0AColorFra); v0AFraR25->SetLineColor(kV0AColorFra);
990 v0AFraR35->SetLineColor(kV0AColorFra); v0AFraR45->SetLineColor(kV0AColorFra);
991 v0AFraR55->SetLineColor(kV0AColorFra);
992 v0AFra5->AddNode(v0AFraR15,1);
993 v0AFra5->AddNode(v0AFraR25,1);
994 v0AFra5->AddNode(v0AFraR35,1);
995 v0AFra5->AddNode(v0AFraR45,1);
996 v0AFra5->AddNode(v0AFraR55,1);
997 v0ASec5->AddNode(v0AFra5,1);
998
999 /// Sensitive scintilator
1000 TGeoVolume *v0ASci5 = new TGeoVolumeAssembly("V0ASci5");
1001 new TGeoTubeSeg( "sV0AR1b5", fV0AR0+fV0AFraWd/2.,
a8b5076e 1002 fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 1003 new TGeoTubeSeg( "sV0AR2b5", fV0AR1+fV0AFraWd/2.,
a8b5076e 1004 fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 1005 new TGeoTubeSeg( "sV0AR3b5", fV0AR2+fV0AFraWd/2.,
a8b5076e 1006 fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 1007 new TGeoTubeSeg( "sV0AR4b5", fV0AR3+fV0AFraWd/2.,
a8b5076e 1008 fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 180.0, 225.0);
11ea46b9 1009 TGeoCompositeShape *sV0AR15 = new TGeoCompositeShape("sV0AR15","sV0AR1b5-sV0ACha5");
1010 TGeoCompositeShape *sV0AR25 = new TGeoCompositeShape("sV0AR25","sV0AR2b5-sV0ACha5");
1011 TGeoCompositeShape *sV0AR35 = new TGeoCompositeShape("sV0AR35","sV0AR3b5-sV0ACha5");
1012 TGeoCompositeShape *sV0AR45 = new TGeoCompositeShape("sV0AR45","sV0AR4b5-sV0ACha5");
1013 TGeoVolume *v0L15 = new TGeoVolume("V0L15",sV0AR15,medV0ASci);
1014 TGeoVolume *v0L25 = new TGeoVolume("V0L25",sV0AR25,medV0ASci);
1015 TGeoVolume *v0L35 = new TGeoVolume("V0L35",sV0AR35,medV0ASci);
1016 TGeoVolume *v0L45 = new TGeoVolume("V0L45",sV0AR45,medV0ASci);
1017 v0L15->SetLineColor(kV0AColorSci); v0L25->SetLineColor(kV0AColorSci);
1018 v0L35->SetLineColor(kV0AColorSci); v0L45->SetLineColor(kV0AColorSci);
1019 v0ASci5->AddNode(v0L15,1);
1020 v0ASci5->AddNode(v0L25,1);
1021 v0ASci5->AddNode(v0L35,1);
1022 v0ASci5->AddNode(v0L45,1);
1023
a8b5076e 1024 /// Segment of octagon
1025 for (int i=0;i<2;i++) {
11ea46b9 1026 v0APts[0+8*i] = -fV0AR6+fV0AOctH2; v0APts[1+8*i] = 0.;
1027 v0APts[2+8*i] = -(fV0AR7-fV0AOctH2)*cos654; v0APts[3+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
1028 v0APts[4+8*i] = -fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
1029 v0APts[6+8*i] = -fV0AR6; v0APts[7+8*i] = 0.;
1030 }
1031 TGeoArb8 *sV0AOct25 = new TGeoArb8("sV0AOct25", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
1032 TGeoVolume *v0AOct25 = new TGeoVolume("V0AOct25", sV0AOct25,medV0ASup);
1033 v0AOct25->SetLineColor(kV0AColorOct);
a8b5076e 1034 TGeoVolume *v0ASup5 = new TGeoVolumeAssembly("V0ASup5");
11ea46b9 1035 v0ASup5->AddNode(v0AOct25,1);
1036 v0ASec5->AddNode(v0ASup5,1);
1037
1038 //Bunch of fibers
1039 v0APts[ 0] = v0APts[ 2] = -14.0;
1040 v0APts[ 1] = v0APts[ 7] = (fV0ASciWd+fV0AOctWd)/2.-0.01;
1041 v0APts[ 3] = v0APts[ 5] = (fV0ASciWd+fV0AOctWd)/2.+0.01;
1042 v0APts[ 4] = v0APts[ 6] = +14.0;
1043 v0APts[ 8] = v0APts[10] = -10.0;
1044 v0APts[ 9] = v0APts[15] = 0.;
1045 v0APts[11] = v0APts[13] = 0.25;
1046 v0APts[12] = v0APts[14] = +10.0;
a8b5076e 1047 new TGeoArb8("sV0AFib15", 11.8, v0APts);
11ea46b9 1048 rot = new TGeoRotation("rot");
1049 rot->RotateX(-90);
1050 rot->RotateZ(90+22.5);
a8b5076e 1051 TGeoCombiTrans *fib15pos = new TGeoCombiTrans("fib15pos", -(fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. +
1052 3.3, -(fV0AR6-fV0AOctH2+fV0AR5)*sin225/2. + 1.5, 0, rot);
1053 fib15pos->RegisterYourself();
1054 TGeoCompositeShape *sV0AFib15Hole = new TGeoCompositeShape("sV0AFib15Hole", "sV0AFib15:fib15pos-sV0AFicR55");
1055 TGeoVolume *v0AFib15Hole = new TGeoVolume("V0AFib15",sV0AFib15Hole,medV0AFib);
1056 v0AFib15Hole->SetLineColor(kV0AColorFib);
1057 new TGeoArb8("sV0AFib25", 11.8, v0APts);
11ea46b9 1058 rot = new TGeoRotation("rot");
1059 rot->RotateX(-90);
1060 rot->RotateY(180);
1061 rot->RotateZ(90+22.5);
a8b5076e 1062 TGeoCombiTrans *fib25pos = new TGeoCombiTrans("fib25pos", -(fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. +
1063 3.3, -(fV0AR6-fV0AOctH2+fV0AR5)*sin225/2. + 1.5, 0, rot);
1064 fib25pos->RegisterYourself();
1065 TGeoCompositeShape *sV0AFib25Hole = new TGeoCompositeShape("sV0AFib25Hole","sV0AFib25:fib25pos-sV0AFicR55");
1066 TGeoVolume *v0AFib25Hole = new TGeoVolume("V0AFib25Hole",sV0AFib25Hole,medV0AFib);
1067 v0AFib25Hole->SetLineColor(kV0AColorFib);
1068 TGeoVolume *v0AFib5 = new TGeoVolumeAssembly("V0AFib5");
1069 v0AFib5->AddNode(v0AFib15Hole,1);
1070 v0AFib5->AddNode(v0AFib25Hole,1);
1071 v0ASec5->AddNode(v0AFib5,1);
1072
1073 /// Non-sensitive scintilator
1074 new TGeoTubeSeg("sV0AR5S25", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 180.0, 225.0);
1075 TGeoCompositeShape *sV0AR55 = new TGeoCompositeShape("V0AR55","sV0AR5S25 - sV0ACha5");
1076 TGeoVolume *v0AR55 = new TGeoVolume("V0AR55",sV0AR55,medV0ASci);
1077 v0AR55->SetLineColor(kV0AColorSci);
1078 v0ASci5->AddNode(v0AR55,1);
1079 v0ASec5->AddNode(v0ASci5,1);
11ea46b9 1080
a8b5076e 1081 /// Plates
11ea46b9 1082 for (int i=0;i<2;i++) {
1083 v0APts[0+8*i] = -fV0AR0; v0APts[1+8*i] = 0.;
1084 v0APts[2+8*i] = -fV0AR0*cos654; v0APts[3+8*i] = -fV0AR0*sin654;
1085 v0APts[4+8*i] = -fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
1086 v0APts[6+8*i] = -fV0AR6; v0APts[7+8*i] = 0.;
1087 }
1088 new TGeoArb8("sV0APlaIn5", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
1089 TGeoCompositeShape *sV0APlaInNailsHoles5 = new TGeoCompositeShape("sV0APlaInNailsHoles5","sV0APlaIn5-sV0ANailsPlaInHoles5");
1090 TGeoVolume *v0APlaInNailsHoles5 = new TGeoVolume("V0APlaInNailsHoles5", sV0APlaInNailsHoles5, medV0APlaIn);
1091 new TGeoArb8("sV0APlaOu5", fV0APlaAl/2., v0APts);
a8b5076e 1092 TGeoCompositeShape *sV0APlaOuNailsHoles5 = new TGeoCompositeShape("sV0APlaOuNailsHoles5","sV0APlaOu5-sV0ANailsPlaOuHoles5");
11ea46b9 1093 TGeoVolume *v0APlaOuNailsHoles5 = new TGeoVolume("V0APlaOuNailsHoles5", sV0APlaOuNailsHoles5, medV0APlaOu);
1094 v0APlaInNailsHoles5->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles5->SetLineColor(kV0AColorPlaOu);
1095 TGeoVolume *v0APla5 = new TGeoVolumeAssembly("V0APla5");
1096 v0APla5->AddNode(v0APlaInNailsHoles5,1);
1097 v0APla5->AddNode(v0APlaOuNailsHoles5,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
1098 v0APla5->AddNode(v0APlaOuNailsHoles5,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
1099 v0ASec5->AddNode(v0APla5,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1100 v0ASec5->AddNode(v0APla5,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1101
a8b5076e 1102 /// PMBox
11ea46b9 1103 TGeoVolume* v0APM5 = new TGeoVolumeAssembly("V0APM5");
1104 new TGeoBBox("sV0APMB15", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
1105 new TGeoBBox("sV0APMB25", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
1106 TGeoCompositeShape *sV0APMB5 = new TGeoCompositeShape("sV0APMB5","sV0APMB15-sV0APMB25");
1107 TGeoVolume *v0APMB5 = new TGeoVolume("V0APMB5",sV0APMB5, medV0APMAlum);
1108 v0APMB5->SetLineColor(kV0AColorPMA);
1109 v0APM5->AddNode(v0APMB5,1);
1110
a8b5076e 1111 /// PMTubes
11ea46b9 1112 TGeoTube *sV0APMT15 = new TGeoTube("sV0APMT15", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
1113 TGeoVolume *v0APMT15 = new TGeoVolume("V0APMT15", sV0APMT15, medV0APMGlass);
1114 TGeoTube *sV0APMT25 = new TGeoTube("sV0APMT25", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
1115 TGeoVolume *v0APMT25 = new TGeoVolume("V0APMT25", sV0APMT25, medV0APMAlum);
1116 TGeoVolume *v0APMT5 = new TGeoVolumeAssembly("V0APMT5");
1117 TGeoTube *sV0APMTT5 = new TGeoTube("sV0APMTT5", 0., fV0APMTR4, fV0APMTB/2.);
2ca4471e 1118 TGeoVolume *v0APMTT5 = new TGeoVolume("V0APMTT5", sV0APMTT5, medV0APMAlum);
11ea46b9 1119 v0APMT5->SetLineColor(kV0AColorPMG);
1120 v0APMT25->SetLineColor(kV0AColorPMA);
1121 v0APMTT5->SetLineColor(kV0AColorPMA);
1122 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
1123 v0APMT5->AddNode(v0APMT15,1,rot);
1124 v0APMT5->AddNode(v0APMT25,1,rot);
1125 v0APMT5->AddNode(v0APMTT5,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
1126 double autoShift5 = (fV0APMBWd-2*fV0APMBWdW)/4.;
1127 v0APM5->AddNode(v0APMT5, 1, new TGeoTranslation(-1.5*autoShift5, 0, 0));
1128 v0APM5->AddNode(v0APMT5, 2, new TGeoTranslation(-0.5*autoShift5, 0, 0));
1129 v0APM5->AddNode(v0APMT5, 3, new TGeoTranslation(+0.5*autoShift5, 0, 0));
1130 v0APM5->AddNode(v0APMT5, 4, new TGeoTranslation(+1.5*autoShift5, 0, 0));
1131
a8b5076e 1132 /// PM
11ea46b9 1133 rot = new TGeoRotation("rot");
1134 rot->RotateX(-90+30);
1135 rot->RotateY(0);
1136 rot->RotateZ(-65-3);
1137 double cosAngPMB5 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
1138 double sinAngPMB5 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
1139 double shiftZ5 = fV0APMBHt/2. * cosAngPMB5
1140 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB5;
1141 double shiftR5 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
1142 v0ASec5->AddNode(v0APM5,1, new TGeoCombiTrans( -shiftR5*cos225-1.3, -shiftR5*sin225, shiftZ5, rot));
1143
a8b5076e 1144 // Aluminium nails
1145 TGeoTube *sV0ANail51 = new TGeoTube("sV0ANail51", 0.0, 0.4, 5.09/2.);
1146 TGeoVolume *v0ANail51 = new TGeoVolume("V0ANail51", sV0ANail51, medV0APMAlum);
1147 v0ANail51->SetLineColor(kV0AColorPMA);// this is the color for aluminium
1148 v0ASec5->AddNode(v0ANail51,1,new TGeoTranslation(-42.9,-0.51,0.0));
1149 TGeoTube *sV0ANail52 = new TGeoTube("sV0ANail52", 0.0, 0.4, 5.09/2.);
1150 TGeoVolume *v0ANail52 = new TGeoVolume("V0ANail52", sV0ANail52, medV0APMAlum);
1151 v0ANail52->SetLineColor(kV0AColorPMA);
1152 v0ASec5->AddNode(v0ANail52,1,new TGeoTranslation(-30.8,-30.04,0.0));
1153
1154 // Adding sector to v0LE volume
1155 v0LE->AddNode(v0ASec5, 1);
11ea46b9 1156
1157
a8b5076e 1158 //Definition of sector 6
11ea46b9 1159 TGeoVolume *v0ASec6 = new TGeoVolumeAssembly("V0ASec6");
1160
1161 /// For boolean sustraction
1162 double preShape6 = 0.2;
1163 for (int i=0;i<2;i++) {
1164 v0APts[0+8*i] = -preShape6; v0APts[1+8*i] = -fV0AR0+fV0AFraWd/2.-preShape6;
a32c7883 1165 v0APts[2+8*i] = 0.0; v0APts[3+8*i] = -fV0AR0+fV0AFraWd/2.-preShape6;
1166 v0APts[4+8*i] = 0.0; v0APts[5+8*i] = -fV0AR4-fV0AFraWd/2.+preShape6;
11ea46b9 1167 v0APts[6+8*i] = -preShape6; v0APts[7+8*i] = -fV0AR4-fV0AFraWd/2.+preShape6;
1168 }
1169 new TGeoArb8("sV0ACha16",fV0ASciWd/1.5,v0APts);
1170 for (int i=0;i<2;i++) {
a8b5076e 1171 v0APts[0+8*i] = -fV0AR0*cos45+preShape;
1172 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape;
1173 v0APts[2+8*i] = -(fV0AR0-fV0AFraWd/2.)*cos45+preShape;
1174 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
1175 v0APts[4+8*i] = -(fV0AR4+fV0AFraWd/2.)*cos45-preShape;
1176 v0APts[5+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-preShape;
1177 v0APts[6+8*i] = -(fV0AR4+fV0AFraWd)*cos45-preShape;
1178 v0APts[7+8*i] = -fV0AR4*sin45-preShape;
11ea46b9 1179 }
1180 new TGeoArb8("sV0ACha26", fV0ASciWd/2.+2.*preShape, v0APts);
1181 new TGeoCompositeShape("sV0ACha126","sV0ACha16+sV0ACha26");
1182 new TGeoTube("sV0ANail16Hole", 0.0, 0.4, 1.65);
1183 TGeoTranslation *pos16 = new TGeoTranslation("pos16",-0.51,-42.9,0.0);
1184 pos16->RegisterYourself();
a8b5076e 1185 new TGeoTube("sV0ANail26Hole", 0.0, 0.4, 1.65);
1186 TGeoTranslation *pos26 = new TGeoTranslation("pos26",-30.05,-30.79,0.0);
1187 pos26->RegisterYourself();
1188 new TGeoCompositeShape("sV0ANailsHoles6","sV0ANail16Hole:pos16+sV0ANail26Hole:pos26");
1189 new TGeoCompositeShape("sV0ACha6","sV0ACha126+sV0ANailsHoles6");
1190 new TGeoTubeSeg("sV0AFicR56", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 225, 270.0);
1191 new TGeoTube("sV0ANail1PlaInHole6", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
1192 new TGeoTube("sV0ANail1PlaOuHole6", 0.0, 0.4, (fV0APlaAl)/2.);
1193
11ea46b9 1194 /// Frame
1195 TGeoVolume *v0AFra6 = new TGeoVolumeAssembly("V0AFra6");
1196 for (int i=0;i<2;i++) {
a32c7883 1197 v0APts[0+8*i] = -fV0AFraWd/2.; v0APts[1+8*i] = -fV0AR0-fV0AFraWd/2.;
1198 v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR0-fV0AFraWd/2.;
1199 v0APts[4+8*i] = 0.; v0APts[5+8*i] = -fV0AR4+fV0AFraWd/2.;
1200 v0APts[6+8*i] = -fV0AFraWd/2.; v0APts[7+8*i] = -fV0AR4+fV0AFraWd/2.;
11ea46b9 1201 }
1202 TGeoArb8 *sV0AFraB16 = new TGeoArb8("sV0AFraB16",fV0ASciWd/2.,v0APts);
1203 TGeoVolume *v0AFraB16 = new TGeoVolume("V0AFraB16",sV0AFraB16,medV0AFra);
1204 for (int i=0;i<2;i++) {
a32c7883 1205 v0APts[0+8*i] = -(fV0AR0+fV0AFraWd/2.)*cos45;
1206 v0APts[1+8*i] = -(fV0AR0+fV0AFraWd/2.)*sin45;
1207 v0APts[2+8*i] = -fV0AR0*cos45;
1208 v0APts[3+8*i] = -(fV0AR0+fV0AFraWd)*sin45;
1209 v0APts[4+8*i] = -(fV0AR4-fV0AFraWd/6.)*cos45;
1210 v0APts[5+8*i] = -fV0AR4*sin45;
a8b5076e 1211 v0APts[6+8*i] = -(fV0AR4-fV0AFraWd)*cos45;
a32c7883 1212 v0APts[7+8*i] = -(fV0AR4-fV0AFraWd/2.)*sin45;
11ea46b9 1213 }
1214 TGeoArb8 *sV0AFraB26 = new TGeoArb8("sV0AFraB26", fV0ASciWd/2., v0APts);
1215 TGeoVolume *v0AFraB26 = new TGeoVolume("V0AFraB26",sV0AFraB26,medV0AFra);
1216 v0AFraB16->SetLineColor(kV0AColorFra); v0AFraB26->SetLineColor(kV0AColorFra);
1217 v0AFra6->AddNode(v0AFraB16,1);
1218 v0AFra6->AddNode(v0AFraB26,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
1219 new TGeoTubeSeg( "sV0AFraR1b6", fV0AR0-fV0AFraWd/2.,
a8b5076e 1220 fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1221 new TGeoTubeSeg( "sV0AFraR2b6", fV0AR1-fV0AFraWd/2.,
a8b5076e 1222 fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1223 new TGeoTubeSeg( "sV0AFraR3b6", fV0AR2-fV0AFraWd/2.,
a8b5076e 1224 fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1225 new TGeoTubeSeg( "sV0AFraR4b6", fV0AR3-fV0AFraWd/2.,
a8b5076e 1226 fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1227 new TGeoTubeSeg( "sV0AFraR5b6", fV0AR4-fV0AFraWd/2.,
a8b5076e 1228 fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1229 TGeoCompositeShape *sV0AFraR16 = new TGeoCompositeShape("sV0AFraR16","sV0AFraR1b6-sV0ACha6");
1230 TGeoCompositeShape *sV0AFraR26 = new TGeoCompositeShape("sV0AFraR26","sV0AFraR2b6-sV0ACha6");
1231 TGeoCompositeShape *sV0AFraR36 = new TGeoCompositeShape("sV0AFraR36","sV0AFraR3b6-sV0ACha6");
1232 TGeoCompositeShape *sV0AFraR46 = new TGeoCompositeShape("sV0AFraR46","sV0AFraR4b6-sV0ACha6");
1233 TGeoCompositeShape *sV0AFraR56 = new TGeoCompositeShape("sV0AFraR56","sV0AFraR5b6-sV0ACha6");
1234 TGeoVolume *v0AFraR16 = new TGeoVolume("V0AFraR16",sV0AFraR16,medV0AFra);
1235 TGeoVolume *v0AFraR26 = new TGeoVolume("V0AFraR26",sV0AFraR26,medV0AFra);
1236 TGeoVolume *v0AFraR36 = new TGeoVolume("V0AFraR36",sV0AFraR36,medV0AFra);
1237 TGeoVolume *v0AFraR46 = new TGeoVolume("V0AFraR46",sV0AFraR46,medV0AFra);
1238 TGeoVolume *v0AFraR56 = new TGeoVolume("V0AFraR56",sV0AFraR56,medV0AFra);
1239 v0AFraR16->SetLineColor(kV0AColorFra); v0AFraR26->SetLineColor(kV0AColorFra);
1240 v0AFraR36->SetLineColor(kV0AColorFra); v0AFraR46->SetLineColor(kV0AColorFra);
1241 v0AFraR56->SetLineColor(kV0AColorFra);
1242 v0AFra6->AddNode(v0AFraR16,1);
1243 v0AFra6->AddNode(v0AFraR26,1);
1244 v0AFra6->AddNode(v0AFraR36,1);
1245 v0AFra6->AddNode(v0AFraR46,1);
1246 v0AFra6->AddNode(v0AFraR56,1);
1247 v0ASec6->AddNode(v0AFra6,1);
1248
1249 /// Sensitive scintilator
1250 TGeoVolume *v0ASci6 = new TGeoVolumeAssembly("V0ASci6");
1251 new TGeoTubeSeg( "sV0AR1b6", fV0AR0+fV0AFraWd/2.,
a8b5076e 1252 fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1253 new TGeoTubeSeg( "sV0AR2b6", fV0AR1+fV0AFraWd/2.,
a8b5076e 1254 fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1255 new TGeoTubeSeg( "sV0AR3b6", fV0AR2+fV0AFraWd/2.,
a8b5076e 1256 fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1257 new TGeoTubeSeg( "sV0AR4b6", fV0AR3+fV0AFraWd/2.,
a8b5076e 1258 fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 225.0, 270.0);
11ea46b9 1259 TGeoCompositeShape *sV0AR16 = new TGeoCompositeShape("sV0AR16","sV0AR1b6-sV0ACha6");
1260 TGeoCompositeShape *sV0AR26 = new TGeoCompositeShape("sV0AR26","sV0AR2b6-sV0ACha6");
1261 TGeoCompositeShape *sV0AR36 = new TGeoCompositeShape("sV0AR36","sV0AR3b6-sV0ACha6");
1262 TGeoCompositeShape *sV0AR46 = new TGeoCompositeShape("sV0AR46","sV0AR4b6-sV0ACha6");
1263 TGeoVolume *v0L16 = new TGeoVolume("V0L16",sV0AR16,medV0ASci);
1264 TGeoVolume *v0L26 = new TGeoVolume("V0L26",sV0AR26,medV0ASci);
1265 TGeoVolume *v0L36 = new TGeoVolume("V0L36",sV0AR36,medV0ASci);
1266 TGeoVolume *v0L46 = new TGeoVolume("V0L46",sV0AR46,medV0ASci);
1267 v0L16->SetLineColor(kV0AColorSci); v0L26->SetLineColor(kV0AColorSci);
1268 v0L36->SetLineColor(kV0AColorSci); v0L46->SetLineColor(kV0AColorSci);
1269 v0ASci6->AddNode(v0L16,1);
1270 v0ASci6->AddNode(v0L26,1);
1271 v0ASci6->AddNode(v0L36,1);
1272 v0ASci6->AddNode(v0L46,1);
a8b5076e 1273
1274 // Bunch of fibers
1275 for (int i=0;i<2;i++) {
1276 v0APts[0+8*i] = -10.0; v0APts[1+8*i] = 13.1;
1277 v0APts[2+8*i] = 10.0; v0APts[3+8*i] = 13.1;
1278 v0APts[4+8*i] = 8.0; v0APts[5+8*i] = -29.0;
1279 v0APts[6+8*i] = -12.0; v0APts[7+8*i] = -12.0;
1280 }
1281 new TGeoArb8("sV0AFib16", 0.01, v0APts);
1282 rot = new TGeoRotation("rot");
1283 rot->RotateX(2.0);
1284 rot->RotateY(180.0);
1285 rot->RotateZ(90+22.5);
1286 TGeoCombiTrans *fib16pos = new TGeoCombiTrans("fib16pos", -40.0 + 3.3, -50.0 + 1.5, 0.5, rot);
1287 fib16pos->RegisterYourself();
1288 TGeoCompositeShape *sV0AFib16Hole = new TGeoCompositeShape("sV0AFib16Hole", "sV0AFib16:fib16pos-sV0AFicR56");
1289 TGeoVolume *v0AFib16Hole = new TGeoVolume("V0AFib16Hole",sV0AFib16Hole,medV0AFib);
1290 v0AFib16Hole->SetLineColor(kV0AColorFib);
1291 new TGeoArb8("sV0AFib26", 0.01, v0APts);
1292 rot = new TGeoRotation("rot");
1293 rot->RotateX(-2.0);
1294 rot->RotateY(180.0);
1295 rot->RotateZ(90+22.5);
1296 TGeoCombiTrans *fib26pos = new TGeoCombiTrans("fib26pos", -40.0 + 3.3, -50.0 + 1.5, -0.5, rot);
1297 fib26pos->RegisterYourself();
1298 TGeoCompositeShape *sV0AFib26Hole = new TGeoCompositeShape("sV0AFib26Hole", "sV0AFib26:fib26pos-sV0AFicR56");
1299 TGeoVolume *v0AFib26Hole = new TGeoVolume("V0AFib26Hole",sV0AFib26Hole,medV0AFib);
1300 v0AFib26Hole->SetLineColor(kV0AColorFib);
1301 TGeoVolume *v0AFib6 = new TGeoVolumeAssembly("V0AFib6");
1302 v0AFib6->AddNode(v0AFib16Hole,1);
1303 v0AFib6->AddNode(v0AFib26Hole,1);
1304 v0ASec6->AddNode(v0AFib6,1);
11ea46b9 1305
1306 /// Non-sensitive scintilator
a8b5076e 1307 new TGeoTubeSeg("sV0AR5S26", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 225.0, 270.0);
11ea46b9 1308 TGeoCompositeShape *sV0AR56 = new TGeoCompositeShape("V0AR56","sV0AR5S26 - sV0ACha6");
1309 TGeoVolume *v0AR56 = new TGeoVolume("V0AR56",sV0AR56,medV0ASci);
1310 v0AR56->SetLineColor(kV0AColorSci);
1311 v0ASci6->AddNode(v0AR56,1);
1312 v0ASec6->AddNode(v0ASci6,1);
1313
a8b5076e 1314 /// Segment of octagon
11ea46b9 1315 for (int i=0;i<2;i++) {
1316 v0APts[0+8*i] = 0.; v0APts[1+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
1317 v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR7*sin654;
1318 v0APts[4+8*i] = -fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
1319 v0APts[6+8*i] = -(fV0AR7-fV0AOctH2)*cos654; v0APts[7+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
1320 }
1321 TGeoArb8 *sV0AOct26 = new TGeoArb8("sV0AOct26", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
1322 TGeoVolume *v0AOct26 = new TGeoVolume("V0AOct26", sV0AOct26,medV0ASup);
1323 v0AOct26->SetLineColor(kV0AColorOct);
a8b5076e 1324 TGeoVolume *v0ASup6 = new TGeoVolumeAssembly("V0ASup6");
11ea46b9 1325 v0ASup6->AddNode(v0AOct26,1);
1326 v0ASec6->AddNode(v0ASup6,1);
1327
11ea46b9 1328 /// Plates
11ea46b9 1329 for (int i=0;i<2;i++) {
1330 v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR0;
1331 v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR7*sin654;
1332 v0APts[4+8*i] = -fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
1333 v0APts[6+8*i] = -fV0AR0*cos654; v0APts[7+8*i] = -fV0AR0*sin654;
1334 }
1335 new TGeoArb8("sV0APlaIn6", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
1336 TGeoCompositeShape *sV0APlaInNailsHoles6 = new TGeoCompositeShape("sV0APlaInNailsHoles6","sV0APlaIn6-sV0ANail1PlaInHole6:pos16");
1337 TGeoVolume *v0APlaInNailsHoles6 = new TGeoVolume("V0APlaInNailsHoles6", sV0APlaInNailsHoles6, medV0APlaIn);
1338 new TGeoArb8("sV0APlaOu6", fV0APlaAl/2., v0APts);
1339 TGeoCompositeShape *sV0APlaOuNailsHoles6 = new TGeoCompositeShape("sV0APlaOuNailsHoles6","sV0APlaOu6-sV0ANail1PlaOuHole6:pos16");
1340 TGeoVolume *v0APlaOuNailsHoles6 = new TGeoVolume("V0APlaOuNailsHoles6", sV0APlaOuNailsHoles6, medV0APlaOu);
1341 v0APlaInNailsHoles6->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles6->SetLineColor(kV0AColorPlaOu);
1342 TGeoVolume *v0APla6 = new TGeoVolumeAssembly("V0APla6");
1343 v0APla6->AddNode(v0APlaInNailsHoles6,1);
1344 v0APla6->AddNode(v0APlaOuNailsHoles6,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
1345 v0APla6->AddNode(v0APlaOuNailsHoles6,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
1346 v0ASec6->AddNode(v0APla6,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1347 v0ASec6->AddNode(v0APla6,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1348
a8b5076e 1349 /// PMBox
1350 TGeoVolume* v0APM6 = new TGeoVolumeAssembly("V0APM6");
1351 new TGeoBBox("sV0APMB16", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
1352 new TGeoBBox("sV0APMB26", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
1353 TGeoCompositeShape *sV0APMB6 = new TGeoCompositeShape("sV0APMB6","sV0APMB16-sV0APMB26");
1354 TGeoVolume *v0APMB6 = new TGeoVolume("V0APMB6",sV0APMB6, medV0APMAlum);
1355 v0APMB6->SetLineColor(kV0AColorPMA);
1356 v0APM6->AddNode(v0APMB6,1);
1357
1358 /// PMTubes
1359 TGeoTube *sV0APMT16 = new TGeoTube("sV0APMT16", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
1360 TGeoVolume *v0APMT16 = new TGeoVolume("V0APMT16", sV0APMT16, medV0APMGlass);
1361 TGeoTube *sV0APMT26 = new TGeoTube("sV0APMT26", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
1362 TGeoVolume *v0APMT26 = new TGeoVolume("V0APMT26", sV0APMT26, medV0APMAlum);
1363 TGeoVolume *v0APMT6 = new TGeoVolumeAssembly("V0APMT6");
1364 TGeoTube *sV0APMTT6 = new TGeoTube("sV0APMTT6", 0., fV0APMTR4, fV0APMTB/2.);
1365 TGeoVolume *v0APMTT6 = new TGeoVolume("V0APMTT6", sV0APMTT6, medV0APMAlum);
1366 v0APMT6->SetLineColor(kV0AColorPMG);
1367 v0APMT26->SetLineColor(kV0AColorPMA);
1368 v0APMTT6->SetLineColor(kV0AColorPMA);
1369 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
1370 v0APMT6->AddNode(v0APMT16,1,rot);
1371 v0APMT6->AddNode(v0APMT26,1,rot);
1372 v0APMT6->AddNode(v0APMTT6,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
1373 double autoShift6 = (fV0APMBWd-2*fV0APMBWdW)/4.;
1374 v0APM6->AddNode(v0APMT6, 1, new TGeoTranslation(-1.5*autoShift6, 0, 0));
1375 v0APM6->AddNode(v0APMT6, 2, new TGeoTranslation(-0.5*autoShift6, 0, 0));
1376 v0APM6->AddNode(v0APMT6, 3, new TGeoTranslation(+0.5*autoShift6, 0, 0));
1377 v0APM6->AddNode(v0APMT6, 4, new TGeoTranslation(+1.5*autoShift6, 0, 0));
1378
1379 /// PM
1380 rot = new TGeoRotation("rot");
1381 rot->RotateX(-90+30);
1382 rot->RotateY(0);
1383 rot->RotateZ(-65-3);
1384 double cosAngPMB6 = TMath::Cos(fV0APMBAng*TMath::DegToRad());
1385 double sinAngPMB6 = TMath::Sin(fV0APMBAng*TMath::DegToRad());
1386 double shiftZ6 = fV0APMBHt/2. * cosAngPMB6
1387 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB6;
1388 double shiftR6 = fV0AR6 + fV0AR1 + fV0AOctWd + fV0APlaAl/3.;
1389 v0ASec6->AddNode(v0APM6,1, new TGeoCombiTrans( -shiftR6*cos45-1.3, -shiftR6*sin45, shiftZ6, rot));
1390
11ea46b9 1391 /// Support
a8b5076e 1392 TGeoBBox *sV0ASuppbl = new TGeoBBox("sV0ASuppbl", 2.0, 18.13, fV0ASciWd/2.);
11ea46b9 1393 TGeoVolume *v0ASuppbl = new TGeoVolume("V0ASuppbl", sV0ASuppbl, medV0ASup);
1394 v0ASuppbl->SetLineColor(kV0AColorOct);
a8b5076e 1395 v0ASec6->AddNode(v0ASuppbl,1,new TGeoTranslation(-2.0,-63.64,0.0));
1396
1397 // Aluminium nail
1398 TGeoTube *sV0ANail61 = new TGeoTube("sV0ANail61", 0.0, 0.4, 5.09/2.);
1399 TGeoVolume *v0ANail61 = new TGeoVolume("V0ANail61", sV0ANail61, medV0APMAlum);
1400 v0ANail61->SetLineColor(kV0AColorPMA);// this is the color for aluminium
1401 v0ASec6->AddNode(v0ANail61,1,new TGeoTranslation(-0.51,-42.9,0.0));
1402 TGeoTube *sV0ANail62 = new TGeoTube("sV0ANail62", 0.0, 0.4, 5.09/2.);
1403 TGeoVolume *v0ANail62 = new TGeoVolume("V0ANail62", sV0ANail62, medV0APMAlum);
1404 v0ANail62->SetLineColor(kV0AColorPMA);
1405 v0ASec6->AddNode(v0ANail62,1,new TGeoTranslation(-30.05,-30.79,0.0));
1406
1407 // Adding sector to v0LE volume
1408 v0LE->AddNode(v0ASec6, 1);
1409
1410
f316b8fc 1411 //Definition of sector 7
11ea46b9 1412 TGeoVolume *v0ASec7 = new TGeoVolumeAssembly("V0ASec7");
1413
1414 /// For boolean sustraction
1415 double preShape7 = 0.2;
1416 for (int i=0;i<2;i++) {
1417 v0APts[0+8*i] = 0.0; v0APts[1+8*i] = -fV0AR0+fV0AFraWd/2.-preShape7;
1418 v0APts[2+8*i] = fV0AFraWd/2.; v0APts[3+8*i] = -fV0AR0+fV0AFraWd/2.-preShape7;
1419 v0APts[4+8*i] = fV0AFraWd/2.; v0APts[5+8*i] = -fV0AR4-fV0AFraWd/2.+preShape7;
1420 v0APts[6+8*i] = 0.0; v0APts[7+8*i] = -fV0AR4-fV0AFraWd/2.+preShape7;
1421 }
1422 new TGeoArb8("sV0ACha17",fV0ASciWd/1.5,v0APts);
1423 for (int i=0;i<2;i++) {
a32c7883 1424 v0APts[0+8*i] = (fV0AR0-fV0AFraWd/2.)*cos45-preShape7;
1425 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
1426 v0APts[2+8*i] = fV0AR0*cos45-preShape7;
1427 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape7;
1428 v0APts[4+8*i] = (fV0AR4+fV0AFraWd)*cos45+preShape7;
1429 v0APts[5+8*i] = -fV0AR4*sin45-preShape7;
1430 v0APts[6+8*i] = (fV0AR4+fV0AFraWd/2.)*cos45+preShape7;
1431 v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-2.*preShape7;
11ea46b9 1432 }
1433 new TGeoArb8("sV0ACha27", fV0ASciWd/2.+2.*preShape, v0APts);
1434 new TGeoCompositeShape("sV0ACha127","sV0ACha17+sV0ACha27");
1435 new TGeoTube("sV0ANail17Hole", 0.0, 0.4, 1.65);
1436 TGeoTranslation *pos17 = new TGeoTranslation("pos17",0.51,-42.9,0.0);
1437 pos17->RegisterYourself();
a8b5076e 1438 new TGeoTube("sV0ANail27Hole", 0.0, 0.4, 1.65);
1439 TGeoTranslation *pos27 = new TGeoTranslation("pos27",30.05,-30.79,0.0);
1440 pos27->RegisterYourself();
1441 new TGeoCompositeShape("sV0ANailsHoles7","sV0ANail17Hole:pos17+sV0ANail27Hole:pos27");
1442 new TGeoCompositeShape("sV0ACha7","sV0ACha127+sV0ANailsHoles7");
1443 new TGeoTubeSeg("sV0AFicR57", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 270.0, 315.0);
1444 new TGeoTube("sV0ANail1PlaInHole7", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
1445 new TGeoTube("sV0ANail1PlaOuHole7", 0.0, 0.4, (fV0APlaAl)/2.);
11ea46b9 1446
1447 /// Frame
1448 TGeoVolume *v0AFra7 = new TGeoVolumeAssembly("V0AFra7");
1449 for (int i=0;i<2;i++) {
1450 v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR0-fV0AFraWd/2.;
1451 v0APts[2+8*i] = fV0AFraWd/2.; v0APts[3+8*i] = -fV0AR0-fV0AFraWd/2.;
1452 v0APts[4+8*i] = fV0AFraWd/2.; v0APts[5+8*i] = -fV0AR4+fV0AFraWd/2.;
1453 v0APts[6+8*i] = 0.; v0APts[7+8*i] = -fV0AR4+fV0AFraWd/2.;
1454 }
1455 TGeoArb8 *sV0AFraB17 = new TGeoArb8("sV0AFraB17",fV0ASciWd/2.,v0APts);
1456 TGeoVolume *v0AFraB17 = new TGeoVolume("V0AFraB17",sV0AFraB17,medV0AFra);
1457 for (int i=0;i<2;i++) {
a32c7883 1458 v0APts[0+8*i] = fV0AR0*cos45-fV0AFraWd;
1459 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd)*sin45;
a8b5076e 1460 v0APts[2+8*i] = (fV0AR0-fV0AFraWd/2.)*cos45;
1461 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
93f5bf1d 1462 v0APts[4+8*i] = (fV0AR4+fV0AFraWd/2.)*cos45/2.;
a32c7883 1463 v0APts[5+8*i] = -fV0AR4*sin45/2.;
1464 v0APts[6+8*i] = (fV0AR4+fV0AFraWd/4.)*cos45/2.;
1465 v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45/2.;
11ea46b9 1466 }
1467 TGeoArb8 *sV0AFraB27 = new TGeoArb8("sV0AFraB27", fV0ASciWd/2., v0APts);
1468 TGeoVolume *v0AFraB27 = new TGeoVolume("V0AFraB27",sV0AFraB27,medV0AFra);
1469 v0AFraB17->SetLineColor(kV0AColorFra); v0AFraB27->SetLineColor(kV0AColorFra);
1470 v0AFra7->AddNode(v0AFraB17,1);
1471 v0AFra7->AddNode(v0AFraB27,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
1472 new TGeoTubeSeg( "sV0AFraR1b7", fV0AR0-fV0AFraWd/2.,
a8b5076e 1473 fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1474 new TGeoTubeSeg( "sV0AFraR2b7", fV0AR1-fV0AFraWd/2.,
a8b5076e 1475 fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1476 new TGeoTubeSeg( "sV0AFraR3b7", fV0AR2-fV0AFraWd/2.,
a8b5076e 1477 fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1478 new TGeoTubeSeg( "sV0AFraR4b7", fV0AR3-fV0AFraWd/2.,
a8b5076e 1479 fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1480 new TGeoTubeSeg( "sV0AFraR5b7", fV0AR4-fV0AFraWd/2.,
a8b5076e 1481 fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1482 TGeoCompositeShape *sV0AFraR17 = new TGeoCompositeShape("sV0AFraR17","sV0AFraR1b7-sV0ACha7");
1483 TGeoCompositeShape *sV0AFraR27 = new TGeoCompositeShape("sV0AFraR27","sV0AFraR2b7-sV0ACha7");
1484 TGeoCompositeShape *sV0AFraR37 = new TGeoCompositeShape("sV0AFraR37","sV0AFraR3b7-sV0ACha7");
1485 TGeoCompositeShape *sV0AFraR47 = new TGeoCompositeShape("sV0AFraR47","sV0AFraR4b7-sV0ACha7");
1486 TGeoCompositeShape *sV0AFraR57 = new TGeoCompositeShape("sV0AFraR57","sV0AFraR5b7-sV0ACha7");
1487 TGeoVolume *v0AFraR17 = new TGeoVolume("V0AFraR17",sV0AFraR17,medV0AFra);
1488 TGeoVolume *v0AFraR27 = new TGeoVolume("V0AFraR27",sV0AFraR27,medV0AFra);
1489 TGeoVolume *v0AFraR37 = new TGeoVolume("V0AFraR37",sV0AFraR37,medV0AFra);
1490 TGeoVolume *v0AFraR47 = new TGeoVolume("V0AFraR47",sV0AFraR47,medV0AFra);
1491 TGeoVolume *v0AFraR57 = new TGeoVolume("V0AFraR57",sV0AFraR57,medV0AFra);
1492 v0AFraR17->SetLineColor(kV0AColorFra); v0AFraR27->SetLineColor(kV0AColorFra);
1493 v0AFraR37->SetLineColor(kV0AColorFra); v0AFraR47->SetLineColor(kV0AColorFra);
1494 v0AFraR57->SetLineColor(kV0AColorFra);
1495 v0AFra7->AddNode(v0AFraR17,1);
1496 v0AFra7->AddNode(v0AFraR27,1);
1497 v0AFra7->AddNode(v0AFraR37,1);
1498 v0AFra7->AddNode(v0AFraR47,1);
1499 v0AFra7->AddNode(v0AFraR57,1);
1500 v0ASec7->AddNode(v0AFra7,1);
1501
1502 /// Sensitive scintilator
1503 TGeoVolume *v0ASci7 = new TGeoVolumeAssembly("V0ASci7");
1504 new TGeoTubeSeg( "sV0AR1b7", fV0AR0+fV0AFraWd/2.,
a8b5076e 1505 fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1506 new TGeoTubeSeg( "sV0AR2b7", fV0AR1+fV0AFraWd/2.,
a8b5076e 1507 fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1508 new TGeoTubeSeg( "sV0AR3b7", fV0AR2+fV0AFraWd/2.,
a8b5076e 1509 fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1510 new TGeoTubeSeg( "sV0AR4b7", fV0AR3+fV0AFraWd/2.,
a8b5076e 1511 fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 270.0, 315.0);
11ea46b9 1512 TGeoCompositeShape *sV0AR17 = new TGeoCompositeShape("sV0AR17","sV0AR1b7-sV0ACha7");
1513 TGeoCompositeShape *sV0AR27 = new TGeoCompositeShape("sV0AR27","sV0AR2b7-sV0ACha7");
1514 TGeoCompositeShape *sV0AR37 = new TGeoCompositeShape("sV0AR37","sV0AR3b7-sV0ACha7");
1515 TGeoCompositeShape *sV0AR47 = new TGeoCompositeShape("sV0AR47","sV0AR4b7-sV0ACha7");
1516 TGeoVolume *v0L17 = new TGeoVolume("V0L17",sV0AR17,medV0ASci);
1517 TGeoVolume *v0L27 = new TGeoVolume("V0L27",sV0AR27,medV0ASci);
1518 TGeoVolume *v0L37 = new TGeoVolume("V0L37",sV0AR37,medV0ASci);
1519 TGeoVolume *v0L47 = new TGeoVolume("V0L47",sV0AR47,medV0ASci);
1520 v0L17->SetLineColor(kV0AColorSci); v0L27->SetLineColor(kV0AColorSci);
1521 v0L37->SetLineColor(kV0AColorSci); v0L47->SetLineColor(kV0AColorSci);
1522 v0ASci7->AddNode(v0L17,1);
1523 v0ASci7->AddNode(v0L27,1);
1524 v0ASci7->AddNode(v0L37,1);
1525 v0ASci7->AddNode(v0L47,1);
a8b5076e 1526
1527 // Bunch of fibers
1528 for (int i=0;i<2;i++) {
1529 v0APts[0+8*i] = -10.0; v0APts[1+8*i] = 13.1;
1530 v0APts[2+8*i] = 10.0; v0APts[3+8*i] = 13.1;
1531 v0APts[4+8*i] = 8.0; v0APts[5+8*i] = -29.0;
1532 v0APts[6+8*i] = -12.0; v0APts[7+8*i] = -12.0;
1533 }
1534 new TGeoArb8("sV0AFib17", 0.01, v0APts);
1535 rot = new TGeoRotation("rot");
1536 rot->RotateX(-2.0);
1537 rot->RotateY(0.0);
1538 rot->RotateZ(248.0);
1539 TGeoCombiTrans *fib17pos = new TGeoCombiTrans("fib17pos", 40.0 - 3.3, -50.0 + 1.5, 0.5, rot);
1540 fib17pos->RegisterYourself();
1541 TGeoCompositeShape *sV0AFib17Hole = new TGeoCompositeShape("sV0AFib17Hole", "sV0AFib17:fib17pos-sV0AFicR57");
1542 TGeoVolume *v0AFib17Hole = new TGeoVolume("V0AFib17Hole",sV0AFib17Hole,medV0AFib);
1543 v0AFib17Hole->SetLineColor(kV0AColorFib);
1544 new TGeoArb8("sV0AFib27", 0.01, v0APts);
1545 rot = new TGeoRotation("rot");
1546 rot->RotateX(2.0);
1547 rot->RotateY(0.0);
1548 rot->RotateZ(248.0);
1549 TGeoCombiTrans *fib27pos = new TGeoCombiTrans("fib27pos", 40.0 - 3.3, -50.0 + 1.5, -0.5, rot);
1550 fib27pos->RegisterYourself();
1551 TGeoCompositeShape *sV0AFib27Hole = new TGeoCompositeShape("sV0AFib27Hole", "sV0AFib27:fib27pos-sV0AFicR57");
1552 TGeoVolume *v0AFib27Hole = new TGeoVolume("V0AFib27Hole",sV0AFib27Hole,medV0AFib);
1553 v0AFib27Hole->SetLineColor(kV0AColorFib);
1554 TGeoVolume *v0AFib7 = new TGeoVolumeAssembly("V0AFib7");
1555 v0AFib7->AddNode(v0AFib17Hole,1);
1556 v0AFib7->AddNode(v0AFib27Hole,1);
1557 v0ASec7->AddNode(v0AFib7,1);
11ea46b9 1558
1559 /// Non-sensitive scintilator
a8b5076e 1560 new TGeoTubeSeg("sV0AR5S27", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 270.0, 315.0);
11ea46b9 1561 TGeoCompositeShape *sV0AR57 = new TGeoCompositeShape("V0AR57","sV0AR5S27 - sV0ACha7");
1562 TGeoVolume *v0AR57 = new TGeoVolume("V0AR57",sV0AR57,medV0ASci);
1563 v0AR57->SetLineColor(kV0AColorSci);
1564 v0ASci7->AddNode(v0AR57,1);
1565 v0ASec7->AddNode(v0ASci7,1);
1566
a8b5076e 1567 /// Segment of octagon
11ea46b9 1568 for (int i=0;i<2;i++) {
a32c7883 1569 v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR7*sin654;
1570 v0APts[2+8*i] = 0.; v0APts[3+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
1571 v0APts[4+8*i] = (fV0AR7-fV0AOctH2)*cos654; v0APts[5+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
1572 v0APts[6+8*i] = fV0AR7*cos654; v0APts[7+8*i] = -fV0AR7*sin654;
11ea46b9 1573 }
1574 TGeoArb8 *sV0AOct27 = new TGeoArb8("sV0AOct27", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
1575 TGeoVolume *v0AOct27 = new TGeoVolume("V0AOct27", sV0AOct27,medV0ASup);
1576 v0AOct27->SetLineColor(kV0AColorOct);
a8b5076e 1577 TGeoVolume *v0ASup7 = new TGeoVolumeAssembly("V0ASup7");
11ea46b9 1578 v0ASup7->AddNode(v0AOct27,1);
1579 v0ASec7->AddNode(v0ASup7,1);
1580
11ea46b9 1581 /// Plates
11ea46b9 1582 for (int i=0;i<2;i++) {
a32c7883 1583 v0APts[0+8*i] = 0.; v0APts[1+8*i] = -fV0AR7*sin654;
1584 v0APts[2+8*i] = 0.; v0APts[3+8*i] = -fV0AR0;
1585 v0APts[4+8*i] = fV0AR0*cos654; v0APts[5+8*i] = -fV0AR0*sin654;
1586 v0APts[6+8*i] = fV0AR7*cos654; v0APts[7+8*i] = -fV0AR7*sin654;
11ea46b9 1587 }
1588 new TGeoArb8("sV0APlaIn7", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
1589 TGeoCompositeShape *sV0APlaInNailsHoles7 = new TGeoCompositeShape("sV0APlaInNailsHoles7","sV0APlaIn7-sV0ANail1PlaInHole7:pos17");
1590 TGeoVolume *v0APlaInNailsHoles7 = new TGeoVolume("V0APlaInNailsHoles7", sV0APlaInNailsHoles7, medV0APlaIn);
1591 new TGeoArb8("sV0APlaOu7", fV0APlaAl/2., v0APts);
1592 TGeoCompositeShape *sV0APlaOuNailsHoles7 = new TGeoCompositeShape("sV0APlaOuNailsHoles7","sV0APlaOu7-sV0ANail1PlaOuHole7:pos17");
1593 TGeoVolume *v0APlaOuNailsHoles7 = new TGeoVolume("V0APlaOuNailsHoles7", sV0APlaOuNailsHoles7, medV0APlaOu);
1594 v0APlaInNailsHoles7->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles7->SetLineColor(kV0AColorPlaOu);
1595 TGeoVolume *v0APla7 = new TGeoVolumeAssembly("V0APla7");
1596 v0APla7->AddNode(v0APlaInNailsHoles7,1);
1597 v0APla7->AddNode(v0APlaOuNailsHoles7,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
1598 v0APla7->AddNode(v0APlaOuNailsHoles7,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
1599 v0ASec7->AddNode(v0APla7,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1600 v0ASec7->AddNode(v0APla7,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
a8b5076e 1601
1602 /// PMBox
1603 TGeoVolume* v0APM7 = new TGeoVolumeAssembly("V0APM7");
1604 new TGeoBBox("sV0APMB17", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
1605 new TGeoBBox("sV0APMB27", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
1606 TGeoCompositeShape *sV0APMB7 = new TGeoCompositeShape("sV0APMB7","sV0APMB17-sV0APMB27");
1607 TGeoVolume *v0APMB7 = new TGeoVolume("V0APMB7",sV0APMB7, medV0APMAlum);
1608 v0APMB7->SetLineColor(kV0AColorPMA);
1609 v0APM7->AddNode(v0APMB7,1);
f316b8fc 1610
a8b5076e 1611 /// PMTubes
1612 TGeoTube *sV0APMT17 = new TGeoTube("sV0APMT17", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
1613 TGeoVolume *v0APMT17 = new TGeoVolume("V0APMT17", sV0APMT17, medV0APMGlass);
1614 TGeoTube *sV0APMT27 = new TGeoTube("sV0APMT27", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
1615 TGeoVolume *v0APMT27 = new TGeoVolume("V0APMT27", sV0APMT27, medV0APMAlum);
1616 TGeoVolume *v0APMT7 = new TGeoVolumeAssembly("V0APMT7"); // pk si no choca con la 752 o con la 794
1617 TGeoTube *sV0APMTT7 = new TGeoTube("sV0APMTT7", 0., fV0APMTR4, fV0APMTB/2.);
1618 TGeoVolume *v0APMTT7 = new TGeoVolume("V0APMTT7", sV0APMTT7, medV0APMAlum);
1619 v0APMT7->SetLineColor(kV0AColorPMG);
1620 v0APMT27->SetLineColor(kV0AColorPMA);
1621 v0APMTT7->SetLineColor(kV0AColorPMA);
1622 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
1623 v0APMT7->AddNode(v0APMT17,1,rot);
1624 v0APMT7->AddNode(v0APMT27,1,rot);
1625 v0APMT7->AddNode(v0APMTT7,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
1626 v0APM7->AddNode(v0APMT7, 1, new TGeoTranslation(-1.5*autoShift, 0, 0));
1627 v0APM7->AddNode(v0APMT7, 2, new TGeoTranslation(-0.5*autoShift, 0, 0));
1628 v0APM7->AddNode(v0APMT7, 3, new TGeoTranslation(+0.5*autoShift, 0, 0));
1629 v0APM7->AddNode(v0APMT7, 4, new TGeoTranslation(+1.5*autoShift, 0, 0));
1630
1631 /// PM
1632 rot = new TGeoRotation("rot");
1633 rot->RotateX(-90+30);
1634 rot->RotateY(0);
1635 rot->RotateZ(65+3);
1636 double shiftZ7 = fV0APMBHt/2. * cosAngPMB
1637 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB;
1638 double shiftR7 = fV0AR6 + fV0AR1 + fV0AOctWd + fV0APlaAl/3.;
f316b8fc 1639 v0ASec7->AddNode(v0APM7,1, new TGeoCombiTrans( shiftR7*cos45+1.3, -shiftR7*sin45, shiftZ7, rot));
a8b5076e 1640
1641 // Aluminium nail
1642 TGeoTube *sV0ANail71 = new TGeoTube("sV0ANail71", 0.0, 0.4, 5.09/2.);
1643 TGeoVolume *v0ANail71 = new TGeoVolume("V0ANail71", sV0ANail71, medV0APMAlum);
1644 v0ANail71->SetLineColor(kV0AColorPMA);// this is the color for aluminium
1645 v0ASec7->AddNode(v0ANail71,1,new TGeoTranslation(0.51,-42.9,0.0));
1646 TGeoTube *sV0ANail72 = new TGeoTube("sV0ANail72", 0.0, 0.4, 5.09/2.);
1647 TGeoVolume *v0ANail72 = new TGeoVolume("V0ANail72", sV0ANail72, medV0APMAlum);
1648 v0ANail72->SetLineColor(kV0AColorPMA);
1649 v0ASec7->AddNode(v0ANail72,1,new TGeoTranslation(30.05,-30.79,0.0));
1650
1651 // Support
1652 TGeoBBox *sV0ASuppbr = new TGeoBBox("sV0ASuppbr", 2.0, 18.13, fV0ASciWd/2.);
11ea46b9 1653 TGeoVolume *v0ASuppbr = new TGeoVolume("V0ASuppbr", sV0ASuppbr, medV0ASup);
1654 v0ASuppbr->SetLineColor(kV0AColorOct);
a8b5076e 1655 v0ASec7->AddNode(v0ASuppbr,1,new TGeoTranslation(2.0,-63.64,0.0));
11ea46b9 1656
a8b5076e 1657 // Adding sector to v0LE volume
1658 v0LE->AddNode(v0ASec7,1);
f316b8fc 1659
11ea46b9 1660
a8b5076e 1661 //Definition of sector 8
1662 TGeoVolume *v0ASec8 = new TGeoVolumeAssembly("V0ASec8");
f316b8fc 1663
1664 /// For boolean sustraction
11ea46b9 1665 for (int i=0;i<2;i++) {
a32c7883 1666 v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[1+8*i] = -2*preShape;
1667 v0APts[2+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[3+8*i] = 0.0;
1668 v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[5+8*i] = 0.0;
1669 v0APts[6+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[7+8*i] = -2*preShape;
11ea46b9 1670 }
1671 new TGeoArb8("sV0ACha18",fV0ASciWd/1.5,v0APts);
1672 for (int i=0;i<2;i++) {
a32c7883 1673 v0APts[0+8*i] = (fV0AR0-fV0AFraWd/2.)*sin45-preShape;
1674 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
1675 v0APts[2+8*i] = fV0AR0*sin45-fV0AFraWd/2.-preShape;
1676 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd)*sin45+preShape;
1677 v0APts[4+8*i] = (fV0AR4+3*fV0AFraWd/2.)*sin45+preShape;
1678 v0APts[5+8*i] = -fV0AR4*sin45-preShape;
1679 v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45+preShape;
1680 v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45-2.*preShape;
11ea46b9 1681 }
1682 new TGeoArb8("sV0ACha28", fV0ASciWd/2.+2.*preShape, v0APts);
1683 new TGeoCompositeShape("sV0ACha128","sV0ACha18+sV0ACha28");
1684 new TGeoTube("sV0ANail18Hole", 0.0, 0.4, 1.65);
1685 TGeoTranslation *pos18 = new TGeoTranslation("pos18",42.9,-.51,0.0);
1686 pos18->RegisterYourself();
1687 new TGeoTube("sV0ANail28Hole", 0.0, 0.4, 1.65);
a8b5076e 1688 TGeoTranslation *pos28 = new TGeoTranslation("pos28",30.8,-30.04,0.0);
1689 pos28->RegisterYourself();
1690 TGeoTranslation *pos38 = new TGeoTranslation("pos38",30.05,-30.79,0.0);
11ea46b9 1691 pos38->RegisterYourself();
a8b5076e 1692 new TGeoCompositeShape("sV0ANailsHoles8","sV0ANail18Hole:pos18+sV0ANail28Hole:pos28");
11ea46b9 1693 new TGeoCompositeShape("sV0ACha8","sV0ACha128+sV0ANailsHoles8");
a8b5076e 1694 new TGeoTubeSeg("sV0AFicR58", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2. +2*preShape, 315.0, 360.0);
1695 new TGeoTube("sV0ANail1PlaInHole8", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
1696 new TGeoTube("sV0ANail2PlaInHole8", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
1697 new TGeoTube("sV0ANail3PlaInHole8", 0.0, 0.4, (fV0APlaWd-2*fV0APlaAl)/2.);
1698 new TGeoCompositeShape("sV0ANailsPlaInHoles8","sV0ANail1PlaInHole8:pos18+sV0ANail2PlaInHole8:pos28+sV0ANail3PlaInHole8:pos38");
1699 new TGeoTube("sV0ANail1PlaOuHole8", 0.0, 0.4, (fV0APlaAl)/2.);
1700 new TGeoTube("sV0ANail2PlaOuHole8", 0.0, 0.4, (fV0APlaAl)/2.);
1701 new TGeoTube("sV0ANail3PlaOuHole8", 0.0, 0.4, (fV0APlaAl)/2.);
1702 new TGeoCompositeShape("sV0ANailsPlaOuHoles8","sV0ANail1PlaOuHole8:pos18+sV0ANail2PlaOuHole8:pos28+sV0ANail3PlaOuHole8:pos38");
f316b8fc 1703
1704 /// Frame
1705 TGeoVolume *v0AFra8 = new TGeoVolumeAssembly("V0AFra8");
11ea46b9 1706 for (int i=0;i<2;i++) {
a8b5076e 1707 v0APts[0+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[1+8*i] = 0.0;
a32c7883 1708 v0APts[2+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[3+8*i] = 0.0;
93f5bf1d 1709 v0APts[4+8*i] = fV0AR4+fV0AFraWd/2.; v0APts[5+8*i] = -fV0AFraWd/8.;
a32c7883 1710 v0APts[6+8*i] = fV0AR0-fV0AFraWd/2.; v0APts[7+8*i] = -fV0AFraWd/8.;
a8b5076e 1711 }
11ea46b9 1712 TGeoArb8 *sV0AFraB18 = new TGeoArb8("sV0AFraB18",fV0ASciWd/2.,v0APts);
f316b8fc 1713 TGeoVolume *v0AFraB18 = new TGeoVolume("V0AFraB18",sV0AFraB18,medV0AFra);
11ea46b9 1714 for (int i=0;i<2;i++) {
a32c7883 1715 v0APts[0+8*i] = (fV0AR0-fV0AFraWd/4.)*sin45;
1716 v0APts[1+8*i] = -(fV0AR0-fV0AFraWd/2.)*sin45;
1717 v0APts[2+8*i] = fV0AR0*sin45-fV0AFraWd/2.;
1718 v0APts[3+8*i] = -(fV0AR0-fV0AFraWd)*sin45;
1719 v0APts[4+8*i] = (fV0AR4+3*fV0AFraWd/2.)*sin45/2.;
1720 v0APts[5+8*i] = -fV0AR4*sin45/2.;
93f5bf1d 1721 v0APts[6+8*i] = (fV0AR4+fV0AFraWd)*sin45/2.;
a32c7883 1722 v0APts[7+8*i] = -(fV0AR4+fV0AFraWd/2.)*sin45/2.;
11ea46b9 1723 }
1724 TGeoArb8 *sV0AFraB28 = new TGeoArb8("sV0AFraB28", fV0ASciWd/2., v0APts);
1725 TGeoVolume *v0AFraB28 = new TGeoVolume("V0AFraB28",sV0AFraB28,medV0AFra);
1726 v0AFraB18->SetLineColor(kV0AColorFra); v0AFraB28->SetLineColor(kV0AColorFra);
1727 v0AFra8->AddNode(v0AFraB18,1);
1728 v0AFra8->AddNode(v0AFraB28,1); // Prefer 2 GeoObjects insted of 3 GeoMovements
1729 new TGeoTubeSeg( "sV0AFraR1b8", fV0AR0-fV0AFraWd/2.,
a8b5076e 1730 fV0AR0+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1731 new TGeoTubeSeg( "sV0AFraR2b8", fV0AR1-fV0AFraWd/2.,
a8b5076e 1732 fV0AR1+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1733 new TGeoTubeSeg( "sV0AFraR3b8", fV0AR2-fV0AFraWd/2.,
a8b5076e 1734 fV0AR2+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1735 new TGeoTubeSeg( "sV0AFraR4b8", fV0AR3-fV0AFraWd/2.,
a8b5076e 1736 fV0AR3+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1737 new TGeoTubeSeg( "sV0AFraR5b8", fV0AR4-fV0AFraWd/2.,
a8b5076e 1738 fV0AR4+fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1739 TGeoCompositeShape *sV0AFraR18 = new TGeoCompositeShape("sV0AFraR18","sV0AFraR1b8-sV0ACha8");
1740 TGeoCompositeShape *sV0AFraR28 = new TGeoCompositeShape("sV0AFraR28","sV0AFraR2b8-sV0ACha8");
1741 TGeoCompositeShape *sV0AFraR38 = new TGeoCompositeShape("sV0AFraR38","sV0AFraR3b8-sV0ACha8");
1742 TGeoCompositeShape *sV0AFraR48 = new TGeoCompositeShape("sV0AFraR48","sV0AFraR4b8-sV0ACha8");
1743 TGeoCompositeShape *sV0AFraR58 = new TGeoCompositeShape("sV0AFraR58","sV0AFraR5b8-sV0ACha8");
1744 TGeoVolume *v0AFraR18 = new TGeoVolume("V0AFraR18",sV0AFraR18,medV0AFra);
1745 TGeoVolume *v0AFraR28 = new TGeoVolume("V0AFraR28",sV0AFraR28,medV0AFra);
1746 TGeoVolume *v0AFraR38 = new TGeoVolume("V0AFraR38",sV0AFraR38,medV0AFra);
1747 TGeoVolume *v0AFraR48 = new TGeoVolume("V0AFraR48",sV0AFraR48,medV0AFra);
1748 TGeoVolume *v0AFraR58 = new TGeoVolume("V0AFraR58",sV0AFraR58,medV0AFra);
1749 v0AFraR18->SetLineColor(kV0AColorFra); v0AFraR28->SetLineColor(kV0AColorFra);
1750 v0AFraR38->SetLineColor(kV0AColorFra); v0AFraR48->SetLineColor(kV0AColorFra);
1751 v0AFraR58->SetLineColor(kV0AColorFra);
1752 v0AFra8->AddNode(v0AFraR18,1);
1753 v0AFra8->AddNode(v0AFraR28,1);
1754 v0AFra8->AddNode(v0AFraR38,1);
1755 v0AFra8->AddNode(v0AFraR48,1);
1756 v0AFra8->AddNode(v0AFraR58,1);
1757 v0ASec8->AddNode(v0AFra8,1);
1758
1759 /// Sensitive scintilator
1760 TGeoVolume *v0ASci8 = new TGeoVolumeAssembly("V0ASci8");
1761 new TGeoTubeSeg( "sV0AR1b8", fV0AR0+fV0AFraWd/2.,
a8b5076e 1762 fV0AR1-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1763 new TGeoTubeSeg( "sV0AR2b8", fV0AR1+fV0AFraWd/2.,
a8b5076e 1764 fV0AR2-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1765 new TGeoTubeSeg( "sV0AR3b8", fV0AR2+fV0AFraWd/2.,
a8b5076e 1766 fV0AR3-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1767 new TGeoTubeSeg( "sV0AR4b8", fV0AR3+fV0AFraWd/2.,
a8b5076e 1768 fV0AR4-fV0AFraWd/2., fV0ASciWd/2., 315.0, 360.0);
11ea46b9 1769 TGeoCompositeShape *sV0AR18 = new TGeoCompositeShape("sV0AR18","sV0AR1b8-sV0ACha8");
1770 TGeoCompositeShape *sV0AR28 = new TGeoCompositeShape("sV0AR28","sV0AR2b8-sV0ACha8");
1771 TGeoCompositeShape *sV0AR38 = new TGeoCompositeShape("sV0AR38","sV0AR3b8-sV0ACha8");
1772 TGeoCompositeShape *sV0AR48 = new TGeoCompositeShape("sV0AR48","sV0AR4b8-sV0ACha8");
1773 TGeoVolume *v0L18 = new TGeoVolume("V0L18",sV0AR18,medV0ASci);
1774 TGeoVolume *v0L28 = new TGeoVolume("V0L28",sV0AR28,medV0ASci);
1775 TGeoVolume *v0L38 = new TGeoVolume("V0L38",sV0AR38,medV0ASci);
1776 TGeoVolume *v0L48 = new TGeoVolume("V0L48",sV0AR48,medV0ASci);
1777 v0L18->SetLineColor(kV0AColorSci); v0L28->SetLineColor(kV0AColorSci);
1778 v0L38->SetLineColor(kV0AColorSci); v0L48->SetLineColor(kV0AColorSci);
1779 v0ASci8->AddNode(v0L18,1);
1780 v0ASci8->AddNode(v0L28,1);
1781 v0ASci8->AddNode(v0L38,1);
f316b8fc 1782 v0ASci8->AddNode(v0L48,1);
11ea46b9 1783
a8b5076e 1784 /// Segment of octagon
1785 for (int i=0;i<2;i++) {
a32c7883 1786 v0APts[0+8*i] = fV0AR6; v0APts[1+8*i] = 0.;
1787 v0APts[2+8*i] = fV0AR7*cos654; v0APts[3+8*i] = -fV0AR7*sin654;
1788 v0APts[4+8*i] = (fV0AR7-fV0AOctH2)*cos654; v0APts[5+8*i] = -(fV0AR7-fV0AOctH2)*sin654;
1789 v0APts[6+8*i] = fV0AR6-fV0AOctH2; v0APts[7+8*i] = 0.;
11ea46b9 1790 }
1791 TGeoArb8 *sV0AOct28 = new TGeoArb8("sV0AOct28", (fV0ASciWd+2*fV0AOctWd)/2., v0APts);
1792 TGeoVolume *v0AOct28 = new TGeoVolume("V0AOct28", sV0AOct28,medV0ASup);
1793 v0AOct28->SetLineColor(kV0AColorOct);
a8b5076e 1794 TGeoVolume *v0ASup8 = new TGeoVolumeAssembly("V0ASup8");
11ea46b9 1795 v0ASup8->AddNode(v0AOct28,1);
1796 v0ASec8->AddNode(v0ASup8,1);
1797
1798 //Bunch of fibers
1799 v0APts[ 0] = v0APts[ 2] = -14.0;
1800 v0APts[ 1] = v0APts[ 7] = (fV0ASciWd+fV0AOctWd)/2.-0.01;
1801 v0APts[ 3] = v0APts[ 5] = (fV0ASciWd+fV0AOctWd)/2.+0.01;
1802 v0APts[ 4] = v0APts[ 6] = +14.0;
1803 v0APts[ 8] = v0APts[10] = -10.0;
1804 v0APts[ 9] = v0APts[15] = 0.;
1805 v0APts[11] = v0APts[13] = 0.25;
1806 v0APts[12] = v0APts[14] = +10.0;
a8b5076e 1807 new TGeoArb8("sV0AFib18", 11.8, v0APts);
11ea46b9 1808 rot = new TGeoRotation("rot");
1809 rot->RotateX(-90);
1810 rot->RotateZ(-90-22.5);
a8b5076e 1811 TGeoCombiTrans *fib18pos = new TGeoCombiTrans("fib18pos", (fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. - 3.3, -(fV0AR6-fV0AOctH2+fV0AR5)*sin225/2. + 1.5, 0, rot);
1812 fib18pos->RegisterYourself();
1813 TGeoCompositeShape *sV0AFib18Hole = new TGeoCompositeShape("sV0AFib18Hole", "sV0AFib18:fib18pos-sV0AFicR58");
1814 TGeoVolume *v0AFib18Hole = new TGeoVolume("V0AFib18",sV0AFib18Hole,medV0AFib);
1815 v0AFib18Hole->SetLineColor(kV0AColorFib);
1816 new TGeoArb8("sV0AFib28", 11.8, v0APts);
11ea46b9 1817 rot = new TGeoRotation("rot");
1818 rot->RotateX(-90);
1819 rot->RotateY(180);
1820 rot->RotateZ(-90-22.5);
a8b5076e 1821 TGeoCombiTrans *fib28pos = new TGeoCombiTrans("fib28pos", (fV0AR6-fV0AOctH2+fV0AR5)*cos225/2. - 3.3, -(fV0AR6-fV0AOctH2+fV0AR5)*sin225/2. + 1.5, 0, rot);
1822 fib28pos->RegisterYourself();
1823 TGeoCompositeShape *sV0AFib28Hole = new TGeoCompositeShape("sV0AFib28Hole", "sV0AFib28:fib28pos-sV0AFicR58");
1824 TGeoVolume *v0AFib28Hole = new TGeoVolume("V0AFib28Hole",sV0AFib28Hole,medV0AFib);
1825 v0AFib28Hole->SetLineColor(kV0AColorFib);
1826 TGeoVolume *v0AFib8 = new TGeoVolumeAssembly("V0AFib8");
1827 v0AFib8->AddNode(v0AFib18Hole,1);
1828 v0AFib8->AddNode(v0AFib28Hole,1);
1829 v0ASec8->AddNode(v0AFib8,1);
1830
1831 /// Non-sensitive scintilator
1832 new TGeoTubeSeg("sV0AR5S28", fV0AR4+fV0AFraWd/2., fV0AR4 + fV0AR0, fV0ASciWd/2.+2*preShape, 315.0, 360.0);
1833 TGeoCompositeShape *sV0AR58 = new TGeoCompositeShape("V0AR58","sV0AR5S28 - sV0ACha8");
1834 TGeoVolume *v0AR58 = new TGeoVolume("V0AR58",sV0AR58,medV0ASci);
1835 v0AR58->SetLineColor(kV0AColorSci);
1836 v0ASci8->AddNode(v0AR58,1);
1837 v0ASec8->AddNode(v0ASci8,1);
11ea46b9 1838
11ea46b9 1839 /// Plates
11ea46b9 1840 for (int i=0;i<2;i++) {
1841 v0APts[0+8*i] = fV0AR0; v0APts[1+8*i] = 0.;
a32c7883 1842 v0APts[2+8*i] = fV0AR6; v0APts[3+8*i] = 0.;
11ea46b9 1843 v0APts[4+8*i] = fV0AR7*cos654; v0APts[5+8*i] = -fV0AR7*sin654;
a32c7883 1844 v0APts[6+8*i] = fV0AR0*cos654; v0APts[7+8*i] = -fV0AR0*sin654;
11ea46b9 1845 }
1846 new TGeoArb8("sV0APlaIn8", (fV0APlaWd-2*fV0APlaAl)/2., v0APts);
1847 TGeoCompositeShape *sV0APlaInNailsHoles8 = new TGeoCompositeShape("sV0APlaInNailsHoles8","sV0APlaIn8-sV0ANailsPlaInHoles8");
1848 TGeoVolume *v0APlaInNailsHoles8 = new TGeoVolume("V0APlaInNailsHoles8", sV0APlaInNailsHoles8, medV0APlaIn);
1849 new TGeoArb8("sV0APlaOu8", fV0APlaAl/2., v0APts);
1850 TGeoCompositeShape *sV0APlaOuNailsHoles8 = new TGeoCompositeShape("sV0APlaOuNailsHoles8","sV0APlaOu8-sV0ANailsPlaOuHoles8");
1851 TGeoVolume *v0APlaOuNailsHoles8 = new TGeoVolume("V0APlaOuNailsHoles8", sV0APlaOuNailsHoles8, medV0APlaOu);
1852 v0APlaInNailsHoles8->SetLineColor(kV0AColorPlaIn); v0APlaOuNailsHoles8->SetLineColor(kV0AColorPlaOu);
1853 TGeoVolume *v0APla8 = new TGeoVolumeAssembly("V0APla8");
1854 v0APla8->AddNode(v0APlaInNailsHoles8,1);
1855 v0APla8->AddNode(v0APlaOuNailsHoles8,1,new TGeoTranslation(0,0,(fV0APlaWd-fV0APlaAl)/2.));
1856 v0APla8->AddNode(v0APlaOuNailsHoles8,2,new TGeoTranslation(0,0,-(fV0APlaWd-fV0APlaAl)/2.));
1857 v0ASec8->AddNode(v0APla8,1,new TGeoTranslation(0,0,(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1858 v0ASec8->AddNode(v0APla8,2,new TGeoTranslation(0,0,-(fV0ASciWd+2*fV0AOctWd+fV0APlaWd)/2.));
1859
a8b5076e 1860 /// PMBox
11ea46b9 1861 TGeoVolume* v0APM8 = new TGeoVolumeAssembly("V0APM1");
1862 new TGeoBBox("sV0APMB18", fV0APMBWd/2., fV0APMBHt/2., fV0APMBTh/2.);
1863 new TGeoBBox("sV0APMB28", fV0APMBWd/2.-fV0APMBWdW, fV0APMBHt/2.-fV0APMBHtW, fV0APMBTh/2.-fV0APMBThW);
1864 TGeoCompositeShape *sV0APMB8 = new TGeoCompositeShape("sV0APMB8","sV0APMB18-sV0APMB28");
1865 TGeoVolume *v0APMB8 = new TGeoVolume("V0APMB8",sV0APMB8, medV0APMAlum);
1866 v0APMB8->SetLineColor(kV0AColorPMA);
1867 v0APM8->AddNode(v0APMB8,1);
1868
a8b5076e 1869 /// PMTubes
11ea46b9 1870 TGeoTube *sV0APMT18 = new TGeoTube("sV0APMT18", fV0APMTR1, fV0APMTR2, fV0APMTH/2.);
1871 TGeoVolume *v0APMT18 = new TGeoVolume("V0APMT18", sV0APMT18, medV0APMGlass);
1872 TGeoTube *sV0APMT28 = new TGeoTube("sV0APMT28", fV0APMTR3, fV0APMTR4, fV0APMTH/2.);
1873 TGeoVolume *v0APMT28 = new TGeoVolume("V0APMT28", sV0APMT28, medV0APMAlum);
1874 TGeoVolume *v0APMT8 = new TGeoVolumeAssembly("V0APMT8");
1875 TGeoTube *sV0APMTT8 = new TGeoTube("sV0APMTT8", 0., fV0APMTR4, fV0APMTB/2.);
2ca4471e 1876 TGeoVolume *v0APMTT8 = new TGeoVolume("V0APMTT8", sV0APMTT8, medV0APMAlum);
11ea46b9 1877 v0APMT8->SetLineColor(kV0AColorPMG);
1878 v0APMT28->SetLineColor(kV0AColorPMA);
1879 v0APMTT8->SetLineColor(kV0AColorPMA);
1880 rot = new TGeoRotation("rot", 90, 0, 180, 0, 90, 90);
1881 v0APMT8->AddNode(v0APMT18,1,rot);
1882 v0APMT8->AddNode(v0APMT28,1,rot);
1883 v0APMT8->AddNode(v0APMTT8,1,new TGeoCombiTrans(0,(fV0APMTH+fV0APMTB)/2.,0,rot));
1884 double autoShift8 = (fV0APMBWd-2*fV0APMBWdW)/4.;
1885 v0APM8->AddNode(v0APMT8, 1, new TGeoTranslation(-1.5*autoShift8, 0, 0));
1886 v0APM8->AddNode(v0APMT8, 2, new TGeoTranslation(-0.5*autoShift8, 0, 0));
1887 v0APM8->AddNode(v0APMT8, 3, new TGeoTranslation(+0.5*autoShift8, 0, 0));
1888 v0APM8->AddNode(v0APMT8, 4, new TGeoTranslation(+1.5*autoShift8, 0, 0));
1889
a8b5076e 1890 /// PM
11ea46b9 1891 rot = new TGeoRotation("rot");
1892 rot->RotateX(-90+30);
1893 rot->RotateY(0);
1894 rot->RotateZ(65+3);
1895 double shiftZ8 = fV0APMBHt/2. * cosAngPMB
1896 - ( fV0ASciWd + 2 * fV0AOctWd + 2 * fV0APlaWd )/2. - fV0APMBTh/2. * sinAngPMB;
1897 double shiftR8 = fV0AR6 + fV0AOctH2 + fV0APlaAl;
f316b8fc 1898 v0ASec8->AddNode(v0APM8,1, new TGeoCombiTrans( shiftR8*cos225 + 1.3, -shiftR8*sin225, shiftZ8, rot));
11ea46b9 1899
a8b5076e 1900 // Aluminium nails
11ea46b9 1901 TGeoTube *sV0ANail81 = new TGeoTube("sV0ANail81", 0.0, 0.4, 5.09/2.);
1902 TGeoVolume *v0ANail81 = new TGeoVolume("V0ANail81", sV0ANail81, medV0APMAlum);
1903 v0ANail81->SetLineColor(kV0AColorPMA);// this is the color for aluminium
a8b5076e 1904 v0ASec8->AddNode(v0ANail81,1,new TGeoTranslation(42.9,-.51,0.0));
11ea46b9 1905 TGeoTube *sV0ANail82 = new TGeoTube("sV0ANail82", 0.0, 0.4, 5.09/2.);
1906 TGeoVolume *v0ANail82 = new TGeoVolume("V0ANail82", sV0ANail82, medV0APMAlum);
1907 v0ANail82->SetLineColor(kV0AColorPMA);
a8b5076e 1908 v0ASec8->AddNode(v0ANail82,1,new TGeoTranslation(30.8,-30.04,0.0));
1909
f316b8fc 1910 // Adding sector to v0LE volume
a8b5076e 1911 v0LE->AddNode(v0ASec8, 1);
1912
1913
edc39343 1914 // Adding detectors to top volume
5063dd34 1915 TGeoVolume *vZERO = new TGeoVolumeAssembly("VZERO");
1916 vZERO->AddNode(v0RI,1,new TGeoTranslation(0, 0, -zdet));
c43dadb9 1917 vZERO->AddNode(v0LE,1,new TGeoTranslation(0, 0, +329.0));
5063dd34 1918 top->AddNode(vZERO,1);
1a809d19 1919}
45b81649 1920
1921//_____________________________________________________________________________
1922void AliVZEROv7::AddAlignableVolumes() const
1923{
1924 //
1925 // Create entries for alignable volumes associating the symbolic volume
1926 // name with the corresponding volume path. Needs to be syncronized with
1927 // eventual changes in the geometry.
1928 //
1929 TString vpC = "/ALIC_1/VZERO_1/V0RI_1";
1930 TString vpA = "/ALIC_1/VZERO_1/V0LE_1";
1931 TString snC = "VZERO/V0C";
1932 TString snA = "VZERO/V0A";
1933
1934 if(!gGeoManager->SetAlignableEntry(snC.Data(),vpC.Data()))
1935 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snC.Data(),vpC.Data()));
1936 if(!gGeoManager->SetAlignableEntry(snA.Data(),vpA.Data()))
1937 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", snA.Data(),vpA.Data()));
1938
1939}
1940
1a809d19 1941//_____________________________________________________________________________
1942void AliVZEROv7::CreateMaterials()
1943{
1944
1945// Creates materials used for geometry
1946
1947 AliDebug(2,"Create materials");
1948 // Parameters for simulation scope
f7a1cc68 1949 Int_t fieldType = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ(); // Field type
1950 Double_t maxField = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max(); // Field max.
1a809d19 1951 Double_t maxBending = 10; // Max Angle
1952 Double_t maxStepSize = 0.01; // Max step size
1953 Double_t maxEnergyLoss = 1; // Max Delta E
1954 Double_t precision = 0.003; // Precision
1955 Double_t minStepSize = 0.003; // Minimum step size
1956
1957 Int_t id;
1958 Double_t a, z, radLength, absLength;
1959 Float_t density, as[4], zs[4], ws[4];
1960
1961// Parameters for V0CPrePlates: Aluminium
1962 a = 26.98;
1963 z = 13.00;
1964 density = 2.7;
1965 radLength = 8.9;
1966 absLength = 37.2;
1967 id = 2;
1968 AliMaterial( id, "V0CAlu", a, z, density, radLength, absLength, 0, 0);
1969 AliMedium(id, "V0CAlu", id, 1, fieldType, maxField, maxBending, maxStepSize,
1970 maxEnergyLoss, precision, minStepSize);
1971
1972// Parameters for V0CPlates: Carbon
1973 a = 12.01;
1974 z = 6.00;
1975 density = 2.265;
1976 radLength = 18.8;
1977 absLength = 49.9;
1978 id = 3;
1979 AliMaterial(id, "V0CCar", a, z, density, radLength, absLength, 0, 0);
1980 AliMedium(id, "V0CCar", id, 1, fieldType, maxField, maxBending, maxStepSize,
1981 maxEnergyLoss, precision, minStepSize);
1982
1983// Parameters for V0Cscintillator: BC408
1984 as[0] = 1.00794; as[1] = 12.011;
1985 zs[0] = 1.; zs[1] = 6.;
1986 ws[0] = 1.; ws[1] = 1.;
1987 density = 1.032;
1988 id = 4;
1989 AliMixture(id, "V0CSci", as, zs, density, -2, ws);
1990 AliMedium(id,"V0CSci", id, 1, fieldType, maxField, maxBending, maxStepSize,
1991 maxEnergyLoss, precision, minStepSize);
1992
1993// Parameters for V0Ascintilator: BC404
1994 as[0] = 1.00794; as[1] = 12.011;
1995 zs[0] = 1.; zs[1] = 6.;
1996 ws[0] = 5.21; ws[1] = 4.74;
1997 density = 1.032;
1998 id = 5;
1999 AliMixture(id, "V0ASci", as, zs, density, -2, ws);
2000 AliMedium(id, "V0ASci", id, 1, fieldType, maxField, maxBending, maxStepSize,
2001 maxEnergyLoss, precision, minStepSize);
2002
2003// Parameters for V0ALuc: Lucita but for the simulation BC404
2004 as[0] = 1.00794; as[1] = 12.011;
2005 zs[0] = 1.; zs[1] = 6.;
2006 ws[0] = 5.21; ws[1] = 4.74;
2007 density = 1.032;
2008 id = 6;
2009 AliMixture(id, "V0ALuc", as, zs, density, -2, ws);
2010 AliMedium(id, "V0ALuc", id, 1, fieldType, maxField, maxBending, maxStepSize,
2011 maxEnergyLoss, precision, minStepSize);
2012
2013// Parameters for V0Aplate: EuroComposite - EC-PI 626 PS - AlMg3
2014 as[0] = 26.982; as[1] = 24.305;
2015 zs[0] = 13.; zs[1] = 12.;
2016 ws[0] = 1.; ws[1] = 3.;
2017 density = 3.034;
2018 id = 7;
2019 AliMixture(id, "V0APlaOu", as, zs, density, -2, ws);
2020 AliMedium(id, "V0APlaOu", id, 1, fieldType, maxField, maxBending, maxStepSize,
2021 maxEnergyLoss, precision, minStepSize);
2022
2023// Parameters for V0Aplate: EuroComposite - EC-PI 626 PS - EC-PI 6.4-42
2024 as[0] = 1.00794; as[1] = 12.011;
2025 zs[0] = 1.; zs[1] = 6.;
2026 ws[0] = 5.21; ws[1] = 4.74;
2027 density = 0.042;
2028 id = 8;
2029 AliMixture(id, "V0APlaIn", as, zs, density, -2, ws);
2030 AliMedium(id, "V0APlaIn", id, 1, fieldType, maxField, maxBending, maxStepSize,
2031 maxEnergyLoss, precision, minStepSize);
2032
2033// Parameters for V0Afiber: BC9929AMC Plastic Scintillating Fiber from Saint-Gobain
2034 as[0] = 1.00794; as[1] = 12.011;
2035 zs[0] = 1.; zs[1] = 6.;
2036 ws[0] = 4.82; ws[1] = 4.85;
2037 density = 1.05;
2038 id = 9;
2039 AliMixture(id, "V0AFib", as, zs, density, -2, ws);
2040 AliMedium(id, "V0AFib", id, 1, fieldType, maxField, maxBending, maxStepSize,
2041 maxEnergyLoss, precision, minStepSize);
2042
2043// Parameters for V0APMA: Aluminium
2044 a = 26.98;
2045 z = 13.00;
2046 density = 2.7;
2047 radLength = 8.9;
2048 absLength = 37.2;
2049 id = 10;
2050 AliMaterial(id, "V0APMA", a, z, density, radLength, absLength, 0, 0);
2051 AliMedium(id, "V0APMA", id, 1, fieldType, maxField, maxBending, maxStepSize,
2052 maxEnergyLoss, precision, minStepSize);
2053
2054// Parameters for V0APMG: Glass for the simulation Aluminium
2055 a = 26.98;
2056 z = 13.00;
2057 density = 2.7;
2058 radLength = 8.9;
2059 absLength = 37.2;
2060 id = 11;
2061 AliMaterial(id, "V0APMG", a, z, density, radLength, absLength, 0, 0);
2062 AliMedium(id, "V0APMG", id, 1, fieldType, maxField, maxBending, maxStepSize,
2063 maxEnergyLoss, precision, minStepSize);
2064}
2065
2066//_____________________________________________________________________________
2067void AliVZEROv7::DrawModule() const
2068{
2069// Drawing is done in DrawVZERO.C
2070
2071 AliDebug(2,"DrawModule");
2072}
2073
2074
2075//_____________________________________________________________________________
2076void AliVZEROv7::DrawGeometry()
2077{
2078// Drawing of V0 geometry done in DrawV0.C
2079
2080 AliDebug(2,"DrawGeometry");
2081}
2082
2083//_____________________________________________________________________________
2084void AliVZEROv7::Init()
2085{
2086// Initialises version of the VZERO Detector given in Config
2087// Just prints an information message
2088
3e87825e 2089// AliInfo(Form("VZERO version %d initialized \n",IsVersion()));
2090
2091 AliDebug(1,"VZERO version 7 initialized");
1a809d19 2092 AliVZERO::Init();
2093}
2094
2095//_____________________________________________________________________________
2096void AliVZEROv7::StepManager()
2097{
5ff8773f 2098// Step Manager, called at each step
1a809d19 2099
2100 Int_t copy;
2101 static Int_t vol[4];
2102 static Float_t hits[21];
2103 static Float_t eloss, tlength;
f419b97e 2104 static Int_t nPhotonsInStep = 0;
2105 static Int_t nPhotons = 0;
2106 static Int_t numStep = 0;
1a809d19 2107 Int_t ringNumber;
2108 Float_t destep, step;
2109 numStep += 1;
2110
5ff8773f 2111 // We keep only charged tracks :
1a809d19 2112 if ( !gMC->TrackCharge() || !gMC->IsTrackAlive() ) return;
2113
2114 vol[0] = gMC->CurrentVolOffID(1, vol[1]);
2115 vol[2] = gMC->CurrentVolID(copy);
2116 vol[3] = copy;
2117 static Int_t idV0R1 = gMC->VolId("V0R1");
2118 static Int_t idV0L1 = gMC->VolId("V0L1");
5ff8773f 2119 static Int_t idV0L15 = gMC->VolId("V0L15");
2120 static Int_t idV0L16 = gMC->VolId("V0L16");
2121 static Int_t idV0L17 = gMC->VolId("V0L17");
2122 static Int_t idV0L18 = gMC->VolId("V0L18");
1a809d19 2123 static Int_t idV0R2 = gMC->VolId("V0R2");
2124 static Int_t idV0L2 = gMC->VolId("V0L2");
5ff8773f 2125 static Int_t idV0L25 = gMC->VolId("V0L25");
2126 static Int_t idV0L26 = gMC->VolId("V0L26");
2127 static Int_t idV0L27 = gMC->VolId("V0L27");
2128 static Int_t idV0L28 = gMC->VolId("V0L28");
1a809d19 2129 static Int_t idV0R3 = gMC->VolId("V0R3");
2130 static Int_t idV0L3 = gMC->VolId("V0L3");
5ff8773f 2131 static Int_t idV0L35 = gMC->VolId("V0L35");
2132 static Int_t idV0L36 = gMC->VolId("V0L36");
2133 static Int_t idV0L37 = gMC->VolId("V0L37");
2134 static Int_t idV0L38 = gMC->VolId("V0L38");
1a809d19 2135 static Int_t idV0R4 = gMC->VolId("V0R4");
2136 static Int_t idV0L4 = gMC->VolId("V0L4");
5ff8773f 2137 static Int_t idV0L45 = gMC->VolId("V0L45");
2138 static Int_t idV0L46 = gMC->VolId("V0L46");
2139 static Int_t idV0L47 = gMC->VolId("V0L47");
2140 static Int_t idV0L48 = gMC->VolId("V0L48");
1a809d19 2141 static Int_t idV0R5 = gMC->VolId("V0R5");
2142 static Int_t idV0R6 = gMC->VolId("V0R6");
742d6134 2143 bool hitOnV0C = true;
1a809d19 2144 double lightYield;
2145 double lightAttenuation;
5ff8773f 2146 double nMeters;
1a809d19 2147 double fibToPhot;
5ff8773f 2148 if ( gMC->CurrentVolID(copy) == idV0R1 || gMC->CurrentVolID(copy) == idV0L1 || gMC->CurrentVolID(copy) == idV0L15 || gMC->CurrentVolID(copy) == idV0L16 || gMC->CurrentVolID(copy) == idV0L17 || gMC->CurrentVolID(copy) == idV0L18 )
1a809d19 2149 ringNumber = 1;
5ff8773f 2150 else if ( gMC->CurrentVolID(copy) == idV0R2 || gMC->CurrentVolID(copy) == idV0L2 || gMC->CurrentVolID(copy) == idV0L25 || gMC->CurrentVolID(copy) == idV0L26 || gMC->CurrentVolID(copy) == idV0L27 || gMC->CurrentVolID(copy) == idV0L28 )
1a809d19 2151 ringNumber = 2;
2152 else if ( gMC->CurrentVolID(copy) == idV0R3 || gMC->CurrentVolID(copy) == idV0R4
5ff8773f 2153 || gMC->CurrentVolID(copy) == idV0L3 || gMC->CurrentVolID(copy) == idV0L35 || gMC->CurrentVolID(copy) == idV0L36 || gMC->CurrentVolID(copy) == idV0L37 || gMC->CurrentVolID(copy) == idV0L38 ) ringNumber = 3;
1a809d19 2154 else if ( gMC->CurrentVolID(copy) == idV0R5 || gMC->CurrentVolID(copy) == idV0R6
5ff8773f 2155 || gMC->CurrentVolID(copy) == idV0L4 || gMC->CurrentVolID(copy) == idV0L45 || gMC->CurrentVolID(copy) == idV0L46 || gMC->CurrentVolID(copy) == idV0L47 || gMC->CurrentVolID(copy) == idV0L48 ) ringNumber = 4;
1a809d19 2156 else ringNumber = 0;
2157 if (ringNumber) {
5ff8773f 2158 if (gMC->CurrentVolID(copy) == idV0L1 || gMC->CurrentVolID(copy) == idV0L15 || gMC->CurrentVolID(copy) == idV0L16 || gMC->CurrentVolID(copy) == idV0L17 || gMC->CurrentVolID(copy) == idV0L18 || gMC->CurrentVolID(copy) == idV0L2 || gMC->CurrentVolID(copy) == idV0L25 || gMC->CurrentVolID(copy) == idV0L26 || gMC->CurrentVolID(copy) == idV0L27 || gMC->CurrentVolID(copy) == idV0L28 || gMC->CurrentVolID(copy) == idV0L3 || gMC->CurrentVolID(copy) == idV0L35 || gMC->CurrentVolID(copy) == idV0L36 || gMC->CurrentVolID(copy) == idV0L37 || gMC->CurrentVolID(copy) == idV0L38 || gMC->CurrentVolID(copy) == idV0L4 || gMC->CurrentVolID(copy) == idV0L45 || gMC->CurrentVolID(copy) == idV0L46 || gMC->CurrentVolID(copy) == idV0L47 || gMC->CurrentVolID(copy) == idV0L48)
1a809d19 2159 hitOnV0C = false;
2160 destep = gMC->Edep();
2161 step = gMC->TrackStep();
2162 if (hitOnV0C) {
2163 lightYield = fV0CLightYield;
2164 lightAttenuation = fV0CLightAttenuation;
2165 nMeters = fV0CnMeters;
2166 fibToPhot = fV0CFibToPhot;
2167 } else {
2168 lightYield = fV0ALightYield;
2169 lightAttenuation = fV0ALightAttenuation;
2170 nMeters = fV0AnMeters;
5e44677e 2171 fibToPhot = fV0AFibToPhot;
1a809d19 2172 }
2173 nPhotonsInStep = Int_t(destep / (lightYield *1e-9) );
2174 nPhotonsInStep = gRandom->Poisson(nPhotonsInStep);
2175 eloss += destep;
2176 tlength += step;
2177 if ( gMC->IsTrackEntering() ) {
2178 nPhotons = nPhotonsInStep;
2179 gMC->TrackPosition(fTrackPosition);
2180 gMC->TrackMomentum(fTrackMomentum);
2181 Float_t pt = TMath::Sqrt( fTrackMomentum.Px() * fTrackMomentum.Px()
2182 + fTrackMomentum.Py() * fTrackMomentum.Py() );
2183 TParticle *par = gAlice->GetMCApp()->Particle(gAlice->GetMCApp()->GetCurrentTrackNumber());
2184 hits[0] = fTrackPosition.X();
2185 hits[1] = fTrackPosition.Y();
2186 hits[2] = fTrackPosition.Z();
2187 hits[3] = Float_t (gMC->TrackPid());
2188 hits[4] = gMC->TrackTime();
2189 hits[5] = gMC->TrackCharge();
2190 hits[6] = fTrackMomentum.Theta()*TMath::RadToDeg();
2191 hits[7] = fTrackMomentum.Phi()*TMath::RadToDeg();
2192 hits[8] = ringNumber;
2193 hits[9] = pt;
2194 hits[10] = fTrackMomentum.P();
2195 hits[11] = fTrackMomentum.Px();
2196 hits[12] = fTrackMomentum.Py();
2197 hits[13] = fTrackMomentum.Pz();
2198 hits[14] = par->Vx();
2199 hits[15] = par->Vy();
2200 hits[16] = par->Vz();
2201 tlength = 0.0;
2202 eloss = 0.0;
742d6134 2203
2204 //////////////////////////
2205 ///// Display V0A geometry
2206 // if (!hitOnV0C) {
2207 // FILE *of;
2208 // of = fopen("V0A.out", "a");
2209 // // x, y, z, ringnumber, cellid
2210 // fprintf( of, "%f %f %f %f %d \n", hits[0], hits[1], hits[2], hits[8], GetCellId (vol, hits) );
2211 // fclose(of);
2212 // }
2213 //////////////////////////
1a809d19 2214 }
2215 nPhotons = nPhotons + nPhotonsInStep;
2216 if( gMC->IsTrackExiting() || gMC->IsTrackStop() || gMC->IsTrackDisappeared()){
2217 nPhotons = nPhotons - Int_t((Float_t(nPhotons) * lightAttenuation * nMeters));
2218 nPhotons = nPhotons - Int_t( Float_t(nPhotons) * fibToPhot);
2219 hits[17] = eloss;
2220 hits[18] = tlength;
2221 hits[19] = nPhotons;
2222 hits[20] = GetCellId (vol, hits);
2223 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2224 tlength = 0.0;
2225 eloss = 0.0;
2226 nPhotons = 0;
2227 nPhotonsInStep = 0;
2228 numStep = 0;
2229 }
7b1a8873 2230 if( gMC->IsTrackEntering() || gMC->IsTrackExiting() ) {
2231 AddTrackReference(gAlice->GetMCApp()->GetCurrentTrackNumber(), AliTrackReference::kVZERO);
2232 }
1a809d19 2233 }
2234}
2235
2236//_____________________________________________________________________________
2237void AliVZEROv7::AddHit(Int_t track, Int_t *vol, Float_t *hits)
2238{
2239// Adds a VZERO hit
2240
2241 TClonesArray &lhits = *fHits;
2242 new(lhits[fNhits++]) AliVZEROhit(fIshunt,track,vol,hits);
2243}
2244
2245//_____________________________________________________________________________
2246void AliVZEROv7::AddDigits(Int_t *tracks, Int_t* digits)
2247{
2248// Adds a VZERO digit
2249
2250 TClonesArray &ldigits = *fDigits;
2251 new(ldigits[fNdigits++]) AliVZEROdigit(tracks, digits);
2252}
2253
2254//_____________________________________________________________________________
2255void AliVZEROv7::MakeBranch(Option_t *option)
2256{
2257// Creates new branches in the current Root Tree
2258
2259 char branchname[10];
2260 sprintf(branchname,"%s",GetName());
2261 AliDebug(2,Form("fBufferSize = %d",fBufferSize));
2262 const char *cH = strstr(option,"H");
cb5b8b21 2263 if (fHits && fLoader->TreeH() && cH) {
2264 fLoader->TreeH()->Branch(branchname,&fHits, fBufferSize);
1a809d19 2265 AliDebug(2,Form("Making Branch %s for hits",branchname));
2266 }
2267 const char *cD = strstr(option,"D");
2268 if (fDigits && fLoader->TreeD() && cD) {
2269 fLoader->TreeD()->Branch(branchname,&fDigits, fBufferSize);
2270 AliDebug(2,Form("Making Branch %s for digits",branchname));
2271 }
2272}
2273
2274//_____________________________________________________________________________
2275Int_t AliVZEROv7::GetCellId(Int_t *vol, Float_t *hits)
2276{
2277 // Returns Id of scintillator cell
2278 // Right side from 0 to 47
2279 // Left side from 48 to 79
2280 // hits[8] = ring number (1 to 4)
2281 // vol[1] = copy number (1 to 8)
2282
2283 Int_t index = vol[1];
5063dd34 2284 Int_t ringNumber = Int_t(hits[8]);
1a809d19 2285 fCellId = 0;
742d6134 2286
1a809d19 2287 Float_t phi = Float_t(TMath::ATan2(Double_t(hits[1]),Double_t(hits[0])) );
11ea46b9 2288 Float_t kRaddeg = 180.0/TMath::Pi();
1a809d19 2289 phi = kRaddeg * phi;
2290
2291 if (index < 7) index = index + 8;
2292
2293 if (hits[2] < 0.0) {
5063dd34 2294 if(ringNumber < 3) {
2295 index = (index - 7) + ( ( ringNumber - 1 ) * 8);
2296 } else if (ringNumber >= 3) {
1a809d19 2297 if ( gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R3") || gMC->CurrentVolID(vol[1])
5063dd34 2298 == gMC->VolId("V0R5") ) index = (index*2-14)+((ringNumber-2)*16);
1a809d19 2299 if ( gMC->CurrentVolID(vol[1]) == gMC->VolId("V0R4") || gMC->CurrentVolID(vol[1])
5063dd34 2300 == gMC->VolId("V0R6") ) index = (index*2-13)+((ringNumber-2)*16);
1a809d19 2301 }
2302 fCellId = index;
2303 } else if (hits[2] > 0.0) {
dac6c675 2304 // cout << " vol[0] = " << vol[0] << " copy : " << vol[1]
2305 // << " called " << gMC->VolName(vol[0]) << endl;
2306 // cout << " vol[2] = " << vol[2] << " copy : " << vol[3]
2307 // << " called " << gMC->VolName(vol[2]) << endl;
2308 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L1")) fCellId = vol[1]+47;
2309 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L2")) fCellId = 8+vol[1]+47;
2310 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L3")) fCellId = 16+vol[1]+47;
2311 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L4")) fCellId = 24+vol[1]+47;
2312 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L15")) fCellId = 48+4;
2313 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L16")) fCellId = 48+5;
2314 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L17")) fCellId = 48+6;
2315 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L18")) fCellId = 48+7;
2316 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L25")) fCellId = 8+48+4;
2317 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L26")) fCellId = 8+48+5;
2318 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L27")) fCellId = 8+48+6;
2319 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L28")) fCellId = 8+48+7;
2320 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L35")) fCellId = 16+48+4;
2321 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L36")) fCellId = 16+48+5;
2322 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L37")) fCellId = 16+48+6;
2323 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L38")) fCellId = 16+48+7;
2324 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L45")) fCellId = 24+48+4;
2325 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L46")) fCellId = 24+48+5;
2326 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L47")) fCellId = 24+48+6;
2327 if (gMC->CurrentVolID(vol[2]) == gMC->VolId("V0L48")) fCellId = 24+48+7;
1a809d19 2328 }
742d6134 2329
1a809d19 2330 return fCellId;
2331}
f316b8fc 2332