IAP GITLAB

Skip to content
Snippets Groups Projects
Commit e94dab23 authored by Felix Riehn's avatar Felix Riehn Committed by Maximilian Reininghaus
Browse files

proposal logger, set appropriate levels

parent e41cad09
No related branches found
No related tags found
1 merge request!430Resolve "Connection between PROPOSAL and hadronic interaction models"
...@@ -25,14 +25,15 @@ namespace corsika::proposal { ...@@ -25,14 +25,15 @@ namespace corsika::proposal {
HEPEnergyType const sqrtS = HEPEnergyType const sqrtS =
calculate_com_energy(_heenthresholdNN, Rho0::mass, Proton::mass); calculate_com_energy(_heenthresholdNN, Rho0::mass, Proton::mass);
if (!heHadronicInteraction_.isValid(Code::Rho0, Code::Proton, sqrtS)) { if (!heHadronicInteraction_.isValid(Code::Rho0, Code::Proton, sqrtS)) {
CORSIKA_LOG_ERROR( CORSIKA_LOGGER_CRITICAL(
logger_,
"Invalid energy threshold for hadron interaction model. theshold_lab= {} GeV, " "Invalid energy threshold for hadron interaction model. theshold_lab= {} GeV, "
"theshold_com={} GeV", "theshold_com={} GeV",
_heenthresholdNN / 1_GeV, sqrtS / 1_GeV); _heenthresholdNN / 1_GeV, sqrtS / 1_GeV);
throw std::runtime_error("Configuration error!"); throw std::runtime_error("Configuration error!");
} }
CORSIKA_LOG_INFO( CORSIKA_LOGGER_DEBUG(
"Threshold for HE hadronic interactions in proposal set to Elab={} GeV", logger_, "Threshold for HE hadronic interactions in proposal set to Elab={} GeV",
_heenthresholdNN / 1_GeV); _heenthresholdNN / 1_GeV);
}; };
...@@ -42,8 +43,8 @@ namespace corsika::proposal { ...@@ -42,8 +43,8 @@ namespace corsika::proposal {
TStackView& view, CoordinateSystemPtr const& labCS, FourMomentum const& photonP4, TStackView& view, CoordinateSystemPtr const& labCS, FourMomentum const& photonP4,
Code const& targetId) { Code const& targetId) {
if (photonP4.getTimeLikeComponent() > heHadronicModelThresholdLabNN_) { if (photonP4.getTimeLikeComponent() > heHadronicModelThresholdLabNN_) {
CORSIKA_LOG_INFO( CORSIKA_LOGGER_TRACE(
"HE photo-hadronic interaction! calling hadronic interaction model.."); logger_, "HE photo-hadronic interaction! calling hadronic interaction model..");
// copy from sibyll::NuclearInteractionModel // copy from sibyll::NuclearInteractionModel
// temporarily add to stack, will be removed after interaction in DoInteraction // temporarily add to stack, will be removed after interaction in DoInteraction
...@@ -63,8 +64,9 @@ namespace corsika::proposal { ...@@ -63,8 +64,9 @@ namespace corsika::proposal {
TStackView photon_secondaries(hadronicPhoton); TStackView photon_secondaries(hadronicPhoton);
// call inner hadronic event generator // call inner hadronic event generator
CORSIKA_LOG_INFO("{} + {} interaction. Ekinlab = {} GeV", hadPhotonCode, targetId, CORSIKA_LOGGER_TRACE(logger_, "{} + {} interaction. Ekinlab = {} GeV",
photonP4.getTimeLikeComponent() / 1_GeV); hadPhotonCode, targetId,
photonP4.getTimeLikeComponent() / 1_GeV);
heHadronicInteraction_.doInteraction(photon_secondaries, hadPhotonCode, targetId, heHadronicInteraction_.doInteraction(photon_secondaries, hadPhotonCode, targetId,
photonP4, targetP4); photonP4, targetP4);
for (const auto& pSec : photon_secondaries) { for (const auto& pSec : photon_secondaries) {
...@@ -74,10 +76,10 @@ namespace corsika::proposal { ...@@ -74,10 +76,10 @@ namespace corsika::proposal {
calculate_kinetic_energy(p3lab.getNorm(), get_mass(pid)); calculate_kinetic_energy(p3lab.getNorm(), get_mass(pid));
view.addSecondary(std::make_tuple(pid, secEkin, p3lab.normalized())); view.addSecondary(std::make_tuple(pid, secEkin, p3lab.normalized()));
} }
CORSIKA_LOG_INFO("number of particles produced: {}", view.getEntries());
} else { } else {
CORSIKA_LOG_INFO( CORSIKA_LOGGER_TRACE(
"LE photo-hadronic interaction! production of secondaries not implemented.."); logger_,
"LE photo-hadronic interaction! Production of secondaries not implemented..");
} }
return ProcessReturn::Ok; return ProcessReturn::Ok;
} }
......
...@@ -124,7 +124,8 @@ namespace corsika::proposal { ...@@ -124,7 +124,8 @@ namespace corsika::proposal {
auto const A = int(target.GetAtomicNum()); auto const A = int(target.GetAtomicNum());
auto const Z = int(target.GetNucCharge()); auto const Z = int(target.GetNucCharge());
Code const targetId = get_nucleus_code(A, Z); Code const targetId = get_nucleus_code(A, Z);
CORSIKA_LOG_INFO( CORSIKA_LOGGER_DEBUG(
logger_,
"photo-hadronic interaction of projectile={} with target={}! Energy={} GeV", "photo-hadronic interaction of projectile={} with target={}! Energy={} GeV",
projectileId, targetId, E / 1_GeV); projectileId, targetId, E / 1_GeV);
this->doHadronicPhotonInteraction(view, labCS, photonP4, targetId); this->doHadronicPhotonInteraction(view, labCS, photonP4, targetId);
......
...@@ -35,6 +35,7 @@ namespace corsika::proposal { ...@@ -35,6 +35,7 @@ namespace corsika::proposal {
FourMomentum const&, Code const&); FourMomentum const&, Code const&);
private: private:
inline static auto logger_{get_logger("corsika_proposal_HadronicPhotonModel")};
THadronicModel& heHadronicInteraction_; THadronicModel& heHadronicInteraction_;
//! threshold for high energy hadronic interaction model. Lab. energy per nucleon //! threshold for high energy hadronic interaction model. Lab. energy per nucleon
HEPEnergyType heHadronicModelThresholdLabNN_; HEPEnergyType heHadronicModelThresholdLabNN_;
......
...@@ -49,6 +49,8 @@ namespace corsika::proposal { ...@@ -49,6 +49,8 @@ namespace corsika::proposal {
//! //!
void buildCalculator(Code, NuclearComposition const&) final; void buildCalculator(Code, NuclearComposition const&) final;
inline static auto logger_{get_logger("corsika_proposal_InteractionModel")};
public: public:
//! //!
//! Produces the stoachastic loss calculator for leptons based on nuclear //! Produces the stoachastic loss calculator for leptons based on nuclear
......
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