PID selection based on simple lambda cut, returns photon or pi0 ID instead of neutral...
[u/mrichter/AliRoot.git] / PMD / AliPMDv1.cxx
CommitLineData
c4561145 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 **************************************************************************/
d49fe99a 15/* $Id$ */
fe9578d7 16
c4561145 17//
18///////////////////////////////////////////////////////////////////////////////
19// //
20// Photon Multiplicity Detector Version 1 //
f117e3aa 21// Bedanga Mohanty : February 14th 2006
24c5571f 22//---------------------------------------------------
23// ALICE PMD FEE BOARDS IMPLEMENTATION
24// Dt: 25th February 2006
25// M.M. Mondal, S.K. Prasad and P.K. Netrakanti
26//---------------------------------------------------
27// Create final detector from Unit Modules
28// Author : Bedanga and Viyogi June 2003
29//---------------------------------------------------
30// Modified by
31// Dr. Y.P. Viyogi and Ranbir Singh
32// Dt: 2nd February 2009
33//
c4561145 34//Begin_Html
35/*
36<img src="picts/AliPMDv1Class.gif">
37*/
38//End_Html
39// //
24c5571f 40/////////////////////////////////////////////////////////////////////////////
c4561145 41////
42
24c5571f 43#include "Riostream.h"
788c3ee6 44#include <TVirtualMC.h>
bff3a244 45
46#include "AliConst.h"
4951e003 47#include "AliLog.h"
bff3a244 48#include "AliMC.h"
49#include "AliMagF.h"
50#include "AliPMDv1.h"
51#include "AliRun.h"
c4561145 52
24c5571f 53const Int_t AliPMDv1::fgkNcolUM1 = 48; // Number of cols in UM, type 1
54const Int_t AliPMDv1::fgkNcolUM2 = 96; // Number of cols in UM, type 2
55const Int_t AliPMDv1::fgkNrowUM1 = 96; // Number of rows in UM, type 1
56const Int_t AliPMDv1::fgkNrowUM2 = 48; // Number of rows in UM, type 2
5c3a1290 57const Float_t AliPMDv1::fgkCellRadius = 0.25; // Radius of a hexagonal cell
58const Float_t AliPMDv1::fgkCellWall = 0.02; // Thickness of cell Wall
59const Float_t AliPMDv1::fgkCellDepth = 0.50; // Gas thickness
24c5571f 60const Float_t AliPMDv1::fgkThPCB = 0.16; // Thickness of PCB
5c3a1290 61const Float_t AliPMDv1::fgkThLead = 1.5; // Thickness of Pb
62const Float_t AliPMDv1::fgkThSteel = 0.5; // Thickness of Steel
63const Float_t AliPMDv1::fgkGap = 0.025; // Air Gap
64const Float_t AliPMDv1::fgkZdist = 361.5; // z-position of the detector
65const Float_t AliPMDv1::fgkSqroot3 = 1.7320508;// Square Root of 3
66const Float_t AliPMDv1::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
f117e3aa 67const Float_t AliPMDv1::fgkSSBoundary = 0.3;
24c5571f 68const Float_t AliPMDv1::fgkThSS = 1.23; // Old thickness of SS frame was 1.03
69const Float_t AliPMDv1::fgkThTopG10 = 0.33;
70const Float_t AliPMDv1::fgkThBotG10 = 0.4;
71
72
c4561145 73ClassImp(AliPMDv1)
74
a48edddd 75//_____________________________________________________________________________
76AliPMDv1::AliPMDv1():
77 fSMthick(0.),
24c5571f 78 fSMthickpmd(0.),
a48edddd 79 fDthick(0.),
80 fSMLengthax(0.),
81 fSMLengthay(0.),
82 fSMLengthbx(0.),
83 fSMLengthby(0.),
84 fMedSens(0)
c4561145 85{
24c5571f 86
c4561145 87 // Default constructor
24c5571f 88
a48edddd 89 for (Int_t i = 0; i < 3; i++)
90 {
91 fDboxmm1[i] = 0.;
92 fDboxmm12[i] = 0.;
93 fDboxmm2[i] = 0.;
94 fDboxmm22[i] = 0.;
95 }
24c5571f 96 for (Int_t i = 0; i < 48; i++)
97 {
98 fModStatus[i] = 1;
99 }
100
c4561145 101}
102
103//_____________________________________________________________________________
a48edddd 104AliPMDv1::AliPMDv1(const char *name, const char *title):
105 AliPMD(name,title),
106 fSMthick(0.),
24c5571f 107 fSMthickpmd(0.),
a48edddd 108 fDthick(0.),
109 fSMLengthax(0.),
110 fSMLengthay(0.),
111 fSMLengthbx(0.),
112 fSMLengthby(0.),
113 fMedSens(0)
c4561145 114{
24c5571f 115
c4561145 116 // Standard constructor
24c5571f 117
a48edddd 118 for (Int_t i = 0; i < 3; i++)
119 {
120 fDboxmm1[i] = 0.;
121 fDboxmm12[i] = 0.;
122 fDboxmm2[i] = 0.;
123 fDboxmm22[i] = 0.;
124 }
24c5571f 125 for (Int_t i = 0; i < 48; i++)
126 {
127 fModStatus[i] = 1;
128 }
c4561145 129}
130
24c5571f 131
132
133
c4561145 134//_____________________________________________________________________________
135void AliPMDv1::CreateGeometry()
136{
b1952773 137 // Create geometry for Photon Multiplicity Detector
138
c4561145 139 GetParameters();
140 CreateSupermodule();
141 CreatePMD();
142}
143
144//_____________________________________________________________________________
145void AliPMDv1::CreateSupermodule()
146{
b1952773 147 //
24c5571f 148 // Creates the geometry of the cells of PMD, places them in modules
149 // which are rectangular objects.
b1952773 150 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is
151 // placed inside another hexagonal cell made of Cu (ECCU) with larger
152 // radius, compared to ECAR. The difference in radius gives the dimension
153 // of half width of each cell wall.
154 // These cells are placed in a rectangular strip which are of 2 types
24c5571f 155 // EST1 and EST2.
156 // Two types of honeycomb EHC1 & EHC2 are made using strips EST1 & EST2.
157 // 4 types of unit modules are made EUM1 & EUM2 for PRESHOWER Plane and
158 // EUV1 & EUV2 for VETO Plane which contains strips placed repeatedly
159 //
160 // These unit moules are then placed inside EPM1, EPM2, EPM3 and EPM4 along
161 // with lead convertor ELDA & ELDB and Iron Supports EFE1, EFE2, EFE3 and EFE4
162 // They have 6 unit moudles inside them in each plane. Therefore, total of 48
163 // unit modules in both the planes (PRESHOWER Plane & VETO Plane). The numbering
164 // of unit modules is from 0 to 47.
165 //
166 // Steel channels (ECHA & ECHB) are also placed which are used to place the unit modules
167 //
168 // In order to account for the extra material around and on the detector, Girders (EGDR),
169 // girder's Carriage (EXGD), eight Aluminium boxes (ESV1,2,3,4 & EVV1,2,3,4) along with
170 // LVDBs (ELVD), cables (ECB1,2,3,4), and ELMBs (ELMB) are being placed in approximations.
171 //
172 // Four FR4 sheets (ECC1,2,3,4) are placed parallel to the PMD on both sides, which perform
173 // as cooling encloser
174
175 // NOTE:- VOLUME Names : begining with "E" for all PMD volumes
c4561145 176
b1952773 177 Int_t i,j;
c4561145 178 Int_t number;
179 Int_t ihrotm,irotdm;
3cdb4e97 180 Float_t xb, yb, zb;
181
c4561145 182 Int_t *idtmed = fIdtmed->GetArray()-599;
183
184 AliMatrix(ihrotm, 90., 30., 90., 120., 0., 0.);
185 AliMatrix(irotdm, 90., 180., 90., 270., 180., 0.);
186
24c5571f 187 //******************************************************//
188 // STEP - I //
f117e3aa 189 //******************************************************//
b1952773 190 // First create the sensitive medium of a hexagon cell (ECAR)
c4561145 191 // Inner hexagon filled with gas (Ar+CO2)
24c5571f 192 // Integer assigned to Ar+CO2 medium is 604
193
c4561145 194 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
3cdb4e97 195 hexd2[4] = -fgkCellDepth/2.;
196 hexd2[7] = fgkCellDepth/2.;
197 hexd2[6] = fgkCellRadius - fgkCellWall;
198 hexd2[9] = fgkCellRadius - fgkCellWall;
c4561145 199
200 gMC->Gsvolu("ECAR", "PGON", idtmed[604], hexd2,10);
f117e3aa 201
24c5571f 202 //******************************************************//
203 // STEP - II //
f117e3aa 204 //******************************************************//
b1952773 205 // Place the sensitive medium inside a hexagon copper cell (ECCU)
c4561145 206 // Outer hexagon made of Copper
24c5571f 207 // Integer assigned to Cu medium is 614
b1952773 208
c4561145 209 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
3cdb4e97 210 hexd1[4] = -fgkCellDepth/2.;
211 hexd1[7] = fgkCellDepth/2.;
212 hexd1[6] = fgkCellRadius;
213 hexd1[9] = fgkCellRadius;
24c5571f 214
c4561145 215 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
c4561145 216
b1952773 217 // Place inner hex (sensitive volume) inside outer hex (copper)
218
a978c9e3 219 gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
f117e3aa 220
f117e3aa 221 //******************************************************//
24c5571f 222 // STEP - III //
223 //******************************************************//
224 // Now create Two types of Rectangular strips (EST1, EST2)
225 // of 1 column and 96 or 48 cells length
c4561145 226
b1952773 227 // volume for first strip EST1 made of AIR
24c5571f 228 // Integer assigned to Air medium is 698
229 // strip type-1 is of 1 column and 96 rows i.e. of 96 cells length
c4561145 230
b1952773 231 Float_t dbox1[3];
f117e3aa 232 dbox1[0] = fgkCellRadius/fgkSqroot3by2;
233 dbox1[1] = fgkNrowUM1*fgkCellRadius;
3cdb4e97 234 dbox1[2] = fgkCellDepth/2.;
b1952773 235
236 gMC->Gsvolu("EST1","BOX", idtmed[698], dbox1, 3);
c4561145 237
c4561145 238
24c5571f 239 // volume for second strip EST2
240 // strip type-2 is of 1 column and 48 rows i.e. of 48 cells length
f117e3aa 241
b1952773 242 Float_t dbox2[3];
f117e3aa 243 dbox2[1] = fgkNrowUM2*fgkCellRadius;
244 dbox2[0] = dbox1[0];
b1952773 245 dbox2[2] = dbox1[2];
c4561145 246
b1952773 247 gMC->Gsvolu("EST2","BOX", idtmed[698], dbox2, 3);
c4561145 248
b1952773 249 // Place hexagonal cells ECCU placed inside EST1
24c5571f 250
f117e3aa 251 xb = 0.;
b1952773 252 zb = 0.;
f117e3aa 253 yb = (dbox1[1]) - fgkCellRadius;
254 for (i = 1; i <= fgkNrowUM1; ++i)
a978c9e3 255 {
256 number = i;
f117e3aa 257 gMC->Gspos("ECCU", number, "EST1", xb,yb,zb, 0, "ONLY");
258 yb -= (fgkCellRadius*2.);
a978c9e3 259 }
f117e3aa 260
b1952773 261 // Place hexagonal cells ECCU placed inside EST2
f117e3aa 262 xb = 0.;
a978c9e3 263 zb = 0.;
f117e3aa 264 yb = (dbox2[1]) - fgkCellRadius;
265 for (i = 1; i <= fgkNrowUM2; ++i)
a978c9e3 266 {
267 number = i;
f117e3aa 268 gMC->Gspos("ECCU", number, "EST2", xb,yb,zb, 0, "ONLY");
f117e3aa 269 yb -= (fgkCellRadius*2.);
a978c9e3 270 }
24c5571f 271
272
f117e3aa 273 //******************************************************//
24c5571f 274 // STEP - IV //
f117e3aa 275 //******************************************************//
24c5571f 276 // Create EHC1 : The honey combs for a unit module type-1
277 //-------------------------EHC1 Start-------------------//
278
f117e3aa 279 // First step is to create a honey comb unit module.
24c5571f 280 // This is named as EHC1 and is a volume of Air
281 // we will lay the EST1 strips of honey comb cells inside it.
a978c9e3 282
24c5571f 283 // Dimensions of EHC1
284 // X-dimension = (dbox1[0]*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.)+ 0.15+0.05+0.05;
285 // Y-dimension = Number of rows * cell radius/sqrt3by2 + 0.15+0.05+0.05;
286 // 0.15cm is the extension in honeycomb on both side of X and Y, 0.05 for air gap and 0.05
287 // for G10 boundary around, which are now merged in the dimensions of EHC1
288 // Z-dimension = cell depth/2
289
290 Float_t ehcExt = 0.15;
291 Float_t ehcAround = 0.05 + 0.05;;
f117e3aa 292
b1952773 293 Float_t dbox3[3];
24c5571f 294 dbox3[0] = (dbox1[0]*fgkNcolUM1)-
295 (fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.) + ehcExt + ehcAround;
296 dbox3[1] = dbox1[1]+fgkCellRadius/2. + ehcExt + ehcAround;
3cdb4e97 297 dbox3[2] = fgkCellDepth/2.;
24c5571f 298
f117e3aa 299 //Create a BOX, Material AIR
300 gMC->Gsvolu("EHC1","BOX", idtmed[698], dbox3, 3);
f117e3aa 301 // Place rectangular strips EST1 inside EHC1 unit module
302 xb = dbox3[0]-dbox1[0];
b1952773 303
f117e3aa 304 for (j = 1; j <= fgkNcolUM1; ++j)
b1952773 305 {
306 if(j%2 == 0)
307 {
f117e3aa 308 yb = -fgkCellRadius/2.0;
b1952773 309 }
310 else
311 {
f117e3aa 312 yb = fgkCellRadius/2.0;
b1952773 313 }
314 number = j;
24c5571f 315 gMC->Gspos("EST1",number, "EHC1", xb - 0.25, yb , 0. , 0, "MANY");
316
f117e3aa 317 //The strips are being placed from top towards bottom of the module
318 //This is because the first cell in a module in hardware is the top
319 //left corner cell
24c5571f 320
f117e3aa 321 xb = (dbox3[0]-dbox1[0])-j*fgkCellRadius*fgkSqroot3;
24c5571f 322
c4561145 323 }
24c5571f 324
325 //--------------------EHC1 done----------------------------------------//
326
327
328
329 //--------------------------------EHC2 Start---------------------------//
330 // Create EHC2 : The honey combs for a unit module type-2
f117e3aa 331 // First step is to create a honey comb unit module.
332 // This is named as EHC2, we will lay the EST2 strips of
333 // honey comb cells inside it.
24c5571f 334
335 // Dimensions of EHC2
336 // X-dimension = (dbox2[0]*fgkNcolUM2)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.)+ 0.15+0.05+0.05;
337 // Y-dimension = Number of rows * cell radius/sqrt3by2 + 0.15+0.05+0.05;
338 // 0.15cm is the extension in honeycomb on both side of X and Y, 0.05 for air gap and 0.05
339 // for G10 boundary around, which are now merged in the dimensions of EHC2
340 // Z-dimension = cell depth/2
341
342
b1952773 343 Float_t dbox4[3];
24c5571f 344
345 dbox4[0] =(dbox2[0]*fgkNcolUM2)-
346 (fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.) + ehcExt + ehcAround;
347 dbox4[1] = dbox2[1] + fgkCellRadius/2. + ehcExt + ehcAround;
b1952773 348 dbox4[2] = dbox3[2];
a978c9e3 349
f117e3aa 350 //Create a BOX of AIR
351 gMC->Gsvolu("EHC2","BOX", idtmed[698], dbox4, 3);
24c5571f 352
f117e3aa 353 // Place rectangular strips EST2 inside EHC2 unit module
354 xb = dbox4[0]-dbox2[0];
a978c9e3 355
24c5571f 356 for (j = 1; j <= fgkNcolUM2; ++j)
357 {
358 if(j%2 == 0)
359 {
360 yb = -fgkCellRadius/2.0;
361 }
362 else
363 {
364 yb = +fgkCellRadius/2.0;
365 }
366 number = j;
367 gMC->Gspos("EST2",number, "EHC2", xb - 0.25, yb , 0. ,0, "MANY");
368 xb = (dbox4[0]-dbox2[0])-j*fgkCellRadius*fgkSqroot3;
369 }
370
371
372 //----------------------------EHC2 done-------------------------------//
f117e3aa 373
24c5571f 374 //====================================================================//
375
f117e3aa 376 // Now the job is to assmeble an Unit module
377 // It will have the following components
24c5571f 378 // (a) Base plate of G10 of 0.2cm
379 // (b) Air gap of 0.08cm
380 // (c) Bottom PCB of 0.16cm G10
381 // (d) Honey comb 0f 0.5cm
382 // (e) Top PCB of 0.16cm G10
383 // (f) Back Plane of 0.1cm G10
384 // (g) Then all around then we have an air gap of 0.05cm
385 // (h) Then all around 0.05cm thick G10 insulation
386 // (i) Then all around Stainless Steel boundary channel 0.3 cm thick
387
388 // In order to reduce the number of volumes and simplify the geometry
389 // following steps are performed:
390 // (I) Base Plate(0.2cm), Air gap(0.04cm) and Bottom PCB(0.16cm)
391 // are taken together as a G10 Plate EDGA (0.4cm)
392 // (II) Back Plane(0.1cm), Air Gap(0.04cm) and Top PCB(0.16cm) and extra
393 // clearance 0.03cm are taken together as G10 Plate EEGA(0.33cm)
394 // (III) The all around Air gap(0.05cm) and G10 boundary(0.05cm) are already
395 // merged in the dimension of EHC1, EHC2, EDGA and EEGA. Therefore, no
396 // separate volumes for all around materials
f117e3aa 397
24c5571f 398 //Let us first create them one by one
399 //--------------------------------------------------------------------//
f117e3aa 400
24c5571f 401 // ---------------- Lets do it first for UM Long Type -----//
402 // 4mm G10 Box : Bottom PCB + Air Gap + Base Plate
403 //================================================
404 // Make a 4mm thick G10 Box for Unit module Long Type
405 // X-dimension is EHC1 - ehcExt
406 // Y-dimension is EHC1 - ehcExt
407 // EHC1 was extended 0.15cm(ehcExt) on both sides
408 // Z-dimension 0.4/2 = 0.2 cm
409 // Integer assigned to G10 medium is 607
f117e3aa 410
24c5571f 411 Float_t dboxCGA[3];
412 dboxCGA[0] = dbox3[0] - ehcExt;
413 dboxCGA[1] = dbox3[1] - ehcExt;
414 dboxCGA[2] = fgkThBotG10/2.;
f117e3aa 415
24c5571f 416 //Create a G10 BOX
417 gMC->Gsvolu("EDGA","BOX", idtmed[607], dboxCGA, 3);
f117e3aa 418
419 //-------------------------------------------------//
24c5571f 420 // 3.3mm G10 Box : Top PCB + Air GAp + Back Plane
f117e3aa 421 //================================================
24c5571f 422 // Make a 3.3mm thick G10 Box for Unit module Long Type
423 // X-dimension is EHC1 - ehcExt
424 // Y-dimension is EHC1 - ehcExt
425 // EHC1 was extended 0.15cm(ehcExt) on both sides
426 // Z-dimension 0.33/2 = 0.165 cm
f117e3aa 427
24c5571f 428 Float_t dboxEEGA[3];
429 dboxEEGA[0] = dboxCGA[0];
430 dboxEEGA[1] = dboxCGA[1];
431 dboxEEGA[2] = fgkThTopG10/2.;
432
433 //Create a G10 BOX
434 gMC->Gsvolu("EEGA","BOX", idtmed[607], dboxEEGA, 3);
f117e3aa 435
f117e3aa 436
f117e3aa 437 //----------------------------------------------------------//
24c5571f 438 //Stainless Steel Bounadry : EUM1 & EUV1
439 //
440 // Make a 3.63cm thick Stainless Steel boundary for Unit module Long Type
441 // 3.63cm equivalent to EDGA(0.4cm)+EHC1(0.5cm)+EEGA(0.33cm)+FEE Board(2.4cm)
442 // X-dimension is EEGA + fgkSSBoundary
443 // Y-dimension is EEGA + fgkSSBoundary
444 // Z-dimension 1.23/2 + 2.4/2.
445 // FEE Boards are 2.4cm thick
446 // Integer assigned to Stainless Steel medium is 618
f117e3aa 447 //------------------------------------------------------//
448 // A Stainless Steel Boundary Channel to house the unit module
24c5571f 449 // along with the FEE Boards
c2518432 450
451 Float_t dboxSS1[3];
24c5571f 452 dboxSS1[0] = dboxCGA[0]+fgkSSBoundary;
453 dboxSS1[1] = dboxCGA[1]+fgkSSBoundary;
454 dboxSS1[2] = fgkThSS/2.+ 2.4/2.;
f117e3aa 455
456 //FOR PRESHOWER
f117e3aa 457 //Stainless Steel boundary - Material Stainless Steel
24c5571f 458 gMC->Gsvolu("EUM1","BOX", idtmed[618], dboxSS1, 3);
459
f117e3aa 460 //FOR VETO
461 //Stainless Steel boundary - Material Stainless Steel
24c5571f 462 gMC->Gsvolu("EUV1","BOX", idtmed[618], dboxSS1, 3);
463
464 //--------------------------------------------------------------------//
f117e3aa 465
f117e3aa 466
24c5571f 467
f117e3aa 468
24c5571f 469 // ============ PMD FEE BOARDS IMPLEMENTATION ======================//
470
471 // FEE board
472 // It is FR4 board of length * breadth :: 7cm * 2.4 cm
473 // and thickness 0.2cm
474 // Material medium is same as G10
f117e3aa 475
24c5571f 476 Float_t dboxFEE[3];
477 dboxFEE[0] = 0.2/2.;
478 dboxFEE[1] = 7.0/2.;
479 dboxFEE[2] = 2.4/2.;
f117e3aa 480
24c5571f 481 gMC->Gsvolu("EFEE","BOX", idtmed[607], dboxFEE, 3);
f117e3aa 482
24c5571f 483 // Now to create the Mother volume to accomodate FEE boards
484 // It should have the dimension few mm smaller than the back plane
485 // But, we have taken it as big as EUM1 or EUV1
486 // It is to compensate the Stainless Steel medium of EUM1 or EUV1
f117e3aa 487
24c5571f 488 // Create Mother volume of Air : Long TYPE
f117e3aa 489
24c5571f 490 Float_t dboxFEEBPlaneA[3];
491 dboxFEEBPlaneA[0] = dboxSS1[0];
492 dboxFEEBPlaneA[1] = dboxSS1[1];
493 dboxFEEBPlaneA[2] = 2.4/2.;
f117e3aa 494
24c5571f 495 //Volume of same dimension as EUM1 or EUV1 of Material AIR
496 gMC->Gsvolu("EFBA","BOX", idtmed[698], dboxFEEBPlaneA, 3);
f117e3aa 497
24c5571f 498 //Placing the FEE boards in the Mother volume of AIR
f117e3aa 499
f117e3aa 500
24c5571f 501 Float_t xFee; // X-position of FEE board
502 Float_t yFee; // Y-position of FEE board
503 Float_t zFee = 0.0; // Z-position of FEE board
504
505 Float_t xA = 0.5; //distance from the border to 1st FEE board/Translator
506 Float_t yA = 4.00; //distance from the border to 1st FEE board
507 Float_t xSepa = 1.70; //Distance between two FEE boards in X-side
508 Float_t ySepa = 8.00; //Distance between two FEE boards in Y-side
509
510
511
512 // FEE Boards EFEE placed inside EFBA
513
514 yFee = dboxFEEBPlaneA[1] - yA - 0.1 - 0.3;
515 // 0.1cm and 0.3cm are subtracted to shift the FEE Boards on their actual positions
516 // As the positions are changed, because we have taken the dimension of EFBA equal
517 // to the dimension of EUM1 or EUV1
518 number = 1;
519 // The loop for six rows of FEE Board
520 for (i = 1; i <= 6; ++i)
521 {
522 // First we place the translator board
523 xFee = -dboxFEEBPlaneA[0] + xA + 0.1 +0.3;
524
525 gMC->Gspos("EFEE", number, "EFBA", xFee,yFee,zFee, 0, "ONLY");
526
527 // The first FEE board is 11mm from the translator board
528 xFee += 1.1;
529 number += 1;
530
531 for (j = 1; j <= 12; ++j)
532 {
533 gMC->Gspos("EFEE", number, "EFBA", xFee,yFee,zFee, 0, "ONLY");
534 xFee += xSepa;
535 number += 1;
536 }
537 yFee -= ySepa;
538 }
539
540
541 // Now Place EEGA, EDGA, EHC1 and EFBA in EUM1 & EUV1 to complete the unit module
542
543
544 // FOR PRE SHOWER //
545 // Placing of all components of UM in AIR BOX EUM1 //
546
547 //(1) FIRST PUT the 4mm G10 Box : EDGA
548 Float_t zedga = -dboxSS1[2] + fgkThBotG10/2.;
549 gMC->Gspos("EDGA", 1, "EUM1", 0., 0., zedga, 0, "ONLY");
550
551 //(2) NEXT PLACING the Honeycomb EHC1
552 Float_t zehc1 = zedga + fgkThBotG10/2. + fgkCellDepth/2.;
553 gMC->Gspos("EHC1", 1, "EUM1", 0., 0., zehc1, 0, "ONLY");
554
555 //(3) NEXT PLACING the 3.3mm G10 Box : EEGA
556 Float_t zeega = zehc1 + fgkCellDepth/2. + fgkThTopG10/2.;
557 gMC->Gspos("EEGA", 1, "EUM1", 0., 0., zeega, 0, "ONLY");
558
559 //(4) NEXT PLACING the FEE BOARD : EFBA
560 Float_t zfeeboardA = zeega + fgkThTopG10/2. +1.2;
561 gMC->Gspos("EFBA", 1, "EUM1", 0., 0., zfeeboardA, 0, "ONLY");
562
563 // FOR VETO //
564 // Placing of all components of UM in AIR BOX EUV1 //
565
566 //(1) FIRST PUT the FEE BOARD : EFBA
567 zfeeboardA = -dboxSS1[2] + 1.2;
568 gMC->Gspos("EFBA", 1, "EUV1", 0., 0., zfeeboardA, 0, "ONLY");
569
570 //(2) FIRST PLACING the 3.3mm G10 Box : EEGA
571 zeega = zfeeboardA + 1.2 + fgkThTopG10/2.;
572 gMC->Gspos("EEGA", 1, "EUV1", 0., 0., zeega, 0, "ONLY");
573
574 //(3) NEXT PLACING the Honeycomb EHC1
575 zehc1 = zeega + fgkThTopG10/2 + fgkCellDepth/2.;
576 gMC->Gspos("EHC1", 1, "EUV1", 0., 0., zehc1, 0, "ONLY");
577
578 //(4) NEXT PUT THE 4mm G10 Box : EDGA
579 zedga = zehc1 + fgkCellDepth/2.+ fgkThBotG10/2.;
580 gMC->Gspos("EDGA", 1, "EUV1", 0., 0., zedga, 0, "ONLY");
f117e3aa 581
f117e3aa 582
24c5571f 583 //=================== LONG TYPE COMPLETED =========================//
584 //------------ Lets do the same thing for UM Short Type -------------//
585 // 4mm G10 Box : Bottom PCB + Air Gap + Base Plate
f117e3aa 586 //================================================
24c5571f 587 // Make a 4mm thick G10 Box for Unit module ShortType
588 // X-dimension is EHC2 - ehcExt
589 // Y-dimension is EHC2 - ehcExt
590 // EHC2 was extended 0.15cm(ehcExt) on both sides
591 // Z-dimension 0.4/2 = 0.2 cm
592 // Integer assigned to G10 medium is 607
593
594 Float_t dboxCGB[3];
595 dboxCGB[0] = dbox4[0] - ehcExt;
596 dboxCGB[1] = dbox4[1] - ehcExt;
597 dboxCGB[2] = 0.4/2.;
598
599 //Create a G10 BOX
600 gMC->Gsvolu("EDGB","BOX", idtmed[607], dboxCGB, 3);
601
602 //-------------------------------------------------//
603 // 3.3mm G10 Box : PCB + Air Gap + Back Plane
f117e3aa 604 //================================================
24c5571f 605 // Make a 3.3mm thick G10 Box for Unit module Short Type
606 // X-dimension is EHC2 - ehcExt
607 // Y-dimension is EHC2 - ehcExt
608 // EHC2 was extended 0.15cm(ehcExt) on both sides
609 // Z-dimension 0.33/2 = 0.165 cm
610
611 Float_t dboxEEGB[3];
612 dboxEEGB[0] = dboxCGB[0];
613 dboxEEGB[1] = dboxCGB[1];
614 dboxEEGB[2] = 0.33/2.;
615
616 // Create a G10 BOX
617 gMC->Gsvolu("EEGB","BOX", idtmed[607], dboxEEGB, 3);
618
619
620 //Stainless Steel Bounadry : EUM2 & EUV2
f117e3aa 621 //==================================
24c5571f 622 // Make a 3.63cm thick Stainless Steel boundary for Unit module Short Type
623 // 3.63cm equivalent to EDGB(0.4cm)+EHC2(0.5cm)+EEGB(0.33cm)+FEE Board(2.4cm)
624 // X-dimension is EEGB + fgkSSBoundary
625 // Y-dimension is EEGB + fgkSSBoundary
626 // Z-dimension 1.23/2 + 2.4/2.
627 // FEE Boards are 2.4cm thick
628 // Integer assigned to Stainless Steel medium is 618
f117e3aa 629 //------------------------------------------------------//
630 // A Stainless Steel Boundary Channel to house the unit module
24c5571f 631 // along with the FEE Boards
632
633
c2518432 634 Float_t dboxSS2[3];
24c5571f 635 dboxSS2[0] = dboxCGB[0] + fgkSSBoundary;
636 dboxSS2[1] = dboxCGB[1] + fgkSSBoundary;
637 dboxSS2[2] = fgkThSS/2.+ 2.4/2.;
f117e3aa 638
639 //PRESHOWER
640 //Stainless Steel boundary - Material Stainless Steel
24c5571f 641 gMC->Gsvolu("EUM2","BOX", idtmed[618], dboxSS2, 3);
642
f117e3aa 643 //VETO
24c5571f 644 //Stainless Steel boundary - Material Stainless Steel
645 gMC->Gsvolu("EUV2","BOX", idtmed[618], dboxSS2, 3);
646
f117e3aa 647 //----------------------------------------------------------------//
24c5571f 648 //NOW THE FEE BOARD IMPLEMENTATION
649
650 // To create the Mother volume to accomodate FEE boards
651 // It should have the dimension few mm smaller than the back plane
652 // But, we have taken it as big as EUM2 or EUV2
653 // It is to compensate the Stainless Steel medium of EUM2 or EUV2
f117e3aa 654
24c5571f 655 // Create Mother volume of Air : SHORT TYPE
656 //------------------------------------------------------//
f117e3aa 657
f117e3aa 658
24c5571f 659 Float_t dboxFEEBPlaneB[3];
660 dboxFEEBPlaneB[0] = dboxSS2[0];
661 dboxFEEBPlaneB[1] = dboxSS2[1];
662 dboxFEEBPlaneB[2] = 2.4/2.;
663
664 //Volume of same dimension as EUM2 or EUV2 of Material AIR
665 gMC->Gsvolu("EFBB","BOX", idtmed[698], dboxFEEBPlaneB, 3);
666
667
668 // FEE Boards EFEE placed inside EFBB
669
670 yFee = dboxFEEBPlaneB[1] - yA -0.1 -0.3;
671 // 0.1cm and 0.3cm are subtracted to shift the FEE Boards on their actual positions
672 // As the positions are changed, because we have taken the dimension of EFBB equal
673 // to the dimension of EUM2 or EUV2
674 number = 1;
675 for (i = 1; i <= 3; ++i)
676 {
677 xFee = -dboxFEEBPlaneB[0] + xA + 0.1 +0.3;
678
679 //First we place the translator board
680 gMC->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
681 // The first FEE board is 11mm from the translator board
682 xFee+=1.1;
683 number+=1;
684
685 for (j = 1; j <= 12; ++j)
686 {
687 gMC->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
688 xFee += xSepa;
689 number += 1;
690 }
691
692 //Now we place Bridge Board
693 xFee = xFee - xSepa + 0.8 ;
694 //Bridge Board is at a distance 8mm from FEE board
695 gMC->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
696
697 number+=1;
698 xFee+=0.8;
699
700 for (j = 1; j <= 12; ++j)
701 {
702 gMC->Gspos("EFEE", number, "EFBB", xFee,yFee,zFee, 0, "ONLY");
703 xFee += xSepa;
704 number += 1;
705 }
706 yFee -= ySepa;
707 }
708
709
710
711 // Now Place EEGB, EDGB, EHC2 and EFBB in EUM2 & EUV2 to complete the unit module
712
713 // FOR PRE SHOWER
714 //- Placing of all components of UM in AIR BOX EUM2--//
715 //(1) FIRST PUT the G10 Box : EDGB
716 Float_t zedgb = -dboxSS2[2] + 0.4/2.;
717 gMC->Gspos("EDGB", 1, "EUM2", 0., 0., zedgb, 0, "ONLY");
718
719 //(2) NEXT PLACING the Honeycomb EHC2
720 Float_t zehc2 = zedgb + 0.4/2. + fgkCellDepth/2.;
721 gMC->Gspos("EHC2", 1, "EUM2", 0., 0., zehc2, 0, "ONLY");
722
723 //(3) NEXT PLACING the G10 Box : EEGB
724 Float_t zeegb = zehc2 + fgkCellDepth/2. + 0.33/2.;
725 gMC->Gspos("EEGB", 1, "EUM2", 0., 0., zeegb, 0, "ONLY");
726
727 //(4) NEXT PLACING FEE BOARDS : EFBB
728 Float_t zfeeboardB = zeegb + 0.33/2.+1.2;
729 gMC->Gspos("EFBB", 1, "EUM2", 0., 0., zfeeboardB, 0, "ONLY");
730
731 // FOR VETO
732 // Placing of all components of UM in AIR BOX EUV2 //
733
734 //(1) FIRST PUT the FEE BOARD : EUV2
735 zfeeboardB = -dboxSS2[2] + 1.2;
736 gMC->Gspos("EFBB", 1, "EUV2", 0., 0., zfeeboardB, 0, "ONLY");
737
738 //(2) FIRST PLACING the G10 Box : EEGB
739 zeegb = zfeeboardB + 1.2 + 0.33/2.;
740 gMC->Gspos("EEGB", 1, "EUV2", 0., 0., zeegb, 0, "ONLY");
741
742 //(3) NEXT PLACING the Honeycomb EHC2
743 zehc2 = zeegb + 0.33/2. + fgkCellDepth/2.;
744 gMC->Gspos("EHC2", 1, "EUV2", 0., 0., zehc2, 0, "ONLY");
745
746 //(4) NEXT PUT THE G10 Box : EDGB
747 zedgb = zehc2 + fgkCellDepth/2.+ 0.4/2.;
748 gMC->Gspos("EDGB", 1, "EUV2", 0., 0., zedgb, 0, "ONLY");
749
750
751 //===================================================================//
752 //---------------------- UM Type B completed ------------------------//
753
754}
f117e3aa 755
24c5571f 756//_______________________________________________________________________
f117e3aa 757
24c5571f 758void AliPMDv1::CreatePMD()
759{
760 // Create final detector from Unit Modules
761 // -- Author : Bedanga and Viyogi June 2003
762
763
764 Float_t zp = fgkZdist; //Z-distance of PMD from Interaction Point
f117e3aa 765
24c5571f 766 Int_t jhrot12,jhrot13, irotdm;
767 Int_t *idtmed = fIdtmed->GetArray()-599;
768
769 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
770 AliMatrix(jhrot12, 90., 180., 90., 270., 0., 0.);
771 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
772
773 // Now We Will Calculate Position Co-ordinates of EUM1 & EUV1 in EPM1 & EPM2
774
775 Float_t dbox1[3];
776 dbox1[0] = fgkCellRadius/fgkSqroot3by2;
777 dbox1[1] = fgkNrowUM1*fgkCellRadius;
778 dbox1[2] = fgkCellDepth/2.;
779
780 Float_t dbox3[3];
781 dbox3[0] = (dbox1[0]*fgkNcolUM1)-
782 (fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.) + 0.15 + 0.05 + 0.05;
783 dbox3[1] = dbox1[1]+fgkCellRadius/2. + 0.15 + 0.05 + 0.05;
784 dbox3[2] = fgkCellDepth/2.;
785
786 Float_t dboxCGA[3];
787 dboxCGA[0] = dbox3[0] - 0.15;
788 dboxCGA[1] = dbox3[1] - 0.15;
789 dboxCGA[2] = 0.4/2.;
f117e3aa 790
24c5571f 791 Float_t dboxSS1[3];
792 dboxSS1[0] = dboxCGA[0]+fgkSSBoundary;
793 dboxSS1[1] = dboxCGA[1]+fgkSSBoundary;
794 dboxSS1[2] = fgkThSS/2.;
f117e3aa 795
24c5571f 796 Float_t dboxUM1[3];
797 dboxUM1[0] = dboxSS1[0];
798 dboxUM1[1] = dboxSS1[1];
799 dboxUM1[2] = fgkThSS/2. + 1.2;
c2518432 800
24c5571f 801 Float_t dboxSM1[3];
802 dboxSM1[0] = fSMLengthax + 0.05; // 0.05cm for the ESC1,2
803 dboxSM1[1] = fSMLengthay;
804 dboxSM1[2] = dboxUM1[2];
805
806 // Position co-ordinates of the unit modules in EPM1 & EPM2
807 Float_t xa1,xa2,xa3,ya1,ya2;
808 xa1 = dboxSM1[0] - dboxUM1[0];
809 xa2 = xa1 - dboxUM1[0] - 0.1 - dboxUM1[0];
810 xa3 = xa2 - dboxUM1[0] - 0.1 - dboxUM1[0];
811 ya1 = dboxSM1[1] - 0.2 - dboxUM1[1];
812 ya2 = ya1 - dboxUM1[1] - 0.3 - dboxUM1[1];
813
814 // Next to Calculate Position Co-ordinates of EUM2 & EUV2 in EPM3 & EPM4
815
816 Float_t dbox2[3];
817 dbox2[1] = fgkNrowUM2*fgkCellRadius;
818 dbox2[0] = dbox1[0];
819 dbox2[2] = dbox1[2];
820
821 Float_t dbox4[3];
822 dbox4[0] =(dbox2[0]*fgkNcolUM2)-
823 (fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.) + 0.15 + 0.05 + 0.05;
824 dbox4[1] = dbox2[1] + fgkCellRadius/2. + 0.15 + 0.05 + 0.05;
825 dbox4[2] = dbox3[2];
826
827 Float_t dboxCGB[3];
828 dboxCGB[0] = dbox4[0] - 0.15;
829 dboxCGB[1] = dbox4[1] - 0.15;
830 dboxCGB[2] = 0.4/2.;
831
832 Float_t dboxSS2[3];
833 dboxSS2[0] = dboxCGB[0] + fgkSSBoundary;
834 dboxSS2[1] = dboxCGB[1] + fgkSSBoundary;
835 dboxSS2[2] = fgkThSS/2.;
836
c2518432 837 Float_t dboxUM2[3];
838 dboxUM2[0] = dboxSS2[0];
839 dboxUM2[1] = dboxSS2[1];
24c5571f 840 dboxUM2[2] = fgkThSS/2. + 2.4/2.; // 2.4 cm is added for FEE Board thickness
f117e3aa 841
24c5571f 842 Float_t dboxSM2[3];
843 dboxSM2[0] = fSMLengthbx + 0.05; // 0.05cm for the ESC3,4
844 dboxSM2[1] = fSMLengthby;
845 dboxSM2[2] = dboxUM2[2];
846
847 // Position co-ordinates of the unit modules in EPM3 & EPM4
848 // Space is added to provide a gapping for HV between UM's
849 Float_t xb1,xb2,yb1,yb2,yb3;
850 xb1 = dboxSM2[0] - 0.1 - dboxUM2[0];
851 xb2 = xb1 - dboxUM2[0] - 0.1 - dboxUM2[0];
852 yb1 = dboxSM2[1] - 0.2 - dboxUM2[1];
853 yb2 = yb1 - dboxUM2[1] - 0.3 - dboxUM2[1];
854 yb3 = yb2 - dboxUM2[1] - 0.3 - dboxUM2[1];
855
856 // Create Volumes for Lead(Pb) Plates
857
858 // Lead Plate For LONG TYPE
859 // X-dimension of Lead Plate = 3*(X-dimension of EUM1 or EUV1) + gap provided between unit modules
860 // Y-dimension of Lead Plate = 2*(Y-dimension of EUM1 or EUV1) + thickness of SS channels
861 // + tolerance
862 // Z-demension of Lead Plate = 1.5cm
863 // Integer assigned to Pb-medium is 600
864
865 Float_t dboxLeadA[3];
866 dboxLeadA[0] = fSMLengthax;
867 dboxLeadA[1] = fSMLengthay;
868 dboxLeadA[2] = fgkThLead/2.;
869
870 gMC->Gsvolu("ELDA","BOX", idtmed[600], dboxLeadA, 3);
871
872 //LEAD Plate For SHORT TYPE
873 // X-dimension of Lead Plate = 2*(X-dimension of EUM2 or EUV2) + gap provided between unit modules
874 // Y-dimension of Lead Plate = 3*(Y-dimension of EUM2 or EUV2) + thickness of SS channels
875 // + tolerance
876 // Z-demension of Lead Plate = 1.5cm
877 // Integer assigned to Pb-medium is 600
878
879 Float_t dboxLeadB[3];
880 dboxLeadB[0] = fSMLengthbx;
881 dboxLeadB[1] = fSMLengthby;
882 dboxLeadB[2] = fgkThLead/2.;
883
884 gMC->Gsvolu("ELDB","BOX", idtmed[600], dboxLeadB, 3);
885
886 //=========== CREATE MOTHER VOLUMES FOR PMD ===========================/
887
888 Float_t serviceX = 23.2;
889 Float_t serviceYa = 5.2;
890 Float_t serviceYb = 9.8;
891 Float_t serviceXext = 16.0;
892
893 // Five Mother Volumes of PMD are Created
894 // Two Volumes EPM1 & EPM2 of Long Type
895 // Other Two Volumes EPM3 & EPM4 for Short Type
896 // Fifth Volume EFGD for Girders and its Carriage
897 // Four Volmes EPM1, EPM2, EPM3 & EPM4 are Placed such that
898 // to create a hole and avoid overlap with Beam Pipe
899
900 // Create Volume FOR EPM1
901 // X-dimension = fSMLengthax + Extended Iron Support(23.2cm) +
902 // Extension in Module(16cm) for full coverage of Detector + 1mm thick SS-Plate
903 // Y-dimension = fSMLengthay + Extended Iron Support(5.2cm)
904 // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
905 // Note:- EPM1 is a Volume of Air
906
907 Float_t gaspmd1[3];
908 gaspmd1[0] = fSMLengthax + serviceX/2.+ serviceXext/2. + 0.05; //0.05cm for the thickness of
909 gaspmd1[1] = fSMLengthay + serviceYa/2.; //SS-plate for cooling encloser
910 gaspmd1[2] = fSMthick/2.;
911
912 gMC->Gsvolu("EPM1", "BOX", idtmed[698], gaspmd1, 3);
f117e3aa 913
f117e3aa 914
24c5571f 915 // Create Volume FOR EPM2
f117e3aa 916
24c5571f 917 // X-dimension = fSMLengthax + Extended Iron Support(23.2cm) +
918 // Extension in Module(16cm) for full coverage of Detector + 1mm thick SS-Plate
919 // Y-dimension = fSMLengthay + Extended Iron Support(9.8cm)
920 // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
921 // Note:- EPM2 is a Volume of Air
f117e3aa 922
24c5571f 923 Float_t gaspmd2[3];
924 gaspmd2[0] = fSMLengthax + serviceX/2. + serviceXext/2. + 0.05; //0.05cm for the thickness of
925 gaspmd2[1] = fSMLengthay + serviceYb/2.; //SS-plate for cooling encloser
926 gaspmd2[2] = fSMthick/2.;
f117e3aa 927
24c5571f 928 gMC->Gsvolu("EPM2", "BOX", idtmed[698], gaspmd2, 3);
f117e3aa 929
24c5571f 930 // Create Volume FOR EPM3
f117e3aa 931
24c5571f 932 // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm) +
933 // Extension in Module(16cm) for full coverage of Detector
934 // Y-dimension = fSMLengthby + Extended Iron Support(5.2cm)
935 // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
936 // Note:- EPM3 is a Volume of Air
f117e3aa 937
f117e3aa 938
24c5571f 939 Float_t gaspmd3[3];
940 gaspmd3[0] = fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05; //0.05cm for the thickness of
941 gaspmd3[1] = fSMLengthby + serviceYa/2.; //SS-plate for cooling encloser
942 gaspmd3[2] = fSMthick/2.;
f117e3aa 943
24c5571f 944 gMC->Gsvolu("EPM3", "BOX", idtmed[698], gaspmd3, 3);
f117e3aa 945
24c5571f 946 // Create Volume FOR EPM4
f117e3aa 947
24c5571f 948 // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm) +
949 // Extension in Module(16cm) for full coverage of Detector
950 // Y-dimension = fSMLengthby + Extended Iron Support(9.8cm)
951 // Z-dimension = fSMthick/2.; fSMthick=17cm is full profile of PMD in Z-Side
952 // Note:- EPM4 is a Volume of Air
953
954 Float_t gaspmd4[3];
955 gaspmd4[0] = fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05; //0.05cm for the thickness of
956 gaspmd4[1] = fSMLengthby + serviceYb/2.; //SS-plate for cooling encloser
957 gaspmd4[2] = fSMthick/2.;
958
959 gMC->Gsvolu("EPM4", "BOX", idtmed[698], gaspmd4, 3);
960
961 // Create the Fifth Mother Volume of Girders and its Carriage
962 //-------------------------------------------------------------//
963 // Create the Girders
964
965 // X-dimension = 238.7cm
966 // Y-dimension = 12.0cm
967 // Z-dimension = 7.0cm
968 // Girders are the Volume of Iron
969 // And the Integer Assigned to SS is 618
970
971 Float_t grdr[3];
972 grdr[0] = 238.7/2.;
973 grdr[1] = 12.0/2.;
974 grdr[2] = 7.0/2.;
975
976 gMC->Gsvolu("EGDR", "BOX", idtmed[618], grdr, 3);
977
978 // Create Air Strip for Girders as the Girders are hollow
979 // Girders are 1cm thick in Y and Z on both sides
980
981 Float_t airgrdr[3];
982 airgrdr[0] = grdr[0];
983 airgrdr[1] = grdr[1] - 1.0;
984 airgrdr[2] = grdr[2] - 1.0;
985
986 gMC->Gsvolu("EAIR", "BOX", idtmed[698], airgrdr, 3);
c4561145 987
24c5571f 988 // Positioning the air strip EAIR in girder EGDR
989 gMC->Gspos("EAIR", 1, "EGDR", 0., 0., 0., 0, "ONLY");
b1952773 990
24c5571f 991 // Create the Carriage for Girders
992 // Originally, Carriage is divided in two parts
993 // 64.6cm on -X side, 44.2cm on +X side and 8.2cm is the gap between two
994 // In approximation we have taken these together as a single Volume
995 // With X = 64.6cm + 44.2cm + 8.2cm
996 // Y-dimension = 4.7cm
997 // Z-dimension = 18.5cm
998 // Carriage is a Volume of SS
999
1000 Float_t xgrdr[3];
1001 xgrdr[0] = (64.6 + 44.2 + 8.2)/2.;
1002 xgrdr[1] = 4.7/2.;
1003 xgrdr[2] = 18.5/2.;
b1952773 1004
24c5571f 1005 gMC->Gsvolu("EXGD", "BOX", idtmed[618], xgrdr, 3);
f117e3aa 1006
24c5571f 1007 // Create Air Strip for the Carriage EXGD as it is hollow
1008 // Carriage is 1cm thick in Y on one side and in Z on both sides
1009
1010 Float_t xairgrdr[3];
1011 xairgrdr[0] = xgrdr[0];
1012 xairgrdr[1] = xgrdr[1] - 0.5;
1013 xairgrdr[2] = xgrdr[2] - 1.0;
a978c9e3 1014
24c5571f 1015 gMC->Gsvolu("EXIR", "BOX", idtmed[698], xairgrdr, 3);
1016
1017 // Positioning the air strip EXIR in CArriage EXGD
1018 gMC->Gspos("EXIR", 1, "EXGD", 0., -0.05, 0., 0, "ONLY");
f117e3aa 1019
24c5571f 1020 // Now Create the master volume of air containing Girders & Carriage
1021
1022 // X-dimension = same as X-dimension of Girders(EGDR)
1023 // Y-dimension = Y of Girder(EGDR) + Y of Carriage(EXGD) + gap between two
1024 // Z-dimenson = same as Z of Carriage(EXGD)
1025 // Note:- It is a volume of Air
f117e3aa 1026
24c5571f 1027 Float_t fulgrdr[3];
1028 fulgrdr[0] = 238.7/2.;
1029 fulgrdr[1] = 17.5/2.;
1030 fulgrdr[2] = 18.5/2.;
b1952773 1031
24c5571f 1032 gMC->Gsvolu("EFGD", "BOX", idtmed[698], fulgrdr, 3);
f117e3aa 1033
24c5571f 1034 // Positioning the EGDR and EXGD in EFGD
b1952773 1035
24c5571f 1036 gMC->Gspos("EXGD", 1, "EFGD", 0., 6.4, 0., 0, "ONLY");
1037 gMC->Gspos("EGDR", 1, "EFGD", 0., -2.75, -5.75, 0, "ONLY");
1038 gMC->Gspos("EGDR", 2, "EFGD", 0., -2.75, 5.75, 0, "ONLY");
f117e3aa 1039
24c5571f 1040 //=========== Mother Volumes are Created ============================//
f117e3aa 1041
24c5571f 1042 // Create the Volume of 1mm thick SS-Plate for cooling encloser
1043 // These are placed on the side close to the Beam Pipe
1044 // SS-Plate is perpendicular to the plane of Detector
1045
1046 // For LONG TYPE
1047
1048 // For EPM1
1049 // X-dimension = 0.1cm
1050 // Y-dimension = same as Y of EPM1
1051 // Z-dimension = Y of EPM1 - 0.1; 0.1cm is subtracted as 1mm thick
1052 // FR4 sheets for the detector encloser placed on both sides
1053 // It is a Volume of SS
1054 // Integer assigned to SS is 618
1055
1056 Float_t sscoolencl1[3];
1057 sscoolencl1[0] = 0.05;
1058 sscoolencl1[1] = gaspmd1[1];
1059 sscoolencl1[2] = gaspmd1[2] - 0.2/2.;
f117e3aa 1060
24c5571f 1061 gMC->Gsvolu("ESC1", "BOX", idtmed[618], sscoolencl1, 3);
b1952773 1062
24c5571f 1063 // Placement of ESC1 in EPM1
1064 gMC->Gspos("ESC1", 1, "EPM1", -gaspmd1[0] + 0.05, 0., 0., 0, "ONLY");
b1952773 1065
b1952773 1066
24c5571f 1067 // For EPM2
1068 // X-dimension = 0.1cm
1069 // Y-dimension = same as Y of EPM2
1070 // Z-dimension = Y of EPM2 - 0.1; 0.1cm is subtracted as 1mm thick
1071 // FR4 sheets for the detector encloser placed on both sides
1072 // It is a Volume of SS
1073
1074 Float_t sscoolencl2[3];
1075 sscoolencl2[0] = 0.05;
1076 sscoolencl2[1] = gaspmd2[1];
1077 sscoolencl2[2] = gaspmd2[2] - 0.2/2.;
b1952773 1078
24c5571f 1079 gMC->Gsvolu("ESC2", "BOX", idtmed[618], sscoolencl2, 3);
c4561145 1080
24c5571f 1081 // Placement of ESC2 in EPM2
1082 gMC->Gspos("ESC2", 1, "EPM2", gaspmd2[0] - 0.05 , 0., 0., 0, "ONLY");
c4561145 1083
24c5571f 1084 // For SHORT TYPE
c4561145 1085
24c5571f 1086 // For EPM3
1087 // X-dimension = 0.1cm
1088 // Y-dimension = same as Y of EPM3
1089 // Z-dimension = Y of EPM3 - 0.1; 0.1cm is subtracted as 1mm thick
1090 // FR4 sheets for the detector encloser placed on both sides
1091 // It is a Volume of SS
1092
1093 Float_t sscoolencl3[3];
1094 sscoolencl3[0] = 0.05;
1095 sscoolencl3[1] = gaspmd3[1];
1096 sscoolencl3[2] = gaspmd3[2] - 0.2/2.;
1097
1098 gMC->Gsvolu("ESC3", "BOX", idtmed[618], sscoolencl3, 3);
1099
1100 // Placement of ESC3 in EPM3
1101 gMC->Gspos("ESC3", 1, "EPM3", gaspmd3[0] - 0.05 , 0., 0., 0, "ONLY");
b1952773 1102
24c5571f 1103
1104 // For EPM4
1105 // X-dimension = 0.1cm
1106 // Y-dimension = same as Y of EPM4
1107 // Z-dimension = Y of EPM4 - 0.1; 0.1cm is subtracted as 1mm thick
1108 // FR4 sheets for the detector encloser placed on both sides
1109 // It is a Volume of SS
f117e3aa 1110
24c5571f 1111 Float_t sscoolencl4[3];
1112 sscoolencl4[0] = 0.05;
1113 sscoolencl4[1] = gaspmd4[1];
1114 sscoolencl4[2] = gaspmd4[2] - 0.2/2.;
f117e3aa 1115
24c5571f 1116 gMC->Gsvolu("ESC4", "BOX", idtmed[618], sscoolencl4, 3);
f117e3aa 1117
24c5571f 1118 // Placement of ESC4 in EPM4
1119 gMC->Gspos("ESC4", 1, "EPM4", -gaspmd4[0] + 0.05 , 0., 0., 0, "ONLY");
f117e3aa 1120
24c5571f 1121 //======== CREATE SS SUPPORTS FOR EPM1, EPM2, EPM3 & EPM4 =========//
1122 // --- DEFINE SS volumes for EPM1 & EPM2 ---
1123
1124 // Create SS Support For EPM1
1125
1126 // X-dimension = fSMLengthax + Extended Iron Support(23.2cm)
1127 // Y-dimension = fSMLengthay + Extended Iron Support(5.2cm)
1128 // Z-dimension = thickness of Iron support(0.5cm)
1129 // It is a Volume of SS
1130 // Integer assigned to SS is 618
1131
1132 Float_t dboxFea1[3];
1133 dboxFea1[0] = fSMLengthax + serviceX/2.;
1134 dboxFea1[1] = fSMLengthay + serviceYa/2.;
1135 dboxFea1[2] = fgkThSteel/2.;
f117e3aa 1136
24c5571f 1137 gMC->Gsvolu("EFE1","BOX", idtmed[618], dboxFea1, 3);
f117e3aa 1138
24c5571f 1139
1140 // Create SS Support For EPM2
1141
1142 // X-dimension = fSMLengthax + Extended Iron Support(23.2cm)
1143 // Y-dimension = fSMLengthay + Extended Iron Support(9.8cm)
1144 // Z-dimension = thickness of Iron support(0.5cm)
1145 // It is a Volume of SS
1146 // Integer assigned to SS is 618
1147
1148 Float_t dboxFea2[3];
1149 dboxFea2[0] = fSMLengthax + serviceX/2.;
1150 dboxFea2[1] = fSMLengthay + serviceYb/2.;
1151 dboxFea2[2] = fgkThSteel/2.;
f117e3aa 1152
24c5571f 1153 gMC->Gsvolu("EFE2","BOX", idtmed[618], dboxFea2, 3);
b1952773 1154
24c5571f 1155 // Create SS Support For EPM3
c4561145 1156
24c5571f 1157 // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm)
1158 // Y-dimension = fSMLengthby + Extended Iron Support(5.2cm)
1159 // Z-dimension = thickness of Iron support(0.5cm)
1160 // It is a Volume of SS
1161 // Integer assigned to SS is 618
c4561145 1162
24c5571f 1163 Float_t dboxFea3[3];
1164 dboxFea3[0] = fSMLengthbx + serviceX/2.;
1165 dboxFea3[1] = fSMLengthby + serviceYa/2.;
1166 dboxFea3[2] = fgkThSteel/2.;
1167
1168 gMC->Gsvolu("EFE3","BOX", idtmed[618], dboxFea3, 3);
c4561145 1169
24c5571f 1170 // Create SS Support For EPM4
c4561145 1171
24c5571f 1172 // X-dimension = fSMLengthbx + Extended Iron Support(23.2cm)
1173 // Y-dimension = fSMLengthby + Extended Iron Support(9.8cm)
1174 // Z-dimension = thickness of Iron support(0.5cm)
1175 // It is a Volume of SS
1176 // Integer assigned to SS is 618
1177
1178 Float_t dboxFea4[3];
1179 dboxFea4[0] = fSMLengthbx + serviceX/2.;
1180 dboxFea4[1] = fSMLengthby + serviceYb/2.;
1181 dboxFea4[2] = fgkThSteel/2.;
f117e3aa 1182
24c5571f 1183 gMC->Gsvolu("EFE4","BOX", idtmed[618], dboxFea4, 3);
c4561145 1184
c4561145 1185
24c5571f 1186 //=============== Volumes for SS support are Completed =============//
c4561145 1187
24c5571f 1188 // Create FR4 Sheets to enclose the PMD which are Placed parallel to the
1189 // plane of the detector. Four FR4 sheets are created with the dimensions
1190 // corresponding to the Iron Supports
1191 // This is cooling encloser.
c4561145 1192
24c5571f 1193 // Create FR4 sheet ECC1
1194 // X-dimension = same as EFE1
1195 // Y-dimension = same as EFE1
1196 // Z-dimension = 0.1cm
1197 // FR4 medium is same as that of G10
1198 // Integer assigned to FR4 medium is 607
c4561145 1199
24c5571f 1200 Float_t enclos1[3];
1201 enclos1[0] = dboxFea1[0];
1202 enclos1[1] = dboxFea1[1];
1203 enclos1[2] = 0.05;
c4561145 1204
24c5571f 1205 gMC->Gsvolu("ECC1", "BOX", idtmed[607], enclos1, 3);
b1952773 1206
24c5571f 1207 // Create FR4 sheet ECC2
1208 // X-dimension = same as EFE2
1209 // Y-dimension = same as EFE2
1210 // Z-dimension = 0.1cm
c4561145 1211
24c5571f 1212 Float_t enclos2[3];
1213 enclos2[0] = dboxFea2[0];
1214 enclos2[1] = dboxFea2[1];
1215 enclos2[2] = 0.05;
c4561145 1216
24c5571f 1217 gMC->Gsvolu("ECC2", "BOX", idtmed[607], enclos2, 3);
c4561145 1218
24c5571f 1219 // Create FR4 sheet ECC3
1220 // X-dimension = same as EFE3
1221 // Y-dimension = same as EFE3
1222 // Z-dimension = 0.1cm
c4561145 1223
24c5571f 1224 Float_t enclos3[3];
1225 enclos3[0] = dboxFea3[0];
1226 enclos3[1] = dboxFea3[1];
1227 enclos3[2] = 0.05;
1228
1229 gMC->Gsvolu("ECC3", "BOX", idtmed[607], enclos3, 3);
1230
1231 // Create FR4 sheet ECC4
1232 // X-dimension = same as EFE4
1233 // Y-dimension = same as EFE4
1234 // Z-dimension = 0.1cm
c4561145 1235
24c5571f 1236 Float_t enclos4[3];
1237 enclos4[0] = dboxFea4[0];
1238 enclos4[1] = dboxFea4[1];
1239 enclos4[2] = 0.05;
c4561145 1240
24c5571f 1241 gMC->Gsvolu("ECC4", "BOX", idtmed[607], enclos4, 3);
c4561145 1242
24c5571f 1243 //--------------- FR4 SHEETS COMPLETED ---------------------------//
c4561145 1244
24c5571f 1245 //------------- Create the SS-Channels(Horizontal Rails) to Place
1246 // Unit Modules on SS Support -------------------------------------//
1247
1248 // Two types of SS-Channels are created
1249 // as we have two types of modules
1250
1251 // Create SS-channel for Long Type
1252 // X-dimension = same as Lead Plate ELDA
1253 // Y-dimension = 0.1cm
1254 // Z-dimension = 2.0cm
1255 // Volume medium is SS
1256
1257 Float_t channel12[3];
1258 channel12[0] = fSMLengthax;
1259 channel12[1] = 0.05;
1260 channel12[2] = 2.0/2.;
1261
1262 gMC->Gsvolu("ECHA", "BOX", idtmed[618], channel12, 3);
1263
1264 // Create SS-channel for Short Type
1265 // X-dimension = same as Lead Plate ELDB
1266 // Y-dimension = 0.1cm
1267 // Z-dimension = 2.0cm
1268 // Volume medium is SS
c4561145 1269
24c5571f 1270 Float_t channel34[3];
1271 channel34[0] = fSMLengthbx;
1272 channel34[1] = 0.05;
1273 channel34[2] = 2.0/2.;
c4561145 1274
24c5571f 1275 gMC->Gsvolu("ECHB", "BOX", idtmed[618], channel34, 3);
c4561145 1276
24c5571f 1277 //----------------- SS-Channels are Copmleted --------------------//
c4561145 1278
24c5571f 1279 //========= POSITIONING OF SS SUPPORT AND LEAD PLATES IN QUADRANTS =====//
1280
1281 /**************** Z-Distances of different Components **********/
1282
1283 Float_t zcva,zfea,zpba,zpsa,zchanVeto,zchanPS, zelvdbVeto, zelvdbPS;
1284
1285
1286 zpba = - fgkThSteel/2.; //z-position of Pb plate
1287 zfea = fgkThLead/2.; //z-position of SS-Support
1288 zchanVeto = zpba - fgkThLead/2. - channel12[2]; //z-position of SS-channel on Veto
1289 zchanPS = zfea + fgkThSteel/2. + channel12[2]; //z-position of SS-channel on Preshower
1290 zpsa = zfea + fgkThSteel/2. + fDthick; //z-position of Preshower
1291 zcva = zpba - fgkThLead/2.- fDthick; //z-position of Veto
1292
1293 zelvdbVeto = zpba + fgkThLead/2. - 8.9/2.; //z-position of LVDBs on Veto side
1294 zelvdbPS = zfea + fgkThSteel/2. + 7.4/2.; //z-position of LVDBs on Preshower side
1295
1296 // FOR LONG TYPE
1297 Float_t xLead1,yLead1,zLead1, xLead2,yLead2,zLead2;
1298 Float_t xIron1,yIron1,zIron1, xIron2,yIron2,zIron2;
1299
1300
1301 xIron1 = - 16.0/2. + 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed
1302 yIron1 = 0.;
1303 zIron1 = zfea;
1304
1305 xIron2 = 16.0/2. - 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed
1306 yIron2 = 0.;
1307 zIron2 = zfea;
c4561145 1308
c4561145 1309
24c5571f 1310 xLead1 = xIron1 - 23.2/2.;
1311 yLead1 = -5.2/2.;
1312 zLead1 = zpba;
1313
1314 xLead2 =xIron2 + 23.2/2.;
1315 yLead2 = 9.8/2.;
1316 zLead2 = zpba;
1317
1318 gMC->Gspos("EFE1", 1, "EPM1", xIron1, yIron1, zfea, 0, "ONLY");
1319 gMC->Gspos("ELDA", 1, "EPM1", xLead1, yLead1, zpba, 0, "ONLY");
1320 gMC->Gspos("EFE2", 1, "EPM2", xIron2, yIron2, zfea, 0, "ONLY");
1321 gMC->Gspos("ELDA", 1, "EPM2", xLead2, yLead2, zpba, jhrot12, "ONLY");
1322
1323
1324 // FOR SHORT TYPE
1325 Float_t xLead3,yLead3,zLead3, xLead4,yLead4,zLead4;
1326 Float_t xIron3,yIron3,zIron3, xIron4,yIron4,zIron4;
1327
1328
1329 xIron3 = 16.0/2.- 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed ;
1330 yIron3 = 0.;
1331 zIron3 = zfea;
1332
1333 xIron4 = - 16.0/2.+ 0.1/2.; // half of 0.1cm is added as 1mm SS sheet is placed;
1334 yIron4 = 0.;
1335 zIron4 = zfea;
1336
1337 xLead3 = xIron3 + 23.2/2.;
1338 yLead3 = -5.2/2.;
1339 zLead3 = zpba;
1340
1341 xLead4 = xIron4 - 23.2/2.;
1342 yLead4 = 9.8/2.;
1343 zLead4 = zpba;
1344
1345 gMC->Gspos("EFE3", 1, "EPM3", xIron3, yIron3, zfea, 0, "ONLY");
1346 gMC->Gspos("ELDB", 1, "EPM3", xLead3, yLead3, zpba, 0, "ONLY");
1347 gMC->Gspos("EFE4", 1, "EPM4", xIron4, yIron4, zfea, 0, "ONLY");
1348 gMC->Gspos("ELDB", 1, "EPM4", xLead4, yLead4, zpba, jhrot12, "ONLY");
1349
1350 //===================================================================//
1351 // Placement of FR4 sheets as encloser of full profile of PMD
1352
1353 gMC->Gspos("ECC1", 1, "EPM1", xIron1, yIron1, -8.45, 0, "ONLY");
1354 gMC->Gspos("ECC2", 1, "EPM2", xIron2, yIron2, -8.45, 0,"ONLY");
1355 gMC->Gspos("ECC3", 1, "EPM3", xIron3, yIron3, -8.45, 0,"ONLY");
1356 gMC->Gspos("ECC4", 1, "EPM4", xIron4, yIron4, -8.45, 0,"ONLY");
b1952773 1357
24c5571f 1358 gMC->Gspos("ECC1", 2, "EPM1", xIron1, yIron1, 8.45, 0, "ONLY");
1359 gMC->Gspos("ECC2", 2, "EPM2", xIron2, yIron2, 8.45, 0,"ONLY");
1360 gMC->Gspos("ECC3", 2, "EPM3", xIron3, yIron3, 8.45, 0,"ONLY");
1361 gMC->Gspos("ECC4", 2, "EPM4", xIron4, yIron4, 8.45, 0,"ONLY");
1362
1363 //----------------- NOW TO PLACE SS-CHANNELS -----------------------//
1364
1365 Float_t xchanepm11, ychanepm11,ychanepm12;
1366 Float_t xchanepm21, ychanepm21,ychanepm22;
1367 Float_t xchanepm31, ychanepm31,ychanepm32,ychanepm33,ychanepm34;
1368 Float_t xchanepm41, ychanepm41,ychanepm42,ychanepm43,ychanepm44;
1369
1370 xchanepm11 = xLead1;
1371 ychanepm11 = ya1 + yLead1 + dboxSS1[1] + 0.1 + 0.1/2.;
1372 ychanepm12 = ya1 + yLead1 - dboxSS1[1] - 0.1 - 0.1/2.;
1373
1374 xchanepm21 = xLead2;
1375 ychanepm21 = -ya1 + yLead2 - dboxSS1[1] - 0.1 - 0.1/2.;
1376 ychanepm22 = -ya1 + yLead2 + dboxSS1[1] + 0.1 + 0.1/2.;
1377
1378 gMC->Gspos("ECHA", 1, "EPM1", xchanepm11, ychanepm11, zchanPS, 0, "ONLY");
1379 gMC->Gspos("ECHA", 2, "EPM1", xchanepm11, ychanepm12, zchanPS, 0, "ONLY");
1380 gMC->Gspos("ECHA", 3, "EPM1", xchanepm11, ychanepm11, zchanVeto, 0, "ONLY");
1381 gMC->Gspos("ECHA", 4, "EPM1", xchanepm11, ychanepm12, zchanVeto, 0, "ONLY");
1382 gMC->Gspos("ECHA", 1, "EPM2", xchanepm21, ychanepm21, zchanPS, 0, "ONLY");
1383 gMC->Gspos("ECHA", 2, "EPM2", xchanepm21, ychanepm22, zchanPS, 0, "ONLY");
1384 gMC->Gspos("ECHA", 3, "EPM2", xchanepm21, ychanepm21, zchanVeto, 0, "ONLY");
1385 gMC->Gspos("ECHA", 4, "EPM2", xchanepm21, ychanepm22, zchanVeto, 0, "ONLY");
c4561145 1386
24c5571f 1387 xchanepm31 = xLead3;
1388 ychanepm31 = yb1 + yLead3 + dboxSS2[1] + 0.1 + 0.1/2.;
1389 ychanepm32 = yb1 + yLead3 - dboxSS2[1] - 0.1 - 0.1/2.;
1390 ychanepm33 = yb3 + yLead3 + dboxSS2[1] + 0.1 + 0.1/2.;
1391 ychanepm34 = yb3 + yLead3 - dboxSS2[1] - 0.1 - 0.1/2.;
1392
1393 xchanepm41 = xLead4;
1394 ychanepm41 = -yb1 + yLead4 - dboxSS2[1] - 0.1 - 0.1/2.;
1395 ychanepm42 = -yb1 + yLead4 + dboxSS2[1] + 0.1 + 0.1/2.;
1396 ychanepm43 = -yb3 + yLead4 - dboxSS2[1] - 0.1 - 0.1/2.;
1397 ychanepm44 = -yb3 + yLead4 + dboxSS2[1] + 0.1 + 0.1/2.;
1398
1399
1400 gMC->Gspos("ECHB", 1, "EPM3", xchanepm31, ychanepm31, zchanPS, 0, "ONLY");
1401 gMC->Gspos("ECHB", 2, "EPM3", xchanepm31, ychanepm32, zchanPS, 0, "ONLY");
1402 gMC->Gspos("ECHB", 3, "EPM3", xchanepm31, ychanepm33, zchanPS, 0, "ONLY");
1403 gMC->Gspos("ECHB", 4, "EPM3", xchanepm31, ychanepm34, zchanPS, 0, "ONLY");
1404 gMC->Gspos("ECHB", 5, "EPM3", xchanepm31, ychanepm31, zchanVeto, 0, "ONLY");
1405 gMC->Gspos("ECHB", 6, "EPM3", xchanepm31, ychanepm32, zchanVeto, 0, "ONLY");
1406 gMC->Gspos("ECHB", 7, "EPM3", xchanepm31, ychanepm33, zchanVeto, 0, "ONLY");
1407 gMC->Gspos("ECHB", 8, "EPM3", xchanepm31, ychanepm34, zchanVeto, 0, "ONLY");
1408
1409 gMC->Gspos("ECHB", 1, "EPM4", xchanepm41, ychanepm41, zchanPS, 0, "ONLY");
1410 gMC->Gspos("ECHB", 2, "EPM4", xchanepm41, ychanepm42, zchanPS, 0, "ONLY");
1411 gMC->Gspos("ECHB", 3, "EPM4", xchanepm41, ychanepm43, zchanPS, 0, "ONLY");
1412 gMC->Gspos("ECHB", 4, "EPM4", xchanepm41, ychanepm44, zchanPS, 0, "ONLY");
1413 gMC->Gspos("ECHB", 5, "EPM4", xchanepm41, ychanepm41, zchanVeto, 0, "ONLY");
1414 gMC->Gspos("ECHB", 6, "EPM4", xchanepm41, ychanepm42, zchanVeto, 0, "ONLY");
1415 gMC->Gspos("ECHB", 7, "EPM4", xchanepm41, ychanepm43, zchanVeto, 0, "ONLY");
1416 gMC->Gspos("ECHB", 8, "EPM4", xchanepm41, ychanepm44, zchanVeto, 0, "ONLY");
1417
1418 //================= Channel Placement Completed ======================//
1419 //============ Now to Create Al Box and then LVDBs and Cables //
1420 // are Placed inside it //
1421
1422 // Eight Al Boxes are created, four on Preshower side
1423 // and four on Veto side
c4561145 1424
24c5571f 1425 // FOR PRESHOWER
1426
1427 // First to Create hollow Al Box
1428 // there are two types of modules, therefore, two Al box of
1429 // long type and two of short type are created
1430
1431 // For Long Type
1432 // X-dimension = 16.5cm
1433 // Y-dimension = same as EFE1
1434 // Z-dimension = 7.4cm
1435 // Integer assigned to Al medium is 603
1436
1437 Float_t esvdA1[3];
1438 esvdA1[0]= 16.5/2.;
1439 esvdA1[1]= dboxFea1[1];
1440 esvdA1[2]= 7.4/2.;
b1952773 1441
24c5571f 1442 gMC->Gsvolu("ESV1", "BOX", idtmed[603], esvdA1, 3);
1443 gMC->Gsvolu("ESV2", "BOX", idtmed[603], esvdA1, 3);
1444
1445 // Create Air strip for Al Boxes type-A
1446 // Al boxes are 3mm thick In X and Z on both sides
1447 // X-dimension = 16.5cm - 0.3cm
1448 // Y-dimension = same as EFE1
1449 // Z-dimension = 7.4cm - 0.3cm
1450
1451 Float_t eairA1[3];
1452 eairA1[0]= esvdA1[0] - 0.3;
1453 eairA1[1]= esvdA1[1];
1454 eairA1[2]= esvdA1[2] - 0.3;
1455
1456 gMC->Gsvolu("EIR1", "BOX", idtmed[698], eairA1, 3);
1457
1458 // Put air strip inside ESV1 & ESV2
1459 gMC->Gspos("EIR1", 1, "ESV1", 0., 0., 0., 0, "ONLY");
1460 gMC->Gspos("EIR1", 1, "ESV2", 0., 0., 0., 0, "ONLY");
b1952773 1461
c4561145 1462
24c5571f 1463 // For Short Type
1464 // X-dimension = 16.5cm
1465 // Y-dimension = same as EFE3
1466 // Z-dimension = 7.4cm
1467
1468 Float_t esvdA2[3];
1469 esvdA2[0]= esvdA1[0];
1470 esvdA2[1]= dboxFea3[1];
1471 esvdA2[2]= esvdA1[2];
c4561145 1472
24c5571f 1473 gMC->Gsvolu("ESV3", "BOX", idtmed[603], esvdA2, 3);
1474 gMC->Gsvolu("ESV4", "BOX", idtmed[603], esvdA2, 3);
1475
1476 // Create Air strip for Al Boxes type-B
1477 // Al boxes are 3mm thick In X and Z on both sides
1478 // X-dimension = 16.5cm - 0.3cm
1479 // Y-dimension = same as EFE3
1480 // Z-dimension = 7.4cm - 0.3cm
1481
1482 Float_t eairA2[3];
1483 eairA2[0]= esvdA2[0] - 0.3;
1484 eairA2[1]= esvdA2[1];
1485 eairA2[2]= esvdA2[2] - 0.3;
1486
1487 gMC->Gsvolu("EIR2", "BOX", idtmed[698], eairA2, 3);
1488
1489 // Put air strip inside ESV3 & ESV4
1490 gMC->Gspos("EIR2", 1, "ESV3", 0., 0., 0., 0, "ONLY");
1491 gMC->Gspos("EIR2", 1, "ESV4", 0., 0., 0., 0, "ONLY");
1492
1493
1494 // FOR VETO
1495
1496 // First to Create hollow Al Box
1497 // there are two types of modules, therefore, two Al box of
1498 // long type and two of short type are created
f117e3aa 1499
24c5571f 1500 // For Long Type
1501 // X-dimension = 16.5cm
1502 // Y-dimension = same as EFE1
1503 // Z-dimension = 8.9cm
1504 // Integer assigned to Al medium is 603
1505
1506 Float_t esvdB1[3];
1507 esvdB1[0]= 16.5/2.;
1508 esvdB1[1]= dboxFea1[1];
1509 esvdB1[2]= 8.9/2.;
1510
1511 gMC->Gsvolu("EVV1", "BOX", idtmed[603], esvdB1, 3);
1512 gMC->Gsvolu("EVV2", "BOX", idtmed[603], esvdB1, 3);
1513
1514 // Create Air strip for Al Boxes long type
1515 // Al boxes are 3mm thick In X and Z on both sides
1516 // X-dimension = 16.5cm - 0.3cm
1517 // Y-dimension = same as EFE1
1518 // Z-dimension = 8.9cm - 0.3cm
1519
1520 Float_t eairB1[3];
1521 eairB1[0]= esvdB1[0] - 0.3;
1522 eairB1[1]= esvdB1[1];
1523 eairB1[2]= esvdB1[2] - 0.3;
1524
1525 gMC->Gsvolu("EIR3", "BOX", idtmed[698], eairB1, 3);
b1952773 1526
24c5571f 1527 // Put air strip inside EVV1 & EVV2
1528 gMC->Gspos("EIR3", 1, "EVV1", 0., 0., 0., 0, "ONLY");
1529 gMC->Gspos("EIR3", 1, "EVV2", 0., 0., 0., 0, "ONLY");
f117e3aa 1530
1531
24c5571f 1532 // For Short Type
1533 // X-dimension = 16.5cm
1534 // Y-dimension = same as EFE3
1535 // Z-dimension = 8.9cm
1536 // Integer assigned to Al medium is 603
1537
1538 Float_t esvdB2[3];
1539 esvdB2[0]= esvdB1[0];
1540 esvdB2[1]= dboxFea3[1];
1541 esvdB2[2]= esvdB1[2];
b1952773 1542
24c5571f 1543 gMC->Gsvolu("EVV3", "BOX", idtmed[603], esvdB2, 3);
1544 gMC->Gsvolu("EVV4", "BOX", idtmed[603], esvdB2, 3);
a978c9e3 1545
f117e3aa 1546
24c5571f 1547 // Create Air strip for Al Boxes short type
1548 // Al boxes are 3mm thick In X and Z on both sides
1549 // X-dimension = 16.5cm - 0.3cm
1550 // Y-dimension = same as EFE3
1551 // Z-dimension = 8.9cm - 0.3cm
1552
1553 Float_t eairB2[3];
1554 eairB2[0]= esvdB2[0] - 0.3;
1555 eairB2[1]= esvdB2[1];
1556 eairB2[2]= esvdB2[2] - 0.3;
1557
1558 gMC->Gsvolu("EIR4", "BOX", idtmed[698], eairB2, 3);
1559
1560 // Put air strip inside EVV3 & EVV4
1561 gMC->Gspos("EIR4", 1, "EVV3", 0., 0., 0., 0, "ONLY");
1562 gMC->Gspos("EIR4", 1, "EVV4", 0., 0., 0., 0, "ONLY");
1563
1564 //------------ Al Boxes Completed ----------------------/
1565
1566 //--------------Now Create LVDBs----------------------/
1567
1568 // LVDBs are the volumes of G10
1569 // X-dimension = 10.0cm
1570 // Y-dimension = 8.0cm
1571 // Z-dimension = 0.2cm
1572 // Integer assigned to the G10 medium is 607
1573
1574 Float_t elvdb[3];
1575 elvdb[0]= 10.0/2.;
1576 elvdb[1]= 8.0/2.;
1577 elvdb[2]= 0.2/2.;
1578
1579 gMC->Gsvolu("ELVD", "BOX", idtmed[607], elvdb, 3);
1580
1581 // Put the LVDBs inside Al Boxes
1582 Float_t yesvd = dboxFea1[1] - 25.0 - 4.0;
1583
1584 for(Int_t jj =1; jj<=6; jj++){
1585
1586 gMC->Gspos("ELVD", jj, "ESV1", 0., yesvd, 0., 0, "ONLY");
1587 gMC->Gspos("ELVD", jj, "ESV2", 0., yesvd, 0., 0, "ONLY");
1588
1589 yesvd = yesvd - 4.0 - 0.5 - 4.0;
1590
1591 }
1592
1593 yesvd = dboxFea3[1] - 15.0 - 4.0;
1594
1595 for(Int_t jj =1; jj<=6; jj++){
1596
1597 gMC->Gspos("ELVD", jj, "ESV3", 0., yesvd, 0., 0, "ONLY");
1598 gMC->Gspos("ELVD", jj, "ESV4", 0., yesvd, 0., 0, "ONLY");
1599
1600 yesvd = yesvd - 4.0 - 0.5 - 4.0;
1601 }
1602
1603 yesvd = dboxFea1[1] - 25.0 - 4.0;
1604
1605 for(Int_t jj =1; jj<=6; jj++){
1606
1607 gMC->Gspos("ELVD", jj, "EVV1", 0., yesvd, 0., 0, "ONLY");
1608 gMC->Gspos("ELVD", jj, "EVV2", 0., yesvd, 0., 0, "ONLY");
1609
1610 yesvd = yesvd - 4.0 - 0.5 - 4.0;
1611 }
1612
1613 yesvd = dboxFea3[1] - 15.0 - 4.0;
1614
1615 for(Int_t jj =1; jj<=6; jj++){
1616
1617 gMC->Gspos("ELVD", jj, "EVV3", 0., yesvd, 0., 0, "ONLY");
1618 gMC->Gspos("ELVD", jj, "EVV4", 0., yesvd, 0., 0, "ONLY");
1619
1620 yesvd = yesvd - 4.0 - 0.5 - 4.0;
1621 }
1622
1623 //----------------- LVDBs Placement Completed--------------//
1624
1625 // ------------ Now Create Cables ------------------------//
1626
1627 // There are a number of cables
1628 // We have reduced the number of volumes to 4
1629 // And these 4 Volumes of Cables are placed repeatedly
1630 // in the four quadrants (EPM1,2,3,4)
1631 // The placement of Cables are in good approximations
1632 // The material medium for Cables is a mixture of Plastic
1633 // and Copper(Cu). Therefore, in a good approximation a mixture
1634 // is created and Integer assigned to this medium is 631
1635
1636 Float_t cable1[3];
1637 cable1[0] = 2.5/2.;
1638 cable1[1] = dboxFea1[1];
1639 cable1[2] = 2.4/2.;
1640
1641 gMC->Gsvolu("ECB1", "BOX", idtmed[631], cable1, 3);
1642
1643 Float_t cable2[3];
1644 cable2[0] = 2.5/2.;
1645 cable2[1] = dboxFea3[1];
1646 cable2[2] = 2.4/2.;
1647
1648 gMC->Gsvolu("ECB2", "BOX", idtmed[631], cable2, 3);
1649
1650 Float_t cable3[3];
1651 cable3[0] = 2.5/2.;
1652 cable3[1] = dboxFea3[1] - dboxUM2[1];
1653 cable3[2] = 2.4/2.;
1654
1655 gMC->Gsvolu("ECB3", "BOX", idtmed[631], cable3, 3);
1656
1657 Float_t cable4[3];
1658 cable4[0] = 2.5/2.;
1659 cable4[1] = dboxUM2[1];
1660 cable4[2] = 2.4/2.;
1661
1662 gMC->Gsvolu("ECB4", "BOX", idtmed[631], cable4, 3);
1663
1664 // Calculation of the co-ordinates of Cables
f117e3aa 1665
24c5571f 1666 Float_t xcable11pm2, xcable12pm2, xcable2pm1, xcable2pm2, xcable21pm4, xcable22pm4;
1667 Float_t xcable3pm1, xcable3pm3, xcable3pm4, xcable4pm3;
f117e3aa 1668
24c5571f 1669 Float_t ycable2pm1, ycable2pm2;
1670 Float_t ycable3pm1, ycable3pm3, ycable3pm4, ycable4pm3;
1671
1672 Float_t zcablePS, zcableVeto;
1673
1674 xcable2pm1 = esvdA1[0] - 3.0 - cable1[0];
1675 xcable3pm1 = xcable2pm1 - cable1[0] - 0.5 - cable1[0];
1676
1677 xcable11pm2 = -esvdA1[0]+ 3.0 + cable1[0];
1678 xcable12pm2 = xcable11pm2 + cable1[0] + 0.5 + cable1[0];
1679 xcable2pm2 = xcable12pm2 + cable1[0] + 0.5 + cable1[0];
1680
1681 xcable3pm3 = -esvdB1[0] + 3.0 + cable1[0];
1682 xcable4pm3 = xcable3pm3 + cable1[0] + 0.5 + cable1[0];
1683
1684 xcable21pm4 = esvdB1[0] - 3.0 - cable1[0];
1685 xcable22pm4 = xcable21pm4 - cable1[0] -0.5 - cable1[0];
1686 xcable3pm4 = xcable22pm4 - cable1[0] -0.5 -cable1[0];
1687
1688 ycable2pm1 = -(esvdA1[1] - esvdA2[1]);
1689 ycable3pm1 = -esvdA1[1] + cable3[1];
1690
1691 ycable2pm2 = -(esvdA1[1] - esvdA2[1]);
1692
1693 ycable3pm3 = -dboxUM2[1];
1694 ycable4pm3 = -esvdA2[1] + dboxUM2[1];
1695
1696 ycable3pm4 = -dboxUM2[1];
1697
1698 zcablePS = -esvdA1[2] + 0.3 + cable1[2];
1699 zcableVeto = esvdB1[2] - 0.3 - cable1[2];
1700
1701
1702 // Placement of Cables in Al Boxes
1703 gMC->Gspos("ECB2", 1, "ESV1", xcable2pm1, ycable2pm1, zcablePS, 0, "ONLY");
1704 gMC->Gspos("ECB3", 1, "ESV1", xcable3pm1, ycable3pm1, zcablePS, 0, "ONLY");
1705 gMC->Gspos("ECB2", 1, "EVV1", xcable2pm1, ycable2pm1, zcableVeto, 0, "ONLY");
1706 gMC->Gspos("ECB3", 1, "EVV1", xcable3pm1, ycable3pm1, zcableVeto, 0, "ONLY");
1707
1708 gMC->Gspos("ECB1", 1, "ESV2", xcable11pm2, 0., zcablePS, 0, "ONLY");
1709 gMC->Gspos("ECB1", 2, "ESV2", xcable12pm2, 0., zcablePS, 0, "ONLY");
1710 gMC->Gspos("ECB2", 1, "ESV2", xcable2pm2, ycable2pm2, zcablePS, 0, "ONLY");
1711 gMC->Gspos("ECB1", 1, "EVV2", xcable11pm2, 0., zcableVeto, 0, "ONLY");
1712 gMC->Gspos("ECB1", 2, "EVV2", xcable12pm2, 0., zcableVeto, 0, "ONLY");
1713 gMC->Gspos("ECB2", 1, "EVV2", xcable2pm2, ycable2pm2, zcableVeto, 0, "ONLY");
1714
1715 gMC->Gspos("ECB3", 1, "ESV3", xcable3pm3, ycable3pm3, zcablePS, 0, "ONLY");
1716 gMC->Gspos("ECB4", 1, "ESV3", xcable4pm3, ycable4pm3, zcablePS, 0, "ONLY");
1717 gMC->Gspos("ECB3", 1, "EVV3", xcable3pm3, ycable3pm3, zcableVeto, 0, "ONLY");
1718 gMC->Gspos("ECB4", 1, "EVV3", xcable4pm3, ycable4pm3, zcableVeto, 0, "ONLY");
1719
1720 gMC->Gspos("ECB2", 1, "ESV4", xcable21pm4, 0., zcablePS, 0, "ONLY");
1721 gMC->Gspos("ECB2", 2, "ESV4", xcable22pm4, 0., zcablePS, 0, "ONLY");
1722 gMC->Gspos("ECB3", 1, "ESV4", xcable3pm4, ycable3pm4, zcablePS, 0, "ONLY");
1723 gMC->Gspos("ECB2", 1, "EVV4", xcable21pm4, 0., zcableVeto, 0, "ONLY");
1724 gMC->Gspos("ECB2", 2, "EVV4", xcable22pm4, 0., zcableVeto, 0, "ONLY");
1725 gMC->Gspos("ECB3", 1, "EVV4", xcable3pm4, ycable3pm4, zcableVeto, 0, "ONLY");
1726
1727
1728 //=============== NOW POSITIONING THE Al Boxes IN EPM'S================//
1729
1730
1731 gMC->Gspos("ESV1", 1, "EPM1", dboxFea1[0] - esvdA1[0] - 8.0, 0., zelvdbPS, 0, "ONLY");
1732 gMC->Gspos("EVV1", 1, "EPM1", dboxFea1[0] - esvdB1[0] - 8.0, 0., zelvdbVeto, 0, "ONLY");
1733
1734 gMC->Gspos("ESV2", 1, "EPM2", -dboxFea2[0] + esvdA1[0] + 8.0, 2.3, zelvdbPS, 0, "ONLY");
1735 gMC->Gspos("EVV2", 1, "EPM2", -dboxFea2[0] + esvdB1[0] + 8.0, 2.3, zelvdbVeto, 0, "ONLY");
1736
1737 gMC->Gspos("ESV3", 1, "EPM3", -dboxFea3[0] + esvdA1[0] + 8.0, 0., zelvdbPS, 0, "ONLY");
1738 gMC->Gspos("EVV3", 1, "EPM3", -dboxFea3[0] + esvdB1[0] + 8.0, 0., zelvdbVeto, 0, "ONLY");
1739
1740 gMC->Gspos("ESV4", 1, "EPM4", dboxFea4[0] - esvdA1[0] - 8.0, 2.3, zelvdbPS, 0, "ONLY");
1741 gMC->Gspos("EVV4", 1, "EPM4", dboxFea4[0] - esvdB1[0] - 8.0, 2.3, zelvdbVeto, 0, "ONLY");
1742
1743 //==================================================================//
1744 //====================== LAST THING IS TO INSTALL ELMB ================//
1745
1746 // ELMB,s are the G10 Volumes
f117e3aa 1747
24c5571f 1748 // First to create Air Volume to place ELMBs
1749 Float_t xelmb[3];
1750 xelmb[0] = 20.0/2.;
1751 xelmb[1] = 8.0/2.;
1752 xelmb[2] = 1.0/2.;
1753
1754 gMC->Gsvolu("ELMB", "BOX", idtmed[698], xelmb, 3);
1755
1756 // There are more G10 Volumes
1757 // But in approximation, we reduced them to two
1758 // ELM1 & ELM2
1759
1760 Float_t xelmb1[3];
1761 xelmb1[0] = 19.4/2.;
1762 xelmb1[1] = 7.2/2.;
1763 xelmb1[2] = 0.2/2.;
1764
1765 gMC->Gsvolu("ELM1", "BOX", idtmed[607], xelmb1, 3);
1766
1767 Float_t xelmb2[3];
1768 xelmb2[0] = 12.0/2.;
1769 xelmb2[1] = 6.0/2.;
1770 xelmb2[2] = 0.2/2.;
1771
1772 gMC->Gsvolu("ELM2", "BOX", idtmed[607], xelmb2, 3);
1773
1774 /******** NOW POSITIONING THE G10 VOLUMES ELM1 & ELM2 IN ELMB **********/
1775
1776 gMC->Gspos("ELM1", 1, "ELMB", 0., 0., -0.3, 0, "ONLY");
1777 gMC->Gspos("ELM2", 1, "ELMB", 0., 0., 0.3, 0, "ONLY");
1778
1779 // Position co-ordinates of ELMBs in EPM2 & EPM4
1780
1781 Float_t xelmbepm2, xelmbepm4, yelmbepm2, yelmbepm4, zelmbPS, zelmbVeto;
1782
1783 xelmbepm2 = -gaspmd2[0] + 16.0 +23.2 + 2.5 + xelmb[0];
1784 xelmbepm4 = gaspmd4[0] - 16.0 -23.2 - 2.5 - xelmb[0];
1785
1786 yelmbepm2 = -gaspmd2[1] + 1.0 + xelmb[1];
1787 yelmbepm4 = -gaspmd4[1] + 1.0 + xelmb[1];
1788
1789 zelmbPS = zfea + fgkThSteel/2.+ xelmb[2];
1790 zelmbVeto = zfea - fgkThSteel/2.- xelmb[2];
1791
1792 /************ NOW PLACE ELMB'S IN EPM2 & EPM4 *********************/
1793
1794 // There are total of 14 ELMB volumes
1795 // three on both sides of EPM2 (total of 6)
1796 // and four on both sides of EPM4 (total of 8)
1797 // The ELMBs are placed at the bottom of
1798 // SS support, which is the extended part
1799
1800 // Placement of ELMBs on EPM2
1801 for(Int_t kk=1;kk<=3;kk++){
1802 gMC->Gspos("ELMB", kk, "EPM2", xelmbepm2, yelmbepm2, zelmbPS, 0, "ONLY");
1803 xelmbepm2 = xelmbepm2 + xelmb[0] + 0.5 + xelmb[0];
1804 }
1805
1806 xelmbepm2 = -gaspmd2[0] + 16.0 +23.2 + 2.5 + xelmb[0];
1807
1808 for(Int_t kk=4;kk<=6;kk++){
1809 gMC->Gspos("ELMB", kk, "EPM2", xelmbepm2, yelmbepm2, zelmbVeto, 0, "ONLY");
1810 xelmbepm2 = xelmbepm2 + xelmb[0] + 0.5 + xelmb[0];
1811 }
1812
1813 // Placement of ELMBs on EPM4
1814 for(Int_t kk=1;kk<=4;kk++){
1815 gMC->Gspos("ELMB", kk, "EPM4", xelmbepm4, yelmbepm4, zelmbPS, 0, "ONLY");
1816 xelmbepm4 = xelmbepm4 - xelmb[0] - 0.5 - xelmb[0];
1817 }
1818
1819 xelmbepm4 = gaspmd4[0] - 16.0 -23.2 - 2.5 - xelmb[0];
1820 for(Int_t kk=5;kk<=8;kk++){
1821 gMC->Gspos("ELMB", kk, "EPM4", xelmbepm4, yelmbepm4, zelmbVeto, 0, "ONLY");
1822 xelmbepm4 = xelmbepm4 - xelmb[0] - 0.5 - xelmb[0];
1823 }
1824
1825 //========= Placement of ELMBs Completed ============================/
1826
1827 // ------------- Now to Place Unit Modules in four quadrants
1828 // EPM1, EPM2, EPM3 & EPM4 ---------------------//
1829
1830 // Position co-ordinates of Unit Modules
1831
1832 //Double_t xcord[48];
1833 //Double_t ycord[48];
1834
1835 Double_t xcord[24];
1836 Double_t ycord[24];
1837
1838 xcord[0] = xa1;
1839 xcord[1] = xa2;
1840 xcord[2] = xa3;
1841 xcord[3] = xa1;
1842 xcord[4] = xa2;
1843 xcord[5] = xa3;
1844 xcord[6] = -xa1;
1845 xcord[7] = -xa2;
1846 xcord[8] = -xa3;
1847 xcord[9] = -xa1;
1848 xcord[10] = -xa2;
1849 xcord[11] = -xa3;
1850 xcord[12] = xb1;
1851 xcord[13] = xb2;
1852 xcord[14] = xb1;
1853 xcord[15] = xb2;
1854 xcord[16] = xb1;
1855 xcord[17] = xb2;
1856 xcord[18] = -xb1;
1857 xcord[19] = -xb2;
1858 xcord[20] = -xb1;
1859 xcord[21] = -xb2;
1860 xcord[22] = -xb1;
1861 xcord[23] = -xb2;
1862
1863 /*
1864 xcord[24] = xa1;
1865 xcord[25] = xa2;
1866 xcord[26] = xa3;
1867 xcord[27] = xa1;
1868 xcord[28] = xa2;
1869 xcord[29] = xa3;
1870 xcord[30] = -xa1;
1871 xcord[31] = -xa2;
1872 xcord[32] = -xa3;
1873 xcord[33] = -xa1;
1874 xcord[34] = -xa2;
1875 xcord[35] = -xa3;
1876 xcord[36] = xb1;
1877 xcord[37] = xb2;
1878 xcord[38] = xb1;
1879 xcord[39] = xb2;
1880 xcord[40] = xb1;
1881 xcord[41] = xb2;
1882 xcord[42] = -xb1;
1883 xcord[43] = -xb2;
1884 xcord[44] = -xb1;
1885 xcord[45] = -xb2;
1886 xcord[46] = -xb1;
1887 xcord[47] = -xb2;
1888 */
1889
1890 ycord[0] = ya1;
1891 ycord[1] = ya1;
1892 ycord[2] = ya1;
1893 ycord[3] = ya2;
1894 ycord[4] = ya2;
1895 ycord[5] = ya2;
1896 ycord[6] = -ya1;
1897 ycord[7] = -ya1;
1898 ycord[8] = -ya1;
1899 ycord[9] = -ya2;
1900 ycord[10] = -ya2;
1901 ycord[11] = -ya2;
1902 ycord[12] = yb1;
1903 ycord[13] = yb1;
1904 ycord[14] = yb2;
1905 ycord[15] = yb2;
1906 ycord[16] = yb3;
1907 ycord[17] = yb3;
1908 ycord[18] = -yb1;
1909 ycord[19] = -yb1;
1910 ycord[20] = -yb2;
1911 ycord[21] = -yb2;
1912 ycord[22] = -yb3;
1913 ycord[23] = -yb3;
1914
1915 /*
1916 ycord[24] = ya1;
1917 ycord[25] = ya1;
1918 ycord[26] = ya1;
1919 ycord[27] = ya2;
1920 ycord[28] = ya2;
1921 ycord[29] = ya2;
1922 ycord[30] = -ya1;
1923 ycord[31] = -ya1;
1924 ycord[32] = -ya1;
1925 ycord[33] = -ya2;
1926 ycord[34] = -ya2;
1927 ycord[35] = -ya2;
1928 ycord[36] = yb1;
1929 ycord[37] = yb1;
1930 ycord[38] = yb2;
1931 ycord[39] = yb2;
1932 ycord[40] = yb3;
1933 ycord[41] = yb3;
1934 ycord[42] = -yb1;
1935 ycord[43] = -yb1;
1936 ycord[44] = -yb2;
1937 ycord[45] = -yb2;
1938 ycord[46] = -yb3;
1939 ycord[47] = -yb3;
1940 */
1941
1942 // Placement of unit modules EUM1 & EUV1(long type)
1943 // and EUM2 & EUV2(short type)
1944 // in the four quadrants EPM1, EPM2, EPM3 & EPM4
1945
1946 for(Int_t ii=0;ii<=5;ii++){
1947 if(fModStatus[ii]){
1948 gMC->Gspos("EUM1", ii, "EPM1", xcord[ii]+xLead1,ycord[ii]+yLead1, zpsa, 0, "ONLY");
1949 }
1950 }
1951
1952 for(Int_t ii=6;ii<=11;ii++){
1953 if(fModStatus[ii]) {
1954 gMC->Gspos("EUM1", ii, "EPM2", xcord[ii]+xLead2, ycord[ii]+yLead2, zpsa, jhrot12, "ONLY");
1955 }
1956 }
1957
1958 for(Int_t ii=12;ii<=17;ii++){
1959 if(fModStatus[ii]) {
1960 gMC->Gspos("EUM2", ii, "EPM3", xcord[ii]+xLead3, ycord[ii]+yLead3, zpsa, 0, "ONLY");
1961 }
1962 }
1963
1964 for(Int_t ii=18;ii<=23;ii++){
1965 if(fModStatus[ii]) {
1966 gMC->Gspos("EUM2", ii, "EPM4", xcord[ii]+xLead4, ycord[ii]+yLead4, zpsa, jhrot12, "ONLY");
1967 }
1968 }
1969
1970 for(Int_t ii=24;ii<=29;ii++){
1971 if(fModStatus[ii]) {
1972 gMC->Gspos("EUV1", ii, "EPM1", xcord[ii-24]+xLead1, ycord[ii-24]+yLead1, zcva, 0, "ONLY");
1973 }
1974 }
1975
1976 for(Int_t ii=30;ii<=35;ii++){
1977 if(fModStatus[ii]) {
1978 gMC->Gspos("EUV1", ii, "EPM2", xcord[ii-24]+xLead2, ycord[ii-24]+yLead2, zcva, jhrot12, "ONLY");
1979 }
1980 }
1981
1982 for(Int_t ii=36;ii<=41;ii++){
1983 if(fModStatus[ii]) {
1984 gMC->Gspos("EUV2", ii, "EPM3", xcord[ii-24]+xLead3, ycord[ii-24]+yLead3, zcva, 0, "ONLY");
1985 }
1986 }
1987
1988 for(Int_t ii=42;ii<=47;ii++){
1989 if(fModStatus[ii]) {
1990 gMC->Gspos("EUV2", ii, "EPM4", xcord[ii-24]+xLead4, ycord[ii-24]+yLead4, zcva, jhrot12, "ONLY");
1991 }
1992 }
1993
1994 //-------------- Placement of Unit Modules Completed ---------------//
1995
1996 // ========== PLACE THE EPMD IN ALICE ======================//
1997
1998 // Now the Job to assemble the five mother volumes of PMD in ALICE
1999
2000 // Z-distance of PMD from Interaction Point
2001
2002 zp = fgkZdist;
2003
2004 // X and Y-positions of the EPM1, EPM2, EPM3 & EPM4
2005 Float_t xfinal,yfinal;
2006 Float_t xsm1, xsm2, xsm3, xsm4;
2007 Float_t ysm1, ysm2, ysm3, ysm4;
2008
2009 xfinal = (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05) + 0.48/2. +
2010 (fSMLengthbx + serviceX/2. + serviceXext/2.+ 0.05);
2011
2012 //Extra width of the SS plate on Support Structure on X-side and 1mm thick SS for cooling encloser
2013 //Extra width of the SS plate on Support Structure on X-side for B-Type
2014
2015 yfinal = (fSMLengthay + serviceYa/2.)+ 0.20/2 + (fSMLengthby + serviceYb/2.);
2016
2017 //serviceYa is the Extra width of the SS plate on Support Structur on Y-side for EPM1 & EPM3
2018 //serviceYb is the Extra width of the SS plate on Support Structur on Y-side for EPM2 & EPM4
2019
2020
2021 xsm1 = xfinal - (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05);
2022 ysm1 = yfinal - (fSMLengthay + serviceYa/2.) - 2.3;
2023
2024 xsm2 = -xfinal + (fSMLengthax + serviceX/2. + serviceXext/2. + 0.05);
2025 ysm2 = -yfinal + (fSMLengthay + serviceYb/2.) - 2.3;
2026
2027 xsm3 = -xfinal + (fSMLengthbx + serviceX/2. + serviceXext/2. + 0.05);
2028 ysm3 = yfinal - (fSMLengthby + serviceYa/2.) - 2.3;
2029
2030 xsm4 = xfinal - (fSMLengthbx + serviceX/2. + serviceXext/2. + 0.05);
2031 ysm4 = -yfinal + (fSMLengthby + serviceYb/2.) - 2.3;
2032
2033 //Position Full PMD in ALICE
2034 //
2035 // EPM1 EPM3
2036 //
2037 // EPM4 EPM2
2038 // (rotated EPM3) (rotated EPM1)
2039 //
2040 // EFGD
2041 // (Girders and its Carriage)
2042
2043 gMC->Gspos("EPM1", 1, "ALIC", xsm1,ysm1,zp, 0, "ONLY");
2044 gMC->Gspos("EPM2", 1, "ALIC", xsm2,ysm2,zp, 0, "ONLY");
2045 gMC->Gspos("EPM3", 1, "ALIC", xsm3,ysm3,zp, 0, "ONLY");
2046 gMC->Gspos("EPM4", 1, "ALIC", xsm4,ysm4,zp, 0, "ONLY");
2047
2048 gMC->Gspos("EFGD", 1, "ALIC", 0., yfinal + fulgrdr[1], zp, 0, "ONLY");
c4561145 2049}
2050
c4561145 2051//_____________________________________________________________________________
24c5571f 2052
36031625 2053void AliPMDv1::DrawModule() const
c4561145 2054{
c4561145 2055 // Draw a shaded view of the Photon Multiplicity Detector
2056 //
36031625 2057 // cout << " Inside Draw Modules " << endl;
24c5571f 2058
2059 // Set everything unseen
c4561145 2060 gMC->Gsatt("*", "seen", -1);
24c5571f 2061
2062 // Set ALIC mother transparent
2063 gMC->Gsatt("ALIC", "seen", 0);
c4561145 2064 //
2065 // Set the visibility of the components
2066 //
2067 gMC->Gsatt("ECAR","seen",0);
2068 gMC->Gsatt("ECCU","seen",1);
b1952773 2069 gMC->Gsatt("EST1","seen",1);
2070 gMC->Gsatt("EST2","seen",1);
2071 gMC->Gsatt("EUM1","seen",1);
2072 gMC->Gsatt("EUM2","seen",1);
24c5571f 2073
b1952773 2074 gMC->Gsatt("EPMD","seen",1);
24c5571f 2075
c4561145 2076 //
2077 gMC->Gdopt("hide", "on");
2078 gMC->Gdopt("shad", "on");
2079 gMC->Gsatt("*", "fill", 7);
2080 gMC->SetClipBox(".");
2081 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
2082 gMC->DefaultRange();
24c5571f 2083 gMC->Gdraw("ALIC", 40, 30, 0, 22, 20.5, .02, .02);
c4561145 2084 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
24c5571f 2085
c4561145 2086 //gMC->Gdman(17, 5, "MAN");
2087 gMC->Gdopt("hide", "off");
24c5571f 2088
bff3a244 2089 AliDebug(1,"Outside Draw Modules");
c4561145 2090}
2091
2092//_____________________________________________________________________________
24c5571f 2093
c4561145 2094void AliPMDv1::CreateMaterials()
2095{
c4561145 2096 // Create materials for the PMD
2097 //
2098 // ORIGIN : Y. P. VIYOGI
2099 //
36031625 2100 // cout << " Inside create materials " << endl;
24c5571f 2101
2102 Int_t isxfld = gAlice->Field()->Integ();
2103 Float_t sxmgmx = gAlice->Field()->Max();
c4561145 2104
2105 // --- Define the various materials for GEANT ---
24c5571f 2106
c4561145 2107 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
f017d70a 2108
2109 // Argon
24c5571f 2110
f017d70a 2111 Float_t dAr = 0.001782; // --- Ar density in g/cm3 ---
2112 Float_t x0Ar = 19.55 / dAr;
2113 AliMaterial(2, "Argon$", 39.95, 18., dAr, x0Ar, 6.5e4);
24c5571f 2114
f017d70a 2115 // --- CO2 ---
24c5571f 2116
f017d70a 2117 Float_t aCO2[2] = { 12.,16. };
2118 Float_t zCO2[2] = { 6.,8. };
2119 Float_t wCO2[2] = { 1.,2. };
2120 Float_t dCO2 = 0.001977;
2121 AliMixture(3, "CO2 $", aCO2, zCO2, dCO2, -2, wCO2);
24c5571f 2122
c4561145 2123 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
24c5571f 2124
f017d70a 2125 // ArCO2
24c5571f 2126
f017d70a 2127 Float_t aArCO2[3] = {39.948,12.0107,15.9994};
2128 Float_t zArCO2[3] = {18.,6.,8.};
2129 Float_t wArCO2[3] = {0.7,0.08,0.22};
2130 Float_t dArCO2 = dAr * 0.7 + dCO2 * 0.3;
2131 AliMixture(5, "ArCO2$", aArCO2, zArCO2, dArCO2, 3, wArCO2);
24c5571f 2132
c4561145 2133 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
24c5571f 2134
f017d70a 2135 // G10
c4561145 2136
f017d70a 2137 Float_t aG10[4]={1.,12.011,15.9994,28.086};
2138 Float_t zG10[4]={1.,6.,8.,14.};
d49fe99a 2139 Float_t wG10[4]={0.15201,0.10641,0.49444,0.24714};
f017d70a 2140 AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
c4561145 2141
f017d70a 2142 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
24c5571f 2143
f017d70a 2144 // Steel
2145 Float_t aSteel[4] = { 55.847,51.9961,58.6934,28.0855 };
2146 Float_t zSteel[4] = { 26.,24.,28.,14. };
2147 Float_t wSteel[4] = { .715,.18,.1,.005 };
2148 Float_t dSteel = 7.88;
2149 AliMixture(19, "STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel);
24c5571f 2150
2151
2152 // --- CH2 : PLASTIC ---
2153
2154 Float_t aCH2[2] = { 12.,1.};
2155 Float_t zCH2[2] = { 6.,1.};
2156 Float_t wCH2[2] = { 1.,2.};
2157 Float_t dCH2 = 0.95;
2158 AliMixture(31, "CH2 $", aCH2, zCH2, dCH2, -2, wCH2);
2159
2160 // --- CABLES : 80% Plastic and 20% Copper ---
2161
2162 Float_t aCABLE[3] = { 12.,1.,63.5 };
2163 Float_t zCABLE[3] = { 6.,1.,29. };
2164 Float_t wCABLE[3] = { 0.6857, 0.1143, 0.2};
2165 Float_t dCABLE = dCH2*0.8 + 8.96*0.2;
2166 AliMixture(32, "CABLE $", aCABLE, zCABLE, dCABLE, 3, wCABLE);
f017d70a 2167
24c5571f 2168
2169
f017d70a 2170 //Air
24c5571f 2171
f017d70a 2172 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
2173 Float_t zAir[4]={6.,7.,8.,18.};
2174 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
2175 Float_t dAir1 = 1.20479E-10;
2176 Float_t dAir = 1.20479E-3;
2177 AliMixture(98, "Vacum$", aAir, zAir, dAir1, 4, wAir);
2178 AliMixture(99, "Air $", aAir, zAir, dAir , 4, wAir);
24c5571f 2179
c4561145 2180 // Define tracking media
f017d70a 2181 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
2182 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
2183 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .10, .1);
2184 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
2185 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
2186 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
2187 AliMedium(19, "S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
24c5571f 2188 AliMedium(32, "CABLE $", 32, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
f017d70a 2189 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
2190 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
c4561145 2191
7235aed2 2192 AliDebug(1,"Outside create materials");
24c5571f 2193
7235aed2 2194}
2195
2196//_____________________________________________________________________________
24c5571f 2197
7235aed2 2198void AliPMDv1::Init()
2199{
2200 //
2201 // Initialises PMD detector after it has been built
2202 //
24c5571f 2203
7235aed2 2204 //
2205 AliDebug(2,"Inside Init");
2206 AliDebug(2,"PMD simulation package (v1) initialised");
2207 AliDebug(2,"parameters of pmd");
2208 AliDebug(2,Form("%10.2f %10.2f %10.2f %10.2f\n",
2209 fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist));
2210 Int_t *idtmed = fIdtmed->GetArray()-599;
2211 fMedSens=idtmed[605-1];
c4561145 2212 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
2213 gMC->Gstpar(idtmed[600], "LOSS", 3.);
2214 gMC->Gstpar(idtmed[600], "DRAY", 1.);
2215
2216 gMC->Gstpar(idtmed[603], "LOSS", 3.);
2217 gMC->Gstpar(idtmed[603], "DRAY", 1.);
2218
2219 gMC->Gstpar(idtmed[604], "LOSS", 3.);
2220 gMC->Gstpar(idtmed[604], "DRAY", 1.);
2221
2222 gMC->Gstpar(idtmed[605], "LOSS", 3.);
2223 gMC->Gstpar(idtmed[605], "DRAY", 1.);
2224
c4561145 2225 gMC->Gstpar(idtmed[607], "LOSS", 3.);
2226 gMC->Gstpar(idtmed[607], "DRAY", 1.);
2227
2228 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
2229 // --- without affecting the hit patterns ---
2230 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
2231 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
2232 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
2233 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
f017d70a 2234
c4561145 2235 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
2236 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
2237 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
2238 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
f017d70a 2239
c4561145 2240 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
2241 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
2242 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
2243 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
24c5571f 2244
2245 // gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
2246 // gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
2247 // gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
2248 // gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
2249
c4561145 2250 // --- Prevent particles stopping in the gas due to energy cut-off ---
2251 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
2252 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
2253 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
2254 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
2255 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
24c5571f 2256
8d6dc7c8 2257 // Visualization of volumes
2258 gMC->Gsatt("ECAR", "SEEN", 0);
24c5571f 2259 gMC->Gsatt("ECCU", "SEEN", 1);
8d6dc7c8 2260 gMC->Gsatt("ECCU", "COLO", 4);
2261 gMC->Gsatt("EST1", "SEEN", 0);
2262 gMC->Gsatt("EST2", "SEEN", 0);
2263 gMC->Gsatt("EHC1", "SEEN", 0);
2264 gMC->Gsatt("EHC2", "SEEN", 0);
24c5571f 2265 gMC->Gsatt("EDGA", "SEEN", 1);
2266 gMC->Gsatt("EDGB", "SEEN", 1);
2267 gMC->Gsatt("EEGA", "SEEN", 1);
2268 gMC->Gsatt("EEGB", "SEEN", 1);
8d6dc7c8 2269 gMC->Gsatt("EUM1", "SEEN", 0);
2270 gMC->Gsatt("EUV1", "SEEN", 0);
8d6dc7c8 2271 gMC->Gsatt("EUM2", "SEEN", 0);
2272 gMC->Gsatt("EUV2", "SEEN", 0);
24c5571f 2273
2274
8d6dc7c8 2275 gMC->Gsatt("EFEE", "SEEN", 0);
2276 gMC->Gsatt("EFEE", "COLO", 4);
24c5571f 2277 gMC->Gsatt("EFBA", "SEEN", 1);
2278 gMC->Gsatt("EFBA", "COLO", 4);
8d6dc7c8 2279 gMC->Gsatt("EFBB", "SEEN", 0);
24c5571f 2280 gMC->Gsatt("EFBB", "COLO", 4);
2281
2282 gMC->Gsatt("ELDA", "SEEN", 0);
2283 gMC->Gsatt("ELDB", "SEEN", 0);
2284
2285 gMC->Gsatt("EFE1", "SEEN", 0);
2286 gMC->Gsatt("EFE2", "SEEN", 0);
2287 gMC->Gsatt("EFE3", "SEEN", 0);
2288 gMC->Gsatt("EFE4", "SEEN", 0);
2289
2290 gMC->Gsatt("ESC1", "SEEN", 0);
2291 gMC->Gsatt("ECC1", "COLO", 2);
2292 gMC->Gsatt("ESC2", "SEEN", 0);
2293 gMC->Gsatt("ECC2", "COLO", 2);
2294 gMC->Gsatt("ESC3", "SEEN", 0);
2295 gMC->Gsatt("ECC3", "COLO", 2);
2296 gMC->Gsatt("ESC4", "SEEN", 0);
2297 gMC->Gsatt("ECC4", "COLO", 2);
2298
2299 gMC->Gsatt("ECC1", "SEEN", 0);
2300 gMC->Gsatt("ECC2", "SEEN", 0);
2301 gMC->Gsatt("ECC3", "SEEN", 0);
2302 gMC->Gsatt("ECC4", "SEEN", 0);
2303
8d6dc7c8 2304 gMC->Gsatt("EPM1", "SEEN", 1);
2305 gMC->Gsatt("EPM2", "SEEN", 1);
2306 gMC->Gsatt("EPM3", "SEEN", 1);
2307 gMC->Gsatt("EPM4", "SEEN", 1);
24c5571f 2308
2309 gMC->Gsatt("ECB1", "SEEN", 0);
2310 gMC->Gsatt("ECB2", "SEEN", 0);
2311 gMC->Gsatt("ECB3", "SEEN", 0);
2312 gMC->Gsatt("ECB4", "SEEN", 0);
2313
2314 gMC->Gsatt("ELMB", "SEEN", 0);
2315
2316 gMC->Gsatt("ESV1", "SEEN", 0);
2317 gMC->Gsatt("ESV2", "SEEN", 0);
2318 gMC->Gsatt("ESV3", "SEEN", 0);
2319 gMC->Gsatt("ESV4", "SEEN", 0);
2320
2321 gMC->Gsatt("EVV1", "SEEN", 0);
2322 gMC->Gsatt("EVV2", "SEEN", 0);
2323 gMC->Gsatt("EVV3", "SEEN", 0);
2324 gMC->Gsatt("EVV4", "SEEN", 0);
2325
2326 gMC->Gsatt("EFGD", "SEEN", 0);
c4561145 2327}
2328
2329//_____________________________________________________________________________
24c5571f 2330
c4561145 2331void AliPMDv1::StepManager()
2332{
2333 //
2334 // Called at each step in the PMD
2335 //
24c5571f 2336
c4561145 2337 Int_t copy;
2338 Float_t hits[4], destep;
2339 Float_t center[3] = {0,0,0};
24c5571f 2340 Int_t vol[6];
2341 //const char *namep;
2342 // printf("Current vol is ******** %s \n",namep);
f335f3e7 2343 if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
24c5571f 2344
c4561145 2345 gMC->CurrentVolID(copy);
24c5571f 2346 //namep=gMC->CurrentVolName();
2347 // printf("Current vol is %s \n",namep);
c4561145 2348 vol[0]=copy;
24c5571f 2349
b1952773 2350 gMC->CurrentVolOffID(1,copy);
c4561145 2351 //namep=gMC->CurrentVolOffName(1);
f117e3aa 2352 // printf("Current vol 11 is %s \n",namep);
c4561145 2353 vol[1]=copy;
24c5571f 2354
b1952773 2355 gMC->CurrentVolOffID(2,copy);
c4561145 2356 //namep=gMC->CurrentVolOffName(2);
24c5571f 2357 // printf("Current vol 22 is %s \n",namep);
c4561145 2358 vol[2]=copy;
24c5571f 2359
c4561145 2360 gMC->CurrentVolOffID(3,copy);
24c5571f 2361 //namep=gMC->CurrentVolOffName(3);
2362 // printf("Current vol 33 is %s \n",namep);
c4561145 2363 vol[3]=copy;
24c5571f 2364
b1952773 2365 gMC->CurrentVolOffID(4,copy);
24c5571f 2366 //namep=gMC->CurrentVolOffName(4);
f117e3aa 2367 // printf("Current vol 44 is %s \n",namep);
c4561145 2368 vol[4]=copy;
24c5571f 2369
b1952773 2370 gMC->CurrentVolOffID(5,copy);
24c5571f 2371 //namep=gMC->CurrentVolOffName(5);
2372 //printf("Current vol 55 is %s \n",namep);
b1952773 2373 vol[5]=copy;
2374
24c5571f 2375
2376 // printf("volume number %4d %4d %4d %4d %4d %4d %10.3f \n",vol[0],vol[1],vol[2],vol[3],vol[4],vol[5],destep*1000000);// edep in MeV
2377
b1952773 2378
c4561145 2379 gMC->Gdtom(center,hits,1);
2380 hits[3] = destep*1e9; //Number in eV
5d12ce38 2381 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
c4561145 2382 }
2383}
2384
24c5571f 2385
c4561145 2386//------------------------------------------------------------------------
2387// Get parameters
2388
2389void AliPMDv1::GetParameters()
2390{
36031625 2391 // This gives all the parameters of the detector
3cdb4e97 2392 // such as Length of Supermodules, type A, type B,
2393 // thickness of the Supermodule
b1952773 2394 //
36031625 2395
f117e3aa 2396 fSMLengthax = 32.7434;
2397 //The total length in X is due to the following components
2398 // Factor 3 is because of 3 module length in X for this type
2399 // fgkNcolUM1*fgkCellRadius (48 x 0.25): Total span of each module in X
2400 // fgkCellRadius/2. : There is offset of 1/2 cell
2401 // 0.05+0.05 : Insulation gaps etc
2402 // fgkSSBoundary (0.3) : Boundary frame
2403 // double XA = 3.0*((fgkCellRadius/fgkSqroot3by2*fgkNcolUM1)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM1-1)/6.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + (2.0*0.075);
24c5571f 2404
2405 fSMLengthbx = 42.6136;
f117e3aa 2406 //The total length in X is due to the following components
2407 // Factor 2 is because of 2 module length in X for this type
2408 // fgkNcolUM2*fgkCellRadius (96 x 0.25): Total span of each module in X
2409 // fgkCellRadius/2. : There is offset of 1/2 cell
2410 // 0.05+0.05 : Insulation gaps etc
2411 // fgkSSBoundary (0.3) : Boundary frame
24c5571f 2412 //double XB = 2.0*((fgkCellRadius/fgkSqroot3by2*fgkNcolUM2)-(fgkCellRadius*fgkSqroot3*(fgkNcolUM2-1)/6.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + 0.1;
2413
f117e3aa 2414
24c5571f 2415
2416 fSMLengthay = 49.35;
f117e3aa 2417 //The total length in Y is due to the following components
2418 // Factor 2 is because of 2 module length in Y for this type
2419 // fgkCellRadius/fgkSqroot3by2)*fgkNrowUM1 (0.25/sqrt3/2 * 96): Total span of each module in Y
2420 // of strips
2421 // 0.05+0.05 : Insulation gaps etc
2422 // fgkSSBoundary (0.3) : Boundary frame
24c5571f 2423 // 0.6cm is the channel width plus tolerance
2424 // double YA = 2.0*(fgkNrowUM1*fgkCellRadius+fgkCellRadius/2.+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + 0.6/2.;
2425
2426 fSMLengthby = 37.925;
f117e3aa 2427 //The total length in Y is due to the following components
2428 // Factor 3 is because of 3 module length in Y for this type
2429 // fgkCellRadius/fgkSqroot3by2)*fgkNrowUM2 (0.25/sqrt3/2 * 48): Total span of each module in Y
2430 // of strips
2431 // 0.05+0.05 : Insulation gaps etc
2432 // fgkSSBoundary (0.3) : Boundary frame
24c5571f 2433 // 10mm is the channel width plus tolerance
2434 //double YB = 3.0*((fgkNrowUM2*fgkCellRadius + fgkCellRadius/2.)+(2.0*fgkGap)+(2.0*fgkGap)+fgkSSBoundary) + 1.0/2.;
2435
2436
f117e3aa 2437 //Thickness of a pre/veto plane
24c5571f 2438 fDthick = fgkThSS/2. + 1.2; // 1.2 added as FEE Board are now assembled with pre/veto
2439
f117e3aa 2440 //Thickness of the PMD ; 2.4 added for FEE boards
24c5571f 2441 fSMthickpmd = 2.0*(fgkThSS/2.) +fgkThSteel/2.+fgkThLead/2.0 + 2.4/2.;
2442
2443 fSMthick = 17.; //17 cm is the full profile of PMD
2444
36031625 2445
b1952773 2446}
24c5571f 2447
2448
4b6f3b17 2449// ---------------------------------------------------------------
2450void AliPMDv1::AddAlignableVolumes() const
2451{
2452 //
2453 // Create entries for alignable volumes associating the symbolic volume
2454 // name with the corresponding volume path. Needs to be syncronized with
2455 // eventual changes in the geometry.
2456 //
2457 SetSectorAlignable();
24c5571f 2458
4b6f3b17 2459}
2460// ----------------------------------------------------------------
2461void AliPMDv1::SetSectorAlignable() const
2462{
3cf8979e 2463 //
24c5571f 2464
4b6f3b17 2465 TString vpsector = "ALIC_1/EPM";
2466 TString vpappend = "_1";
2467
2468 TString snsector="PMD/Sector";
24c5571f 2469
4b6f3b17 2470 TString volpath, symname;
2471
2472 for(Int_t cnt=1; cnt<=4; cnt++){
24c5571f 2473 //for(Int_t cnt=1; cnt<=4; cnt++){
4b6f3b17 2474 volpath = vpsector;
2475 volpath += cnt;
2476 volpath += vpappend;
2477 symname = snsector;
2478 symname += cnt;
3cf8979e 2479 if(!gGeoManager->SetAlignableEntry(symname.Data(),volpath.Data()))
2480 {
2481 AliFatal("Unable to set alignable entry!");
2482 }
4b6f3b17 2483 }
2484}
2485// ------------------------------------------------------------------
24c5571f 2486void AliPMDv1::SetCpvOff()
2487{
2488 // Set the entire CPV plane off
2489
2490 for (Int_t imodule = 24; imodule < 48; imodule++)
2491 fModStatus[imodule] = 0;
2492}
2493// ------------------------------------------------------------------
2494void AliPMDv1::SetPreOff()
2495{
2496 // Set the entire Preshower plane off
2497
2498 for (Int_t imodule = 0; imodule < 24; imodule++)
2499 fModStatus[imodule] = 0;
2500
2501}
2502// ------------------------------------------------------------------
2503void AliPMDv1::SetModuleOff(Int_t imodule)
2504{
2505 // Set the individual module off
2506
2507 fModStatus[imodule] = 0;
2508
2509}