So here is the my code for the detector construction, and its showing an overlap with the mother volume
MyDetectorConstruction::MyDetectorConstruction() {
nCols = 7;
nRows = 7;
DefineMaterial();
xWorld = 1.0*m;
yWorld = 1.05*m;
zWorld = 2.0*m;
}
MyDetectorConstruction::~MyDetectorConstruction() {}
void MyDetectorConstruction::DefineMaterial()
{
G4NistManager *nist = G4NistManager::Instance();
Ar = new G4Element("Argon", "Ar", 18., 39.948*g/mole);
O = new G4Element("Oxygen", "O", 8., 15.999*g/mole);
N = new G4Element("Nitrogen", "N", 7., 14.007*g/mole);
Aluminium = new G4Material("Al", 2.70*g/cm3, 1);
Aluminium->AddElement(nist->FindOrBuildElement("Al"), 1);
Pb = new G4Element("Lead", "Pb", 82., 207.2*g/mole);
W = new G4Element("Tungsten", "W", 74., 183.84*g/mole);
Air = new G4Material("Air", 1.214*mg/cm3, 3);
Air->AddElement(N, 75*perCent);
Air->AddElement(O, 24*perCent);
Air->AddElement(Ar, 1*perCent);
PbWO4 = new G4Material("PbWO4", 8.300*g/cm3, 3);
PbWO4->AddElement(Pb, 1);
PbWO4->AddElement(W, 2);
PbWO4->AddElement(O, 2);
}
G4VPhysicalVolume *MyDetectorConstruction::Construct()
{
solidWorld = new G4Box("World", 0.5*xWorld, 0.5*yWorld, 0.5*zWorld);
logicWorld = new G4LogicalVolume(solidWorld, Air, "World");
physWorld = new G4PVPlacement(0, G4ThreeVector(), logicWorld, "World", 0, false, 0, true);
solidRadiator = new G4Box("solidRadiator", 50.4*cm, 30.4*cm, 121.9*cm);
logicRadiator = new G4LogicalVolume(solidRadiator, Aluminium,"logicalRadiator");
fScoringVolume = logicRadiator;
physRadiator = new G4PVPlacement(0, G4ThreeVector(0.,0.,-129.0*cm), logicRadiator, "physRadiator", logicWorld, false, 0, true);
G4double xsize(2.2*cm), ysize(2.2*cm), zsize(23.6*cm);
solidDetector = new G4Box("Detector", 0.5*xsize, 0.5*ysize, 0.5*zsize);
logicDetector = new G4LogicalVolume(solidDetector, PbWO4, "Detector");
G4double xpos = -0.5 * xsize * (nRows - 1);
G4double zpos = (+25.0 + 121.9)*cm + 0.5*zsize;
for (G4int i=0; i < nRows; i++) {
G4double ypos = -0.5 * ysize * (nCols - 1);
for (G4int j=0; j < nCols; j++) {
G4int copy = i * 10 + j;
new G4PVPlacement(0, G4ThreeVector(xpos, ypos, zpos), logicDetector, "Detector", logicWorld, false, copy, true);
ypos += ysize;
}
xpos += xsize;
}
return physWorld;
}
The output sown in the terminal is the following
Overlap with mother volume !
Overlap is detected for volume Detector:65 (G4Box) with its mother volume World (G4Box)
protrusion at mother local point (58.6427,53.2418,1705) by 70.5 cm (max of 1000 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Checking overlaps for volume Detector:66 (G4Box) ...
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
issued by : G4PVPlacement::CheckOverlaps()
Overlap with mother volume !
Overlap is detected for volume Detector:66 (G4Box) with its mother volume World (G4Box)
protrusion at mother local point (57.8513,55.8805,1705) by 70.5 cm (max of 1000 cases)
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------
Please help