1 #ifndef __JDETECTOR__JDETECTOR__
2 #define __JDETECTOR__JDETECTOR__
33 namespace JDETECTOR {}
34 namespace JPP {
using namespace JDETECTOR; }
86 public JMultiEquals<JDetector, JTYPELIST<JDetectorID, JVersion>::typelist>,
164 return setVersion(getLatestDetectorVersion<JDetectorVersion::JVersion_t>());
176 for (iterator i = begin(); i != end(); ++i) {
192 for (iterator i = begin(); i != end(); ++i) {
208 return at(address.
first);
220 return at(address.
first);
232 for (JDetector::const_iterator module = this->begin(); module != this->end(); ++module) {
233 if (*module == location) {
250 for (JDetector::iterator module = this->begin(); module != this->end(); ++module) {
251 if (*module == location) {
301 >> static_cast<JDetectorID&>(detector)
304 int number_of_modules;
310 catch(std::exception&) {}
318 in >> number_of_modules;
324 istringstream(buffer) >> number_of_modules;
328 for (
JModule module; number_of_modules != 0 && in >> module; --number_of_modules) {
329 detector.push_back(module);
351 setFormat<JPosition3D> (
JFormat_t(9, 3, std::ios::fixed | std::ios::showpos));
352 setFormat<JDirection3D> (
JFormat_t(9, 6, std::ios::fixed | std::ios::showpos));
353 setFormat<JQuaternion3D>(
JFormat_t(9, 6, std::ios::fixed | std::ios::showpos));
354 setFormat<JCalibration> (
JFormat_t(9, 3, std::ios::fixed | std::ios::showpos));
360 out << static_cast<const JDetectorID&>(
detector);
366 out << static_cast<const JDetectorVersion&>(
detector) << endl;
367 out << static_cast<const JDetectorHeader&> (
detector) << endl;
375 out << detector.size() << endl;
377 for (const_iterator i = detector.begin(); i != detector.end(); ++i) {
415 JByteArrayReader
is(prefix, N);
417 int number_of_modules;
422 in >> number_of_modules;
426 for (
JModule module; number_of_modules != 0; --number_of_modules) {
430 this->push_back(module);
456 for (JComment::const_iterator i = this->
comment.begin(); i != this->
comment.end(); ++i) {
466 const int number_of_modules = this->size();
468 out << static_cast<const JDetectorID&> (*this);
469 out << static_cast<const JDetectorVersion&>(*this);
470 out << static_cast<const JDetectorHeader&> (*this);
471 out << number_of_modules;
473 for (const_iterator module = this->begin(); module != this->end(); ++module) {
536 return start_of_comment;
start_of_comment_type
Enumeration for different lengths of start of comment in binary I/O.
static start_of_comment_type getStartOfComment()
Get option for short start of comment in binary I/O.
Interface for binary output.
static void setVersion(const JVersion &version)
Set detector version.
Data structure for a composite optical module.
JUTMPosition & sub(const JUTMPosition &pos)
Subtract UTM position.
JDetectorVersion()
Default constructor.
JVersion_t
Enumeration of version types.
friend std::ostream & operator<<(std::ostream &out, const JDetector &detector)
Write detector to output.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
bool setToLatestVersion()
Set to latest version.
int second
index of PMT in module data structure.
static void setStartOfComment(const start_of_comment_type option)
Set option for short start of comment in binary I/O.
friend std::istream & operator>>(std::istream &in, JDetector &detector)
Read detector from input.
const std::string & getVersion() const
Get version.
const JPMT & getPMT(const JPMTAddress &address) const
Get PMT parameters.
static const size_t LENGTH_START_OF_COMMENT
Length of start of comment in binary I/O.
void setVersion(const JVersion &version)
Set version.
JModule & getModule(const JLocation &location)
Get module parameters.
Template definition of auxiliary base class for data structures composed of multiple base classes wit...
JDetector()
Default constructor.
int first
index of module in detector data structure
void setVersion(const std::string &version)
Set version.
Forward declaration of binary output.
virtual JReader & read(JReader &in) override
Read from input.
Version with PMT status field and comments.
Data structure for vector in three dimensions.
virtual JWriter & write(JWriter &out) const override
Write to output.
Logical location of module.
Auxiliary class for recursive type list generation.
Data structure for PMT geometry, calibration and status.
Data structure for detector version.
bool setVersion(const JDetectorVersion::JVersion_t &version, const bool force=false)
Set version.
Address of module in detector data structure.
Interface for binary input.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
const JModule & getModule(const JModuleAddress &address) const
Get module parameters.
static const JPutDetectorVersion putDetectorVersion(getDetectorVersion)
Function object to map numerical value to detector version.
static void setVersion(const JVersion &version)
Set detector version.
Address of PMT in detector data structure.
JDetector(const JDetectorID &id, const JVersion &version, const JDetectorHeader &header)
Constructor.
static start_of_comment_type & get_start_of_comment()
Get option for short start of comment in binary I/O.
Data structure for PMT geometry and calibration.
Auxiliary class for object identification.
JPMT & getPMT(const JPMTAddress &address)
Get PMT parameters.
void setVersion() const
Set version.
JDetector & operator+=(const JVector3D &pos)
Move detector elements.
JUTMPosition & add(const JUTMPosition &pos)
Add UTM position.
const JModule & getModule(const JLocation &location) const
Get module parameters.
Exception for accessing an index in a collection that is outside of its range.
do set_variable DETECTOR_TXT $WORKDIR detector
Auxiliary class for version identifier.
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
JDetector & operator-=(const JVector3D &pos)
Move detector elements.
JLANG::JObjectID JDetectorID
Type definition of detector identifier.
then usage $script[input file[working directory[option]]] nWhere option can be N
JModule & getModule(const JModuleAddress &address)
Get module parameters.
STD extensions for binary I/O.
Data structure for optical module.