IAP GITLAB

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

format

parent effa19f4
No related branches found
No related tags found
No related merge requests found
...@@ -27,8 +27,8 @@ TEST_CASE("CONEX", "[processes]") { ...@@ -27,8 +27,8 @@ TEST_CASE("CONEX", "[processes]") {
using std::endl; using std::endl;
std::string parameterPathName = ""; std::string parameterPathName = "";
//auto cxModel = eSibyll23; // auto cxModel = eSibyll23;
//ConexDynamicInterface cx(cxModel); // ConexDynamicInterface cx(cxModel);
int randomSeeds[3]; int randomSeeds[3];
randomSeeds[0] = 1234; randomSeeds[0] = 1234;
...@@ -38,7 +38,7 @@ TEST_CASE("CONEX", "[processes]") { ...@@ -38,7 +38,7 @@ TEST_CASE("CONEX", "[processes]") {
int nShower = 1; // large to avoid final stats. int nShower = 1; // large to avoid final stats.
int maxDetail = 0; int maxDetail = 0;
int particleListMode = 0; int particleListMode = 0;
//cx.Init(nShower, randomSeeds, maxDetail, particleListMode, parameterPathName); // cx.Init(nShower, randomSeeds, maxDetail, particleListMode, parameterPathName);
double energyInGeV = 100.; double energyInGeV = 100.;
double zenith = 60; double zenith = 60;
...@@ -46,6 +46,7 @@ TEST_CASE("CONEX", "[processes]") { ...@@ -46,6 +46,7 @@ TEST_CASE("CONEX", "[processes]") {
double impactParameter = 0; double impactParameter = 0;
int particleType = 100; int particleType = 100;
//cx.RunConex(randomSeeds, energyInGeV, zenith, azimuth, impactParameter, particleType); // cx.RunConex(randomSeeds, energyInGeV, zenith, azimuth, impactParameter,
// particleType);
} }
} }
...@@ -76,10 +76,11 @@ corsika::process::EProcessReturn CONEXSourceCut::DoSecondaries( ...@@ -76,10 +76,11 @@ corsika::process::EProcessReturn CONEXSourceCut::DoSecondaries(
<< std::endl; << std::endl;
p.Delete(); p.Delete();
//conex_.Shower(egs_pid, E, x, y, altitude, slantDistance, lateralX, lateralY, slantX, // conex_.Shower(egs_pid, E, x, y, altitude, slantDistance, lateralX, lateralY,
// slantX,
// time, u, v, w, iri, weight, latchin); // time, u, v, w, iri, weight, latchin);
conex::show_(egs_pid, E, x, y, altitude, slantDistance, lateralX, lateralY, slantX, conex::show_(egs_pid, E, x, y, altitude, slantDistance, lateralX, lateralY, slantX,
time, u, v, w, iri, weight, latchin); time, u, v, w, iri, weight, latchin);
} }
return corsika::process::EProcessReturn::eOk; return corsika::process::EProcessReturn::eOk;
...@@ -92,14 +93,14 @@ void CONEXSourceCut::SolveCE() { ...@@ -92,14 +93,14 @@ void CONEXSourceCut::SolveCE() {
int iCEmode = 1; int iCEmode = 1;
int id = 0; // RU: max, fix this int id = 0; // RU: max, fix this
int nshtot_ = 0; // RU: max, fix this int nshtot_ = 0; // RU: max, fix this
//conex_.HadronCascade(id, nshtot_, zero, iCEmode); // conex_.HadronCascade(id, nshtot_, zero, iCEmode);
//conex_.SolveMomentEquations(zero); // conex_.SolveMomentEquations(zero);
conex::hadroncascade_(id, nshtot_, zero, iCEmode); conex::hadroncascade_(id, nshtot_, zero, iCEmode);
conex::solvemomentequations_(zero); conex::solvemomentequations_(zero);
// RU: this here is from cxroot, // RU: this here is from cxroot,
//int nX = conex_.GetNumberOfDepthBins(); // make sure this works! // int nX = conex_.GetNumberOfDepthBins(); // make sure this works!
int nX = conex::get_number_of_depth_bins_(); // make sure this works! int nX = conex::get_number_of_depth_bins_(); // make sure this works!
int icut = 1; int icut = 1;
...@@ -130,12 +131,12 @@ void CONEXSourceCut::SolveCE() { ...@@ -130,12 +131,12 @@ void CONEXSourceCut::SolveCE() {
// conex_.GetGammaProfile(icutg, nX, Gamma[0]); // conex_.GetGammaProfile(icutg, nX, Gamma[0]);
// conex_.GetElectronProfile(icute, nX, Electrons[0]); // conex_.GetElectronProfile(icute, nX, Electrons[0]);
// conex_.GetHadronProfile(icuth, nX, Hadrons[0]); // conex_.GetHadronProfile(icuth, nX, Hadrons[0]);
conex::get_shower_data_(icut, iSec, nX, X[0], N[0], fitpars[0], H[0], D[0]); conex::get_shower_data_(icut, iSec, nX, X[0], N[0], fitpars[0], H[0], D[0]);
conex::get_shower_edep_(icut, nX, dEdX[0], EGround[0]); conex::get_shower_edep_(icut, nX, dEdX[0], EGround[0]);
conex::get_shower_muon_(icutm, nX, Mu[0], dMu[0]); conex::get_shower_muon_(icutm, nX, Mu[0], dMu[0]);
conex::get_shower_gamma_(icutg, nX, Gamma[0]); conex::get_shower_gamma_(icutg, nX, Gamma[0]);
conex::get_shower_electron_(icute, nX, Electrons[0]); conex::get_shower_electron_(icute, nX, Electrons[0]);
conex::get_shower_hadron_(icuth, nX, Hadrons[0]); conex::get_shower_hadron_(icuth, nX, Hadrons[0]);
} }
// RU: move all the non-C8 code from the following c++ function into a new file. Here we // RU: move all the non-C8 code from the following c++ function into a new file. Here we
...@@ -146,8 +147,8 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis s ...@@ -146,8 +147,8 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis s
// units::si::GrammageType Xcut, // units::si::GrammageType Xcut,
units::si::HEPEnergyType primaryEnergy, units::si::HEPEnergyType primaryEnergy,
particles::PDGCode primaryID) particles::PDGCode primaryID)
: //conex_{ConexDynamicInterface(eSibyll23)} : // conex_{ConexDynamicInterface(eSibyll23)}
center_{center} center_{center}
, showerAxis_{showerAxis} , showerAxis_{showerAxis}
, groundDist_{groundDist} , groundDist_{groundDist}
, conexObservationCS_{std::invoke([&]() { , conexObservationCS_{std::invoke([&]() {
...@@ -171,21 +172,18 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis s ...@@ -171,21 +172,18 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis s
int randomSeeds[3] = {1234, 0, 0}; // will be overwritten later?? int randomSeeds[3] = {1234, 0, 0}; // will be overwritten later??
int heModel = eSibyll23; int heModel = eSibyll23;
int nShower = 1; // large to avoid final stats. int nShower = 1; // large to avoid final stats.
int maxDetail = 0; int maxDetail = 0;
int particleListMode = 0; int particleListMode = 0;
//conex_.Init(nShower, randomSeeds, maxDetail, particleListMode, parameterPathName); // conex_.Init(nShower, randomSeeds, maxDetail, particleListMode, parameterPathName);
std::string configPath = CONEX_CONFIG_PATH; std::string configPath = CONEX_CONFIG_PATH;
conex::initconex_(nShower, randomSeeds, conex::initconex_(nShower, randomSeeds, heModel, maxDetail,
heModel,
maxDetail,
#ifdef CONEX_EXTENSIONS #ifdef CONEX_EXTENSIONS
particleListMode, particleListMode,
#endif #endif
configPath.c_str(), configPath.c_str(), configPath.size());
configPath.size());
double eprima = primaryEnergy / 1_GeV; double eprima = primaryEnergy / 1_GeV;
...@@ -209,6 +207,6 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis s ...@@ -209,6 +207,6 @@ CONEXSourceCut::CONEXSourceCut(geometry::Point center, environment::ShowerAxis s
std::array<int, 3> ioseed{static_cast<int>(rng()), static_cast<int>(rng()), std::array<int, 3> ioseed{static_cast<int>(rng()), static_cast<int>(rng()),
static_cast<int>(rng())}; static_cast<int>(rng())};
//conex_.ConexRun(ipart, eprima, theta, phi, dimpact, ioseed.data()); // conex_.ConexRun(ipart, eprima, theta, phi, dimpact, ioseed.data());
conex::conexrun_(ipart, eprima, theta, phi, dimpact, ioseed.data()); conex::conexrun_(ipart, eprima, theta, phi, dimpact, ioseed.data());
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
namespace conex { namespace conex {
corsika::units::si::LengthType constexpr earthRadius{6371315 * corsika::units::si::LengthType constexpr earthRadius{6371315 *
corsika::units::si::meter}; corsika::units::si::meter};
} // namespace conex } // namespace conex
namespace corsika::process { namespace corsika::process {
...@@ -45,7 +45,7 @@ namespace corsika::process { ...@@ -45,7 +45,7 @@ namespace corsika::process {
void SolveCE(); void SolveCE();
private: private:
//ConexDynamicInterface conex_; // ConexDynamicInterface conex_;
//! CONEX e.m. particle codes //! CONEX e.m. particle codes
static std::array<std::pair<particles::Code, int>, 3> constexpr egs_em_codes_{ static std::array<std::pair<particles::Code, int>, 3> constexpr egs_em_codes_{
......
...@@ -19,33 +19,32 @@ ...@@ -19,33 +19,32 @@
#include <conexHEModels.h> #include <conexHEModels.h>
namespace conex { namespace conex {
extern "C" { extern "C" {
// ipart,energy,theta,phi,dimpact,ioseed // ipart,energy,theta,phi,dimpact,ioseed
void initconex_(int&, int*, int&, int&, void initconex_(int&, int*, int&, int&,
#ifdef CONEX_EXTENSIONS #ifdef CONEX_EXTENSIONS
int&, int&,
#endif #endif
const char*, int); const char*, int);
void conexrun_(int& ipart, double& energy, double& theta, double& phi, double& void conexrun_(int& ipart, double& energy, double& theta, double& phi, double& dimpact,
dimpact, int ioseed[3]); int ioseed[3]);
void conexcascade_(); void conexcascade_();
void hadroncascade_(int&, int&, int&, void hadroncascade_(int&, int&, int&, int&);
int&); void solvemomentequations_(int&);
void solvemomentequations_(int&); void show_(int& iqi, double& ei, double& xmi, double& ymi, double& zmi, double& dmi,
void show_(int& iqi, double& ei, double& xmi, double& xi, double& yi, double& zi, double& tmi, double& ui, double& vi,
double& ymi, double& zmi, double& dmi, double& xi, double& yi, double& zi, double& double& wi, int& iri, double& wti, int& latchi);
tmi, double& ui, double& vi, double& wi, int& iri, double& wti, int& latchi);
int get_number_of_depth_bins_();
int get_number_of_depth_bins_();
void get_shower_data_(const int&, const int&, const int&, float&, float&, float&,
void get_shower_data_(const int&, const int&, const int&, float&, float&, float&, float&);
float&, float&, float&); void get_shower_edep_(const int&, const int&, float&, float&);
void get_shower_edep_(const int&, const int&, float&, float&); void get_shower_muon_(const int&, const int&, float&, float&);
void get_shower_muon_(const int&, const int&, float&, float&); void get_shower_gamma_(const int&, const int&, float&);
void get_shower_gamma_(const int&, const int&, float&); void get_shower_electron_(const int&, const int&, float&);
void get_shower_electron_(const int&, const int&, float&); void get_shower_hadron_(const int&, const int&, float&);
void get_shower_hadron_(const int&, const int&, float&); }
}
} // namespace conex
}
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