Jpp  17.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JACoeffSource.hh
Go to the documentation of this file.
1 #ifndef __JPHYSICS__JACOEFFSOURCE__
2 #define __JPHYSICS__JACOEFFSOURCE__
3 
5 
6 #include "JPhysics/JRadiation.hh"
7 
8 
9 /**
10  * \author mdejong
11  */
12 
13 namespace JPHYSICS {}
14 namespace JPP { using namespace JPHYSICS; }
15 
16 namespace JPHYSICS {
17 
19 
20 
21  /**
22  * Interface for calculation of ionization constant.
23  */
25  public:
26  /**
27  * Virtual destructor.
28  */
30  {}
31 
32  /**
33  * Get ionization constant a.
34  *
35  * \param E muon energy [GeV]
36  * \return ionization constant [GeV/m]
37  */
38  virtual double getA(const double E) const = 0;
39  };
40 
41 
42  /**
43  * Implementation for calculation of ionization constant.
44 
45  * This class implements the JACoeffInterface interface.\n
46  * N.B: This class owns the object pointed to using JLANG::JSharedPointer.
47  */
48  class JACoeffSource :
49  public JACoeffInterface,
50  public JSharedPointer<JRadiation>
51  {
52  public:
53  /**
54  * Constructor.
55  *
56  * \param radiation pointer to valid JRadition object
57  * \param density mass density of radiation material [gr/cm³]
58  */
60  const double density) :
61  JSharedPointer<JRadiation>(radiation),
62  rho(density)
63  {}
64 
65 
66  /**
67  * Get ionization constant a.
68  *
69  * \param E muon energy [GeV]
70  * \return ionization constant [GeV/m]
71  */
72  virtual double getA(const double E) const override
73  {
74  return (*this)->CalculateACoeff(E) * rho * 1.0e6;
75  }
76 
77  protected:
78  const double rho;
79  };
80 }
81 
82 #endif
then usage E
Definition: JMuonPostfit.sh:35
Implementation for calculation of ionization constant.
Muon radiative cross sections.
The template JSharedPointer class can be used to share a pointer to an object.
Auxiliary class for the calculation of the muon radiative cross sections.
Definition: JRadiation.hh:34
JACoeffSource(const JSharedPointer< JRadiation > &radiation, const double density)
Constructor.
virtual double getA(const double E) const override
Get ionization constant a.
virtual ~JACoeffInterface()
Virtual destructor.
virtual double getA(const double E) const =0
Get ionization constant a.
Interface for calculation of ionization constant.