media_geo.cpp contains "ConstructMaterials" code extracted from MEMPHYS and WCSim Geant4 simulation applications. The program produces output at the FairRoot "media.geo" ascii format for the medium "MEMPHYS_Water" of water described in MEMPHYS, and "WCSim_Water" for water described in WCSim. build and run : ------------- The build sh script uses "geant4-config" to build the "media_geo" program. You have to "source setup" geant4 before using it. The run script runs it. output are done on stdout. Some explanations : ----------------- The function write_media_geo() takes a G4Material as first arguments along with tables ENERGY, ABSORPTION, EFFICIENCY, RINDEX1. The G4Material and tables are the one describing water for a Cherenkov detector. The "media.geo" ascii output are produced on stdout according to the "data schema" found in the FairRoot codes : fairroot/geobase/FairGeoMedia.h fairroot/geobase/FairGeoMedia.cxx and fairroot/geobase/FairGeoMedium.h fairroot/geobase/FairGeoMedium.cxx The relevant codes are in the read() methods of the classes FairGeaMedia and FairGeoMedium. Units are the ones guessed from comments in the .h and various .geo files found in the FairRoot distribution. They are : ENERGY eV ABSORPTION mm EFFICIENCY mm RINDEX1 (no unit). The mapping Geant4/FairRoot taken in write_media_geo() is : ENERGY ppckov ABSORPTION absco EFFICIENCY effic RINDEX1 rindex WARNING : there are no EFFICIENCY tables found for water in the MEMPHYS and WCSim codes. It had been set to "1 mm" in the media.geo output. WARNING : the second line of each water description corresponds to : sensFlag : sensitivity flag. fldFlag : field flag. fld : Maximum field value in kilogauss epsil : Boundary crossing precision (unit ?). There is no correspondance of these in the MEMPHYS and WCSim codes. They had been set to "0 0 20. .001" in the media.geo output. WARNING : there are RAYLEIGH tables found for water in the MEMPHYS and WCSim codes, but it does not seem to have a corresponding entry in the media.geo FairRoot data schema. G.Barand 18/Feb/2019