Program Listing for File MomentumDiffusion.h
↰ Return to documentation for file (include/crpropa/module/MomentumDiffusion.h
)
#ifndef CRPROPA_MOMENTUMDIFFUSION_H
#define CRPROPA_MOMENTUMDIFFUSION_H
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <cstdlib>
#include <stdexcept>
#include <crpropa/Module.h>
#include <crpropa/Units.h>
#include <crpropa/Random.h>
#include "kiss/logger.h"
namespace crpropa {
class ConstantMomentumDiffusion: public Module {
private:
double Dpp; // Diffusion coefficient
double limit; // maximal fractional energy loss
public:
ConstantMomentumDiffusion(double Dpp);
ConstantMomentumDiffusion(double Dpp, double limit);
void process(Candidate *candidate) const;
double calculateAScalar(double p) const;
double calculateBScalar() const;
void setLimit(double l);
void setDpp(double Dpp);
double getLimit() const;
double getDpp() const;
std::string getDescription() const;
};
}; //end namespace crpropa
#endif // CRPROPA_MOMENTUMDIFFUSION_H