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