1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 Revision 1.6 1999/09/29 09:24:28 fca
19 Introduction of the Copyright and cvs Log
23 ///////////////////////////////////////////////////////////////////////////////
25 // Photon Multiplicity Detector Version 1 //
29 <img src="picts/AliPMDv0Class.gif">
33 ///////////////////////////////////////////////////////////////////////////////
39 static Float_t smod2[3], smod3[3], smod4[3];
40 static Int_t maxbox, kdet;
41 static Float_t thgas,thmin,thmax,zdist,zdist1,thlow,
44 static Float_t xbox[40][40], ybox[40][40];
45 static Int_t pindex[40][40];
48 //_____________________________________________________________________________
49 AliPMDv0::AliPMDv0() : AliPMD()
52 // Default constructor
57 //_____________________________________________________________________________
58 AliPMDv0::AliPMDv0(const char *name, const char *title)
62 // Standard constructor
67 //_____________________________________________________________________________
68 void AliPMDv0::Coordnew()
71 // Find coordinates for pad geometry
73 // Author Y.P. Viyogi, VECC Calcutta
76 Float_t th1, th2, dbox, dist;
77 //Float_t xoff[40][40], yoff[40][40];
80 Int_t xoff1[3], yoff1[3], l;
81 Float_t rhigh, dmax, hole;
85 th1 = thmin * kPI / 180;
86 th2 = thmax * kPI / 180;
87 /* ESTIMATES FOR OCTAGON */
88 dist = zdist * TMath::Tan(th2);
89 /* *** 04.06.97 Fixed Module size of 6 cm, 0 mm boundary. */
90 /* *** variable pad sizes of 0.3 mm, 0.5 mm, 1.0 mm and 1.2 mm */
92 maxbox = Int_t(dist / dbox + .5);
94 /* NOW GET THE HOLE SIZE ETC. */
95 hole = zdist * TMath::Tan(th1);
96 nhol = Int_t(hole / dbox + .5);
99 rlow = zdist * TMath::Tan(thlow * kPI / 180);
100 rhigh = zdist * TMath::Tan(thhigh * kPI / 180);
101 for (i = 1; i <= 40; ++i) {
102 for (j = 1; j <= 40; ++j) {
112 // NOW START PLACING THE BOXES IN VARIOUS LAYERS, START FROM THE CENTRE
115 for(i=0;i<3;i++) yoff1[i]=0;
117 // PRINT*,'MAXBOX=',MAXBOX
118 for (i = 1; i <= maxbox; ++i) {
120 for(j=0;j<3;j++) xoff1[j]=0;
121 for (j = 1; j <= maxbox; ++j) {
122 rr = sqrt(xx*xx+yy*yy);
123 if (rr >= hole && rr <= dmax) {
126 //if (rr < rlow) index[j][i] = 1;
127 //else if (rr > rhigh) index[j][i] = 3;
131 //xoff[j][i] = xoff1[index[j][i] - 1];
132 //yoff[j][i] = yoff1[index[j][i] - 1];
134 if (kdet == 1) kk = 1; else kk = 0;
135 for (l = 1; l <= 3; ++l)
136 xoff1[l - 1] += fNumPads[l + kk - 1];
140 if (kdet == 1) kk = 1; else kk=0;
142 for (l = 1; l <= 3; ++l)
143 yoff1[l - 1] += fNumPads[l + kk - 1];
148 //_____________________________________________________________________________
149 void AliPMDv0::Coordinates()
152 // SUBROUTINE TO COMPUTE THE X- AND Y- COORDINATES OF THE BOXES
153 // WHICH CAN FIT INTO THE CIRCULAR REGION BETWEEN THE GIVEN ANGLES.
154 // INPUT : ZDIST, THMIN, THMAX, PADSIZE (FOR INSIDE and OUTSIDE PMD).
155 // ALL DIMENSIONS IN CM.
156 // -- Author : Y.P. VIYOGI, 10/05/1996.
158 Float_t hole, dmax, dbox;
164 Float_t rhigh, rr, xx, yy, th1, th2;
168 // ESTIMATES FOR OCTAGON
169 dist = zdist * TMath::Tan(th2);
170 // *** 04.06.97 Fixed Module size of 24 cm, 3 mm boundary.
171 // *** variable pad sizes of 8 mm, 10 mm, 12mm and 15 mm
173 maxbox = Int_t(dist / dbox + .5);
175 // NOW GET THE HOLE SIZE ETC.
176 hole = zdist * TMath::Tan(th1);
177 nhol = Int_t(hole / dbox + .5);
180 rlow = zdist * TMath::Tan(thlow*kPI/180);
181 rhigh = zdist * TMath::Tan(thhigh*kPI/180);
182 for (i = 0; i < 40; ++i) {
183 for (j = 0; j < 40; ++j) {
190 // NOW START PLACING THE BOXES IN VARIOUS LAYERS, START FROM THE CENTRE
193 for (i = 0; i < maxbox; ++i) {
195 for (j = 0; j < maxbox; ++j) {
196 rr = TMath::Sqrt(xx*xx + yy*yy);
197 if (rr >= hole && rr <= dmax) { // BOX CAN BE FITTED
199 if (rr < rlow) pindex[j][i] = 1;
200 if (rr > rhigh) pindex[j][i] = 3;
211 //_____________________________________________________________________________
212 void AliPMDv0::CreateGeometry()
215 // Create geometry for Photon Multiplicity Detector Version 1
219 <img src="picts/AliPMDv0.gif">
224 <img src="picts/AliPMDv0Tree.gif">
231 //_____________________________________________________________________________
232 void AliPMDv0::CreateInside()
235 // Create inside of Pads
237 // -- Author : Y.P. VIYOGI, 07/05/1996.
238 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
240 Float_t sipmd[3] = { 300.,300.,5. };
244 Float_t xiqa[4], yiqa[4];
245 Int_t inum2, inum3, inum4, i, j, k;
247 Float_t zd, xd, yd, xp, yp, zp;
250 Int_t *idtmed = fIdtmed->GetArray()-599;
252 // VOLUMES Names : begining with D for all PMD volumes,
253 // The names of SIZE variables begin with S and have more meaningful
254 // characters as shown below.
256 // VOLUME SIZE MEDIUM : REMARKS
257 // ------ ----- ------ : ---------------------------
259 // DPMD SIPMD AIR : INSIDE PMD and its SIZE
263 // *** Define the DPMD Volume and fill with air ***
265 gMC->Gsvolu("DPMD", "BOX ", idtmed[698], sipmd, 3);
267 // *** Define DIQU Volume and fill with air
268 siqad[0] = sipmd[0] / 2. - 1.;
269 siqad[1] = sipmd[1] / 2. - 1.;
271 gMC->Gsvolu("DIQU","BOX ", idtmed[698], siqad, 3);
272 gMC->Gsatt("DIQU", "SEEN", 1);
275 // --- Place the modules in INSIDE PMD (DPMD)
276 // --- FIRST CALCULATE THE COORDINATES OF THE MODULES WHICH CAN BE
284 AliMatrix(idrotm[1], 90., 0., 90., 90., 0., 0.);
285 AliMatrix(idrotm[2], 90., 180., 90., 90., 0., 0.);
286 AliMatrix(idrotm[3], 90., 180., 90., 270., 0., 0.);
287 AliMatrix(idrotm[4], 90., 0., 90., 270., 0., 0.);
288 // **** Filling the DIQU Vol. (One Quadrant)
292 for (i = 0; i < maxbox; ++i) {
294 for (j = 0; j < i2; ++j) {
295 if (xbox[j][i] <= 0 && ybox[j][i] <= 0) continue;
296 xd = xbox[j][i] - siqad[0];
297 yd = ybox[j][i] - siqad[1];
298 if (pindex[j][i] == 1) {
300 gMC->Gsposp("DM11", inum2, "DIQU", xd, yd, zd, 0, "ONLY", smod2, 3);
302 if (pindex[j][i] == 2) {
304 gMC->Gsposp("DM12", inum3, "DIQU", xd, yd, zd, 0, "ONLY", smod3, 3);
306 if (pindex[j][i] == 3) {
308 gMC->Gsposp("DM13", inum4, "DIQU", xd, yd, zd, 0, "ONLY", smod4, 3);
321 for (k = 1; k <= i2; ++k) {
322 gMC->Gsposp("DIQU", k, "DPMD", xiqa[k-1], yiqa[k-1], zd, idrotm[k], "ONLY", siqad, 3);
325 // --- Place the DPMD in ALICE with front edge 6.0m from vertex ---
329 gMC->Gspos("DPMD", 1, "ALIC", xp, yp, zp, 0, "ONLY");
333 //_____________________________________________________________________________
334 void AliPMDv0::CreatePads()
337 // Create the geometry of the pads
338 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
339 // *** DIFFERENT PADS WITH SIZES 8 MM, 10 MM, 12 MM AND 15 MM SQUARE
340 // -- Author : Y.P. VIYOGI, 04/06/1997.
341 // -- Modified: P.V.K.S.Baba(JU), 13-12-97.
344 Float_t /* scpv1[3], */ scpv2[3] /*, scpv3[3], scpv4[3] */;
345 Float_t spsw1[3], spsw2[3];//, spsw3[3], spsw4[3];
346 Float_t sw[3], xc, yc, zc;
348 Float_t spb[3], pad1, pad2, pad3, pad4;
349 // VOLUMES Names : begining with D for all PMD volumes,
351 // DM11 : MODULE TYPE
353 // The names of SIZE variables begin with S and have more meaningful
354 // characters as shown below.
356 // VOLUME SIZE MEDIUM : REMARKS
357 // ------ ----- ------ : ---------------------------
359 // DPPB SPB PB : PB Converter and its SIZE
360 // DPFE SFE FE : FE Support Plate and its SIZE
362 // DW11 SPSW3 G10 : PRESHOWER
363 // DV11 SCPV3 G10 : CPV
364 // ****************** VOLUME TREE ******************
369 // -------------------------------------------------
372 // DV11( CPV) DPFE DPPB DW11(Preshower)
373 // ************************************************************
377 Int_t *idtmed = fIdtmed->GetArray()-599;
383 zdist = TMath::Abs(zdist1);
387 numqu = Int_t(fGeo[2]);
393 npad2 = Int_t(24/fPadSize[1]);
395 spsw2[0] = (npad2 * pad2)/2 + edge;
397 spsw2[2] = (thgas + .4) / 2;
401 // The modules (DW11 and DV11 are filed with gas, G10 plate is ignored)
402 gMC->Gsvolu("DW11","BOX ", idtmed[604], spsw2, 3);
403 gMC->Gsatt("DW11", "SEEN", 1);
404 gMC->Gsvolu("DV11","BOX ", idtmed[604], spsw2, 3);
405 gMC->Gsatt("DV11", "SEEN", 1);
407 // --- DEFINE MODULES, IRON, TUNGSTEN AND LEAD VOLUMES
409 // This mod by fca, waiting for Yogendra Viyogi answer
419 gMC->Gsvolu("DPPB","BOX ", idtmed[600], spb, 3);
420 gMC->Gsatt("DPPB", "SEEN", 1);
425 gMC->Gsvolu("DPW ","BOX ", idtmed[600], sw, 3);
426 gMC->Gsatt("DPW ", "SEEN", 1);
431 gMC->Gsvolu("DPFE","BOX ", idtmed[605], sfe, 3);
432 gMC->Gsatt("DPFE", "SEEN", 1);
436 smod2[2] = spsw2[2] + sfe[2] + spb[2] + scpv2[2];
437 gMC->Gsvolu("DM11", "BOX ", idtmed[698], smod2, 3);
439 // --- place gas box (as CPV), iron support, lead converter and gas box
440 // --- (preshower) in the module
443 // --- First the CPV box
444 zc = -(spsw2[2] + sfe[2] + spb[2] + spsw2[2]) + spsw2[2];
445 gMC->Gspos("DV11", 1, "DM11", xc, yc, zc, 0, "ONLY");
446 // --- Then iron support plate
447 zc = zc + sfe[2] + spsw2[2];
448 gMC->Gspos("DPFE", 1, "DM11", xc, yc, zc, 0, "ONLY");
449 // --- Then lead converter plate
450 zc = zc + sfe[2] + spb[2];
451 gMC->Gspos("DPPB", 1, "DM11", xc, yc, zc, 0, "ONLY");
452 // --- Lastly the preshower box
453 zc = zc + spb[2] + spsw2[2];
454 gMC->Gspos("DW11", 1, "DM11", xc, yc, zc, 0, "ONLY");
458 //_____________________________________________________________________________
459 void AliPMDv0::DrawModule()
462 // Draw a shaded view of the Photon Multiplicity Detector
465 gMC->Gsatt("*", "seen", -1);
466 gMC->Gsatt("alic", "seen", 0);
468 // Set the visibility of the components
470 gMC->Gsatt("DW11","seen",0);
471 gMC->Gsatt("DV11","seen",0);
472 gMC->Gsatt("DPPB","seen",1);
473 gMC->Gsatt("DPW ","seen",1);
474 gMC->Gsatt("DPFE","seen",1);
475 gMC->Gsatt("DM11","seen",1);
476 gMC->Gsatt("DPMD","seen",0);
477 gMC->Gsatt("DIQU","seen",0);
479 gMC->Gdopt("hide", "on");
480 gMC->Gdopt("shad", "on");
481 gMC->Gsatt("*", "fill", 7);
482 gMC->SetClipBox(".");
483 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
485 gMC->Gdraw("alic", 40, 30, 0, 22, 15.5, .04, .04);
486 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
487 gMC->Gdman(17, 5, "MAN");
488 gMC->Gdopt("hide", "off");
491 //_____________________________________________________________________________
492 void AliPMDv0::CreateMaterials()
495 // Create materials for the PMD version 1
497 // ORIGIN : Y. P. VIYOGI
500 // --- The Argon- CO2 mixture ---
501 Float_t ag[2] = { 39.95 };
502 Float_t zg[2] = { 18. };
503 Float_t wg[2] = { .8,.2 };
504 Float_t dar = .001782; // --- Ar density in g/cm3 ---
506 Float_t ac[2] = { 12.,16. };
507 Float_t zc[2] = { 6.,8. };
508 Float_t wc[2] = { 1.,2. };
509 Float_t dc = .001977;
510 Float_t dco = .002; // --- CO2 density in g/cm3 ---
512 Float_t absl, radl, a, d, z;
518 Int_t *idtmed = fIdtmed->GetArray()-599;
519 Int_t isxfld = gAlice->Field()->Integ();
520 Float_t sxmgmx = gAlice->Field()->Max();
522 // --- Define the various materials for GEANT ---
523 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
525 AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4);
526 AliMixture(3, "CO2 $", ac, zc, dc, -2, wc);
527 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
528 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
529 AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3);
530 AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999);
531 AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.);
532 AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7);
533 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
534 AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9);
536 AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.);
537 AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.);
538 AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16);
539 AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.);
541 // define gas-mixtures
544 gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
547 dg = (dar * 4 + dco) / 5;
548 AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg);
550 // Define tracking media
551 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
552 AliMedium(7, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
553 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
554 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
555 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
556 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
557 AliMedium(9, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
558 AliMedium(10, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
559 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10);
560 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1);
561 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
562 AliMedium(16, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
564 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
565 gMC->Gstpar(idtmed[600], "LOSS", 3.);
566 gMC->Gstpar(idtmed[600], "DRAY", 1.);
568 gMC->Gstpar(idtmed[603], "LOSS", 3.);
569 gMC->Gstpar(idtmed[603], "DRAY", 1.);
571 gMC->Gstpar(idtmed[604], "LOSS", 3.);
572 gMC->Gstpar(idtmed[604], "DRAY", 1.);
574 gMC->Gstpar(idtmed[605], "LOSS", 3.);
575 gMC->Gstpar(idtmed[605], "DRAY", 1.);
577 gMC->Gstpar(idtmed[606], "LOSS", 3.);
578 gMC->Gstpar(idtmed[606], "DRAY", 1.);
580 gMC->Gstpar(idtmed[607], "LOSS", 3.);
581 gMC->Gstpar(idtmed[607], "DRAY", 1.);
583 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
584 // --- without affecting the hit patterns ---
585 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
586 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
587 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
588 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
589 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
590 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
591 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
592 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
593 gMC->Gstpar(idtmed[606], "CUTGAM", 1e-4);
594 gMC->Gstpar(idtmed[606], "CUTELE", 1e-4);
595 gMC->Gstpar(idtmed[606], "CUTNEU", 1e-4);
596 gMC->Gstpar(idtmed[606], "CUTHAD", 1e-4);
597 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
598 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
599 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
600 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
601 gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
602 gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
603 gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
604 gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
606 // --- Prevent particles stopping in the gas due to energy cut-off ---
607 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
608 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
609 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
610 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
611 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
614 //_____________________________________________________________________________
615 void AliPMDv0::Init()
618 // Initialises PMD detector after it has been built
624 for(i=0;i<35;i++) printf("*");
625 printf(" PMD_INIT ");
626 for(i=0;i<35;i++) printf("*");
628 printf(" PMD simulation package initialised\n");
629 printf(" parameters of pmd\n");
630 printf("%6d %10.2f %10.2f %10.2f %10.2f %10.2f\n",kdet,thmin,thmax,zdist,thlow,thhigh);
632 for(i=0;i<80;i++) printf("*");
635 Int_t *idtmed = fIdtmed->GetArray()-599;
636 fMedSens=idtmed[605-1];
639 //_____________________________________________________________________________
640 void AliPMDv0::StepManager()
643 // Called at each step in the PMD
646 Float_t hits[4], destep;
647 Float_t center[3] = {0,0,0};
651 if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
653 gMC->CurrentVolID(copy);
655 gMC->CurrentVolOffID(1,copy);
657 gMC->CurrentVolOffID(2,copy);
658 namep=gMC->CurrentVolOffName(2);
660 if(strncmp(namep,"DW11",4))vol[2]=1;
661 if(strncmp(namep,"DV11",4))vol[2]=2;
662 gMC->CurrentVolOffID(3,copy);
664 gMC->CurrentVolOffID(4,copy);
666 gMC->Gdtom(center,hits,1);
667 hits[3] = destep*1e9; //Number in eV
668 AddHit(gAlice->CurrentTrack(), vol, hits);