PropagationCK::Y PropagationCK::dYdt(const Y &y, ParticleState &p, double z) const { // normalize direction vector to prevent numerical losses Vector3d velocity = y.u.getUnitVector() * c_light; Vector3d B(0, 0, 0); try { B = field->getField(y.x, z); } catch (std::exception &e) { std::cerr << "PropagationCK: Exception in getField." << std::endl; std::cerr << e.what() << std::endl; } // Lorentz force: du/dt = q*c/E * (v x B) Vector3d dudt = p.getCharge() * c_light / p.getEnergy() * velocity.cross(B); return Y(velocity, dudt); }
bool EmissionMap::drawDirection(const ParticleState& state, Vector3d& direction) const { return drawDirection(state.getId(), state.getEnergy(), direction); }
bool EmissionMap::checkDirection(const ParticleState& state) const { return checkDirection(state.getId(), state.getEnergy(), state.getDirection()); }
void EmissionMap::fillMap(const ParticleState& state, double weight) { fillMap(state.getId(), state.getEnergy(), state.getDirection(), weight); }