IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 44dcfb0d authored by ralfulrich's avatar ralfulrich
Browse files

urqmd better filename handling

parent e1cfad0f
No related branches found
No related tags found
1 merge request!271Resolve "Assumption of no continuous between two stochastic losses"
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
namespace corsika::urqmd { namespace corsika::urqmd {
inline UrQMD::UrQMD(boost::filesystem::path const& xs_file) { inline UrQMD::UrQMD(boost::filesystem::path xs_file) {
readXSFile(xs_file); readXSFile(xs_file);
::urqmd::iniurqmdc8_(); ::urqmd::iniurqmdc8_();
} }
...@@ -394,7 +394,7 @@ namespace corsika::urqmd { ...@@ -394,7 +394,7 @@ namespace corsika::urqmd {
return mapPDGToUrQMD.at(static_cast<int>(get_PDG(code))); return mapPDGToUrQMD.at(static_cast<int>(get_PDG(code)));
} }
inline void UrQMD::readXSFile(boost::filesystem::path const& filename) { inline void UrQMD::readXSFile(boost::filesystem::path const filename) {
boost::filesystem::ifstream file(filename, std::ios::in); boost::filesystem::ifstream file(filename, std::ios::in);
if (!file.is_open()) { if (!file.is_open()) {
...@@ -429,6 +429,7 @@ namespace corsika::urqmd { ...@@ -429,6 +429,7 @@ namespace corsika::urqmd {
std::getline(file, line); std::getline(file, line);
} }
} }
file.close();
} }
} // namespace corsika::urqmd } // namespace corsika::urqmd
...@@ -27,7 +27,7 @@ namespace corsika::urqmd { ...@@ -27,7 +27,7 @@ namespace corsika::urqmd {
class UrQMD : public InteractionProcess<UrQMD> { class UrQMD : public InteractionProcess<UrQMD> {
public: public:
UrQMD(boost::filesystem::path const& path = corsika_data("UrQMD/UrQMD-1.3.1-xs.dat")); UrQMD(boost::filesystem::path const path = corsika_data("UrQMD/UrQMD-1.3.1-xs.dat"));
template <typename TParticle> template <typename TParticle>
GrammageType getInteractionLength(TParticle const&) const; GrammageType getInteractionLength(TParticle const&) const;
...@@ -46,7 +46,7 @@ namespace corsika::urqmd { ...@@ -46,7 +46,7 @@ namespace corsika::urqmd {
private: private:
static CrossSectionType getCrossSection(Code, Code, HEPEnergyType, int); static CrossSectionType getCrossSection(Code, Code, HEPEnergyType, int);
void readXSFile(boost::filesystem::path const&); void readXSFile(boost::filesystem::path);
// data members // data members
default_prng_type& RNG_ = RNGManager::getInstance().getRandomStream("urqmd"); default_prng_type& RNG_ = RNGManager::getInstance().getRandomStream("urqmd");
......
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