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.8 2000/10/02 21:28:12 fca
19 Removal of useless dependecies via forward declarations
21 Revision 1.7 1999/10/06 13:05:52 fca
22 Temporary fix to keep the code working waiting for Y.Viyogi
24 Revision 1.6 1999/09/29 09:24:28 fca
25 Introduction of the Copyright and cvs Log
29 ///////////////////////////////////////////////////////////////////////////////
31 // Photon Multiplicity Detector Version 1 //
35 <img src="picts/AliPMDv0Class.gif">
39 ///////////////////////////////////////////////////////////////////////////////
47 static const Double_t kPI=TMath::Pi();
49 static Float_t smod2[3], smod3[3], smod4[3];
50 static Int_t maxbox, kdet;
51 static Float_t thgas,thmin,thmax,zdist,zdist1,thlow,
54 static Float_t xbox[40][40], ybox[40][40];
55 static Int_t pindex[40][40];
58 //_____________________________________________________________________________
59 AliPMDv0::AliPMDv0() : AliPMD()
62 // Default constructor
67 //_____________________________________________________________________________
68 AliPMDv0::AliPMDv0(const char *name, const char *title)
72 // Standard constructor
77 //_____________________________________________________________________________
78 void AliPMDv0::Coordnew()
81 // Find coordinates for pad geometry
83 // Author Y.P. Viyogi, VECC Calcutta
86 Float_t th1, th2, dbox, dist;
87 //Float_t xoff[40][40], yoff[40][40];
90 Int_t xoff1[3], yoff1[3], l;
91 Float_t rhigh, dmax, hole;
95 th1 = thmin * kPI / 180;
96 th2 = thmax * kPI / 180;
97 /* ESTIMATES FOR OCTAGON */
98 dist = zdist * TMath::Tan(th2);
99 /* *** 04.06.97 Fixed Module size of 6 cm, 0 mm boundary. */
100 /* *** variable pad sizes of 0.3 mm, 0.5 mm, 1.0 mm and 1.2 mm */
101 dbox = edge * 2 + 24;
102 maxbox = Int_t(dist / dbox + .5);
104 /* NOW GET THE HOLE SIZE ETC. */
105 hole = zdist * TMath::Tan(th1);
106 nhol = Int_t(hole / dbox + .5);
109 rlow = zdist * TMath::Tan(thlow * kPI / 180);
110 rhigh = zdist * TMath::Tan(thhigh * kPI / 180);
111 for (i = 1; i <= 40; ++i) {
112 for (j = 1; j <= 40; ++j) {
122 // NOW START PLACING THE BOXES IN VARIOUS LAYERS, START FROM THE CENTRE
125 for(i=0;i<3;i++) yoff1[i]=0;
127 // PRINT*,'MAXBOX=',MAXBOX
128 for (i = 1; i <= maxbox; ++i) {
130 for(j=0;j<3;j++) xoff1[j]=0;
131 for (j = 1; j <= maxbox; ++j) {
132 rr = sqrt(xx*xx+yy*yy);
133 if (rr >= hole && rr <= dmax) {
136 //if (rr < rlow) index[j][i] = 1;
137 //else if (rr > rhigh) index[j][i] = 3;
141 //xoff[j][i] = xoff1[index[j][i] - 1];
142 //yoff[j][i] = yoff1[index[j][i] - 1];
144 if (kdet == 1) kk = 1; else kk = 0;
145 for (l = 1; l <= 3; ++l)
146 xoff1[l - 1] += fNumPads[l + kk - 1];
150 if (kdet == 1) kk = 1; else kk=0;
152 for (l = 1; l <= 3; ++l)
153 yoff1[l - 1] += fNumPads[l + kk - 1];
158 //_____________________________________________________________________________
159 void AliPMDv0::Coordinates()
162 // SUBROUTINE TO COMPUTE THE X- AND Y- COORDINATES OF THE BOXES
163 // WHICH CAN FIT INTO THE CIRCULAR REGION BETWEEN THE GIVEN ANGLES.
164 // INPUT : ZDIST, THMIN, THMAX, PADSIZE (FOR INSIDE and OUTSIDE PMD).
165 // ALL DIMENSIONS IN CM.
166 // -- Author : Y.P. VIYOGI, 10/05/1996.
168 Float_t hole, dmax, dbox;
174 Float_t rhigh, rr, xx, yy, th1, th2;
178 // ESTIMATES FOR OCTAGON
179 dist = zdist * TMath::Tan(th2);
180 // *** 04.06.97 Fixed Module size of 24 cm, 3 mm boundary.
181 // *** variable pad sizes of 8 mm, 10 mm, 12mm and 15 mm
183 maxbox = Int_t(dist / dbox + .5);
185 // NOW GET THE HOLE SIZE ETC.
186 hole = zdist * TMath::Tan(th1);
187 nhol = Int_t(hole / dbox + .5);
190 rlow = zdist * TMath::Tan(thlow*kPI/180);
191 rhigh = zdist * TMath::Tan(thhigh*kPI/180);
192 for (i = 0; i < 40; ++i) {
193 for (j = 0; j < 40; ++j) {
200 // NOW START PLACING THE BOXES IN VARIOUS LAYERS, START FROM THE CENTRE
203 for (i = 0; i < maxbox; ++i) {
205 for (j = 0; j < maxbox; ++j) {
206 rr = TMath::Sqrt(xx*xx + yy*yy);
207 if (rr >= hole && rr <= dmax) { // BOX CAN BE FITTED
209 if (rr < rlow) pindex[j][i] = 1;
210 if (rr > rhigh) pindex[j][i] = 3;
221 //_____________________________________________________________________________
222 void AliPMDv0::CreateGeometry()
225 // Create geometry for Photon Multiplicity Detector Version 1
229 <img src="picts/AliPMDv0.gif">
234 <img src="picts/AliPMDv0Tree.gif">
241 //_____________________________________________________________________________
242 void AliPMDv0::CreateInside()
245 // Create inside of Pads
247 // -- Author : Y.P. VIYOGI, 07/05/1996.
248 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
250 Float_t sipmd[3] = { 300.,300.,5. };
254 Float_t xiqa[4], yiqa[4];
255 Int_t inum2, inum3, inum4, i, j, k;
257 Float_t zd, xd, yd, xp, yp, zp;
260 Int_t *idtmed = fIdtmed->GetArray()-599;
262 // VOLUMES Names : begining with D for all PMD volumes,
263 // The names of SIZE variables begin with S and have more meaningful
264 // characters as shown below.
266 // VOLUME SIZE MEDIUM : REMARKS
267 // ------ ----- ------ : ---------------------------
269 // DPMD SIPMD AIR : INSIDE PMD and its SIZE
273 // *** Define the DPMD Volume and fill with air ***
275 gMC->Gsvolu("DPMD", "BOX ", idtmed[698], sipmd, 3);
277 // *** Define DIQU Volume and fill with air
278 siqad[0] = sipmd[0] / 2. - 1.;
279 siqad[1] = sipmd[1] / 2. - 1.;
281 gMC->Gsvolu("DIQU","BOX ", idtmed[698], siqad, 3);
282 gMC->Gsatt("DIQU", "SEEN", 1);
285 // --- Place the modules in INSIDE PMD (DPMD)
286 // --- FIRST CALCULATE THE COORDINATES OF THE MODULES WHICH CAN BE
294 AliMatrix(idrotm[1], 90., 0., 90., 90., 0., 0.);
295 AliMatrix(idrotm[2], 90., 180., 90., 90., 0., 0.);
296 AliMatrix(idrotm[3], 90., 180., 90., 270., 0., 0.);
297 AliMatrix(idrotm[4], 90., 0., 90., 270., 0., 0.);
298 // **** Filling the DIQU Vol. (One Quadrant)
302 for (i = 0; i < maxbox; ++i) {
304 for (j = 0; j < i2; ++j) {
305 if (xbox[j][i] <= 0 && ybox[j][i] <= 0) continue;
306 xd = xbox[j][i] - siqad[0];
307 yd = ybox[j][i] - siqad[1];
308 if (pindex[j][i] == 1) {
310 gMC->Gsposp("DM11", inum2, "DIQU", xd, yd, zd, 0, "ONLY", smod2, 3);
312 if (pindex[j][i] == 2) {
314 gMC->Gsposp("DM12", inum3, "DIQU", xd, yd, zd, 0, "ONLY", smod3, 3);
316 if (pindex[j][i] == 3) {
318 gMC->Gsposp("DM13", inum4, "DIQU", xd, yd, zd, 0, "ONLY", smod4, 3);
331 for (k = 1; k <= i2; ++k) {
332 gMC->Gsposp("DIQU", k, "DPMD", xiqa[k-1], yiqa[k-1], zd, idrotm[k], "ONLY", siqad, 3);
335 // --- Place the DPMD in ALICE with front edge 6.0m from vertex ---
339 gMC->Gspos("DPMD", 1, "ALIC", xp, yp, zp, 0, "ONLY");
343 //_____________________________________________________________________________
344 void AliPMDv0::CreatePads()
347 // Create the geometry of the pads
348 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
349 // *** DIFFERENT PADS WITH SIZES 8 MM, 10 MM, 12 MM AND 15 MM SQUARE
350 // -- Author : Y.P. VIYOGI, 04/06/1997.
351 // -- Modified: P.V.K.S.Baba(JU), 13-12-97.
354 Float_t /* scpv1[3], */ scpv2[3] /*, scpv3[3], scpv4[3] */;
355 Float_t spsw1[3], spsw2[3];//, spsw3[3], spsw4[3];
356 Float_t sw[3], xc, yc, zc;
358 Float_t spb[3], pad1, pad2, pad3, pad4;
359 // VOLUMES Names : begining with D for all PMD volumes,
361 // DM11 : MODULE TYPE
363 // The names of SIZE variables begin with S and have more meaningful
364 // characters as shown below.
366 // VOLUME SIZE MEDIUM : REMARKS
367 // ------ ----- ------ : ---------------------------
369 // DPPB SPB PB : PB Converter and its SIZE
370 // DPFE SFE FE : FE Support Plate and its SIZE
372 // DW11 SPSW3 G10 : PRESHOWER
373 // DV11 SCPV3 G10 : CPV
374 // ****************** VOLUME TREE ******************
379 // -------------------------------------------------
382 // DV11( CPV) DPFE DPPB DW11(Preshower)
383 // ************************************************************
387 Int_t *idtmed = fIdtmed->GetArray()-599;
393 zdist = TMath::Abs(zdist1);
397 numqu = Int_t(fGeo[2]);
403 npad2 = Int_t(24/fPadSize[1]);
405 spsw2[0] = (npad2 * pad2)/2 + edge;
407 spsw2[2] = (thgas + .4) / 2;
411 // The modules (DW11 and DV11 are filed with gas, G10 plate is ignored)
412 gMC->Gsvolu("DW11","BOX ", idtmed[604], spsw2, 3);
413 gMC->Gsatt("DW11", "SEEN", 1);
414 gMC->Gsvolu("DV11","BOX ", idtmed[604], spsw2, 3);
415 gMC->Gsatt("DV11", "SEEN", 1);
417 // --- DEFINE MODULES, IRON, TUNGSTEN AND LEAD VOLUMES
419 // This mod by fca, waiting for Yogendra Viyogi answer
429 gMC->Gsvolu("DPPB","BOX ", idtmed[600], spb, 3);
430 gMC->Gsatt("DPPB", "SEEN", 1);
435 gMC->Gsvolu("DPW ","BOX ", idtmed[600], sw, 3);
436 gMC->Gsatt("DPW ", "SEEN", 1);
441 gMC->Gsvolu("DPFE","BOX ", idtmed[605], sfe, 3);
442 gMC->Gsatt("DPFE", "SEEN", 1);
446 smod2[2] = spsw2[2] + sfe[2] + spb[2] + scpv2[2];
447 gMC->Gsvolu("DM11", "BOX ", idtmed[698], smod2, 3);
449 // --- place gas box (as CPV), iron support, lead converter and gas box
450 // --- (preshower) in the module
453 // --- First the CPV box
454 zc = -(spsw2[2] + sfe[2] + spb[2] + spsw2[2]) + spsw2[2];
455 gMC->Gspos("DV11", 1, "DM11", xc, yc, zc, 0, "ONLY");
456 // --- Then iron support plate
457 zc = zc + sfe[2] + spsw2[2];
458 gMC->Gspos("DPFE", 1, "DM11", xc, yc, zc, 0, "ONLY");
459 // --- Then lead converter plate
460 zc = zc + sfe[2] + spb[2];
461 gMC->Gspos("DPPB", 1, "DM11", xc, yc, zc, 0, "ONLY");
462 // --- Lastly the preshower box
463 zc = zc + spb[2] + spsw2[2];
464 gMC->Gspos("DW11", 1, "DM11", xc, yc, zc, 0, "ONLY");
468 //_____________________________________________________________________________
469 void AliPMDv0::DrawModule()
472 // Draw a shaded view of the Photon Multiplicity Detector
475 gMC->Gsatt("*", "seen", -1);
476 gMC->Gsatt("alic", "seen", 0);
478 // Set the visibility of the components
480 gMC->Gsatt("DW11","seen",0);
481 gMC->Gsatt("DV11","seen",0);
482 gMC->Gsatt("DPPB","seen",1);
483 gMC->Gsatt("DPW ","seen",1);
484 gMC->Gsatt("DPFE","seen",1);
485 gMC->Gsatt("DM11","seen",1);
486 gMC->Gsatt("DPMD","seen",0);
487 gMC->Gsatt("DIQU","seen",0);
489 gMC->Gdopt("hide", "on");
490 gMC->Gdopt("shad", "on");
491 gMC->Gsatt("*", "fill", 7);
492 gMC->SetClipBox(".");
493 gMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
495 gMC->Gdraw("alic", 40, 30, 0, 22, 15.5, .04, .04);
496 gMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
497 gMC->Gdman(17, 5, "MAN");
498 gMC->Gdopt("hide", "off");
501 //_____________________________________________________________________________
502 void AliPMDv0::CreateMaterials()
505 // Create materials for the PMD version 1
507 // ORIGIN : Y. P. VIYOGI
510 // --- The Argon- CO2 mixture ---
511 Float_t ag[2] = { 39.95 };
512 Float_t zg[2] = { 18. };
513 Float_t wg[2] = { .8,.2 };
514 Float_t dar = .001782; // --- Ar density in g/cm3 ---
516 Float_t ac[2] = { 12.,16. };
517 Float_t zc[2] = { 6.,8. };
518 Float_t wc[2] = { 1.,2. };
519 Float_t dc = .001977;
520 Float_t dco = .002; // --- CO2 density in g/cm3 ---
522 Float_t absl, radl, a, d, z;
528 Int_t *idtmed = fIdtmed->GetArray()-599;
529 Int_t isxfld = gAlice->Field()->Integ();
530 Float_t sxmgmx = gAlice->Field()->Max();
532 // --- Define the various materials for GEANT ---
533 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
535 AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4);
536 AliMixture(3, "CO2 $", ac, zc, dc, -2, wc);
537 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
538 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
539 AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3);
540 AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999);
541 AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.);
542 AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7);
543 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
544 AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9);
546 AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.);
547 AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.);
548 AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16);
549 AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.);
551 // define gas-mixtures
554 gMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
557 dg = (dar * 4 + dco) / 5;
558 AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg);
560 // Define tracking media
561 AliMedium(1, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
562 AliMedium(7, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
563 AliMedium(8, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
564 AliMedium(4, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
565 AliMedium(6, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
566 AliMedium(5, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
567 AliMedium(9, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
568 AliMedium(10, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
569 AliMedium(98, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10);
570 AliMedium(99, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1);
571 AliMedium(15, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
572 AliMedium(16, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
574 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
575 gMC->Gstpar(idtmed[600], "LOSS", 3.);
576 gMC->Gstpar(idtmed[600], "DRAY", 1.);
578 gMC->Gstpar(idtmed[603], "LOSS", 3.);
579 gMC->Gstpar(idtmed[603], "DRAY", 1.);
581 gMC->Gstpar(idtmed[604], "LOSS", 3.);
582 gMC->Gstpar(idtmed[604], "DRAY", 1.);
584 gMC->Gstpar(idtmed[605], "LOSS", 3.);
585 gMC->Gstpar(idtmed[605], "DRAY", 1.);
587 gMC->Gstpar(idtmed[606], "LOSS", 3.);
588 gMC->Gstpar(idtmed[606], "DRAY", 1.);
590 gMC->Gstpar(idtmed[607], "LOSS", 3.);
591 gMC->Gstpar(idtmed[607], "DRAY", 1.);
593 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
594 // --- without affecting the hit patterns ---
595 gMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
596 gMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
597 gMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
598 gMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
599 gMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
600 gMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
601 gMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
602 gMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
603 gMC->Gstpar(idtmed[606], "CUTGAM", 1e-4);
604 gMC->Gstpar(idtmed[606], "CUTELE", 1e-4);
605 gMC->Gstpar(idtmed[606], "CUTNEU", 1e-4);
606 gMC->Gstpar(idtmed[606], "CUTHAD", 1e-4);
607 gMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
608 gMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
609 gMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
610 gMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
611 gMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
612 gMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
613 gMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
614 gMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
616 // --- Prevent particles stopping in the gas due to energy cut-off ---
617 gMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
618 gMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
619 gMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
620 gMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
621 gMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
624 //_____________________________________________________________________________
625 void AliPMDv0::Init()
628 // Initialises PMD detector after it has been built
634 for(i=0;i<35;i++) printf("*");
635 printf(" PMD_INIT ");
636 for(i=0;i<35;i++) printf("*");
638 printf(" PMD simulation package initialised\n");
639 printf(" parameters of pmd\n");
640 printf("%6d %10.2f %10.2f %10.2f %10.2f %10.2f\n",kdet,thmin,thmax,zdist,thlow,thhigh);
642 for(i=0;i<80;i++) printf("*");
645 Int_t *idtmed = fIdtmed->GetArray()-599;
646 fMedSens=idtmed[605-1];
649 //_____________________________________________________________________________
650 void AliPMDv0::StepManager()
653 // Called at each step in the PMD
656 Float_t hits[4], destep;
657 Float_t center[3] = {0,0,0};
661 if(gMC->GetMedium() == fMedSens && (destep = gMC->Edep())) {
663 gMC->CurrentVolID(copy);
665 gMC->CurrentVolOffID(1,copy);
667 gMC->CurrentVolOffID(2,copy);
668 namep=gMC->CurrentVolOffName(2);
670 if(strncmp(namep,"DW11",4))vol[2]=1;
671 if(strncmp(namep,"DV11",4))vol[2]=2;
672 gMC->CurrentVolOffID(3,copy);
674 gMC->CurrentVolOffID(4,copy);
676 gMC->Gdtom(center,hits,1);
677 hits[3] = destep*1e9; //Number in eV
678 AddHit(gAlice->CurrentTrack(), vol, hits);