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

Detector data structure. More...

#include <JDetector.hh>

Inheritance diagram for JDETECTOR::JDetector:
JLANG::JObjectID JDETECTOR::JDetectorVersion JDETECTOR::JDetectorHeader std::vector< JModule > JLANG::JMultiEquals< JClass_t, JType_t > JIO::JSerialisable JLANG::JComparable< JObjectID > JLANG::JComparable< JObjectID, int > JDETECTOR::JVersion JUTC::JUTCTimeRange JUTM::JUTMGrid JUTM::JUTMPosition JLANG::JEquals< JFirst_t, JSecond_t > JLANG::JComparable< 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::JMonteCarloDetector JDYNAMICS::JDynamics

Public Types

enum  start_of_comment_type { OLD_START_OF_COMMENT, NEW_START_OF_COMMENT }
 Enumeration for different lengths of start of comment in binary I/O. More...
 
enum  JVersion_t {
  V1 = 1, V2 = 2, V3 = 3, V4 = 4,
  V5 = 5
}
 Enumeration of version types. More...
 
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

 JDetector ()
 Default constructor. More...
 
 JDetector (const JDetectorID &id, const JVersion &version, const JDetectorHeader &header)
 Constructor. More...
 
void setVersion (const JVersion &version)
 Set version. More...
 
bool setVersion (const JDetectorVersion::JVersion_t &version, const bool force=false)
 Set version. More...
 
bool setToLatestVersion ()
 Set to latest version. More...
 
JDetectoroperator+= (const JVector3D &pos)
 Move detector elements. More...
 
JDetectoroperator-= (const JVector3D &pos)
 Move detector elements. More...
 
const JModulegetModule (const JModuleAddress &address) const
 Get module parameters. More...
 
JModulegetModule (const JModuleAddress &address)
 Get module parameters. More...
 
const JModulegetModule (const JLocation &location) const
 Get module parameters. More...
 
JModulegetModule (const JLocation &location)
 Get module parameters. More...
 
const JPMTgetPMT (const JPMTAddress &address) const
 Get PMT parameters. More...
 
JPMTgetPMT (const JPMTAddress &address)
 Get PMT parameters. More...
 
virtual JReaderread (JReader &in) override
 Read from input. More...
 
virtual JWriterwrite (JWriter &out) const override
 Write to output. More...
 
int getID () const
 Get identifier. More...
 
int & getID ()
 Get identifier. More...
 
void setID (const int id)
 Set identifier. More...
 
bool less (const JObjectID &object) const
 Less than method. More...
 
bool less (const int id) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 
const std::string & getVersion () const
 Get version. More...
 
void setVersion (const std::string &version)
 Set version. More...
 
bool less (const JVersion &version) const
 Less-than method. 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...
 
bool equals (const range_type &range) const
 Equal method. More...
 
bool equals (const JUTMGrid &grid) 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...
 
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_type include (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...
 
JUTMPositionadd (const JUTMPosition &pos)
 Add UTM position. More...
 
range_typesub (argument_type x)
 Subtract offset. More...
 
range_typesub (const range_type &range)
 Subtract offsets. More...
 
JUTMPositionsub (const JUTMPosition &pos)
 Subtract UTM position. More...
 
range_typemul (const double factor)
 Multiply range. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JUTMPositionmul (const double factor)
 Scale UTM position. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
range_typediv (const double factor)
 Divide range. More...
 
JUTMPositiondiv (const double factor)
 Scale UTM position. More...
 
T getN (const double R) const
 Get expected number of occurances of given rate within this interval. More...
 
const key_typegetKey () const
 
const std::string & getKey () const
 Get key. More...
 
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 & getWGS () const
 Get WGS. More...
 
const std::string & getUTMZone () const
 Get UTM zone. More...
 
int getUTMValue () const
 Get UTM zone by numerical value. 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...
 
double getDisplacement (const JUTMPosition &position) const
 Get displacement to position. More...
 

Static Public Member Functions

static start_of_comment_type getStartOfComment ()
 Get option for short start of comment in binary I/O. More...
 
static void setStartOfComment (const start_of_comment_type option)
 Set option for short start of comment in binary I/O. More...
 
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

JComment comment
 
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

void setVersion () const
 Set version. More...
 
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...
 

Static Protected Member Functions

static start_of_comment_typeget_start_of_comment ()
 Get option for short start of comment in binary I/O. More...
 

Protected Attributes

int __id
 
std::string version
 
std::string key
 
std::string wgs
 
std::string zone
 
double east
 
double north
 
double z
 

Static Protected Attributes

static const size_t LENGTH_START_OF_COMMENT = sizeof(JDetectorID)
 Length of start of comment in binary I/O. More...
 

Friends

std::istream & operator>> (std::istream &in, JDetector &detector)
 Read detector from input. More...
 
std::ostream & operator<< (std::ostream &out, const JDetector &detector)
 Write detector to output. More...
 

Detailed Description

Detector data structure.

A detector consists of a header and a list of modules, each of which consists of a list of PMTs. Each PMT comprises position, orientation and time calibration data. Note that the index of the PMT in the module data structure corresponds to the readout channel (TDC).

The following formats and file name extension are supported:

extension format function
".detx" ASCII I/O
".gz" gzipped ASCII I/O
".dat" binary I/O
".det" ASCII I

The different formats can transparently be read and written using the methods:

   inline void load(const JString& file_name, JDetector& detector);
   inline void store(const JString& file_name, const JDetector& detector);

respectively. These methods are available in the include file JDetectorToolkit.hh.

The JDETECTOR::JModuleRouter and JDETECTOR::JPMTRouter classes provide for fast look-up methods of module and PMT calibration data for real data and Monte Carlo data, respectively.
Note that the (not) equal operator strictly applies to the detector identifier and version. For quantitative comparisons, use JCompareDetector.cc.
The official detector description document is available on the google drive for anyone with a KM3NeT account.
It can directly be found at this link.

For a given detector, the module identifier (JModule::getID) and the PMT identifier (JPMT::getID) are unique.
The serial number in the UPI of a PMT is equal to its identifier in the detector description.
For more information on the PBS (product breakdown structure) and UPI (universal product identifier), see this link.

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

Member Enumeration Documentation

Enumeration for different lengths of start of comment in binary I/O.

Enumerator
OLD_START_OF_COMMENT 
NEW_START_OF_COMMENT 

Definition at line 495 of file JDetector.hh.

Enumeration of version types.


Note that additional version types should be included in JGetDetectorVersion::JGetDetectorVersion.

Enumerator
V1 

First version.

V2 

Version with UTC time and UTM position data.

V3 

Version with PMT status field and comments.

V4 

Version with quaternion and time offset per module.

V5 

Version with module status field.

Definition at line 48 of file JDetectorVersion.hh.

48  {
49  V1 = 1, //!< First version
50  V2 = 2, //!< Version with UTC time and UTM position data
51  V3 = 3, //!< Version with PMT status field and comments
52  V4 = 4, //!< Version with quaternion and time offset per module
53  V5 = 5 //!< Version with module status field
54  };
Version with UTC time and UTM position data.
Version with PMT status field and comments.
Version with quaternion and time offset per module.
Version with module status field.

Constructor & Destructor Documentation

JDETECTOR::JDetector::JDetector ( )
inline

Default constructor.

Definition at line 101 of file JDetector.hh.

101  :
102  JDetectorID(),
104  JDetectorHeader (),
106  JSerialisable()
107  {}
JDetectorVersion()
Default constructor.
JDetectorHeader()
Default constructor.
JLANG::JObjectID JDetectorID
Type definition of detector identifier.
Definition: JDetectorID.hh:19
JDETECTOR::JDetector::JDetector ( const JDetectorID id,
const JVersion version,
const JDetectorHeader header 
)
inline

Constructor.

Parameters
iddetector identifier
versionversion
headerheader

Definition at line 117 of file JDetector.hh.

119  :
120  JDetectorID(id),
121  JDetectorVersion(version),
122  JDetectorHeader (header),
124  JSerialisable()
125  {
126  setVersion();
127  }
JDetectorVersion()
Default constructor.
JDetectorHeader()
Default constructor.
void setVersion() const
Set version.
Definition: JDetector.hh:528
JLANG::JObjectID JDetectorID
Type definition of detector identifier.
Definition: JDetectorID.hh:19

Member Function Documentation

void JDETECTOR::JDetector::setVersion ( const JVersion version)
inline

Set version.

Parameters
versionversion

Definition at line 135 of file JDetector.hh.

136  {
137  static_cast<JDetectorVersion&>(*this).setVersion(version.getVersion());
138 
139  setVersion();
140  }
const std::string & getVersion() const
Get version.
void setVersion(const std::string &version)
Set version.
void setVersion() const
Set version.
Definition: JDetector.hh:528
bool JDETECTOR::JDetector::setVersion ( const JDetectorVersion::JVersion_t version,
const bool  force = false 
)
inline

Set version.

Note that the version is only set to a higher version or when forced to set it.

Parameters
versionversion
forceforce setting of version
Returns
true if set; else false

Definition at line 152 of file JDetector.hh.

153  {
154  if (this->getVersion() == JDetectorVersion() || version > getDetectorVersion(this->getVersion()) || force) {
155 
157 
158  return true;
159  }
160 
161  return false;
162  }
JDetectorVersion()
Default constructor.
const std::string & getVersion() const
Get version.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
void setVersion() const
Set version.
Definition: JDetector.hh:528
bool JDETECTOR::JDetector::setToLatestVersion ( )
inline

Set to latest version.

Returns
true if set; else false

Definition at line 170 of file JDetector.hh.

171  {
172  return setVersion(getLatestDetectorVersion<JDetectorVersion::JVersion_t>());
173  }
void setVersion() const
Set version.
Definition: JDetector.hh:528
JDetector& JDETECTOR::JDetector::operator+= ( const JVector3D pos)
inline

Move detector elements.

Parameters
posoffset position
Returns
this JDetector

Definition at line 182 of file JDetector.hh.

183  {
184  for (iterator i = begin(); i != end(); ++i) {
185  i->add(pos);
186  }
187 
188  return *this;
189  }
JDetector& JDETECTOR::JDetector::operator-= ( const JVector3D pos)
inline

Move detector elements.

Parameters
posoffset position
Returns
this JDetector

Definition at line 198 of file JDetector.hh.

199  {
200  for (iterator i = begin(); i != end(); ++i) {
201  i->sub(pos);
202  }
203 
204  return *this;
205  }
const JModule& JDETECTOR::JDetector::getModule ( const JModuleAddress address) const
inline

Get module parameters.

Parameters
addressmodule address
Returns
module parameters

Definition at line 214 of file JDetector.hh.

215  {
216  return at(address.first);
217  }
int first
index of module in detector data structure
JModule& JDETECTOR::JDetector::getModule ( const JModuleAddress address)
inline

Get module parameters.

Parameters
addressmodule address
Returns
module parameters

Definition at line 226 of file JDetector.hh.

227  {
228  return at(address.first);
229  }
int first
index of module in detector data structure
const JModule& JDETECTOR::JDetector::getModule ( const JLocation location) const
inline

Get module parameters.

Parameters
locationmodule location
Returns
module parameters

Definition at line 238 of file JDetector.hh.

239  {
240  for (JDetector::const_iterator module = this->begin(); module != this->end(); ++module) {
241  if (*module == location) {
242  return *module;
243  }
244  }
245 
246  THROW(JIndexOutOfRange, "Invalid location " << location);
247  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
JModule& JDETECTOR::JDetector::getModule ( const JLocation location)
inline

Get module parameters.

Parameters
locationmodule location
Returns
module parameters

Definition at line 256 of file JDetector.hh.

257  {
258  for (JDetector::iterator module = this->begin(); module != this->end(); ++module) {
259  if (*module == location) {
260  return *module;
261  }
262  }
263 
264  THROW(JIndexOutOfRange, "Invalid location " << location);
265  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
const JPMT& JDETECTOR::JDetector::getPMT ( const JPMTAddress address) const
inline

Get PMT parameters.

Parameters
addressJPMTAddress
Returns
JPMT

Definition at line 274 of file JDetector.hh.

275  {
276  return at(address.first).at(address.second);
277  }
int second
index of PMT in module data structure.
Definition: JPMTAddress.hh:100
int first
index of module in detector data structure
JPMT& JDETECTOR::JDetector::getPMT ( const JPMTAddress address)
inline

Get PMT parameters.

Parameters
addressJPMTAddress
Returns
JPMT

Definition at line 286 of file JDetector.hh.

287  {
288  return at(address.first).at(address.second);
289  }
int second
index of PMT in module data structure.
Definition: JPMTAddress.hh:100
int first
index of module in detector data structure
virtual JReader& JDETECTOR::JDetector::read ( JReader in)
inlineoverridevirtual

Read from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 399 of file JDetector.hh.

400  {
401  using namespace std;
402  using namespace JPP;
403 
404  this->clear();
405 
407 
408  char prefix[N];
409 
410  for (string buffer; in.read(prefix, N) == N && count(prefix, prefix + N, JComment::START_COMMENT) == N; ) {
411 
412  in >> buffer;
413 
414  this->comment.add(buffer);
415  }
416 
417  if (this->comment.empty()) {
418  THROW(JIOException, "Missing comments");
419  }
420 
421  in.read(&prefix[N], sizeof(JDetectorID) - N);
422 
423  JByteArrayReader is(prefix, N);
424 
425  int number_of_modules;
426 
427  is >> static_cast<JDetectorID&> (*this);
428  in >> static_cast<JDetectorVersion&>(*this);
429  in >> static_cast<JDetectorHeader&> (*this);
430  in >> number_of_modules;
431 
432  this->setVersion();
433 
434  for (JModule module; number_of_modules != 0; --number_of_modules) {
435 
436  in >> module;
437 
438  this->push_back(module);
439  }
440 
441  return in;
442  }
static start_of_comment_type getStartOfComment()
Get option for short start of comment in binary I/O.
Definition: JDetector.hh:506
static const char START_COMMENT
start comment
Definition: JComment.hh:48
Data structure for a composite optical module.
Definition: JModule.hh:68
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
static const size_t LENGTH_START_OF_COMMENT
Length of start of comment in binary I/O.
Definition: JDetector.hh:551
is
Definition: JDAQCHSM.chsm:167
Data structure for detector header.
std::vector< int > count
Definition: JAlgorithm.hh:180
Auxiliary class for object identification.
Definition: JObjectID.hh:22
void setVersion() const
Set version.
Definition: JDetector.hh:528
JComment & add(const std::string &comment)
Add comment.
Definition: JComment.hh:100
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:41
virtual JWriter& JDETECTOR::JDetector::write ( JWriter out) const
inlineoverridevirtual

Write to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 451 of file JDetector.hh.

452  {
453  using namespace std;
454  using namespace JPP;
455 
456  if (getDetectorVersion(this->getVersion()) < V3 || this->comment.empty()) {
457  THROW(JIOException, "Version " << getDetectorVersion(this->getVersion()) << " < " << V3 << " or missing comments.");
458  }
459 
460  this->setVersion();
461 
462  if (getDetectorVersion(this->getVersion()) >= V3) {
463 
464  for (JComment::const_iterator i = this->comment.begin(); i != this->comment.end(); ++i) {
465 
466  for (size_t i = 0; i != LENGTH_START_OF_COMMENT; ++i) {
468  }
469 
470  out << *i;
471  }
472  }
473 
474  const int number_of_modules = this->size();
475 
476  out << static_cast<const JDetectorID&> (*this);
477  out << static_cast<const JDetectorVersion&>(*this);
478  out << static_cast<const JDetectorHeader&> (*this);
479  out << number_of_modules;
480 
481  for (const_iterator module = this->begin(); module != this->end(); ++module) {
482  out << *module;
483  }
484 
485  return out;
486  }
static const char START_COMMENT
start comment
Definition: JComment.hh:48
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:670
const std::string & getVersion() const
Get version.
static const size_t LENGTH_START_OF_COMMENT
Length of start of comment in binary I/O.
Definition: JDetector.hh:551
Version with PMT status field and comments.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
void setVersion() const
Set version.
Definition: JDetector.hh:528
static start_of_comment_type JDETECTOR::JDetector::getStartOfComment ( )
inlinestatic

Get option for short start of comment in binary I/O.

Returns
option

Definition at line 506 of file JDetector.hh.

507  {
508  return get_start_of_comment();
509  }
static start_of_comment_type & get_start_of_comment()
Get option for short start of comment in binary I/O.
Definition: JDetector.hh:540
static void JDETECTOR::JDetector::setStartOfComment ( const start_of_comment_type  option)
inlinestatic

Set option for short start of comment in binary I/O.

Parameters
optionoption

Definition at line 517 of file JDetector.hh.

518  {
519  get_start_of_comment() = option;
520  }
static start_of_comment_type & get_start_of_comment()
Get option for short start of comment in binary I/O.
Definition: JDetector.hh:540
void JDETECTOR::JDetector::setVersion ( ) const
inlineprotected

Set version.

This method should be called to set up the handling of detector version specific module and PMT I/O.

Definition at line 528 of file JDetector.hh.

529  {
531  JPMT ::setVersion(this->getVersion());
532  }
static void setVersion(const JVersion &version)
Set detector version.
Definition: JModule.hh:131
const std::string & getVersion() const
Get version.
static void setVersion(const JVersion &version)
Set detector version.
Definition: JPMT.hh:114
static start_of_comment_type& JDETECTOR::JDetector::get_start_of_comment ( )
inlinestaticprotected

Get option for short start of comment in binary I/O.

Returns
option

Definition at line 540 of file JDetector.hh.

541  {
542  static start_of_comment_type start_of_comment = NEW_START_OF_COMMENT;
543 
544  return start_of_comment;
545  }
start_of_comment_type
Enumeration for different lengths of start of comment in binary I/O.
Definition: JDetector.hh:495
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51  {
52  return __id;
53  }
int& JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62  {
63  return __id;
64  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73  {
74  this->__id = id;
75  }
bool JLANG::JObjectID::less ( const JObjectID object) const
inlineinherited

Less than method.

Parameters
objectobject identifier
Returns
true if this identifier less than given identifier; else false

Definition at line 84 of file JObjectID.hh.

85  {
86  return this->getID() < object.getID();
87  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
bool JLANG::JObjectID::less ( const int  id) const
inlineinherited

Less than method.

Parameters
ididentifier
Returns
true if this identifier less than given identifier; else false

Definition at line 96 of file JObjectID.hh.

97  {
98  return this->getID() < id;
99  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
bool JLANG::JObjectID::more ( const int  id) const
inlineinherited

More than method.

Parameters
ididentifier
Returns
true if this identifier greater than given identifier; else false

Definition at line 108 of file JObjectID.hh.

109  {
110  return this->getID() > id;
111  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
const std::string& JDETECTOR::JVersion::getVersion ( ) const
inlineinherited

Get version.

Returns
version

Definition at line 50 of file JDetector/JVersion.hh.

51  {
52  return this->version;
53  }
void JDETECTOR::JVersion::setVersion ( const std::string &  version)
inlineinherited

Set version.

Parameters
versionversion

Definition at line 61 of file JDetector/JVersion.hh.

62  {
63  this->version = version;
64  }
bool JDETECTOR::JVersion::less ( const JVersion version) const
inlineinherited

Less-than method.

Parameters
versionversion
Returns
true if this version less than given version; else false

Definition at line 73 of file JDetector/JVersion.hh.

74  {
75  return this->getVersion() < version.getVersion();
76  }
const std::string & getVersion() const
Get version.
const JDetectorHeader& JDETECTOR::JDetectorHeader::getDetectorHeader ( ) const
inlineinherited

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
inlineinherited

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
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:578
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 $
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
static JEquationParameters& JDETECTOR::JDetectorHeader::getEquationParameters ( )
inlinestaticinherited

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)
inlinestaticinherited

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())
inlineinherited

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
inlineinherited

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:398
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:547
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:146
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:558
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 589 of file JRange.hh.

590  {
592  }
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 603 of file JRange.hh.

604  {
606 
607  for (R i = first; i != second; ++i) {
608  include(*i);
609  }
610  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:398
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:547
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:146
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:558
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>>
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:578
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:578
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:578
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:578
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.


The result is equivalent to join(range).is_valid().

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

Definition at line 383 of file JRange.hh.

384  {
385  return (compare(getLowerLimit(), range.getUpperLimit()) &&
386  compare(range.getLowerLimit(), getUpperLimit()));
387  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:578
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 398 of file JRange.hh.

399  {
400  if (compare(x, getLowerLimit())) { setLowerLimit(x); }
401  if (compare(getUpperLimit(), x)) { setUpperLimit(x); }
402 
403  return *this;
404  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:578
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 416 of file JRange.hh.

417  {
418  if (compare(getLowerLimit(), range.getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
419  if (compare(range.getUpperLimit(), getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
420 
421  return *this;
422  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:578
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 433 of file JRange.hh.

434  {
435  if (compare(range.getLowerLimit(), getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
436  if (compare(getUpperLimit(), range.getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
437 
438  return *this;
439  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
JComparator_t compare
Function object.
Definition: JRange.hh:578
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 447 of file JRange.hh.

448  {
449  this->first += x;
450  this->second += x;
451 
452  return *this;
453  }
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 477 of file JRange.hh.

478  {
479  this->first += range.getLowerLimit();
480  this->second += range.getUpperLimit();
481 
482  return *this;
483  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
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.
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 461 of file JRange.hh.

462  {
463  this->first -= x;
464  this->second -= x;
465 
466  return *this;
467  }
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 493 of file JRange.hh.

494  {
495  this->first -= range.getLowerLimit();
496  this->second -= range.getUpperLimit();
497 
498  return *this;
499  }
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
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.
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 507 of file JRange.hh.

508  {
509  this->first *= factor;
510  this->second *= factor;
511 
512  return *this;
513  }
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::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
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 521 of file JRange.hh.

522  {
523  this->first /= factor;
524  this->second /= factor;
525 
526  return *this;
527  }
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  }
template<class T, class JComparator_t = std::less<T>>
T JTOOLS::JRange< T, JComparator_t >::getN ( const double  R) const
inlineinherited

Get expected number of occurances of given rate within this interval.

Parameters
Rrate
Returns
expectation value

Definition at line 536 of file JRange.hh.

537  {
538  return R * (getUpperLimit() - getLowerLimit());
539  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:43
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 547 of file JRange.hh.

548  {
549  return JMATH::JLimits<T>::min();
550  }
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 558 of file JRange.hh.

559  {
560  return JMATH::JLimits<T>::max();
561  }
const key_type& JTOOLS::JPair< T , T >::getKey ( ) const
inlineinherited

Definition at line 123 of file JPair.hh.

123 { return this->first; }
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 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::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
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  }
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,
JDetector detector 
)
friend

Read detector from input.

Parameters
ininput stream
detectordetector
Returns
input stream

Definition at line 299 of file JDetector.hh.

300  {
301  using namespace std;
302 
303  detector.clear();
304 
305  string buffer;
306 
307  if (in
308  >> detector.comment
309  >> static_cast<JDetectorID&>(detector)
310  >> buffer) {
311 
312  int number_of_modules;
313  int version = -1;
314 
315  try {
316  version = getDetectorVersion(buffer);
317  }
318  catch(std::exception&) {}
319 
320  switch (version) {
321 
322  default:
323  in >> static_cast<JDetectorHeader&>(detector);
324 
325  case V1:
326  in >> number_of_modules;
327  detector.setVersion(buffer);
328  break;
329 
330  case -1:
331  detector.setVersion(putDetectorVersion(V1));
332  istringstream(buffer) >> number_of_modules;
333  break;
334  }
335 
336  for (JModule module; number_of_modules != 0 && in >> module; --number_of_modules) {
337  detector.push_back(module);
338  }
339  }
340 
341  return in;
342  }
Data structure for a composite optical module.
Definition: JModule.hh:68
void setVersion(const JVersion &version)
Set version.
Definition: JDetector.hh:135
Data structure for detector header.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
do set_variable DETECTOR_TXT $WORKDIR detector
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:41
std::ostream& operator<< ( std::ostream &  out,
const JDetector detector 
)
friend

Write detector to output.

Parameters
outoutput stream
detectordetector
Returns
output stream

Definition at line 352 of file JDetector.hh.

353  {
354  using namespace std;
355  using namespace JPP;
356 
357  detector.setVersion();
358 
359  setFormat<JPosition3D> (JFormat_t(9, 3, std::ios::fixed | std::ios::showpos));
360  setFormat<JDirection3D> (JFormat_t(9, 6, std::ios::fixed | std::ios::showpos));
361  setFormat<JQuaternion3D>(JFormat_t(9, 6, std::ios::fixed | std::ios::showpos));
362  setFormat<JCalibration> (JFormat_t(9, 3, std::ios::fixed | std::ios::showpos));
363 
364  if (getDetectorVersion(detector.getVersion()) >= V3) {
365  out << detector.comment;
366  }
367 
368  out << static_cast<const JDetectorID&>(detector);
369 
370  switch (getDetectorVersion(detector.getVersion())) {
371 
372  default:
373  out << " ";
374  out << static_cast<const JDetectorVersion&>(detector) << endl;
375  out << static_cast<const JDetectorHeader&> (detector) << endl;
376  break;
377 
378  case V1:
379  out << " ";
380  break;
381  }
382 
383  out << detector.size() << endl;
384 
385  for (const_iterator i = detector.begin(); i != detector.end(); ++i) {
386  out << *i << endl;
387  }
388 
389  return out;
390  }
const std::string & getVersion() const
Get version.
void setVersion(const JVersion &version)
Set version.
Definition: JDetector.hh:135
Version with PMT status field and comments.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
do set_variable DETECTOR_TXT $WORKDIR detector
Data structure for format specifications.
Definition: JManip.hh:522

Member Data Documentation

JComment JDETECTOR::JDetector::comment

Definition at line 489 of file JDetector.hh.

const size_t JDETECTOR::JDetector::LENGTH_START_OF_COMMENT = sizeof(JDetectorID)
staticprotected

Length of start of comment in binary I/O.

Definition at line 551 of file JDetector.hh.

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

std::string JDETECTOR::JVersion::version
protectedinherited

Definition at line 79 of file JDetector/JVersion.hh.

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 568 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 578 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: