Jpp  16.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
JDETECTOR::JDetectorHeader Class Reference

Data structure for detector header. More...

#include <JDetectorHeader.hh>

Inheritance diagram for JDETECTOR::JDetectorHeader:
JUTC::JUTCTimeRange JUTM::JUTMGrid JUTM::JUTMPosition JLANG::JEquals< JFirst_t, JSecond_t > JTOOLS::JRange< T, JComparator_t > JLANG::JEquals< JFirst_t, JSecond_t > JMATH::JMath< JFirst_t, JSecond_t > JTOOLS::JPair< T, T > JLANG::JEquals< JFirst_t, JSecond_t > JMATH::JMath< JFirst_t, JSecond_t > JDETECTOR::JDetector JDETECTOR::JMonteCarloDetector JDYNAMICS::JDynamics

Classes

class  JDetectorHeaderHelper
 Auxiliary class for I/O of detector header. More...
 

Public Types

typedef std::pair< T, Tpair_type
 
typedef JRange< T, JComparator_t > range_type
 
typedef JLANG::JClass< T >
::argument_type 
argument_type
 
typedef T key_type
 
typedef T mapped_type
 

Public Member Functions

 JDetectorHeader ()
 Default constructor. More...
 
 JDetectorHeader (const JUTCTimeRange &range, const JUTMGrid &grid, const JUTMPosition &pos)
 Constructor. More...
 
const JDetectorHeadergetDetectorHeader () const
 Get detector header. More...
 
bool equals (const JDetectorHeader &header, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
JProperties getProperties (const JEquationParameters &equation=JDetectorHeader::getEquationParameters())
 Get properties of this class. More...
 
JProperties getProperties (const JEquationParameters &equation=JDetectorHeader::getEquationParameters()) const
 Get properties of this class. More...
 
const JUTCTimeRangegetUTCTimeRange () const
 Get UTC time range. More...
 
void setUTCTimeRange (const JRange< double > &timerange)
 Set UTC time range. More...
 
 operator pair_type () const
 Type conversion operator. More...
 
const range_typegetRange () const
 Get range. More...
 
void setRange (const range_type &range)
 Set range. More...
 
void setRange (argument_type x, argument_type y)
 Set lower and upper limit. More...
 
template<class R >
void setRange (R first, R second)
 Set range. More...
 
template<class JElement_t , class JAllocator_t >
void setRange (const array_type< JElement_t, JAllocator_t > &buffer)
 Set lower and upper limit according to input data. More...
 
T getLowerLimit () const
 Get lower limit. More...
 
T getUpperLimit () const
 Get upper limit. More...
 
void setLowerLimit (argument_type x)
 Set lower limit. More...
 
void setUpperLimit (argument_type y)
 Set upper limit. More...
 
void fixLowerLimit (argument_type x)
 Fix lower limit. More...
 
void fixUpperLimit (argument_type y)
 Fix upper limit. More...
 
bool equals (const range_type &range) const
 Equal method. More...
 
T getLength () const
 Get length (difference between upper and lower limit). More...
 
void setLength (argument_type length)
 Set length (difference between upper and lower limit). More...
 
bool is_valid () const
 Check validity of range. More...
 
bool in_range (argument_type x) const
 Test whether value is inside range. More...
 
bool operator() (argument_type x) const
 Test whether value is inside range. More...
 
T constrain (argument_type x) const
 Constrain value to range. More...
 
T mod (argument_type x) const
 Modulo value with respect to range. More...
 
bool overlap (const range_type &range) const
 Test overlap with given range. More...
 
range_typeinclude (argument_type x)
 Include given value to range. More...
 
range_typejoin (const range_type &range)
 Join ranges. More...
 
range_typecombine (const range_type &range)
 Combine ranges. More...
 
range_typeadd (argument_type x)
 Add offset. More...
 
range_typeadd (const range_type &range)
 Add offsets. More...
 
range_typesub (argument_type x)
 Subtract offset. More...
 
range_typesub (const range_type &range)
 Subtract offsets. More...
 
range_typemul (const double factor)
 Multiply range. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
range_typediv (const double factor)
 Divide range. More...
 
const key_typegetKey () const
 
const mapped_typegetValue () const
 
mapped_typegetValue ()
 
const JUTMGridgetUTMGrid () const
 Get UTM grid. More...
 
void setUTMGrid (const JUTMGrid &grid)
 Set UTM grid. More...
 
const std::string & getKey () const
 Get key. More...
 
const std::string & getWGS () const
 Get WGS. More...
 
const std::string & getUTMZone () const
 Get UTM zone. More...
 
int getUTMValue () const
 Get UTM zone by numerical value. More...
 
bool equals (const JUTMGrid &grid) const
 Check equality. More...
 
std::string toString () const
 Convert UTM grid. More...
 
const JUTMPositiongetUTMPosition () const
 Get UTM position. More...
 
void setUTMPosition (const JUTMPosition &position)
 Set UTM position. More...
 
JPosition3D getPosition () const
 Get position. More...
 
 operator JPosition3D () const
 Type conversion operator. More...
 
double getUTMEast () const
 Get UTM east. More...
 
double getUTMNorth () const
 Get UTM north. More...
 
double getUTMZ () const
 Get UTM Z. More...
 
JUTMPositionnegate ()
 Negate UTM position. More...
 
JUTMPositionadd (const JUTMPosition &pos)
 Add UTM position. More...
 
JUTMPositionsub (const JUTMPosition &pos)
 Subtract UTM position. More...
 
JUTMPositionmul (const double factor)
 Scale UTM position. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JUTMPositiondiv (const double factor)
 Scale UTM position. More...
 
double getDisplacement (const JUTMPosition &position) const
 Get displacement to position. More...
 

Static Public Member Functions

static JEquationParametersgetEquationParameters ()
 Get equation parameters. More...
 
static void setEquationParameters (const JEquationParameters &equation)
 Set equation parameters. More...
 
static T getMinimum ()
 Get minimum possible value. More...
 
static T getMaximum ()
 Get maximum possible value. More...
 
static JUTMGrid valueOf (const std::string &buffer)
 Extract UTM grid. More...
 

Public Attributes

JComparator_t compare
 Function object. More...
 
T first
 
T second
 

Static Public Attributes

static const JRange< T,
JComparator_t > 
DEFAULT_RANGE
 Default range. More...
 

Protected Member Functions

template<class R >
void setRange (R first, R second, const JLANG::JBool< false > &option)
 Set range. More...
 
template<class R >
void setRange (R first, R second, const JLANG::JBool< true > &option)
 Set range. More...
 

Protected Attributes

std::string key
 
std::string wgs
 
std::string zone
 
double east
 
double north
 
double z
 

Friends

std::istream & operator>> (std::istream &in, JDetectorHeader &header)
 Read detector header from input. More...
 
std::ostream & operator<< (std::ostream &out, const JDetectorHeader &header)
 Write detector header to output. More...
 
JReaderoperator>> (JReader &in, JDetectorHeader &header)
 Read detector header from input. More...
 
JWriteroperator<< (JWriter &out, const JDetectorHeader &header)
 Write detector header to output. More...
 

Detailed Description

Data structure for detector header.

Definition at line 38 of file JDetectorHeader.hh.

Member Typedef Documentation

template<class T, class JComparator_t = std::less<T>>
typedef std::pair<T,T> JTOOLS::JRange< T, JComparator_t >::pair_type
inherited

Definition at line 45 of file JRange.hh.

template<class T, class JComparator_t = std::less<T>>
typedef JRange<T, JComparator_t> JTOOLS::JRange< T, JComparator_t >::range_type
inherited

Definition at line 46 of file JRange.hh.

template<class T, class JComparator_t = std::less<T>>
typedef JLANG::JClass<T>::argument_type JTOOLS::JRange< T, JComparator_t >::argument_type
inherited

Definition at line 47 of file JRange.hh.

typedef T JTOOLS::JPair< T , T >::key_type
inherited

Definition at line 32 of file JPair.hh.

typedef T JTOOLS::JPair< T , T >::mapped_type
inherited

Definition at line 33 of file JPair.hh.

Constructor & Destructor Documentation

JDETECTOR::JDetectorHeader::JDetectorHeader ( )
inline

Default constructor.

Definition at line 48 of file JDetectorHeader.hh.

48  :
49  JUTCTimeRange(),
50  JUTMGrid (),
51  JUTMPosition ()
52  {}
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JUTCTimeRange()
Default constructor.
JUTMGrid()
Default constructor.
Definition: JUTMGrid.hh:44
JDETECTOR::JDetectorHeader::JDetectorHeader ( const JUTCTimeRange range,
const JUTMGrid grid,
const JUTMPosition pos 
)
inline

Constructor.

Parameters
rangeUTC time range
gridUTM grid
posUTM position

Definition at line 62 of file JDetectorHeader.hh.

64  :
66  JUTMGrid (grid),
67  JUTMPosition (pos)
68  {}
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JUTCTimeRange()
Default constructor.
JUTMGrid()
Default constructor.
Definition: JUTMGrid.hh:44
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $

Member Function Documentation

const JDetectorHeader& JDETECTOR::JDetectorHeader::getDetectorHeader ( ) const
inline

Get detector header.

Returns
header

Definition at line 76 of file JDetectorHeader.hh.

77  {
78  return static_cast<const JDetectorHeader&>(*this);
79  }
Data structure for detector header.
bool JDETECTOR::JDetectorHeader::equals ( const JDetectorHeader header,
const double  precision = std::numeric_limits<double>::min() 
) const
inline

Check equality.

Parameters
headerheader
precisionprecision
Returns
true if headers are equal; else false

Definition at line 89 of file JDetectorHeader.hh.

91  {
92  return (this->getUTMGrid() == header.getUTMGrid() && this->getDisplacement(header.getUTMPosition()) < precision);
93  }
const JUTMPosition & getUTMPosition() const
Get UTM position.
Definition: JUTMPosition.hh:84
double getDisplacement(const JUTMPosition &position) const
Get displacement to position.
const JUTMGrid & getUTMGrid() const
Get UTM grid.
Definition: JUTMGrid.hh:73
static JEquationParameters& JDETECTOR::JDetectorHeader::getEquationParameters ( )
inlinestatic

Get equation parameters.

Returns
equation parameters

Definition at line 173 of file JDetectorHeader.hh.

174  {
175  static JEquationParameters equation;
176 
177  return equation;
178  }
Simple data structure to support I/O of equations (see class JLANG::JEquation).
static void JDETECTOR::JDetectorHeader::setEquationParameters ( const JEquationParameters equation)
inlinestatic

Set equation parameters.

Parameters
equationequation parameters

Definition at line 187 of file JDetectorHeader.hh.

188  {
189  getEquationParameters() = equation;
190  }
static JEquationParameters & getEquationParameters()
Get equation parameters.
JProperties JDETECTOR::JDetectorHeader::getProperties ( const JEquationParameters equation = JDetectorHeader::getEquationParameters())
inline

Get properties of this class.

Parameters
equationequation parameters

Definition at line 198 of file JDetectorHeader.hh.

199  {
200  return JDetectorHeaderHelper(*this, equation);
201  }
JProperties JDETECTOR::JDetectorHeader::getProperties ( const JEquationParameters equation = JDetectorHeader::getEquationParameters()) const
inline

Get properties of this class.

Parameters
equationequation parameters

Definition at line 209 of file JDetectorHeader.hh.

210  {
211  return JDetectorHeaderHelper(*this, equation);
212  }
const JUTCTimeRange& JUTC::JUTCTimeRange::getUTCTimeRange ( ) const
inlineinherited

Get UTC time range.

Returns
UTC time range

Definition at line 63 of file JUTCTimeRange.hh.

64  {
65  return static_cast<const JUTCTimeRange&>(*this);
66  }
UTC time range [s].
void JUTC::JUTCTimeRange::setUTCTimeRange ( const JRange< double > &  timerange)
inlineinherited

Set UTC time range.

Parameters
timerangeUTC time range

Definition at line 74 of file JUTCTimeRange.hh.

75  {
76  static_cast<JUTCTimeRange&>(*this) = timerange;
77  }
UTC time range [s].
template<class T, class JComparator_t = std::less<T>>
JTOOLS::JRange< T, JComparator_t >::operator pair_type ( ) const
inlineinherited

Type conversion operator.

Returns
piar

Definition at line 124 of file JRange.hh.

125  {
127  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
std::pair< T, T > pair_type
Definition: JRange.hh:45
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
template<class T, class JComparator_t = std::less<T>>
const range_type& JTOOLS::JRange< T, JComparator_t >::getRange ( ) const
inlineinherited

Get range.

Returns
range

Definition at line 135 of file JRange.hh.

136  {
137  return static_cast<const range_type&>(*this);
138  }
JRange< T, JComparator_t > range_type
Definition: JRange.hh:46
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::setRange ( const range_type range)
inlineinherited

Set range.

Parameters
rangerange

Definition at line 146 of file JRange.hh.

147  {
148  static_cast<range_type&>(*this) = range;
149  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
JRange< T, JComparator_t > range_type
Definition: JRange.hh:46
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::setRange ( argument_type  x,
argument_type  y 
)
inlineinherited

Set lower and upper limit.

Parameters
xlower limit
yupper limit

Definition at line 158 of file JRange.hh.

159  {
160  this->first = x;
161  this->second = y;
162  }
template<class T, class JComparator_t = std::less<T>>
template<class R >
void JTOOLS::JRange< T, JComparator_t >::setRange ( R  first,
R  second 
)
inlineinherited

Set range.


The arguments could be values or iterators.

Parameters
firstfirst
secondsecond

Definition at line 173 of file JRange.hh.

174  {
175  using namespace JLANG;
176 
178  }
Auxiliary template class for type bool.
Definition: JBool.hh:20
Data structure to check whether given data type is an iterator.
Definition: JClass.hh:62
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:146
template<class T, class JComparator_t = std::less<T>>
template<class JElement_t , class JAllocator_t >
void JTOOLS::JRange< T, JComparator_t >::setRange ( const array_type< JElement_t, JAllocator_t > &  buffer)
inlineinherited

Set lower and upper limit according to input data.

Parameters
bufferinput data

Definition at line 187 of file JRange.hh.

188  {
190 
191  for (typename array_type<JElement_t, JAllocator_t>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
192  include(*i);
193  }
194  }
range_type & include(argument_type x)
Include given value to range.
Definition: JRange.hh:397
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:534
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:146
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:545
Auxiliary data structure for return type of make methods.
Definition: JVectorize.hh:26
template<class T, class JComparator_t = std::less<T>>
template<class R >
void JTOOLS::JRange< T, JComparator_t >::setRange ( R  first,
R  second,
const JLANG::JBool< false > &  option 
)
inlineprotectedinherited

Set range.

Parameters
firstfirst
secondsecond
optionfalse

Definition at line 576 of file JRange.hh.

577  {
579  }
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:146
JLANG::JClass< T >::argument_type argument_type
Definition: JRange.hh:47
template<class T, class JComparator_t = std::less<T>>
template<class R >
void JTOOLS::JRange< T, JComparator_t >::setRange ( R  first,
R  second,
const JLANG::JBool< true > &  option 
)
inlineprotectedinherited

Set range.

Parameters
firstfirst
secondsecond
optiontrue

Definition at line 590 of file JRange.hh.

591  {
593 
594  for (R i = first; i != second; ++i) {
595  include(*i);
596  }
597  }
range_type & include(argument_type x)
Include given value to range.
Definition: JRange.hh:397
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:534
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:146
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:545
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
template<class T, class JComparator_t = std::less<T>>
T JTOOLS::JRange< T, JComparator_t >::getLowerLimit ( ) const
inlineinherited

Get lower limit.

Returns
lower limit

Definition at line 202 of file JRange.hh.

203  {
204  return this->first;
205  }
template<class T, class JComparator_t = std::less<T>>
T JTOOLS::JRange< T, JComparator_t >::getUpperLimit ( ) const
inlineinherited

Get upper limit.

Returns
upper limit

Definition at line 213 of file JRange.hh.

214  {
215  return this->second;
216  }
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::setLowerLimit ( argument_type  x)
inlineinherited

Set lower limit.

Parameters
xlower limit

Definition at line 224 of file JRange.hh.

225  {
226  this->first = x;
227  }
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::setUpperLimit ( argument_type  y)
inlineinherited

Set upper limit.

Parameters
yupper limit

Definition at line 235 of file JRange.hh.

236  {
237  this->second = y;
238  }
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::fixLowerLimit ( argument_type  x)
inlineinherited

Fix lower limit.

The range is shifted to the given lower limit.

Parameters
xlower limit

Definition at line 248 of file JRange.hh.

249  {
250  this->second += x - this->first;
251  this->first = x;
252  }
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::fixUpperLimit ( argument_type  y)
inlineinherited

Fix upper limit.

The range is shifted to the given upper limit.

Parameters
yupper limit

Definition at line 262 of file JRange.hh.

263  {
264  this->first += y - this->second;
265  this->second = y;
266  }
template<class T, class JComparator_t = std::less<T>>
bool JTOOLS::JRange< T, JComparator_t >::equals ( const range_type range) const
inlineinherited

Equal method.

Parameters
rangerange
Returns
true if this module range equal to given module range; else false

Definition at line 275 of file JRange.hh.

276  {
277  return (!this->compare(this->getLowerLimit(), range.getLowerLimit()) &&
278  !this->compare(range.getLowerLimit(), this->getLowerLimit()) &&
279  !this->compare(this->getUpperLimit(), range.getUpperLimit()) &&
280  !this->compare(range.getUpperLimit(), this->getUpperLimit()));
281  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
template<class T, class JComparator_t = std::less<T>>
T JTOOLS::JRange< T, JComparator_t >::getLength ( ) const
inlineinherited

Get length (difference between upper and lower limit).

Returns
length

Definition at line 289 of file JRange.hh.

290  {
291  return getUpperLimit() - getLowerLimit();
292  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
template<class T, class JComparator_t = std::less<T>>
void JTOOLS::JRange< T, JComparator_t >::setLength ( argument_type  length)
inlineinherited

Set length (difference between upper and lower limit).

Parameters
lengthlength

Definition at line 300 of file JRange.hh.

301  {
302  setUpperLimit(getLowerLimit() + length);
303  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:235
template<class T, class JComparator_t = std::less<T>>
bool JTOOLS::JRange< T, JComparator_t >::is_valid ( ) const
inlineinherited

Check validity of range.

Returns
true if lower limit less than or equal to upper limit; else false

Definition at line 311 of file JRange.hh.

312  {
313  return !compare(getUpperLimit(), getLowerLimit());
314  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
template<class T, class JComparator_t = std::less<T>>
bool JTOOLS::JRange< T, JComparator_t >::in_range ( argument_type  x) const
inlineinherited

Test whether value is inside range.

Parameters
xvalue
Returns
true if lower limit <= value <= upper limit; else false

Definition at line 323 of file JRange.hh.

324  {
325  return (!compare(x, getLowerLimit()) &&
326  !compare(getUpperLimit(), x));
327  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
template<class T, class JComparator_t = std::less<T>>
bool JTOOLS::JRange< T, JComparator_t >::operator() ( argument_type  x) const
inlineinherited

Test whether value is inside range.

Parameters
xvalue
Returns
true if lower limit <= value <= upper limit; else false

Definition at line 336 of file JRange.hh.

337  {
338  return in_range(x);
339  }
bool in_range(argument_type x) const
Test whether value is inside range.
Definition: JRange.hh:323
template<class T, class JComparator_t = std::less<T>>
T JTOOLS::JRange< T, JComparator_t >::constrain ( argument_type  x) const
inlineinherited

Constrain value to range.


This method returns the original value if it is in this range, else lower limit if value < lower limit or upper limit if value > upper limit.

Parameters
xvalue
Returns
lower limit <= x <= upper limit

Definition at line 350 of file JRange.hh.

351  {
352  if (compare(x, getLowerLimit())) { return getLowerLimit(); }
353  if (compare(getUpperLimit(), x)) { return getUpperLimit(); }
354 
355  return x;
356  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
template<class T, class JComparator_t = std::less<T>>
T JTOOLS::JRange< T, JComparator_t >::mod ( argument_type  x) const
inlineinherited

Modulo value with respect to range.


Parameters
xvalue
Returns
lower limit <= x <= upper limit

Definition at line 365 of file JRange.hh.

366  {
367  if (compare(x, getLowerLimit()))
368  return x + getLength() * floor((getUpperLimit() - x) / getLength());
369  else if (compare(getUpperLimit(), x))
370  return x - getLength() * floor((x - getLowerLimit()) / getLength());
371  else
372  return x;
373  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
T getLength() const
Get length (difference between upper and lower limit).
Definition: JRange.hh:289
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
template<class T, class JComparator_t = std::less<T>>
bool JTOOLS::JRange< T, JComparator_t >::overlap ( const range_type range) const
inlineinherited

Test overlap with given range.


Parameters
rangerange
Returns
true if there is a non-zero overlap; else false

Definition at line 382 of file JRange.hh.

383  {
384  return (!compare(range.getUpperLimit(), getLowerLimit()) &&
385  !compare(getUpperLimit(), range.getLowerLimit()));
386  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::include ( argument_type  x)
inlineinherited

Include given value to range.


The new lower limit is the minimim of the original lower limit and given value and
the new upper limit is the maximum of the original upper limit and given value;

Parameters
xvalue
Returns
range

Definition at line 397 of file JRange.hh.

398  {
399  if (compare(x, getLowerLimit())) { setLowerLimit(x); }
400  if (compare(getUpperLimit(), x)) { setUpperLimit(x); }
401 
402  return *this;
403  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:235
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:224
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::join ( const range_type range)
inlineinherited

Join ranges.


The new lower limit is the maximim of the two lower limits and
the new upper limit is the minimum of the two upper limits.
This operation results in an equal or smaller range and may result in an unphysical range (i.e. lower limit > upper limit).

Parameters
rangerange

Definition at line 415 of file JRange.hh.

416  {
417  if (compare(getLowerLimit(), range.getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
418  if (compare(range.getUpperLimit(), getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
419 
420  return *this;
421  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:235
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:224
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::combine ( const range_type range)
inlineinherited

Combine ranges.


The new lower limit is the minimim of the two lower limits and
the new upper limit is the maximum of the two upper limits.
This operation results in an equal or larger range.

Parameters
rangerange

Definition at line 432 of file JRange.hh.

433  {
434  if (compare(range.getLowerLimit(), getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
435  if (compare(getUpperLimit(), range.getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
436 
437  return *this;
438  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:565
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:235
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:224
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::add ( argument_type  x)
inlineinherited

Add offset.

Parameters
xoffset

Definition at line 446 of file JRange.hh.

447  {
448  this->first += x;
449  this->second += x;
450 
451  return *this;
452  }
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::add ( const range_type range)
inlineinherited

Add offsets.


The new lower limit is the sum of the two lower limits and
the new upper limit is the sum of the two upper limits.

Parameters
rangeoffset

Definition at line 476 of file JRange.hh.

477  {
478  this->first += range.getLowerLimit();
479  this->second += range.getUpperLimit();
480 
481  return *this;
482  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::sub ( argument_type  x)
inlineinherited

Subtract offset.

Parameters
xoffset

Definition at line 460 of file JRange.hh.

461  {
462  this->first -= x;
463  this->second -= x;
464 
465  return *this;
466  }
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::sub ( const range_type range)
inlineinherited

Subtract offsets.


The new lower limit is the difference of the two lower limits and
the new upper limit is the difference of the two upper limits.

Parameters
rangeoffset

Definition at line 492 of file JRange.hh.

493  {
494  this->first -= range.getLowerLimit();
495  this->second -= range.getUpperLimit();
496 
497  return *this;
498  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::mul ( const double  factor)
inlineinherited

Multiply range.

Parameters
factorfactor

Definition at line 506 of file JRange.hh.

507  {
508  this->first *= factor;
509  this->second *= factor;
510 
511  return *this;
512  }
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
template<class T, class JComparator_t = std::less<T>>
range_type& JTOOLS::JRange< T, JComparator_t >::div ( const double  factor)
inlineinherited

Divide range.

Parameters
factorfactor

Definition at line 520 of file JRange.hh.

521  {
522  this->first /= factor;
523  this->second /= factor;
524 
525  return *this;
526  }
template<class T, class JComparator_t = std::less<T>>
static T JTOOLS::JRange< T, JComparator_t >::getMinimum ( )
inlinestaticinherited

Get minimum possible value.

Returns
minimum possible value

Definition at line 534 of file JRange.hh.

535  {
536  return JMATH::JLimits<T>::min();
537  }
float min()
Definition: JLimits.hh:96
template<class T, class JComparator_t = std::less<T>>
static T JTOOLS::JRange< T, JComparator_t >::getMaximum ( )
inlinestaticinherited

Get maximum possible value.

Returns
maximum possible value

Definition at line 545 of file JRange.hh.

546  {
547  return JMATH::JLimits<T>::max();
548  }
const key_type& JTOOLS::JPair< T , T >::getKey ( ) const
inlineinherited

Definition at line 123 of file JPair.hh.

123 { return this->first; }
const mapped_type& JTOOLS::JPair< T , T >::getValue ( ) const
inlineinherited

Definition at line 124 of file JPair.hh.

124 { return this->second; }
mapped_type& JTOOLS::JPair< T , T >::getValue ( )
inlineinherited

Definition at line 126 of file JPair.hh.

126 { return this->second; }
const JUTMGrid& JUTM::JUTMGrid::getUTMGrid ( ) const
inlineinherited

Get UTM grid.

Returns
UTM grid

Definition at line 73 of file JUTMGrid.hh.

74  {
75  return static_cast<const JUTMGrid&>(*this);
76  }
Data structure for UTM grid.
Definition: JUTMGrid.hh:37
void JUTM::JUTMGrid::setUTMGrid ( const JUTMGrid grid)
inlineinherited

Set UTM grid.

Parameters
gridUTM grid

Definition at line 84 of file JUTMGrid.hh.

85  {
86  static_cast<JUTMGrid&>(*this) = grid;
87  }
Data structure for UTM grid.
Definition: JUTMGrid.hh:37
const std::string& JUTM::JUTMGrid::getKey ( ) const
inlineinherited

Get key.

Returns
key

Definition at line 95 of file JUTMGrid.hh.

96  {
97  return key;
98  }
std::string key
Definition: JUTMGrid.hh:246
const std::string& JUTM::JUTMGrid::getWGS ( ) const
inlineinherited

Get WGS.

Returns
WGS

Definition at line 106 of file JUTMGrid.hh.

107  {
108  return wgs;
109  }
std::string wgs
Definition: JUTMGrid.hh:247
const std::string& JUTM::JUTMGrid::getUTMZone ( ) const
inlineinherited

Get UTM zone.

Returns
UTM zone

Definition at line 117 of file JUTMGrid.hh.

118  {
119  return zone;
120  }
std::string zone
Definition: JUTMGrid.hh:248
int JUTM::JUTMGrid::getUTMValue ( ) const
inlineinherited

Get UTM zone by numerical value.

Returns
UTM zone

Definition at line 128 of file JUTMGrid.hh.

129  {
130  using namespace std;
131 
132  int value = 0;
133 
134  for (string::const_iterator i = zone.begin(); i != zone.end(); ++i) {
135  if (isdigit(*i))
136  value = 10 * value + (*i - '0');
137  else
138  break;
139  }
140 
141  return value;
142  }
std::string zone
Definition: JUTMGrid.hh:248
bool JUTM::JUTMGrid::equals ( const JUTMGrid grid) const
inlineinherited

Check equality.

Parameters
gridUTM grid
Returns
true if grids are equal; else false

Definition at line 151 of file JUTMGrid.hh.

152  {
153  return (this->getKey() == grid.getKey() &&
154  this->getWGS() == grid.getWGS() &&
155  this->getUTMValue() == grid.getUTMValue());
156  }
int getUTMValue() const
Get UTM zone by numerical value.
Definition: JUTMGrid.hh:128
const std::string & getWGS() const
Get WGS.
Definition: JUTMGrid.hh:106
const std::string & getKey() const
Get key.
Definition: JUTMGrid.hh:95
std::string JUTM::JUTMGrid::toString ( ) const
inlineinherited

Convert UTM grid.

Returns
UTM grid

Definition at line 164 of file JUTMGrid.hh.

165  {
166  return (key + " " + wgs + " " + zone);
167  }
std::string key
Definition: JUTMGrid.hh:246
std::string zone
Definition: JUTMGrid.hh:248
std::string wgs
Definition: JUTMGrid.hh:247
static JUTMGrid JUTM::JUTMGrid::valueOf ( const std::string &  buffer)
inlinestaticinherited

Extract UTM grid.

Parameters
bufferWGS and UTM zone
Returns
UTM grid

Definition at line 176 of file JUTMGrid.hh.

177  {
178  JUTMGrid grid;
179 
180  std::istringstream is(buffer);
181 
182  if (is >> grid)
183  return grid;
184  else
185  throw JParseError("JUTMGrid::valueOf()");
186  }
is
Definition: JDAQCHSM.chsm:167
Data structure for UTM grid.
Definition: JUTMGrid.hh:37
const JUTMPosition& JUTM::JUTMPosition::getUTMPosition ( ) const
inlineinherited

Get UTM position.

Returns
position

Definition at line 84 of file JUTMPosition.hh.

85  {
86  return static_cast<const JUTMPosition&>(*this);
87  }
Data structure for UTM position.
Definition: JUTMPosition.hh:36
void JUTM::JUTMPosition::setUTMPosition ( const JUTMPosition position)
inlineinherited

Set UTM position.

Parameters
positionposition

Definition at line 95 of file JUTMPosition.hh.

96  {
97  static_cast<JUTMPosition&>(*this) = position;
98  }
Data structure for UTM position.
Definition: JUTMPosition.hh:36
JPosition3D JUTM::JUTMPosition::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 106 of file JUTMPosition.hh.

107  {
108  return JPosition3D(east, north, z);
109  }
JUTM::JUTMPosition::operator JPosition3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 117 of file JUTMPosition.hh.

118  {
119  return getPosition();
120  }
JPosition3D getPosition() const
Get position.
double JUTM::JUTMPosition::getUTMEast ( ) const
inlineinherited

Get UTM east.

Returns
UTM East

Definition at line 128 of file JUTMPosition.hh.

129  {
130  return this->east;
131  }
double JUTM::JUTMPosition::getUTMNorth ( ) const
inlineinherited

Get UTM north.

Returns
UTM North

Definition at line 139 of file JUTMPosition.hh.

140  {
141  return this->north;
142  }
double JUTM::JUTMPosition::getUTMZ ( ) const
inlineinherited

Get UTM Z.

Returns
UTM Z

Definition at line 150 of file JUTMPosition.hh.

151  {
152  return this->z;
153  }
JUTMPosition& JUTM::JUTMPosition::negate ( )
inlineinherited

Negate UTM position.

Returns
this UTM position

Definition at line 161 of file JUTMPosition.hh.

162  {
163  east = -east;
164  north = -north;
165  z = -z;
166 
167  return *this;
168  }
JUTMPosition& JUTM::JUTMPosition::add ( const JUTMPosition pos)
inlineinherited

Add UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 177 of file JUTMPosition.hh.

178  {
179  east += pos.getUTMEast();
180  north += pos.getUTMNorth();
181  z += pos.getUTMZ();
182 
183  return *this;
184  }
double getUTMEast() const
Get UTM east.
double getUTMZ() const
Get UTM Z.
double getUTMNorth() const
Get UTM north.
JUTMPosition& JUTM::JUTMPosition::sub ( const JUTMPosition pos)
inlineinherited

Subtract UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 193 of file JUTMPosition.hh.

194  {
195  east -= pos.getUTMEast();
196  north -= pos.getUTMNorth();
197  z -= pos.getUTMZ();
198 
199  return *this;
200  }
double getUTMEast() const
Get UTM east.
double getUTMZ() const
Get UTM Z.
double getUTMNorth() const
Get UTM north.
JUTMPosition& JUTM::JUTMPosition::mul ( const double  factor)
inlineinherited

Scale UTM position.

Parameters
factormultiplication factor
Returns
this UTM position

Definition at line 209 of file JUTMPosition.hh.

210  {
211  east *= factor;
212  north *= factor;
213  z *= factor;
214 
215  return *this;
216  }
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 357 of file JMath.hh.

358  {
359  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
360  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
JUTMPosition& JUTM::JUTMPosition::div ( const double  factor)
inlineinherited

Scale UTM position.

Parameters
factordivision factor
Returns
this UTM position

Definition at line 225 of file JUTMPosition.hh.

226  {
227  east /= factor;
228  north /= factor;
229  z /= factor;
230 
231  return *this;
232  }
double JUTM::JUTMPosition::getDisplacement ( const JUTMPosition position) const
inlineinherited

Get displacement to position.

The displacement corresponds to the 2D distance in the (East,North) plane.

Parameters
positionposition
Returns
displacement

Definition at line 243 of file JUTMPosition.hh.

244  {
245  const double x = this->getUTMEast() - position.getUTMEast();
246  const double y = this->getUTMNorth() - position.getUTMNorth();
247 
248  return sqrt(x*x + y*y);
249  }
double getUTMEast() const
Get UTM east.
double getUTMNorth() const
Get UTM north.

Friends And Related Function Documentation

std::istream& operator>> ( std::istream &  in,
JDetectorHeader header 
)
friend

Read detector header from input.

Parameters
ininput stream
headerheader
Returns
input stream

Definition at line 103 of file JDetectorHeader.hh.

104  {
105  in >> static_cast<JUTCTimeRange&>(header);
106  in >> static_cast<JUTMGrid&> (header);
107  in >> static_cast<JUTMPosition&> (header);
108 
109  return in;
110  }
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JUTCTimeRange()
Default constructor.
JUTMGrid()
Default constructor.
Definition: JUTMGrid.hh:44
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
std::ostream& operator<< ( std::ostream &  out,
const JDetectorHeader header 
)
friend

Write detector header to output.

Parameters
outoutput stream
headerheader
Returns
output stream

Definition at line 120 of file JDetectorHeader.hh.

121  {
122  using namespace std;
123 
124  out << static_cast<const JUTCTimeRange&>(header);
125  out << endl;
126  out << static_cast<const JUTMGrid&> (header);
127  out << ' ';
128  out << static_cast<const JUTMPosition&> (header);
129 
130  return out;
131  }
JReader& operator>> ( JReader in,
JDetectorHeader header 
)
friend

Read detector header from input.

Parameters
ininput stream
headerheader
Returns
input stream

Definition at line 141 of file JDetectorHeader.hh.

142  {
143  in >> static_cast<JUTCTimeRange&>(header);
144  in >> static_cast<JUTMGrid&> (header);
145  in >> static_cast<JUTMPosition&> (header);
146 
147  return in;
148  }
JUTMPosition()
Default constructor.
Definition: JUTMPosition.hh:43
JUTCTimeRange()
Default constructor.
JUTMGrid()
Default constructor.
Definition: JUTMGrid.hh:44
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:42
JWriter& operator<< ( JWriter out,
const JDetectorHeader header 
)
friend

Write detector header to output.

Parameters
outoutput stream
headerheader
Returns
output stream

Definition at line 158 of file JDetectorHeader.hh.

159  {
160  out << static_cast<const JUTCTimeRange&>(header);
161  out << static_cast<const JUTMGrid&> (header);
162  out << static_cast<const JUTMPosition&> (header);
163 
164  return out;
165  }

Member Data Documentation

template<class T, class JComparator_t = std::less<T>>
const JRange< T, JComparator_t > JTOOLS::JRange< T, JComparator_t >::DEFAULT_RANGE
staticinherited

Default range.

This range corresponds to an unphysical range.

Definition at line 555 of file JRange.hh.

template<class T, class JComparator_t = std::less<T>>
JComparator_t JTOOLS::JRange< T, JComparator_t >::compare
inherited

Function object.

Parameters
firstfirst argument
secondsecond argument
Returns
true if first < second; else false

Definition at line 565 of file JRange.hh.

T JTOOLS::JPair< T , T >::first
inherited

Definition at line 128 of file JPair.hh.

T JTOOLS::JPair< T , T >::second
inherited

Definition at line 129 of file JPair.hh.

std::string JUTM::JUTMGrid::key
protectedinherited

Definition at line 246 of file JUTMGrid.hh.

std::string JUTM::JUTMGrid::wgs
protectedinherited

Definition at line 247 of file JUTMGrid.hh.

std::string JUTM::JUTMGrid::zone
protectedinherited

Definition at line 248 of file JUTMGrid.hh.

double JUTM::JUTMPosition::east
protectedinherited

Definition at line 311 of file JUTMPosition.hh.

double JUTM::JUTMPosition::north
protectedinherited

Definition at line 312 of file JUTMPosition.hh.

double JUTM::JUTMPosition::z
protectedinherited

Definition at line 313 of file JUTMPosition.hh.


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