Line data Source code
1 : #ifndef CRPROPA_NAKANISHI_H 2 : #define CRPROPA_NAKANISHI_H 3 : 4 : #include "crpropa/massDistribution/Density.h" 5 : 6 : #include <cmath> 7 : #include <string> 8 : 9 : namespace crpropa { 10 : /** 11 : @class Nakanishi 12 : @brief Cylindrical symetrical model of the density distribution of the Milky Way for atomic (HI) and molecular (H2) hydrogen 13 : Modell for HI arXiv:astro-ph/0304338 14 : Modell for H2 arxiv:astro-ph/0610769 15 : fit of the models given in arXiv:1607.07886 16 : */ 17 1 : class Nakanishi: public Density { 18 : private: 19 : bool isforHI = true; 20 : bool isforHII = false; 21 : bool isforH2 = true; 22 : 23 : public: 24 : /** @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 25 : @returns density in parts/m^3, only activated parts are summed up */ 26 : double getDensity(const Vector3d &position) const; 27 : /** @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 28 : @returns density of atomic hydrogen in parts/m^3 */ 29 : double getHIDensity(const Vector3d &position) const; 30 : /** @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 31 : @returns density of molecular hydrogen in parts/m^3 */ 32 : double getH2Density(const Vector3d &position) const; 33 : /** @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 34 : @returns nucleon density in parts/m^3, only activated parts are summed up and H2 is weighted twice */ 35 : double getNucleonDensity(const Vector3d &position) const; 36 : 37 : /** the scale height over the galactic plane of atomic hydrogen is fitted by polynom of degree 3 38 : @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 39 : @returns scale height at given position */ 40 : double getHIScaleheight(const Vector3d &position)const; 41 : /** the plane density is fittet by two exponential components with e^-R and e^-(R^2) 42 : @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 43 : @returns plane density in parts/m^3 */ 44 : double getHIPlanedensity(const Vector3d &position)const; 45 : 46 : /** the scale height over the galactic plane of molecular hydrogen is fitted by exponential function 47 : @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 48 : @returns scale height at given position */ 49 : double getH2Scaleheight(const Vector3d &position)const; 50 : /** the plane density is fitted by two exponential components 51 : @param position position in galactic coordinates with Earth at (-8.5kpc, 0, 0) 52 : @returns plane density in parts/m^3 */ 53 : double getH2Planedensity(const Vector3d &position)const; 54 : 55 : /** changes activation status for atomic hydrogen */ 56 : void setIsForHI(bool HI); 57 : /** changes activation status for molecular hydrogen */ 58 : void setIsForH2(bool H2); 59 : 60 : /** @returns activation status for atomic hydrogen */ 61 : bool getIsForHI(); 62 : /** @returns activation status for ionised hydrogen */ 63 : bool getIsForHII(); 64 : /** @returns activation status for molecular hydrogen */ 65 : bool getIsForH2(); 66 : std::string getDescription(); 67 : }; 68 : 69 : } // namespace crpropa 70 : 71 : #endif // CRPROPA_NAKANISHI_H 72 : 73 : 74 :