]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PMD/AliPMDv0.cxx
Coverity fix (an obsolete constructor removed)
[u/mrichter/AliRoot.git] / PMD / AliPMDv0.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 **************************************************************************/
dee197d3 15
88cb7938 16/* $Id$ */
c4561145 17
18//
19///////////////////////////////////////////////////////////////////////////////
20// //
21// Photon Multiplicity Detector Version 1 //
22// //
23//Begin_Html
24/*
25<img src="picts/AliPMDv0Class.gif">
26*/
27//End_Html
28// //
29///////////////////////////////////////////////////////////////////////////////
30////
31
f7a1cc68 32#include <Riostream.h>
dd6416aa 33#include <TGeoManager.h>
f7a1cc68 34#include <TGeoGlobalMagField.h>
88cb7938 35#include <TVirtualMC.h>
f7a1cc68 36
c4561145 37#include "AliConst.h"
38#include "AliMagF.h"
88cb7938 39#include "AliPMDv0.h"
40#include "AliRun.h"
5d12ce38 41#include "AliMC.h"
4951e003 42#include "AliLog.h"
86bd0ac4 43
44const Int_t AliPMDv0::fgkNcellHole = 24; // Hole dimension
45const Float_t AliPMDv0::fgkCellRadius = 0.25; // Radius of a hexagonal cell
46const Float_t AliPMDv0::fgkCellWall = 0.02; // Thickness of cell Wall
47const Float_t AliPMDv0::fgkCellDepth = 0.50; // Gas thickness
48const Float_t AliPMDv0::fgkBoundary = 0.7; // Thickness of Boundary wall
49const Float_t AliPMDv0::fgkThBase = 0.3; // Thickness of Base plate
50const Float_t AliPMDv0::fgkThAir = 0.1; // Thickness of Air
51const Float_t AliPMDv0::fgkThPCB = 0.16; // Thickness of PCB
52const Float_t AliPMDv0::fgkThLead = 1.5; // Thickness of Pb
53const Float_t AliPMDv0::fgkThSteel = 0.5; // Thickness of Steel
54const Float_t AliPMDv0::fgkZdist = 361.5; // z-position of the detector
55const Float_t AliPMDv0::fgkSqroot3 = 1.7320508;// Square Root of 3
56const Float_t AliPMDv0::fgkSqroot3by2 = 0.8660254;// Square Root of 3 by 2
57const Float_t AliPMDv0::fgkPi = 3.14159; // pi
c4561145 58
59ClassImp(AliPMDv0)
60
86bd0ac4 61//_____________________________________________________________________________
a48edddd 62AliPMDv0::AliPMDv0():
63 fSMthick(0.),
64 fSMLength(0.),
65 fMedSens(0),
66 fNcellSM(0)
c4561145 67{
68 //
69 // Default constructor
70 //
c4561145 71}
72
73//_____________________________________________________________________________
a48edddd 74AliPMDv0::AliPMDv0(const char *name, const char *title):
75 AliPMD(name,title),
76 fSMthick(0.),
77 fSMLength(0.),
78 fMedSens(0),
79 fNcellSM(0)
c4561145 80{
81 //
82 // Standard constructor
83 //
c4561145 84}
85
86//_____________________________________________________________________________
87void AliPMDv0::CreateGeometry()
88{
89 //
90 // Create geometry for Photon Multiplicity Detector Version 3 :
91 // April 2, 2001
92 //
93 //Begin_Html
94 /*
95 <img src="picts/AliPMDv0.gif">
96 */
97 //End_Html
98 //Begin_Html
99 /*
100 <img src="picts/AliPMDv0Tree.gif">
101 */
102 //End_Html
103 GetParameters();
104 CreateSupermodule();
105 CreatePMD();
106}
107
108//_____________________________________________________________________________
109void AliPMDv0::CreateSupermodule()
110{
111 //
112 // Creates the geometry of the cells, places them in supermodule which
113 // is a rhombus object.
114
115 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
116 // *** HEXAGONAL CELLS WITH CELL RADIUS 0.25 cm (see "GetParameters")
117 // -- Author : S. Chattopadhyay, 02/04/1999.
118
119 // Basic unit is ECAR, a hexagonal cell made of Ar+CO2, which is placed inside another
120 // hexagonal cell made of Cu (ECCU) with larger radius, compared to ECAR. The difference
121 // in radius gives the dimension of half width of each cell wall.
122 // These cells are placed as 72 x 72 array in a
123 // rhombus shaped supermodule (EHC1). The rhombus shaped modules are designed
124 // to have closed packed structure.
125 //
126 // Each supermodule (ESMA, ESMB), made of G10 is filled with following components
127 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
128 // EHC1 --> Rhombus shaped parallelopiped containing the hexagonal cells
129 // EAIR --> Air gap between gas hexagonal cells and G10 backing.
130 //
131 // ESMA, ESMB are placed in EMM1 along with EMPB (Pb converter)
132 // and EMFE (iron support)
133
134 // EMM1 made of
135 // ESMB --> Normal supermodule, mirror image of ESMA
136 // EMPB --> Pb converter
137 // EMFE --> Fe backing
138 // ESMA --> Normal supermodule
139 //
140 // ESMX, ESMY are placed in EMM2 along with EMPB (Pb converter)
141 // and EMFE (iron support)
142
143 // EMM2 made of
144 // ESMY --> Special supermodule, mirror image of ESMX,
145 // EMPB --> Pb converter
146 // EMFE --> Fe backing
147 // ESMX --> First of the two Special supermodules near the hole
148
149 // EMM3 made of
150 // ESMQ --> Special supermodule, mirror image of ESMX,
151 // EMPB --> Pb converter
152 // EMFE --> Fe backing
153 // ESMP --> Second of the two Special supermodules near the hole
154
155 // EMM2 and EMM3 are used to create the hexagonal HOLE
156
157 //
158 // EPMD
159 // |
160 // |
161 // ---------------------------------------------------------------------------
162 // | | | | |
163 // EHOL EMM1 EMM2 EMM3 EALM
164 // | | |
165 // -------------------- -------------------- --------------------
166 // | | | | | | | | | | | |
167 // ESMB EMPB EMFE ESMA ESMY EMPB EMFE ESMX ESMQ EMPB EMFE ESMP
168 // | | |
169 // ------------ ------------ -------------
170 // | | | | | | | | |
171 // EAIR EHC1 EAIR EAIR EHC2 EAIR EAIR EHC3 EAIR
172 // | | |
173 // ECCU ECCU ECCU
174 // | | |
175 // ECAR ECAR ECAR
176
177
178 Int_t i, j;
179 Float_t xb, yb, zb;
180 Int_t number;
181 Int_t ihrotm,irotdm;
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
c4561145 187 //Subhasis, dimensional parameters of rhombus (dpara) as given to gsvolu
188 // rhombus to accomodate 72 x 72 hexagons, and with total 1.2cm extension
189 //(1mm tolerance on both side and 5mm thick G10 wall)
190 //
c4561145 191 // **** CELL SIZE 20 mm^2 EQUIVALENT
c4561145 192 // Inner hexagon filled with gas (Ar+CO2)
193
194 Float_t hexd2[10] = {0.,360.,6,2,-0.25,0.,0.23,0.25,0.,0.23};
195
86bd0ac4 196 hexd2[4]= -fgkCellDepth/2.;
197 hexd2[7]= fgkCellDepth/2.;
198 hexd2[6]= fgkCellRadius - fgkCellWall;
199 hexd2[9]= fgkCellRadius - fgkCellWall;
c4561145 200
86bd0ac4 201 // Gas replaced by vacuum for v0(insensitive) version of PMD.
c4561145 202
203 gMC->Gsvolu("ECAR", "PGON", idtmed[697], hexd2,10);
dd6416aa 204 gGeoManager->SetVolumeAttribute("ECAR", "SEEN", 0);
86bd0ac4 205
c4561145 206 // Outer hexagon made of Copper
86bd0ac4 207
c4561145 208 Float_t hexd1[10] = {0.,360.,6,2,-0.25,0.,0.25,0.25,0.,0.25};
c4561145 209
86bd0ac4 210 hexd1[4]= -fgkCellDepth/2.;
211 hexd1[7]= fgkCellDepth/2.;
212 hexd1[6]= fgkCellRadius;
213 hexd1[9]= fgkCellRadius;
c4561145 214
215 gMC->Gsvolu("ECCU", "PGON", idtmed[614], hexd1,10);
dd6416aa 216 gGeoManager->SetVolumeAttribute("ECCU", "SEEN", 1);
c4561145 217
218 // --- place inner hex inside outer hex
219
ef61784c 220 gMC->Gspos("ECAR", 1, "ECCU", 0., 0., 0., 0, "ONLY");
c4561145 221
86bd0ac4 222 // Rhombus shaped supermodules (defined by PARA)
223
224 // volume for SUPERMODULE
c4561145 225
86bd0ac4 226 Float_t dparasm1[6] = {12.5,12.5,0.8,30.,0.,0.};
227 dparasm1[0] = (fNcellSM+0.25)*hexd1[6] ;
228 dparasm1[1] = dparasm1[0] *fgkSqroot3by2;
229 dparasm1[2] = fSMthick/2.;
230
231 //
232 gMC->Gsvolu("ESMA","PARA", idtmed[607], dparasm1, 6);
dd6416aa 233 gGeoManager->SetVolumeAttribute("ESMA", "SEEN", 0);
c4561145 234 //
86bd0ac4 235 gMC->Gsvolu("ESMB","PARA", idtmed[607], dparasm1, 6);
dd6416aa 236 gGeoManager->SetVolumeAttribute("ESMB", "SEEN", 0);
86bd0ac4 237
c4561145 238 // Air residing between the PCB and the base
86bd0ac4 239
240 Float_t dparaair[6] = {12.5,12.5,8.,30.,0.,0.};
241 dparaair[0]= dparasm1[0];
242 dparaair[1]= dparasm1[1];
243 dparaair[2]= fgkThAir/2.;
244
245 gMC->Gsvolu("EAIR","PARA", idtmed[698], dparaair, 6);
dd6416aa 246 gGeoManager->SetVolumeAttribute("EAIR", "SEEN", 0);
86bd0ac4 247
c4561145 248 // volume for honeycomb chamber EHC1
86bd0ac4 249
c4561145 250 Float_t dpara1[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 251 dpara1[0] = dparasm1[0];
252 dpara1[1] = dparasm1[1];
253 dpara1[2] = fgkCellDepth/2.;
c4561145 254
255 gMC->Gsvolu("EHC1","PARA", idtmed[698], dpara1, 6);
dd6416aa 256 gGeoManager->SetVolumeAttribute("EHC1", "SEEN", 1);
c4561145 257
c4561145 258 // Place hexagonal cells ECCU cells inside EHC1 (72 X 72)
259
86bd0ac4 260 Int_t xrow = 1;
c4561145 261
86bd0ac4 262 yb = -dpara1[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 263 zb = 0.;
264
86bd0ac4 265 for (j = 1; j <= fNcellSM; ++j) {
c4561145 266 xb =-(dpara1[0] + dpara1[1]*0.577) + 2*hexd1[6]; //0.577=tan(30deg)
267 if(xrow >= 2){
268 xb = xb+(xrow-1)*hexd1[6];
269 }
86bd0ac4 270 for (i = 1; i <= fNcellSM; ++i) {
271 number = i+(j-1)*fNcellSM;
ef61784c 272 gMC->Gspos("ECCU", number, "EHC1", xb,yb,zb, ihrotm, "ONLY");
c4561145 273 xb += (hexd1[6]*2.);
274 }
275 xrow = xrow+1;
86bd0ac4 276 yb += (hexd1[6]*fgkSqroot3);
c4561145 277 }
278
279
280 // Place EHC1 and EAIR into ESMA and ESMB
281
86bd0ac4 282 Float_t zAir1,zAir2,zGas;
c4561145 283
284 //ESMA is normal supermodule with base at bottom, with EHC1
86bd0ac4 285 zAir1= -dparasm1[2] + fgkThBase + dparaair[2];
286 gMC->Gspos("EAIR", 1, "ESMA", 0., 0., zAir1, 0, "ONLY");
287 zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
76ad67b5 288 //Line below Commented for version 0 of PMD routine
86bd0ac4 289 // gMC->Gspos("EHC1", 1, "ESMA", 0., 0., zGas, 0, "ONLY");
290 zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
291 gMC->Gspos("EAIR", 2, "ESMA", 0., 0., zAir2, 0, "ONLY");
c4561145 292
293 // ESMB is mirror image of ESMA, with base at top, with EHC1
294
86bd0ac4 295 zAir1= -dparasm1[2] + fgkThPCB + dparaair[2];
296 gMC->Gspos("EAIR", 3, "ESMB", 0., 0., zAir1, 0, "ONLY");
297 zGas=zAir1+dparaair[2]+ fgkThPCB + dpara1[2];
76ad67b5 298 //Line below Commented for version 0 of PMD routine
86bd0ac4 299 // gMC->Gspos("EHC1", 2, "ESMB", 0., 0., zGas, 0, "ONLY");
300 zAir2=zGas+dpara1[2]+ fgkThPCB + dparaair[2];
301 gMC->Gspos("EAIR", 4, "ESMB", 0., 0., zAir2, 0, "ONLY");
c4561145 302
c4561145 303
86bd0ac4 304 // special supermodule EMM2(GEANT only) containing 6 unit modules
305 // volume for SUPERMODULE
c4561145 306
86bd0ac4 307 Float_t dparasm2[6] = {12.5,12.5,0.8,30.,0.,0.};
308 dparasm2[0]=(fNcellSM+0.25)*hexd1[6] ;
309 dparasm2[1] = (fNcellSM - fgkNcellHole + 0.25) * fgkSqroot3by2 * hexd1[6];
310 dparasm2[2] = fSMthick/2.;
c4561145 311
86bd0ac4 312 gMC->Gsvolu("ESMX","PARA", idtmed[607], dparasm2, 6);
dd6416aa 313 gGeoManager->SetVolumeAttribute("ESMX", "SEEN", 0);
c4561145 314 //
86bd0ac4 315 gMC->Gsvolu("ESMY","PARA", idtmed[607], dparasm2, 6);
dd6416aa 316 gGeoManager->SetVolumeAttribute("ESMY", "SEEN", 0);
c4561145 317
318 Float_t dpara2[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 319 dpara2[0] = dparasm2[0];
320 dpara2[1] = dparasm2[1];
321 dpara2[2] = fgkCellDepth/2.;
c4561145 322
323 gMC->Gsvolu("EHC2","PARA", idtmed[698], dpara2, 6);
dd6416aa 324 gGeoManager->SetVolumeAttribute("EHC2", "SEEN", 1);
c4561145 325
326
327 // Air residing between the PCB and the base
328
86bd0ac4 329 Float_t dpara2Air[6] = {12.5,12.5,8.,30.,0.,0.};
330 dpara2Air[0]= dparasm2[0];
331 dpara2Air[1]= dparasm2[1];
332 dpara2Air[2]= fgkThAir/2.;
c4561145 333
86bd0ac4 334 gMC->Gsvolu("EAIX","PARA", idtmed[698], dpara2Air, 6);
dd6416aa 335 gGeoManager->SetVolumeAttribute("EAIX", "SEEN", 0);
c4561145 336
337 // Place hexagonal single cells ECCU inside EHC2
338 // skip cells which go into the hole in top left corner.
339
340 xrow=1;
86bd0ac4 341 yb = -dpara2[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 342 zb = 0.;
86bd0ac4 343 for (j = 1; j <= (fNcellSM - fgkNcellHole); ++j) {
c4561145 344 xb =-(dpara2[0] + dpara2[1]*0.577) + 2*hexd1[6];
345 if(xrow >= 2){
346 xb = xb+(xrow-1)*hexd1[6];
347 }
86bd0ac4 348 for (i = 1; i <= fNcellSM; ++i) {
349 number = i+(j-1)*fNcellSM;
ef61784c 350 gMC->Gspos("ECCU", number, "EHC2", xb,yb,zb, ihrotm, "ONLY");
c4561145 351 xb += (hexd1[6]*2.);
352 }
353 xrow = xrow+1;
86bd0ac4 354 yb += (hexd1[6]*fgkSqroot3);
c4561145 355 }
356
357
358 // ESMX is normal supermodule with base at bottom, with EHC2
359
86bd0ac4 360 zAir1= -dparasm2[2] + fgkThBase + dpara2Air[2];
361 gMC->Gspos("EAIX", 1, "ESMX", 0., 0., zAir1, 0, "ONLY");
362 zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
76ad67b5 363 //Line below Commented for version 0 of PMD routine
86bd0ac4 364 // gMC->Gspos("EHC2", 1, "ESMX", 0., 0., zGas, 0, "ONLY");
365 zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
366 gMC->Gspos("EAIX", 2, "ESMX", 0., 0., zAir2, 0, "ONLY");
c4561145 367
368 // ESMY is mirror image of ESMX with base at bottom, with EHC2
369
86bd0ac4 370 zAir1= -dparasm2[2] + fgkThPCB + dpara2Air[2];
371 gMC->Gspos("EAIX", 3, "ESMY", 0., 0., zAir1, 0, "ONLY");
372 zGas=zAir1+dpara2Air[2]+ fgkThPCB + dpara2[2];
76ad67b5 373 //Line below Commented for version 0 of PMD routine
86bd0ac4 374 // gMC->Gspos("EHC2", 2, "ESMY", 0., 0., zGas, 0, "ONLY");
375 zAir2=zGas+dpara2[2]+ fgkThPCB + dpara2Air[2];
376 gMC->Gspos("EAIX", 4, "ESMY", 0., 0., zAir2, 0, "ONLY");
c4561145 377
86bd0ac4 378 //
379 // special supermodule EMM3 (GEANT only) containing 2 unit modules
380 // volume for SUPERMODULE
381 //
382 Float_t dparaSM3[6] = {12.5,12.5,0.8,30.,0.,0.};
383 dparaSM3[0]=(fNcellSM - fgkNcellHole +0.25)*hexd1[6] ;
384 dparaSM3[1] = (fgkNcellHole + 0.25) * hexd1[6] * fgkSqroot3by2;
385 dparaSM3[2] = fSMthick/2.;
c4561145 386
86bd0ac4 387 gMC->Gsvolu("ESMP","PARA", idtmed[607], dparaSM3, 6);
dd6416aa 388 gGeoManager->SetVolumeAttribute("ESMP", "SEEN", 0);
c4561145 389 //
86bd0ac4 390 gMC->Gsvolu("ESMQ","PARA", idtmed[607], dparaSM3, 6);
dd6416aa 391 gGeoManager->SetVolumeAttribute("ESMQ", "SEEN", 0);
c4561145 392
393 Float_t dpara3[6] = {12.5,12.5,0.4,30.,0.,0.};
86bd0ac4 394 dpara3[0] = dparaSM3[0];
395 dpara3[1] = dparaSM3[1];
396 dpara3[2] = fgkCellDepth/2.;
c4561145 397
398 gMC->Gsvolu("EHC3","PARA", idtmed[698], dpara3, 6);
dd6416aa 399 gGeoManager->SetVolumeAttribute("EHC3", "SEEN", 1);
c4561145 400
c4561145 401 // Air residing between the PCB and the base
402
86bd0ac4 403 Float_t dpara3Air[6] = {12.5,12.5,8.,30.,0.,0.};
404 dpara3Air[0]= dparaSM3[0];
405 dpara3Air[1]= dparaSM3[1];
406 dpara3Air[2]= fgkThAir/2.;
c4561145 407
86bd0ac4 408 gMC->Gsvolu("EAIP","PARA", idtmed[698], dpara3Air, 6);
dd6416aa 409 gGeoManager->SetVolumeAttribute("EAIP", "SEEN", 0);
c4561145 410
411
412 // Place hexagonal single cells ECCU inside EHC3
413 // skip cells which go into the hole in top left corner.
414
415 xrow=1;
86bd0ac4 416 yb = -dpara3[1] + (1./fgkSqroot3by2)*hexd1[6];
c4561145 417 zb = 0.;
86bd0ac4 418 for (j = 1; j <= fgkNcellHole; ++j) {
c4561145 419 xb =-(dpara3[0] + dpara3[1]*0.577) + 2*hexd1[6];
420 if(xrow >= 2){
421 xb = xb+(xrow-1)*hexd1[6];
422 }
86bd0ac4 423 for (i = 1; i <= (fNcellSM - fgkNcellHole); ++i) {
424 number = i+(j-1)*(fNcellSM - fgkNcellHole);
ef61784c 425 gMC->Gspos("ECCU", number, "EHC3", xb,yb,zb, ihrotm, "ONLY");
c4561145 426 xb += (hexd1[6]*2.);
427 }
428 xrow = xrow+1;
86bd0ac4 429 yb += (hexd1[6]*fgkSqroot3);
c4561145 430 }
431
432 // ESMP is normal supermodule with base at bottom, with EHC3
433
86bd0ac4 434 zAir1= -dparaSM3[2] + fgkThBase + dpara3Air[2];
435 gMC->Gspos("EAIP", 1, "ESMP", 0., 0., zAir1, 0, "ONLY");
436 zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
76ad67b5 437 //Line below Commented for version 0 of PMD routine
86bd0ac4 438 // gMC->Gspos("EHC3", 1, "ESMP", 0., 0., zGas, 0, "ONLY");
439 zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
440 gMC->Gspos("EAIP", 2, "ESMP", 0., 0., zAir2, 0, "ONLY");
441
c4561145 442 // ESMQ is mirror image of ESMP with base at bottom, with EHC3
443
86bd0ac4 444 zAir1= -dparaSM3[2] + fgkThPCB + dpara3Air[2];
445 gMC->Gspos("EAIP", 3, "ESMQ", 0., 0., zAir1, 0, "ONLY");
446 zGas=zAir1+dpara3Air[2]+ fgkThPCB + dpara3[2];
76ad67b5 447 //Line below Commented for version 0 of PMD routine
86bd0ac4 448 // gMC->Gspos("EHC3", 2, "ESMQ", 0., 0., zGas, 0, "ONLY");
449 zAir2=zGas+dpara3[2]+ fgkThPCB + dpara3Air[2];
450 gMC->Gspos("EAIP", 4, "ESMQ", 0., 0., zAir2, 0, "ONLY");
451
c4561145 452}
86bd0ac4 453
c4561145 454//_____________________________________________________________________________
455
456void AliPMDv0::CreatePMD()
457{
458 //
459 // Create final detector from supermodules
460 //
461 // -- Author : Y.P. VIYOGI, 07/05/1996.
462 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
463 // -- Modified: For New Geometry YPV, March 2001.
464
c4561145 465 Float_t xp, yp, zp;
86bd0ac4 466 Int_t i,j;
467 Int_t nummod;
c4561145 468 Int_t jhrot12,jhrot13, irotdm;
c4561145 469 Int_t *idtmed = fIdtmed->GetArray()-599;
470
471 // VOLUMES Names : begining with "E" for all PMD volumes,
472 // The names of SIZE variables begin with S and have more meaningful
473 // characters as shown below.
c4561145 474 // VOLUME SIZE MEDIUM : REMARKS
475 // ------ ----- ------ : ---------------------------
c4561145 476 // EPMD GASPMD AIR : INSIDE PMD and its SIZE
c4561145 477 // *** Define the EPMD Volume and fill with air ***
c4561145 478 // Gaspmd, the dimension of HEXAGONAL mother volume of PMD,
479
480
481 Float_t gaspmd[10] = {0.,360.,6,2,-4.,12.,150.,4.,12.,150.};
482
86bd0ac4 483 gaspmd[5] = fgkNcellHole * fgkCellRadius * 2. * fgkSqroot3by2;
c4561145 484 gaspmd[8] = gaspmd[5];
485
486 gMC->Gsvolu("EPMD", "PGON", idtmed[698], gaspmd, 10);
dd6416aa 487 gGeoManager->SetVolumeAttribute("EPMD", "SEEN", 0);
c4561145 488
489 AliMatrix(irotdm, 90., 0., 90., 90., 180., 0.);
490
491 AliMatrix(jhrot12, 90., 120., 90., 210., 0., 0.);
492 AliMatrix(jhrot13, 90., 240., 90., 330., 0., 0.);
493
494
86bd0ac4 495 Float_t dmthick = 2. * fSMthick + fgkThLead + fgkThSteel;
c4561145 496
86bd0ac4 497 // dparaemm1 array contains parameters of the imaginary volume EMM1,
c4561145 498 // EMM1 is a master module of type 1, which has 24 copies in the PMD.
499 // EMM1 : normal volume as in old cases
500
501
86bd0ac4 502 Float_t dparaemm1[6] = {12.5,12.5,0.8,30.,0.,0.};
503 dparaemm1[0] = fSMLength/2.;
504 dparaemm1[1] = dparaemm1[0] *fgkSqroot3by2;
505 dparaemm1[2] = dmthick/2.;
c4561145 506
86bd0ac4 507 gMC->Gsvolu("EMM1","PARA", idtmed[698], dparaemm1, 6);
dd6416aa 508 gGeoManager->SetVolumeAttribute("EMM1", "SEEN", 1);
c4561145 509
510 //
511 // --- DEFINE Modules, iron, and lead volumes
c4561145 512 // Pb Convertor for EMM1
c4561145 513
86bd0ac4 514 Float_t dparapb1[6] = {12.5,12.5,8.,30.,0.,0.};
515 dparapb1[0] = fSMLength/2.;
516 dparapb1[1] = dparapb1[0] * fgkSqroot3by2;
517 dparapb1[2] = fgkThLead/2.;
518
519 gMC->Gsvolu("EPB1","PARA", idtmed[600], dparapb1, 6);
dd6416aa 520 gGeoManager->SetVolumeAttribute ("EPB1", "SEEN", 0);
c4561145 521
522 // Fe Support for EMM1
86bd0ac4 523 Float_t dparafe1[6] = {12.5,12.5,8.,30.,0.,0.};
524 dparafe1[0] = dparapb1[0];
525 dparafe1[1] = dparapb1[1];
526 dparafe1[2] = fgkThSteel/2.;
c4561145 527
86bd0ac4 528 gMC->Gsvolu("EFE1","PARA", idtmed[618], dparafe1, 6);
dd6416aa 529 gGeoManager->SetVolumeAttribute ("EFE1", "SEEN", 0);
c4561145 530
c4561145 531 //
532 // position supermodule ESMA, ESMB, EPB1, EFE1 inside EMM1
533
86bd0ac4 534 Float_t zps,zpb,zfe,zcv;
c4561145 535
86bd0ac4 536 zps = -dparaemm1[2] + fSMthick/2.;
537 gMC->Gspos("ESMB", 1, "EMM1", 0., 0., zps, 0, "ONLY");
538 zpb = zps+fSMthick/2.+dparapb1[2];
539 gMC->Gspos("EPB1", 1, "EMM1", 0., 0., zpb, 0, "ONLY");
540 zfe = zpb+dparapb1[2]+dparafe1[2];
541 gMC->Gspos("EFE1", 1, "EMM1", 0., 0., zfe, 0, "ONLY");
542 zcv = zfe+dparafe1[2]+fSMthick/2.;
543 gMC->Gspos("ESMA", 1, "EMM1", 0., 0., zcv, 0, "ONLY");
c4561145 544
545 // EMM2 : special master module having full row of cells but the number
546 // of rows limited by hole.
547
86bd0ac4 548 Float_t dparaemm2[6] = {12.5,12.5,0.8,30.,0.,0.};
549 dparaemm2[0] = fSMLength/2.;
550 dparaemm2[1] = (fNcellSM - fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2;
551 dparaemm2[2] = dmthick/2.;
c4561145 552
86bd0ac4 553 gMC->Gsvolu("EMM2","PARA", idtmed[698], dparaemm2, 6);
dd6416aa 554 gGeoManager->SetVolumeAttribute("EMM2", "SEEN", 1);
c4561145 555
c4561145 556 // Pb Convertor for EMM2
86bd0ac4 557 Float_t dparapb2[6] = {12.5,12.5,8.,30.,0.,0.};
558 dparapb2[0] = dparaemm2[0];
559 dparapb2[1] = dparaemm2[1];
560 dparapb2[2] = fgkThLead/2.;
c4561145 561
86bd0ac4 562 gMC->Gsvolu("EPB2","PARA", idtmed[600], dparapb2, 6);
dd6416aa 563 gGeoManager->SetVolumeAttribute ("EPB2", "SEEN", 0);
c4561145 564
565 // Fe Support for EMM2
86bd0ac4 566 Float_t dparafe2[6] = {12.5,12.5,8.,30.,0.,0.};
567 dparafe2[0] = dparapb2[0];
568 dparafe2[1] = dparapb2[1];
569 dparafe2[2] = fgkThSteel/2.;
c4561145 570
86bd0ac4 571 gMC->Gsvolu("EFE2","PARA", idtmed[618], dparafe2, 6);
dd6416aa 572 gGeoManager->SetVolumeAttribute ("EFE2", "SEEN", 0);
c4561145 573
c4561145 574 // position supermodule ESMX, ESMY inside EMM2
575
86bd0ac4 576 zps = -dparaemm2[2] + fSMthick/2.;
577 gMC->Gspos("ESMY", 1, "EMM2", 0., 0., zps, 0, "ONLY");
578 zpb = zps + fSMthick/2.+dparapb2[2];
579 gMC->Gspos("EPB2", 1, "EMM2", 0., 0., zpb, 0, "ONLY");
580 zfe = zpb + dparapb2[2]+dparafe2[2];
581 gMC->Gspos("EFE2", 1, "EMM2", 0., 0., zfe, 0, "ONLY");
582 zcv = zfe + dparafe2[2]+fSMthick/2.;
583 gMC->Gspos("ESMX", 1, "EMM2", 0., 0., zcv, 0, "ONLY");
c4561145 584 //
c4561145 585 // EMM3 : special master module having truncated rows and columns of cells
586 // limited by hole.
587
86bd0ac4 588 Float_t dparaemm3[6] = {12.5,12.5,0.8,30.,0.,0.};
589 dparaemm3[0] = dparaemm2[1]/fgkSqroot3by2;
590 dparaemm3[1] = (fgkNcellHole + 0.25) * fgkCellRadius *fgkSqroot3by2;
591 dparaemm3[2] = dmthick/2.;
c4561145 592
86bd0ac4 593 gMC->Gsvolu("EMM3","PARA", idtmed[698], dparaemm3, 6);
dd6416aa 594 gGeoManager->SetVolumeAttribute("EMM3", "SEEN", 1);
c4561145 595
c4561145 596 // Pb Convertor for EMM3
86bd0ac4 597 Float_t dparapb3[6] = {12.5,12.5,8.,30.,0.,0.};
598 dparapb3[0] = dparaemm3[0];
599 dparapb3[1] = dparaemm3[1];
600 dparapb3[2] = fgkThLead/2.;
c4561145 601
86bd0ac4 602 gMC->Gsvolu("EPB3","PARA", idtmed[600], dparapb3, 6);
dd6416aa 603 gGeoManager->SetVolumeAttribute ("EPB3", "SEEN", 0);
c4561145 604
605 // Fe Support for EMM3
86bd0ac4 606 Float_t dparafe3[6] = {12.5,12.5,8.,30.,0.,0.};
607 dparafe3[0] = dparapb3[0];
608 dparafe3[1] = dparapb3[1];
609 dparafe3[2] = fgkThSteel/2.;
c4561145 610
86bd0ac4 611 gMC->Gsvolu("EFE3","PARA", idtmed[618], dparafe3, 6);
dd6416aa 612 gGeoManager->SetVolumeAttribute ("EFE3", "SEEN", 0);
c4561145 613
c4561145 614 // position supermodule ESMP, ESMQ inside EMM3
615
86bd0ac4 616 zps = -dparaemm3[2] + fSMthick/2.;
617 gMC->Gspos("ESMQ", 1, "EMM3", 0., 0., zps, 0, "ONLY");
618 zpb = zps + fSMthick/2.+dparapb3[2];
619 gMC->Gspos("EPB3", 1, "EMM3", 0., 0., zpb, 0, "ONLY");
620 zfe = zpb + dparapb3[2]+dparafe3[2];
621 gMC->Gspos("EFE3", 1, "EMM3", 0., 0., zfe, 0, "ONLY");
622 zcv = zfe + dparafe3[2] + fSMthick/2.;
623 gMC->Gspos("ESMP", 1, "EMM3", 0., 0., zcv, 0, "ONLY");
c4561145 624 //
625
626 // EHOL is a tube structure made of air
627 //
628 //Float_t d_hole[3];
629 //d_hole[0] = 0.;
86bd0ac4 630 //d_hole[1] = fgkNcellHole * fgkCellRadius *2. * fgkSqroot3by2 + boundary;
631 //d_hole[2] = dmthick/2.;
c4561145 632 //
633 //gMC->Gsvolu("EHOL", "TUBE", idtmed[698], d_hole, 3);
dd6416aa 634 //gGeoManager->SetVolumeAttribute("EHOL", "SEEN", 1);
c4561145 635
636 //Al-rod as boundary of the supermodules
637
86bd0ac4 638 Float_t alRod[3] ;
639 alRod[0] = fSMLength * 3/2. - gaspmd[5]/2 - fgkBoundary ;
640 alRod[1] = fgkBoundary;
641 alRod[2] = dmthick/2.;
c4561145 642
86bd0ac4 643 gMC->Gsvolu("EALM","BOX ", idtmed[698], alRod, 3);
dd6416aa 644 gGeoManager->SetVolumeAttribute ("EALM", "SEEN", 1);
c4561145 645 Float_t xalm[3];
86bd0ac4 646 xalm[0]=alRod[0] + gaspmd[5] + 3.0*fgkBoundary;
c4561145 647 xalm[1]=-xalm[0]/2.;
648 xalm[2]=xalm[1];
649
650 Float_t yalm[3];
651 yalm[0]=0.;
86bd0ac4 652 yalm[1]=xalm[0]*fgkSqroot3by2;
c4561145 653 yalm[2]=-yalm[1];
654
655 // delx = full side of the supermodule
86bd0ac4 656 Float_t delx=fSMLength * 3.;
657 Float_t x1= delx*fgkSqroot3by2 /2.;
c4561145 658 Float_t x4=delx/4.;
659
c4561145 660 // placing master modules and Al-rod in PMD
661
86bd0ac4 662 Float_t dx = fSMLength;
663 Float_t dy = dx * fgkSqroot3by2;
c4561145 664 Float_t xsup[9] = {-dx/2., dx/2., 3.*dx/2.,
665 -dx, 0., dx,
666 -3.*dx/2., -dx/2., dx/2.};
667
668 Float_t ysup[9] = {dy, dy, dy,
669 0., 0., 0.,
670 -dy, -dy, -dy};
671
672 // xpos and ypos are the x & y coordinates of the centres of EMM1 volumes
673
86bd0ac4 674 Float_t xoff = fgkBoundary * TMath::Tan(fgkPi/6.);
675 Float_t xmod[3]={x4 + xoff , x4 + xoff, -2.*x4-fgkBoundary/fgkSqroot3by2};
676 Float_t ymod[3] = {-x1 - fgkBoundary, x1 + fgkBoundary, 0.};
c4561145 677 Float_t xpos[9], ypos[9], x2, y2, x3, y3;
678
86bd0ac4 679 Float_t xemm2 = fSMLength/2. -
680 (fNcellSM + fgkNcellHole + 0.25) * fgkCellRadius * 0.5
c4561145 681 + xoff;
86bd0ac4 682 Float_t yemm2 = -(fNcellSM + fgkNcellHole + 0.25)*fgkCellRadius*fgkSqroot3by2
683 - fgkBoundary;
c4561145 684
86bd0ac4 685 Float_t xemm3 = (fNcellSM + 0.5 * fgkNcellHole + 0.25) * fgkCellRadius +
686 xoff;
687 Float_t yemm3 = - (fgkNcellHole - 0.25) * fgkCellRadius * fgkSqroot3by2 -
688 fgkBoundary;
c4561145 689
86bd0ac4 690 Float_t theta[3] = {0., 2.*fgkPi/3., 4.*fgkPi/3.};
c4561145 691 Int_t irotate[3] = {0, jhrot12, jhrot13};
86bd0ac4 692
693 nummod=0;
ef61784c 694 for (j=0; j<3; ++j) {
695 gMC->Gspos("EALM", j+1, "EPMD", xalm[j],yalm[j], 0., irotate[j], "ONLY");
696 x2=xemm2*TMath::Cos(theta[j]) - yemm2*TMath::Sin(theta[j]);
697 y2=xemm2*TMath::Sin(theta[j]) + yemm2*TMath::Cos(theta[j]);
c4561145 698
ef61784c 699 gMC->Gspos("EMM2", j+1, "EPMD", x2,y2, 0., irotate[j], "ONLY");
c4561145 700
ef61784c 701 x3=xemm3*TMath::Cos(theta[j]) - yemm3*TMath::Sin(theta[j]);
702 y3=xemm3*TMath::Sin(theta[j]) + yemm3*TMath::Cos(theta[j]);
c4561145 703
ef61784c 704 gMC->Gspos("EMM3", j+4, "EPMD", x3,y3, 0., irotate[j], "ONLY");
c4561145 705
ef61784c 706 for (i=1; i<9; ++i) {
86bd0ac4 707 xpos[i]=xmod[j] + xsup[i]*TMath::Cos(theta[j]) -
708 ysup[i]*TMath::Sin(theta[j]);
709 ypos[i]=ymod[j] + xsup[i]*TMath::Sin(theta[j]) +
710 ysup[i]*TMath::Cos(theta[j]);
4951e003 711
712 AliDebugClass(1,Form("xpos: %f, ypos: %f", xpos[i], ypos[i]));
86bd0ac4 713
714 nummod = nummod+1;
715
4951e003 716 AliDebugClass(1,Form("nummod %d",nummod));
86bd0ac4 717
718 gMC->Gspos("EMM1", nummod + 6, "EPMD", xpos[i],ypos[i], 0., irotate[j], "ONLY");
719
720 }
ef61784c 721 }
86bd0ac4 722
723
c4561145 724 // place EHOL in the centre of EPMD
725 // gMC->Gspos("EHOL", 1, "EPMD", 0.,0.,0., 0, "ONLY");
86bd0ac4 726
c4561145 727 // --- Place the EPMD in ALICE
728 xp = 0.;
729 yp = 0.;
86bd0ac4 730 zp = fgkZdist;
c4561145 731
732 gMC->Gspos("EPMD", 1, "ALIC", xp,yp,zp, 0, "ONLY");
733
734}
735
736
c4561145 737//_____________________________________________________________________________
738void AliPMDv0::CreateMaterials()
739{
740 //
741 // Create materials for the PMD
742 //
743 // ORIGIN : Y. P. VIYOGI
744 //
745
f017d70a 746 // cout << " Inside create materials " << endl;
908ce7f5 747
f7a1cc68 748 Int_t isxfld = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Integ();
749 Float_t sxmgmx = ((AliMagF*)TGeoGlobalMagField::Instance()->GetField())->Max();
c4561145 750
751 // --- Define the various materials for GEANT ---
f017d70a 752
c4561145 753 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
f017d70a 754
755 // Argon
756
757 Float_t dAr = 0.001782; // --- Ar density in g/cm3 ---
758 Float_t x0Ar = 19.55 / dAr;
759 AliMaterial(2, "Argon$", 39.95, 18., dAr, x0Ar, 6.5e4);
760
761 // --- CO2 ---
762
763 Float_t aCO2[2] = { 12.,16. };
764 Float_t zCO2[2] = { 6.,8. };
765 Float_t wCO2[2] = { 1.,2. };
766 Float_t dCO2 = 0.001977;
767 AliMixture(3, "CO2 $", aCO2, zCO2, dCO2, -2, wCO2);
768
c4561145 769 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
f017d70a 770
771 // ArCO2
772
773 Float_t aArCO2[3] = {39.948,12.0107,15.9994};
774 Float_t zArCO2[3] = {18.,6.,8.};
775 Float_t wArCO2[3] = {0.7,0.08,0.22};
776 Float_t dArCO2 = dAr * 0.7 + dCO2 * 0.3;
777 AliMixture(5, "ArCO2$", aArCO2, zArCO2, dArCO2, 3, wArCO2);
778
c4561145 779 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
f017d70a 780
781 // G10
c4561145 782
f017d70a 783 Float_t aG10[4]={1.,12.011,15.9994,28.086};
784 Float_t zG10[4]={1.,6.,8.,14.};
d49fe99a 785 //PH Float_t wG10[4]={0.148648649,0.104054054,0.483499056,0.241666667};
786 Float_t wG10[4]={0.15201,0.10641,0.49444,0.24714};
f017d70a 787 AliMixture(8,"G10",aG10,zG10,1.7,4,wG10);
c4561145 788
f017d70a 789 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
790
791 // Steel
792 Float_t aSteel[4] = { 55.847,51.9961,58.6934,28.0855 };
793 Float_t zSteel[4] = { 26.,24.,28.,14. };
794 Float_t wSteel[4] = { .715,.18,.1,.005 };
795 Float_t dSteel = 7.88;
796 AliMixture(19, "STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel);
797
798 //Air
799
800 Float_t aAir[4]={12.0107,14.0067,15.9994,39.948};
801 Float_t zAir[4]={6.,7.,8.,18.};
802 Float_t wAir[4]={0.000124,0.755267,0.231781,0.012827};
803 Float_t dAir1 = 1.20479E-10;
804 Float_t dAir = 1.20479E-3;
805 AliMixture(98, "Vacum$", aAir, zAir, dAir1, 4, wAir);
806 AliMixture(99, "Air $", aAir, zAir, dAir , 4, wAir);
807
c4561145 808 // Define tracking media
f017d70a 809 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
810 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
811 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .10, .1);
812 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
813 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
814 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
815 AliMedium(19, "S steel$", 19, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
816 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .10, 10);
817 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .10, .1);
818
7235aed2 819}
820
821//_____________________________________________________________________________
822void AliPMDv0::Init()
823{
824 //
825 // Initialises PMD detector after it has been built
826 //
827 Int_t i;
828 // kdet=1;
829 //
830 if(AliLog::GetGlobalDebugLevel()>0) {
831 printf("\n%s: ",ClassName());
832 for(i=0;i<35;i++) printf("*");
833 printf(" PMD_INIT ");
834 for(i=0;i<35;i++) printf("*");
835 printf("\n%s: ",ClassName());
836 printf(" PMD simulation package (v0) initialised\n");
837 printf("%s: parameters of pmd\n", ClassName());
838 printf("%s: %10.2f %10.2f %10.2f \
839 %10.2f\n",ClassName(),fgkCellRadius,fgkCellWall,fgkCellDepth,fgkZdist );
840 printf("%s: ",ClassName());
841 for(i=0;i<80;i++) printf("*");
842 printf("\n");
843 }
844 Int_t *idtmed = fIdtmed->GetArray()-599;
845 fMedSens=idtmed[605-1];
c4561145 846 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
5b9c7140 847 // removed all Gstpar and energy cut-offs moved to galice.cuts
c4561145 848}
849
c4561145 850//_____________________________________________________________________________
851void AliPMDv0::StepManager()
852{
853 //
854 // Called at each step in the PMD
855 //
856 Int_t copy;
db06ef51 857 Float_t hits[5], destep;
c4561145 858 Float_t center[3] = {0,0,0};
db06ef51 859 Int_t vol[6];
c4561145 860 //char *namep;
861
fa914fe6 862 if(gMC->CurrentMedium() == fMedSens && (destep = gMC->Edep())) {
c4561145 863
864 gMC->CurrentVolID(copy);
db06ef51 865 vol[0] = copy;
c4561145 866 gMC->CurrentVolOffID(1,copy);
db06ef51 867 vol[1] = copy;
c4561145 868 gMC->CurrentVolOffID(2,copy);
db06ef51 869 vol[2] = copy;
c4561145 870 gMC->CurrentVolOffID(3,copy);
db06ef51 871 vol[3] = copy;
c4561145 872 gMC->CurrentVolOffID(4,copy);
db06ef51 873 vol[4] = copy;
874 gMC->CurrentVolOffID(5,copy);
875 vol[5] = copy;
c4561145 876
877 gMC->Gdtom(center,hits,1);
878 hits[3] = destep*1e9; //Number in eV
db06ef51 879
880 // this is for pile-up events
881 hits[4] = gMC->TrackTime();
882
5d12ce38 883 AddHit(gAlice->GetMCApp()->GetCurrentTrackNumber(), vol, hits);
c4561145 884 }
885}
886
887
888//------------------------------------------------------------------------
889// Get parameters
890
891void AliPMDv0::GetParameters()
892{
86bd0ac4 893 // This gives all the parameters of the detector
894 // such as Length of Supermodules
895 // thickness of the Supermodule
896 //
897 Int_t ncellum, numum;
898 ncellum = 24;
899 numum = 3;
900 fNcellSM = ncellum * numum; //no. of cells in a row in one supermodule
901 fSMLength = (fNcellSM + 0.25 )*fgkCellRadius*2.;
902 fSMthick = fgkThBase + fgkThAir + fgkThPCB + fgkCellDepth +
903 fgkThPCB + fgkThAir + fgkThPCB;
c4561145 904}