IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 56db68b6 authored by Nikos Karastathis's avatar Nikos Karastathis :ocean:
Browse files

small updates to radio shower 2 example

parent 7b2cb8f3
No related branches found
No related tags found
1 merge request!329Radio interface
...@@ -62,19 +62,20 @@ using namespace corsika; ...@@ -62,19 +62,20 @@ using namespace corsika;
using namespace std; using namespace std;
// //
// The example main program for a particle cascade // A simple shower to get the electric field trace of an electron
// //
int main() { int main() {
logging::set_level(logging::level::info); logging::set_level(logging::level::info);
corsika_logger->set_pattern("[%n:%^%-8l%$] custom pattern: %v"); corsika_logger->set_pattern("[%n:%^%-8l%$] custom pattern: %v");
std::cout << "cascade_proton_example" << std::endl; std::cout << "radio_shower2" << std::endl;
feenableexcept(FE_INVALID); feenableexcept(FE_INVALID);
// initialize random number sequence(s) // initialize random number sequence(s)
RNGManager::getInstance().registerRandomStream("cascade"); RNGManager::getInstance().registerRandomStream("cascade");
// This environment needs a hardcoded refractive index in the propagator at the moment
// setup environment, geometry // setup environment, geometry
using EnvType = setup::Environment; using EnvType = setup::Environment;
EnvType env; EnvType env;
...@@ -145,36 +146,22 @@ int main() { ...@@ -145,36 +146,22 @@ int main() {
setup::Tracking tracking; setup::Tracking tracking;
StackInspector<setup::Stack> stackInspect(1, true, E0); StackInspector<setup::Stack> stackInspect(1, true, E0);
// ParticleCut cut(60_GeV, true, true);
// put radio process here // put radio process here
RadioProcess<decltype(detector), CoREAS<decltype(detector), RadioProcess<decltype(detector), CoREAS<decltype(detector),
decltype(StraightPropagator(env))>, decltype(StraightPropagator(env))> decltype(StraightPropagator(env))>, decltype(StraightPropagator(env))>
coreas(detector, env); coreas(detector, env);
TrackWriter trackWriter("tracks.dat"); TrackWriter trackWriter("tracks.dat");
ShowerAxis const showerAxis{injectionPos, Vector{rootCS, 0_m, 0_m, -100_km}, env}; ShowerAxis const showerAxis{injectionPos, Vector{rootCS, 0_m, 0_m, -100_km}, env};
// BetheBlochPDG eLoss{showerAxis};
// assemble all processes into an ordered process list // assemble all processes into an ordered process list
// auto sequence = make_sequence(sibyll, sibyllNuc, decay, eLoss, cut, trackWriter,
// stackInspect); auto sequence = make_sequence(sibyll, decay, eLoss, cut, trackWriter,
// stackInspect);
auto sequence = make_sequence(coreas, trackWriter, stackInspect); auto sequence = make_sequence(coreas, trackWriter, stackInspect);
// define air shower object, run simulation // define air shower object, run simulation
Cascade EAS(env, tracking, sequence, stack); Cascade EAS(env, tracking, sequence, stack);
EAS.run(); EAS.run();
cout << "Result: E0=" << E0 / 1_GeV << endl;
cut.showResults();
const HEPEnergyType Efinal =
cut.getCutEnergy() + cut.getInvEnergy() + cut.getEmEnergy();
cout << "total energy (GeV): " << Efinal / 1_GeV << endl
<< "relative difference (%): " << (Efinal / E0 - 1.) * 100 << endl;
// get radio output // get radio output
coreas.writeOutput(); coreas.writeOutput();
} }
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