4 #include "G4Material.hh"
5 #include "G4Element.hh"
8 #include "G4UnionSolid.hh"
11 #include "G4IntersectionSolid.hh"
12 #include "G4Polyhedra.hh"
13 #include "G4LogicalVolume.hh"
14 #include "G4ThreeVector.hh"
15 #include "G4RotationMatrix.hh"
16 #include "G4PVReplica.hh"
17 #include "G4PVPlacement.hh"
18 #include "G4PVParameterised.hh"
19 #include "G4AssemblyVolume.hh"
20 #include "G4SubtractionSolid.hh"
22 #include "G4VisAttributes.hh"
23 #include "G4LogicalBorderSurface.hh"
24 #include "G4LogicalSkinSurface.hh"
25 #include "G4OpBoundaryProcess.hh"
26 #include "G4OpticalSurface.hh"
27 #include "G4UserLimits.hh"
28 #include "G4ReflectionFactory.hh"
29 #include "G4GeometryTolerance.hh"
30 #include "G4GeometryManager.hh"
34 #include "G4SystemOfUnits.hh"
35 #include "G4PhysicalConstants.hh"
52 G4Colour
white (1.0, 1.0, 1.0) ;
53 G4Colour
black (0.0, 0.0, 0.0) ;
54 G4Colour
red (1.0, 0.0, 0.0) ;
55 G4Colour
green (0.0, 1.0, 0.0) ;
56 G4Colour
blue (0.0, 0.0, 1.0) ;
57 G4Colour
cyan (0.0, 1.0, 1.0) ;
58 G4Colour
magenta (1.0, 0.0, 1.0) ;
59 G4Colour
yellow (1.0, 1.0, 0.0) ;
66 G4cout <<
"**** Building Cylindrical Detector ****" << G4endl;
104 G4cout <<
"Computed tolerance = "
105 << G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/mm
111 {
water =
"Doped Water";}
120 G4Tubs* solidWC =
new G4Tubs(
"WC",
127 G4LogicalVolume* logicWC =
128 new G4LogicalVolume(solidWC,
129 G4Material::GetMaterial(
"Air"),
134 G4VisAttributes* showColor =
new G4VisAttributes(G4Colour(0.0,1.0,0.0));
135 logicWC->SetVisAttributes(showColor);
137 logicWC->SetVisAttributes(G4VisAttributes::Invisible);
142 G4Tubs* solidWCBarrel =
new G4Tubs(
"WCBarrel",
149 G4LogicalVolume* logicWCBarrel =
150 new G4LogicalVolume(solidWCBarrel,
151 G4Material::GetMaterial(
water),
155 G4VPhysicalVolume* physiWCBarrel =
157 G4ThreeVector(0.,0.,0.),
169 G4Tubs *solidCaveTyvek =
new G4Tubs(
"WC",
176 G4LogicalVolume *logicCaveTyvek =
177 new G4LogicalVolume(solidCaveTyvek,
178 G4Material::GetMaterial(
"Tyvek"),
182 G4VPhysicalVolume *physiCaveTyvek =
184 G4ThreeVector(0., 0., 0.),
191 G4LogicalSkinSurface *TyvekCaveBarrelSurface =
new G4LogicalSkinSurface(
"TyvekCaveBarrelSurface", logicCaveTyvek,
OpWaterTySurface);
193 G4VisAttributes *showTyvekCave =
new G4VisAttributes(
green);
194 showTyvekCave->SetForceWireframe(
true);
195 logicCaveTyvek->SetVisAttributes(showTyvekCave);
202 G4Tubs *solidCaveCapsTyvek =
new G4Tubs(
"CaveCapsTyvek",
209 G4LogicalVolume *logicCaveCapsTyvek =
210 new G4LogicalVolume(solidCaveCapsTyvek,
211 G4Material::GetMaterial(
"Tyvek"),
215 G4LogicalSkinSurface *TyvekCaveTopSurface =
new G4LogicalSkinSurface(
"TyvekCaveTopSurface", logicCaveCapsTyvek,
OpWaterTySurface);
217 G4VisAttributes *CapsCaveTyvekVisAtt =
new G4VisAttributes(
yellow);
218 CapsCaveTyvekVisAtt->SetForceWireframe(
true);
219 logicCaveCapsTyvek->SetVisAttributes(CapsCaveTyvekVisAtt);
222 G4ThreeVector CaveTyvekPosition(0., 0.,
WCLength / 2);
224 G4VPhysicalVolume *physiTopCaveTyvek =
234 CaveTyvekPosition.setZ(-CaveTyvekPosition.getZ());
236 G4VPhysicalVolume *physiBottomCaveTyvek =
251 {logicWCBarrel->SetVisAttributes(G4VisAttributes::Invisible);}
255 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4VisAttributes::Invisible);
256 tmpVisAtt->SetForceWireframe(
true);
257 logicWCBarrel->SetVisAttributes(tmpVisAtt);
268 G4Polyhedra* solidWCBarrelAnnulus =
new G4Polyhedra(
"WCBarrelAnnulus",
277 G4LogicalVolume* logicWCBarrelAnnulus =
278 new G4LogicalVolume(solidWCBarrelAnnulus,
279 G4Material::GetMaterial(
water),
283 G4VPhysicalVolume* physiWCBarrelAnnulus =
285 G4ThreeVector(0.,0.,0.),
286 logicWCBarrelAnnulus,
292 logicWCBarrelAnnulus->SetVisAttributes(G4VisAttributes::Invisible);
299 G4Polyhedra* solidWCBarrelRing =
new G4Polyhedra(
"WCBarrelRing",
302 (G4int)WCBarrelRingNPhi,
308 G4LogicalVolume* logicWCBarrelRing =
309 new G4LogicalVolume(solidWCBarrelRing,
310 G4Material::GetMaterial(
water),
314 G4VPhysicalVolume* physiWCBarrelRing =
315 new G4PVReplica(
"WCBarrelRing",
317 logicWCBarrelAnnulus,
323 {G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(0,0.5,1.));
324 tmpVisAtt->SetForceWireframe(
true);
325 logicWCBarrelRing->SetVisAttributes(tmpVisAtt);
327 logicWCBarrelRing->SetVisAttributes(G4VisAttributes::Invisible);
330 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(0,0.5,1.));
331 tmpVisAtt->SetForceWireframe(
true);
332 logicWCBarrelRing->SetVisAttributes(tmpVisAtt);
340 G4Polyhedra* solidWCBarrelCell =
new G4Polyhedra(
"WCBarrelCell",
349 G4LogicalVolume* logicWCBarrelCell =
350 new G4LogicalVolume(solidWCBarrelCell,
351 G4Material::GetMaterial(
water),
355 G4VPhysicalVolume* physiWCBarrelCell =
356 new G4PVReplica(
"WCBarrelCell",
360 (G4int)WCBarrelRingNPhi,
365 {G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(1.,0.5,0.5));
366 tmpVisAtt->SetForceWireframe(
true);
367 logicWCBarrelCell->SetVisAttributes(tmpVisAtt);
369 logicWCBarrelCell->SetVisAttributes(G4VisAttributes::Invisible);
372 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(1.,0.5,0.5));
373 tmpVisAtt->SetForceWireframe(
true);
374 logicWCBarrelCell->SetVisAttributes(tmpVisAtt);
387 G4double annulusBlackSheetRmin[2] = {(
WCIDRadius),
390 G4Polyhedra* solidWCBarrelCellBlackSheet =
new G4Polyhedra(
"WCBarrelCellBlackSheet",
396 annulusBlackSheetRmin,
397 annulusBlackSheetRmax);
400 new G4LogicalVolume(solidWCBarrelCellBlackSheet,
401 G4Material::GetMaterial(
"Blacksheet"),
402 "WCBarrelCellBlackSheet",
405 G4VPhysicalVolume* physiWCBarrelCellBlackSheet =
407 G4ThreeVector(0.,0.,0.),
409 "WCBarrelCellBlackSheet",
414 G4LogicalBorderSurface * WaterBSBarrelCellSurface
415 =
new G4LogicalBorderSurface(
"WaterBSBarrelCellSurface",
417 physiWCBarrelCellBlackSheet,
425 G4VisAttributes* WCBarrelBlackSheetCellVisAtt
426 =
new G4VisAttributes(G4Colour(0.2,0.9,0.2));
427 WCBarrelBlackSheetCellVisAtt->SetForceSolid(
true);
428 WCBarrelBlackSheetCellVisAtt->SetForceAuxEdgeVisible(
true);
436 G4VisAttributes* WCBarrelBlackSheetCellVisAtt
437 =
new G4VisAttributes(G4Colour(0.2,0.9,0.2));
449 G4LogicalVolume* logicWCExtraTowerCell;
450 G4LogicalVolume* logicWCExtraBorderCell;
458 G4double extraTowerRmin[2];
459 G4double extraTowerRmax[2];
460 for(
int i = 0; i < 2 ; i++){
461 extraTowerRmin[i] = mainAnnulusRmin[i] != 0 ? mainAnnulusRmin[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.) : 0.;
462 extraTowerRmax[i] = mainAnnulusRmax[i] != 0 ? mainAnnulusRmax[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.) : 0.;
464 G4Polyhedra* solidWCExtraTower =
new G4Polyhedra(
"WCextraTower",
467 -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
478 G4LogicalVolume* logicWCExtraTower =
479 new G4LogicalVolume(solidWCExtraTower,
480 G4Material::GetMaterial(
water),
483 G4VPhysicalVolume* physiWCExtraTower =
485 G4ThreeVector(0.,0.,0.),
493 logicWCExtraTower->SetVisAttributes(G4VisAttributes::Invisible);
498 G4Polyhedra* solidWCExtraTowerCell =
new G4Polyhedra(
"WCExtraTowerCell",
500 2.*pi -
totalAngle -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
507 logicWCExtraTowerCell =
508 new G4LogicalVolume(solidWCExtraTowerCell,
509 G4Material::GetMaterial(
water),
512 G4VPhysicalVolume* physiWCTowerCell =
513 new G4PVReplica(
"extraTowerCell",
514 logicWCExtraTowerCell,
519 logicWCExtraTowerCell->SetVisAttributes(G4VisAttributes::Invisible);
525 G4double towerBSRmin[2];
526 G4double towerBSRmax[2];
527 for(
int i = 0; i < 2; i++){
528 towerBSRmin[i] = annulusBlackSheetRmin[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.);
529 towerBSRmax[i] = annulusBlackSheetRmax[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.);
531 G4Polyhedra* solidWCTowerBlackSheet =
new G4Polyhedra(
"WCExtraTowerBlackSheet",
533 2.*pi -
totalAngle -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
541 new G4LogicalVolume(solidWCTowerBlackSheet,
542 G4Material::GetMaterial(
"Blacksheet"),
543 "WCExtraTowerBlackSheet",
546 G4VPhysicalVolume* physiWCTowerBlackSheet =
548 G4ThreeVector(0.,0.,0.),
550 "WCExtraTowerBlackSheet",
551 logicWCExtraTowerCell,
555 G4LogicalBorderSurface * WaterBSTowerCellSurface
556 =
new G4LogicalBorderSurface(
"WaterBSBarrelCellSurface",
558 physiWCTowerBlackSheet,
565 G4VisAttributes* WCBarrelBlackSheetCellVisAtt
566 =
new G4VisAttributes(G4Colour(0.2,0.9,0.2));
575 G4VisAttributes* WCBarrelBlackSheetCellVisAtt
576 =
new G4VisAttributes(G4Colour(0.2,0.9,0.2));
577 WCBarrelBlackSheetCellVisAtt->SetForceSolid(
true);
578 WCBarrelBlackSheetCellVisAtt->SetForceAuxEdgeVisible(
true);
587 G4VisAttributes* WCBarrelBlackSheetCellVisAtt
588 =
new G4VisAttributes(G4Colour(0.2,0.9,0.2));
604 G4LogicalVolume* logicWCTopVeto;
608 G4double WCTyvekThickness = 1.0*mm;
610 G4VSolid* solidWCTopVeto;
612 new G4Tubs(
"WCTopVeto",
615 0.5*m + WCTyvekThickness,
620 new G4LogicalVolume(solidWCTopVeto,
621 G4Material::GetMaterial(
water),
625 G4VPhysicalVolume* physiWCTopVeto =
626 new G4PVPlacement( 0,
637 G4VSolid* solidWCTVTyvek;
639 new G4Tubs(
"WCTVTyvek",
647 G4LogicalVolume* logicWCTVTyvek =
648 new G4LogicalVolume(solidWCTVTyvek,
649 G4Material::GetMaterial(
"Tyvek"),
654 G4VPhysicalVolume* physiWCTVTyvekBot =
655 new G4PVPlacement( 0,
656 G4ThreeVector(0.,0.,-0.5*m
657 -WCTyvekThickness/2),
663 G4LogicalBorderSurface * WaterTyTVSurfaceBot =
664 new G4LogicalBorderSurface(
"WaterTyTVSurfaceBot",
670 G4VPhysicalVolume* physiWCTVTyvekTop =
671 new G4PVPlacement( 0,
672 G4ThreeVector(0.,0.,0.5*m
673 +WCTyvekThickness/2),
679 G4LogicalBorderSurface * WaterTyTVSurfaceTop =
680 new G4LogicalBorderSurface(
"WaterTyTVSurfaceTop",
686 G4VSolid* solidWCTVTyvekSide;
688 new G4Tubs(
"WCTVTyvekSide",
691 0.5*m + WCTyvekThickness,
696 G4LogicalVolume* logicWCTVTyvekSide =
697 new G4LogicalVolume(solidWCTVTyvekSide,
698 G4Material::GetMaterial(
"Tyvek"),
702 G4VPhysicalVolume* physiWCTVTyvekSide =
703 new G4PVPlacement( 0,
704 G4ThreeVector(0.,0.,0.),
710 G4LogicalBorderSurface * WaterTyTVSurfaceSide =
711 new G4LogicalBorderSurface(
"WaterTyTVSurfaceSide",
741 G4VisAttributes* WClogic
742 =
new G4VisAttributes(G4Colour(0.4,0.0,0.8));
743 WClogic->SetForceSolid(
true);
744 WClogic->SetForceAuxEdgeVisible(
true);
747 logicWCPMT->SetVisAttributes(G4VisAttributes::Invisible);
757 G4int TVNCell = WCTVEdgeLimit/WCTVPMTSpacing + 2;
761 for (
int i = -TVNCell ; i < TVNCell; i++) {
762 for (
int j = -TVNCell ; j < TVNCell; j++) {
764 G4double xoffset = i*WCTVPMTSpacing + WCTVPMTSpacing*0.5;
765 G4double yoffset = j*WCTVPMTSpacing + WCTVPMTSpacing*0.5;
767 G4ThreeVector cellpos =
768 G4ThreeVector( xoffset, yoffset, -0.5*m);
770 if ((sqrt(xoffset*xoffset + yoffset*yoffset) +
WCPMTRadius) < WCTVEdgeLimit) {
772 G4VPhysicalVolume* physiCapPMT =
773 new G4PVPlacement( 0,
787 G4cout <<
"Total on top veto: " << icopy <<
"\n";
788 G4cout <<
"Coverage was calculated to be: " << WCTVEfficiency <<
"\n";
798 G4RotationMatrix* WCPMTRotation =
new G4RotationMatrix;
799 WCPMTRotation->rotateY(90.*deg);
801 G4double barrelCellWidth = 2.*
WCIDRadius*tan(dPhi/2.);
807 G4ThreeVector PMTPosition = G4ThreeVector(
WCIDRadius,
808 -barrelCellWidth/2.+(i+0.5)*horizontalSpacing,
811 G4VPhysicalVolume* physiWCBarrelPMT =
812 new G4PVPlacement(WCPMTRotation,
818 (
int)(i*WCPMTperCellVertical+j),
833 G4RotationMatrix* WCPMTRotation =
new G4RotationMatrix;
834 WCPMTRotation->rotateY(90.*deg);
845 towerWidth/2.-(i+0.5)*horizontalSpacing,
850 G4VPhysicalVolume* physiWCBarrelPMT =
851 new G4PVPlacement(WCPMTRotation,
855 logicWCExtraTowerCell,
857 (
int)(i*WCPMTperCellVertical+j),
891 G4Tubs* solidWCODCapsTyvek =
new G4Tubs(
"WCODCapsTyvek",
898 G4LogicalVolume* logicWCODCapTyvek =
899 new G4LogicalVolume(solidWCODCapsTyvek,
900 G4Material::GetMaterial(
"Tyvek"),
904 G4LogicalSkinSurface *WaterTySurfaceTop =
new G4LogicalSkinSurface(
"WaterTySurfaceTop", logicWCODCapTyvek,
OpWaterTySurface);
906 G4VisAttributes* WCCapsODTyvekCellVisAtt
907 =
new G4VisAttributes(
yellow);
908 WCCapsODTyvekCellVisAtt->SetForceWireframe(
true);
910 logicWCODCapTyvek->SetVisAttributes(G4VisAttributes::Invisible);
916 G4VPhysicalVolume* physiWCODTopCapsTyvek =
926 CapTyvekPosition.setZ(-CapTyvekPosition.getZ());
928 G4VPhysicalVolume* physiWCODBottomCapsTyvek =
932 "WCODBottomCapsTyvek",
942 G4double annulusODTyvekRmax[2] = {(
WCODRadius),
947 G4Polyhedra* solidWCBarrelCellODTyvek =
new G4Polyhedra(
"WCBarrelCellODTyvek",
957 new G4LogicalVolume(solidWCBarrelCellODTyvek,
958 G4Material::GetMaterial(
"Tyvek"),
959 "WCBarrelCellODTyvek",
964 G4VisAttributes* WCBarrelODTyvekCellVisAtt
965 =
new G4VisAttributes(
yellow);
966 WCBarrelODTyvekCellVisAtt->SetForceWireframe(
true);
973 G4VPhysicalVolume* physiWCBarrelCellODTyvek =
975 G4ThreeVector(0.,0.,0.),
977 "WCBarrelCellODTyvek",
991 G4RotationMatrix* WCPMTODRotation =
new G4RotationMatrix;
992 WCPMTODRotation->rotateY(270.*deg);
994 G4double barrelODCellWidth = 2.*
WCODRadius*tan(dPhi/2.);
995 G4double barrelODCellHeight =
barrelCellHeight * (barrelODCellWidth/barrelCellWidth);
1000 G4double AreaRingOD = WCBarrelRingNPhi * barrelODCellWidth * barrelODCellHeight;
1003 G4double NPMTODByCell = round(NPMTODCovered/WCBarrelRingNPhi);
1007 G4cout <<
"AreaRingOD : " << AreaRingOD/m2 <<
" (m2)" << G4endl;
1008 G4cout <<
"AreaPMTOD : " << AreaPMTOD/m2 <<
" (m2)" << G4endl;
1009 G4cout <<
"--> NbPMTODCovered : " << NPMTODCovered << G4endl;
1010 G4cout <<
"--> NbPMTODByCell : " << NPMTODByCell << G4endl;
1025 G4ThreeVector PMTPosition = G4ThreeVector(
WCODRadius,
1026 -barrelODCellWidth/2.+(i+0.5)*horizontalODSpacing+((G4int)(std::pow(-1,j))*(G4int)(
WCODPMTShift)/2),
1027 -(
barrelCellHeight * (barrelODCellWidth/barrelCellWidth))/2.+(j+0.5)*verticalODSpacing);
1029 G4VPhysicalVolume* physiWCBarrelPMT =
1030 new G4PVPlacement(WCPMTODRotation,
1036 (
int)(i*WCPMTODperCellVertical+j),
1052 G4double towerODTyvekRmin[2];
1053 G4double towerODTyvekRmax[2];
1054 for(
int i = 0; i < 2; i++){
1055 towerODTyvekRmin[i] = annulusODTyvekRmin[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.);
1056 towerODTyvekRmax[i] = annulusODTyvekRmax[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.);
1058 G4Polyhedra* solidWCTowerODTyvek =
new G4Polyhedra(
"WCExtraTowerODTyvek",
1060 2.*pi -
totalAngle -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
1068 new G4LogicalVolume(solidWCTowerODTyvek,
1069 G4Material::GetMaterial(
"Tyvek"),
1070 "WCExtraTowerODTyvek",
1078 G4VPhysicalVolume* physiWCTowerODTyvek =
1079 new G4PVPlacement(0,
1080 G4ThreeVector(0.,0.,0.),
1082 "WCExtraTowerODTyvek",
1083 logicWCExtraTowerCell,
1089 G4RotationMatrix* WCPMTRotation =
new G4RotationMatrix;
1090 WCPMTRotation->rotateY(270.*deg);
1091 WCPMTRotation->rotateX((2*pi-
totalAngle)/2.);
1101 -towerWidthOD/2.+(i+0.5)*horizontalODSpacing,
1107 G4VPhysicalVolume* physiWCBarrelPMT =
1108 new G4PVPlacement(WCPMTRotation,
1112 logicWCExtraTowerCell,
1114 (
int)(i*WCPMTODperCellVertical+j),
1130 G4RotationMatrix* WCCapPMTRotation =
new G4RotationMatrix;
1131 WCCapPMTRotation->rotateY(180.*deg);
1135 for (
int i = -CapNCell ; i < CapNCell; i++) {
1136 for (
int j = -CapNCell ; j < CapNCell; j++) {
1141 G4ThreeVector topcellpos = G4ThreeVector(xoffset,
1145 G4ThreeVector bottomcellpos = G4ThreeVector(xoffset,
1147 -topcellpos.getZ());
1152 G4VPhysicalVolume* physiTopCapPMT =
1153 new G4PVPlacement(0,
1162 G4VPhysicalVolume* physiBottomCapPMT =
1163 new G4PVPlacement(WCCapPMTRotation,
1181 G4cout <<
"#### OD ####" <<
"\n";
1182 G4cout <<
" total on cap: " << icopy <<
"\n";
1184 G4cout <<
"############" <<
"\n";
1194 logicBottomCapAssembly->SetVisAttributes(G4VisAttributes::Invisible);
1195 logicTopCapAssembly->SetVisAttributes(G4VisAttributes::Invisible);}
1197 G4VPhysicalVolume* physiTopCapAssembly =
1198 new G4PVPlacement(0,
1200 logicTopCapAssembly,
1205 G4VPhysicalVolume* physiBottomCapAssembly =
1206 new G4PVPlacement(0,
1208 logicBottomCapAssembly,
1209 "BottomCapAssembly",
1222 G4Tubs* solidCapAssembly =
new G4Tubs(
"CapAssembly",
1229 G4LogicalVolume* logicCapAssembly =
1230 new G4LogicalVolume(solidCapAssembly,
1231 G4Material::GetMaterial(
water),
1235 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4VisAttributes::Invisible);
1236 tmpVisAtt->SetForceWireframe(
true);
1237 logicCapAssembly->SetVisAttributes(tmpVisAtt);
1248 G4Polyhedra* solidWCBarrelBorderRing =
new G4Polyhedra(
"WCBarrelBorderRing",
1251 (G4int)WCBarrelRingNPhi,
1256 G4LogicalVolume* logicWCBarrelBorderRing =
1257 new G4LogicalVolume(solidWCBarrelBorderRing,
1258 G4Material::GetMaterial(
water),
1263 G4VPhysicalVolume* physiWCBarrelBorderRing =
1264 new G4PVPlacement(0,
1266 logicWCBarrelBorderRing,
1267 "WCBarrelBorderRing",
1274 logicWCBarrelBorderRing->SetVisAttributes(G4VisAttributes::Invisible);
1278 G4Polyhedra* solidWCBarrelBorderCell =
new G4Polyhedra(
"WCBarrelBorderCell",
1287 G4LogicalVolume* logicWCBarrelBorderCell =
1288 new G4LogicalVolume(solidWCBarrelBorderCell,
1289 G4Material::GetMaterial(
water),
1290 "WCBarrelBorderCell",
1293 G4VPhysicalVolume* physiWCBarrelBorderCell =
1294 new G4PVReplica(
"WCBarrelBorderCell",
1295 logicWCBarrelBorderCell,
1296 logicWCBarrelBorderRing,
1298 (G4int)WCBarrelRingNPhi,
1308 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(1.,0.5,0.5));
1309 tmpVisAtt->SetForceSolid(
true);
1310 logicWCBarrelBorderCell->SetVisAttributes(tmpVisAtt);
1311 logicWCBarrelBorderCell->SetVisAttributes(G4VisAttributes::Invisible);}
1313 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(1.,0.5,0.5));
1314 tmpVisAtt->SetForceWireframe(
true);
1315 logicWCBarrelBorderCell->SetVisAttributes(tmpVisAtt);
1316 logicWCBarrelBorderCell->SetVisAttributes(G4VisAttributes::Invisible);}}
1322 {logicWCBarrelBorderCell->SetVisAttributes(G4VisAttributes::Invisible);}
1324 G4VisAttributes* tmpVisAtt =
new G4VisAttributes(G4Colour(1.,0.5,0.5));
1325 tmpVisAtt->SetForceWireframe(
true);
1326 logicWCBarrelBorderCell->SetVisAttributes(tmpVisAtt);}}
1336 G4VPhysicalVolume* physiWCBarrelBorderCellBlackSheet =
1337 new G4PVPlacement(0,
1338 G4ThreeVector(0.,0.,0.),
1340 "WCBarrelCellBlackSheet",
1341 logicWCBarrelBorderCell,
1345 G4LogicalBorderSurface * WaterBSBarrelBorderCellSurface
1346 =
new G4LogicalBorderSurface(
"WaterBSBarrelCellSurface",
1347 physiWCBarrelBorderCell,
1348 physiWCBarrelBorderCellBlackSheet,
1353 G4LogicalVolume* logicWCExtraTowerCell;
1354 G4LogicalVolume* logicWCExtraBorderCell;
1355 G4VPhysicalVolume* physiWCExtraBorderCell;
1363 G4double extraBorderRmin[3];
1364 G4double extraBorderRmax[3];
1365 for(
int i = 0; i < 3; i++){
1366 extraBorderRmin[i] = borderAnnulusRmin[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.);
1367 extraBorderRmax[i] = borderAnnulusRmax[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.);
1369 G4Polyhedra* solidWCExtraBorderCell =
new G4Polyhedra(
"WCspecialBarrelBorderCell",
1371 2.*pi -
totalAngle -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
1378 logicWCExtraBorderCell =
1379 new G4LogicalVolume(solidWCExtraBorderCell,
1380 G4Material::GetMaterial(
water),
1381 "WCspecialBarrelBorderCell",
1385 physiWCExtraBorderCell =
1386 new G4PVPlacement(0,
1388 logicWCExtraBorderCell,
1389 "WCExtraTowerBorderCell",
1393 logicWCExtraBorderCell->SetVisAttributes(G4VisAttributes::Invisible);
1395 G4VPhysicalVolume* physiWCExtraBorderBlackSheet =
1396 new G4PVPlacement(0,
1397 G4ThreeVector(0.,0.,0.),
1399 "WCExtraTowerBlackSheet",
1400 logicWCExtraBorderCell,
1404 G4LogicalBorderSurface * WaterBSExtraBorderCellSurface
1405 =
new G4LogicalBorderSurface(
"WaterBSBarrelCellSurface",
1406 physiWCExtraBorderCell,
1407 physiWCExtraBorderBlackSheet,
1419 G4double capRmin[4] = { 0. , 0., 0., 0.} ;
1421 G4VSolid* solidWCCap;
1424 =
new G4Polyhedra(
"WCCap",
1427 (
int)WCBarrelRingNPhi,
1437 G4Polyhedra* mainPart
1438 =
new G4Polyhedra(
"WCCapMainPart",
1441 (
int)WCBarrelRingNPhi,
1447 G4double extraCapRmin[4];
1448 G4double extraCapRmax[4];
1449 for(
int i = 0; i < 4 ; i++){
1450 extraCapRmin[i] = capRmin[i] != 0. ? capRmin[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.) : 0.;
1451 extraCapRmax[i] = capRmax[i] != 0. ? capRmax[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.) : 0.;
1453 G4Polyhedra* extraSlice
1454 =
new G4Polyhedra(
"WCCapExtraSlice",
1456 2.*pi -
totalAngle -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
1465 new G4UnionSolid(
"WCCap", mainPart, extraSlice);
1471 G4LogicalVolume* logicWCCap =
1472 new G4LogicalVolume(solidWCCap,
1473 G4Material::GetMaterial(
water),
1477 G4VPhysicalVolume* physiWCCap =
1478 new G4PVPlacement(0,
1490 G4VisAttributes* tmpVisAtt2 =
new G4VisAttributes(G4Colour(1,0.5,0.5));
1491 tmpVisAtt2->SetForceSolid(
true);
1492 logicWCCap->SetVisAttributes(tmpVisAtt2);
1493 logicWCCap->SetVisAttributes(G4VisAttributes::Invisible);
1497 G4VisAttributes* tmpVisAtt2 =
new G4VisAttributes(G4Colour(0.6,0.5,0.5));
1498 tmpVisAtt2->SetForceSolid(
true);
1499 logicWCCap->SetVisAttributes(tmpVisAtt2);}}
1504 logicWCCap->SetVisAttributes(G4VisAttributes::Invisible);
1506 {G4VisAttributes* tmpVisAtt2 =
new G4VisAttributes(G4Colour(.6,0.5,0.5));
1507 tmpVisAtt2->SetForceWireframe(
true);
1508 logicWCCap->SetVisAttributes(tmpVisAtt2);}}
1520 G4VSolid* solidWCCapBlackSheet;
1522 solidWCCapBlackSheet
1523 =
new G4Polyhedra(
"WCCapBlackSheet",
1535 G4Polyhedra* mainPart
1536 =
new G4Polyhedra(
"WCCapBlackSheetMainPart",
1545 G4double extraBSRmin[4];
1546 G4double extraBSRmax[4];
1547 for(
int i = 0; i < 4 ; i++){
1548 extraBSRmin[i] = capBlackSheetRmin[i] != 0. ? capBlackSheetRmin[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.) : 0.;
1549 extraBSRmax[i] = capBlackSheetRmax[i] != 0. ? capBlackSheetRmax[i]/cos(dPhi/2.)*cos((2.*pi-
totalAngle)/2.) : 0.;
1551 G4Polyhedra* extraSlice
1552 =
new G4Polyhedra(
"WCCapBlackSheetextraSlice",
1554 2.*pi -
totalAngle -G4GeometryTolerance::GetInstance()->GetSurfaceTolerance()/(10.*m),
1562 solidWCCapBlackSheet =
1563 new G4UnionSolid(
"WCCapBlackSheet", mainPart, extraSlice);
1565 G4LogicalVolume* logicWCCapBlackSheet =
1566 new G4LogicalVolume(solidWCCapBlackSheet,
1567 G4Material::GetMaterial(
"Blacksheet"),
1570 G4VPhysicalVolume* physiWCCapBlackSheet =
1571 new G4PVPlacement(0,
1572 G4ThreeVector(0.,0.,0.),
1573 logicWCCapBlackSheet,
1578 G4LogicalBorderSurface * WaterBSBottomCapSurface
1579 =
new G4LogicalBorderSurface(
"WaterBSCapPolySurface",
1580 physiWCCap,physiWCCapBlackSheet,
1583 G4VisAttributes* WCCapBlackSheetVisAtt
1584 =
new G4VisAttributes(G4Colour(0.9,0.2,0.2));
1589 G4VisAttributes* WCCapBlackSheetVisAtt
1590 =
new G4VisAttributes(G4Colour(0.9,0.2,0.2));
1593 logicWCCapBlackSheet->SetVisAttributes(G4VisAttributes::Invisible);
1595 logicWCCapBlackSheet->SetVisAttributes(WCCapBlackSheetVisAtt);}
1600 G4VisAttributes* WCCapBlackSheetVisAtt
1601 =
new G4VisAttributes(G4Colour(1.0,1.0,0.0));
1605 logicWCCapBlackSheet->SetVisAttributes(WCCapBlackSheetVisAtt);
1607 logicWCCapBlackSheet->SetVisAttributes(WCCapBlackSheetVisAtt);}
1621 G4RotationMatrix* WCCapPMTRotation =
new G4RotationMatrix;
1623 WCCapPMTRotation->rotateY(180.*deg);
1628 for (
int i = -CapNCell ; i < CapNCell; i++) {
1629 for (
int j = -CapNCell ; j < CapNCell; j++) {
1636 G4ThreeVector cellpos = G4ThreeVector(xoffset, yoffset, 0);
1644 G4VPhysicalVolume* physiCapPMT =
1645 new G4PVPlacement(WCCapPMTRotation,
1662 G4cout <<
"total on cap: " << icopy <<
"\n";
1666 G4RotationMatrix* WCPMTRotation =
new G4RotationMatrix;
1667 WCPMTRotation->rotateY(90.*deg);
1669 G4double barrelCellWidth = 2.*
WCIDRadius*tan(dPhi/2.);
1675 G4ThreeVector PMTPosition = G4ThreeVector(
WCIDRadius,
1676 -barrelCellWidth/2.+(i+0.5)*horizontalSpacing,
1679 G4VPhysicalVolume* physiWCBarrelBorderPMT =
1680 new G4PVPlacement(WCPMTRotation,
1684 logicWCBarrelBorderCell,
1686 (
int)(i*WCPMTperCellVertical+j)
1702 G4RotationMatrix* WCPMTRotation =
new G4RotationMatrix;
1703 WCPMTRotation->rotateY(90.*deg);
1704 WCPMTRotation->rotateX((2*pi-
totalAngle)/2.);
1714 towerWidth/2.-(i+0.5)*horizontalSpacing,
1719 G4VPhysicalVolume* physiWCBarrelBorderPMT =
1720 new G4PVPlacement(WCPMTRotation,
1724 logicWCExtraBorderCell,
1726 (
int)(i*WCPMTperCellVertical+j)
1751 G4VPhysicalVolume* physiWCBarrelBorderCellODTyvek =
1752 new G4PVPlacement(0,
1753 G4ThreeVector(0.,0.,0.),
1755 "WCBarrelCellODTyvek",
1756 logicWCBarrelBorderCell,
1760 G4LogicalBorderSurface * WaterTyBarrelBorderCellSurfaceBot =
1761 new G4LogicalBorderSurface(
"WaterTyBarrelBorderCellSurface",
1762 physiWCBarrelBorderCell,
1763 physiWCBarrelBorderCellODTyvek,
1774 G4RotationMatrix* WCPMTODRotation =
new G4RotationMatrix;
1775 WCPMTODRotation->rotateY(270.*deg);
1777 G4double barrelODCellWidth = 2.*
WCODRadius*tan(dPhi/2.);
1784 -barrelODCellWidth/2.+(i+0.5)*horizontalODSpacing+((G4int)(std::pow(-1,j))*(G4int)(
WCODPMTShift)/2),
1785 -(
barrelCellHeight * (barrelODCellWidth/barrelCellWidth))/2.+(j+0.5)*verticalODSpacing);
1788 G4VPhysicalVolume* physiWCBarrelPMT =
1789 new G4PVPlacement(WCPMTODRotation,
1793 logicWCBarrelBorderCell,
1795 (
int)(i*WCPMTODperCellVertical+j),
1803 G4VPhysicalVolume* physiWCExtraBorderODTyvek =
1804 new G4PVPlacement(0,
1805 G4ThreeVector(0.,0.,0.),
1807 "WCExtraTowerODTyvek",
1808 logicWCExtraBorderCell,
1812 G4LogicalBorderSurface * WaterTyBarrelBorderCellSurfaceBot =
1813 new G4LogicalBorderSurface(
"WaterTyBarrelBorderCellSurface",
1814 physiWCExtraBorderCell,
1815 physiWCExtraBorderODTyvek,
1818 G4RotationMatrix* WCPMTRotation =
new G4RotationMatrix;
1819 WCPMTRotation->rotateY(270.*deg);
1820 WCPMTRotation->rotateX((2*pi-
totalAngle)/2.);
1829 G4ThreeVector PMTPosition = G4ThreeVector(
WCODRadius,
1830 -towerWidthOD/2.+(i+0.5)*horizontalODSpacing,
1836 G4VPhysicalVolume* physiWCBarrelPMT =
1837 new G4PVPlacement(WCPMTRotation,
1841 logicWCExtraBorderCell,
1843 (
int)(i*WCPMTODperCellVertical+j),
1853 return logicCapAssembly;
1861 G4cout <<
"N PMTs for OD is equal 0, increase coverage" << G4endl;
1862 *NPMTHorizontal = 1;
1866 *NPMTHorizontal = 1;
1870 *NPMTHorizontal = 1;
1874 *NPMTHorizontal = 2;
1878 *NPMTHorizontal = 2;
1883 *NPMTHorizontal = NPMT/2;
1884 *NPMTVertical = NPMT/2;
1886 *NPMTHorizontal = NPMT/2 + 1;
1887 *NPMTVertical = NPMT/2;
G4double WCPMTODperCellHorizontal
G4Colour black(0.0, 0.0, 0.0)
G4LogicalVolume * ConstructPMT(G4String, G4String, G4String detectorElement="tank")
G4LogicalVolume * logicWCBarrelCellBlackSheet
G4String WCODCollectionName
G4double WCBlackSheetThickness
G4LogicalVolume * ConstructCylinder()
G4Colour cyan(0.0, 1.0, 1.0)
G4double capAssemblyHeight
G4double WCODTyvekSheetThickness
G4double WCODLateralWaterDepth
G4Colour white(1.0, 1.0, 1.0)
G4double WCPMTperCellVertical
WCSimTuningParameters * WCSimTuningParams
G4double outerAnnulusRadius
G4LogicalVolume * logicWCBarrelCellODTyvek
G4Colour blue(0.0, 0.0, 1.0)
G4double WCPMTExposeHeight
G4LogicalVolume * ConstructCaps(G4int zflip)
void ComputeWCODPMT(G4int NPMT, G4double *NPMTHorizontal, G4double *NPMTVertical)
G4double WCPMTODExposeHeight
G4Colour green(0.0, 1.0, 0.0)
G4double WCODCapEdgeLimit
G4double barrelCellHeight
G4double WCODHeightWaterDepth
G4double WCPMTperCellHorizontal
G4Colour red(1.0, 0.0, 0.0)
G4LogicalVolume * logicWCTowerODTyvek
G4double WCPMTODperCellVertical
G4double WCODCapPMTSpacing
G4String WCIDCollectionName
G4double innerAnnulusRadius
G4OpticalSurface * OpWaterBSSurface
G4OpticalSurface * OpWaterTySurface
G4double WCBarrelPMTOffset
G4double WCBarrelNumPMTHorizontal
G4double mainAnnulusHeight
G4Colour yellow(1.0, 1.0, 0.0)
G4double WCBarrelRingNPhi
G4LogicalVolume * logicWCTowerBlackSheet
G4double WCPMTODPercentCoverage
G4Colour magenta(1.0, 0.0, 1.0)