WCSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WCSimConstructEggShapedHyperK.cc
Go to the documentation of this file.
1 // -*- mode:c++; tab-width:4; -*-
3 
4 #include "G4SystemOfUnits.hh"
5 #include "G4ThreeVector.hh"
6 #include "G4RotationMatrix.hh"
7 #include "G4Transform3D.hh"
8 
9 #include "G4Material.hh"
10 #include "G4NistManager.hh"
11 
12 #include "G4Box.hh"
13 #include "G4Trap.hh"
14 #include "G4Tubs.hh"
15 #include "G4Sphere.hh"
16 
17 #include "G4UnionSolid.hh"
18 #include "G4SubtractionSolid.hh"
19 
20 #include "G4LogicalVolume.hh"
21 #include "G4PVPlacement.hh"
22 #include "G4PVReplica.hh"
23 
24 #include "G4LogicalSkinSurface.hh"
25 
26 #include "G4VisAttributes.hh"
27 
28 #include "G4SDManager.hh"
29 #include "WCSimWCSD.hh"
30 
31 
32 /***********************************************************
33  *
34  * This file contains the functions which construct an
35  * egg-shaped HyperK detector. It used by the HK detector
36  * configuration modes. It is called in the Construct()
37  * method in WCSimDetectorConstruction.cc.
38  *
39  * Sourcefile for the WCSimDetectorConstruction class
40  *
41  ***********************************************************/
42 
43 
45 {
46  G4cout << "**** Construct egg-shaped HyperK Detector ****" << G4endl;
47 
48  PMTCopyNo = 0;
49  wallSlabCopyNo = 0;
50 
51  // ------------- Volumes --------------
52 
53  checkOverlaps = true;
54 
55  // HyperK Volume
56 
57  G4LogicalVolume* eggShapedHyperKLV
58  = new G4LogicalVolume(new G4Box("EggShapedHyperKBox",
62  FindMaterial("G4_AIR"),
63  "EggShapedHyperK");
64  eggShapedHyperKLV->SetVisAttributes(G4VisAttributes::Invisible);
65 
66  new G4LogicalSkinSurface("WaterBSSurface",eggShapedHyperKLV,OpWaterBSSurface);
67 
68 // G4VPhysicalVolume* eggShapedHyperKPV
69 // = new G4PVPlacement(0,G4ThreeVector(),eggShapedHyperKLV,
70 // "EggShapedHyperK",0,false,0,checkOverlaps);
71 
72  // +/- Z Black Sheets
73 
74  G4LogicalVolume* blackSheetZLV
75  = new G4LogicalVolume(new G4Box("blackSheetZ",
79  FindMaterial("G4_POLYETHYLENE"),
80  "blackSheetZ");
81 // blackSheetZLV->SetVisAttributes(new G4VisAttributes(G4Colour(0,0.5,1.)));
82 
83  new G4LogicalSkinSurface("WaterBSSurface",blackSheetZLV,OpWaterBSSurface);
84 
85  G4double z = waterTank_Length/2.+blackSheetThickness/2.;
86 
87  new G4PVPlacement(0,G4ThreeVector(0,0, z),blackSheetZLV,
88  "blackSheetZ",eggShapedHyperKLV,false,0,checkOverlaps);
89  new G4PVPlacement(0,G4ThreeVector(0,0,-z),blackSheetZLV,
90  "blackSheetZ",eggShapedHyperKLV,false,1,checkOverlaps);
91 
92 // -----------------------------------------------------------------
93 // G4LogicalVolume* pmtLV = ConstructPMT(innerPMT_Radius,innerPMT_Expose);
94 // new G4PVPlacement(0,G4ThreeVector(0.,0.,innerPMT_Expose/2.),
95 // pmtLV,"PMT",eggShapedHyperKLV,false,0,checkOverlaps);
96 // return eggShapedHyperKLV;
97 // -----------------------------------------------------------------
98 
99  // The egg-shaped Water Tank
100 
101  G4VSolid* waterTank_top = ConstructHalf(waterTank_TopR,waterTank_UpperA);
102  G4VSolid* waterTank_bot = ConstructHalf(waterTank_BotR,waterTank_LowerB);
103 
104  G4RotationMatrix rotm = G4RotationMatrix();
105  rotm.rotateZ(180.*degree);
106 
107  G4VSolid* waterTank_union
108  = new G4UnionSolid("Union",waterTank_top,waterTank_bot,
109  G4Transform3D(rotm,
110  G4ThreeVector(0,-waterTank_Height/2.,0)));
111 
112  waterTankLV
113  = new G4LogicalVolume(waterTank_union,FindMaterial("G4_WATER"),"Tank");
114  waterTankLV->SetVisAttributes(G4VisAttributes::Invisible);
115 
116  new G4PVPlacement(0,G4ThreeVector(0,waterTank_Height/4.,0),
117  waterTankLV,"Tank",eggShapedHyperKLV,false,0,checkOverlaps);
118 
119  G4RotationMatrix* g4rot;
120  G4LogicalVolume* pmtCellLV;
121 
122  //Construct the PMTs
123 
124  G4LogicalVolume* logicWCPMT = ConstructPMT(WCPMTName, WCIDCollectionName);
125  G4LogicalVolume* logicWCPMT_OD = ConstructPMT(outerPMT_Name, WCODCollectionName);
126 
127  // Radial PMTs
128 
132 
133  g4rot = new G4RotationMatrix();
134  g4rot->rotateY(90.*deg);
135 
136  G4double ratio = innerPMT_Radius/innerPMT_TopR;
137  G4double r = innerPMT_TopR*std::sqrt(1.-ratio*ratio);
138  r -= innerPMT_Expose/2.;
139 
140  new G4PVPlacement(g4rot,
141  G4ThreeVector(r,0.,0.),
142  logicWCPMT,
143  "PMT",
144  pmtCellLV,
145  false,PMTCopyNo++,checkOverlaps);
146 
150 
152  r = innerPMT_BotR*std::sqrt(1.-ratio*ratio);
153  r -= innerPMT_Expose/2.;
154 
155  new G4PVPlacement(g4rot,
156  G4ThreeVector(r,0.,0.),
157  logicWCPMT,
158  "PMT",
159  pmtCellLV,
160  false,PMTCopyNo++,checkOverlaps);
161 
165 
166  g4rot = new G4RotationMatrix();
167  g4rot->rotateY(-90.*deg);
168 
169  G4double phi = outerPMT_TopRpitch/outerPMT_TopR/3;
170  G4double dphi = innerPMT_Radius/innerPMT_TopR;
171 
172  G4double angle = -phi + dphi;
173 
175  r = outerPMT_TopR*std::sqrt(1.-ratio*ratio);
176  // don't understand this reall....
177  r -= outerPMT_Expose;
178 
179  G4double x = r * std::cos(angle);
180  G4double y = r * std::sin(angle);
181 // G4double x = (outerPMT_TopR+outerPMT_Expose/2.) * std::cos(angle);
182 // G4double y = (outerPMT_TopR+outerPMT_Expose/2.) * std::sin(angle);
183  z = -outerPMT_Apitch/4.;
184 
185  new G4PVPlacement(g4rot, G4ThreeVector(x,y,z),
186  logicWCPMT_OD,
187  "PMT",
188  pmtCellLV,
189  false,PMTCopyNo++,checkOverlaps);
190 
191  angle = phi - dphi;
192 
193  x = r * std::cos(angle);
194  y = r * std::sin(angle);
195 // x = (outerPMT_TopR+outerPMT_Expose/2.) * std::cos(angle);
196 // y = (outerPMT_TopR+outerPMT_Expose/2.) * std::sin(angle);
197  z = outerPMT_Apitch/4.;
198 
199  new G4PVPlacement(g4rot, G4ThreeVector(x,y,z),
200  logicWCPMT_OD,
201  "PMT",
202  pmtCellLV,
203  false,PMTCopyNo++,checkOverlaps);
204 
208 
211 
212  angle = -phi + dphi;
213 
215  r = outerPMT_BotR*std::sqrt(1.-ratio*ratio);
216  // don't understand this reall....
217  r -= outerPMT_Expose;
218 
219  x = r * std::cos(angle);
220  y = r * std::sin(angle);
221 // x = (outerPMT_BotR+outerPMT_Expose/2.) * std::cos(angle);
222 // y = (outerPMT_BotR+outerPMT_Expose/2.) * std::sin(angle);
223  z = -outerPMT_Apitch/4.;
224 
225  new G4PVPlacement(g4rot, G4ThreeVector(x,y,z),
226  logicWCPMT_OD,
227  "PMT",
228  pmtCellLV,
229  false,PMTCopyNo++,checkOverlaps);
230 
231  angle = phi - dphi;
232 
233  x = r * std::cos(angle);
234  y = r * std::sin(angle);
235 // x = (outerPMT_BotR+outerPMT_Expose/2.) * std::cos(angle);
236 // y = (outerPMT_BotR+outerPMT_Expose/2.) * std::sin(angle);
237  z = outerPMT_Apitch/4.;
238 
239  new G4PVPlacement(g4rot, G4ThreeVector(x,y,z),
240  logicWCPMT_OD,
241  "PMT",
242  pmtCellLV,
243  false,PMTCopyNo++,checkOverlaps);
244 
245  // End Wall PMTs
246 
247  pmtCellLV = ConstructEndWallPMT();
248 
249  g4rot = new G4RotationMatrix();
250  g4rot->rotateY(180.*deg);
251 
252  new G4PVPlacement(g4rot, G4ThreeVector(0.,0.,-innerPMT_Expose/2.),
253  logicWCPMT,
254  "PMT",
255  pmtCellLV,
256  false,PMTCopyNo++,checkOverlaps);
257 
258  // Top and Bottom PMTs
259 
262 
263  g4rot = new G4RotationMatrix();
264  g4rot->rotateX(-90.*deg);
265 
266  new G4PVPlacement(g4rot, G4ThreeVector(0.,0.,0.),
267  logicWCPMT,
268  "PMT",
269  pmtCellLV,
270  false,PMTCopyNo++,checkOverlaps);
271 
274 
275  new G4PVPlacement(g4rot, G4ThreeVector(0.,0.,0.),
276  logicWCPMT,
277  "PMT",
278  pmtCellLV,
279  false,PMTCopyNo++,checkOverlaps);
280 
283 
284  g4rot = new G4RotationMatrix();
285  g4rot->rotateX(90.*deg);
286 
287  new G4PVPlacement(g4rot, G4ThreeVector(0.,0.,0.),
288  logicWCPMT_OD,
289  "PMT",
290  pmtCellLV,
291  false,PMTCopyNo++,checkOverlaps);
292 
295 
296  new G4PVPlacement(g4rot, G4ThreeVector(0.,0.,0.),
297  logicWCPMT_OD,
298  "PMT",
299  pmtCellLV,
300  false,PMTCopyNo++,checkOverlaps);
301 
302  //
303  // always return the physical HyperK volume
304  //
305  return eggShapedHyperKLV;
306 }
307 
308 G4VSolid* WCSimDetectorConstruction::ConstructHalf(G4double waterTank_Radius,
309  G4double waterTank_OffSet)
310 {
311  G4double sinPhi = (waterTank_Height/2.)/waterTank_Radius;
312  G4double cosPhi = std::sqrt(1.-sinPhi*sinPhi);
313 
314  G4double sinPhiHalf = std::sqrt((1.-cosPhi)/2.);
315  G4double cosPhiHalf = std::sqrt((1.+cosPhi)/2.);
316 
317  G4double phi = std::asin(sinPhi);
318 
319  G4Trap* waterTank_trap
320  = new G4Trap("TankTrap",
321  waterTank_Length/2.,0.,0.,
322  waterTank_Height/4.,
323  waterTank_Radius-waterTank_OffSet,
324  waterTank_Radius*cosPhi-waterTank_OffSet,
325  0,
326  waterTank_Height/4.,
327  waterTank_Radius-waterTank_OffSet,
328  waterTank_Radius*cosPhi-waterTank_OffSet,
329  0);
330 
331  const G4double epsilon = 1*mm;
332  G4VSolid* waterTank_slice
333  = new G4SubtractionSolid("TankSlice",
334  new G4Tubs("WaterTubs",
335  0.,waterTank_Radius,
336  waterTank_Length/2.,
337  -phi/2.,phi),
338  new G4Box("WaterBox",
339  waterTank_Radius*cosPhiHalf,
340  waterTank_Radius*sinPhiHalf,
341  waterTank_Length/2.+epsilon));
342 
343  G4RotationMatrix rotm = G4RotationMatrix();
344  rotm.rotateZ(phi/2.);
345 
346  G4VSolid* waterTank_union1
347  = new G4UnionSolid("Union1",waterTank_trap,waterTank_slice,
348  G4Transform3D(rotm,G4ThreeVector(-waterTank_OffSet,
349  -waterTank_Height/4.,
350  0)));
351 
352  rotm = G4RotationMatrix();
353  rotm.rotateZ(phi/2.);
354  rotm.rotateY(180.*degree);
355 
356  G4VSolid* waterTank_union2
357  = new G4UnionSolid("Union2",waterTank_union1,waterTank_slice,
358  G4Transform3D(rotm,G4ThreeVector(waterTank_OffSet,
359  -waterTank_Height/4.,
360  0)));
361  return waterTank_union2;
362 }
363 
364 
366  G4double radius,
367  G4double height,
368  G4double offset,
369  G4double expose,
370  G4double pitchR,
371  G4double pitchZ)
372 {
373  G4bool inner = false;
374  if (height == innerPMT_Height) inner = true;
375 
376  G4double sinPhi = height/radius;
377 
378  G4double phi = std::asin(sinPhi);
379  G4int nphi = (G4int)(radius*phi/pitchR);
380 
381  if(radius == innerPMT_TopR){
382  nphi = nphi + 1;
383  innerPMT_TopN = nphi;
384  }
385  if(radius == innerPMT_BotR){
386  innerPMT_BotN = nphi;
387  }
388  if(radius == outerPMT_TopR){
389  nphi = innerPMT_TopN/3;
390  }
391  if(radius == outerPMT_BotR){
392  nphi = innerPMT_BotN/3;
393  }
394 
395  phi = nphi * pitchR/radius;
396 
397  G4double dphi = pitchR/radius;
398 
399  G4double length = waterTank_Length;
400  G4int nz = (G4int)(length/pitchZ);
401  length = nz * pitchZ;
402 
403  G4LogicalVolume* pmtAnnulusLV
404  = new G4LogicalVolume(new G4Tubs("PMTAnnulus",
405  radius-2.*expose,radius,
406  length/2.,
407  -phi/2.,phi),
408  FindMaterial("G4_WATER"),
409  "PMTAnnulus");
410  pmtAnnulusLV->SetVisAttributes(G4VisAttributes::Invisible);
411 
412  G4LogicalVolume* blackSheetALV = NULL;
413  if (inner) {
414  blackSheetALV =
415  new G4LogicalVolume(new G4Tubs("blackSheetA",
416  radius,radius+blackSheetThickness,
417  length/2.,
418  -phi/2.,phi),
419  FindMaterial("G4_POLYETHYLENE"),
420  "blackSheetA");
421 // blackSheetALV->SetVisAttributes(new G4VisAttributes(G4Colour(0,0.5,1.)));
422  new G4LogicalSkinSurface("WaterBSSurface",blackSheetALV,OpWaterBSSurface);
423  }
424 
425  G4LogicalVolume* pmtRingLV
426  = new G4LogicalVolume(new G4Tubs("PMTRing",
427  radius-2.*expose,radius,
428  pitchZ/2.,
429  -phi/2.,phi),
430  FindMaterial("G4_WATER"),
431  "PMTRings");
432  pmtRingLV->SetVisAttributes(G4VisAttributes::Invisible);
433 
434  G4LogicalVolume* pmtCellLV
435  = new G4LogicalVolume(new G4Tubs("PMTCell",
436  radius-2.*expose,radius,
437  pitchZ/2.,
438  -dphi/2.,dphi),
439  FindMaterial("G4_WATER"),
440  "PMTCell");
441  pmtCellLV->SetVisAttributes(G4VisAttributes::Invisible);
442 
443 //-----------------------------------------------------------------
444 //
445 // G4Tubs* cell_solid = new G4Tubs("Cell",
446 // radius-2.*expose,radius,
447 // pitchZ/2.,
448 // -dphi/2.,dphi);
449 // G4LogicalVolume* cellLV = new G4LogicalVolume(cell_solid,
450 // FindMaterial("G4_WATER"),
451 // "Cell");
452 // G4VisAttributes* red = new G4VisAttributes(G4Colour(255/255.,0/255.,0/255.));
453 // cellLV->SetVisAttributes(red);
454 // G4RotationMatrix* g4rot = new G4RotationMatrix();
455 // G4double angle = -phi/2.+dphi/2.;
456 // g4rot->rotateZ(angle);
457 // *g4rot = g4rot->inverse();
458 // for (G4int i=0; i<nz; i++) {
459 // G4int i=0;
460 // G4double z = -length/2. + pitchZ/2. + i * pitchZ;
461 // new G4PVPlacement(g4rot,G4ThreeVector(0,0,z),cellLV,"Cell",pmtAnnulusLV,
462 // false,i,checkOverlaps);
463 // }
464 //
465 //-----------------------------------------------------------------
466 
467  G4VPhysicalVolume* pmtRingPV
468  = new G4PVReplica("PMTRing",
469  pmtRingLV,
470  pmtAnnulusLV,
471  kZAxis,
472  nz,
473  pitchZ);
474 
475  new G4PVReplica("PMTCell",
476  pmtCellLV,
477  pmtRingPV,
478  kPhi,
479  nphi,
480  dphi,
481  -phi/2.);
482 
483  G4RotationMatrix* rotm = new G4RotationMatrix();
484  rotm->rotateZ(-phi/2.);
485  if(!top)rotm->rotateZ(180.*degree);
486 
487  G4int t = 1;
488  if(!top)t = -1;
489 
490  new G4PVPlacement(rotm,G4ThreeVector(-t*offset,-waterTank_Height/4.,0),
491  pmtAnnulusLV,"PMTAnnulus",waterTankLV,false,0,checkOverlaps);
492  if (inner)
493  new G4PVPlacement(rotm,G4ThreeVector(-t*offset,-waterTank_Height/4.,0),
494  blackSheetALV,"blackSheetA",waterTankLV,false,0,checkOverlaps);
495 
496  rotm = new G4RotationMatrix();
497  rotm->rotateZ(phi/2.);
498  if(!top)rotm->rotateZ(180.*degree);
499  rotm->rotateY(180.*degree);
500 
501  new G4PVPlacement(rotm,G4ThreeVector( t* offset,-waterTank_Height/4.,0),
502  pmtAnnulusLV,"PMTAnnulus",waterTankLV,false,1,checkOverlaps);
503  if (inner)
504  new G4PVPlacement(rotm,G4ThreeVector( t* offset,-waterTank_Height/4.,0),
505  blackSheetALV,"blackSheetA",waterTankLV,false,1,checkOverlaps);
506 
507 // return cellLV;
508  return pmtCellLV;
509 }
510 
512 {
513  G4LogicalVolume* pmtCellLV
514  = new G4LogicalVolume(new G4Box("PMTCell",
515  innerPMT_Apitch/2.,
516  innerPMT_Apitch/2.,
517  innerPMT_Apitch/2.),
518  FindMaterial("G4_WATER"),
519  "PMTCell");
520  pmtCellLV->SetVisAttributes(G4VisAttributes::Invisible);
521 
522  G4RotationMatrix* rotm = new G4RotationMatrix();
523  rotm->rotateY(180.*degree);
524 
525  G4int i = 0;
526  G4double x = innerPMT_Apitch/2.;
527  G4ThreeVector xv = G4ThreeVector(x,0.,0.);
528 
529  while (x < innerPMT_TopR - waterTank_UpperA)
530 
531  {
532  G4int j = 0;
533  G4double y = innerPMT_Apitch/2.;
534  G4ThreeVector ov = G4ThreeVector(waterTank_UpperA,0.,0.);
535  G4ThreeVector yv = G4ThreeVector(0.,y,0.);
536 
537 // while (y < innerPMT_Height - innerPMT_Radius)
538  while (y < innerPMT_Height - 2*innerPMT_Expose)
539  {
540  G4ThreeVector dv = ov + xv + yv;
541 // if (dv.mag() > innerPMT_TopR - innerPMT_Radius) break;
542  if (dv.mag() > innerPMT_TopR - 2*innerPMT_Expose) break;
543  j++;
544  y+=innerPMT_Apitch;
545  yv = G4ThreeVector(0.,y,0.);
546  }
547  G4int ny = j;
548  j--;
549  y-=innerPMT_Apitch;
550 
551  G4double yt = y;
552 
553  j = 0;
554  y = innerPMT_Apitch/2.;
555  ov = G4ThreeVector(waterTank_LowerB,0.,0.);
556  yv = G4ThreeVector(0.,y,0.);
557 
558 // while (y < innerPMT_Height - innerPMT_Radius)
559  while (y < innerPMT_Height - 2*innerPMT_Expose)
560  {
561  G4ThreeVector dv = ov + xv + yv;
562 // if (dv.mag() > innerPMT_BotR - innerPMT_Radius) break;
563  if (dv.mag() > innerPMT_BotR - 2*innerPMT_Expose) break;
564  j++;
565  y+=innerPMT_Apitch;
566  yv = G4ThreeVector(0.,y,0.);
567  }
568  j--;
569  ny += j;
570  y-=innerPMT_Apitch;
571 
572  G4double yb = y;
573 
574  G4LogicalVolume* pmtSlabLV
575  = new G4LogicalVolume(new G4Box("PMTSlab",
576  innerPMT_Apitch/2.,
577  (yt+yb)/2.,
578  innerPMT_Apitch/2.),
579  FindMaterial("G4_WATER"),
580  "PMTSlab");
581  pmtSlabLV->SetVisAttributes(G4VisAttributes::Invisible);
582 
583  new G4PVReplica("PMTCell",
584  pmtCellLV,
585  pmtSlabLV,
586  kYAxis,
587  ny,
589 
590  G4double xpos = x-innerPMT_Apitch/2.;
591  G4double ypos = (yt-yb)/2. - waterTank_Height/4. ;
592  G4double zpos = waterTank_Length/2.-innerPMT_Apitch/2.;
593 
594  new G4PVPlacement(0, G4ThreeVector(xpos,ypos, zpos),
595  pmtSlabLV,"PMTSlab",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
596  new G4PVPlacement(rotm,G4ThreeVector(xpos,ypos,-zpos),
597  pmtSlabLV,"PMTSlab",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
598  if ( i > 0 ) {
599  xpos = -xpos;
600  new G4PVPlacement(0, G4ThreeVector(xpos,ypos, zpos),
601  pmtSlabLV,"PMTSlab",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
602  new G4PVPlacement(rotm,G4ThreeVector(xpos,ypos,-zpos),
603  pmtSlabLV,"PMTSlab",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
604  }
605 
606  i++;
607  x+=innerPMT_Apitch;
608  xv = G4ThreeVector(x,0.,0.);
609 
610  }
611 
612  return pmtCellLV;
613 }
614 
616  G4double width,
617  G4double height,
618  G4double pitch,
619  G4double size)
620 {
621  G4bool inner = false;
622  if (height == innerPMT_Height) inner = true;
623 
624  G4int nx = (G4int)(2.*width/pitch);
625 
626  // ***** to fix the overlap with annulus *****
627  nx = nx - 1;
628 
629  G4double xlength = nx * pitch;
630  G4int nz = (G4int)(waterTank_Length/pitch);
631  G4double zlength = nz * pitch;
632 
633  G4LogicalVolume* pmtSlabLV
634  = new G4LogicalVolume(new G4Box("PMTSlab",
635  xlength/2.,
636  size/2.,
637  zlength/2.),
638  FindMaterial("G4_WATER"),
639  "PMTSlab");
640  pmtSlabLV->SetVisAttributes(G4VisAttributes::Invisible);
641 
642  G4LogicalVolume* blackSheetYLV = NULL;
643  if (inner) {
644  blackSheetYLV =
645  new G4LogicalVolume(new G4Box("blackSheetY",
646  xlength/2.,
648  zlength/2.),
649  FindMaterial("G4_POLYETHYLENE"),
650  "blackSheetY");
651 // blackSheetYLV->SetVisAttributes(new G4VisAttributes(G4Colour(0,0.5,1.)));
652  new G4LogicalSkinSurface("WaterBSSurface",blackSheetYLV,OpWaterBSSurface);
653  }
654 
655  G4LogicalVolume* pmtSliceLV
656  = new G4LogicalVolume(new G4Box("PMTSlice",
657  xlength/2.,
658  size/2.,
659  pitch/2.),
660  FindMaterial("G4_WATER"),
661  "PMTSlab");
662  pmtSliceLV->SetVisAttributes(G4VisAttributes::Invisible);
663 
664  G4LogicalVolume* pmtCellLV
665  = new G4LogicalVolume(new G4Box("PMTCell",
666  pitch/2.,
667  size/2.,
668  pitch/2.),
669  FindMaterial("G4_WATER"),
670  "PMTCell");
671  pmtCellLV->SetVisAttributes(G4VisAttributes::Invisible);
672 
673  G4VPhysicalVolume* pmtSlicePV
674  = new G4PVReplica("PMTSlice",
675  pmtSliceLV,
676  pmtSlabLV,
677  kZAxis,
678  nz,
679  pitch);
680 
681  new G4PVReplica("PMTCell",
682  pmtCellLV,
683  pmtSlicePV,
684  kXAxis,
685  nx,
686  pitch);
687 
688  G4double xpos = 0.0*mm;
689  G4double ypos = (height-size/2.) - waterTank_Height/4.;
690  G4double zpos = 0.0*mm;
691 
692  if (top) {
693  new G4PVPlacement(0,G4ThreeVector(xpos,ypos,zpos),
694  pmtSlabLV,"PMTSlab",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
695  ypos += size/2. + blackSheetThickness/2.;
696  if (inner) new G4PVPlacement(0,G4ThreeVector(xpos,ypos,zpos),
697  blackSheetYLV,"blackSheet",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
698  } else {
699  ypos = (-height+size/2.) - waterTank_Height/4.;
700  G4RotationMatrix* rotm = new G4RotationMatrix();
701  rotm->rotateZ(180.*degree);
702  new G4PVPlacement(rotm,G4ThreeVector(xpos,ypos,zpos),
703  pmtSlabLV,"PMTSlab",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
704  ypos -= size/2. + blackSheetThickness/2.;
705  if (inner) new G4PVPlacement(0,G4ThreeVector(xpos,ypos,zpos),
706  blackSheetYLV,"blackSheet",waterTankLV,false,wallSlabCopyNo++,checkOverlaps);
707 
708  }
709 
710  return pmtCellLV;
711 }
712 
716 G4Material* WCSimDetectorConstruction::FindMaterial(G4String name)
717 {
718  if (name == "G4_AIR") return FindMaterial("Air");
719  if (name == "G4_WATER") return FindMaterial("Water");
720  if (name == "G4_POLYETHYLENE") return FindMaterial("Blacksheet");
721  G4Material* material = G4Material::GetMaterial(name,true);
722  return material;
723 }
G4LogicalVolume * ConstructPMT(G4String, G4String, G4String detectorElement="tank")
G4VSolid * ConstructHalf(G4double, G4double)
G4LogicalVolume * ConstructRadialPMT(G4bool, G4double, G4double, G4double, G4double, G4double, G4double)
G4LogicalVolume * ConstructCeilingPMT(G4bool, G4double, G4double, G4double, G4double)