Problem 2165 - Track stuck in a simple GDML based geometry and isotropic source model
Summary: Track stuck in a simple GDML based geometry and isotropic source model
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: persistency/gdml (show other problems)
Version: 10.5
Hardware: All Linux
: P4 major
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2019-05-23 23:27 CEST by Sanchit Sharma
Modified: 2019-05-28 10:56 CEST (History)
2 users (show)

See Also:


Attachments
Output file with Error (537.33 KB, text/plain)
2019-05-23 23:27 CEST, Sanchit Sharma
Details
GDML File (10.08 MB, text/plain)
2019-05-23 23:30 CEST, Sanchit Sharma
Details
Geometry with CAD import (3.64 KB, image/png)
2019-05-27 21:51 CEST, Sanchit Sharma
Details
Geometry without tool (2.39 KB, image/png)
2019-05-27 21:52 CEST, Sanchit Sharma
Details
Geometry without CAD import (2.39 KB, image/png)
2019-05-27 21:53 CEST, Sanchit Sharma
Details
Qt view of the setup, after disabling few nodes... (715.61 KB, image/png)
2019-05-28 10:09 CEST, Gabriele Cosmo
Details
This gdml file does not gives any overlaps error (10.08 MB, text/plain)
2019-05-28 10:22 CEST, Sanchit Sharma
Details
Output of with the previous GDML file (537.32 KB, text/plain)
2019-05-28 10:23 CEST, Sanchit Sharma
Details

Note You need to log in before you can comment on or make changes to this problem.
Description Sanchit Sharma 2019-05-23 23:27:40 CEST
Created attachment 571 [details]
Output file with Error

I have imported a GDML geometry in to my normal C++ based geometry and build a hybrid geometry. Upon the import it is not showing any intersection of geometry, upon visual inspection also I am not seeing any intersections. But multiple threads have below errors. I have also attached a sample output file with a list of these errors and my gdml file. Please note that the Geant4 runs are doing just fine without the CAD model i.e. only C++ based Boolean geometry. 

G4WT22 > 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
      issued by : G4Navigator::ComputeStep()
Track stuck or not moving.
          Track stuck, not moving for 10 steps
          in volume -world- at point (-3.424999999999784,510.1858861663759,-159.1586266624186) (local point (-3.424999999999784,510.1858861663759,-159.1586266624186))
          direction: (-0.9061371351645376,0.05388786167888215,-0.4195373530920483) (local direction: (-0.9061371351645376,0.05388786167888215,-0.4195373530920483)).
          Potential geometry or navigation problem !
          Trying pushing it of 1e-07 mm ...Potential overlap in geometry!

*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

G4WT12 > 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
      issued by : G4Navigator::ComputeStep()
Track stuck or not moving.
          Track stuck, not moving for 10 steps
          in volume -world- at point (45.19510970023173,586.9743814134983,-161.2229538112001) (local point (45.19510970023173,586.9743814134983,-161.2229538112001))
          direction: (-0.2439193961906107,0.7746825599967422,0.5834125979089771) (local direction: (-0.2439193961906107,0.7746825599967422,0.5834125979089771)).
          Potential geometry or navigation problem !
          Trying pushing it of 1e-07 mm ...Potential overlap in geometry!

*** This is just a warning message. ***
-------- WWWW -------- G4Exception-END --------- WWWW -------

G4WT20 > 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomNav1002
      issued by : G4Navigator::ComputeStep()
Track stuck or not moving.
          Track stuck, not moving for 10 steps
          in volume -tool_phys- at point (503.0250000000001,526.6210783892574,-121.5938370693028) (local point (1747.725,-6.7789216107426,45.40616293069723))
          direction: (0.2998056977753287,-0.1628108605185207,-0.9400048761994093) (local direction: (0.2998056977753287,-0.1628108605185207,-0.9400048761994093)).
          Potential geometry or navigation problem !
          Trying pushing it of 1e-07 mm ...Potential overlap in geometry!
Comment 1 Sanchit Sharma 2019-05-23 23:30:15 CEST
Created attachment 572 [details]
GDML File

This file is being imported by following code:

  G4GDMLParser parser;
  G4String filename,GDMLsolid;
  filename = "/homes/sanchitsharma/Geant4/CNEC/Thermal_CAD/source/src/final_cnec_tool.gdml";
    // Create the run manager (MT or non-MT) and make it a bit verbose.";
  parser.Read(filename);GDMLsolid = "final_cnec_tool";
  auto DummyLV2 = parser.GetVolume(GDMLsolid);
  auto tool_sol = DummyLV2->GetSolid();

  G4RotationMatrix* rottool  = new  G4RotationMatrix;
  rottool -> rotateZ(270 * degree); 

  G4ThreeVector Trantool(0. * m ,0. * m, 0. * m);
  
  G4Transform3D shift(*rottool, Trantool);

  auto tool = new G4DisplacedSolid("tool_box",tool_sol, shift);
  auto tool_log = new G4LogicalVolume(tool, Aluminum, "tool_log");
  // Place the trenches

  G4VisAttributes* greytl = new G4VisAttributes(G4Colour::Grey());
  greytl->SetVisibility(true);
  greytl->SetForceSolid(true);
  tool_log->SetVisAttributes(greytl);

  new G4PVPlacement(0, {-1.2447 * m ,0.5334 * m, -0.167 * m}, tool_log, "tool_phys", worldLog, false, 0, checkOverlaps);
Comment 2 Gabriele Cosmo 2019-05-27 10:44:45 CEST
Sorry, but your report is fairly incomplete and hard for us to investigate.
- Can you please clarify what you mean by "are doing just fine without the CAD model i.e. only C++ based Boolean geometry" ?  Do you have exactly the same geometry represented as C++ code, rather than the import of this rather massive (11.6 MB file) GDML tessellated geometry?  Do you expect us to debug such geometry?
- There is no information on how the world volume is being set up.
- There is no information on how to reproduce the problem.
- The way the tessellated model is placed in the world is rather peculiar. Why are you creating a displaced-solid, further transforming it, rather than simply placing it through a normal transformation (rotation+translation)?

The run-time warnings you get may mean different things, a real overlap somewhere or a badly defined tessellated structure. How did you generate the tessellated structure?
Comment 3 Sanchit Sharma 2019-05-27 21:51:25 CEST
Created attachment 573 [details]
Geometry with CAD import
Comment 4 Sanchit Sharma 2019-05-27 21:52:16 CEST
Created attachment 574 [details]
Geometry without tool
Comment 5 Sanchit Sharma 2019-05-27 21:53:15 CEST
Created attachment 575 [details]
Geometry without CAD import
Comment 6 Sanchit Sharma 2019-05-27 21:59:37 CEST
(In reply to Gabriele Cosmo from comment #2)
> Sorry, but your report is fairly incomplete and hard for us to investigate.
> - Can you please clarify what you mean by "are doing just fine without the
> CAD model i.e. only C++ based Boolean geometry" ?  Do you have exactly the
> same geometry represented as C++ code, rather than the import of this rather
> massive (11.6 MB file) GDML tessellated geometry?  Do you expect us to debug
> such geometry?
> - There is no information on how the world volume is being set up.
> - There is no information on how to reproduce the problem.
> - The way the tessellated model is placed in the world is rather peculiar.
> Why are you creating a displaced-solid, further transforming it, rather than
> simply placing it through a normal transformation (rotation+translation)?
> 
> The run-time warnings you get may mean different things, a real overlap
> somewhere or a badly defined tessellated structure. How did you generate the
> tessellated structure?

Humble apologies for the confusion caused from my end. Here are my explanations:

1) I have made geometry of an entire experimental facility in C++ code. The experimental setup has a tool for holding detectors. Only that tool is imported in CAD. If I import the tool the Geant4 output shows no Overlaps but gives the error mentioned 'track stuck' in the output. If I do not import the tool and model my detectors as if they are floating in the air, then every thing works just fine. I have attached pictures of my geometry "Geometry with CAD Import" and "Geometry without CAD Import" in this thread.

2) World volume definition:

  G4double world_hx = 26 * m;
  G4double world_hy = 26 * m;
  G4double world_hz = 26 * m;
  G4VSolid* worldBox = new G4Box("world", world_hx, world_hy, world_hz);

  G4LogicalVolume* worldLog = new G4LogicalVolume(worldBox, nist->FindOrBuildMaterial("G4_AIR"), "worldLV");
  G4VisAttributes* visAttr = new G4VisAttributes();
  visAttr->SetVisibility(true);
  worldLog->SetVisAttributes(visAttr);
 
  G4VPhysicalVolume* worldPhys = new G4PVPlacement(0, {}, worldLog, "world", 0, false, 0);

3) I have attached the GDML file and will email you the whole source file to your email so that the error can be reproduced.

4) To import the CAD solid I am using an example in which a displacement solid was used, I was just following it. 

5) I generated the .CTL file from SALOME and then converted it to GDML using an online python code "CAD to GDML converter".

I appreciate any help in this regard.

Thanks!
Comment 7 Gabriele Cosmo 2019-05-28 09:58:44 CEST
The geometry is wrongly setup with clear overlaps!

Please look more carefully to what gets reported:

   :
-------- WWWW ------- G4Exception-START -------- WWWW -------
** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume tool_phys:0
          with Tube:0 volume's
          local point (-99.2713,22.956,1302.01), overlapping by at least: 290.97 um 
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 Tube8 ... OK!
Checking overlaps for volume BshieldP ... OK!
Checking overlaps for volume BshieldP1 ... OK!
Checking overlaps for volume BshieldP2 ... OK!
Checking overlaps for volume BshieldP3 ... OK!
Checking overlaps for volume PE_1 ... OK!
Checking overlaps for volume PE_2 ... OK!
Checking overlaps for volume RoofBPE_1 ... OK!
Checking overlaps for volume RoofBPE_2 ... OK!
Checking overlaps for volume RoofBPE_3 ... OK!
Checking overlaps for volume doorBPE_1 ... OK!
Checking overlaps for volume doorBPE_2 ... OK!
Checking overlaps for volume TubeCap ... 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume TubeCap:0
          with tool_phys:0 volume's
          local point (2658.51,-114.3,20.0837), overlapping by at least: 6.31646 cm 
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 CapCover ... 
-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : GeomVol1002
      issued by : G4PVPlacement::CheckOverlaps()
Overlap with volume already placed !
          Overlap is detected for volume CapCover:0
          with tool_phys:0 volume's
          local point (2794,1.66024,-51.9401), overlapping by at least: 180.454 um 
NOTE: Reached maximum fixed number -1- of overlaps reports for this volume !
*** This is just a warning message. ***
   :

I suggest you to resolve all reported overlaps before issuing a bug-report (this case was already analysed on Hypernews with similar diagnostics...).

Few considerations in addition:
- your code loads twice the GDML model (once in the main() and once in the DetectorConstrution::construct()... why??);
- you are placing every volume in a flat way inside the world with no one single mother-daughter relationship; this, besides being inefficient can also easily expose to generation of overlaps if shells/walls are not accurately described;
- the use of a displaced-solid for placing the CAD structure is not necessary and just causes inefficiencies, as you compute the transformation (translation/rotation) on the fly at every intersection...
Comment 8 Gabriele Cosmo 2019-05-28 10:09:49 CEST
Created attachment 576 [details]
Qt view of the setup, after disabling few nodes...

The CAD structure appears to be totally off centre...
Comment 9 Sanchit Sharma 2019-05-28 10:22:31 CEST
Created attachment 577 [details]
This gdml file does not gives any overlaps error
Comment 10 Sanchit Sharma 2019-05-28 10:23:11 CEST
Created attachment 578 [details]
Output of with the previous GDML file
Comment 11 Sanchit Sharma 2019-05-28 10:25:23 CEST
Respected Dr. Cosmo,

Many thanks for looking into this. I am very grateful. The tool is not supposed to be in the center due to gravity, I am confident that my placement is correct. 

Thanks!
Comment 12 Sanchit Sharma 2019-05-28 10:28:37 CEST
I humbly request you to please reconsider this. I look forward for your solution. I will follow your advice regarding mother and daughter volume for this point onward.

sincere regards,
Sanchit Sharma
Comment 13 Gabriele Cosmo 2019-05-28 10:36:09 CEST
Please resolve the overlaps reported. The GDML you attached again is the same as the previous you provided and is the one I tested.
There is a clear overlap with the tube and cap, as reported !!
Sorry, I cannot help more and I'm closing this ticket.
Comment 14 Sanchit Sharma 2019-05-28 10:56:06 CEST
Dr. Cosmo,

Thanks very much for your time.

Regards,
Sanchit Sharma