Skip to content
Snippets Groups Projects
Commit d8fad4a2 authored by matta's avatar matta
Browse files

* Same change in NPSimulation

 - Test Performed everything is Ok!
parent 30cdbbe6
No related branches found
No related tags found
No related merge requests found
......@@ -170,17 +170,25 @@ void DetectorConstruction::ReadConfigurationFile(string Path)
//////////////////////////////////////////////////////////////////////////////////////////
// added by Nicolas [07/05/09]
string GlobalPath = getenv("NPTOOL");
Path = GlobalPath + "/Inputs/DetectorConfiguration/" + Path;
string StandardPath = GlobalPath + "/Inputs/DetectorConfiguration/" + Path;
ifstream ConfigFile;
ConfigFile.open(Path.c_str());
ConfigFile.open(StandardPath.c_str());
if (ConfigFile.is_open())
cout << " Configuration file " << Path << " loading " << endl;
else {
cout << " Error, no configuration file" << Path << " found" << endl;
return;
}
{
cout << " Configuration file " << Path << " loading " << endl;
Path=StandardPath;
}
else
{
ConfigFile.open( Path.c_str() );
if(ConfigFile.is_open()) {
cout << " Configuration file " << Path << " loading " << endl;
}
else { cout << " Error, no configuration file" << Path << " found" << endl;return;}
}
while (!ConfigFile.eof()) {
//Pick-up next line
......
......@@ -79,10 +79,10 @@ void PrimaryGeneratorAction::ReadEventGeneratorFile(string Path)
{
// added by Nicolas [07/05/09]
string GlobalPath = getenv("NPTOOL");
Path = GlobalPath + "/Inputs/EventGenerator/" + Path;
string StandardPath = GlobalPath + "/Inputs/EventGenerator/" + Path;
string LineBuffer;
ifstream EventGeneratorFile;
EventGeneratorFile.open(Path.c_str());
EventGeneratorFile.open(StandardPath.c_str());
bool check_TransfertToResonance = false ;
bool check_PhaseSpace = false ;
......@@ -90,11 +90,22 @@ void PrimaryGeneratorAction::ReadEventGeneratorFile(string Path)
bool check_Transfert = false ;
bool check_Beam = false ;
if (EventGeneratorFile.is_open()) cout << " Event Generator file " << Path << " loading " << endl ;
else {
cout << " Error, Event Generator file " << Path << " found" << endl ;
return;
}
if (EventGeneratorFile.is_open())
{
cout << " Event Generator file " << Path << " loading " << endl ;
Path = StandardPath;
}
else
{
EventGeneratorFile.open( Path.c_str() );
if(EventGeneratorFile.is_open()) {
cout << " Event Generator file " << Path << " loading " << endl ;
}
else { cout << " Error, Event Generator file " << Path << " found" << endl ; return;}
}
while (!EventGeneratorFile.eof()) {
//Pick-up next line
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment