In my simulation, I have created an hexagon using G4BREPSolidPolyhedra: // hexagonal hole solidCollimHoleP=NULL; logicCollimHoleP=NULL; physiCollimHoleP=NULL; G4double holeR = CollimHoleDiameter/2.; G4double *zValues = new G4double[2]; zValues[0]= -CollimHeight/2; zValues[1]= CollimHeight/2; G4double *rMinValues = new G4double[2]; rMinValues[0] = 0.; rMinValues[1] = 0.; G4double *rMaxValues = new G4double[2]; rMaxValues[0] = holeR; rMaxValues[1] = holeR; solidCollimHoleP = new G4BREPSolidPolyhedra("HoleP",0.,twopi,6,2, -CollimHeight/2,zValues,rMinValues,rMaxValues); logicCollimHoleP = new G4LogicalVolume(solidCollimHoleP,defaultMaterial, "HoleP"); physiCollimHoleP = new G4PVPlacement(0,G4ThreeVector(),"HoleP", logicCollimHoleP,physiCollim,false,0); When I run the program, I obtained this message: Program received signal SIGSEGV, Segmentation fault. __libc_free (mem=0xffffffc5) at malloc.c:3005 3005 malloc.c: No such file or directory. (gdb) #1 0x83910b1 in __builtin_vec_delete (ptr=0xffffffc5) Current language: auto; currently c++ (gdb) #2 0x80885c3 in G4BREPSolidPolyhedra::~G4BREPSolidPolyhedra () (gdb) #3 0x83c062e in G4RWTPtrOrderedVector<G4VSolid>::clearAndDestroy () (gdb) #4 0x81d23c0 in G4SolidStore::~G4SolidStore () (gdb) #5 0x81d2477 in __tcf_0 () (gdb) #6 0x4019c23a in exit (status=1) at exit.c:57 57 exit.c: No such file or directory. Current language: auto; currently c (gdb) #7 0x808e81e in G4Ray::RayCheck () (gdb) #8 0x808d6d6 in G4FPlane::CalcNormal () (gdb) #9 0x808d335 in G4FPlane::G4FPlane () (gdb) #10 0x8085844 in G4BREPSolidPolyhedra::G4BREPSolidPolyhedra () (gdb) #11 0x805056e in crysDetectorConstruction::ConstructCamera () (gdb) #12 0x8052ea5 in crysDetectorConstruction::UpdateGeometry () (gdb) #13 0x80564c4 in crysDetectorMessenger::SetNewValue () (gdb) #14 0x81f127e in G4UIcommand::DoIt () (gdb) #15 0x8203309 in G4UImanager::ApplyCommand () (gdb) #16 0x8202a99 in G4UImanager::ApplyCommand () (gdb) #17 0x820f9a4 in G4UIbatch::SessionStart () (gdb) #18 0x82028eb in G4UImanager::ExecuteMacroFile () (gdb) #19 0x82113d1 in G4UIcontrolMessenger::SetNewValue () (gdb) #20 0x81f127e in G4UIcommand::DoIt () (gdb) #21 0x8203309 in G4UImanager::ApplyCommand () (gdb) #22 0x8202a99 in G4UImanager::ApplyCommand () (gdb) #23 0x804d632 in main () (gdb) #24 0x401939cb in __libc_start_main (main=0x804d41c <main>, argc=1, argv=0xbfffe6a4, init=0x804c310 <_init>, fini=0x83c5b74 <_fini>, rtld_fini=0x4000aea0 <_dl_fini>, stack_end=0xbfffe69c) at ../sysdeps/generic/libc-start.c:92 I've tried to run the same program with G4BREPSolidPcone instead of G4BREPSolidPolyhedra and it works. Thank you very much in advance for your help.
From the trace dump provided the program enters in an 'exit' state in G4Ray::RayCheck(), as expected if the ray's direction is set to zero. Might be a problem in the user's geometry. To be investigated.
Additional information required, values for: CollimHoleDiameter, CollimHeight, holeR.
I have fixed the G4BREPSolidPolyhedra so that now handles the special case when dphi = 2*pi and all RMIN values are 0.0. The geometry should be visible at the attached URL. The fix will apparently appear after testing in the new reference tag.
Ooops, the URL is http://cern.ch/radoone/g4/bug266geom.jpg