Jpp 20.0.0
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JMorphologyGauss Struct Reference

Implementation of Gaussian source morphology. More...

#include <JMorphology.hh>

Inheritance diagram for JASTRONOMY::JMorphologyGauss:
JLANG::JClonable< JClonable_t, JDerived_t >

Public Types

typedef JClonable< JClonable_t >::clone_type clone_type
 

Public Member Functions

virtual std::istream & read (std::istream &in) override
 Read source morphology from input stream.
 
virtual std::ostream & write (std::ostream &out) const override
 Write source morphology to output stream.
 
virtual JSourceLocation get () const override
 Get location on sky.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Public Attributes

double sigma_deg
 

Detailed Description

Implementation of Gaussian source morphology.

Note that all input angles are in degrees.

Definition at line 173 of file JMorphology.hh.

Member Typedef Documentation

◆ clone_type

template<class JClonable_t , class JDerived_t >
JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Member Function Documentation

◆ read()

virtual std::istream & JASTRONOMY::JMorphologyGauss::read ( std::istream & in)
inlineoverridevirtual

Read source morphology from input stream.

Parameters
ininput stream
Returns
input stream

Definition at line 182 of file JMorphology.hh.

183 {
184 return JMorphology::read(in, *this)
185 >> this->sigma_deg;
186 }
static std::istream & read(std::istream &in, JSourceLocation &source)
Read source location in degrees from input stream.

◆ write()

virtual std::ostream & JASTRONOMY::JMorphologyGauss::write ( std::ostream & out) const
inlineoverridevirtual

Write source morphology to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 195 of file JMorphology.hh.

196 {
197 return JMorphology::write(out, *this)
198 << ' ' << this->sigma_deg;
199 }
static std::ostream & write(std::ostream &out, const JSourceLocation &source)
Write source location in degrees to output stream.

◆ get()

virtual JSourceLocation JASTRONOMY::JMorphologyGauss::get ( ) const
inlineoverridevirtual

Get location on sky.

Returns
location on sky

Definition at line 207 of file JMorphology.hh.

208 {
209 using namespace JPP;
210
211 JDirection3D u(0.0, 0.0, 1.0);
212
213 if (sigma_deg > 0.0) {
214
215 const double theta = gRandom->Gaus(0.0, getRadians(sigma_deg));
216 const double phi = gRandom->Uniform(-PI, +PI);
217
218 const JRotation3D R(JAngle3D(theta, phi));
219
220 u.rotate_back(R);
221 }
222
223 const JRotation3D Rs(this->getSourceLocation());
224
225 u.rotate_back(Rs);
226
227 return JSourceLocation(u);
228 }
Data structure for angles in three dimensions.
Definition JAngle3D.hh:35
Data structure for direction in three dimensions.
double getRadians(const double angle)
Convert angle to radians.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Location of astrophysical source.

◆ clone()

template<class JClonable_t , class JDerived_t >
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlineoverridevirtualinherited

Member Data Documentation

◆ sigma_deg

double JASTRONOMY::JMorphologyGauss::sigma_deg

Definition at line 231 of file JMorphology.hh.


The documentation for this struct was generated from the following file: