IAP GITLAB

Skip to content

ParticleWriterParquet counts kinetic energies instead of total energies

When calling observationLevel.getEnergyGround() for ParticleWriterParquet, the variable totalEnergy_ is returned. But totalEnergy_ only describes the sum of all kinetic energies (not total energies) that stopped in the observation plane. This is because ObservationPlane::::doContinuous writes the kinetic energy of the particles to ParticleWrtierParquet::write, which also means that we save the sum of all kinetic energies on ground.

This also clashes with the total energy budget check that we do at the end of our example scripts:

    HEPEnergyType const Efinal =
        dEdX.getEnergyLost() + observationLevel.getEnergyGround();

    CORSIKA_LOG_INFO(
        "total energy budget (GeV): {} (dEdX={} ground={}), "
        "relative difference (%): {}",
        Efinal / 1_GeV, dEdX.getEnergyLost() / 1_GeV,
        observationLevel.getEnergyGround() / 1_GeV, (Efinal / E0 - 1) * 100);

Here, Efinal does not include the masses of the particles in the observation plane, so Efinal and E0 would never be identical (E0 is the total energy of the original particle).

One could "fix" this by writing totalEnergy_ += energy + get_mass(pid) here, but I am not entirely sure whether this would be a more useful/consistent information.

Edited by Jean-Marco Alameddine
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information