1 #ifndef __JDETECTOR__JMODULE__ 
    2 #define __JDETECTOR__JMODULE__ 
  148                                const double   precision = 1.0e-3)
 
  150       if (first.size() == second.size()) {
 
  152         for (
size_t i = 0; i != first.size(); ++i) {
 
  198       if (index >= (
int) size()) {
 
  202       (*this)[index] = pmt;
 
  218       if (this->size() > 1u) {
 
  226         for (const_iterator pmt = this->begin(); pmt != this->end(); ++pmt) {
 
  228           const double xx = 1.0  -  pmt->getDX() * pmt->getDX();
 
  229           const double yy = 1.0  -  pmt->getDY() * pmt->getDY();
 
  230           const double zz = 1.0  -  pmt->getDZ() * pmt->getDZ();
 
  232           const double xy = -pmt->getDX() * pmt->getDY();
 
  233           const double xz = -pmt->getDX() * pmt->getDZ();
 
  234           const double yz = -pmt->getDY() * pmt->getDZ();
 
  245           x  +=  xx * pmt->getX()  + xy * pmt->getY()  +  xz * pmt->getZ();
 
  246           y  +=  xy * pmt->getX()  + yy * pmt->getY()  +  yz * pmt->getZ();
 
  247           z  +=  xz * pmt->getX()  + yz * pmt->getY()  +  zz * pmt->getZ();
 
  286       if (!this->empty()) {
 
  293         catch(
const exception&) {
 
  297           for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  298             pos.
add(i->getPosition());
 
  318       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  333       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  350       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  351         i->transform(R, pos);
 
  365       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  380       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  395       for (
iterator i = this->begin(); i != this->end(); ++i) {
 
  421       for (
iterator i = begin(); i != end(); ++i) {
 
  439       for (
iterator i = begin(); i != end(); ++i) {
 
  457       for (
iterator i = begin(); i != end(); ++i) {
 
  473       for (
iterator i = begin(); i != end(); ++i) {
 
  489       for (
iterator i = begin(); i != end(); ++i) {
 
  505       return this->
add(pos);
 
  517       return this->
sub(pos);
 
  542         in >> 
static_cast<JStatus&
>      (module);
 
  549       for (
JPMT pmt; 
n != 0 && in >> pmt; --
n) {
 
  550         module.push_back(pmt);
 
  573       out << static_cast<const JModuleIdentifier&>(module);
 
  575       out << static_cast<const JLocation&>        (module);
 
  579         out << static_cast<const JPosition3D&>  (module);
 
  581         out << static_cast<const JQuaternion3D&>(module);
 
  583         out << static_cast<const JCalibration&> (module);
 
  588         out << static_cast<const JStatus&>      (module);
 
  591       out << 
' ' << module.size() << endl;
 
  593       for (const_iterator i = module.begin(); i != module.end(); ++i) {
 
  594         out << 
' ' << *i << endl;;
 
  622         in >> 
static_cast<JStatus&
>      (module);
 
  631       for (JModule::iterator out = module.begin(); 
n != 0; --
n, ++out) {
 
  652       out << static_cast<const JModuleIdentifier&>(module);
 
  653       out << static_cast<const JLocation&>        (module);
 
  656         out << static_cast<const JPosition3D&>  (module);
 
  657         out << static_cast<const JQuaternion3D&>(module);
 
  658         out << static_cast<const JCalibration&> (module);
 
  662         out << static_cast<const JStatus&>      (module);
 
  665       int n = module.size();
 
  669       for (const_iterator i = module.begin(); i != module.end(); ++i) {
 
Data structure for detector version.
 
Logical location of module.
 
Base class for data structures with artithmetic capabilities.
 
Data structure for PMT geometry and calibration.
 
Data structure for time calibration.
 
double getT0() const
Get time offset.
 
void subT0(const double t0)
Subtract time offset.
 
void setCalibration(const JCalibration &cal)
Set calibration.
 
void setT0(const double t0)
Set time offset.
 
void addT0(const double t0)
Add time offset.
 
Logical location of module.
 
Data structure for a composite optical module.
 
JModule()
Default constructor.
 
void compile()
Compile module data.
 
static void setVersion(const JVersion &version)
Set detector version.
 
void setPMT(const int index, const JPMT &pmt)
Set PMT.
 
friend std::istream & operator>>(std::istream &in, JModule &module)
Read module from input.
 
static bool compare(const JModule &first, const JModule &second, const double precision=1.0e-3)
Compare modules.
 
JModule & add(const JVector3D &pos)
Add position.
 
JModule & sub(const double t0)
Subtract time offset.
 
JVector3D getCenter() const
Get center of module based on crossing point of PMT axes.
 
static JDetectorVersion & getVersion()
Get detector version.
 
friend JWriter & operator<<(JWriter &out, const JModule &module)
Write module to output.
 
void transform(const JRotation3D &R, const JVector3D &pos)
Transformation of geometry (see method JGEOMETRY3D::JPosition3D::transform(const JRotation3D&,...
 
JModule & operator-=(const JVector3D &pos)
Subtract position.
 
void transform(const JTransformation3D &T)
Transformation of geometry.
 
JModule & sub(const JVector3D &pos)
Subtract position.
 
JModule & add(const double t0)
Add time offset.
 
friend JReader & operator>>(JReader &in, JModule &module)
Read module from input.
 
friend std::ostream & operator<<(std::ostream &out, const JModule &module)
Write module to output.
 
void rotate(const JQuaternion3D &Q)
Rotate module.
 
const JPMT & getPMT(const int index) const
Get PMT.
 
JModule(const int id, const JLocation &location)
Constructor.
 
JModule & set(const JVector3D &pos)
Set position.
 
JModule & operator+=(const JVector3D &pos)
Add position.
 
void rotate(const JRotation3D &R)
Rotate module.
 
JModule & set(const double t0)
Set time offset.
 
void rotate_back(const JRotation3D &R)
Rotate back module.
 
JPMT & getPMT(const int index)
Get PMT.
 
void rotate_back(const JQuaternion3D &Q)
Rotate back module.
 
Data structure for PMT geometry, calibration and status.
 
Data structure for position in three dimensions.
 
JPosition3D & rotate(const JRotation3D &R)
Rotate.
 
const JPosition3D & getPosition() const
Get position.
 
double getDot(const JVector3D &vector) const
Get dot product.
 
JPosition3D()
Default constructor.
 
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
 
JVector3D & transform(const JMatrix3D &T)
Transform.
 
Data structure for unit quaternion in three dimensions.
 
const JRotation3D & getRotation() const
Get rotation.
 
Data structure for vector in three dimensions.
 
JVector3D & add(const JVector3D &vector)
Add vector.
 
JVector3D & div(const double factor)
Scale vector.
 
JVector3D()
Default constructor.
 
JVector3D & sub(const JVector3D &vector)
Subtract vector.
 
Data structure for normalised vector in three dimensions.
 
Interface for binary input.
 
Interface for binary output.
 
Auxiliary class for object identification.
 
Exception for accessing a value in a collection that is outside of its range.
 
void invert()
Invert matrix.
 
JDirection3D getDirection(const Vec &dir)
Get direction.
 
file Auxiliary data structures and methods for detector calibration.
 
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
 
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
 
std::iterator_traits< T >::value_type getAverage(T __begin, T __end)
Get average.
 
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
 
@ V5
Version with module status field.
 
@ V4
Version with quaternion and time offset per module.
 
Auxiliary class for version identifier.
 
Auxiliary class for handling status.
 
void set(const int bit)
Set PMT status.
 
bool has(const int bit) const
Test PMT status.
 
void reset(const int bit)
Reset PMT status.