Hi, My program compiles without problems, but when I run it, it aborts. *** G4Exception : InvalidSetup issued by : G4PVPlacement::G4PVPlacement() Cannot place a volume inside itself! *** Fatal Exception *** core dump *** I use the G4PVPlacement method twice in my detector construction: //------------------------------ world volume G4double world_x = 5.0*m; G4double world_y = 5.0*m; G4double world_z = 5.0*m; G4Box* world_box = new G4Box("world_box",world_x,world_y,world_z); world_log = new G4LogicalVolume(world_box,Air,"world_log",0,0,0); world_phys = new G4PVPlacement(0,G4ThreeVector(0.,0.,0.),world_log,"world",0,false,0); //------------------------------ a germanium tube G4double innerRadiusOfTheTube = 0.*mm; G4double outerRadiusOfTheTube = 60.*mm; G4double hightOfTheTube = 30.*mm; G4double startAngleOfTheTube = 0.*deg; G4double spanningAngleOfTheTube = 360.*deg; G4Tubs* germanium = new G4Tubs("germanium_tube",innerRadiusOfTheTube, outerRadiusOfTheTube,hightOfTheTube, startAngleOfTheTube,spanningAngleOfTheTube); germanium_log = new G4LogicalVolume(germanium,Ge,"germanium_log",0,0,0); G4double germanium_Pos_x = 1.*mm; G4double germanium_Pos_y = 1.*mm; G4double germanium_Pos_z = 1.*mm; germanium_phys = new G4PVPlacement(0, G4ThreeVector(germanium_Pos_x,germanium_Pos_y,germanium_Pos_z), germanium_log,"germanium",world_log,false,0); Can you find where the problem is? Best regards, Lidia
The exception thrown is indicating that the same logical-volume pointer for daughter and mother is used for making the placement. This is not the case in the snippet of code shown here, unless 'world_log' and 'germanium_log' are somewhere redirected to be the same pointer. It may also be that the exception refers to a different G4PVPlacement statement which is not the one of those reported in this code... or you are not runnnig the executable which refers to this code... please, check.