Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JRadiationSource.hh
Go to the documentation of this file.
1#ifndef __JPHYSICS__JRADIATIONSOURCE__
2#define __JPHYSICS__JRADIATIONSOURCE__
3
5
7#include "JPhysics/JDIS.hh"
9
10
11/**
12 * \author mdejong
13 */
14
15namespace JPHYSICS {}
16namespace JPP { using namespace JPHYSICS; }
17
18namespace JPHYSICS {
19
21
22
23 /**
24 * Interface for calculation of inverse interaction length and shower energy.
25 */
27 public:
28 /**
29 * Constructor.
30 *
31 * \param id radiation identifier
32 */
33 JRadiationInterface(const int id) :
34 id(id)
35 {}
36
37 /**
38 * Virtual destructor.
39 */
41 {}
42
43 /**
44 * Get radiation identifer.
45 *
46 * \return identifier
47 */
48 int getID() const
49 {
50 return id;
51 }
52
53 /**
54 * Get inverse interaction length.
55 *
56 * \param E muon energy [GeV]
57 * \return inverse interaction length [m^-1]
58 */
59 virtual double getInverseInteractionLength(const double E) const = 0;
60
61 /**
62 * Get energy of shower.
63 *
64 * \param E muon energy [GeV]
65 * \return shower energy [GeV]
66 */
67 virtual double getEnergyOfShower(const double E) const = 0;
68
69 /**
70 * Get RMS of scattering angle.
71 *
72 * \param E muon energy [GeV]
73 * \param Es shower energy [GeV]
74 * \return RMS scattering angle [rad]
75 */
76 virtual double getThetaRMS(const double E, const double Es) const = 0;
77
78 private:
79 const int id;
80 };
81
82
83 /**
84 * Implementation for calculation of inverse interaction length and shower energy.
85 *
86 * This class implements the JRadiationInterface interface.\n
87 * N.B: This class owns the object pointed to using JLANG::JSharedPointer.
88 */
91 public JSharedPointer<JRadiation>,
93 {
94 public:
95 /**
96 * Constructor.
97 *
98 * \param id radiation identifier
99 * \param radiation pointer to valid JRadition object
100 * \param density mass density of radiation material [gr/cm³]
101 * \param source pointers to member methods of JRadiation
102 */
103 JRadiationSource(const int id,
104 const JSharedPointer<JRadiation>& radiation,
105 const double density,
106 const JRadiationSource_t source) :
108 JSharedPointer<JRadiation>(radiation),
109 JRadiationSource_t(source),
110 rho(density)
111 {}
112
113
114 /**
115 * Get inverse interaction length.
116 *
117 * \param E muon energy [GeV]
118 * \return inverse interaction length [m^-1]
119 */
120 virtual double getInverseInteractionLength(const double E) const override
121 {
122 return ((*this)->*sigma)(E) * rho * 1.0e6;
123 }
124
125
126 /**
127 * Get energy of shower.
128 *
129 * \param E muon energy [GeV]
130 * \return shower energy [GeV]
131 */
132 virtual double getEnergyOfShower(const double E) const override
133 {
134 return ((*this)->*eloss)(E);
135 }
136
137
138 /**
139 * Get RMS of scattering angle.
140 *
141 * \param E muon energy [GeV]
142 * \param Es shower energy [GeV]
143 * \return RMS scattering angle [rad]
144 */
145 virtual double getThetaRMS(const double E, const double Es) const override
146 {
147 return ((*this)->*theta)(E, Es/E);
148 }
149
150 protected:
151 const double rho;
152 };
153
154
155 /**
156 * Implementation for calculation of inverse interaction length and shower energy due to deep-inelastic muon-nucleon scattering.
157 *
158 * This class implements the JRadiationInterface interface.
159 */
161 public JRadiationInterface,
162 public JDIS
163 {
164 public:
165 /**
166 * Constructor.
167 *
168 * \param id radiation identifier
169 * \param density mass density of radiation material [gr/cm³]
170 */
171 JDISSource(const int id,
172 const double density) :
174 rho(density)
175 {}
176
177
178 /**
179 * Get inverse interaction length.
180 *
181 * \param E muon energy [GeV]
182 * \return inverse interaction length [m^-1]
183 */
184 virtual double getInverseInteractionLength(const double E) const override
185 {
186 return this->getCrossSection(E) * (rho / NUCLEON_MOLAR_MASS) * AVOGADRO * 1.0e2;
187 }
188
189
190 /**
191 * Get energy of shower.
192 *
193 * \param E muon energy [GeV]
194 * \return shower energy [GeV]
195 */
196 virtual double getEnergyOfShower(const double E) const override
197 {
198 return this->getE(E);
199 }
200
201
202 /**
203 * Get RMS of scattering angle.
204 *
205 * \param E muon energy [GeV]
206 * \param Es shower energy [GeV]
207 * \return RMS scattering angle [rad]
208 */
209 virtual double getThetaRMS(const double E, const double Es) const override
210 {
211 return static_cast<const JDIS*>(this)->getThetaRMS(E, Es/E);
212 }
213
214 protected:
215 const double rho;
216 };
217}
218
219#endif
Deep-inelastic muon-nucleon scattering.
Physics constants.
Muon radiative cross sections.
The template JSharedPointer class can be used to share a pointer to an object.
Implementation for calculation of inverse interaction length and shower energy due to deep-inelastic ...
virtual double getThetaRMS(const double E, const double Es) const override
Get RMS of scattering angle.
virtual double getEnergyOfShower(const double E) const override
Get energy of shower.
virtual double getInverseInteractionLength(const double E) const override
Get inverse interaction length.
JDISSource(const int id, const double density)
Constructor.
Deep-inelastic muon-nucleon scattering.
Definition JDIS.hh:31
double getCrossSection(const double E) const
Get cross section.
Definition JDIS.hh:46
double getE(const double E) const
Get shower energy.
Definition JDIS.hh:78
Interface for calculation of inverse interaction length and shower energy.
int getID() const
Get radiation identifer.
JRadiationInterface(const int id)
Constructor.
virtual double getEnergyOfShower(const double E) const =0
Get energy of shower.
virtual double getThetaRMS(const double E, const double Es) const =0
Get RMS of scattering angle.
virtual ~JRadiationInterface()
Virtual destructor.
virtual double getInverseInteractionLength(const double E) const =0
Get inverse interaction length.
Implementation for calculation of inverse interaction length and shower energy.
virtual double getInverseInteractionLength(const double E) const override
Get inverse interaction length.
JRadiationSource(const int id, const JSharedPointer< JRadiation > &radiation, const double density, const JRadiationSource_t source)
Constructor.
virtual double getThetaRMS(const double E, const double Es) const override
Get RMS of scattering angle.
virtual double getEnergyOfShower(const double E) const override
Get energy of shower.
Auxiliary class for the calculation of the muon radiative cross sections.
Definition JRadiation.hh:36
Auxiliary methods for light properties of deep-sea water.
static const double AVOGADRO
Avogadro's number.
static const double NUCLEON_MOLAR_MASS
nucleon molar mass [g/mol]
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for handling member methods of class JRadiation.
double(JRadiation::* sigma)(const double) const
total cross section method
double(JRadiation::* eloss)(const double) const
energy loss method
double(JRadiation::* theta)(const double, const double) const
scattering angle method