Problem 834 - G4Exception: Aborting execution
Summary: G4Exception: Aborting execution
Status: RESOLVED WORKSFORME
Alias: None
Product: Geant4
Classification: Unclassified
Component: geometry (show other problems)
Version: 7.1
Hardware: PC Linux
: P2 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2006-01-24 08:44 CET by lsilva
Modified: 2006-01-26 09:12 CET (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description lsilva 2006-01-24 08:44:51 CET
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
Comment 1 Gabriele Cosmo 2006-01-26 09:12:59 CET
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.