Program Listing for File ConstantDensity.h

Return to documentation for file (include/crpropa/massDistribution/ConstantDensity.h)

#ifndef CRPROPA_CONSTANTDENSITY_H
#define CRPROPA_CONSTANTDENSITY_H

#include "crpropa/massDistribution/Density.h"

#include <cmath>
#include <sstream>
#include <string>

namespace crpropa {

/*
@class ConstantDensity
@brief Density module for Constant densities in HI, HII and H2 component.
*/
class ConstantDensity: public Density {
private:
        // default mode: all density types set to 0 and no activ component
        double HIdensitynumber  = 0;
        double HIIdensitynumber = 0;
        double H2densitynumber  = 0;
        bool isHI = false;
        bool isHII = false;
        bool isH2 = false;
public:
        ConstantDensity(double HI, double HII, double H2);

        double getDensity(const Vector3d &position) const;
        double getHIDensity(const Vector3d &position) const;
        double getHIIDensity(const Vector3d &position) const;
        double getH2Density(const Vector3d &position) const;
        double getNucleonDensity(const Vector3d &position) const;

        bool getIsForHI();
        bool getIsForHII();
        bool getIsForH2();

        void setHI(bool activate, double densityNumber);
        void setHI(bool activate);
        void setHI(double densityNumber);

        void setHII(bool activate, double densityNumber);
        void setHII(bool activate);
        void setHII(double densityNumber);

        void setH2(bool activate, double densityNumber);
        void setH2(bool activate);
        void setH2(double densityNumber);

        std::string getDescription();
};

}  // namespace crpropa

#endif  // CRPROPA_CONSTANTDENSITY_H