IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 826f0f04 authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Maximilian Reininghaus
Browse files

proper calculation for inclined shower

parent 23db971f
No related branches found
No related tags found
No related merge requests found
...@@ -75,8 +75,8 @@ int main(int argc, char** argv) { ...@@ -75,8 +75,8 @@ int main(int argc, char** argv) {
using EnvType = Environment<setup::IEnvironmentModel>; using EnvType = Environment<setup::IEnvironmentModel>;
EnvType env; EnvType env;
const CoordinateSystem& rootCS = env.GetCoordinateSystem(); const CoordinateSystem& rootCS = env.GetCoordinateSystem();
Point const center{rootCS, 0_m, 0_m, 0_m};
environment::LayeredSphericalAtmosphereBuilder builder(Point{rootCS, 0_m, 0_m, 0_m}); environment::LayeredSphericalAtmosphereBuilder builder{center};
builder.setNuclearComposition( builder.setNuclearComposition(
{{particles::Code::Nitrogen, particles::Code::Oxygen}, {{particles::Code::Nitrogen, particles::Code::Oxygen},
{0.7847f, 1.f - 0.7847f}}); // values taken from AIRES manual, Ar removed for now {0.7847f, 1.f - 0.7847f}}); // values taken from AIRES manual, Ar removed for now
...@@ -97,29 +97,31 @@ int main(int argc, char** argv) { ...@@ -97,29 +97,31 @@ int main(int argc, char** argv) {
unsigned short Z = std::stoi(std::string(argv[2])); unsigned short Z = std::stoi(std::string(argv[2]));
auto const mass = particles::GetNucleusMass(A, Z); auto const mass = particles::GetNucleusMass(A, Z);
const HEPEnergyType E0 = 1_GeV * std::stof(std::string(argv[3])); const HEPEnergyType E0 = 1_GeV * std::stof(std::string(argv[3]));
double theta = 0.; double theta = 75.;
double phi = 0.; auto const thetaRad = theta / 180. * M_PI;
Point const injectionPos(
rootCS, 0_m, 0_m,
112.7_km +
builder.earthRadius); // this is the CORSIKA 7 start of atmosphere/universe
// {
auto elab2plab = [](HEPEnergyType Elab, HEPMassType m) { auto elab2plab = [](HEPEnergyType Elab, HEPMassType m) {
return sqrt((Elab - m) * (Elab + m)); return sqrt((Elab - m) * (Elab + m));
}; };
HEPMomentumType P0 = elab2plab(E0, mass); HEPMomentumType P0 = elab2plab(E0, mass);
auto momentumComponents = [](double theta, double phi, HEPMomentumType ptot) { auto momentumComponents = [](double thetaRad, HEPMomentumType ptot) {
return std::make_tuple(ptot * sin(theta) * cos(phi), ptot * sin(theta) * sin(phi), return std::make_tuple(ptot * sin(thetaRad), 0_eV, -ptot * cos(thetaRad));
-ptot * cos(theta));
}; };
auto const [px, py, pz] = auto const [px, py, pz] =
momentumComponents(theta / 180. * M_PI, phi / 180. * M_PI, P0); momentumComponents(thetaRad, P0);
auto plab = corsika::stack::MomentumVector(rootCS, {px, py, pz}); auto plab = corsika::stack::MomentumVector(rootCS, {px, py, pz});
cout << "input particle: " << beamCode << endl; cout << "input particle: " << beamCode << endl;
cout << "input angles: theta=" << theta << " phi=" << phi << endl; cout << "input angles: theta=" << theta << endl;
cout << "input momentum: " << plab.GetComponents() / 1_GeV << endl; cout << "input momentum: " << plab.GetComponents() / 1_GeV << ", norm = " << plab.norm() << endl;
auto const observationHeight = 1.4_km + builder.earthRadius;
auto const injectionHeight = 112.75_km + builder.earthRadius;
auto const t = - observationHeight * cos(thetaRad) + sqrt(- si::detail::static_pow<2>(sin(thetaRad) * observationHeight) + si::detail::static_pow<2>(injectionHeight));
Point const showerCore{rootCS, 0_m, 0_m, observationHeight};
Point const injectionPos = showerCore + Vector<dimensionless_d>{rootCS, {-sin(thetaRad), 0, cos(thetaRad)}} * t;
std::cout << "point of injection: " << injectionPos.GetCoordinates() << std::endl;
if (A != 1) { if (A != 1) {
stack.AddParticle(std::tuple<particles::Code, units::si::HEPEnergyType, stack.AddParticle(std::tuple<particles::Code, units::si::HEPEnergyType,
...@@ -136,10 +138,7 @@ int main(int argc, char** argv) { ...@@ -136,10 +138,7 @@ int main(int argc, char** argv) {
Line const line(injectionPos, plab.normalized() * 1_m * 1_Hz); Line const line(injectionPos, plab.normalized() * 1_m * 1_Hz);
auto const velocity = line.GetV0().norm(); auto const velocity = line.GetV0().norm();
setup::Trajectory const showerAxis(line, (injectionPos - showerCore).norm() / velocity);
auto const observationHeight = 1.4_km + builder.earthRadius;
setup::Trajectory const showerAxis(line, (112.7_km - observationHeight) / velocity);
// setup processes, decays and interactions // setup processes, decays and interactions
...@@ -152,32 +151,14 @@ int main(int argc, char** argv) { ...@@ -152,32 +151,14 @@ int main(int argc, char** argv) {
process::pythia::Decay decayPythia; process::pythia::Decay decayPythia;
// use sibyll decay routine for decays of particles unknown to pythia // use sibyll decay routine for decays of particles unknown to pythia
process::sibyll::Decay decaySibyll({ process::sibyll::Decay decaySibyll;
Code::N1440Plus,
Code::N1440MinusBar,
Code::N1440_0,
Code::N1440_0Bar,
Code::N1710Plus,
Code::N1710MinusBar,
Code::N1710_0,
Code::N1710_0Bar,
Code::Pi1300Plus,
Code::Pi1300Minus,
Code::Pi1300_0,
Code::KStar0_1430_0,
Code::KStar0_1430_0Bar,
Code::KStar0_1430_Plus,
Code::KStar0_1430_MinusBar,
});
decaySibyll.PrintDecayConfig(); decaySibyll.PrintDecayConfig();
process::particle_cut::ParticleCut cut(100_GeV); process::particle_cut::ParticleCut cut{60_GeV};
process::energy_loss::EnergyLoss eLoss(showerAxis); process::energy_loss::EnergyLoss eLoss(showerAxis);
Plane const obsPlane(Point(rootCS, 0_m, 0_m, observationHeight), Plane const obsPlane(showerCore,
Vector<dimensionless_d>(rootCS, {0., 0., 1.})); Vector<dimensionless_d>(rootCS, {0., 0., 1.}));
process::observation_plane::ObservationPlane observationLevel(obsPlane, process::observation_plane::ObservationPlane observationLevel(obsPlane,
"particles.dat"); "particles.dat");
...@@ -185,9 +166,10 @@ int main(int argc, char** argv) { ...@@ -185,9 +166,10 @@ int main(int argc, char** argv) {
// assemble all processes into an ordered process list // assemble all processes into an ordered process list
process::UrQMD::UrQMD urqmd; process::UrQMD::UrQMD urqmd;
process::interaction_counter::InteractionCounter urqmdCounted{urqmd};
auto sibyllSequence = sibyllNucCounted << sibyllCounted; auto sibyllSequence = sibyllNucCounted << sibyllCounted;
process::switch_process::SwitchProcess switchProcess(urqmd, sibyllSequence, 55_GeV); process::switch_process::SwitchProcess switchProcess(urqmdCounted, sibyllSequence, 55_GeV);
auto decaySequence = decayPythia << decaySibyll; auto decaySequence = decayPythia << decaySibyll;
auto sequence = switchProcess << decaySequence << eLoss << cut << observationLevel; auto sequence = switchProcess << decaySequence << eLoss << cut << observationLevel;
...@@ -212,10 +194,10 @@ int main(int argc, char** argv) { ...@@ -212,10 +194,10 @@ int main(int argc, char** argv) {
cout << "total dEdX energy (GeV): " << eLoss.GetTotal() / 1_GeV << endl cout << "total dEdX energy (GeV): " << eLoss.GetTotal() / 1_GeV << endl
<< "relative difference (%): " << eLoss.GetTotal() / E0 * 100 << endl; << "relative difference (%): " << eLoss.GetTotal() / E0 * 100 << endl;
auto const hists = sibyllCounted.GetHistogram() + sibyllNucCounted.GetHistogram(); auto const hists = sibyllCounted.GetHistogram() + sibyllNucCounted.GetHistogram() + urqmdCounted.GetHistogram();
hists.saveLab("inthist_lab.txt"); hists.saveLab("inthist_lab.txt");
hists.saveCMS("inthist_cms.txt"); hists.saveCMS("inthist_cms.txt");
std::ofstream finish("finished"); std::ofstream finish("finished");
finish << "run completed without error" << std::endl; finish << "run completed without error" << std::endl;
} }
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