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

Implementation of Gaussian detector resolution. More...

#include <JResolution.hh>

Inheritance diagram for JASTRONOMY::JResolutionGauss:
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 detector resolution from input stream.
 
virtual std::ostream & write (std::ostream &out) const override
 Write detector resolution to output stream.
 
JDirection3D get () const override
 Get direction.
 
virtual clone_type clone () const override
 Get clone of this object.
 

Public Attributes

double sigma_deg
 

Detailed Description

Implementation of Gaussian detector resolution.

Note that all input angles are in degrees.

Definition at line 93 of file JResolution.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::JResolutionGauss::read ( std::istream & in)
inlineoverridevirtual

Read detector resolution from input stream.

Parameters
ininput stream
Returns
input stream

Definition at line 102 of file JResolution.hh.

103 {
104 return in >> this->sigma_deg;
105 }

◆ write()

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

Write detector resolution to output stream.

Parameters
outoutput stream
Returns
output stream

Definition at line 114 of file JResolution.hh.

115 {
116 return out << this->sigma_deg;
117 }

◆ get()

JDirection3D JASTRONOMY::JResolutionGauss::get ( ) const
inlineoverride

Get direction.

Returns
direction

Definition at line 125 of file JResolution.hh.

126 {
127 using namespace JPP;
128
129 JDirection3D u(0.0, 0.0, 1.0);
130
131 if (sigma_deg > 0.0) {
132
133 const double theta = gRandom->Gaus(0.0, getRadians(sigma_deg));
134 const double phi = gRandom->Uniform(-PI, +PI);
135
136 const JRotation3D R(JAngle3D(theta, phi));
137
138 u.rotate_back(R);
139 }
140
141 return u;
142 }
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).

◆ 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::JResolutionGauss::sigma_deg

Definition at line 145 of file JResolution.hh.


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