Gate icon indicating copy to clipboard operation
Gate copied to clipboard

Only add warnings with USE_OPTICAL=ON when necessary

Open SimonRit opened this issue 6 years ago • 2 comments

When Gate is compiled with USE_OPTICAL=ON , e.g., in vgate, all simulations, even those which do not use optical photons, get the warnings

I/O warning : failed to load external entity "./Materials.xml"
I/O warning: Discard the previous warning if your simulation doesn't transport OPTICAL PHOTONS.
Otherwise, please copy the ./Materials.xml file from the gate-source directory in the directory where you run your main macro.

It would be nice to remove those when no optical photon is produced (most simulations).

SimonRit avatar Feb 19 '19 15:02 SimonRit

Quite difficult to achieve:

  • In the code, this message appears during the detector construction. Before the instantiation of processes which could inform GATE if optical photons are involved or not during simulation.
  • Even if this is possible, GATE has to know which processes will product optical photons. But there is no indicator of that in G4 processes.

m-dupont avatar Sep 20 '21 16:09 m-dupont

What about doing the opposite: no warning if not found, and a clear message when Materials.xml is found and read. It will be the user responsibility to check that the file is used? (note that in the future, the cmake flag USE_OPTICAL will be removed and always ON)

dsarrut avatar Sep 22 '21 06:09 dsarrut