IAP GITLAB

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

more std boost filesystem use

parent 93f844fb
No related branches found
No related tags found
No related merge requests found
...@@ -25,8 +25,7 @@ namespace corsika { ...@@ -25,8 +25,7 @@ namespace corsika {
template <class Axes, class Storage> template <class Axes, class Storage>
inline void save_hist(boost::histogram::histogram<Axes, Storage> const& h, inline void save_hist(boost::histogram::histogram<Axes, Storage> const& h,
std::string const& filename, bool overwrite) { std::string const& filename, bool overwrite) {
if (boost::filesystem::status(filename).type() != if (boost::filesystem::exists(filename)) {
boost::filesystem::file_type::file_not_found) {
if (overwrite) { if (overwrite) {
boost::filesystem::remove(filename); boost::filesystem::remove(filename);
} else { } else {
......
...@@ -80,7 +80,7 @@ int main() { ...@@ -80,7 +80,7 @@ int main() {
UniformMagneticField<HomogeneousMedium<setup::EnvironmentInterface>>>; UniformMagneticField<HomogeneousMedium<setup::EnvironmentInterface>>>;
world->setModelProperties<MyHomogeneousModel>( world->setModelProperties<MyHomogeneousModel>(
Medium::AirDry1Atm, MagneticFieldVector(rootCS, 0_T, 0_T, 1_T), Medium::AirDry1Atm, MagneticFieldVector(rootCS, 0_T, 0_T, 1_mT),
1_kg / (1_m * 1_m * 1_m), 1_kg / (1_m * 1_m * 1_m),
NuclearComposition(std::vector<Code>{Code::Hydrogen}, NuclearComposition(std::vector<Code>{Code::Hydrogen},
std::vector<float>{(float)1.})); std::vector<float>{(float)1.}));
...@@ -92,7 +92,7 @@ int main() { ...@@ -92,7 +92,7 @@ int main() {
stack.clear(); stack.clear();
const Code beamCode = Code::Proton; const Code beamCode = Code::Proton;
const HEPMassType mass = Proton::mass; const HEPMassType mass = Proton::mass;
const HEPEnergyType E0 = 1000_GeV; const HEPEnergyType E0 = 200_GeV;
double theta = 0.; double theta = 0.;
double phi = 0.; double phi = 0.;
......
...@@ -88,13 +88,11 @@ void registerRandomStreams(int seed) { ...@@ -88,13 +88,11 @@ void registerRandomStreams(int seed) {
RNGManager<>::getInstance().registerRandomStream("pythia"); RNGManager<>::getInstance().registerRandomStream("pythia");
RNGManager<>::getInstance().registerRandomStream("urqmd"); RNGManager<>::getInstance().registerRandomStream("urqmd");
RNGManager<>::getInstance().registerRandomStream("proposal"); RNGManager<>::getInstance().registerRandomStream("proposal");
if (seed == 0) { if (seed == 0) {
std::random_device rd; std::random_device rd;
seed = rd(); seed = rd();
cout << "new random seed (auto) " << seed << endl; cout << "new random seed (auto) " << seed << endl;
} }
RNGManager<>::getInstance().setSeed(seed); RNGManager<>::getInstance().setSeed(seed);
} }
......
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