IAP GITLAB

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

Merge branch 'include_proposal_process_rebase' of...

Merge branch 'include_proposal_process_rebase' of gitlab.ikp.kit.edu:AirShowerPhysics/corsika into include_proposal_process_rebase
parents 76e7e83a bc449f78
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,13 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons ...@@ -41,7 +41,13 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
const int binEnd = std::floor(grammageEnd / dX_); const int binEnd = std::floor(grammageEnd / dX_);
for (int b = binStart; b <= binEnd; ++b) { for (int b = binStart; b <= binEnd; ++b) {
if (pid == particles::Code::MuPlus) { if (pid == particles::Code::Gamma) {
profiles_.at(b)[ProfileIndex::Gamma]++;
} else if (pid == particles::Code::Positron) {
profiles_.at(b)[ProfileIndex::Positron]++;
} else if (pid == particles::Code::Electron) {
profiles_.at(b)[ProfileIndex::Electron]++;
} else if (pid == particles::Code::MuPlus) {
profiles_.at(b)[ProfileIndex::MuPlus]++; profiles_.at(b)[ProfileIndex::MuPlus]++;
} else if (pid == particles::Code::MuMinus) { } else if (pid == particles::Code::MuMinus) {
profiles_.at(b)[ProfileIndex::MuMinus]++; profiles_.at(b)[ProfileIndex::MuMinus]++;
...@@ -55,7 +61,7 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons ...@@ -55,7 +61,7 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
void LongitudinalProfile::save(std::string const& filename) { void LongitudinalProfile::save(std::string const& filename) {
std::ofstream f{filename}; std::ofstream f{filename};
f << "# X / g·cm¯², mu+, mu-, all hadrons" << std::endl; f << "# X / g·cm¯², gamma, e+, e-, mu+, mu-, all hadrons" << std::endl;
for (size_t b = 0; b < profiles_.size(); ++b) { for (size_t b = 0; b < profiles_.size(); ++b) {
f << std::setprecision(5) << std::setw(11) << b * (dX_ / (1_g / 1_cm / 1_cm)); f << std::setprecision(5) << std::setw(11) << b * (dX_ / (1_g / 1_cm / 1_cm));
for (auto const& N : profiles_.at(b)) { for (auto const& N : profiles_.at(b)) {
......
...@@ -43,8 +43,15 @@ namespace corsika::process::longitudinal_profile { ...@@ -43,8 +43,15 @@ namespace corsika::process::longitudinal_profile {
}); // profile binning }); // profile binning
environment::ShowerAxis const& shower_axis_; environment::ShowerAxis const& shower_axis_;
using ProfileEntry = std::array<uint32_t, 3>; using ProfileEntry = std::array<uint32_t, 6>;
enum ProfileIndex { MuPlus = 0, MuMinus = 1, Hadron = 2 }; enum ProfileIndex {
Gamma = 0,
Positron = 1,
Electron = 2,
MuPlus = 3,
MuMinus = 4,
Hadron = 5
};
std::vector<ProfileEntry> profiles_; // longitudinal profile std::vector<ProfileEntry> profiles_; // longitudinal profile
static int const width_ = 14; static int const width_ = 14;
......
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