Implementation for calculation of inverse interaction length and shower energy.
More...
#include <JRadiationSource.hh>
|
static void | release (JClass_t *p) |
| Release memory.
|
|
|
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
|
|
|
void | set (const JSharedPointer &object) |
| Set pointer.
|
|
virtual void | set (JClass_t *p) override |
| Set pointer.
|
|
void | release () |
| Release memory.
|
|
Implementation for calculation of inverse interaction length and shower energy.
This class implements the JRadiationInterface interface.
N.B: This class owns the object pointed to using JLANG::JSharedPointer.
Definition at line 89 of file JRadiationSource.hh.
◆ pointer_type
template<class JClass_t , template< class > class JMemory_t = JNew>
◆ storage_type
template<class JClass_t , template< class > class JMemory_t = JNew>
◆ memory_type
◆ JRadiationSource()
Constructor.
- Parameters
-
id | radiation identifier |
radiation | pointer to valid JRadition object |
density | mass density of radiation material [gr/cm³] |
source | pointers to member methods of JRadiation |
Definition at line 103 of file JRadiationSource.hh.
106 :
108 JSharedPointer<JRadiation>(radiation),
109 JRadiationSource_t(source),
111 {}
JRadiationInterface(const int id)
Constructor.
◆ getInverseInteractionLength()
virtual double JPHYSICS::JRadiationSource::getInverseInteractionLength |
( |
const double | E | ) |
const |
|
inlineoverridevirtual |
Get inverse interaction length.
- Parameters
-
- Returns
- inverse interaction length [m^-1]
Implements JPHYSICS::JRadiationInterface.
Definition at line 120 of file JRadiationSource.hh.
121 {
122 return ((*this)->*
sigma)(E) *
rho * 1.0e6;
123 }
double(JRadiation::* sigma)(const double) const
total cross section method
◆ getEnergyOfShower()
virtual double JPHYSICS::JRadiationSource::getEnergyOfShower |
( |
const double | E | ) |
const |
|
inlineoverridevirtual |
◆ getThetaRMS()
virtual double JPHYSICS::JRadiationSource::getThetaRMS |
( |
const double | E, |
|
|
const double | Es ) const |
|
inlineoverridevirtual |
Get RMS of scattering angle.
- Parameters
-
E | muon energy [GeV] |
Es | shower energy [GeV] |
- Returns
- RMS scattering angle [rad]
Implements JPHYSICS::JRadiationInterface.
Definition at line 145 of file JRadiationSource.hh.
146 {
147 return ((*this)->*
theta)(E, Es/E);
148 }
double(JRadiation::* theta)(const double, const double) const
scattering angle method
◆ getID()
int JPHYSICS::JRadiationInterface::getID |
( |
| ) |
const |
|
inlineinherited |
◆ getSharedPointer() [1/2]
template<class JClass_t , template< class > class JMemory_t = JNew>
Get shared pointer.
- Returns
- this shared pointer
Definition at line 95 of file JSharedPointer.hh.
96 {
98 }
JSharedPointer()
Default constructor.
◆ getSharedPointer() [2/2]
template<class JClass_t , template< class > class JMemory_t = JNew>
◆ setSharedPointer()
template<class JClass_t , template< class > class JMemory_t = JNew>
Set shared pointer.
- Parameters
-
Definition at line 117 of file JSharedPointer.hh.
118 {
119 if (this->
get() !=
object.
get()) {
120
122
125 }
126 }
127 }
bool is_valid() const
Check validity of pointer.
virtual JClass_t * get() const override
Get pointer.
virtual void reset() override
Reset pointer.
void set(const JSharedPointer &object)
Set pointer.
◆ reset() [1/3]
template<class JClass_t , template< class > class JMemory_t = JNew>
|
inlineoverridevirtualinherited |
Reset pointer.
The reference counter is decremented by one and the object pointed to previously is deleted when its reference counter is zero.
Reimplemented from JLANG::JStorage< JClass_t, JNew >.
Definition at line 171 of file JSharedPointer.hh.
172 {
175 }
176
178 }
virtual void reset() override
Reset pointer.
virtual void reset() override
Reset pointer.
◆ reset() [2/3]
Reset pointer.
- Parameters
-
Definition at line 35 of file JPointer.hh.
109 {
110 this->
reset(pointer.get());
111 }
◆ reset() [3/3]
template<class JClass_t >
Reset pointer.
- Parameters
-
Definition at line 94 of file JAbstractPointer.hh.
95 {
96 if (this->
get() != p) {
97
99
100 if (p != NULL) {
102 }
103 }
104 }
virtual void set(JClass_t *p)=0
Set pointer.
virtual JClass_t * get() const =0
Get pointer.
virtual void reset()=0
Reset pointer.
◆ set() [1/3]
template<class JClass_t , template< class > class JMemory_t = JNew>
Set pointer.
The reference counter of the shared object pointed to is incremented by one.
- Parameters
-
Definition at line 188 of file JSharedPointer.hh.
189 {
191
193 }
virtual void set(JClass_t *p) override
Set pointer.
void attach(const JSharedCounter &object)
Attach this counter to given shared counter object.
◆ set() [2/3]
template<class JClass_t , template< class > class JMemory_t = JNew>
|
inlineoverrideprotectedvirtualinherited |
Set pointer.
The reference counter of the shared object pointed to is initialised to one.
- Parameters
-
p | pointer to derived class object |
Reimplemented from JLANG::JPointer< JClass_t >.
Definition at line 202 of file JSharedPointer.hh.
203 {
205
207 }
void initialise()
Initialise counter.
◆ set() [3/3]
template<class JClass_t >
template<class T >
Set pointer.
- Parameters
-
Definition at line 96 of file JPointer.hh.
97 {
98 this->
set(pointer.get());
99 }
◆ initialise()
void JLANG::JSharedCounter::initialise |
( |
| ) |
|
|
inlineinherited |
◆ attach()
Attach this counter to given shared counter object.
- Parameters
-
Definition at line 46 of file JSharedCounter.hh.
47 {
49
51
53 ++(*counter);
54 }
55 }
◆ detach()
bool JLANG::JSharedCounter::detach |
( |
| ) |
|
|
inlineinherited |
Detach.
- Returns
- true if counter at zero; else false
Definition at line 63 of file JSharedCounter.hh.
64 {
66
68
70
72
73 return true;
74 }
75
77 }
78
79 return false;
80 }
◆ getCount()
const int JLANG::JSharedCounter::getCount |
( |
| ) |
|
|
inlineinherited |
◆ recreate()
Recreate object in memory.
A new object is created if no memory is allocated yet, else the previously created object is maintained.
Definition at line 57 of file JStorage.hh.
58 {
61 }
62 }
static JClass_t * create()
Create object in memory.
◆ create() [1/2]
Create object in memory.
The memory allocated by a previously created object will be released.
Definition at line 69 of file JStorage.hh.
◆ create() [2/2]
Create array of objects in memory.
The memory allocated by previously created objects will be released.
- Parameters
-
Definition at line 81 of file JStorage.hh.
◆ release() [1/2]
Release memory.
Definition at line 91 of file JStorage.hh.
92 {
94 }
static void release(JClass_t *p)
Release memory.
◆ release() [2/2]
template<class JClass_t >
static void JLANG::JNew< JClass_t >::release |
( |
JClass_t * | p | ) |
|
|
inlinestaticinherited |
Release memory.
- Parameters
-
Definition at line 41 of file JMemory.hh.
◆ get()
template<class JClass_t >
|
inlineoverridevirtualinherited |
◆ getReference() [1/2]
template<class JClass_t >
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 119 of file JPointer.hh.
◆ getReference() [2/2]
template<class JClass_t >
Get rereference to internal pointer.
- Returns
- reference to internal pointer
Definition at line 130 of file JPointer.hh.
◆ equals()
template<class JClass_t >
Equals.
The equality is evaluated by comparison of the internal pointers.
- Parameters
-
- Returns
- true if equals; else false
Definition at line 50 of file JAbstractPointer.hh.
51 {
52 return this->
get() ==
object.get();
53 }
◆ is_valid()
template<class JClass_t >
Check validity of pointer.
- Returns
- true if pointer not null; else false
Definition at line 83 of file JAbstractPointer.hh.
84 {
85 return this->
get() != NULL;
86 }
◆ operator->()
template<class JClass_t >
Smart pointer operator.
- Returns
- pointer to object
Definition at line 112 of file JAbstractPointer.hh.
113 {
115 THROW(JNullPointerException,
"JAbstractPointer::operator->()");
116 else
118 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
◆ operator JClass_t *()
template<class JClass_t >
◆ rho
const double JPHYSICS::JRadiationSource::rho |
|
protected |
◆ id
const int JPHYSICS::JRadiationInterface::id |
|
privateinherited |
◆ counter
int* JLANG::JSharedCounter::counter |
|
protectedinherited |
◆ __p
template<class JClass_t >
◆ sigma
double(JRadiation::* JPHYSICS::JRadiationSource_t::sigma) (const double) const |
|
inherited |
◆ eloss
double(JRadiation::* JPHYSICS::JRadiationSource_t::eloss) (const double) const |
|
inherited |
◆ theta
double(JRadiation::* JPHYSICS::JRadiationSource_t::theta) (const double, const double) const |
|
inherited |
The documentation for this class was generated from the following file: