Jpp
 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 | 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 > JTOOLS::JRange< T, JComparator_t > JMATH::JMath< JUTMPosition > JTOOLS::JPair< T, T > JLANG::JEquals< JFirst_t, JSecond_t > JMATH::JMath< JFirst_t, JSecond_t > JDETECTOR::JMonteCarloDetector

Public Types

enum  JVersion_t { V1 = 1, V2 = 2, V3 = 3 }
 Enumeration of version types. More...
 
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 JObjectID &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...
 
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)
 Read from input. More...
 
virtual JWriterwrite (JWriter &out) const
 Write to output. More...
 
int getID () const
 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 JVersiongetVersion () const
 Get version. More...
 
JVersiongetVersion ()
 Get version. More...
 
const std::string & getVariant () const
 Get variant. More...
 
void setVariant (const std::string &variant)
 Set variant. More...
 
bool equals (const JVersion &version) const
 Equal method. 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 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 iterator_type , class value_type , class result_type >
void setRange (iterator_type __begin, iterator_type __end, result_type value_type::*member)
 Set lower and upper limit according to minimal and maximal value in input data, respectively. More...
 
template<class iterator_type , class value_type , class result_type >
void setRange (iterator_type __begin, iterator_type __end, result_type(value_type::*function)() const)
 Set lower and upper limit according to minimal and maximal value in input data, respectively. 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 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...
 
JUTMPositionmul (const JNullType &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 std::string & getWGS () const
 Get WGS. More...
 
const std::string & getUTMZone () const
 Get UTM zone. More...
 
std::string toString () const
 Convert UTM grid. More...
 
const JUTMPositiongetUTMPosition () const
 Get 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...
 

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

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

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

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

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 for anyone with a KM3NeT account at the <a href="https://drive.google.com/open?id=0B6l8SNtndcwaUTZPOWZOXzd6R3M> google drive .

Definition at line 80 of file JDetector.hh.

Member Typedef Documentation

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 41 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 42 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 of version types.


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.

Definition at line 41 of file JDetectorVersion.hh.

41  {
42  V1 = 1, //!< First version
43  V2 = 2, //!< Version with UTC time and UTM position data
44  V3 = 3 //!< Version with PMT status field and comments
45  };
Version with UTC time and UTM position data.
Version with PMT status field and comments.

Constructor & Destructor Documentation

JDETECTOR::JDetector::JDetector ( )
inline

Default constructor.

Definition at line 92 of file JDetector.hh.

92  :
93  JObjectID(),
95  JDetectorHeader (),
97  JSerialisable()
98  {}
JDetectorVersion()
Default constructor.
JDetectorHeader()
Default constructor.
JObjectID()
Default constructor.
Definition: JObjectID.hh:35
JDETECTOR::JDetector::JDetector ( const JObjectID id,
const JVersion version,
const JDetectorHeader header 
)
inline

Constructor.

Parameters
iddetector identifier
versionversion
headerheader

Definition at line 108 of file JDetector.hh.

110  :
111  JObjectID(id),
112  JDetectorVersion(version),
113  JDetectorHeader (header),
115  JSerialisable()
116  {
118  }
JDetectorVersion()
Default constructor.
JDetectorHeader()
Default constructor.
JObjectID()
Default constructor.
Definition: JObjectID.hh:35
static void setVersion(const JVersion &version)
Set detector version.
Definition: JPMT.hh:118
const JVersion & getVersion() const
Get version.
Definition: JVersion.hh:56

Member Function Documentation

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

Set version.

Parameters
versionversion

Definition at line 126 of file JDetector.hh.

127  {
128  static_cast<JDetectorVersion&>(*this).setVersion(version);
129 
130  JPMT::setVersion(this->getVersion());
131  }
void setVersion(const JVersion &version)
Set version.
Definition: JVersion.hh:78
static void setVersion(const JVersion &version)
Set detector version.
Definition: JPMT.hh:118
const JVersion & getVersion() const
Get version.
Definition: JVersion.hh:56
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 143 of file JDetector.hh.

144  {
145  if (this->getVersion() == JDetectorVersion() || version > getDetectorVersion(this->getVersion()) || force) {
146 
148 
149  return true;
150  }
151 
152  return false;
153  }
JDetectorVersion()
Default constructor.
void setVersion(const JVersion &version)
Set version.
Definition: JDetector.hh:126
static const JGetDetectorVersion getDetectorVersion
Function object to map detector variant to detector version.
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map detector version to detector variant.
version
Definition: JCalibratePMT.sh:7
const JVersion & getVersion() const
Get version.
Definition: JVersion.hh:56
JDetector& JDETECTOR::JDetector::operator+= ( const JVector3D pos)
inline

Move detector elements.

Parameters
posoffset position
Returns
this JDetector

Definition at line 162 of file JDetector.hh.

163  {
164  for (iterator i = begin(); i != end(); ++i) {
165  i->add(pos);
166  }
167 
168  return *this;
169  }
JDetector& JDETECTOR::JDetector::operator-= ( const JVector3D pos)
inline

Move detector elements.

Parameters
posoffset position
Returns
this JDetector

Definition at line 178 of file JDetector.hh.

179  {
180  for (iterator i = begin(); i != end(); ++i) {
181  i->sub(pos);
182  }
183 
184  return *this;
185  }
const JModule& JDETECTOR::JDetector::getModule ( const JModuleAddress address) const
inline

Get module parameters.

Parameters
addressmodule address
Returns
module parameters

Definition at line 194 of file JDetector.hh.

195  {
196  return at(address.first);
197  }
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 206 of file JDetector.hh.

207  {
208  return at(address.first);
209  }
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 218 of file JDetector.hh.

219  {
220  for (JDetector::const_iterator module = this->begin(); module != this->end(); ++module) {
221  if (*module == location) {
222  return *module;
223  }
224  }
225 
226  THROW(JIndexOutOfRange, "JDetector::getModule()");
227  }
#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 236 of file JDetector.hh.

237  {
238  for (JDetector::iterator module = this->begin(); module != this->end(); ++module) {
239  if (*module == location) {
240  return *module;
241  }
242  }
243 
244  THROW(JIndexOutOfRange, "JDetector::getModule()");
245  }
#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 254 of file JDetector.hh.

255  {
256  return at(address.first).at(address.second);
257  }
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 266 of file JDetector.hh.

267  {
268  return at(address.first).at(address.second);
269  }
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)
inlinevirtual

Read from input.

Parameters
inreader
Returns
reader

Implements JIO::JSerialisable.

Definition at line 381 of file JDetector.hh.

382  {
383  clear();
384 
385  int n;
386 
387  in >> static_cast<JObjectID&> (*this);
388  in >> static_cast<JDetectorVersion&>(*this);
389  in >> static_cast<JDetectorHeader&> (*this);
390  in >> n;
391 
393 
394  for (JModule module; n != 0; --n) {
395 
396  in >> module;
397 
398  push_back(module);
399  }
400 
401  return in;
402  }
Data structure for a composite optical module.
Definition: JModule.hh:50
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
JObjectID()
Default constructor.
Definition: JObjectID.hh:35
Data structure for detector header.
static void setVersion(const JVersion &version)
Set detector version.
Definition: JPMT.hh:118
alias put_queue eval echo n
Definition: qlib.csh:19
const JVersion & getVersion() const
Get version.
Definition: JVersion.hh:56
virtual JWriter& JDETECTOR::JDetector::write ( JWriter out) const
inlinevirtual

Write to output.

Parameters
outwriter
Returns
writer

Implements JIO::JSerialisable.

Definition at line 411 of file JDetector.hh.

412  {
413  int n = size();
414 
415  out << static_cast<const JObjectID&> (*this);
416  out << static_cast<const JDetectorVersion&>(*this);
417  out << static_cast<const JDetectorHeader&> (*this);
418  out << n;
419 
420  for (const_iterator i = begin(); i != end(); ++i) {
421  out << *i;
422  }
423 
424  return out;
425  }
alias put_queue eval echo n
Definition: qlib.csh:19
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 55 of file JObjectID.hh.

56  {
57  return __id;
58  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 66 of file JObjectID.hh.

67  {
68  this->__id = id;
69  }
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 78 of file JObjectID.hh.

79  {
80  return this->getID() < object.getID();
81  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
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 90 of file JObjectID.hh.

91  {
92  return this->getID() < id;
93  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
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 102 of file JObjectID.hh.

103  {
104  return this->getID() > id;
105  }
int getID() const
Get identifier.
Definition: JObjectID.hh:55
const JVersion& JDETECTOR::JVersion::getVersion ( ) const
inlineinherited

Get version.

Returns
version

Definition at line 56 of file JVersion.hh.

57  {
58  return static_cast<const JVersion&>(*this);
59  }
Auxiliary class for version identifier.
Definition: JVersion.hh:30
JVersion& JDETECTOR::JVersion::getVersion ( )
inlineinherited

Get version.

Returns
version

Definition at line 67 of file JVersion.hh.

68  {
69  return static_cast<JVersion&>(*this);
70  }
Auxiliary class for version identifier.
Definition: JVersion.hh:30
const std::string& JDETECTOR::JVersion::getVariant ( ) const
inlineinherited

Get variant.

Returns
variant

Definition at line 89 of file JVersion.hh.

90  {
91  return this->__variant;
92  }
std::string __variant
Definition: JVersion.hh:170
void JDETECTOR::JVersion::setVariant ( const std::string &  variant)
inlineinherited

Set variant.

Parameters
variantvariant

Definition at line 100 of file JVersion.hh.

101  {
102  this->__variant = variant;
103  }
std::string __variant
Definition: JVersion.hh:170
bool JDETECTOR::JVersion::equals ( const JVersion version) const
inlineinherited

Equal method.

Parameters
versionversion
Returns
true if this version equal to given version; else false

Definition at line 112 of file JVersion.hh.

113  {
114  return this->getVariant() == version.getVariant();
115  }
const std::string & getVariant() const
Get variant.
Definition: JVersion.hh:89
static JEquationParameters& JDETECTOR::JDetectorHeader::getEquationParameters ( )
inlinestaticinherited

Get equation parameters.

Returns
equation parameters

Definition at line 144 of file JDetectorHeader.hh.

145  {
146  static JEquationParameters equation;
147 
148  return equation;
149  }
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 158 of file JDetectorHeader.hh.

159  {
160  getEquationParameters() = equation;
161  }
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 169 of file JDetectorHeader.hh.

170  {
171  return JDetectorHeaderHelper(*this, equation);
172  }
JProperties JDETECTOR::JDetectorHeader::getProperties ( const JEquationParameters equation = JDetectorHeader::getEquationParameters()) const
inlineinherited

Get properties of this class.

Parameters
equationequation parameters

Definition at line 180 of file JDetectorHeader.hh.

181  {
182  return JDetectorHeaderHelper(*this, equation);
183  }
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 128 of file JRange.hh.

129  {
130  return static_cast<const range_type&>(*this);
131  }
JRange< T, JComparator_t > range_type
Definition: JRange.hh:41
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 139 of file JRange.hh.

140  {
141  static_cast<range_type&>(*this) = range;
142  }
JRange< T, JComparator_t > range_type
Definition: JRange.hh:41
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 151 of file JRange.hh.

152  {
153  this->first = x;
154  this->second = y;
155  }
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 166 of file JRange.hh.

167  {
168  using namespace JLANG;
169 
171  }
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:139
template<class T, class JComparator_t = std::less<T>>
template<class iterator_type , class value_type , class result_type >
void JTOOLS::JRange< T, JComparator_t >::setRange ( iterator_type  __begin,
iterator_type  __end,
result_type value_type::*  member 
)
inlineinherited

Set lower and upper limit according to minimal and maximal value in input data, respectively.

Parameters
__beginbegin of data
__endend of data
memberpointer to data member

Definition at line 182 of file JRange.hh.

183  {
185 
186  for (iterator_type i = __begin; i != __end; ++i) {
187  include((*i).*member);
188  }
189  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:399
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:548
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:559
template<class T, class JComparator_t = std::less<T>>
template<class iterator_type , class value_type , class result_type >
void JTOOLS::JRange< T, JComparator_t >::setRange ( iterator_type  __begin,
iterator_type  __end,
result_type(value_type::*)() const  function 
)
inlineinherited

Set lower and upper limit according to minimal and maximal value in input data, respectively.

Parameters
__beginbegin of data
__endend of data
functionpointer to member method

Definition at line 200 of file JRange.hh.

201  {
203 
204  for (iterator_type i = __begin; i != __end; ++i) {
205  include(((*i).*function)());
206  }
207  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:399
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:548
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:559
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 590 of file JRange.hh.

591  {
593  }
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
JLANG::JClass< T >::argument_type argument_type
Definition: JRange.hh:42
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 604 of file JRange.hh.

605  {
607 
608  for (R i = first; i != second; ++i) {
609  include(*i);
610  }
611  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:399
static T getMinimum()
Get minimum possible value.
Definition: JRange.hh:548
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
static T getMaximum()
Get maximum possible value.
Definition: JRange.hh:559
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
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 215 of file JRange.hh.

216  {
217  return this->first;
218  }
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 226 of file JRange.hh.

227  {
228  return this->second;
229  }
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 237 of file JRange.hh.

238  {
239  this->first = x;
240  }
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 248 of file JRange.hh.

249  {
250  this->second = y;
251  }
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 261 of file JRange.hh.

262  {
263  this->second += x - this->first;
264  this->first = x;
265  }
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 275 of file JRange.hh.

276  {
277  this->first += y - this->second;
278  this->second = y;
279  }
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 288 of file JRange.hh.

289  {
290  return (!this->compare(this->getLowerLimit(), range.getLowerLimit()) &&
291  !this->compare(range.getLowerLimit(), this->getLowerLimit()) &&
292  !this->compare(this->getUpperLimit(), range.getUpperLimit()) &&
293  !this->compare(range.getUpperLimit(), this->getUpperLimit()));
294  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 302 of file JRange.hh.

303  {
304  return getUpperLimit() - getLowerLimit();
305  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 313 of file JRange.hh.

314  {
315  setUpperLimit(getLowerLimit() + length);
316  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
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 324 of file JRange.hh.

325  {
326  return !compare(getUpperLimit(), getLowerLimit());
327  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 (!compare(x, getLowerLimit()) &&
339  !compare(getUpperLimit(), x));
340  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 351 of file JRange.hh.

352  {
353  if (compare(x, getLowerLimit())) { return getLowerLimit(); }
354  if (compare(getUpperLimit(), x)) { return getUpperLimit(); }
355 
356  return x;
357  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 366 of file JRange.hh.

367  {
368  if (compare(x, getLowerLimit()))
369  return x + getLength() * floor((getUpperLimit() - x) / getLength());
370  else if (compare(getUpperLimit(), x))
371  return x - getLength() * floor((x - getLowerLimit()) / getLength());
372  else
373  return x;
374  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
T getLength() const
Get length (difference between upper and lower limit).
Definition: JRange.hh:302
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 384 of file JRange.hh.

385  {
386  return (compare(getLowerLimit(), range.getUpperLimit()) &&
387  compare(range.getLowerLimit(), getUpperLimit()));
388  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
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 399 of file JRange.hh.

400  {
401  if (compare(x, getLowerLimit())) { setLowerLimit(x); }
402  if (compare(getUpperLimit(), x)) { setUpperLimit(x); }
403 
404  return *this;
405  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:237
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 417 of file JRange.hh.

418  {
419  if (compare(getLowerLimit(), range.getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
420  if (compare(range.getUpperLimit(), getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
421 
422  return *this;
423  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:237
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 434 of file JRange.hh.

435  {
436  if (compare(range.getLowerLimit(), getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
437  if (compare(getUpperLimit(), range.getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
438 
439  return *this;
440  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JComparator_t compare
Function object.
Definition: JRange.hh:579
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:237
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 448 of file JRange.hh.

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

479  {
480  this->first += range.getLowerLimit();
481  this->second += range.getUpperLimit();
482 
483  return *this;
484  }
JUTMPosition& JUTM::JUTMPosition::add ( const JUTMPosition pos)
inlineinherited

Add UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 164 of file JUTMPosition.hh.

165  {
166  east += pos.getUTMEast();
167  north += pos.getUTMNorth();
168  z += pos.getUTMZ();
169 
170  return *this;
171  }
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 462 of file JRange.hh.

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

495  {
496  this->first -= range.getLowerLimit();
497  this->second -= range.getUpperLimit();
498 
499  return *this;
500  }
JUTMPosition& JUTM::JUTMPosition::sub ( const JUTMPosition pos)
inlineinherited

Subtract UTM position.

Parameters
posUTM position
Returns
this UTM position

Definition at line 180 of file JUTMPosition.hh.

181  {
182  east -= pos.getUTMEast();
183  north -= pos.getUTMNorth();
184  z -= pos.getUTMZ();
185 
186  return *this;
187  }
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 508 of file JRange.hh.

509  {
510  this->first *= factor;
511  this->second *= factor;
512 
513  return *this;
514  }
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 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
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 196 of file JUTMPosition.hh.

197  {
198  east *= factor;
199  north *= factor;
200  z *= factor;
201 
202  return *this;
203  }
JUTMPosition & JMATH::JMath< JUTMPosition , JNullType >::mul ( const JNullType object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
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 522 of file JRange.hh.

523  {
524  this->first /= factor;
525  this->second /= factor;
526 
527  return *this;
528  }
JUTMPosition& JUTM::JUTMPosition::div ( const double  factor)
inlineinherited

Scale UTM position.

Parameters
factordivision factor
Returns
this UTM position

Definition at line 212 of file JUTMPosition.hh.

213  {
214  east /= factor;
215  north /= factor;
216  z /= factor;
217 
218  return *this;
219  }
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 537 of file JRange.hh.

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

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

560  {
561  return JMATH::JLimits<T>::max();
562  }
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 68 of file JUTMGrid.hh.

69  {
70  return key;
71  }
std::string key
Definition: JUTMGrid.hh:183
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 std::string& JUTM::JUTMGrid::getWGS ( ) const
inlineinherited

Get WGS.

Returns
WGS

Definition at line 79 of file JUTMGrid.hh.

80  {
81  return wgs;
82  }
std::string wgs
Definition: JUTMGrid.hh:184
const std::string& JUTM::JUTMGrid::getUTMZone ( ) const
inlineinherited

Get UTM zone.

Returns
UTM zone

Definition at line 90 of file JUTMGrid.hh.

91  {
92  return zone;
93  }
std::string zone
Definition: JUTMGrid.hh:185
std::string JUTM::JUTMGrid::toString ( ) const
inlineinherited

Convert UTM grid.

Returns
UTM grid

Definition at line 101 of file JUTMGrid.hh.

102  {
103  return (key + " " + wgs + " " + zone);
104  }
std::string key
Definition: JUTMGrid.hh:183
std::string zone
Definition: JUTMGrid.hh:185
std::string wgs
Definition: JUTMGrid.hh:184
static JUTMGrid JUTM::JUTMGrid::valueOf ( const std::string &  buffer)
inlinestaticinherited

Extract UTM grid.

Parameters
bufferWGS and UTM zone
Returns
UTM grid

Definition at line 113 of file JUTMGrid.hh.

114  {
115  JUTMGrid grid;
116 
117  std::istringstream is(buffer);
118 
119  if (is >> grid)
120  return grid;
121  else
122  throw JParseError("JUTMGrid::valueOf()");
123  }
is
Definition: JDAQCHSM.chsm:167
Data structure for UTM grid.
Definition: JUTMGrid.hh:34
const JUTMPosition& JUTM::JUTMPosition::getUTMPosition ( ) const
inlineinherited

Get UTM position.

Returns
position

Definition at line 82 of file JUTMPosition.hh.

83  {
84  return static_cast<const JUTMPosition&>(*this);
85  }
Data structure for UTM position.
Definition: JUTMPosition.hh:34
JPosition3D JUTM::JUTMPosition::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 93 of file JUTMPosition.hh.

94  {
95  return JPosition3D(east, north, z);
96  }
JUTM::JUTMPosition::operator JPosition3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 104 of file JUTMPosition.hh.

105  {
106  return getPosition();
107  }
JPosition3D getPosition() const
Get position.
Definition: JUTMPosition.hh:93
double JUTM::JUTMPosition::getUTMEast ( ) const
inlineinherited

Get UTM east.

Returns
UTM East

Definition at line 115 of file JUTMPosition.hh.

116  {
117  return this->east;
118  }
double JUTM::JUTMPosition::getUTMNorth ( ) const
inlineinherited

Get UTM north.

Returns
UTM North

Definition at line 126 of file JUTMPosition.hh.

127  {
128  return this->north;
129  }
double JUTM::JUTMPosition::getUTMZ ( ) const
inlineinherited

Get UTM Z.

Returns
UTM Z

Definition at line 137 of file JUTMPosition.hh.

138  {
139  return this->z;
140  }
JUTMPosition& JUTM::JUTMPosition::negate ( )
inlineinherited

Negate UTM position.

Returns
this UTM position

Definition at line 148 of file JUTMPosition.hh.

149  {
150  east = -east;
151  north = -north;
152  z = -z;
153 
154  return *this;
155  }

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 279 of file JDetector.hh.

280  {
281  using namespace std;
282 
283  detector.clear();
284 
285  string buffer;
286 
287  if (in
288  >> detector.comment
289  >> static_cast<JObjectID&>(detector)
290  >> buffer) {
291 
292  int n;
293  int version = -1;
294 
295  try {
296  version = getDetectorVersion(buffer);
297  }
298  catch(std::exception&) {}
299 
300  switch (version) {
301 
302  case V3:
303  case V2:
304  in >> static_cast<JDetectorHeader&>(detector);
305 
306  case V1:
307  in >> n;
308  detector.setVersion(buffer);
309  break;
310 
311  default:
312  detector.setVersion(putDetectorVersion(V1));
313  istringstream(buffer) >> n;
314  break;
315  }
316 
317  for (JModule module; n != 0 && in >> module; --n) {
318  detector.push_back(module);
319  }
320  }
321 
322  return in;
323  }
Data structure for a composite optical module.
Definition: JModule.hh:50
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition: JSirene.sh:45
void setVersion(const JVersion &version)
Set version.
Definition: JDetector.hh:126
Data structure for detector header.
Version with UTC time and UTM position data.
Version with PMT status field and comments.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector variant to detector version.
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map detector version to detector variant.
alias put_queue eval echo n
Definition: qlib.csh:19
version
Definition: JCalibratePMT.sh:7
std::ostream& operator<< ( std::ostream &  out,
const JDetector detector 
)
friend

Write detector to output.

Parameters
outoutput stream
detectordetector
Returns
output stream

Definition at line 333 of file JDetector.hh.

334  {
335  using namespace std;
336 
337  const ios::fmtflags format = out.flags();
338  const streamsize precision = out.precision();
339 
340  out.setf(ios::fixed);
341  out.precision(1);
342 
343  out << detector.comment;
344  out << static_cast<const JObjectID&>(detector);
345 
346  switch (getDetectorVersion(detector.getVariant())) {
347 
348  case V3:
349  case V2:
350  out << " ";
351  out << static_cast<const JDetectorVersion&>(detector) << endl;
352  out << static_cast<const JDetectorHeader&> (detector) << endl;
353  break;
354 
355  default:
356  out << " ";
357  break;
358  }
359 
360  out << detector.size() << endl;
361 
362  out.precision(3);
363 
364  for (const_iterator i = detector.begin(); i != detector.end(); ++i) {
365  out << *i << endl;
366  }
367 
368  out.flags(format);
369  out.precision(precision);
370 
371  return out;
372  }
Version with UTC time and UTM position data.
Version with PMT status field and comments.
const std::string & getVariant() const
Get variant.
Definition: JVersion.hh:89
static const JGetDetectorVersion getDetectorVersion
Function object to map detector variant to detector version.

Member Data Documentation

JComment JDETECTOR::JDetector::comment

Definition at line 429 of file JDetector.hh.

int JLANG::JObjectID::__id
protectedinherited

Definition at line 160 of file JObjectID.hh.

std::string JDETECTOR::JVersion::__variant
protectedinherited

Definition at line 170 of file 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 569 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 579 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 183 of file JUTMGrid.hh.

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

Definition at line 184 of file JUTMGrid.hh.

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

Definition at line 185 of file JUTMGrid.hh.

double JUTM::JUTMPosition::east
protectedinherited

Definition at line 276 of file JUTMPosition.hh.

double JUTM::JUTMPosition::north
protectedinherited

Definition at line 277 of file JUTMPosition.hh.

double JUTM::JUTMPosition::z
protectedinherited

Definition at line 278 of file JUTMPosition.hh.


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