1 ///////////////////////////////////////////////////////////////////////////////
3 // Photon Multiplicity Detector //
4 // This class contains the basic functions for the Photon Multiplicity //
5 // Detector. Functions specific to one particular geometry are //
6 // contained in the derived classes //
10 <img src="gif/AliPMDClass.gif">
13 <font size=+2 color=red>
14 <p>The responsible person for this module is
15 <a href="mailto:sub@vecdec.veccal.ernet.in">Subhasis Chattopadhyay</a>.
21 ///////////////////////////////////////////////////////////////////////////////
30 static Float_t smod1[3], smod2[3], smod3[3], smod4[3];
31 static Int_t maxbox, kdet;
32 //static Float_t pmdin,pmdout,wafer;
33 static Float_t thgas,thcell,thmin,thmax,zdist,thlow,
36 static Float_t xbox[40][40], ybox[40][40];
37 static Int_t pindex[40][40];
41 //_____________________________________________________________________________
45 // Default constructor
50 //_____________________________________________________________________________
51 AliPMD::AliPMD(const char *name, const char *title)
52 : AliDetector(name,title)
55 // Default constructor
59 // Allocate the array of hits
60 fHits = new TClonesArray("AliPMDhit", 405);
82 //_____________________________________________________________________________
83 void AliPMD::AddHit(Int_t track, Int_t *vol, Float_t *hits)
88 TClonesArray &lhits = *fHits;
89 AliPMDhit *newcell, *curcell;
90 // printf("PMD++ Adding energy %f, prim %d, vol %d %d %d %d\n",
91 // hits[3],gAlice->GetPrimary(track-1),vol[0],vol[1],vol[2],vol[3]);
92 newcell = new AliPMDhit(fIshunt, track, vol, hits);
94 for (i=0; i<fNhits; i++) {
96 // See if this cell has already been hit
97 curcell=(AliPMDhit*) lhits[i];
98 if (*curcell==*newcell) {
99 // printf("Cell with same numbers found\n") ; curcell->Print();
100 *curcell = *curcell+*newcell;
101 // printf("Cell after addition\n") ; curcell->Print();
106 new(lhits[fNhits++]) AliPMDhit(newcell);
110 //_____________________________________________________________________________
111 void AliPMD::BuildGeometry()
114 // Build simple ROOT TNode geometry for event display
118 const int kColorPMD = kRed;
121 Top=gAlice->GetGeometry()->GetNode("alice");
124 new TBRIK("S_PMD","PMD box","void",300,300,5);
126 Node = new TNode("PMD","PMD","S_PMD",0,0,600,"");
127 Node->SetLineColor(kColorPMD);
131 //_____________________________________________________________________________
132 Int_t AliPMD::DistancetoPrimitive(Int_t , Int_t )
135 // Distance from mouse to detector on the screen
141 //_____________________________________________________________________________
142 void AliPMD::SetPAR(Float_t p1, Float_t p2, Float_t p3,Float_t p4)
145 // Set PMD parameters
153 //_____________________________________________________________________________
154 void AliPMD::SetIN(Float_t p1, Float_t p2, Float_t p3,Float_t p4,Float_t p5)
157 // Set PMD parameters
166 //_____________________________________________________________________________
167 void AliPMD::SetGEO(Float_t p1, Float_t p2, Float_t p3)
170 // Set geometry parameters
177 //_____________________________________________________________________________
178 void AliPMD::SetPadSize(Float_t p1, Float_t p2, Float_t p3,Float_t p4)
189 //_____________________________________________________________________________
190 void AliPMD::StepManager()
193 // Called at every step in PMD
198 //_____________________________________________________________________________
199 void AliPMD::Undulation(char *undul, Float_t pitch, Float_t thick,
200 Float_t zundul, Float_t rundul, char (*cone)[5])
203 // RUNDUL : Internal radius of the undulated chamber
204 // THICK : material thickness
205 // PITCH : one-QUARTER wave of undulation (cm)
206 // ZUNDUL : half length (cm)
208 // The undulated structure is desgned as a superposition of eight CONES
209 // of suitable sizes, where the inner/outer radius of the cone increases,
210 // then decreases, each half of the wave is assumed to be a semicircle,
211 // which allows to calculate the thickness and the radii of the cone, by
212 // dividing the semicircle into 4 parts of equal arc length.
213 // Thus apear the constants 0.293 and 0.707.
216 const Float_t const1 = .293;
217 const Float_t const2 = .707;
219 AliMC* pMC = AliMC::GetMC();
223 Float_t dcone1[5], dcone2[5], dcone3[5], dcone4[5], dcone5[5],
224 dcone6[5], dcone7[5], dcone8[5];
225 Float_t xc, yc, zc, dundul[3];
226 Int_t *idtmed = gAlice->Idtmed();
230 dcone1[0] = const1 * pitch / 2;
232 dcone1[2] = dcone1[1] + thick;
233 dcone1[3] = dcone1[1] + const2 * pitch;
234 dcone1[4] = dcone1[3] + thick;
236 dcone2[0] = const2 * pitch / 2;
237 dcone2[1] = dcone1[3];
238 dcone2[2] = dcone1[4];
239 dcone2[3] = dcone2[1] + const1 * pitch;
240 dcone2[4] = dcone2[3] + thick;
242 dcone3[0] = dcone2[0];
243 dcone3[1] = dcone2[3];
244 dcone3[2] = dcone2[4];
245 dcone3[3] = dcone2[1];
246 dcone3[4] = dcone2[2];
248 dcone4[0] = dcone1[0];
249 dcone4[1] = dcone1[3];
250 dcone4[2] = dcone1[4];
251 dcone4[3] = dcone1[1];
252 dcone4[4] = dcone1[2];
254 dcone5[0] = dcone1[0];
255 dcone5[1] = dcone1[1] - thick;
256 dcone5[2] = dcone1[1];
257 dcone5[3] = dcone5[1] - const2 * pitch;
258 dcone5[4] = dcone5[3] + thick;
260 dcone6[0] = dcone2[0];
261 dcone6[1] = dcone5[3];
262 dcone6[2] = dcone5[4];
263 dcone6[3] = dcone6[1] - const1 * pitch;
264 dcone6[4] = dcone6[3] + thick;
266 dcone7[0] = dcone6[0];
267 dcone7[1] = dcone6[3];
268 dcone7[2] = dcone6[4];
269 dcone7[3] = dcone5[3];
270 dcone7[4] = dcone5[4];
272 dcone8[0] = dcone5[0];
273 dcone8[1] = dcone7[3];
274 dcone8[2] = dcone7[4];
275 dcone8[3] = dcone5[1];
276 dcone8[4] = dcone5[2];
278 pMC->Gsvolu(cone[0], "CONE", idtmed[606-1], dcone1, 5);
279 pMC->Gsvolu(cone[1], "CONE", idtmed[606-1], dcone2, 5);
280 pMC->Gsvolu(cone[2], "CONE", idtmed[606-1], dcone3, 5);
281 pMC->Gsvolu(cone[3], "CONE", idtmed[606-1], dcone4, 5);
282 pMC->Gsvolu(cone[4], "CONE", idtmed[606-1], dcone5, 5);
283 pMC->Gsvolu(cone[5], "CONE", idtmed[606-1], dcone6, 5);
284 pMC->Gsvolu(cone[6], "CONE", idtmed[606-1], dcone7, 5);
285 pMC->Gsvolu(cone[7], "CONE", idtmed[606-1], dcone8, 5);
286 pMC->Gsatt(cone[0], "SEEN", 0);
287 pMC->Gsatt(cone[1], "SEEN", 0);
288 pMC->Gsatt(cone[2], "SEEN", 0);
289 pMC->Gsatt(cone[3], "SEEN", 0);
290 pMC->Gsatt(cone[4], "SEEN", 0);
291 pMC->Gsatt(cone[5], "SEEN", 0);
292 pMC->Gsatt(cone[6], "SEEN", 0);
293 pMC->Gsatt(cone[7], "SEEN", 0);
295 // DEFINE AN IMAGINARY TUBE VOLUME FOR UNDULATED CHAMBER, FILL WITH VACUUM
297 nwave = Int_t (zundul / (pitch * 2) + .1);
298 dundul[2] = pitch * 2 * nwave;
299 dundul[1] = rundul + pitch + thick * 2;
302 pMC->Gsvolu(undul, "TUBE", idtmed[698-1], dundul, 3);
306 zc = -dundul[2] + dcone1[0];
307 for (j = 1; j <= nwave; ++j) {
308 pMC->Gspos(cone[0], j, undul, xc, yc, zc, 0, "ONLY");
309 zc = zc + dcone1[0] + dcone2[0];
310 pMC->Gspos(cone[1], j, undul, xc, yc, zc, 0, "ONLY");
311 zc = zc + dcone2[0] + dcone3[0];
312 pMC->Gspos(cone[2], j, undul, xc, yc, zc, 0, "ONLY");
313 zc = zc + dcone3[0] + dcone4[0];
314 pMC->Gspos(cone[3], j, undul, xc, yc, zc, 0, "ONLY");
315 zc = zc + dcone4[0] + dcone5[0];
316 pMC->Gspos(cone[4], j, undul, xc, yc, zc, 0, "ONLY");
317 zc = zc + dcone5[0] + dcone6[0];
318 pMC->Gspos(cone[5], j, undul, xc, yc, zc, 0, "ONLY");
319 zc = zc + dcone6[0] + dcone7[0];
320 pMC->Gspos(cone[6], j, undul, xc, yc, zc, 0, "ONLY");
321 zc = zc + dcone7[0] + dcone8[0];
322 pMC->Gspos(cone[7], j, undul, xc, yc, zc, 0, "ONLY");
323 zc = zc + dcone8[0] + dcone1[0];
327 ///////////////////////////////////////////////////////////////////////////////
329 // Photon Multiplicity Detector Version 1 //
333 <img src="gif/AliPMDv1Class.gif">
337 ///////////////////////////////////////////////////////////////////////////////
341 //_____________________________________________________________________________
342 AliPMDv1::AliPMDv1() : AliPMD()
345 // Default constructor
350 //_____________________________________________________________________________
351 AliPMDv1::AliPMDv1(const char *name, const char *title)
355 // Standard constructor
360 //_____________________________________________________________________________
361 void AliPMDv1::Coordnew()
364 // Find coordinates for pad geometry
366 // Author Y.P. Viyogi, VECC Calcutta
369 Float_t th1, th2, dbox, dist;
370 //Float_t xoff[40][40], yoff[40][40];
372 Int_t xoff1[3], yoff1[3], l;
377 th1 = thmin * kPI / 180;
378 th2 = thmax * kPI / 180;
379 /* ESTIMATES FOR OCTAGON */
380 dist = zdist * TMath::Tan(th2);
381 /* *** 04.06.97 Fixed Module size of 6 cm, 0 mm boundary. */
382 /* *** variable pad sizes of 0.3 mm, 0.5 mm, 1.0 mm and 1.2 mm */
383 dbox = edge * 2 + 24;
384 maxbox = Int_t(dist / dbox + .5);
386 /* NOW GET THE HOLE SIZE ETC. */
387 hole = zdist * TMath::Tan(th1);
388 nhol = Int_t(hole / dbox + .5);
391 //rlow = zdist * TMath::Tan(thlow * kPI / 180);
392 //rhigh = zdist * TMath::Tan(thhigh * kPI / 180);
393 for (i = 1; i <= 40; ++i) {
394 for (j = 1; j <= 40; ++j) {
404 // NOW START PLACING THE BOXES IN VARIOUS LAYERS, START FROM THE CENTRE
407 for(i=0;i<3;i++) yoff1[i]=0;
409 // PRINT*,'MAXBOX=',MAXBOX
410 for (i = 1; i <= maxbox; ++i) {
412 for(j=0;j<3;j++) xoff1[j]=0;
413 for (j = 1; j <= maxbox; ++j) {
414 rr = sqrt(xx*xx+yy*yy);
415 if (rr >= hole && rr <= dmax) {
418 //if (rr < rlow) index[j][i] = 1;
419 //else if (rr > rhigh) index[j][i] = 3;
423 //xoff[j][i] = xoff1[index[j][i] - 1];
424 //yoff[j][i] = yoff1[index[j][i] - 1];
426 if (kdet == 1) kk = 1; else kk = 0;
427 for (l = 1; l <= 3; ++l)
428 xoff1[l - 1] += fNumPads[l + kk - 1];
432 if (kdet == 1) kk = 1; else kk=0;
434 for (l = 1; l <= 3; ++l)
435 yoff1[l - 1] += fNumPads[l + kk - 1];
440 //_____________________________________________________________________________
441 void AliPMDv1::Coordinates()
444 // SUBROUTINE TO COMPUTE THE X- AND Y- COORDINATES OF THE BOXES
445 // WHICH CAN FIT INTO THE CIRCULAR REGION BETWEEN THE GIVEN ANGLES.
446 // INPUT : ZDIST, THMIN, THMAX, PADSIZE (FOR INSIDE and OUTSIDE PMD).
447 // ALL DIMENSIONS IN CM.
448 // -- Author : Y.P. VIYOGI, 10/05/1996.
450 Float_t hole, dmax, dbox;
456 Float_t rhigh, rr, xx, yy, th1, th2;
460 // ESTIMATES FOR OCTAGON
461 dist = zdist * TMath::Tan(th2);
462 // *** 04.06.97 Fixed Module size of 24 cm, 3 mm boundary.
463 // *** variable pad sizes of 8 mm, 10 mm, 12mm and 15 mm
465 maxbox = Int_t(dist / dbox + .5);
467 // NOW GET THE HOLE SIZE ETC.
468 hole = zdist * TMath::Tan(th1);
469 nhol = Int_t(hole / dbox + .5);
472 rlow = zdist * TMath::Tan(thlow*kPI/180);
473 rhigh = zdist * TMath::Tan(thhigh*kPI/180);
474 for (i = 0; i < 40; ++i) {
475 for (j = 0; j < 40; ++j) {
482 // NOW START PLACING THE BOXES IN VARIOUS LAYERS, START FROM THE CENTRE
485 for (i = 0; i < maxbox; ++i) {
487 for (j = 0; j < maxbox; ++j) {
488 rr = TMath::Sqrt(xx*xx + yy*yy);
489 if (rr >= hole && rr <= dmax) { // BOX CAN BE FITTED
491 if (rr < rlow) pindex[j][i] = 1;
492 if (rr > rhigh) pindex[j][i] = 3;
503 //_____________________________________________________________________________
504 void AliPMDv1::CreateGeometry()
507 // Create geometry for Photon Multiplicity Detector Version 1
511 <img src="gif/AliPMDv1.gif">
516 <img src="gif/AliPMDv1Tree.gif">
523 //_____________________________________________________________________________
524 void AliPMDv1::CreateInside()
527 // Create inside of Pads
529 // -- Author : Y.P. VIYOGI, 07/05/1996.
530 // -- Modified: P.V.K.S.Baba(JU), 15-12-97.
532 Float_t sipmd[3] = { 300.,300.,5. };
536 Float_t xiqa[4], yiqa[4];
537 Int_t inum2, inum3, inum4, i, j, k;
539 Float_t zd, xd, yd, xp, yp, zp;
542 Int_t *idtmed = gAlice->Idtmed();
544 // VOLUMES Names : begining with D for all PMD volumes,
545 // The names of SIZE variables begin with S and have more meaningful
546 // characters as shown below.
548 // VOLUME SIZE MEDIUM : REMARKS
549 // ------ ----- ------ : ---------------------------
551 // DPMD SIPMD AIR : INSIDE PMD and its SIZE
555 // *** Define the DPMD Volume and fill with air ***
557 AliMC* pMC = AliMC::GetMC();
559 pMC->Gsvolu("DPMD", "BOX ", idtmed[698], sipmd, 3);
561 // *** Define DIQU Volume and fill with air
562 siqad[0] = sipmd[0] / 2. - 1.;
563 siqad[1] = sipmd[1] / 2. - 1.;
565 pMC->Gsvolu("DIQU","BOX ", idtmed[698], siqad, 3);
566 pMC->Gsatt("DIQU", "SEEN", 1);
569 // --- Place the modules in INSIDE PMD (DPMD)
570 // --- FIRST CALCULATE THE COORDINATES OF THE MODULES WHICH CAN BE
578 AliMatrix(idrotm[1], 90., 0., 90., 90., 0., 0.);
579 AliMatrix(idrotm[2], 90., 180., 90., 90., 0., 0.);
580 AliMatrix(idrotm[3], 90., 180., 90., 270., 0., 0.);
581 AliMatrix(idrotm[4], 90., 0., 90., 270., 0., 0.);
582 // **** Filling the DIQU Vol. (One Quadrant)
586 for (i = 0; i < maxbox; ++i) {
588 for (j = 0; j < i2; ++j) {
589 if (xbox[j][i] <= 0 && ybox[j][i] <= 0) continue;
590 xd = xbox[j][i] - siqad[0];
591 yd = ybox[j][i] - siqad[1];
592 if (pindex[j][i] == 1) {
594 pMC->Gsposp("DM11", inum2, "DIQU", xd, yd, zd, 0, "ONLY", smod2, 3);
596 if (pindex[j][i] == 2) {
598 pMC->Gsposp("DM12", inum3, "DIQU", xd, yd, zd, 0, "ONLY", smod3, 3);
600 if (pindex[j][i] == 3) {
602 pMC->Gsposp("DM13", inum4, "DIQU", xd, yd, zd, 0, "ONLY", smod4, 3);
615 for (k = 1; k <= i2; ++k) {
616 pMC->Gsposp("DIQU", k, "DPMD", xiqa[k-1], yiqa[k-1], zd, idrotm[k], "ONLY", siqad, 3);
619 // --- Place the DPMD in ALICE with front edge 6.0m from vertex ---
623 pMC->Gspos("DPMD", 1, "ALIC", xp, yp, zp, 0, "ONLY");
627 //_____________________________________________________________________________
628 void AliPMDv1::CreatePads()
631 // Create the geometry of the pads
632 // *** DEFINITION OF THE GEOMETRY OF THE PMD ***
633 // *** DIFFERENT PADS WITH SIZES 8 MM, 10 MM, 12 MM AND 15 MM SQUARE
634 // -- Author : Y.P. VIYOGI, 04/06/1997.
635 // -- Modified: P.V.K.S.Baba(JU), 13-12-97.
637 AliMC* pMC = AliMC::GetMC();
639 Int_t npad1, npad2, npad3, npad4;
640 Float_t spad1[3], spad2[3], spad3[3], spad4[3];
641 Float_t scpv1[3], scpv2[3], scpv3[3], scpv4[3];
643 Float_t sstr1[3], spsw1[3], sstr2[3], spsw2[3], sstr3[3], spsw3[3],
645 Float_t xa, ya, za, xb, yb, zb, xc, sw[3], yc, zc;
647 Float_t spb[3], pad1, pad2, pad3, pad4;
648 // VOLUMES Names : begining with D for all PMD volumes,
649 // DMO1 : MODULE TYPE 1 ( 8 MM PADS)
650 // DM11 : MODULE TYPE 2 (10 MM PADS)
651 // DM12 : MODULE TYPE 3 (12 MM PADS)
652 // DM13 : MODULE TYPE 4 (15 MM PADS)
654 // The names of SIZE variables begin with S and have more meaningful
655 // characters as shown below.
657 // VOLUME SIZE MEDIUM : REMARKS
658 // ------ ----- ------ : ---------------------------
660 // DPPB SPB PB : PB Converter and its SIZE
661 // DPFE SFE FE : FE Support Plate and its SIZE
663 // DP11 SPAD2 GAS : PAD TYPE 2 (10 MM)
664 // DP12 SPAD2 GAS : PAD TYPE 2 FOR CPV(10 MM)
665 // DS11 SSTR2 FE : STRIP OF IRON
666 // DW11 SPSW2 G10 : PRESHOWER
667 // DV11 SCPV2 G10 : CPV
669 // DP13 SPAD3 GAS : PAD TYPE 3 (12 MM)
670 // DP14 SPAD3 GAS : PAD TYPE 3 FOR CPV(12 MM)
671 // DS12 SSTR3 FE : STRIP OF IRON
672 // DW12 SPSW3 G10 : PRESHOWER
673 // DV12 SCPV3 G10 : CPV
675 // DP15 SPAD4 GAS : PAD TYPE 4 (15 MM)
676 // DP16 SPAD4 GAS : PAD TYPE 4 FOR CPV(15 MM)
677 // DS13 SSTR4 FE : STRIP OF IRON
678 // DW13 SPSW4 G10 : PRESHOWER
679 // DV13 SCPV4 G10 : CPV
681 // ****************** VOLUME TREE ******************
686 // -------------------------------------------------
689 // DV11( CPV) DPFE DPPB DW11(Preshower)
692 // DS12(Strip) DS11(Strip)
695 // DP12(Pads) DP11(Pads)
697 // ************************************************************
699 // --- The above gives the Volume Tree. PAD is a gas cell of size
700 // --- given by PADSIZE in the input cards. STRIP is a collection of
701 //--- PADs in a row. STRIPs are positioned in the PRESHOWER BOX. This is
702 //--- then placed in the MODULE. The PSW and the MODULE have the same size
703 // --- ; Lead converter, Iron support plate are also placed
704 // --- in the MODULE.
707 // DATA PAD1,PAD2,PAD3,PAD4/4*0.8/
708 // DATA NPAD1,NPAD2,NPAD3,NPAD4/4*30/
710 Int_t *idtmed = gAlice->Idtmed();
712 // **** PAD SIZE 8 MM
724 numqu = Int_t(fGeo[2]);
732 npad1 = Int_t(24/fPadSize[0]);
733 npad2 = Int_t(24/fPadSize[1]);
734 npad3 = Int_t(24/fPadSize[2]);
735 npad4 = Int_t(24/fPadSize[3]);
737 spad1[0] = (pad1 - thcell) / 2.;
739 spad1[2] = thgas / 2;
740 pMC->Gsvolu("DP21", "BOX ", idtmed[604], spad1, 3);
741 pMC->Gsatt("DP21", "SEEN", 1);
742 pMC->Gsvolu("DP22", "BOX ", idtmed[604], spad1, 3);
743 pMC->Gsatt("DP22", "SEEN", 1);
745 sstr1[0] = npad1*pad1/2;
748 pMC->Gsvolu("DS21", "BOX ", idtmed[605], sstr1, 3);
749 pMC->Gsatt("DS21", "SEEN", 1);
750 pMC->Gsvolu("DS22", "BOX ", idtmed[605], sstr1, 3);
751 pMC->Gsatt("DS22", "SEEN", 1);
753 spsw1[0] = sstr1[0] + edge;
755 spsw1[2] = (thgas + .4) / 2;
756 // 2 mm G10 Plate cover (NMATE = 808)
760 pMC->Gsvolu("DW21", "BOX ", idtmed[607], spsw1, 3);
761 pMC->Gsatt("DW21", "SEEN", 1);
762 pMC->Gsvolu("DV21", "BOX ", idtmed[607], spsw1, 3);
763 pMC->Gsatt("DV21", "SEEN", 1);
765 // --- place pads in a strip
766 xa = (-npad1 + 1.) * pad1 / 2.;
769 for (i = 1; i <= npad1; ++i) {
770 pMC->Gsposp("DP21", i, "DS21", xa, ya, za, 0, "ONLY", spad1, 3);
771 pMC->Gsposp("DP22", i, "DS22", xa, ya, za, 0, "ONLY", spad1, 3);
774 // --- place strips in the PRESHOWER AND CPV boxes
776 yb = (-npad1 + 1.) * pad1 / 2.;
778 for (j = 1; j <= npad1; ++j) {
779 pMC->Gsposp("DS21", j, "DW21", xb, yb, zb, 0, "ONLY", sstr1, 3);
780 pMC->Gsposp("DS22", j, "DV21", xb, yb, zb, 0, "ONLY", sstr1, 3);
784 // **** PAD SIZE 10 MM
786 spad2[0] = (pad2 - thcell) / 2.;
788 spad2[2] = thgas / 2;
789 pMC->Gsvolu("DP11", "BOX ", idtmed[604], spad2, 3);
790 pMC->Gsatt("DP11", "SEEN", 1);
791 pMC->Gsvolu("DP12", "BOX ", idtmed[604], spad2, 3);
792 pMC->Gsatt("DP12", "SEEN", 1);
794 sstr2[0] = npad2 * pad2 / 2;
796 sstr2[2] = thgas / 2;
797 pMC->Gsvolu("DS11", "BOX ", idtmed[605], sstr2, 3);
798 pMC->Gsatt("DS11", "SEEN", 1);
799 pMC->Gsvolu("DS12", "BOX ", idtmed[605], sstr2, 3);
800 pMC->Gsatt("DS12", "SEEN", 1);
802 spsw2[0] = sstr2[0] + edge;
804 spsw2[2] = (thgas + .4) / 2;
805 // 2 mm G10 Plate cover (NMATE = 808)
809 pMC->Gsvolu("DW11","BOX ", idtmed[607], spsw2, 3);
810 pMC->Gsatt("DW11", "SEEN", 1);
811 pMC->Gsvolu("DV11","BOX ", idtmed[607], spsw2, 3);
812 pMC->Gsatt("DV11", "SEEN", 1);
814 // --- place pads in a strip
815 xa = (-npad2 + 1.) * pad2 / 2.;
818 for (i = 1; i <= npad2; ++i) {
819 pMC->Gsposp("DP11", i, "DS11", xa, ya, za, 0, "ONLY", spad2, 3);
820 pMC->Gsposp("DP12", i, "DS12", xa, ya, za, 0, "ONLY", spad2, 3);
823 // --- place strips in the PRESHOWER AND CPV boxes
825 yb = (-npad2 + 1.) * pad2 / 2.;
827 for (j = 1; j <= npad2; ++j) {
828 pMC->Gsposp("DS11", j, "DW11", xb, yb, zb, 0, "ONLY", sstr2, 3);
829 pMC->Gsposp("DS12", j, "DV11", xb, yb, zb, 0, "ONLY", sstr2, 3);
833 // **** PAD SIZE 12 MM
835 spad3[0] = (pad3 - thcell) / 2.;
837 spad3[2] = thgas / 2;
838 pMC->Gsvolu("DP13", "BOX ", idtmed[604], spad3, 3);
839 pMC->Gsatt("DP13", "SEEN", 1);
840 pMC->Gsvolu("DP14", "BOX ", idtmed[604], spad3, 3);
841 pMC->Gsatt("DP14", "SEEN", 1);
843 sstr3[0] = npad3 * pad3 / 2;
845 sstr3[2] = thgas / 2;
846 pMC->Gsvolu("DS13", "BOX ", idtmed[605], sstr3, 3);
847 pMC->Gsatt("DS13", "SEEN", 1);
848 pMC->Gsvolu("DS14", "BOX ", idtmed[605], sstr3, 3);
849 pMC->Gsatt("DS14", "SEEN", 1);
851 spsw3[0] = sstr3[0] + edge;
853 spsw3[2] = (thgas + .4) / 2;
854 // 2 mm G10 Plate cover (NMATE = 808)
858 pMC->Gsvolu("DW12","BOX ", idtmed[607], spsw3, 3);
859 pMC->Gsatt("DW12", "SEEN", 1);
860 pMC->Gsvolu("DV12","BOX ", idtmed[607], spsw3, 3);
861 pMC->Gsatt("DV12", "SEEN", 1);
863 // --- place pads in a strip
864 xa = (-npad3 + 1.) * pad3 / 2.;
867 for (i = 1; i <= npad3; ++i) {
868 pMC->Gsposp("DP13", i, "DS13", xa, ya, za, 0, "ONLY", spad3, 3);
869 pMC->Gsposp("DP14", i, "DS14", xa, ya, za, 0, "ONLY", spad3, 3);
872 // --- place strips in the PRESHOWER AND CPV boxes
874 yb = (-npad3 + 1.) * pad3 / 2.;
876 for (j = 1; j <= npad3; ++j) {
877 pMC->Gsposp("DS13", j, "DW12", xb, yb, zb, 0, "ONLY", sstr3, 3);
878 pMC->Gsposp("DS14", j, "DV12", xb, yb, zb, 0, "ONLY", sstr3, 3);
882 // **** PAD SIZE 15 MM
884 spad4[0] = (pad4 - thcell) / 2.;
886 spad4[2] = thgas / 2;
887 pMC->Gsvolu("DP15","BOX ", idtmed[604], spad4, 3);
888 pMC->Gsatt("DP15", "SEEN", 1);
889 pMC->Gsvolu("DP16","BOX ", idtmed[604], spad4, 3);
890 pMC->Gsatt("DP16", "SEEN", 1);
892 sstr4[0] = npad4 * pad4 / 2;
894 sstr4[2] = thgas / 2;
895 pMC->Gsvolu("DS15","BOX ", idtmed[605], sstr4, 3);
896 pMC->Gsatt("DS15", "SEEN", 1);
897 pMC->Gsvolu("DS16","BOX ", idtmed[605], sstr4, 3);
898 pMC->Gsatt("DS16", "SEEN", 1);
900 spsw4[0] = sstr4[0] + edge;
902 spsw4[2] = (thgas + .4) / 2;
903 // 2 mm G10 Plate cover (NMATE = 808)
907 pMC->Gsvolu("DW13","BOX ", idtmed[607], spsw4, 3);
908 pMC->Gsatt("DW13", "SEEN", 1);
909 pMC->Gsvolu("DV13","BOX ", idtmed[607], spsw4, 3);
910 pMC->Gsatt("DV13", "SEEN", 1);
912 // --- place pads in a strip
913 xa = (-npad4 + 1.) * pad4 / 2.;
916 for (i = 1; i <= npad4; ++i) {
917 pMC->Gsposp("DP15", i, "DS15", xa, ya, za, 0, "ONLY", spad4, 3);
918 pMC->Gsposp("DP16", i, "DS16", xa, ya, za, 0, "ONLY", spad4, 3);
921 // --- place strips in the PRESHOWER AND CPV boxes
923 yb = (-npad4 + 1.) * pad4 / 2.;
925 for (j = 1; j <= npad4; ++j) {
926 pMC->Gsposp("DS15", j, "DW13", xb, yb, zb, 0, "ONLY", sstr4, 3);
927 pMC->Gsposp("DS16", j, "DV13", xb, yb, zb, 0, "ONLY", sstr4, 3);
932 // --- DEFINE MODULES, IRON, TUNGSTEN AND LEAD VOLUMES
938 pMC->Gsvolu("DPPB","BOX ", idtmed[600], spb, 3);
939 pMC->Gsatt("DPPB", "SEEN", 1);
944 pMC->Gsvolu("DPW ","BOX ", idtmed[600], sw, 3);
945 pMC->Gsatt("DPW ", "SEEN", 1);
950 pMC->Gsvolu("DPFE","BOX ", idtmed[605], sfe, 3);
951 pMC->Gsatt("DPFE", "SEEN", 1);
955 // SMOD1(3)=SPSW1(3)+SFE(3)+SW (3)+SCPV1(3)
956 smod1[2] = spsw1[2] + sfe[2] + spb[2] + scpv1[2];
957 pMC->Gsvolu("DM21", "BOX ", idtmed[698], smod1, 3);
961 smod2[2] = spsw2[2] + sfe[2] + spb[2] + scpv2[2];
962 pMC->Gsvolu("DM11", "BOX ", idtmed[698], smod2, 3);
966 smod3[2] = spsw3[2] + sfe[2] + spb[2] + scpv3[2];
967 pMC->Gsvolu("DM12", "BOX ", idtmed[698], smod3, 3);
971 smod4[2] = spsw4[2] + sfe[2] + spb[2] + scpv4[2];
972 pMC->Gsvolu("DM13", "BOX ", idtmed[698], smod4, 3);
974 // **** MODULE TYPE 1 : ALWAYS WITH TUNSGTEN CONVERTER
976 // *** try with PB once 8.6.97
978 // --- place gas box (as CPV), iron support, lead converter and gas box
979 // --- (preshower) in the module
982 // --- First the CPV box
983 zc = -(spsw1[2] + sfe[2] + spb[2] + spsw1[2]) + spsw1[2];
984 pMC->Gspos("DV21", 1, "DM21", xc, yc, zc, 0, "ONLY");
985 // --- Then iron support plate
986 zc = zc + sfe[2] + spsw1[2];
987 pMC->Gspos("DPFE", 1, "DM21", xc, yc, zc, 0, "ONLY");
988 // --- Then converter plate
989 zc = zc + sfe[2] + spb[2];
990 pMC->Gspos("DPPB", 1, "DM21", xc, yc, zc, 0, "ONLY");
991 // --- Lastly the preshower box
992 zc = zc + spb[2] + spsw1[2];
993 pMC->Gspos("DW21", 1, "DM21", xc, yc, zc, 0, "ONLY");
995 // **** MODULE TYPE 2
997 // --- place gas box (as CPV), iron support, lead converter and gas box
998 // --- (preshower) in the module
1001 // --- First the CPV box
1002 zc = -(spsw2[2] + sfe[2] + spb[2] + spsw2[2]) + spsw2[2];
1003 pMC->Gspos("DV11", 1, "DM11", xc, yc, zc, 0, "ONLY");
1004 // --- Then iron support plate
1005 zc = zc + sfe[2] + spsw2[2];
1006 pMC->Gspos("DPFE", 1, "DM11", xc, yc, zc, 0, "ONLY");
1007 // --- Then lead converter plate
1008 zc = zc + sfe[2] + spb[2];
1009 pMC->Gspos("DPPB", 1, "DM11", xc, yc, zc, 0, "ONLY");
1010 // --- Lastly the preshower box
1011 zc = zc + spb[2] + spsw2[2];
1012 pMC->Gspos("DW11", 1, "DM11", xc, yc, zc, 0, "ONLY");
1015 // **** MODULE TYPE 3
1017 // --- place gas box (as CPV), iron support, lead converter and gas box
1018 // --- (preshower) in the module
1021 // --- First the CPV box
1022 zc = -(spsw3[2] + sfe[2] + spb[2] + spsw3[2]) + spsw3[2];
1023 pMC->Gspos("DV12", 1, "DM12", xc, yc, zc, 0, "ONLY");
1024 // --- Then iron support plate
1025 zc = zc + sfe[2] + spsw3[2];
1026 pMC->Gspos("DPFE", 1, "DM12", xc, yc, zc, 0, "ONLY");
1027 // --- Then lead converter plate
1028 zc = zc + sfe[2] + spb[2];
1029 pMC->Gspos("DPPB", 1, "DM12", xc, yc, zc, 0, "ONLY");
1030 // --- Lastly the preshower box
1031 zc = zc + spb[2] + spsw3[2];
1032 pMC->Gspos("DW12", 1, "DM12", xc, yc, zc, 0, "ONLY");
1035 // **** MODULE TYPE 4
1037 // --- place gas box (as CPV), iron support, lead converter and gas box
1038 // --- (preshower) in the module
1041 // --- First the CPV box
1042 zc = -(spsw4[2] + sfe[2] + spb[2] + spsw4[2]) + spsw4[2];
1043 pMC->Gspos("DV13", 1, "DM13", xc, yc, zc, 0, "ONLY");
1044 // --- Then iron support plate
1045 zc = zc + sfe[2] + spsw4[2];
1046 pMC->Gspos("DPFE", 1, "DM13", xc, yc, zc, 0, "ONLY");
1047 // --- Then lead converter plate
1048 zc = zc + sfe[2] + spb[2];
1049 pMC->Gspos("DPPB", 1, "DM13", xc, yc, zc, 0, "ONLY");
1050 // --- Lastly the preshower box
1051 zc = zc + spb[2] + spsw4[2];
1052 pMC->Gspos("DW13", 1, "DM13", xc, yc, zc, 0, "ONLY");
1056 //_____________________________________________________________________________
1057 void AliPMDv1::DrawModule()
1060 // Draw a shaded view of the Photon Multiplicity Detector
1063 AliMC* pMC = AliMC::GetMC();
1065 pMC->Gsatt("*", "seen", -1);
1066 pMC->Gsatt("alic", "seen", 0);
1068 // Set the visibility of the components
1070 pMC->Gsatt("DP21","seen",0);
1071 pMC->Gsatt("DP22","seen",0);
1072 pMC->Gsatt("DS21","seen",1);
1073 pMC->Gsatt("DS22","seen",1);
1074 pMC->Gsatt("DW21","seen",0);
1075 pMC->Gsatt("DV21","seen",0);
1076 pMC->Gsatt("DP11","seen",0);
1077 pMC->Gsatt("DP12","seen",0);
1078 pMC->Gsatt("DS11","seen",1);
1079 pMC->Gsatt("DS12","seen",1);
1080 pMC->Gsatt("DW11","seen",0);
1081 pMC->Gsatt("DV11","seen",0);
1082 pMC->Gsatt("DP13","seen",0);
1083 pMC->Gsatt("DP14","seen",0);
1084 pMC->Gsatt("DS13","seen",1);
1085 pMC->Gsatt("DS14","seen",1);
1086 pMC->Gsatt("DW12","seen",0);
1087 pMC->Gsatt("DV12","seen",0);
1088 pMC->Gsatt("DP15","seen",0);
1089 pMC->Gsatt("DP16","seen",0);
1090 pMC->Gsatt("DS15","seen",1);
1091 pMC->Gsatt("DS16","seen",1);
1092 pMC->Gsatt("DW13","seen",0);
1093 pMC->Gsatt("DV13","seen",0);
1094 pMC->Gsatt("DPPB","seen",1);
1095 pMC->Gsatt("DPW ","seen",1);
1096 pMC->Gsatt("DPFE","seen",1);
1097 pMC->Gsatt("DM21","seen",1);
1098 pMC->Gsatt("DM11","seen",1);
1099 pMC->Gsatt("DM12","seen",1);
1100 pMC->Gsatt("DM13","seen",1);
1101 pMC->Gsatt("DPMD","seen",0);
1102 pMC->Gsatt("DIQU","seen",0);
1104 pMC->Gdopt("hide", "on");
1105 pMC->Gdopt("shad", "on");
1106 pMC->Gsatt("*", "fill", 7);
1107 pMC->SetClipBox(".");
1108 pMC->SetClipBox("*", 0, 3000, -3000, 3000, -6000, 6000);
1109 pMC->DefaultRange();
1110 pMC->Gdraw("alic", 40, 30, 0, 22, 15.5, .04, .04);
1111 pMC->Gdhead(1111, "Photon Multiplicity Detector Version 1");
1112 pMC->Gdman(17, 5, "MAN");
1113 pMC->Gdopt("hide", "off");
1116 //_____________________________________________________________________________
1117 void AliPMDv1::CreateMaterials()
1120 // Create materials for the PMD version 1
1122 // ORIGIN : Y. P. VIYOGI
1125 AliMC* pMC = AliMC::GetMC();
1127 // --- The Argon- CO2 mixture ---
1128 Float_t ag[2] = { 39.95 };
1129 Float_t zg[2] = { 18. };
1130 Float_t wg[2] = { .8,.2 };
1131 Float_t dar = .001782; // --- Ar density in g/cm3 ---
1133 Float_t ac[2] = { 12.,16. };
1134 Float_t zc[2] = { 6.,8. };
1135 Float_t wc[2] = { 1.,2. };
1136 Float_t dc = .001977;
1137 Float_t dco = .002; // --- CO2 density in g/cm3 ---
1139 Float_t absl, radl, a, d, z;
1145 Int_t *idtmed = gAlice->Idtmed();
1146 Int_t isxfld = gAlice->Field()->Integ();
1147 Float_t sxmgmx = gAlice->Field()->Max();
1149 // --- Define the various materials for GEANT ---
1150 AliMaterial(1, "Pb $", 207.19, 82., 11.35, .56, 18.5);
1152 AliMaterial(2, "Argon$", 39.95, 18., dar, x0ar, 6.5e4);
1153 AliMixture(3, "CO2 $", ac, zc, dc, -2, wc);
1154 AliMaterial(4, "Al $", 26.98, 13., 2.7, 8.9, 18.5);
1155 AliMaterial(6, "Fe $", 55.85, 26., 7.87, 1.76, 18.5);
1156 AliMaterial(7, "W $", 183.85, 74., 19.3, .35, 10.3);
1157 AliMaterial(8, "G10 $", 20., 10., 1.7, 19.4, 999);
1158 AliMaterial(9, "SILIC$", 28.09, 14., 2.33, 9.36, 45.);
1159 AliMaterial(10, "Be $", 9.01, 4., 1.848, 35.3, 36.7);
1160 AliMaterial(15, "Cu $", 63.54, 29., 8.96, 1.43, 15.);
1161 AliMaterial(16, "C $", 12.01, 6., 2.265, 18.8, 49.9);
1163 AliMaterial(96, "MYLAR$", 8.73, 4.55, 1.39, 28.7, 62.);
1164 AliMaterial(97, "CONCR$", 20., 10., 2.5, 10.7, 40.);
1165 AliMaterial(98, "Vacum$", 1e-9, 1e-9, 1e-9, 1e16, 1e16);
1166 AliMaterial(99, "Air $", 14.61, 7.3, .0012, 30420., 67500.);
1168 // define gas-mixtures
1171 pMC->Gfmate((*fIdmate)[3], namate, a, z, d, radl, absl, buf, nbuf);
1174 dg = (dar * 4 + dco) / 5;
1175 AliMixture(5, "ArCO2$", ag, zg, dg, 2, wg);
1177 // Define tracking media
1178 AliMedium(601, "Pb conv.$", 1, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
1179 AliMedium(607, "W conv.$", 7, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
1180 AliMedium(608, "G10plate$", 8, 0, 0, isxfld, sxmgmx, 1., .1, .01, .1);
1181 AliMedium(604, "Al $", 4, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1182 AliMedium(606, "Fe $", 6, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1183 AliMedium(605, "ArCO2 $", 5, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
1184 AliMedium(609, "SILICON $", 9, 1, 0, isxfld, sxmgmx, .1, .1, .1, .1);
1185 AliMedium(610, "Be $", 10, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1186 AliMedium(698, "Vacuum $", 98, 0, 0, isxfld, sxmgmx, 1., .1, .1, 10);
1187 AliMedium(699, "Air gaps$", 99, 0, 0, isxfld, sxmgmx, 1., .1, .1, .1);
1188 AliMedium(615, "Cu $", 15, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1189 AliMedium(616, "C $", 16, 0, 0, isxfld, sxmgmx, .1, .1, .01, .1);
1191 // --- Generate explicitly delta rays in the iron, aluminium and lead ---
1192 pMC->Gstpar(idtmed[600], "LOSS", 3.);
1193 pMC->Gstpar(idtmed[600], "DRAY", 1.);
1195 pMC->Gstpar(idtmed[603], "LOSS", 3.);
1196 pMC->Gstpar(idtmed[603], "DRAY", 1.);
1198 pMC->Gstpar(idtmed[604], "LOSS", 3.);
1199 pMC->Gstpar(idtmed[604], "DRAY", 1.);
1201 pMC->Gstpar(idtmed[605], "LOSS", 3.);
1202 pMC->Gstpar(idtmed[605], "DRAY", 1.);
1204 pMC->Gstpar(idtmed[606], "LOSS", 3.);
1205 pMC->Gstpar(idtmed[606], "DRAY", 1.);
1207 pMC->Gstpar(idtmed[607], "LOSS", 3.);
1208 pMC->Gstpar(idtmed[607], "DRAY", 1.);
1210 // --- Energy cut-offs in the Pb and Al to gain time in tracking ---
1211 // --- without affecting the hit patterns ---
1212 pMC->Gstpar(idtmed[600], "CUTGAM", 1e-4);
1213 pMC->Gstpar(idtmed[600], "CUTELE", 1e-4);
1214 pMC->Gstpar(idtmed[600], "CUTNEU", 1e-4);
1215 pMC->Gstpar(idtmed[600], "CUTHAD", 1e-4);
1216 pMC->Gstpar(idtmed[605], "CUTGAM", 1e-4);
1217 pMC->Gstpar(idtmed[605], "CUTELE", 1e-4);
1218 pMC->Gstpar(idtmed[605], "CUTNEU", 1e-4);
1219 pMC->Gstpar(idtmed[605], "CUTHAD", 1e-4);
1220 pMC->Gstpar(idtmed[606], "CUTGAM", 1e-4);
1221 pMC->Gstpar(idtmed[606], "CUTELE", 1e-4);
1222 pMC->Gstpar(idtmed[606], "CUTNEU", 1e-4);
1223 pMC->Gstpar(idtmed[606], "CUTHAD", 1e-4);
1224 pMC->Gstpar(idtmed[603], "CUTGAM", 1e-4);
1225 pMC->Gstpar(idtmed[603], "CUTELE", 1e-4);
1226 pMC->Gstpar(idtmed[603], "CUTNEU", 1e-4);
1227 pMC->Gstpar(idtmed[603], "CUTHAD", 1e-4);
1228 pMC->Gstpar(idtmed[609], "CUTGAM", 1e-4);
1229 pMC->Gstpar(idtmed[609], "CUTELE", 1e-4);
1230 pMC->Gstpar(idtmed[609], "CUTNEU", 1e-4);
1231 pMC->Gstpar(idtmed[609], "CUTHAD", 1e-4);
1233 // --- Prevent particles stopping in the gas due to energy cut-off ---
1234 pMC->Gstpar(idtmed[604], "CUTGAM", 1e-5);
1235 pMC->Gstpar(idtmed[604], "CUTELE", 1e-5);
1236 pMC->Gstpar(idtmed[604], "CUTNEU", 1e-5);
1237 pMC->Gstpar(idtmed[604], "CUTHAD", 1e-5);
1238 pMC->Gstpar(idtmed[604], "CUTMUO", 1e-5);
1241 //_____________________________________________________________________________
1242 void AliPMDv1::Init()
1245 // Initialises PMD detector after it has been built
1251 for(i=0;i<35;i++) printf("*");
1252 printf(" PMD_INIT ");
1253 for(i=0;i<35;i++) printf("*");
1255 printf(" PMD simulation package initialised\n");
1256 printf(" parameters of pmd\n");
1257 printf("%6d %10.2f %10.2f %10.2f %10.2f %10.2f\n",kdet,thmin,thmax,zdist,thlow,thhigh);
1259 for(i=0;i<80;i++) printf("*");
1262 Int_t *idtmed = gAlice->Idtmed();
1263 fMedSens=idtmed[605-1];
1266 //_____________________________________________________________________________
1267 void AliPMDv1::StepManager()
1270 // Called at each step in the PMD
1273 Float_t hits[4], destep;
1274 Float_t center[3] = {0,0,0};
1277 AliMC* pMC=AliMC::GetMC();
1278 if(pMC->GetMedium() == fMedSens && (destep = pMC->Edep())) {
1280 // THIS PART MUST BE CHECKED
1281 pMC->CurrentVol(0, copy);
1283 pMC->CurrentVolOff(1,0,copy);
1285 pMC->CurrentVolOff(2,0,copy);
1287 pMC->CurrentVolOff(1,0,copy);
1289 pMC->Gdtom(center,hits,1);
1290 hits[3] = destep*1e9; //Number in eV
1291 AddHit(gAlice->CurrentTrack(), vol, hits);
1297 //_____________________________________________________________________________
1298 AliPMDhit::AliPMDhit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits):
1299 AliHit(shunt, track)
1305 for (i=0;i<4;i++) fVolume[i] = vol[i];