Ejemplo n.º 1
0
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);
}
Ejemplo n.º 2
0
bool EmissionMap::drawDirection(const ParticleState& state, Vector3d& direction) const {
	return drawDirection(state.getId(), state.getEnergy(), direction);
}
Ejemplo n.º 3
0
bool EmissionMap::checkDirection(const ParticleState& state) const {
	return checkDirection(state.getId(), state.getEnergy(), state.getDirection());
}
Ejemplo n.º 4
0
void EmissionMap::fillMap(const ParticleState& state, double weight) {
	fillMap(state.getId(), state.getEnergy(), state.getDirection(), weight);
}