IAP GITLAB

Skip to content
Snippets Groups Projects

Neutrino interactions with pythia 8310

Merged Felix Riehn requested to merge neutrino-interactions-with-pythia-8245 into master
All threads resolved!
1 file
+ 8
3
Compare changes
  • Side-by-side
  • Inline
/*
* (c) Copyright 2024 CORSIKA Project, corsika-project@lists.kit.edu
*
* This software is distributed under the terms of the GNU General Public
* Licence version 3 (GPL Version 3). See file LICENSE for a full version of
* the license.
*/
#pragma once
#include <tuple>
#include <boost/filesystem/path.hpp>
#include <corsika/framework/utility/CorsikaData.hpp>
#include <corsika/framework/core/ParticleProperties.hpp>
#include <corsika/framework/core/PhysicalUnits.hpp>
#include <corsika/framework/random/RNGManager.hpp>
#include <corsika/framework/process/InteractionProcess.hpp>
#include <corsika/modules/pythia8/Pythia8.hpp>
namespace corsika::pythia8 {
using HEPEnergyTypeSqr = decltype(1_GeV * 1_GeV);
class NeutrinoInteraction : public InteractionProcess<NeutrinoInteraction> {
public:
NeutrinoInteraction(bool const& handleNC = true, bool const& handleCC = true,
bool const print_listing = false);
~NeutrinoInteraction();
/**
* Returns inelastic (production) cross section.
*
* This cross section must correspond to the process described in doInteraction.
* Allowed targets are: nuclei or single nucleons (p,n,hydrogen).
*
* @param projectile is the Code of the projectile
* @param target is the Code of the target
* @param projectileP4 is the four momentum of the projectile
* @param targetP4 is the four momentum of the target
*
* @return inelastic cross section
*/
/* NOTE: the cross section for neutrino interactions is fixed to an arbitrary small
* value. This is needed just so the interaction process is not skipped in the process
* loop when the interaction is forced. If needed the exact value could be made
* accessible. */
CrossSectionType getCrossSection(Code const projectile, Code const target,
FourMomentum const& projectileP4,
FourMomentum const& targetP4) const {
if (isValid(projectile, target, projectileP4, targetP4))
return cross_section_;
else
return CrossSectionType::zero();
};
bool isValid(Code const projectileId, [[maybe_unused]] Code const targetId,
FourMomentum const& projectileP4, FourMomentum const& targetP4) const {
auto const S = (projectileP4 + targetP4).getNormSqr();
return is_neutrino(projectileId) &&
(is_nucleus(targetId) || targetId == Code::Proton ||
targetId == Code::Neutron) &&
S >= minQ2_;
};
/**
* In this function PYTHIA is called to produce one event. The
* event is copied (and boosted) into the shower lab frame.
*/
template <typename TView>
void doInteraction(TView& output, Code const projectileId, Code const targetId,
FourMomentum const& projectileP4, FourMomentum const& targetP4);
private:
CrossSectionType const cross_section_ = 4_nb;
int count_ = 0;
bool const print_listing_ = false;
bool const handle_nc_ = true;
bool const handle_cc_ = true;
HEPEnergyTypeSqr minQ2_ = 25_GeV * 1_GeV;
Pythia8::Pythia pythiaMain_;
};
} // namespace corsika::pythia8
#include <corsika/detail/modules/pythia8/NeutrinoInteraction.inl>
\ No newline at end of file
Loading