1 #ifndef __JDETECTOR__JDETECTOR__
2 #define __JDETECTOR__JDETECTOR__
33 namespace JDETECTOR {}
34 namespace JPP {
using namespace JDETECTOR; }
94 public JMultiEquals<JDetector, JTYPELIST<JDetectorID, JVersion>::typelist>,
172 return setVersion(getLatestDetectorVersion<JDetectorVersion::JVersion_t>());
184 for (iterator i = begin(); i != end(); ++i) {
200 for (iterator i = begin(); i != end(); ++i) {
216 return at(address.
first);
228 return at(address.
first);
240 for (JDetector::const_iterator module = this->begin(); module != this->end(); ++module) {
241 if (*module == location) {
258 for (JDetector::iterator module = this->begin(); module != this->end(); ++module) {
259 if (*module == location) {
309 >> static_cast<JDetectorID&>(detector)
312 int number_of_modules;
318 catch(std::exception&) {}
326 in >> number_of_modules;
332 istringstream(buffer) >> number_of_modules;
336 for (
JModule module; number_of_modules != 0 && in >> module; --number_of_modules) {
337 detector.push_back(module);
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));
368 out << static_cast<const JDetectorID&>(
detector);
374 out << static_cast<const JDetectorVersion&>(
detector) << endl;
375 out << static_cast<const JDetectorHeader&> (
detector) << endl;
383 out << detector.size() << endl;
385 for (const_iterator i = detector.begin(); i != detector.end(); ++i) {
423 JByteArrayReader
is(prefix, N);
425 int number_of_modules;
430 in >> number_of_modules;
434 for (
JModule module; number_of_modules != 0; --number_of_modules) {
438 this->push_back(module);
464 for (JComment::const_iterator i = this->
comment.begin(); i != this->
comment.end(); ++i) {
474 const int number_of_modules = this->size();
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;
481 for (const_iterator module = this->begin(); module != this->end(); ++module) {
544 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.
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
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.
JModule & getModule(const JModuleAddress &address)
Get module parameters.
STD extensions for binary I/O.
Data structure for optical module.