IAP GITLAB

Skip to content
Snippets Groups Projects
Commit bc449f78 authored by Maximilian Sackel's avatar Maximilian Sackel
Browse files

extension of longitudinal shower profile with electro magnetic component

parent c84b912c
No related branches found
No related tags found
1 merge request!245Include proposal process rebase
Pipeline #2214 failed
......@@ -41,7 +41,13 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
const int binEnd = std::floor(grammageEnd / dX_);
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]++;
} else if (pid == particles::Code::MuMinus) {
profiles_.at(b)[ProfileIndex::MuMinus]++;
......@@ -55,7 +61,7 @@ corsika::process::EProcessReturn LongitudinalProfile::DoContinuous(Particle cons
void LongitudinalProfile::save(std::string const& 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) {
f << std::setprecision(5) << std::setw(11) << b * (dX_ / (1_g / 1_cm / 1_cm));
for (auto const& N : profiles_.at(b)) {
......
......@@ -43,8 +43,15 @@ namespace corsika::process::longitudinal_profile {
}); // profile binning
environment::ShowerAxis const& shower_axis_;
using ProfileEntry = std::array<uint32_t, 3>;
enum ProfileIndex { MuPlus = 0, MuMinus = 1, Hadron = 2 };
using ProfileEntry = std::array<uint32_t, 6>;
enum ProfileIndex {
Gamma = 0,
Positron = 1,
Electron = 2,
MuPlus = 3,
MuMinus = 4,
Hadron = 5
};
std::vector<ProfileEntry> profiles_; // longitudinal profile
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