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