Line data Source code
1 : #ifndef CRPROPA_DENSITY_H
2 : #define CRPROPA_DENSITY_H
3 :
4 : #include "crpropa/Units.h"
5 : #include "crpropa/Vector3.h"
6 : #include "crpropa/Referenced.h"
7 :
8 : namespace crpropa {
9 :
10 : /**
11 : @class Density
12 : @brief Abstract base class for target densities
13 : */
14 0 : class Density: public Referenced {
15 : public:
16 0 : virtual ~Density() {
17 0 : }
18 :
19 0 : virtual double getDensity(const Vector3d &position) const { // sum of all densities
20 0 : return 0;
21 : }
22 :
23 0 : virtual double getHIDensity(const Vector3d &position) const {
24 0 : return 0;
25 : }
26 :
27 0 : virtual double getHIIDensity(const Vector3d &position) const {
28 0 : return 0;
29 : }
30 :
31 0 : virtual double getH2Density(const Vector3d &position) const {
32 0 : return 0;
33 : }
34 :
35 0 : virtual double getNucleonDensity(const Vector3d &position) const { // sum of nucleons (H2 with factor 2)
36 0 : return 0;
37 : }
38 :
39 0 : virtual bool getIsForHI() {
40 0 : return false;
41 : }
42 :
43 0 : virtual bool getIsForHII() {
44 0 : return false;
45 : }
46 :
47 0 : virtual bool getIsForH2() {
48 0 : return false;
49 : }
50 :
51 0 : virtual std::string getDescription() {
52 0 : return "Abstract Density Module\n";
53 : }
54 : };
55 :
56 : } // namespace crpropa
57 :
58 : #endif // CRPROPA_DENSITY_H
|