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