LCOV - code coverage report
Current view: top level - src/massDistribution - Cordes.cpp (source / functions) Hit Total Coverage
Test: coverage.info.cleaned Lines: 16 21 76.2 %
Date: 2024-04-29 14:43:01 Functions: 6 7 85.7 %

          Line data    Source code
       1             : #include "crpropa/massDistribution/Cordes.h"
       2             : #include "crpropa/Common.h"
       3             : 
       4             : #include <sstream>
       5             : 
       6             : namespace crpropa {
       7             : 
       8           4 : double Cordes::getHIIDensity(const Vector3d &position) const {
       9             :         double n=0;  // in m^-3
      10             : 
      11           4 :         double z=position.z;
      12           4 :         double R = sqrt(position.x*position.x+position.y*position.y);  //radius in galactic disk
      13             : 
      14           4 :         n += 0.025/ccm*exp(-fabs(z)/(1*kpc))*exp(-pow_integer<2>(R/(20*kpc)));  // galactocentric component
      15           4 :         n += 0.2/ccm*exp(-fabs(z)/(0.15*kpc))*exp(-pow_integer<2>((R-4*kpc)/(2*kpc)));  // anular component
      16             : 
      17           4 :         return n;
      18             : }
      19             : 
      20           2 : double Cordes::getDensity(const Vector3d &position) const {
      21           2 :         return Cordes::getHIIDensity(position);
      22             : }
      23             : 
      24           1 : double Cordes::getNucleonDensity(const Vector3d &position) const {
      25           1 :         return getHIIDensity(position);
      26             : }
      27             : 
      28           1 : bool Cordes::getIsForHI() {
      29           1 :         return isforHI;
      30             : }
      31             : 
      32           1 : bool Cordes::getIsForHII() {
      33           1 :         return isforHII;
      34             : }
      35             : 
      36           1 : bool Cordes::getIsForH2() {
      37           1 :         return isforH2;
      38             : }
      39             : 
      40           0 : std::string Cordes::getDescription() {
      41           0 :         std::stringstream s;
      42           0 :         s << "Density Cordes: includes only an HII component";
      43           0 :         return s.str();
      44           0 : }
      45             : 
      46             : }  // namespace crpropa

Generated by: LCOV version 1.14