Gate
                                
                                 Gate copied to clipboard
                                
                                    Gate copied to clipboard
                            
                            
                            
                        Only add warnings with USE_OPTICAL=ON when necessary
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).
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.
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)