Prevent from printing G4Material properties if MME not defined
I've added a commit 71ba0367 to v01-16-01-patches
that fixes the problem with Geant4Converter
when working on Muon XMLs.
Geant4Converter INFO ++ Convert Volume Copper30micBox : 0x4ee8460 TGeoBBox/TGeoVolume assembly:NO
TUnixSystem::Di... FATAL segmentation violation
In particular, Geant4Converter
in DDG4 prints the properties of the material once converted to G4Material. It uses the internal printing functions [coming from Geant4] https://gitlab.cern.ch/geant4/geant4/-/blob/master/source/materials/src/G4Material.cc#L799-840. In order to print these properties, the mean excitation energy must be defined, otherwise Geant will fail processing the following line:
G4BestUnit(material->GetIonisation()->GetMeanExcitationEnergy(),"Energy")
There is no check for this in Geant4Converter
. In other words, if the ionization properties have not been set for the material or the structure of the compact XML is not correct, then Geant4Converter
will fail to print the properties and will not give any hint as to why this happened. Once the commit is applied, Geant4Converter
will print a warning message that the properties cannot be printed:
Geant4Converter INFO ++ Convert Volume Copper30micBox : 0x4bbfcb0 TGeoBBox/TGeoVolume assembly:NO
Geant4Converter WARNING ++ Created G4 material but ION is not defined and the properites cannot be printed.
I do not really know in what cases the MME can be undefined. In any case, it might be worth reporting this issue directly in dd4hep.