Problem 1483 - G4SeltzerBergerModel opens files in spot
Summary: G4SeltzerBergerModel opens files in spot
Status: RESOLVED INVALID
Alias: None
Product: Geant4
Classification: Unclassified
Component: processes/electromagnetic (show other problems)
Version: 9.6
Hardware: All All
: P5 critical
Assignee: Vladimir.Ivantchenko
URL:
Depends on:
Blocks:
 
Reported: 2013-06-20 00:30 CEST by Spencer
Modified: 2013-06-21 17:33 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
Description Spencer 2013-06-20 00:30:39 CEST
I just installed the latest version geant4.9.6.p02 yesterday and my application get crashing with this error 

-------- EEEE ------- G4Exception-START -------- EEEE -------
*** G4Exception : em0003
      issued by : G4SeltzerBergerModel::ReadData()
Bremsstrahlung data file </home/burt/Packages/geant/build/install/data/brem_SB/br7> is not opened!
G4LEDATA version should be G4EMLOW6.23 or later.

*** Fatal Exception *** core dump ***
-------- EEEE -------- G4Exception-END --------- EEEE -------

That is because the file location is wrong. I added in a line in 
processes/electromagnetic/standard/src/G4SeltzerBergerModel.cc

so that it reads like this now with some context
 
102 void G4SeltzerBergerModel::Initialise(const G4ParticleDefinition* p,
103                                       const G4DataVector& cuts)
104 {
105   // check environment variable
106   // Build the complete string identifying the file with the data set
107   char* path = getenv("G4LEDATA");
108   strcat(path, "/G4EMLOW6.32");
109 
110   // Access to elements
111   const G4ElementTable* theElmTable = G4Element::GetElementTable();
112   size_t numOfElm = G4Element::GetNumberOfElements();

I had to include <string.h> to get the strcat. Now it works.
Comment 1 Spencer 2013-06-21 17:33:56 CEST
I was able to resolve this bug on my own. If sourced the geant/build/install/bin/geant4.sh to set the environmental variables for me instead of setting them on my own then everything works correctly with no modification to the source code.