Simple implementation of the VEventPool which allows to loop several times over the...
[u/mrichter/AliRoot.git] / ZDC / AliZDCv3.cxx
CommitLineData
8d433671 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
17///////////////////////////////////////////////////////////////////////
18// //
19// AliZDCv3 --- new ZDC geometry //
20// with the both ZDC set geometry implemented //
21// //
22///////////////////////////////////////////////////////////////////////
23
24// --- Standard libraries
25#include "stdio.h"
26
27// --- ROOT system
28#include <TBRIK.h>
8d433671 29#include <TMath.h>
30#include <TNode.h>
31#include <TRandom.h>
32#include <TSystem.h>
33#include <TTree.h>
34#include <TVirtualMC.h>
35#include <TGeoManager.h>
313e8ff0 36#include <TGeoMatrix.h>
37#include <TGeoCone.h>
38#include <TGeoShape.h>
39#include <TGeoCompositeShape.h>
47709f57 40#include <TParticle.h>
8d433671 41
8d433671 42// --- AliRoot classes
43#include "AliConst.h"
44#include "AliMagF.h"
8d433671 45#include "AliRun.h"
46#include "AliZDCv3.h"
47#include "AliMC.h"
48
49class AliZDCHit;
50class AliPDG;
51class AliDetector;
52
53
54ClassImp(AliZDCv3)
55
56//_____________________________________________________________________________
f853b9aa 57AliZDCv3::AliZDCv3() :
58 AliZDC(),
59 fMedSensF1(0),
60 fMedSensF2(0),
61 fMedSensZP(0),
62 fMedSensZN(0),
63 fMedSensZEM(0),
64 fMedSensGR(0),
65 fMedSensPI(0),
29c8f0dc 66 fMedSensTDI(0),
f853b9aa 67 fNalfan(0),
68 fNalfap(0),
69 fNben(0),
70 fNbep(0),
71 fZEMLength(0),
72 fpLostITC(0),
73 fpLostD1C(0),
74 fpDetectedC(0),
75 fnDetectedC(0),
8cbab886 76 fnLumiC(0),
f853b9aa 77 fpLostITA(0),
78 fpLostD1A(0),
79 fpLostTDI(0),
80 fpDetectedA(0),
8cbab886 81 fnDetectedA(0),
82 fnLumiA(0),
83 fnTrou(0)
8d433671 84{
85 //
86 // Default constructor for Zero Degree Calorimeter
87 //
88
8d433671 89}
90
91//_____________________________________________________________________________
a718c993 92AliZDCv3::AliZDCv3(const char *name, const char *title) :
f853b9aa 93 AliZDC(name,title),
94 fMedSensF1(0),
95 fMedSensF2(0),
96 fMedSensZP(0),
97 fMedSensZN(0),
98 fMedSensZEM(0),
99 fMedSensGR(0),
100 fMedSensPI(0),
29c8f0dc 101 fMedSensTDI(0),
f853b9aa 102 fNalfan(90),
103 fNalfap(90),
104 fNben(18),
105 fNbep(28),
64d8b611 106 fZEMLength(0),
f853b9aa 107 fpLostITC(0),
108 fpLostD1C(0),
109 fpDetectedC(0),
110 fnDetectedC(0),
8cbab886 111 fnLumiC(0),
f853b9aa 112 fpLostITA(0),
113 fpLostD1A(0),
114 fpLostTDI(0),
115 fpDetectedA(0),
8cbab886 116 fnDetectedA(0),
117 fnLumiA(0),
118 fnTrou(0)
8d433671 119{
120 //
121 // Standard constructor for Zero Degree Calorimeter
122 //
123 //
124 // Check that DIPO, ABSO, DIPO and SHIL is there (otherwise tracking is wrong!!!)
125
126 AliModule* pipe=gAlice->GetModule("PIPE");
127 AliModule* abso=gAlice->GetModule("ABSO");
128 AliModule* dipo=gAlice->GetModule("DIPO");
129 AliModule* shil=gAlice->GetModule("SHIL");
130 if((!pipe) || (!abso) || (!dipo) || (!shil)) {
131 Error("Constructor","ZDC needs PIPE, ABSO, DIPO and SHIL!!!\n");
132 exit(1);
133 }
f853b9aa 134 //
8d433671 135 Int_t ip,jp,kp;
136 for(ip=0; ip<4; ip++){
137 for(kp=0; kp<fNalfap; kp++){
138 for(jp=0; jp<fNbep; jp++){
139 fTablep[ip][kp][jp] = 0;
140 }
141 }
142 }
143 Int_t in,jn,kn;
144 for(in=0; in<4; in++){
145 for(kn=0; kn<fNalfan; kn++){
146 for(jn=0; jn<fNben; jn++){
147 fTablen[in][kn][jn] = 0;
148 }
149 }
150 }
f853b9aa 151 //
8d433671 152 // Parameters for hadronic calorimeters geometry
153 fDimZN[0] = 3.52;
154 fDimZN[1] = 3.52;
155 fDimZN[2] = 50.;
156 fDimZP[0] = 11.2;
157 fDimZP[1] = 6.;
158 fDimZP[2] = 75.;
f853b9aa 159 fPosZNC[0] = 0.;
160 fPosZNC[1] = 1.2;
b6a8f9f1 161 fPosZNC[2] = -11600.;
f853b9aa 162 fPosZPC[0] = 23.9;
cd807e71 163 fPosZPC[1] = 0.;
164 fPosZPC[2] = -11600.;
f853b9aa 165 fPosZNA[0] = 0.;
166 fPosZNA[1] = 1.2;
167 fPosZNA[2] = 11620.;
cd807e71 168 fPosZPA[0] = 24.;
169 fPosZPA[1] = 0.;
170 fPosZPA[2] = 11620.;
8d433671 171 fFibZN[0] = 0.;
172 fFibZN[1] = 0.01825;
173 fFibZN[2] = 50.;
174 fFibZP[0] = 0.;
175 fFibZP[1] = 0.0275;
176 fFibZP[2] = 75.;
8d433671 177 // Parameters for EM calorimeter geometry
178 fPosZEM[0] = 8.5;
179 fPosZEM[1] = 0.;
180 fPosZEM[2] = 735.;
8d433671 181 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
182 Float_t kDimZEMAir = 0.001; // scotch
183 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
184 Int_t kDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
185 Float_t kDimZEM0 = 2*kDivZEM[2]*(kDimZEMPb+kDimZEMAir+kFibRadZEM*(TMath::Sqrt(2.)));
186 fZEMLength = kDimZEM0;
187
188}
189
190//_____________________________________________________________________________
191void AliZDCv3::CreateGeometry()
192{
193 //
194 // Create the geometry for the Zero Degree Calorimeter version 2
195 //* Initialize COMMON block ZDC_CGEOM
196 //*
197
198 CreateBeamLine();
199 CreateZDC();
200}
201
202//_____________________________________________________________________________
203void AliZDCv3::CreateBeamLine()
204{
205 //
206 // Create the beam line elements
207 //
208
209 Float_t zc, zq, zd1, zd2, zql, zd2l;
210 Float_t conpar[9], tubpar[3], tubspar[5], boxpar[3];
211 Int_t im1, im2;
f853b9aa 212 //
8d433671 213 Int_t *idtmed = fIdtmed->GetArray();
214
215 ////////////////////////////////////////////////////////////////
216 // //
217 // SIDE C - RB26 (dimuon side) //
218 // //
219 ///////////////////////////////////////////////////////////////
220
221
222 // -- Mother of the ZDCs (Vacuum PCON)
223 zd1 = 1921.6;
224
225 conpar[0] = 0.;
226 conpar[1] = 360.;
227 conpar[2] = 2.;
228 conpar[3] = -13500.;
229 conpar[4] = 0.;
230 conpar[5] = 55.;
231 conpar[6] = -zd1;
232 conpar[7] = 0.;
233 conpar[8] = 55.;
cd807e71 234 gMC->Gsvolu("ZDCC", "PCON", idtmed[10], conpar, 9);
f853b9aa 235 gMC->Gspos("ZDCC", 1, "ALIC", 0., 0., 0., 0, "ONLY");
8d433671 236
237
238 // -- FIRST SECTION OF THE BEAM PIPE (from compensator dipole to
239 // the beginning of D1)
240 tubpar[0] = 6.3/2.;
241 tubpar[1] = 6.7/2.;
242 // From beginning of ZDC volumes to beginning of D1
243 tubpar[2] = (5838.3-zd1)/2.;
244 gMC->Gsvolu("QT01", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 245 gMC->Gspos("QT01", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 246 // Ch.debug
247 //printf("\n QT01 TUBE pipe from z = %f to z= %f (D1 beg.)\n",-zd1,-2*tubpar[2]-zd1);
248
249 //-- SECOND SECTION OF THE BEAM PIPE (from the end of D1 to the
250 // beginning of D2)
251
252 //-- FROM MAGNETIC BEGINNING OF D1 TO MAGNETIC END OF D1 + 13.5 cm
253 //-- Cylindrical pipe (r = 3.47) + conical flare
254
255 // -> Beginning of D1
256 zd1 += 2.*tubpar[2];
257
258 tubpar[0] = 3.47;
259 tubpar[1] = 3.47+0.2;
260 tubpar[2] = 958.5/2.;
261 gMC->Gsvolu("QT02", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 262 gMC->Gspos("QT02", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 263 // Ch.debug
264 //printf("\n QT02 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
265
266 zd1 += 2.*tubpar[2];
267
268 conpar[0] = 25./2.;
269 conpar[1] = 10./2.;
270 conpar[2] = 10.4/2.;
271 conpar[3] = 6.44/2.;
272 conpar[4] = 6.84/2.;
273 gMC->Gsvolu("QC01", "CONE", idtmed[7], conpar, 5);
f853b9aa 274 gMC->Gspos("QC01", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 275 // Ch.debug
276 //printf("\n QC01 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
277
278 zd1 += 2.*conpar[0];
279
280 tubpar[0] = 10./2.;
281 tubpar[1] = 10.4/2.;
282 tubpar[2] = 50./2.;
283 gMC->Gsvolu("QT03", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 284 gMC->Gspos("QT03", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 285 // Ch.debug
286 //printf("\n QT03 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
287
288 zd1 += tubpar[2]*2.;
289
290 tubpar[0] = 10./2.;
291 tubpar[1] = 10.4/2.;
292 tubpar[2] = 10./2.;
293 gMC->Gsvolu("QT04", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 294 gMC->Gspos("QT04", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 295 // Ch.debug
296 //printf("\n QT04 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
297
298 zd1 += tubpar[2] * 2.;
299
300 tubpar[0] = 10./2.;
301 tubpar[1] = 10.4/2.;
302 tubpar[2] = 3.16/2.;
303 gMC->Gsvolu("QT05", "TUBE", idtmed[7], tubpar, 3);
71cd8104 304 gMC->Gspos("QT05", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 305 // Ch.debug
306 //printf("\n QT05 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
307
308 zd1 += tubpar[2] * 2.;
309
310 tubpar[0] = 10.0/2.;
311 tubpar[1] = 10.4/2;
312 tubpar[2] = 190./2.;
313 gMC->Gsvolu("QT06", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 314 gMC->Gspos("QT06", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 315 // Ch.debug
316 //printf("\n QT06 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
317
318 zd1 += tubpar[2] * 2.;
319
320 conpar[0] = 30./2.;
321 conpar[1] = 20.6/2.;
322 conpar[2] = 21./2.;
323 conpar[3] = 10./2.;
324 conpar[4] = 10.4/2.;
325 gMC->Gsvolu("QC02", "CONE", idtmed[7], conpar, 5);
f853b9aa 326 gMC->Gspos("QC02", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 327 // Ch.debug
328 //printf("\n QC02 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
329
330 zd1 += conpar[0] * 2.;
331
332 tubpar[0] = 20.6/2.;
333 tubpar[1] = 21./2.;
334 tubpar[2] = 450./2.;
335 gMC->Gsvolu("QT07", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 336 gMC->Gspos("QT07", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 337 // Ch.debug
338 //printf("\n QT07 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
339
340 zd1 += tubpar[2] * 2.;
341
342 conpar[0] = 13.6/2.;
343 conpar[1] = 25.4/2.;
344 conpar[2] = 25.8/2.;
345 conpar[3] = 20.6/2.;
346 conpar[4] = 21./2.;
347 gMC->Gsvolu("QC03", "CONE", idtmed[7], conpar, 5);
f853b9aa 348 gMC->Gspos("QC03", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 349 // Ch.debug
350 //printf("\n QC03 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
351
352 zd1 += conpar[0] * 2.;
353
354 tubpar[0] = 25.4/2.;
355 tubpar[1] = 25.8/2.;
356 tubpar[2] = 205.8/2.;
357 gMC->Gsvolu("QT08", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 358 gMC->Gspos("QT08", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 359 // Ch.debug
360 //printf("\n QT08 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
361
362 zd1 += tubpar[2] * 2.;
363
364 tubpar[0] = 50./2.;
365 tubpar[1] = 50.4/2.;
366 // QT09 is 10 cm longer to accomodate TDI
367 tubpar[2] = 515.4/2.;
368 gMC->Gsvolu("QT09", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 369 gMC->Gspos("QT09", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 370 // Ch.debug
371 //printf("\n QT09 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
372
8d433671 373 zd1 += tubpar[2] * 2.;
374
375 tubpar[0] = 50./2.;
376 tubpar[1] = 50.4/2.;
377 // QT10 is 10 cm shorter
378 tubpar[2] = 690./2.;
379 gMC->Gsvolu("QT10", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 380 gMC->Gspos("QT10", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 381 // Ch.debug
382 //printf("\n QT10 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
383
384 zd1 += tubpar[2] * 2.;
385
386 tubpar[0] = 50./2.;
387 tubpar[1] = 50.4/2.;
388 tubpar[2] = 778.5/2.;
389 gMC->Gsvolu("QT11", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 390 gMC->Gspos("QT11", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 391 // Ch.debug
392 //printf("\n QT11 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
393
394 zd1 += tubpar[2] * 2.;
395
396 conpar[0] = 14.18/2.;
397 conpar[1] = 55./2.;
398 conpar[2] = 55.4/2.;
399 conpar[3] = 50./2.;
400 conpar[4] = 50.4/2.;
401 gMC->Gsvolu("QC04", "CONE", idtmed[7], conpar, 5);
f853b9aa 402 gMC->Gspos("QC04", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 403 // Ch.debug
404 //printf("\n QC04 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
405
406 zd1 += conpar[0] * 2.;
407
408 tubpar[0] = 55./2.;
409 tubpar[1] = 55.4/2.;
410 tubpar[2] = 730./2.;
411 gMC->Gsvolu("QT12", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 412 gMC->Gspos("QT12", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 413 // Ch.debug
414 //printf("\n QT12 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
415
416 zd1 += tubpar[2] * 2.;
417
418 conpar[0] = 36.86/2.;
419 conpar[1] = 68./2.;
420 conpar[2] = 68.4/2.;
421 conpar[3] = 55./2.;
422 conpar[4] = 55.4/2.;
423 gMC->Gsvolu("QC05", "CONE", idtmed[7], conpar, 5);
f853b9aa 424 gMC->Gspos("QC05", 1, "ZDCC", 0., 0., -conpar[0]-zd1, 0, "ONLY");
8d433671 425 // Ch.debug
426 //printf("\n QC05 CONE pipe from z = %f to z= %f\n",-zd1,-2*conpar[0]-zd1);
427
428 zd1 += conpar[0] * 2.;
429
430 tubpar[0] = 68./2.;
431 tubpar[1] = 68.4/2.;
432 tubpar[2] = 927.3/2.;
433 gMC->Gsvolu("QT13", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 434 gMC->Gspos("QT13", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 435 // Ch.debug
436 //printf("\n QT13 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
437
438 zd1 += tubpar[2] * 2.;
439
440 tubpar[0] = 0./2.;
441 tubpar[1] = 68.4/2.;
442 tubpar[2] = 0.2/2.;
443 gMC->Gsvolu("QT14", "TUBE", idtmed[8], tubpar, 3);
f853b9aa 444 gMC->Gspos("QT14", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 445 // Ch.debug
446 //printf("\n QT14 TUBE pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
447
448 zd1 += tubpar[2] * 2.;
449
450 tubpar[0] = 0./2.;
451 tubpar[1] = 6.4/2.;
452 tubpar[2] = 0.2/2.;
453 gMC->Gsvolu("QT15", "TUBE", idtmed[11], tubpar, 3);
454 //-- Position QT15 inside QT14
455 gMC->Gspos("QT15", 1, "QT14", -7.7, 0., 0., 0, "ONLY");
456
457 gMC->Gsvolu("QT16", "TUBE", idtmed[11], tubpar, 3);
458 //-- Position QT16 inside QT14
459 gMC->Gspos("QT16", 1, "QT14", 7.7, 0., 0., 0, "ONLY");
460
461
462 //-- BEAM PIPE BETWEEN END OF CONICAL PIPE AND BEGINNING OF D2
463
464 tubpar[0] = 6.4/2.;
465 tubpar[1] = 6.8/2.;
466 tubpar[2] = 680.8/2.;
467 gMC->Gsvolu("QT17", "TUBE", idtmed[7], tubpar, 3);
468
469 tubpar[0] = 6.4/2.;
470 tubpar[1] = 6.8/2.;
471 tubpar[2] = 680.8/2.;
472 gMC->Gsvolu("QT18", "TUBE", idtmed[7], tubpar, 3);
473
474 // -- ROTATE PIPES
475 Float_t angle = 0.143*kDegrad; // Rotation angle
476
477 //AliMatrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
478 gMC->Matrix(im1, 90.+0.143, 0., 90., 90., 0.143, 0.); // x<0
f853b9aa 479 gMC->Gspos("QT17", 1, "ZDCC", TMath::Sin(angle) * 680.8/ 2. - 9.4,
8d433671 480 0., -tubpar[2]-zd1, im1, "ONLY");
2fdd1072 481 //printf("\n QT17-18 pipe from z = %f to z= %f\n",-zd1,-2*tubpar[2]-zd1);
8d433671 482
483 //AliMatrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
484 gMC->Matrix(im2, 90.-0.143, 0., 90., 90., 0.143, 180.); // x>0 (ZP)
f853b9aa 485 gMC->Gspos("QT18", 1, "ZDCC", 9.7 - TMath::Sin(angle) * 680.8 / 2.,
8d433671 486 0., -tubpar[2]-zd1, im2, "ONLY");
2fdd1072 487
488 // -- Luminometer (Cu box) in front of ZN - side C
489 boxpar[0] = 8.0/2.;
490 boxpar[1] = 8.0/2.;
491 boxpar[2] = 15./2.;
492 gMC->Gsvolu("QLUC", "BOX ", idtmed[6], boxpar, 3);
493 gMC->Gspos("QLUC", 1, "ZDCC", 0., 0., fPosZNC[2]+66.+boxpar[2], 0, "ONLY");
494 //printf("\n QLUC LUMINOMETER from z = %f to z= %f\n", fPosZNC[2]+66., fPosZNC[2]+66.+2*boxpar[2]);
8d433671 495
496 // -- END OF BEAM PIPE VOLUME DEFINITION FOR SIDE C (RB26 SIDE)
497 // ----------------------------------------------------------------
498
499 ////////////////////////////////////////////////////////////////
500 // //
501 // SIDE A - RB24 //
502 // //
503 ///////////////////////////////////////////////////////////////
504
505 // Rotation Matrices definition
313e8ff0 506 Int_t irotpipe2, irotpipe1;
507 //Int_t irotpipe5, irotpipe6
508 Int_t irotpipe7, irotpipe8;
8d433671 509 //-- rotation matrices for the tilted tube before and after the TDI
510 gMC->Matrix(irotpipe2,90.+6.3025,0.,90.,90.,6.3025,0.);
511 //-- rotation matrices for the tilted cone after the TDI to recenter vacuum chamber
512 gMC->Matrix(irotpipe1,90.-2.2918,0.,90.,90.,2.2918,180.);
513 //-- rotation matrices for the legs
313e8ff0 514 /*gMC->Matrix(irotpipe5,90.-5.0109,0.,90.,90.,5.0109,180.);
515 gMC->Matrix(irotpipe6,90.+5.0109,0.,90.,90.,5.0109,0.);*/
8d433671 516 gMC->Matrix(irotpipe7,90.-1.0027,0.,90.,90.,1.0027,180.);
517 gMC->Matrix(irotpipe8,90.+1.0027,0.,90.,90.,1.0027,0.);
518
519 // -- Mother of the ZDCs (Vacuum PCON)
6ac9cca5 520 zd2 = 1910.22;// zd2 initial value
8d433671 521
522 conpar[0] = 0.;
523 conpar[1] = 360.;
524 conpar[2] = 2.;
525 conpar[3] = zd2;
526 conpar[4] = 0.;
527 conpar[5] = 55.;
528 conpar[6] = 13500.;
529 conpar[7] = 0.;
530 conpar[8] = 55.;
f853b9aa 531 gMC->Gsvolu("ZDCA", "PCON", idtmed[10], conpar, 9);
532 gMC->Gspos("ZDCA", 1, "ALIC", 0., 0., 0., 0, "ONLY");
8d433671 533
f853b9aa 534 // BEAM PIPE from 19.10 m to inner triplet beginning (22.965 m)
8d433671 535 tubpar[0] = 6.0/2.;
536 tubpar[1] = 6.4/2.;
6ac9cca5 537 tubpar[2] = (386.5 - 0.22)/2.;
cd807e71 538 gMC->Gsvolu("QA01", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 539 gMC->Gspos("QA01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 540 // Ch.debug
f853b9aa 541 //printf("\n QA01 TUBE from z = %f to z= %f (Inner triplet beg.)\n",zd2,2*tubpar[2]+zd2);
8d433671 542
543 zd2 += 2.*tubpar[2];
544
545 // -- FIRST SECTION OF THE BEAM PIPE (from beginning of inner triplet to
f853b9aa 546 // beginning of D1)
8d433671 547 tubpar[0] = 6.3/2.;
548 tubpar[1] = 6.7/2.;
549 tubpar[2] = 3541.8/2.;
cd807e71 550 gMC->Gsvolu("QA02", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 551 gMC->Gspos("QA02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 552 // Ch.debug
f853b9aa 553 //printf("\n QA02 TUBE from z = %f to z= %f (D1 beg.)\n",zd2,2*tubpar[2]+zd2);
8d433671 554
555 zd2 += 2.*tubpar[2];
556
557
558 // -- SECOND SECTION OF THE BEAM PIPE (from the beginning of D1 to the beginning of D2)
559 //
560 // FROM (MAGNETIC) BEGINNING OF D1 TO THE (MAGNETIC) END OF D1 + 126.5 cm
561 // CYLINDRICAL PIPE of diameter increasing from 6.75 cm up to 8.0 cm
562 // from magnetic end :
563 // 1) 80.1 cm still with ID = 6.75 radial beam screen
564 // 2) 2.5 cm conical section from ID = 6.75 to ID = 8.0 cm
565 // 3) 43.9 cm straight section (tube) with ID = 8.0 cm
f853b9aa 566 //
567 //printf("\n Beginning of D1 at z= %f\n",zd2);
8d433671 568
569 tubpar[0] = 6.75/2.;
570 tubpar[1] = 7.15/2.;
571 tubpar[2] = (945.0+80.1)/2.;
cd807e71 572 gMC->Gsvolu("QA03", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 573 gMC->Gspos("QA03", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 574 // Ch.debug
f853b9aa 575 //printf("\n QA03 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 576
577 zd2 += 2.*tubpar[2];
578
579 // Transition Cone from ID=67.5 mm to ID=80 mm
8d433671 580 conpar[0] = 2.5/2.;
581 conpar[1] = 6.75/2.;
582 conpar[2] = 7.15/2.;
583 conpar[3] = 8.0/2.;
584 conpar[4] = 8.4/2.;
cd807e71 585 gMC->Gsvolu("QA04", "CONE", idtmed[7], conpar, 5);
f853b9aa 586 gMC->Gspos("QA04", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
587 //printf(" QA04 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 588
589 zd2 += 2.*conpar[0];
590
591 tubpar[0] = 8.0/2.;
592 tubpar[1] = 8.4/2.;
593 tubpar[2] = 43.9/2.;
cd807e71 594 gMC->Gsvolu("QA05", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 595 gMC->Gspos("QA05", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 596 // Ch.debug
f853b9aa 597 //printf("\n QA05 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 598
599 zd2 += 2.*tubpar[2];
8d433671 600
601 // Bellow (ID=80 mm) - length = 0.2 m - VMAA
8d433671 602 tubpar[0] = 8.0/2.;
603 tubpar[1] = 8.4/2.;
604 tubpar[2] = 20./2.;
cd807e71 605 gMC->Gsvolu("QA06", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 606 gMC->Gspos("QA06", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 607 // Ch.debug
f853b9aa 608 //printf(" QA06 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 609
610 zd2 += 2.*tubpar[2];
611
f853b9aa 612 // Beam Position Monitor (ID=80 mm) Cu - BPMSX
8d433671 613 tubpar[0] = 8.0/2.;
614 tubpar[1] = 8.4/2.;
615 tubpar[2] = 28.5/2.;
cd807e71 616 gMC->Gsvolu("QA07", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 617 gMC->Gspos("QA07", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 618 // Ch.debug
f853b9aa 619 //printf(" QA07 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 620
621 zd2 += 2.*tubpar[2];
622
f853b9aa 623 // First section of VAEHI (tube ID=80mm)
8d433671 624 tubpar[0] = 8.0/2.;
625 tubpar[1] = 8.4/2.;
626 tubpar[2] = 28.5/2.;
cd807e71 627 gMC->Gsvolu("QAV1", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 628 gMC->Gspos("QAV1", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 629 // Ch.debug
f853b9aa 630 //printf(" QAV1 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 631
632 zd2 += 2.*tubpar[2];
633
f853b9aa 634 // Second section of VAEHI (transition cone from ID=80mm to ID=98mm)
8d433671 635 conpar[0] = 4.0/2.;
636 conpar[1] = 8.0/2.;
637 conpar[2] = 8.4/2.;
638 conpar[3] = 9.8/2.;
639 conpar[4] = 10.2/2.;
cd807e71 640 gMC->Gsvolu("QAV2", "CONE", idtmed[7], conpar, 5);
f853b9aa 641 gMC->Gspos("QAV2", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
642 //printf(" QAV2 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 643
644 zd2 += 2.*conpar[0];
645
f853b9aa 646 //Third section of VAEHI (transition cone from ID=98mm to ID=90mm)
8d433671 647 conpar[0] = 1.0/2.;
648 conpar[1] = 9.8/2.;
649 conpar[2] = 10.2/2.;
650 conpar[3] = 9.0/2.;
651 conpar[4] = 9.4/2.;
cd807e71 652 gMC->Gsvolu("QAV3", "CONE", idtmed[7], conpar, 5);
f853b9aa 653 gMC->Gspos("QAV3", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
654 //printf(" QAV3 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 655
656 zd2 += 2.*conpar[0];
657
f853b9aa 658 // Fourth section of VAEHI (tube ID=90mm)
8d433671 659 tubpar[0] = 9.0/2.;
660 tubpar[1] = 9.4/2.;
661 tubpar[2] = 31.0/2.;
cd807e71 662 gMC->Gsvolu("QAV4", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 663 gMC->Gspos("QAV4", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 664 // Ch.debug
f853b9aa 665 //printf(" QAV4 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 666
667 zd2 += 2.*tubpar[2];
668
8d433671 669 //---------------------------- TCDD beginning ----------------------------------
670 // space for the insertion of the collimator TCDD (2 m)
8d433671 671 // TCDD ZONE - 1st volume
672 conpar[0] = 1.3/2.;
673 conpar[1] = 9.0/2.;
674 conpar[2] = 13.0/2.;
675 conpar[3] = 9.6/2.;
676 conpar[4] = 13.0/2.;
cd807e71 677 gMC->Gsvolu("Q01T", "CONE", idtmed[7], conpar, 5);
f853b9aa 678 gMC->Gspos("Q01T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
679 //printf(" Q01T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 680
681 zd2 += 2.*conpar[0];
682
683 // TCDD ZONE - 2nd volume
684 tubpar[0] = 9.6/2.;
685 tubpar[1] = 10.0/2.;
686 tubpar[2] = 1.0/2.;
cd807e71 687 gMC->Gsvolu("Q02T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 688 gMC->Gspos("Q02T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 689 // Ch.debug
f853b9aa 690 //printf(" Q02T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 691
692 zd2 += 2.*tubpar[2];
693
694 // TCDD ZONE - third volume
695 conpar[0] = 9.04/2.;
696 conpar[1] = 9.6/2.;
697 conpar[2] = 10.0/2.;
698 conpar[3] = 13.8/2.;
699 conpar[4] = 14.2/2.;
cd807e71 700 gMC->Gsvolu("Q03T", "CONE", idtmed[7], conpar, 5);
f853b9aa 701 gMC->Gspos("Q03T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
702 //printf(" Q03T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 703
704 zd2 += 2.*conpar[0];
705
706 // TCDD ZONE - 4th volume
707 tubpar[0] = 13.8/2.;
708 tubpar[1] = 14.2/2.;
709 tubpar[2] = 38.6/2.;
cd807e71 710 gMC->Gsvolu("Q04T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 711 gMC->Gspos("Q04T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 712 // Ch.debug
f853b9aa 713 //printf(" Q04T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 714
715 zd2 += 2.*tubpar[2];
716
717 // TCDD ZONE - 5th volume
718 tubpar[0] = 21.0/2.;
719 tubpar[1] = 21.4/2.;
720 tubpar[2] = 100.12/2.;
cd807e71 721 gMC->Gsvolu("Q05T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 722 gMC->Gspos("Q05T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 723 // Ch.debug
f853b9aa 724 //printf(" Q05T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 725
726 zd2 += 2.*tubpar[2];
727
728 // TCDD ZONE - 6th volume
729 tubpar[0] = 13.8/2.;
730 tubpar[1] = 14.2/2.;
731 tubpar[2] = 38.6/2.;
cd807e71 732 gMC->Gsvolu("Q06T", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 733 gMC->Gspos("Q06T", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 734 // Ch.debug
f853b9aa 735 //printf(" Q06T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 736
737 zd2 += 2.*tubpar[2];
738
739 // TCDD ZONE - 7th volume
740 conpar[0] = 11.34/2.;
741 conpar[1] = 13.8/2.;
742 conpar[2] = 14.2/2.;
743 conpar[3] = 18.0/2.;
744 conpar[4] = 18.4/2.;
cd807e71 745 gMC->Gsvolu("Q07T", "CONE", idtmed[7], conpar, 5);
f853b9aa 746 gMC->Gspos("Q07T", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
747 //printf(" Q07T CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 748
749 zd2 += 2.*conpar[0];
750
f853b9aa 751 // Upper section : one single phi segment of a tube
752 // 5 parameters for tubs: inner radius = 0.,
753 // outer radius = 7.5 cm, half length = 50 cm
754 // phi1 = 0., phi2 = 180.
8d433671 755 tubspar[0] = 0.0/2.;
756 tubspar[1] = 15.0/2.;
757 tubspar[2] = 100.0/2.;
758 tubspar[3] = 0.;
759 tubspar[4] = 180.;
cd807e71 760 gMC->Gsvolu("Q08T", "TUBS", idtmed[7], tubspar, 5);
8d433671 761 // Ch.debug
f853b9aa 762 //printf("\n upper part : one single phi segment of a tube (Q08T)\n");
763
764 // rectangular beam pipe inside TCDD upper section (Vacuum)
8d433671 765 boxpar[0] = 7.0/2.;
766 boxpar[1] = 2.5/2.;
767 boxpar[2] = 100./2.;
768 gMC->Gsvolu("Q09T", "BOX ", idtmed[10], boxpar, 3);
f853b9aa 769 // positioning vacuum box in the upper section of TCDD
8d433671 770 gMC->Gspos("Q09T", 1, "Q08T", 0., 1.25, 0., 0, "ONLY");
771
f853b9aa 772 // lower section : one single phi segment of a tube
8d433671 773 tubspar[0] = 0.0/2.;
774 tubspar[1] = 15.0/2.;
775 tubspar[2] = 100.0/2.;
776 tubspar[3] = 180.;
777 tubspar[4] = 360.;
cd807e71 778 gMC->Gsvolu("Q10T", "TUBS", idtmed[7], tubspar, 5);
f853b9aa 779 // rectangular beam pipe inside TCDD lower section (Vacuum)
8d433671 780 boxpar[0] = 7.0/2.;
781 boxpar[1] = 2.5/2.;
782 boxpar[2] = 100./2.;
783 gMC->Gsvolu("Q11T", "BOX ", idtmed[10], boxpar, 3);
f853b9aa 784 // positioning vacuum box in the lower section of TCDD
8d433671 785 gMC->Gspos("Q11T", 1, "Q10T", 0., -1.25, 0., 0, "ONLY");
786
787 // positioning TCDD elements in ZDC2, (inside TCDD volume)
f853b9aa 788 gMC->Gspos("Q08T", 1, "ZDCA", 0., 2.5, -100+zd2, 0, "ONLY");
789 gMC->Gspos("Q10T", 1, "ZDCA", 0., -2.5, -100+zd2, 0, "ONLY");
8d433671 790
791 // RF screen
792 boxpar[0] = 0.2/2.;
793 boxpar[1] = 5.0/2.;
794 boxpar[2] = 100./2.;
cd807e71 795 gMC->Gsvolu("Q12T", "BOX ", idtmed[7], boxpar, 3);
8d433671 796 // positioning RF screen at both sides of TCDD
f853b9aa 797 gMC->Gspos("Q12T", 1, "ZDCA", tubspar[1]+boxpar[0], 0., -100+zd2, 0, "ONLY");
798 gMC->Gspos("Q12T", 2, "ZDCA", -tubspar[1]-boxpar[0], 0., -100+zd2, 0, "ONLY");
8d433671 799 //---------------------------- TCDD end ---------------------------------------
800
801 // Bellow (ID=80 mm) - length = 0.3 m - VMAAB
802 tubpar[0] = 8.0/2.;
803 tubpar[1] = 8.4/2.;
804 tubpar[2] = 30.0/2.;
cd807e71 805 gMC->Gsvolu("QA08", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 806 gMC->Gspos("QA08", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 807 // Ch.debug
f853b9aa 808 //printf(" QA08 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 809
810 zd2 += 2.*tubpar[2];
811
f853b9aa 812 // Flange (ID=80 mm) Cu (first section of VCTCE)
8d433671 813 tubpar[0] = 8.0/2.;
814 tubpar[1] = 8.4/2.;
815 tubpar[2] = 2.0/2.;
cd807e71 816 gMC->Gsvolu("QA09", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 817 gMC->Gspos("QA09", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 818 // Ch.debug
f853b9aa 819 //printf(" QA09 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 820
821 zd2 += 2.*tubpar[2];
822
f853b9aa 823 // transition cone from ID=80 to ID=212 (second section of VCTCE)
8d433671 824 conpar[0] = 25.0/2.;
825 conpar[1] = 8.0/2.;
826 conpar[2] = 8.4/2.;
827 conpar[3] = 21.2/2.;
828 conpar[4] = 21.8/2.;
cd807e71 829 gMC->Gsvolu("QA10", "CONE", idtmed[7], conpar, 5);
f853b9aa 830 gMC->Gspos("QA10", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
831 //printf(" QA10 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 832
833 zd2 += 2.*conpar[0];
834
f853b9aa 835 // tube (ID=212 mm) Cu (third section of VCTCE)
8d433671 836 tubpar[0] = 21.2/2.;
837 tubpar[1] = 21.8/2.;
838 tubpar[2] = 403.54/2.;
cd807e71 839 gMC->Gsvolu("QA11", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 840 gMC->Gspos("QA11", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 841 // Ch.debug
f853b9aa 842 //printf(" QA11 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 843
844 zd2 += 2.*tubpar[2];
845
846 // bellow (ID=212 mm) (VMBGA)
8d433671 847 tubpar[0] = 21.2/2.;
848 tubpar[1] = 21.8/2.;
849 tubpar[2] = 40.0/2.;
cd807e71 850 gMC->Gsvolu("QA12", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 851 gMC->Gspos("QA12", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 852 // Ch.debug
f853b9aa 853 //printf(" QA12 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 854
855 zd2 += 2.*tubpar[2];
856
857 // TDI valve assembly (ID=212 mm)
8d433671 858 tubpar[0] = 21.2/2.;
859 tubpar[1] = 21.8/2.;
860 tubpar[2] = 30.0/2.;
cd807e71 861 gMC->Gsvolu("QA13", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 862 gMC->Gspos("QA13", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 863 // Ch.debug
f853b9aa 864 //printf(" QA13 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 865
866 zd2 += 2.*tubpar[2];
867
868 // bellow (ID=212 mm) (VMBGA)
8d433671 869 tubpar[0] = 21.2/2.;
870 tubpar[1] = 21.8/2.;
871 tubpar[2] = 40.0/2.;
cd807e71 872 gMC->Gsvolu("QA14", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 873 gMC->Gspos("QA14", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 874 // Ch.debug
f853b9aa 875 //printf(" QA14 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 876
877 zd2 += 2.*tubpar[2];
878
879 // skewed transition piece (ID=212 mm) (before TDI)
8d433671 880 tubpar[0] = 21.2/2.;
881 tubpar[1] = 21.8/2.;
8e622ffc 882 tubpar[2] = (20.0-2.41)/2.;
cd807e71 883 gMC->Gsvolu("QA15", "TUBE", idtmed[7], tubpar, 3);
8e622ffc 884 gMC->Gspos("QA15", 1, "ZDCA", 1.10446, 0., tubpar[2]+2.41/2.+zd2, irotpipe2, "ONLY");
8d433671 885 // Ch.debug
8e622ffc 886 //printf(" QA15 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+2.41+zd2);
8d433671 887
8e622ffc 888 zd2 += 2.*tubpar[2]+2.41;
8d433671 889
f853b9aa 890 // Vacuum chamber containing TDI
1243078f 891 tubpar[0] = 0.;
892 tubpar[1] = 54.6/2.;
893 tubpar[2] = 540.0/2.;
894 gMC->Gsvolu("Q13TM", "TUBE", idtmed[10], tubpar, 3);
895 gMC->Gspos("Q13TM", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 896 tubpar[0] = 54.0/2.;
897 tubpar[1] = 54.6/2.;
898 tubpar[2] = 540.0/2.;
cd807e71 899 gMC->Gsvolu("Q13T", "TUBE", idtmed[7], tubpar, 3);
1243078f 900 gMC->Gspos("Q13T", 1, "Q13TM", 0., 0., 0., 0, "ONLY");
8d433671 901 // Ch.debug
f853b9aa 902 //printf(" Q13T TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 903
904 zd2 += 2.*tubpar[2];
905
f853b9aa 906 //---------------- INSERT TDI INSIDE Q13T -----------------------------------
8d433671 907 boxpar[0] = 11.0/2.;
908 boxpar[1] = 9.0/2.;
909 boxpar[2] = 540.0/2.;
cd807e71 910 gMC->Gsvolu("QTD1", "BOX ", idtmed[7], boxpar, 3);
1243078f 911 gMC->Gspos("QTD1", 1, "Q13TM", -3.8, 10.5, 0., 0, "ONLY");
8d433671 912 boxpar[0] = 11.0/2.;
913 boxpar[1] = 9.0/2.;
914 boxpar[2] = 540.0/2.;
cd807e71 915 gMC->Gsvolu("QTD2", "BOX ", idtmed[7], boxpar, 3);
1243078f 916 gMC->Gspos("QTD2", 1, "Q13TM", -3.8, -10.5, 0., 0, "ONLY");
8d433671 917 boxpar[0] = 5.1/2.;
918 boxpar[1] = 0.2/2.;
919 boxpar[2] = 540.0/2.;
cd807e71 920 gMC->Gsvolu("QTD3", "BOX ", idtmed[7], boxpar, 3);
1243078f 921 gMC->Gspos("QTD3", 1, "Q13TM", -3.8+5.5+boxpar[0], 6.1, 0., 0, "ONLY");
922 gMC->Gspos("QTD3", 2, "Q13TM", -3.8+5.5+boxpar[0], -6.1, 0., 0, "ONLY");
923 gMC->Gspos("QTD3", 3, "Q13TM", -3.8-5.5-boxpar[0], 6.1, 0., 0, "ONLY");
924 gMC->Gspos("QTD3", 4, "Q13TM", -3.8-5.5-boxpar[0], -6.1, 0., 0, "ONLY");
f853b9aa 925 //
8d433671 926 tubspar[0] = 12.0/2.;
927 tubspar[1] = 12.4/2.;
928 tubspar[2] = 540.0/2.;
929 tubspar[3] = 90.;
930 tubspar[4] = 270.;
cd807e71 931 gMC->Gsvolu("QTD4", "TUBS", idtmed[7], tubspar, 5);
1243078f 932 gMC->Gspos("QTD4", 1, "Q13TM", -3.8-10.6, 0., 0., 0, "ONLY");
8d433671 933 tubspar[0] = 12.0/2.;
934 tubspar[1] = 12.4/2.;
935 tubspar[2] = 540.0/2.;
936 tubspar[3] = -90.;
937 tubspar[4] = 90.;
cd807e71 938 gMC->Gsvolu("QTD5", "TUBS", idtmed[7], tubspar, 5);
1243078f 939 gMC->Gspos("QTD5", 1, "Q13TM", -3.8+10.6, 0., 0., 0, "ONLY");
8d433671 940 //---------------- END DEFINING TDI INSIDE Q13T -------------------------------
941
942 // skewed transition piece (ID=212 mm) (after TDI)
943 tubpar[0] = 21.2/2.;
944 tubpar[1] = 21.8/2.;
8e622ffc 945 tubpar[2] = (20.0-2.41)/2.;
cd807e71 946 gMC->Gsvolu("QA16", "TUBE", idtmed[7], tubpar, 3);
8e622ffc 947 gMC->Gspos("QA16", 1, "ZDCA", 1.10446+2.2, 0., tubpar[2]+2.41/2.+zd2, irotpipe2, "ONLY");
8d433671 948 // Ch.debug
8e622ffc 949 //printf(" QA16 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+2.41+zd2);
8d433671 950
8e622ffc 951 zd2 += 2.*tubpar[2]+2.41;
8d433671 952
953 // bellow (ID=212 mm) (VMBGA)
954 tubpar[0] = 21.2/2.;
955 tubpar[1] = 21.8/2.;
956 tubpar[2] = 40.0/2.;
cd807e71 957 gMC->Gsvolu("QA17", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 958 gMC->Gspos("QA17", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 959 // Ch.debug
f853b9aa 960 //printf(" QA17 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 961
962 zd2 += 2.*tubpar[2];
963
964 // TDI valve assembly (ID=212 mm)
965 tubpar[0] = 21.2/2.;
966 tubpar[1] = 21.8/2.;
967 tubpar[2] = 30.0/2.;
cd807e71 968 gMC->Gsvolu("QA18", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 969 gMC->Gspos("QA18", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 970 // Ch.debug
f853b9aa 971 //printf(" QA18 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 972
973 zd2 += 2.*tubpar[2];
974
975 // bellow (ID=212 mm) (VMBGA)
976 tubpar[0] = 21.2/2.;
977 tubpar[1] = 21.8/2.;
978 tubpar[2] = 40.0/2.;
cd807e71 979 gMC->Gsvolu("QA19", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 980 gMC->Gspos("QA19", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 981 // Ch.debug
f853b9aa 982 //printf(" QA19 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 983
984 zd2 += 2.*tubpar[2];
985
986 // vacuum chamber (ID=212 mm) (BTVST)
987 tubpar[0] = 21.2/2.;
988 tubpar[1] = 21.8/2.;
989 tubpar[2] = 50.0/2.;
cd807e71 990 gMC->Gsvolu("QA20", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 991 gMC->Gspos("QA20", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 992 // Ch.debug
f853b9aa 993 //printf(" QA20 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 994
995 zd2 += 2.*tubpar[2];
996
997 // bellow (ID=212 mm) (VMBGA) repeated 3 times
998 tubpar[0] = 21.2/2.;
999 tubpar[1] = 21.8/2.;
1000 tubpar[2] = 120.0/2.;
cd807e71 1001 gMC->Gsvolu("QA21", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1002 gMC->Gspos("QA21", 1, "ZDCA", 4.4, 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1003 // Ch.debug
f853b9aa 1004 //printf(" QA21 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1005
1006 zd2 += 2.*tubpar[2];
1007
1008 // skewed transition cone from ID=212 mm to ID=797 mm SS for the moment
f2e00220 1009 conpar[0] = (110.0-0.44-1.63)/2.;
8d433671 1010 conpar[1] = 21.2/2.;
1011 conpar[2] = 21.8/2.;
1012 conpar[3] = 79.7/2.;
1013 conpar[4] = 81.3/2.;
cd807e71 1014 gMC->Gsvolu("QA22", "CONE", idtmed[7], conpar, 5);
f2e00220 1015 gMC->Gspos("QA22", 1, "ZDCA", 4.4-2.201, 0., conpar[0]+0.44+zd2, irotpipe1, "ONLY");
1016 //printf(" QA22 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+0.44+1.63+zd2);
8d433671 1017
f2e00220 1018 zd2 += 2.*conpar[0]+0.44+1.63;
8d433671 1019
1020 // beam pipe (ID=797 mm) SS
1021 tubpar[0] = 79.7/2.;
1022 tubpar[1] = 81.3/2.;
1023 tubpar[2] = 2393.05/2.;
cd807e71 1024 gMC->Gsvolu("QA23", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1025 gMC->Gspos("QA23", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1026 // Ch.debug
9c374a22 1027 //printf(" QA23 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1028
1029 zd2 += 2.*tubpar[2];
1030
1031 // Transition from ID=797 mm to ID=196 mm SS for the moment:
1032 //
1033 // in order to simulate the thin window opened in the transition cone
1034 // we divide the transition cone in three cones:
1035 // the first 8 mm thick
1036 // the second 3 mm thick
1037 // the third 8 mm thick
f853b9aa 1038 //
1039 // First section
8d433671 1040 conpar[0] = 9.09/2.; // 15 degree
1041 conpar[1] = 79.7/2.;
1042 conpar[2] = 81.3/2.; // thickness 8 mm
1043 conpar[3] = 74.82868/2.;
1044 conpar[4] = 76.42868/2.; // thickness 8 mm
cd807e71 1045 gMC->Gsvolu("Q24A", "CONE", idtmed[7], conpar, 5);
f853b9aa 1046 gMC->Gspos("Q24A", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1047 //printf(" Q24A CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1048
1049 zd2 += 2.*conpar[0];
1050
f853b9aa 1051 // Second section
8d433671 1052 conpar[0] = 96.2/2.; // 15 degree
1053 conpar[1] = 74.82868/2.;
1054 conpar[2] = 75.42868/2.; // thickness 3 mm
1055 conpar[3] = 23.19588/2.;
1056 conpar[4] = 23.79588/2.; // thickness 3 mm
cd807e71 1057 gMC->Gsvolu("QA25", "CONE", idtmed[7], conpar, 5);
f853b9aa 1058 gMC->Gspos("QA25", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1059 //printf(" QA25 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1060
1061 zd2 += 2.*conpar[0];
1062
f853b9aa 1063 // Third section
8d433671 1064 conpar[0] = 6.71/2.; // 15 degree
1065 conpar[1] = 23.19588/2.;
1066 conpar[2] = 24.79588/2.;// thickness 8 mm
1067 conpar[3] = 19.6/2.;
1068 conpar[4] = 21.2/2.;// thickness 8 mm
cd807e71 1069 gMC->Gsvolu("QA26", "CONE", idtmed[7], conpar, 5);
f853b9aa 1070 gMC->Gspos("QA26", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
1071 //printf(" QA26 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1072
1073 zd2 += 2.*conpar[0];
1074
1075 // beam pipe (ID=196 mm)
1076 tubpar[0] = 19.6/2.;
1077 tubpar[1] = 21.2/2.;
1078 tubpar[2] = 9.55/2.;
cd807e71 1079 gMC->Gsvolu("QA27", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1080 gMC->Gspos("QA27", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1081 // Ch.debug
f853b9aa 1082 //printf(" QA27 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1083
1084 zd2 += 2.*tubpar[2];
1085
1086 // Flange (ID=196 mm)
1087 tubpar[0] = 19.6/2.;
1088 tubpar[1] = 25.3/2.;
1089 tubpar[2] = 4.9/2.;
cd807e71 1090 gMC->Gsvolu("QF01", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1091 gMC->Gspos("QF01", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1092 // Ch.debug
f853b9aa 1093 //printf(" QF01 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1094
1095 zd2 += 2.*tubpar[2];
1096
1097 // Special Warm Module (made by 5 volumes)
8d433671 1098 tubpar[0] = 20.2/2.;
1099 tubpar[1] = 20.6/2.;
1100 tubpar[2] = 2.15/2.;
cd807e71 1101 gMC->Gsvolu("QA28", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1102 gMC->Gspos("QA28", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1103 // Ch.debug
f853b9aa 1104 //printf(" QA28 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1105
1106 zd2 += 2.*tubpar[2];
1107
1108 conpar[0] = 6.9/2.;
1109 conpar[1] = 20.2/2.;
1110 conpar[2] = 20.6/2.;
1111 conpar[3] = 23.9/2.;
1112 conpar[4] = 24.3/2.;
cd807e71 1113 gMC->Gsvolu("QA29", "CONE", idtmed[7], conpar, 5);
f853b9aa 1114 gMC->Gspos("QA29", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
8d433671 1115 // Ch.debug
f853b9aa 1116 //printf(" QA29 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1117
1118 zd2 += 2.*conpar[0];
1119
1120 tubpar[0] = 23.9/2.;
1121 tubpar[1] = 25.5/2.;
1122 tubpar[2] = 17.0/2.;
cd807e71 1123 gMC->Gsvolu("QA30", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1124 gMC->Gspos("QA30", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1125 // Ch.debug
f853b9aa 1126 //printf(" QA30 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1127
1128 zd2 += 2.*tubpar[2];
1129
1130 conpar[0] = 6.9/2.;
1131 conpar[1] = 23.9/2.;
1132 conpar[2] = 24.3/2.;
1133 conpar[3] = 20.2/2.;
1134 conpar[4] = 20.6/2.;
cd807e71 1135 gMC->Gsvolu("QA31", "CONE", idtmed[7], conpar, 5);
f853b9aa 1136 gMC->Gspos("QA31", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
8d433671 1137 // Ch.debug
f853b9aa 1138 //printf(" QA31 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1139
1140 zd2 += 2.*conpar[0];
1141
1142 tubpar[0] = 20.2/2.;
1143 tubpar[1] = 20.6/2.;
1144 tubpar[2] = 2.15/2.;
cd807e71 1145 gMC->Gsvolu("QA32", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1146 gMC->Gspos("QA32", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1147 // Ch.debug
f853b9aa 1148 //printf(" QA32 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1149
1150 zd2 += 2.*tubpar[2];
1151
1152 // Flange (ID=196 mm)
1153 tubpar[0] = 19.6/2.;
1154 tubpar[1] = 25.3/2.;
1155 tubpar[2] = 4.9/2.;
cd807e71 1156 gMC->Gsvolu("QF02", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1157 gMC->Gspos("QF02", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1158 // Ch.debug
f853b9aa 1159 //printf(" QF02 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1160
1161 zd2 += 2.*tubpar[2];
1162
1163 // simulation of the trousers (VCTYB)
addda976 1164 // (last design -mail 3/6/05)
8d433671 1165 // pipe: a tube (ID = 196. OD = 200.)
1166 tubpar[0] = 19.6/2.;
1167 tubpar[1] = 20.0/2.;
1168 tubpar[2] = 3.9/2.;
cd807e71 1169 gMC->Gsvolu("QA33", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1170 gMC->Gspos("QA33", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1171 // Ch.debug
f853b9aa 1172 //printf(" QA33 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1173
1174 zd2 += 2.*tubpar[2];
1175
1176 // transition cone from ID=196. to ID=216.6
1177 conpar[0] = 32.55/2.;
1178 conpar[1] = 19.6/2.;
1179 conpar[2] = 20.0/2.;
1180 conpar[3] = 21.66/2.;
1181 conpar[4] = 22.06/2.;
cd807e71 1182 gMC->Gsvolu("QA34", "CONE", idtmed[7], conpar, 5);
f853b9aa 1183 gMC->Gspos("QA34", 1, "ZDCA", 0., 0., conpar[0]+zd2, 0, "ONLY");
8d433671 1184 // Ch.debug
f853b9aa 1185 //printf(" QA34 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+zd2);
8d433671 1186
71cd8104 1187 zd2 += 2.*conpar[0];
8d433671 1188
1189 // tube
1190 tubpar[0] = 21.66/2.;
1191 tubpar[1] = 22.06/2.;
1192 tubpar[2] = 28.6/2.;
cd807e71 1193 gMC->Gsvolu("QA35", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1194 gMC->Gspos("QA35", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1195 // Ch.debug
f853b9aa 1196 //printf("\n QA35 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1197
1198 zd2 += 2.*tubpar[2];
1199
313e8ff0 1200 // --------------------------------------------------------
1201 // RECOMBINATION CHAMBER IMPLEMENTED USING TGeo CLASSES!!!!
1202 // author: Chiara (June 2008)
1203 // --------------------------------------------------------
1204 // TRANSFORMATION MATRICES
1205 // Combi transformation:
1206 Double_t dx = -3.970000;
1207 Double_t dy = 0.000000;
1208 Double_t dz = 0.0;
1209 // Rotation:
1210 Double_t thx = 84.989100; Double_t phx = 0.000000;
1211 Double_t thy = 90.000000; Double_t phy = 90.000000;
1212 Double_t thz = 5.010900; Double_t phz = 180.000000;
1213 TGeoRotation *rotMatrix1 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1214 // Combi transformation:
1215 dx = -3.970000;
1216 dy = 0.000000;
1217 dz = 0.0;
1218 TGeoCombiTrans *rotMatrix2 = new TGeoCombiTrans("ZDC_c1", dx,dy,dz,rotMatrix1);
1219 rotMatrix2->RegisterYourself();
1220 // Combi transformation:
1221 dx = 3.970000;
1222 dy = 0.000000;
1223 dz = 0.0;
1224 // Rotation:
1225 thx = 95.010900; phx = 0.000000;
1226 thy = 90.000000; phy = 90.000000;
1227 thz = 5.010900; phz = 0.000000;
1228 TGeoRotation *rotMatrix3 = new TGeoRotation("",thx,phx,thy,phy,thz,phz);
1229 TGeoCombiTrans *rotMatrix4 = new TGeoCombiTrans("ZDC_c2", dx,dy,dz,rotMatrix3);
1230 rotMatrix4->RegisterYourself();
1231
1232 // VOLUMES DEFINITION
1233 // Volume: ZDCA
1234 TGeoVolume *pZDCA = gGeoManager->GetVolume("ZDCA");
1235 gGeoManager->SetTopVolume(pZDCA);
1236 //pZDCA->PrintNodes();
1237
f2e00220 1238 conpar[0] = (90.1-0.95-0.26)/2.;
8d433671 1239 conpar[1] = 0.0/2.;
1240 conpar[2] = 21.6/2.;
1241 conpar[3] = 0.0/2.;
1242 conpar[4] = 5.8/2.;
313e8ff0 1243 TGeoShape *pConeExt = new TGeoCone("QALext", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
8d433671 1244
f2e00220 1245 conpar[0] = (90.1-0.95-0.26)/2.;
8d433671 1246 conpar[1] = 0.0/2.;
1247 conpar[2] = 21.2/2.;
1248 conpar[3] = 0.0/2.;
1249 conpar[4] = 5.4/2.;
313e8ff0 1250 TGeoShape *pConeInt = new TGeoCone("QALint", conpar[0],conpar[1],conpar[2],conpar[3],conpar[4]);
1251
1252 // Outer trousers
1253 TGeoCompositeShape *pOutTrousers = new TGeoCompositeShape("outTrousers", "QALext:ZDC_c1+QALext:ZDC_c2");
1254
1255 // Volume: QALext
1256 TGeoMedium *medZDCFe = gGeoManager->GetMedium("ZDC_ZIRON");
1257 TGeoVolume *pQALext = new TGeoVolume("QALext",pOutTrousers, medZDCFe);
1258 pQALext->SetLineColor(5);
1259 pQALext->SetVisLeaves(kTRUE);
1260 //
1261 TGeoTranslation *tr1 = new TGeoTranslation(0., 0., (Double_t) conpar[0]+0.95+zd2);
1262 pZDCA->AddNode(pQALext, 1, tr1);
1263 // Inner trousers
1264 TGeoCompositeShape *pIntTrousers = new TGeoCompositeShape("intTrousers", "QALint:ZDC_c1+QALint:ZDC_c2");
1265 // Volume: QALint
1266 TGeoMedium *medZDCvoid = gGeoManager->GetMedium("ZDC_ZVOID");
1267 TGeoVolume *pQALint = new TGeoVolume("QALint",pIntTrousers, medZDCvoid);
1268 pQALint->SetLineColor(7);
1269 pQALint->SetVisLeaves(kTRUE);
1270 pQALext->AddNode(pQALint, 1);
8d433671 1271
8d433671 1272 zd2 += 90.1;
1273
f853b9aa 1274 // second section : 2 tubes (ID = 54. OD = 58.)
8d433671 1275 tubpar[0] = 5.4/2.;
1276 tubpar[1] = 5.8/2.;
1277 tubpar[2] = 40.0/2.;
cd807e71 1278 gMC->Gsvolu("QA36", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1279 gMC->Gspos("QA36", 1, "ZDCA", -15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
1280 gMC->Gspos("QA36", 2, "ZDCA", 15.8/2., 0., tubpar[2]+zd2, 0, "ONLY");
8d433671 1281 // Ch.debug
f853b9aa 1282 //printf(" QA36 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1283
1284 zd2 += 2.*tubpar[2];
1285
1286 // transition x2zdc to recombination chamber : skewed cone
8e622ffc 1287 conpar[0] = (10.-0.2)/2.;
8d433671 1288 conpar[1] = 5.4/2.;
1289 conpar[2] = 5.8/2.;
1290 conpar[3] = 6.3/2.;
1291 conpar[4] = 7.0/2.;
cd807e71 1292 gMC->Gsvolu("QA37", "CONE", idtmed[7], conpar, 5);
8e622ffc 1293 gMC->Gspos("QA37", 1, "ZDCA", -7.9-0.175, 0., conpar[0]+0.1+zd2, irotpipe7, "ONLY");
1294 gMC->Gspos("QA37", 2, "ZDCA", 7.9+0.175, 0., conpar[0]+0.1+zd2, irotpipe8, "ONLY");
1295 //printf(" QA37 CONE from z = %f to z= %f\n",zd2,2*conpar[0]+0.2+zd2);
8d433671 1296
8e622ffc 1297 zd2 += 2.*conpar[0]+0.2;
8d433671 1298
8d433671 1299 // 2 tubes (ID = 63 mm OD=70 mm)
1300 tubpar[0] = 6.3/2.;
1301 tubpar[1] = 7.0/2.;
1302 tubpar[2] = 512.9/2.;
cd807e71 1303 gMC->Gsvolu("QA38", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1304 gMC->Gspos("QA38", 1, "ZDCA", -16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1305 gMC->Gspos("QA38", 2, "ZDCA", 16.5/2., 0., tubpar[2]+zd2, 0, "ONLY");
1306 //printf(" QA38 TUBE from z = %f to z= %f\n",zd2,2*tubpar[2]+zd2);
8d433671 1307
1308 zd2 += 2.*tubpar[2];
f853b9aa 1309 //printf("\n END OF BEAM PIPE VOLUME DEFINITION AT z= %f\n",zd2);
2fdd1072 1310
1311 // -- Luminometer (Cu box) in front of ZN - side A
1312 boxpar[0] = 8.0/2.;
1313 boxpar[1] = 8.0/2.;
1314 boxpar[2] = 15./2.;
cd807e71 1315 gMC->Gsvolu("QLUA", "BOX ", idtmed[7], boxpar, 3);
2fdd1072 1316 gMC->Gspos("QLUA", 1, "ZDCA", 0., 0., fPosZNA[2]-66.-boxpar[2], 0, "ONLY");
1317 //printf("\n QLUC LUMINOMETER from z = %f to z= %f\n\n", fPosZNA[2]-66., fPosZNA[2]-66.-2*boxpar[2]);
8d433671 1318
1319
1320 // ----------------------------------------------------------------
1321 // -- MAGNET DEFINITION -> LHC OPTICS 6.5
1322 // ----------------------------------------------------------------
1323 // ***************************************************************
1324 // SIDE C - RB26 (dimuon side)
1325 // ***************************************************************
1326 // -- COMPENSATOR DIPOLE (MBXW)
b6a8f9f1 1327 zc = 1972.5;
8d433671 1328
1329 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1330 tubpar[0] = 0.;
5bb2bc93 1331 tubpar[1] = 3.14;
b6a8f9f1 1332 tubpar[2] = 153./2.;
8d433671 1333 gMC->Gsvolu("MBXW", "TUBE", idtmed[11], tubpar, 3);
1334
1335 // -- YOKE
1336 tubpar[0] = 4.5;
1337 tubpar[1] = 55.;
b6a8f9f1 1338 tubpar[2] = 153./2.;
cd807e71 1339 gMC->Gsvolu("YMBX", "TUBE", idtmed[7], tubpar, 3);
8d433671 1340
f853b9aa 1341 gMC->Gspos("MBXW", 1, "ZDCC", 0., 0., -tubpar[2]-zc, 0, "ONLY");
1342 gMC->Gspos("YMBX", 1, "ZDCC", 0., 0., -tubpar[2]-zc, 0, "ONLY");
8d433671 1343
1344
1345 // -- INNER TRIPLET
1346 zq = 2296.5;
1347
1348 // -- DEFINE MQXL AND MQX QUADRUPOLE ELEMENT
1349 // -- MQXL
1350 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1351 tubpar[0] = 0.;
5bb2bc93 1352 tubpar[1] = 3.14;
8d433671 1353 tubpar[2] = 637./2.;
1354 gMC->Gsvolu("MQXL", "TUBE", idtmed[11], tubpar, 3);
f853b9aa 1355
8d433671 1356 // -- YOKE
1357 tubpar[0] = 3.5;
1358 tubpar[1] = 22.;
1359 tubpar[2] = 637./2.;
1360 gMC->Gsvolu("YMQL", "TUBE", idtmed[7], tubpar, 3);
1361
f853b9aa 1362 gMC->Gspos("MQXL", 1, "ZDCC", 0., 0., -tubpar[2]-zq, 0, "ONLY");
1363 gMC->Gspos("YMQL", 1, "ZDCC", 0., 0., -tubpar[2]-zq, 0, "ONLY");
8d433671 1364
b6a8f9f1 1365 gMC->Gspos("MQXL", 2, "ZDCC", 0., 0., -tubpar[2]-zq-2400., 0, "ONLY");
1366 gMC->Gspos("YMQL", 2, "ZDCC", 0., 0., -tubpar[2]-zq-2400., 0, "ONLY");
8d433671 1367
1368 // -- MQX
1369 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1370 tubpar[0] = 0.;
5bb2bc93 1371 tubpar[1] = 3.14;
8d433671 1372 tubpar[2] = 550./2.;
1373 gMC->Gsvolu("MQX ", "TUBE", idtmed[11], tubpar, 3);
1374
1375 // -- YOKE
1376 tubpar[0] = 3.5;
1377 tubpar[1] = 22.;
1378 tubpar[2] = 550./2.;
1379 gMC->Gsvolu("YMQ ", "TUBE", idtmed[7], tubpar, 3);
1380
f853b9aa 1381 gMC->Gspos("MQX ", 1, "ZDCC", 0., 0., -tubpar[2]-zq-908.5, 0, "ONLY");
1382 gMC->Gspos("YMQ ", 1, "ZDCC", 0., 0., -tubpar[2]-zq-908.5, 0, "ONLY");
8d433671 1383
f853b9aa 1384 gMC->Gspos("MQX ", 2, "ZDCC", 0., 0., -tubpar[2]-zq-1558.5, 0, "ONLY");
1385 gMC->Gspos("YMQ ", 2, "ZDCC", 0., 0., -tubpar[2]-zq-1558.5, 0, "ONLY");
8d433671 1386
1387 // -- SEPARATOR DIPOLE D1
1388 zd1 = 5838.3;
1389
1390 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1391 tubpar[0] = 0.;
f891321f 1392 tubpar[1] = 3.46;
8d433671 1393 tubpar[2] = 945./2.;
1394 gMC->Gsvolu("MD1 ", "TUBE", idtmed[11], tubpar, 3);
1395
1396 // -- Insert horizontal Cu plates inside D1
1397 // -- (to simulate the vacuum chamber)
1398 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.98+0.2)*(2.98+0.2)) - 0.05;
1399 boxpar[1] = 0.2/2.;
71cd8104 1400 boxpar[2] =945./2.;
8d433671 1401 gMC->Gsvolu("MD1V", "BOX ", idtmed[6], boxpar, 3);
1402 gMC->Gspos("MD1V", 1, "MD1 ", 0., 2.98+boxpar[1], 0., 0, "ONLY");
1403 gMC->Gspos("MD1V", 2, "MD1 ", 0., -2.98-boxpar[1], 0., 0, "ONLY");
1404
1405 // -- YOKE
f891321f 1406 tubpar[0] = 3.68;
1407 tubpar[1] = 110./2.;
8d433671 1408 tubpar[2] = 945./2.;
1409 gMC->Gsvolu("YD1 ", "TUBE", idtmed[7], tubpar, 3);
1410
f853b9aa 1411 gMC->Gspos("YD1 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd1, 0, "ONLY");
8d433671 1412 gMC->Gspos("MD1 ", 1, "YD1 ", 0., 0., 0., 0, "ONLY");
b6a8f9f1 1413 // Ch debug
1414 //printf("\t **** D1 positioned! It goes from z = %1.2f to z = %1.2f cm\n",-zd1, -zd1-2*tubpar[2]);
8d433671 1415
1416 // -- DIPOLE D2
1417 // --- LHC optics v6.4
b6a8f9f1 1418 zd2 = 12167.8;
8d433671 1419
1420 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1421 tubpar[0] = 0.;
1422 tubpar[1] = 7.5/2.;
1423 tubpar[2] = 945./2.;
1424 gMC->Gsvolu("MD2 ", "TUBE", idtmed[11], tubpar, 3);
1425
1426 // -- YOKE
1427 tubpar[0] = 0.;
1428 tubpar[1] = 55.;
1429 tubpar[2] = 945./2.;
1430 gMC->Gsvolu("YD2 ", "TUBE", idtmed[7], tubpar, 3);
1431
f853b9aa 1432 gMC->Gspos("YD2 ", 1, "ZDCC", 0., 0., -tubpar[2]-zd2, 0, "ONLY");
8d433671 1433
1434 gMC->Gspos("MD2 ", 1, "YD2 ", -9.4, 0., 0., 0, "ONLY");
1435 gMC->Gspos("MD2 ", 2, "YD2 ", 9.4, 0., 0., 0, "ONLY");
1436
1437 // ***************************************************************
1438 // SIDE A - RB24
1439 // ***************************************************************
1440
1441 // COMPENSATOR DIPOLE (MCBWA) (2nd compensator)
1442 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1443 tubpar[0] = 0.;
5bf70036 1444 tubpar[1] = 3.;
8d433671 1445 tubpar[2] = 153./2.;
1446 gMC->Gsvolu("MCBW", "TUBE", idtmed[11], tubpar, 3);
f853b9aa 1447 gMC->Gspos("MCBW", 1, "ZDCA", 0., 0., tubpar[2]+1972.5, 0, "ONLY");
8d433671 1448
1449 // -- YOKE
1450 tubpar[0] = 4.5;
1451 tubpar[1] = 55.;
1452 tubpar[2] = 153./2.;
cd807e71 1453 gMC->Gsvolu("YMCB", "TUBE", idtmed[7], tubpar, 3);
f853b9aa 1454 gMC->Gspos("YMCB", 1, "ZDCA", 0., 0., tubpar[2]+1972.5, 0, "ONLY");
8d433671 1455
8d433671 1456 // -- INNER TRIPLET
1457 zql = 2296.5;
1458
1459 // -- DEFINE MQX1 AND MQX2 QUADRUPOLE ELEMENT
1460 // -- MQX1
1461 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1462 tubpar[0] = 0.;
f891321f 1463 tubpar[1] = 3.14;
8d433671 1464 tubpar[2] = 637./2.;
1465 gMC->Gsvolu("MQX1", "TUBE", idtmed[11], tubpar, 3);
71cd8104 1466 gMC->Gsvolu("MQX4", "TUBE", idtmed[11], tubpar, 3);
8d433671 1467
1468 // -- YOKE
1469 tubpar[0] = 3.5;
1470 tubpar[1] = 22.;
1471 tubpar[2] = 637./2.;
cd807e71 1472 gMC->Gsvolu("YMQ1", "TUBE", idtmed[7], tubpar, 3);
8d433671 1473
71cd8104 1474 // -- Q1
1475 gMC->Gspos("MQX1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "ONLY");
1476 gMC->Gspos("YMQ1", 1, "ZDCA", 0., 0., tubpar[2]+zql, 0, "ONLY");
1477
8d433671 1478 // -- BEAM SCREEN FOR Q1
1479 tubpar[0] = 4.78/2.;
1480 tubpar[1] = 5.18/2.;
1481 tubpar[2] = 637./2.;
00521574 1482 gMC->Gsvolu("QBS1", "TUBE", idtmed[6], tubpar, 3);
71cd8104 1483 gMC->Gspos("QBS1", 1, "MQX1", 0., 0., 0., 0, "ONLY");
8d433671 1484 // INSERT VERTICAL PLATE INSIDE Q1
1485 boxpar[0] = 0.2/2.0;
1486 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(1.9+0.2)*(1.9+0.2));
1487 boxpar[2] =637./2.;
00521574 1488 gMC->Gsvolu("QBS2", "BOX ", idtmed[6], boxpar, 3);
71cd8104 1489 gMC->Gspos("QBS2", 1, "MQX1", 1.9+boxpar[0], 0., 0., 0, "ONLY");
1490 gMC->Gspos("QBS2", 2, "MQX1", -1.9-boxpar[0], 0., 0., 0, "ONLY");
1491
1492 // -- Q3
1493 gMC->Gspos("MQX4", 1, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "ONLY");
1494 gMC->Gspos("YMQ1", 2, "ZDCA", 0., 0., tubpar[2]+zql+2400., 0, "ONLY");
8d433671 1495
1496 // -- BEAM SCREEN FOR Q3
1497 tubpar[0] = 5.79/2.;
1498 tubpar[1] = 6.14/2.;
1499 tubpar[2] = 637./2.;
00521574 1500 gMC->Gsvolu("QBS3", "TUBE", idtmed[6], tubpar, 3);
71cd8104 1501 gMC->Gspos("QBS3", 1, "MQX4", 0., 0., 0., 0, "ONLY");
8d433671 1502 // INSERT VERTICAL PLATE INSIDE Q3
1503 boxpar[0] = 0.2/2.0;
1504 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1505 boxpar[2] =637./2.;
00521574 1506 gMC->Gsvolu("QBS4", "BOX ", idtmed[6], boxpar, 3);
71cd8104 1507 gMC->Gspos("QBS4", 1, "MQX4", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1508 gMC->Gspos("QBS4", 2, "MQX4", -2.405-boxpar[0], 0., 0., 0, "ONLY");
1509
8d433671 1510
1511
1512 // -- MQX2
1513 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1514 tubpar[0] = 0.;
f891321f 1515 tubpar[1] = 3.14;
8d433671 1516 tubpar[2] = 550./2.;
1517 gMC->Gsvolu("MQX2", "TUBE", idtmed[11], tubpar, 3);
71cd8104 1518 gMC->Gsvolu("MQX3", "TUBE", idtmed[11], tubpar, 3);
8d433671 1519
1520 // -- YOKE
1521 tubpar[0] = 3.5;
1522 tubpar[1] = 22.;
1523 tubpar[2] = 550./2.;
cd807e71 1524 gMC->Gsvolu("YMQ2", "TUBE", idtmed[7], tubpar, 3);
8d433671 1525
1526 // -- BEAM SCREEN FOR Q2
1527 tubpar[0] = 5.79/2.;
1528 tubpar[1] = 6.14/2.;
1529 tubpar[2] = 550./2.;
00521574 1530 gMC->Gsvolu("QBS5", "TUBE", idtmed[6], tubpar, 3);
8d433671 1531 // VERTICAL PLATE INSIDE Q2
1532 boxpar[0] = 0.2/2.0;
1533 boxpar[1] = TMath::Sqrt(tubpar[0]*tubpar[0]-(2.405+0.2)*(2.405+0.2));
1534 boxpar[2] =550./2.;
00521574 1535 gMC->Gsvolu("QBS6", "BOX ", idtmed[6], boxpar, 3);
8d433671 1536
1537 // -- Q2A
71cd8104 1538 gMC->Gspos("MQX2", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "ONLY");
1539 gMC->Gspos("QBS5", 1, "MQX2", 0., 0., 0., 0, "ONLY");
1540 gMC->Gspos("QBS6", 1, "MQX2", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1541 gMC->Gspos("QBS6", 2, "MQX2", -2.405-boxpar[0], 0., 0., 0, "ONLY");
f853b9aa 1542 gMC->Gspos("YMQ2", 1, "ZDCA", 0., 0., tubpar[2]+zql+908.5, 0, "ONLY");
8d433671 1543
1544
1545 // -- Q2B
71cd8104 1546 gMC->Gspos("MQX3", 1, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "ONLY");
1547 gMC->Gspos("QBS5", 2, "MQX3", 0., 0., 0., 0, "ONLY");
1548 gMC->Gspos("QBS6", 3, "MQX3", 2.405+boxpar[0], 0., 0., 0, "ONLY");
1549 gMC->Gspos("QBS6", 4, "MQX3", -2.405-boxpar[0], 0., 0., 0, "ONLY");
f853b9aa 1550 gMC->Gspos("YMQ2", 2, "ZDCA", 0., 0., tubpar[2]+zql+1558.5, 0, "ONLY");
8d433671 1551
1552 // -- SEPARATOR DIPOLE D1
1553 zd2 = 5838.3;
1554
1555 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1556 tubpar[0] = 0.;
00521574 1557 tubpar[1] = 6.75/2.;//3.375
8d433671 1558 tubpar[2] = 945./2.;
1559 gMC->Gsvolu("MD1L", "TUBE", idtmed[11], tubpar, 3);
8d433671 1560
1561 // -- YOKE
00521574 1562 tubpar[0] = 7.34/2.; // 3.67 -- to be checked
8d433671 1563 tubpar[1] = 110./2;
1564 tubpar[2] = 945./2.;
cd807e71 1565 gMC->Gsvolu("YD1L", "TUBE", idtmed[7], tubpar, 3);
8d433671 1566
f853b9aa 1567 gMC->Gspos("YD1L", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
71cd8104 1568 gMC->Gspos("MD1L", 1, "ZDCA", 0., 0., tubpar[2]+zd2, 0, "ONLY");
1569
1570 // -- The beam screen tube is provided by the beam pipe in D1 (QA03 volume)
1571 // -- Insert the beam screen horizontal Cu plates inside D1
1572 // -- (to simulate the vacuum chamber)
1573 boxpar[0] = TMath::Sqrt(tubpar[1]*tubpar[1]-(2.885+0.2)*(2.885+0.2));
1574 boxpar[1] = 0.2/2.;
1575 //boxpar[2] =(945.+80.1)/2.;
1576 boxpar[2] =945./2.;
00521574 1577 gMC->Gsvolu("QBS7", "BOX ", idtmed[6], boxpar, 3);
71cd8104 1578 gMC->Gspos("QBS7", 1, "MD1L", 0., 2.885+boxpar[1],0., 0, "ONLY");
1579 gMC->Gspos("QBS7", 2, "MD1L", 0., -2.885-boxpar[1],0., 0, "ONLY");
1580
8d433671 1581
1582 // -- DIPOLE D2
1583 // --- LHC optics v6.5
1584 zd2l = 12167.8;
1585
1586 // -- GAP (VACUUM WITH MAGNETIC FIELD)
1587 tubpar[0] = 0.;
1588 tubpar[1] = 7.5/2.; // this has to be checked
1589 tubpar[2] = 945./2.;
1590 gMC->Gsvolu("MD2L", "TUBE", idtmed[11], tubpar, 3);
1591
1592 // -- YOKE
1593 tubpar[0] = 0.;
1594 tubpar[1] = 55.;
1595 tubpar[2] = 945./2.;
cd807e71 1596 gMC->Gsvolu("YD2L", "TUBE", idtmed[7], tubpar, 3);
8d433671 1597
f853b9aa 1598 gMC->Gspos("YD2L", 1, "ZDCA", 0., 0., tubpar[2]+zd2l, 0, "ONLY");
8d433671 1599
1600 gMC->Gspos("MD2L", 1, "YD2L", -9.4, 0., 0., 0, "ONLY");
1601 gMC->Gspos("MD2L", 2, "YD2L", 9.4, 0., 0., 0, "ONLY");
1602
1603 // -- END OF MAGNET DEFINITION
1604}
1605
1606//_____________________________________________________________________________
1607void AliZDCv3::CreateZDC()
1608{
1609 //
1610 // Create the various ZDCs (ZN + ZP)
1611 //
1612
1613 Float_t dimPb[6], dimVoid[6];
1614
1615 Int_t *idtmed = fIdtmed->GetArray();
1616
1617 // Parameters for hadronic calorimeters geometry
1618 // NB -> parameters used ONLY in CreateZDC()
1619 Float_t fGrvZN[3] = {0.03, 0.03, 50.}; // Grooves for neutron detector
1620 Float_t fGrvZP[3] = {0.04, 0.04, 75.}; // Grooves for proton detector
1621 Int_t fDivZN[3] = {11, 11, 0}; // Division for neutron detector
1622 Int_t fDivZP[3] = {7, 15, 0}; // Division for proton detector
1623 Int_t fTowZN[2] = {2, 2}; // Tower for neutron detector
1624 Int_t fTowZP[2] = {4, 1}; // Tower for proton detector
1625
1626 // Parameters for EM calorimeter geometry
1627 // NB -> parameters used ONLY in CreateZDC()
1628 Float_t kDimZEMPb = 0.15*(TMath::Sqrt(2.)); // z-dimension of the Pb slice
1629 Float_t kFibRadZEM = 0.0315; // External fiber radius (including cladding)
1630 Int_t fDivZEM[3] = {92, 0, 20}; // Divisions for EM detector
1631 Float_t fDimZEM[6] = {fZEMLength, 3.5, 3.5, 45., 0., 0.}; // Dimensions of EM detector
1632 Float_t fFibZEM2 = fDimZEM[2]/TMath::Sin(fDimZEM[3]*kDegrad)-kFibRadZEM;
1633 Float_t fFibZEM[3] = {0., 0.0275, fFibZEM2}; // Fibers for EM calorimeter
1634
1635
1636 //-- Create calorimeters geometry
1637
1638 // -------------------------------------------------------------------------------
1639 //--> Neutron calorimeter (ZN)
1640
1641 gMC->Gsvolu("ZNEU", "BOX ", idtmed[1], fDimZN, 3); // Passive material
1642 gMC->Gsvolu("ZNF1", "TUBE", idtmed[3], fFibZN, 3); // Active material
1643 gMC->Gsvolu("ZNF2", "TUBE", idtmed[4], fFibZN, 3);
1644 gMC->Gsvolu("ZNF3", "TUBE", idtmed[4], fFibZN, 3);
1645 gMC->Gsvolu("ZNF4", "TUBE", idtmed[3], fFibZN, 3);
1646 gMC->Gsvolu("ZNG1", "BOX ", idtmed[12], fGrvZN, 3); // Empty grooves
1647 gMC->Gsvolu("ZNG2", "BOX ", idtmed[12], fGrvZN, 3);
1648 gMC->Gsvolu("ZNG3", "BOX ", idtmed[12], fGrvZN, 3);
1649 gMC->Gsvolu("ZNG4", "BOX ", idtmed[12], fGrvZN, 3);
1650
1651 // Divide ZNEU in towers (for hits purposes)
1652
1653 gMC->Gsdvn("ZNTX", "ZNEU", fTowZN[0], 1); // x-tower
1654 gMC->Gsdvn("ZN1 ", "ZNTX", fTowZN[1], 2); // y-tower
1655
1656 //-- Divide ZN1 in minitowers
1657 // fDivZN[0]= NUMBER OF FIBERS PER TOWER ALONG X-AXIS,
1658 // fDivZN[1]= NUMBER OF FIBERS PER TOWER ALONG Y-AXIS
1659 // (4 fibres per minitower)
1660
1661 gMC->Gsdvn("ZNSL", "ZN1 ", fDivZN[1], 2); // Slices
1662 gMC->Gsdvn("ZNST", "ZNSL", fDivZN[0], 1); // Sticks
1663
1664 // --- Position the empty grooves in the sticks (4 grooves per stick)
1665 Float_t dx = fDimZN[0] / fDivZN[0] / 4.;
1666 Float_t dy = fDimZN[1] / fDivZN[1] / 4.;
1667
1668 gMC->Gspos("ZNG1", 1, "ZNST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1669 gMC->Gspos("ZNG2", 1, "ZNST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1670 gMC->Gspos("ZNG3", 1, "ZNST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1671 gMC->Gspos("ZNG4", 1, "ZNST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1672
1673 // --- Position the fibers in the grooves
1674 gMC->Gspos("ZNF1", 1, "ZNG1", 0., 0., 0., 0, "ONLY");
1675 gMC->Gspos("ZNF2", 1, "ZNG2", 0., 0., 0., 0, "ONLY");
1676 gMC->Gspos("ZNF3", 1, "ZNG3", 0., 0., 0., 0, "ONLY");
1677 gMC->Gspos("ZNF4", 1, "ZNG4", 0., 0., 0., 0, "ONLY");
1678
1679 // --- Position the neutron calorimeter in ZDC
1680 // -- Rotation of ZDCs
1681 Int_t irotzdc;
1682 gMC->Matrix(irotzdc, 90., 180., 90., 90., 180., 0.);
1683 //
f853b9aa 1684 gMC->Gspos("ZNEU", 1, "ZDCC", fPosZNC[0], fPosZNC[1], fPosZNC[2]-fDimZN[2], irotzdc, "ONLY");
8d433671 1685 //Ch debug
1686 //printf("\n ZN -> %f < z < %f cm\n",fPosZN[2],fPosZN[2]-2*fDimZN[2]);
1687
1688 // --- Position the neutron calorimeter in ZDC2 (left line)
1689 // -- No Rotation of ZDCs
f853b9aa 1690 gMC->Gspos("ZNEU", 2, "ZDCA", fPosZNA[0], fPosZNA[1], fPosZNA[2]+fDimZN[2], 0, "ONLY");
8d433671 1691 //Ch debug
1692 //printf("\n ZN left -> %f < z < %f cm\n",fPosZNl[2],fPosZNl[2]+2*fDimZN[2]);
1693
1694
1695 // -------------------------------------------------------------------------------
1696 //--> Proton calorimeter (ZP)
1697
1698 gMC->Gsvolu("ZPRO", "BOX ", idtmed[2], fDimZP, 3); // Passive material
1699 gMC->Gsvolu("ZPF1", "TUBE", idtmed[3], fFibZP, 3); // Active material
1700 gMC->Gsvolu("ZPF2", "TUBE", idtmed[4], fFibZP, 3);
1701 gMC->Gsvolu("ZPF3", "TUBE", idtmed[4], fFibZP, 3);
1702 gMC->Gsvolu("ZPF4", "TUBE", idtmed[3], fFibZP, 3);
1703 gMC->Gsvolu("ZPG1", "BOX ", idtmed[12], fGrvZP, 3); // Empty grooves
1704 gMC->Gsvolu("ZPG2", "BOX ", idtmed[12], fGrvZP, 3);
1705 gMC->Gsvolu("ZPG3", "BOX ", idtmed[12], fGrvZP, 3);
1706 gMC->Gsvolu("ZPG4", "BOX ", idtmed[12], fGrvZP, 3);
1707
1708 //-- Divide ZPRO in towers(for hits purposes)
1709
1710 gMC->Gsdvn("ZPTX", "ZPRO", fTowZP[0], 1); // x-tower
1711 gMC->Gsdvn("ZP1 ", "ZPTX", fTowZP[1], 2); // y-tower
1712
1713
1714 //-- Divide ZP1 in minitowers
1715 // fDivZP[0]= NUMBER OF FIBERS ALONG X-AXIS PER MINITOWER,
1716 // fDivZP[1]= NUMBER OF FIBERS ALONG Y-AXIS PER MINITOWER
1717 // (4 fiber per minitower)
1718
1719 gMC->Gsdvn("ZPSL", "ZP1 ", fDivZP[1], 2); // Slices
1720 gMC->Gsdvn("ZPST", "ZPSL", fDivZP[0], 1); // Sticks
1721
1722 // --- Position the empty grooves in the sticks (4 grooves per stick)
1723 dx = fDimZP[0] / fTowZP[0] / fDivZP[0] / 2.;
1724 dy = fDimZP[1] / fTowZP[1] / fDivZP[1] / 2.;
1725
1726 gMC->Gspos("ZPG1", 1, "ZPST", 0.-dx, 0.+dy, 0., 0, "ONLY");
1727 gMC->Gspos("ZPG2", 1, "ZPST", 0.+dx, 0.+dy, 0., 0, "ONLY");
1728 gMC->Gspos("ZPG3", 1, "ZPST", 0.-dx, 0.-dy, 0., 0, "ONLY");
1729 gMC->Gspos("ZPG4", 1, "ZPST", 0.+dx, 0.-dy, 0., 0, "ONLY");
1730
1731 // --- Position the fibers in the grooves
1732 gMC->Gspos("ZPF1", 1, "ZPG1", 0., 0., 0., 0, "ONLY");
1733 gMC->Gspos("ZPF2", 1, "ZPG2", 0., 0., 0., 0, "ONLY");
1734 gMC->Gspos("ZPF3", 1, "ZPG3", 0., 0., 0., 0, "ONLY");
1735 gMC->Gspos("ZPF4", 1, "ZPG4", 0., 0., 0., 0, "ONLY");
1736
1737
f853b9aa 1738 // --- Position the proton calorimeter in ZDCC
921be7cf 1739 gMC->Gspos("ZPRO", 1, "ZDCC", fPosZPC[0], fPosZPC[1], fPosZPC[2]-fDimZP[2], irotzdc, "ONLY");
8d433671 1740 //Ch debug
1741 //printf("\n ZP -> %f < z < %f cm\n",fPosZP[2],fPosZP[2]-2*fDimZP[2]);
1742
f853b9aa 1743 // --- Position the proton calorimeter in ZDCA
1744 // --- No rotation
921be7cf 1745 gMC->Gspos("ZPRO", 2, "ZDCA", fPosZPA[0], fPosZPA[1], fPosZPA[2]+fDimZP[2], 0, "ONLY");
8d433671 1746 //Ch debug
1747 //printf("\n ZP left -> %f < z < %f cm\n",fPosZPl[2],fPosZPl[2]+2*fDimZP[2]);
1748
1749
1750 // -------------------------------------------------------------------------------
1751 // -> EM calorimeter (ZEM)
1752
1753 gMC->Gsvolu("ZEM ", "PARA", idtmed[10], fDimZEM, 6);
1754
1755 Int_t irot1, irot2;
1756 gMC->Matrix(irot1,0.,0.,90.,90.,-90.,0.); // Rotation matrix 1
1757 gMC->Matrix(irot2,180.,0.,90.,fDimZEM[3]+90.,90.,fDimZEM[3]);// Rotation matrix 2
1758 //printf("irot1 = %d, irot2 = %d \n", irot1, irot2);
1759
1760 gMC->Gsvolu("ZEMF", "TUBE", idtmed[3], fFibZEM, 3); // Active material
1761
1762 gMC->Gsdvn("ZETR", "ZEM ", fDivZEM[2], 1); // Tranches
1763
1764 dimPb[0] = kDimZEMPb; // Lead slices
1765 dimPb[1] = fDimZEM[2];
1766 dimPb[2] = fDimZEM[1];
1767 //dimPb[3] = fDimZEM[3]; //controllare
1768 dimPb[3] = 90.-fDimZEM[3]; //originale
1769 dimPb[4] = 0.;
1770 dimPb[5] = 0.;
1771 gMC->Gsvolu("ZEL0", "PARA", idtmed[5], dimPb, 6);
1772 gMC->Gsvolu("ZEL1", "PARA", idtmed[5], dimPb, 6);
1773 gMC->Gsvolu("ZEL2", "PARA", idtmed[5], dimPb, 6);
1774
1775 // --- Position the lead slices in the tranche
1776 Float_t zTran = fDimZEM[0]/fDivZEM[2];
1777 Float_t zTrPb = -zTran+kDimZEMPb;
1778 gMC->Gspos("ZEL0", 1, "ZETR", zTrPb, 0., 0., 0, "ONLY");
1779 gMC->Gspos("ZEL1", 1, "ZETR", kDimZEMPb, 0., 0., 0, "ONLY");
1780
1781 // --- Vacuum zone (to be filled with fibres)
1782 dimVoid[0] = (zTran-2*kDimZEMPb)/2.;
1783 dimVoid[1] = fDimZEM[2];
1784 dimVoid[2] = fDimZEM[1];
1785 dimVoid[3] = 90.-fDimZEM[3];
1786 dimVoid[4] = 0.;
1787 dimVoid[5] = 0.;
1788 gMC->Gsvolu("ZEV0", "PARA", idtmed[10], dimVoid,6);
1789 gMC->Gsvolu("ZEV1", "PARA", idtmed[10], dimVoid,6);
1790
1791 // --- Divide the vacuum slice into sticks along x axis
1792 gMC->Gsdvn("ZES0", "ZEV0", fDivZEM[0], 3);
1793 gMC->Gsdvn("ZES1", "ZEV1", fDivZEM[0], 3);
1794
1795 // --- Positioning the fibers into the sticks
1796 gMC->Gspos("ZEMF", 1,"ZES0", 0., 0., 0., irot2, "ONLY");
1797 gMC->Gspos("ZEMF", 1,"ZES1", 0., 0., 0., irot2, "ONLY");
1798
1799 // --- Positioning the vacuum slice into the tranche
5bb2bc93 1800 //Float_t displFib = fDimZEM[1]/fDivZEM[0];
8d433671 1801 gMC->Gspos("ZEV0", 1,"ZETR", -dimVoid[0], 0., 0., 0, "ONLY");
6ac9cca5 1802 gMC->Gspos("ZEV1", 1,"ZETR", -dimVoid[0]+zTran, 0., 0., 0, "ONLY");
8d433671 1803
1804 // --- Positioning the ZEM into the ZDC - rotation for 90 degrees
f853b9aa 1805 // NB -> ZEM is positioned in ALIC (instead of in ZDC) volume
8d433671 1806 gMC->Gspos("ZEM ", 1,"ALIC", -fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1807
1808 // Second EM ZDC (same side w.r.t. IP, just on the other side w.r.t. beam pipe)
1809 gMC->Gspos("ZEM ", 2,"ALIC", fPosZEM[0], fPosZEM[1], fPosZEM[2]+fDimZEM[0], irot1, "ONLY");
1810
1811 // --- Adding last slice at the end of the EM calorimeter
1812 Float_t zLastSlice = fPosZEM[2]+kDimZEMPb+2*fDimZEM[0];
1813 gMC->Gspos("ZEL2", 1,"ALIC", fPosZEM[0], fPosZEM[1], zLastSlice, irot1, "ONLY");
1814 //Ch debug
1815 //printf("\n ZEM lenght = %f cm\n",2*fZEMLength);
1816 //printf("\n ZEM -> %f < z < %f cm\n",fPosZEM[2],fPosZEM[2]+2*fZEMLength+zLastSlice+kDimZEMPb);
1817
1818}
1819
1820//_____________________________________________________________________________
1821void AliZDCv3::DrawModule() const
1822{
1823 //
1824 // Draw a shaded view of the Zero Degree Calorimeter version 1
1825 //
1826
1827 // Set everything unseen
1828 gMC->Gsatt("*", "seen", -1);
1829 //
1830 // Set ALIC mother transparent
1831 gMC->Gsatt("ALIC","SEEN",0);
1832 //
1833 // Set the volumes visible
f853b9aa 1834 gMC->Gsatt("ZDCC","SEEN",0);
8d433671 1835 gMC->Gsatt("QT01","SEEN",1);
1836 gMC->Gsatt("QT02","SEEN",1);
1837 gMC->Gsatt("QT03","SEEN",1);
1838 gMC->Gsatt("QT04","SEEN",1);
1839 gMC->Gsatt("QT05","SEEN",1);
1840 gMC->Gsatt("QT06","SEEN",1);
1841 gMC->Gsatt("QT07","SEEN",1);
1842 gMC->Gsatt("QT08","SEEN",1);
1843 gMC->Gsatt("QT09","SEEN",1);
1844 gMC->Gsatt("QT10","SEEN",1);
1845 gMC->Gsatt("QT11","SEEN",1);
1846 gMC->Gsatt("QT12","SEEN",1);
1847 gMC->Gsatt("QT13","SEEN",1);
1848 gMC->Gsatt("QT14","SEEN",1);
1849 gMC->Gsatt("QT15","SEEN",1);
1850 gMC->Gsatt("QT16","SEEN",1);
1851 gMC->Gsatt("QT17","SEEN",1);
1852 gMC->Gsatt("QT18","SEEN",1);
1853 gMC->Gsatt("QC01","SEEN",1);
1854 gMC->Gsatt("QC02","SEEN",1);
1855 gMC->Gsatt("QC03","SEEN",1);
1856 gMC->Gsatt("QC04","SEEN",1);
1857 gMC->Gsatt("QC05","SEEN",1);
1858 gMC->Gsatt("QTD1","SEEN",1);
1859 gMC->Gsatt("QTD2","SEEN",1);
1860 gMC->Gsatt("QTD3","SEEN",1);
1861 gMC->Gsatt("MQXL","SEEN",1);
1862 gMC->Gsatt("YMQL","SEEN",1);
1863 gMC->Gsatt("MQX ","SEEN",1);
1864 gMC->Gsatt("YMQ ","SEEN",1);
1865 gMC->Gsatt("ZQYX","SEEN",1);
1866 gMC->Gsatt("MD1 ","SEEN",1);
1867 gMC->Gsatt("MD1V","SEEN",1);
1868 gMC->Gsatt("YD1 ","SEEN",1);
1869 gMC->Gsatt("MD2 ","SEEN",1);
1870 gMC->Gsatt("YD2 ","SEEN",1);
1871 gMC->Gsatt("ZNEU","SEEN",0);
1872 gMC->Gsatt("ZNF1","SEEN",0);
1873 gMC->Gsatt("ZNF2","SEEN",0);
1874 gMC->Gsatt("ZNF3","SEEN",0);
1875 gMC->Gsatt("ZNF4","SEEN",0);
1876 gMC->Gsatt("ZNG1","SEEN",0);
1877 gMC->Gsatt("ZNG2","SEEN",0);
1878 gMC->Gsatt("ZNG3","SEEN",0);
1879 gMC->Gsatt("ZNG4","SEEN",0);
1880 gMC->Gsatt("ZNTX","SEEN",0);
1881 gMC->Gsatt("ZN1 ","COLO",4);
1882 gMC->Gsatt("ZN1 ","SEEN",1);
1883 gMC->Gsatt("ZNSL","SEEN",0);
1884 gMC->Gsatt("ZNST","SEEN",0);
1885 gMC->Gsatt("ZPRO","SEEN",0);
1886 gMC->Gsatt("ZPF1","SEEN",0);
1887 gMC->Gsatt("ZPF2","SEEN",0);
1888 gMC->Gsatt("ZPF3","SEEN",0);
1889 gMC->Gsatt("ZPF4","SEEN",0);
1890 gMC->Gsatt("ZPG1","SEEN",0);
1891 gMC->Gsatt("ZPG2","SEEN",0);
1892 gMC->Gsatt("ZPG3","SEEN",0);
1893 gMC->Gsatt("ZPG4","SEEN",0);
1894 gMC->Gsatt("ZPTX","SEEN",0);
1895 gMC->Gsatt("ZP1 ","COLO",6);
1896 gMC->Gsatt("ZP1 ","SEEN",1);
1897 gMC->Gsatt("ZPSL","SEEN",0);
1898 gMC->Gsatt("ZPST","SEEN",0);
1899 gMC->Gsatt("ZEM ","COLO",7);
1900 gMC->Gsatt("ZEM ","SEEN",1);
1901 gMC->Gsatt("ZEMF","SEEN",0);
1902 gMC->Gsatt("ZETR","SEEN",0);
1903 gMC->Gsatt("ZEL0","SEEN",0);
1904 gMC->Gsatt("ZEL1","SEEN",0);
1905 gMC->Gsatt("ZEL2","SEEN",0);
1906 gMC->Gsatt("ZEV0","SEEN",0);
1907 gMC->Gsatt("ZEV1","SEEN",0);
1908 gMC->Gsatt("ZES0","SEEN",0);
1909 gMC->Gsatt("ZES1","SEEN",0);
1910
1911 //
1912 gMC->Gdopt("hide", "on");
1913 gMC->Gdopt("shad", "on");
1914 gMC->Gsatt("*", "fill", 7);
1915 gMC->SetClipBox(".");
1916 gMC->SetClipBox("*", 0, 100, -100, 100, 12000, 16000);
1917 gMC->DefaultRange();
1918 gMC->Gdraw("alic", 40, 30, 0, 488, 220, .07, .07);
f853b9aa 1919 gMC->Gdhead(1111, "Zero Degree Calorimeter Version 3");
8d433671 1920 gMC->Gdman(18, 4, "MAN");
1921}
1922
1923//_____________________________________________________________________________
1924void AliZDCv3::CreateMaterials()
1925{
1926 //
1927 // Create Materials for the Zero Degree Calorimeter
1928 //
00521574 1929 Float_t dens, ubuf[1], wmat[3], a[3], z[3];
1930
1931 // --- W alloy -> ZN passive material
1932 dens = 17.6;
1933 a[0] = 183.85;
1934 a[1] = 55.85;
1935 a[2] = 58.71;
1936 z[0] = 74.;
1937 z[1] = 26.;
1938 z[2] = 28.;
1939 wmat[0] = .93;
1940 wmat[1] = .03;
1941 wmat[2] = .04;
6656fe8d 1942 AliMixture(1, "WALL", a, z, dens, 3, wmat);
8d433671 1943
8d433671 1944 // --- Brass (CuZn) -> ZP passive material
1945 dens = 8.48;
1946 a[0] = 63.546;
1947 a[1] = 65.39;
1948 z[0] = 29.;
1949 z[1] = 30.;
1950 wmat[0] = .63;
1951 wmat[1] = .37;
cd807e71 1952 AliMixture(2, "BRASS", a, z, dens, 2, wmat);
8d433671 1953
1954 // --- SiO2
1955 dens = 2.64;
1956 a[0] = 28.086;
1957 a[1] = 15.9994;
1958 z[0] = 14.;
1959 z[1] = 8.;
1960 wmat[0] = 1.;
1961 wmat[1] = 2.;
cd807e71 1962 AliMixture(3, "SIO2", a, z, dens, -2, wmat);
8d433671 1963
1964 // --- Lead
1965 ubuf[0] = 1.12;
1966 AliMaterial(5, "LEAD", 207.19, 82., 11.35, .56, 18.5, ubuf, 1);
1967
1968 // --- Copper (energy loss taken into account)
1969 ubuf[0] = 1.10;
1970 AliMaterial(6, "COPP0", 63.54, 29., 8.96, 1.4, 0., ubuf, 1);
1971
8d433671 1972 // --- Iron (energy loss taken into account)
1973 ubuf[0] = 1.1;
1974 AliMaterial(7, "IRON0", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
1975
1976 // --- Iron (no energy loss)
1977 ubuf[0] = 1.1;
313e8ff0 1978 AliMaterial(8, "IRON1", 55.85, 26., 7.87, 1.76, 0., ubuf, 1);
f853b9aa 1979
8d433671 1980 // ---------------------------------------------------------
1981 Float_t aResGas[3]={1.008,12.0107,15.9994};
1982 Float_t zResGas[3]={1.,6.,8.};
1983 Float_t wResGas[3]={0.28,0.28,0.44};
1984 Float_t dResGas = 3.2E-14;
1985
1986 // --- Vacuum (no magnetic field)
1987 AliMixture(10, "VOID", aResGas, zResGas, dResGas, 3, wResGas);
8d433671 1988
1989 // --- Vacuum (with magnetic field)
1990 AliMixture(11, "VOIM", aResGas, zResGas, dResGas, 3, wResGas);
8d433671 1991
1992 // --- Air (no magnetic field)
1993 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
1994 Float_t zAir[4]={6.,7.,8.,18.};
1995 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
1996 Float_t dAir = 1.20479E-3;
1997 //
1998 AliMixture(12, "Air $", aAir, zAir, dAir, 4, wAir);
8d433671 1999
2000 // --- Definition of tracking media:
2001
2002 // --- Tantalum = 1 ;
2003 // --- Brass = 2 ;
2004 // --- Fibers (SiO2) = 3 ;
2005 // --- Fibers (SiO2) = 4 ;
2006 // --- Lead = 5 ;
2007 // --- Copper (with energy loss)= 6 ;
2008 // --- Copper (with energy loss)= 13 ;
2009 // --- Iron (with energy loss) = 7 ;
2010 // --- Iron (without energy loss) = 8 ;
2011 // --- Vacuum (no field) = 10
2012 // --- Vacuum (with field) = 11
2013 // --- Air (no field) = 12
2014
2015 // ****************************************************
2016 // Tracking media parameters
2017 //
2018 Float_t epsil = 0.01; // Tracking precision,
2019 Float_t stmin = 0.01; // Min. value 4 max. step (cm)
2020 Float_t stemax = 1.; // Max. step permitted (cm)
2021 Float_t tmaxfd = 0.; // Maximum angle due to field (degrees)
2022 Float_t deemax = -1.; // Maximum fractional energy loss
2023 Float_t nofieldm = 0.; // Max. field value (no field)
2024 Float_t fieldm = 45.; // Max. field value (with field)
2025 Int_t isvol = 0; // ISVOL =0 -> not sensitive volume
2026 Int_t isvolActive = 1; // ISVOL =1 -> sensitive volume
2027 Int_t inofld = 0; // IFIELD=0 -> no magnetic field
2028 Int_t ifield =2; // IFIELD=2 -> magnetic field defined in AliMagFC.h
2029 // *****************************************************
2030
2031 AliMedium(1, "ZTANT", 1, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2032 AliMedium(2, "ZBRASS",2, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2033 AliMedium(3, "ZSIO2", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2034 AliMedium(4, "ZQUAR", 3, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2035 AliMedium(5, "ZLEAD", 5, isvolActive, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2036 AliMedium(6, "ZCOPP", 6, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2037 AliMedium(7, "ZIRON", 7, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2038 AliMedium(8, "ZIRONN",8, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2039 AliMedium(10,"ZVOID",10, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2040 AliMedium(12,"ZAIR", 12, isvol, inofld, nofieldm, tmaxfd, stemax, deemax, epsil, stmin);
2041 //
2042 AliMedium(11,"ZVOIM",11, isvol, ifield, fieldm, tmaxfd, stemax, deemax, epsil, stmin);
00521574 2043
f853b9aa 2044
2045}
2046
2047//_____________________________________________________________________________
2048void AliZDCv3::AddAlignableVolumes() const
2049{
2050 //
2051 // Create entries for alignable volumes associating the symbolic volume
2052 // name with the corresponding volume path. Needs to be syncronized with
2053 // eventual changes in the geometry.
2054 //
63e6d88e 2055 TString volpath1 = "ALIC_1/ZDCC_1/ZNEU_1";
2056 TString volpath2 = "ALIC_1/ZDCC_1/ZPRO_1";
2057 TString volpath3 = "ALIC_1/ZDCA_1/ZNEU_2";
2058 TString volpath4 = "ALIC_1/ZDCA_1/ZPRO_2";
f853b9aa 2059
63e6d88e 2060 TString symname1="ZDC/NeutronZDC_C";
2061 TString symname2="ZDC/ProtonZDC_C";
2062 TString symname3="ZDC/NeutronZDC_A";
2063 TString symname4="ZDC/ProtonZDC_A";
f853b9aa 2064
2065 if(!gGeoManager->SetAlignableEntry(symname1.Data(),volpath1.Data()))
2066 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2067
2068 if(!gGeoManager->SetAlignableEntry(symname2.Data(),volpath2.Data()))
2069 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
63e6d88e 2070
2071 if(!gGeoManager->SetAlignableEntry(symname3.Data(),volpath3.Data()))
2072 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname1.Data(),volpath1.Data()));
2073
2074 if(!gGeoManager->SetAlignableEntry(symname4.Data(),volpath4.Data()))
2075 AliFatal(Form("Alignable entry %s not created. Volume path %s not valid", symname2.Data(),volpath2.Data()));
2076
f853b9aa 2077}
2078
2079
2080//_____________________________________________________________________________
2081void AliZDCv3::Init()
2082{
2083 InitTables();
2084 Int_t *idtmed = fIdtmed->GetArray();
2085 Int_t i;
8d433671 2086 // Thresholds for showering in the ZDCs
2087 i = 1; //tantalum
2088 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2089 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2090 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2091 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2092 i = 2; //brass
2093 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2094 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2095 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2096 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2097 i = 5; //lead
2098 gMC->Gstpar(idtmed[i], "CUTGAM", .001);
2099 gMC->Gstpar(idtmed[i], "CUTELE", .001);
2100 gMC->Gstpar(idtmed[i], "CUTNEU", .01);
2101 gMC->Gstpar(idtmed[i], "CUTHAD", .01);
2102
2103 // Avoid too detailed showering in TDI
f853b9aa 2104 i = 6; //copper
8d433671 2105 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2106 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2107 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2108 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2109
8d433671 2110 // Avoid too detailed showering along the beam line
2111 i = 7; //iron with energy loss (ZIRON)
2112 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2113 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2114 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2115 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
2116
2117 // Avoid too detailed showering along the beam line
2118 i = 8; //iron with energy loss (ZIRONN)
2119 gMC->Gstpar(idtmed[i], "CUTGAM", .1);
2120 gMC->Gstpar(idtmed[i], "CUTELE", .1);
2121 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
2122 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
cd807e71 2123
8d433671 2124 // Avoid too detailed showering along the beam line
f853b9aa 2125 i = 13; //iron with energy loss (ZIRONN)
2126 gMC->Gstpar(idtmed[i], "CUTGAM", 1.);
2127 gMC->Gstpar(idtmed[i], "CUTELE", 1.);
8d433671 2128 gMC->Gstpar(idtmed[i], "CUTNEU", 1.);
f853b9aa 2129 gMC->Gstpar(idtmed[i], "CUTHAD", 1.);
8d433671 2130
2131 // Avoid interaction in fibers (only energy loss allowed)
2132 i = 3; //fibers (ZSI02)
2133 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2134 gMC->Gstpar(idtmed[i], "MULS", 0.);
2135 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2136 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2137 gMC->Gstpar(idtmed[i], "LOSS", 1.);
2138 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2139 gMC->Gstpar(idtmed[i], "COMP", 0.);
2140 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2141 gMC->Gstpar(idtmed[i], "BREM", 0.);
2142 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2143 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2144 gMC->Gstpar(idtmed[i], "HADR", 0.);
2145 i = 4; //fibers (ZQUAR)
2146 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2147 gMC->Gstpar(idtmed[i], "MULS", 0.);
2148 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2149 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2150 gMC->Gstpar(idtmed[i], "LOSS", 1.);
2151 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2152 gMC->Gstpar(idtmed[i], "COMP", 0.);
2153 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2154 gMC->Gstpar(idtmed[i], "BREM", 0.);
2155 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2156 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2157 gMC->Gstpar(idtmed[i], "HADR", 0.);
2158
2159 // Avoid interaction in void
2160 i = 11; //void with field
2161 gMC->Gstpar(idtmed[i], "DCAY", 0.);
2162 gMC->Gstpar(idtmed[i], "MULS", 0.);
2163 gMC->Gstpar(idtmed[i], "PFIS", 0.);
2164 gMC->Gstpar(idtmed[i], "MUNU", 0.);
2165 gMC->Gstpar(idtmed[i], "LOSS", 0.);
2166 gMC->Gstpar(idtmed[i], "PHOT", 0.);
2167 gMC->Gstpar(idtmed[i], "COMP", 0.);
2168 gMC->Gstpar(idtmed[i], "PAIR", 0.);
2169 gMC->Gstpar(idtmed[i], "BREM", 0.);
2170 gMC->Gstpar(idtmed[i], "DRAY", 0.);
2171 gMC->Gstpar(idtmed[i], "ANNI", 0.);
2172 gMC->Gstpar(idtmed[i], "HADR", 0.);
2173
2174 //
2175 fMedSensZN = idtmed[1]; // Sensitive volume: ZN passive material
2176 fMedSensZP = idtmed[2]; // Sensitive volume: ZP passive material
2177 fMedSensF1 = idtmed[3]; // Sensitive volume: fibres type 1
2178 fMedSensF2 = idtmed[4]; // Sensitive volume: fibres type 2
2179 fMedSensZEM = idtmed[5]; // Sensitive volume: ZEM passive material
f853b9aa 2180 fMedSensTDI = idtmed[6]; // Sensitive volume: TDI Cu shield
8d433671 2181 fMedSensPI = idtmed[7]; // Sensitive volume: beam pipes
2182 fMedSensGR = idtmed[12]; // Sensitive volume: air into the grooves
8d433671 2183}
2184
2185//_____________________________________________________________________________
2186void AliZDCv3::InitTables()
2187{
2188 //
2189 // Read light tables for Cerenkov light production parameterization
2190 //
2191
2192 Int_t k, j;
2193
2194 char *lightfName1,*lightfName2,*lightfName3,*lightfName4,
2195 *lightfName5,*lightfName6,*lightfName7,*lightfName8;
2196 FILE *fp1, *fp2, *fp3, *fp4, *fp5, *fp6, *fp7, *fp8;
2197
2198 // --- Reading light tables for ZN
f853b9aa 2199 lightfName1 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362207s");
8d433671 2200 if((fp1 = fopen(lightfName1,"r")) == NULL){
2201 printf("Cannot open file fp1 \n");
2202 return;
2203 }
f853b9aa 2204 lightfName2 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362208s");
8d433671 2205 if((fp2 = fopen(lightfName2,"r")) == NULL){
2206 printf("Cannot open file fp2 \n");
2207 return;
2208 }
f853b9aa 2209 lightfName3 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362209s");
8d433671 2210 if((fp3 = fopen(lightfName3,"r")) == NULL){
2211 printf("Cannot open file fp3 \n");
2212 return;
2213 }
f853b9aa 2214 lightfName4 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620362210s");
8d433671 2215 if((fp4 = fopen(lightfName4,"r")) == NULL){
2216 printf("Cannot open file fp4 \n");
2217 return;
2218 }
2219
2220 for(k=0; k<fNalfan; k++){
2221 for(j=0; j<fNben; j++){
2222 fscanf(fp1,"%f",&fTablen[0][k][j]);
2223 fscanf(fp2,"%f",&fTablen[1][k][j]);
2224 fscanf(fp3,"%f",&fTablen[2][k][j]);
2225 fscanf(fp4,"%f",&fTablen[3][k][j]);
2226 }
2227 }
2228 fclose(fp1);
2229 fclose(fp2);
2230 fclose(fp3);
2231 fclose(fp4);
2232
2233 // --- Reading light tables for ZP and ZEM
f853b9aa 2234 lightfName5 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552207s");
8d433671 2235 if((fp5 = fopen(lightfName5,"r")) == NULL){
2236 printf("Cannot open file fp5 \n");
2237 return;
2238 }
f853b9aa 2239 lightfName6 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552208s");
8d433671 2240 if((fp6 = fopen(lightfName6,"r")) == NULL){
2241 printf("Cannot open file fp6 \n");
2242 return;
2243 }
f853b9aa 2244 lightfName7 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552209s");
8d433671 2245 if((fp7 = fopen(lightfName7,"r")) == NULL){
2246 printf("Cannot open file fp7 \n");
2247 return;
2248 }
f853b9aa 2249 lightfName8 = gSystem->ExpandPathName("$ALICE_ROOT/ZDC/light22620552210s");
8d433671 2250 if((fp8 = fopen(lightfName8,"r")) == NULL){
2251 printf("Cannot open file fp8 \n");
2252 return;
2253 }
2254
2255 for(k=0; k<fNalfap; k++){
2256 for(j=0; j<fNbep; j++){
2257 fscanf(fp5,"%f",&fTablep[0][k][j]);
2258 fscanf(fp6,"%f",&fTablep[1][k][j]);
2259 fscanf(fp7,"%f",&fTablep[2][k][j]);
2260 fscanf(fp8,"%f",&fTablep[3][k][j]);
2261 }
2262 }
2263 fclose(fp5);
2264 fclose(fp6);
2265 fclose(fp7);
2266 fclose(fp8);
2267}
2268//_____________________________________________________________________________
2269void AliZDCv3::StepManager()
2270{
2271 //
2272 // Routine called at every step in the Zero Degree Calorimeters
b6a8f9f1 2273 //
47709f57 2274 Int_t j, vol[2]={0,0}, ibeta=0, ialfa=0, ibe=0, nphe=0;
2275 Float_t hits[11], x[3], xdet[3], um[3], ud[3];
2276 Float_t m=0., ekin=0., destep=0., be=0., out=0.;
61424d1c 2277 // Parametrization for light guide uniformity
61424d1c 2278 // NEW!!! Light guide tilted @ 51 degrees
2279 Float_t guiPar[4]={0.31,-0.0006305,0.01337,0.8895};
f853b9aa 2280 Double_t s[3], p[3];
8d433671 2281 const char *knamed;
f853b9aa 2282 //
47709f57 2283 for(j=0;j<11;j++) hits[j]=-999.;
f853b9aa 2284 //
8d433671 2285 // --- This part is for no shower developement in beam pipe and TDI
2286 // If particle interacts with beam pipe or TDI -> return
f853b9aa 2287 if((gMC->CurrentMedium() == fMedSensPI) || (gMC->CurrentMedium() == fMedSensTDI)){
8d433671 2288 // If option NoShower is set -> StopTrack
cd807e71 2289 if(fNoShower==1){
f853b9aa 2290 gMC->TrackPosition(s[0],s[1],s[2]);
cd807e71 2291 if(gMC->CurrentMedium() == fMedSensPI){
8d433671 2292 knamed = gMC->CurrentVolName();
f853b9aa 2293 if(!strncmp(knamed,"YMQ",3)){
2294 if(s[2]<0) fpLostITC += 1;
2295 else fpLostITA += 1;
2296 }
8cbab886 2297 else if(!strncmp(knamed,"YD1",3)){
f853b9aa 2298 if(s[2]<0) fpLostD1C += 1;
2299 else fpLostD1A += 1;
2300 }
8cbab886 2301 else if(!strncmp(knamed,"QAL",3)) fnTrou++;
8d433671 2302 }
f853b9aa 2303 else if(gMC->CurrentMedium() == fMedSensTDI){
8d433671 2304 knamed = gMC->CurrentVolName();
f853b9aa 2305 if(!strncmp(knamed,"MD1",3)){
2306 if(s[2]<0) fpLostD1C += 1;
2307 else fpLostD1A += 1;
2308 }
8cbab886 2309 else if(!strncmp(knamed,"QTD",3)) fpLostTDI += 1;
2310 else if(!strncmp(knamed,"QLU",3)){
2311 if(s[2]<0) fnLumiC ++;
2312 else fnLumiA++;
2313 }
8d433671 2314 }
cd807e71 2315 //
8cbab886 2316 //gMC->TrackMomentum(p[0], p[1], p[2], p[3]);
cd807e71 2317 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2318 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2319 //
8cbab886 2320 printf("\n\t **********************************\n");
2321 printf("\t ********** Side C **********\n");
2322 printf("\t # of spectators in IT = %d\n",fpLostITC);
2323 printf("\t # of spectators in D1 = %d\n",fpLostD1C);
2324 printf("\t # of spectators in luminometer = %d\n",fnLumiC);
2325 printf("\t ********** Side A **********\n");
2326 printf("\t # of spectators in IT = %d\n",fpLostITA);
2327 printf("\t # of spectators in D1 = %d\n",fpLostD1A);
2328 printf("\t # of spectators in TDI = %d\n",fpLostTDI);
2329 printf("\t # of spectators in luminometer = %d\n",fnLumiA);
2330 printf("\t # of spectators in trousers = %d\n",fnTrou);
2331 printf("\t **********************************\n");
8d433671 2332 gMC->StopTrack();
2333 }
2334 return;
2335 }
2336
2337
2338 if((gMC->CurrentMedium() == fMedSensZN) || (gMC->CurrentMedium() == fMedSensZP) ||
2339 (gMC->CurrentMedium() == fMedSensGR) || (gMC->CurrentMedium() == fMedSensF1) ||
2340 (gMC->CurrentMedium() == fMedSensF2) || (gMC->CurrentMedium() == fMedSensZEM)){
2341
8cbab886 2342
8d433671 2343 //Particle coordinates
f853b9aa 2344 gMC->TrackPosition(s[0],s[1],s[2]);
8d433671 2345 for(j=0; j<=2; j++) x[j] = s[j];
2346 hits[0] = x[0];
2347 hits[1] = x[1];
2348 hits[2] = x[2];
2349
2350 // Determine in which ZDC the particle is
2351 knamed = gMC->CurrentVolName();
2352 if(!strncmp(knamed,"ZN",2)){
921be7cf 2353 if(x[2]<0.) vol[0]=1; // ZNC (dimuon side)
2354 else if(x[2]>0.) vol[0]=4; //ZNA
8d433671 2355 }
2356 else if(!strncmp(knamed,"ZP",2)){
921be7cf 2357 if(x[2]<0.) vol[0]=2; //ZPC (dimuon side)
2358 else if(x[2]>0.) vol[0]=5; //ZPA
8d433671 2359 }
921be7cf 2360 else if(!strncmp(knamed,"ZE",2)) vol[0]=3; //ZEM
8d433671 2361
2362 // Determine in which quadrant the particle is
f853b9aa 2363 if(vol[0]==1){ //Quadrant in ZNC
61424d1c 2364 // Calculating particle coordinates inside ZNC
f853b9aa 2365 xdet[0] = x[0]-fPosZNC[0];
2366 xdet[1] = x[1]-fPosZNC[1];
8d433671 2367 // Calculating quadrant in ZN
2368 if(xdet[0]<=0.){
f853b9aa 2369 if(xdet[1]<=0.) vol[1]=1;
2370 else vol[1]=3;
8d433671 2371 }
2372 else if(xdet[0]>0.){
f853b9aa 2373 if(xdet[1]<=0.) vol[1]=2;
2374 else vol[1]=4;
8d433671 2375 }
2376 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2377 printf("\n ZDC StepManager->ERROR in ZN!!! vol[1] = %d, xdet[0] = %f,"
2378 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2379 }
2380
f853b9aa 2381 else if(vol[0]==2){ //Quadrant in ZPC
61424d1c 2382 // Calculating particle coordinates inside ZPC
f853b9aa 2383 xdet[0] = x[0]-fPosZPA[0];
2384 xdet[1] = x[1]-fPosZPA[1];
8d433671 2385 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2386 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2387 // Calculating tower in ZP
2388 Float_t xqZP = xdet[0]/(fDimZP[0]/2.);
2389 for(int i=1; i<=4; i++){
2390 if(xqZP>=(i-3) && xqZP<(i-2)){
2391 vol[1] = i;
2392 break;
2393 }
2394 }
2395 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
2396 printf(" ZDC StepManager->ERROR in ZP!!! vol[1] = %d, xdet[0] = %f,"
2397 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2398 }
f853b9aa 2399 //
8d433671 2400 // Quadrant in ZEM: vol[1] = 1 -> particle in 1st ZEM (placed at x = 8.5 cm)
2401 // vol[1] = 2 -> particle in 2nd ZEM (placed at x = -8.5 cm)
2402 else if(vol[0] == 3){
2403 if(x[0]>0.){
2404 vol[1] = 1;
2405 // Particle x-coordinate inside ZEM1
2406 xdet[0] = x[0]-fPosZEM[0];
2407 }
2408 else{
2409 vol[1] = 2;
2410 // Particle x-coordinate inside ZEM2
2411 xdet[0] = x[0]+fPosZEM[0];
2412 }
2413 xdet[1] = x[1]-fPosZEM[1];
2414 }
f853b9aa 2415 //
2416 else if(vol[0]==4){ //Quadrant in ZNA
2417 // Calculating particle coordinates inside ZNA
2418 xdet[0] = x[0]-fPosZNA[0];
2419 xdet[1] = x[1]-fPosZNA[1];
2420 // Calculating quadrant in ZNA
2421 if(xdet[0]>=0.){
2422 if(xdet[1]<=0.) vol[1]=1;
2423 else vol[1]=3;
8d433671 2424 }
f853b9aa 2425 else if(xdet[0]<0.){
2426 if(xdet[1]<=0.) vol[1]=2;
2427 else vol[1]=4;
8d433671 2428 }
2429 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
f853b9aa 2430 printf("\n ZDC StepManager->ERROR in ZNA!!! vol[1] = %d, xdet[0] = %f,"
8d433671 2431 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2432 }
f853b9aa 2433 //
2434 else if(vol[0]==5){ //Quadrant in ZPA
2435 // Calculating particle coordinates inside ZPA
2436 xdet[0] = x[0]-fPosZPC[0];
2437 xdet[1] = x[1]-fPosZPC[1];
8d433671 2438 if(xdet[0]>=fDimZP[0]) xdet[0]=fDimZP[0]-0.01;
2439 if(xdet[0]<=-fDimZP[0]) xdet[0]=-fDimZP[0]+0.01;
2440 // Calculating tower in ZP
f853b9aa 2441 Float_t xqZP = -xdet[0]/(fDimZP[0]/2.);
8d433671 2442 for(int i=1; i<=4; i++){
2443 if(xqZP>=(i-3) && xqZP<(i-2)){
2444 vol[1] = i;
2445 break;
2446 }
2447 }
2448 if((vol[1]!=1) && (vol[1]!=2) && (vol[1]!=3) && (vol[1]!=4))
f853b9aa 2449 printf(" ZDC StepManager->ERROR in ZPA!!! vol[1] = %d, xdet[0] = %f,"
8d433671 2450 "xdet[1] = %f\n",vol[1], xdet[0], xdet[1]);
2451 }
2452
2453
2454 // Store impact point and kinetic energy of the ENTERING particle
2455
2456 if(gMC->IsTrackEntering()){
2457 //Particle energy
f853b9aa 2458 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
8d433671 2459 hits[3] = p[3];
2460 // Impact point on ZDC
2461 hits[4] = xdet[0];
2462 hits[5] = xdet[1];
2463 hits[6] = 0;
2464 hits[7] = 0;
2465 hits[8] = 0;
2466 hits[9] = 0;
47709f57 2467 //
2468 Int_t curTrackN = gAlice->GetMCApp()->GetCurrentTrackNumber();
2469 TParticle *part = (gAlice->GetMCApp())->Particle(curTrackN);
2470 hits[10] = part->GetPdgCode();
2471 //printf("\t PDGCode = %d\n", part->GetPdgCode());
8d433671 2472
47709f57 2473 AddHit(curTrackN, vol, hits);
8d433671 2474
2475 if(fNoShower==1){
921be7cf 2476 //printf("\t VolName %s -> det %d quad %d - x = %f, y = %f, z = %f\n",
2477 //knamed, vol[0], vol[1], x[0], x[1], x[2]);
2478 if(vol[0]==1){
2479 fnDetectedC += 1;
8cbab886 2480 printf("\n # of particles in ZNC = %d\n\n",fnDetectedC);
921be7cf 2481 }
2482 else if(vol[0]==2){
2483 fpDetectedC += 1;
8cbab886 2484 printf("\n # of particles in ZPC = %d\n\n",fpDetectedC);
921be7cf 2485 }
2486 else if(vol[0]==4){
2487 fnDetectedA += 1;
8cbab886 2488 printf("\n # of particles in ZNA = %d\n\n",fnDetectedA);
921be7cf 2489 }
2490 else if(vol[0]==5){
2491 fpDetectedA += 1;
8cbab886 2492 printf("\n # of particles in ZPA = %d\n\n",fpDetectedA);
921be7cf 2493 }
cd807e71 2494 //
2495 //printf("\t Particle: mass = %1.3f, E = %1.3f GeV, pz = %1.2f GeV -> stopped in volume %s\n",
2496 // gMC->TrackMass(), p[3], p[2], gMC->CurrentVolName());
2497 //
8d433671 2498 gMC->StopTrack();
8d433671 2499 return;
2500 }
2501 }
2502
2503 // Charged particles -> Energy loss
2504 if((destep=gMC->Edep())){
2505 if(gMC->IsTrackStop()){
f853b9aa 2506 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
8d433671 2507 m = gMC->TrackMass();
2508 ekin = p[3]-m;
2509 hits[9] = ekin;
2510 hits[7] = 0.;
2511 hits[8] = 0.;
2512 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2513 }
2514 else{
2515 hits[9] = destep;
2516 hits[7] = 0.;
2517 hits[8] = 0.;
2518 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2519 }
2520 }
2521 }
2522
2523
2524 // *** Light production in fibres
2525 if((gMC->CurrentMedium() == fMedSensF1) || (gMC->CurrentMedium() == fMedSensF2)){
2526
2527 //Select charged particles
2528 if((destep=gMC->Edep())){
2529
2530 // Particle velocity
2531 Float_t beta = 0.;
f853b9aa 2532 gMC->TrackMomentum(p[0],p[1],p[2],p[3]);
8d433671 2533 Float_t ptot=TMath::Sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
2534 if(p[3] > 0.00001) beta = ptot/p[3];
2535 else return;
2536 if(beta<0.67)return;
2537 else if((beta>=0.67) && (beta<=0.75)) ibeta = 0;
2538 else if((beta>0.75) && (beta<=0.85)) ibeta = 1;
2539 else if((beta>0.85) && (beta<=0.95)) ibeta = 2;
2540 else if(beta>0.95) ibeta = 3;
2541
2542 // Angle between particle trajectory and fibre axis
2543 // 1 -> Momentum directions
2544 um[0] = p[0]/ptot;
2545 um[1] = p[1]/ptot;
2546 um[2] = p[2]/ptot;
2547 gMC->Gmtod(um,ud,2);
2548 // 2 -> Angle < limit angle
2549 Double_t alfar = TMath::ACos(ud[2]);
2550 Double_t alfa = alfar*kRaddeg;
2551 if(alfa>=110.) return;
2552 //
2553 ialfa = Int_t(1.+alfa/2.);
2554
2555 // Distance between particle trajectory and fibre axis
f853b9aa 2556 gMC->TrackPosition(s[0],s[1],s[2]);
8d433671 2557 for(j=0; j<=2; j++){
2558 x[j] = s[j];
2559 }
2560 gMC->Gmtod(x,xdet,1);
2561 if(TMath::Abs(ud[0])>0.00001){
2562 Float_t dcoeff = ud[1]/ud[0];
2563 be = TMath::Abs((xdet[1]-dcoeff*xdet[0])/TMath::Sqrt(dcoeff*dcoeff+1.));
2564 }
2565 else{
2566 be = TMath::Abs(ud[0]);
2567 }
2568
2569 ibe = Int_t(be*1000.+1);
2570 //if((vol[0]==1)) radius = fFibZN[1];
2571 //else if((vol[0]==2)) radius = fFibZP[1];
2572
2573 //Looking into the light tables
2574 Float_t charge = gMC->TrackCharge();
2575
80e87581 2576 if(vol[0]==1 || vol[0]==4) { // (1) ZN fibres
8d433671 2577 if(ibe>fNben) ibe=fNben;
2578 out = charge*charge*fTablen[ibeta][ialfa][ibe];
2579 nphe = gRandom->Poisson(out);
2580 // Ch. debug
2581 //if(ibeta==3) printf("\t %f \t %f \t %f\n",alfa, be, out);
2582 //printf("\t ibeta = %d, ialfa = %d, ibe = %d -> nphe = %d\n\n",ibeta,ialfa,ibe,nphe);
2583 if(gMC->CurrentMedium() == fMedSensF1){
2584 hits[7] = nphe; //fLightPMQ
2585 hits[8] = 0;
2586 hits[9] = 0;
2587 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2588 }
2589 else{
2590 hits[7] = 0;
2591 hits[8] = nphe; //fLightPMC
2592 hits[9] = 0;
2593 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2594 }
2595 }
80e87581 2596 else if(vol[0]==2 || vol[0]==5) {// (2) ZP fibres
8d433671 2597 if(ibe>fNbep) ibe=fNbep;
2598 out = charge*charge*fTablep[ibeta][ialfa][ibe];
2599 nphe = gRandom->Poisson(out);
2600 if(gMC->CurrentMedium() == fMedSensF1){
2601 hits[7] = nphe; //fLightPMQ
2602 hits[8] = 0;
2603 hits[9] = 0;
2604 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2605 }
2606 else{
2607 hits[7] = 0;
2608 hits[8] = nphe; //fLightPMC
2609 hits[9] = 0;
2610 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2611 }
2612 }
2613 else if((vol[0]==3)) { // (3) ZEM fibres
2614 if(ibe>fNbep) ibe=fNbep;
2615 out = charge*charge*fTablep[ibeta][ialfa][ibe];
f853b9aa 2616 gMC->TrackPosition(s[0],s[1],s[2]);
47709f57 2617 Float_t xalic[3];
2618 for(j=0; j<3; j++){
8d433671 2619 xalic[j] = s[j];
2620 }
2621 // z-coordinate from ZEM front face
2622 // NB-> fPosZEM[2]+fZEMLength = -1000.+2*10.3 = 979.69 cm
47709f57 2623 Float_t z = -xalic[2]+fPosZEM[2]+2*fZEMLength-xalic[1];
8d433671 2624// z = xalic[2]-fPosZEM[2]-fZEMLength-xalic[1]*(TMath::Tan(45.*kDegrad));
2625// printf("\n fPosZEM[2]+2*fZEMLength = %f", fPosZEM[2]+2*fZEMLength);
47709f57 2626 Float_t guiEff = guiPar[0]*(guiPar[1]*z*z+guiPar[2]*z+guiPar[3]);
8d433671 2627 out = out*guiEff;
2628 nphe = gRandom->Poisson(out);
2629// printf(" out*guiEff = %f nphe = %d", out, nphe);
2630 if(vol[1] == 1){
2631 hits[7] = 0;
2632 hits[8] = nphe; //fLightPMC (ZEM1)
2633 hits[9] = 0;
2634 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2635 }
2636 else{
2637 hits[7] = nphe; //fLightPMQ (ZEM2)
2638 hits[8] = 0;
2639 hits[9] = 0;
2640 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
2641 }
2642 }
2643 }
2644 }
2645}