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>());
 
  183       for (iterator module = this->begin(); module != this->end(); ++module) {
 
  184         module->getStatus().set(bit);
 
  196       for (iterator module = this->begin(); module != this->end(); ++module) {
 
  197         module->getStatus().reset(bit);
 
  209       for (iterator module = this->begin(); module != this->end(); ++module) {
 
  210         for (JModule::iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
 
  211           pmt->getStatus().set(bit);
 
  224       for (iterator module = this->begin(); module != this->end(); ++module) {
 
  225         for (JModule::iterator pmt = module->begin(); pmt != module->end(); ++pmt) {
 
  226           pmt->getStatus().reset(bit);
 
  240       for (iterator i = begin(); i != end(); ++i) {
 
  256       for (iterator i = begin(); i != end(); ++i) {
 
  272       return at(address.
first);
 
  284       return at(address.
first);
 
  296       for (JDetector::const_iterator module = this->begin(); module != this->end(); ++module) {
 
  297         if (*module == location) {
 
  314       for (JDetector::iterator module = this->begin(); module != this->end(); ++module) {
 
  315         if (*module == location) {
 
  365           >> static_cast<JDetectorID&>(detector)
 
  368         int number_of_modules;
 
  374         catch(std::exception&) {}
 
  382           in >> number_of_modules;
 
  388           istringstream(buffer) >> number_of_modules;
 
  392         for (
JModule module; number_of_modules != 0 && in >> module; --number_of_modules) {
 
  393           detector.push_back(module);
 
  415       setFormat<JPosition3D>  (
JFormat_t( 9, 3, std::ios::fixed | std::ios::showpos));
 
  416       setFormat<JDirection3D> (
JFormat_t( 9, 6, std::ios::fixed | std::ios::showpos));
 
  417       setFormat<JQuaternion3D>(
JFormat_t( 9, 6, std::ios::fixed | std::ios::showpos));
 
  418       setFormat<JCalibration> (
JFormat_t(10, 3, std::ios::fixed | std::ios::showpos));
 
  424       out << static_cast<const JDetectorID&>(
detector);
 
  430         out << static_cast<const JDetectorVersion&>(
detector) << endl;
 
  431         out << static_cast<const JDetectorHeader&> (
detector) << endl;
 
  439       out << detector.size() << endl;
 
  441       for (const_iterator i = detector.begin(); i != detector.end(); ++i) {
 
  479       JByteArrayReader 
is(prefix, N);
 
  481       int number_of_modules;
 
  486       in >> number_of_modules;
 
  490       for (
JModule module; number_of_modules != 0; --number_of_modules) {
 
  494         this->push_back(module);
 
  520         for (JComment::const_iterator i = this->
comment.begin(); i != this->
comment.end(); ++i) {
 
  530       const int number_of_modules = this->size();
 
  532       out << static_cast<const JDetectorID&>     (*this);
 
  533       out << static_cast<const JDetectorVersion&>(*this);
 
  534       out << static_cast<const JDetectorHeader&> (*this);
 
  535       out << number_of_modules;
 
  537       for (const_iterator module = this->begin(); module != this->end(); ++module) {
 
  600       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. 
 
void setModuleStatus(const int bit)
Set status of all modules. 
 
friend std::istream & operator>>(std::istream &in, JDetector &detector)
Read detector from input. 
 
void setPMTStatus(const int bit)
Set status of all PMTs. 
 
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. 
 
void resetModuleStatus(const int bit)
Reset status of all modules. 
 
Forward declaration of binary output. 
 
virtual JReader & read(JReader &in) override
Read from input. 
 
void resetPMTStatus(const int bit)
Reset status of all PMTs. 
 
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. 
 
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
 
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS 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.