IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 26da741b authored by Felix Riehn's avatar Felix Riehn
Browse files

removed conversion map added ifs

parent c3fd7982
No related branches found
No related tags found
No related merge requests found
...@@ -244,12 +244,9 @@ namespace corsika::process::sibyll { ...@@ -244,12 +244,9 @@ namespace corsika::process::sibyll {
const auto mediumComposition = currentNode->GetModelProperties().GetNuclearComposition(); const auto mediumComposition = currentNode->GetModelProperties().GetNuclearComposition();
// get cross sections and nucleon number for target materials // get cross sections and nucleon number for target materials
std::vector<si::CrossSectionType> cross_section_components; std::vector<si::CrossSectionType> cross_section_components;
// conversion map for target code, should be in ParticleConversion.h
std::map<corsika::particles::Code,int> corsika2sibyll_target_code;
for(auto targetId: mediumComposition.GetComponents() ){ for(auto targetId: mediumComposition.GetComponents() ){
const auto [sigProd, nNuc] = GetCrossSection( corsikaBeamId, targetId, Ecm); const auto [sigProd, nNuc] = GetCrossSection( corsikaBeamId, targetId, Ecm);
cross_section_components.push_back( sigProd ); cross_section_components.push_back( sigProd );
corsika2sibyll_target_code.insert( std::pair<corsika::particles::Code,int>(targetId , nNuc)) ;
} }
// this routine could be moved to the environment as GetTarget( std::vector<si::CrossSectionType> ) // this routine could be moved to the environment as GetTarget( std::vector<si::CrossSectionType> )
...@@ -277,8 +274,20 @@ namespace corsika::process::sibyll { ...@@ -277,8 +274,20 @@ namespace corsika::process::sibyll {
}; };
const auto targetCode = sample_target( mediumComposition, cross_section_components ); const auto targetCode = sample_target( mediumComposition, cross_section_components );
cout << "Interaction: target selected: " << targetCode << endl; cout << "Interaction: target selected: " << targetCode << endl;
const auto targetSibCode = corsika2sibyll_target_code.at( targetCode ); /*
FOR NOW: allow nuclei with A<18 or protons only.
when medium composition becomes more complex, approximations will have to be allowed
air in atmosphere also contains some Argon.
*/
int targetSibCode = -1;
if( IsNucleus(targetCode))
targetSibCode = GetNucleusA( targetCode );
if( targetCode == corsika::particles::Proton::GetCode())
targetSibCode = 1;
cout << "Interaction: sibyll code: " << targetSibCode << endl; cout << "Interaction: sibyll code: " << targetSibCode << endl;
if(targetSibCode>18||targetSibCode<1)
throw std::runtime_error("Sibyll target outside range. Only nuclei with A<18 or protons are allowed.");
/* /*
get transformation between Stack-frame and SibStack-frame get transformation between Stack-frame and SibStack-frame
for EAS Stack-frame is lab. frame, could be different for CRMC-mode for EAS Stack-frame is lab. frame, could be different for CRMC-mode
......
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