Jpp test-rotations-old-533-g2bdbdb559
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:
JASTRONOMY::JResolution

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.
 

Public Attributes

double sigma_deg
 

Detailed Description

Implementation of Gaussian detector resolution.

Note that all input angles are in degrees.

Definition at line 89 of file JResolution.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

Implements JASTRONOMY::JResolution.

Definition at line 98 of file JResolution.hh.

99 {
100 return in >> this->sigma_deg;
101 }

◆ write()

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

Write detector resolution to output stream.

Parameters
outoutput stream
Returns
output stream

Implements JASTRONOMY::JResolution.

Definition at line 110 of file JResolution.hh.

111 {
112 return out << this->sigma_deg;
113 }

◆ get()

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

Get direction.

Returns
direction

Implements JASTRONOMY::JResolution.

Definition at line 121 of file JResolution.hh.

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

Member Data Documentation

◆ sigma_deg

double JASTRONOMY::JResolutionGauss::sigma_deg

Definition at line 141 of file JResolution.hh.


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