Jpp  17.3.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
JMONITOR::JClusterBuilder Class Reference

Local coincidence cluster builder. More...

#include <JClusterBuilder.hh>

Inheritance diagram for JMONITOR::JClusterBuilder:
JTRIGGER::JBuildL1< JHitL1 > std::vector< JCluster > JDETECTOR::JModule std::vector< JPMT > JEEP::JStatus JDETECTOR::JCalibration JGEOMETRY3D::JQuaternion3D JGEOMETRY3D::JPosition3D JDETECTOR::JLocation JLANG::JObjectID JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > > JTRIGGER::JBuildL1< JHit >

Classes

class  MinimalMultiplicityFunctor
 functor that compares the multiplicity of a JCluster to some fixed given multiplicity. More...
 

Public Types

typedef JHitL1 value_type
 
typedef JMatch< value_typematch_type
 
typedef JDAQHitSelector selector_type
 

Public Member Functions

 JClusterBuilder (const double window, const bool combine)
 default constructor More...
 
 JClusterBuilder (const JDAQSuperFrame &frame, const JModule &module, const double window, const bool combine)
 constructor More...
 
void reset (const JDAQSuperFrame &frame, const JModule &module)
 This is a way to re-use the allocated memory. More...
 
vector< JCluster >::const_iterator begin_m (unsigned int multiplicity) const
 returns begin iterator for clusters with exactly the given multiplicity More...
 
vector< JCluster >::const_iterator end_m (unsigned int multiplicity) const
 returns end iterator for clusters with exactly the given multiplicity More...
 
vector< JCluster >::const_iterator begin_inclusive_m (unsigned int multiplicity) const
 returns begin iterator for clusters with at least the given multiplicity More...
 
vector< JCluster >::const_iterator end_inclusive_m (unsigned int multiplicity) const
 returns end iterator for clusters with at least the given multiplicity More...
 
unsigned int getNclusters (const unsigned int multiplicity) const
 return the number of clusters with exactly the given multiplicity More...
 
unsigned int getInclusiveNclusters (const unsigned int multiplicity) const
 return the number of clusters with at least the given multiplicity More...
 
template<class JOutput_t >
void operator() (const JSuperFrame2D< JHit > &input, JOutput_t out) const
 Build hits from calibrated data. More...
 
template<class JOutput_t >
void operator() (const JDAQSuperFrame &input, const JModule &module, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (typename JSuperFrame2D< JHit >::const_iterator __begin, typename JSuperFrame2D< JHit >::const_iterator __end, JOutput_t out) const
 Build hits from set of frames with calibrated data. More...
 
void operator() (const JSuperFrame1D< JHit > &input, JOutput_t out) const
 Build hits from calibrated data. More...
 
void operator() (const JDAQTimeslice &timeslice, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQEvent &event, const JModuleRouter &router, const bool snapshot, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQEvent &event, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQTimeslice &timeslice, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQEvent &event, const JModuleRouter &router, const bool snapshot, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQEvent &event, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void setPreprocessor (const JPreprocessor::JOption_t option, const match_type &match)
 Set pre-processor of consecutive hits. More...
 
void resetPreprocessor ()
 Reset pre-processor of consecutive hits. More...
 
void setDAQHitSelector (const JDAQHitSelector &selector)
 Set DAQ hit selector. More...
 
void resetDAQHitSelector ()
 Reset DAQ hit selector. More...
 
JSuperFrame2D< JHit > & demultiplex (const JDAQSuperFrame &input, const JModule &module) const
 Demultiplex and pre-process DAQ super frame. More...
 
const JPMTgetPMT (const int index) const
 Get PMT. More...
 
JPMTgetPMT (const int index)
 Get PMT. More...
 
void setPMT (const int index, const JPMT &pmt)
 Set PMT. More...
 
JVector3D getCenter () const
 Get center of module based on crossing point of PMT axes. More...
 
void compile ()
 Compile module data. More...
 
void rotate (const JRotation3D &R)
 Rotate module. More...
 
void rotate (const JQuaternion3D &Q)
 Rotate module. More...
 
JPosition3Drotate (const JRotation3X &R)
 Rotate around X-axis. More...
 
JPosition3Drotate (const JRotation3Y &R)
 Rotate around Y-axis. More...
 
JPosition3Drotate (const JRotation3Z &R)
 Rotate around Z-axis. More...
 
void rotate (double &__x, double &__y, double &__z) const
 Rotate. More...
 
void rotate_back (const JRotation3D &R)
 Rotate back module. More...
 
void rotate_back (const JQuaternion3D &Q)
 Rotate back module. More...
 
JPosition3Drotate_back (const JRotation3X &R)
 Rotate back around X-axis. More...
 
JPosition3Drotate_back (const JRotation3Y &R)
 Rotate back around Y-axis. More...
 
JPosition3Drotate_back (const JRotation3Z &R)
 Rotate back around Z-axis. More...
 
void rotate_back (double &__x, double &__y, double &__z) const
 Rotate back. More...
 
void transform (const JRotation3D &R, const JVector3D &pos)
 Transformation of geometry (see method JGEOMETRY3D::JPosition3D::transform(const JRotation3D&, const JVector3D&)). More...
 
void transform (const JTransformation3D &T)
 Transformation of geometry. More...
 
JVector3Dtransform (const JMatrix3D &T)
 Transform. More...
 
JModuleset (const JVector3D &pos)
 Set position. More...
 
JModuleset (const double t0)
 Set time offset. More...
 
void set (const int bit)
 Set PMT status. More...
 
JModuleadd (const JVector3D &pos)
 Add position. More...
 
JModuleadd (const double t0)
 Add time offset. More...
 
JQuaternion3Dadd (const JQuaternion3D &quaternion)
 Add quaternion. More...
 
JModulesub (const JVector3D &pos)
 Subtract position. More...
 
JModulesub (const double t0)
 Subtract time offset. More...
 
JQuaternion3Dsub (const JQuaternion3D &quaternion)
 Subtract quaternion. More...
 
JModuleoperator+= (const JVector3D &pos)
 Add position. More...
 
JModuleoperator-= (const JVector3D &pos)
 Subtract position. More...
 
int getID () const
 Get identifier. More...
 
int & getID ()
 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 less (const JLocation &location) const
 Less than method. More...
 
bool more (const int id) const
 More than method. More...
 
const JLocationgetLocation () const
 Get location. More...
 
JLocationgetLocation ()
 Get location. More...
 
void setLocation (const JLocation &location)
 Set location. More...
 
std::string toString () const
 Convert module location to string. More...
 
std::string toString (const std::string &fmt, const std::string target="%") const
 Convert module loation to string. More...
 
int getString () const
 Get string number. More...
 
int getFloor () const
 Get floor number. More...
 
const JPosition3DgetPosition () const
 Get position. More...
 
JPosition3DgetPosition ()
 Get position. More...
 
void setPosition (const JVector3D &pos)
 Set position. More...
 
 operator JAngle3D () const
 Type conversion operator. More...
 
 operator JVersor3D () const
 Type conversion operator. More...
 
 operator JVersor3D () const
 Type conversion operator. More...
 
void transform_back (const JRotation3D &R, const JVector3D &pos)
 Transform back position. More...
 
double getDot (const JAngle3D &angle) const
 Get dot product. More...
 
double getDot (const JVersor3D &dir) const
 Get dot product. More...
 
double getDot (const JVersor3Z &dir) const
 Get dot product. More...
 
double getDot (const JVector3D &vector) const
 Get dot product. More...
 
double getDot (const JQuaternion3D &quaternion) const
 Get dot product. More...
 
 operator JVector2D () const
 Type conversion operator. More...
 
double getX () const
 Get x position. More...
 
double getY () const
 Get y position. More...
 
double getZ () const
 Get z position. More...
 
JVector3Dnegate ()
 Negate vector. More...
 
JQuaternion3Dnegate ()
 Negate quaternion. More...
 
JVector3Dmul (const double factor)
 Scale vector. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JQuaternion3Dmul (const double factor)
 Scale quaternion. More...
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3X &second)
 Quaternion multiplication. More...
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3Y &second)
 Quaternion multiplication. More...
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3Z &second)
 Quaternion multiplication. More...
 
JQuaternion3Dmul (const JQuaternion3D &first, const JQuaternion3D &second)
 Quaternion multiplication. More...
 
JQuaternion3Dmul (const JQuaternion3X &qx, const JQuaternion3Y &qy, const JQuaternion3Z &qz)
 Quaternion multiplication. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
JVector3Ddiv (const double factor)
 Scale vector. More...
 
JQuaternion3Ddiv (const double factor)
 Scale quaternion. More...
 
bool equals (const JVector3D &vector, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
bool equals (const JQuaternion3D &quaternion, const double precision=std::numeric_limits< double >::min()) const
 Check equality. More...
 
bool equals (const JStatus &status) const
 Equal method. More...
 
double getLengthSquared () const
 Get length squared. More...
 
double getLengthSquared () const
 Get length squared. More...
 
double getLength () const
 Get length. More...
 
double getLength () const
 Get length. More...
 
double getDistanceSquared (const JVector3D &pos) const
 Get squared of distance to point. More...
 
double getDistanceSquared (const JQuaternion3D &quaternion) const
 Get squared of distance to quaternion. More...
 
double getDistance (const JVector3D &pos) const
 Get distance to point. More...
 
double getDistance (const JQuaternion3D &quaternion) const
 Get distance to quaternion. More...
 
JVector3DgetCross (const JVector3D &first, const JVector3D &second)
 Get cross product. More...
 
const JQuaternion3DgetQuaternion () const
 Get quaternion. More...
 
JQuaternion3DgetQuaternion ()
 Get quaternion. More...
 
void setQuaternion (const JQuaternion3D &quaternion)
 Set quaternion. More...
 
 operator JVector3D () const
 Type conversion operator. More...
 
double getAngle () const
 Get rotation angle. More...
 
double getA () const
 Get a value. More...
 
double getB () const
 Get b value. More...
 
double getC () const
 Get c value. More...
 
double getD () const
 Get d value. More...
 
JQuaternion3DsetIdentity ()
 Set to identity quaternion. More...
 
JQuaternion3Dconjugate ()
 Conjugate quaternion. More...
 
bool isIdentity (const double precision=std::numeric_limits< double >::min()) const
 Test identity. More...
 
JQuaternion3D getConjugate () const
 Get conjugate of this quaternion. More...
 
JQuaternion3Dnormalise ()
 Normalise quaternion. More...
 
JQuaternion3Dpow (const double y)
 Raise quaternion to given power. More...
 
JQuaternion3Dinterpolate (const JQuaternion3D &object, const double alpha)
 Interpolation between quaternions. More...
 
const JCalibrationgetCalibration () const
 Get calibration. More...
 
JCalibrationgetCalibration ()
 Get calibration. More...
 
void setCalibration (const JCalibration &cal)
 Set calibration. More...
 
double getT0 () const
 Get time offset. More...
 
void setT0 (const double t0)
 Set time offset. More...
 
void addT0 (const double t0)
 Add time offset. More...
 
void subT0 (const double t0)
 Subtract time offset. More...
 
int getStatus () const
 Get status. More...
 
JStatusgetStatus ()
 Get status. More...
 
int getStatus (const int mask) const
 Get status. More...
 
void setStatus (const JStatus &status)
 Set status. More...
 
bool has (const int bit) const
 Test PMT status. More...
 
void reset (const int bit)
 Reset PMT status. More...
 

Static Public Member Functions

static JDetectorVersiongetVersion ()
 Get detector version. More...
 
static void setVersion (const JVersion &version)
 Set detector version. More...
 
static bool compare (const JModule &first, const JModule &second, const double precision=1.0e-3)
 Compare modules. More...
 
static const JQuaternion3DgetIdentity ()
 Get identity quaternion. More...
 

Public Attributes

double TMax_ns
 
bool combine
 
JPreprocessor::JOption_t option
 pre-processor option More...
 
JLANG::JSharedPointer< match_typematch
 pre-processor match criterion More...
 
JLANG::JSharedPointer
< selector_type
selector
 DAQ hit selector. More...
 

Protected Member Functions

void setEndIterators ()
 Use std::partition to sort the clusters in order of decreasing multiplicity. More...
 

Protected Attributes

const unsigned int max_multiplicity
 the highest allowed value for the multiplicity More...
 
vector< vector< JCluster >
::iterator
end_iterators
 iterators pointing to the first element whose multiplicity is lower than the index More...
 
int __id
 
int string
 
int floor
 
double __x
 
double __y
 
double __z
 
double __a
 
double __b
 
double __c
 
double __d
 
double t0
 
int status
 

Detailed Description

Local coincidence cluster builder.

A coincidence cluster is defined as two or more hits on the same DOM within the defined time window.

Given a JDAQSuperframe (for the hits) and the corresponding JModule (for the timing) all the coincidence clusters are extracted and sorted by multiplicity.

Internally, the clusters are stored as a vector of JClusters

Parameters
frameJDAQSuperframe containing the hits
modulemodule corresponding to the JDAQSuperframe
windowtime window used for clustering

Definition at line 47 of file JClusterBuilder.hh.

Member Typedef Documentation

typedef JHitL1 JTRIGGER::JBuildL1< JHitL1 >::value_type
inherited

Definition at line 205 of file JBuildL1.hh.

Definition at line 39 of file JBuild.hh.

Definition at line 40 of file JBuild.hh.

Constructor & Destructor Documentation

JMONITOR::JClusterBuilder::JClusterBuilder ( const double  window,
const bool  combine 
)
inline

default constructor

Definition at line 52 of file JClusterBuilder.hh.

53  // order using std::partition
54  setEndIterators() ;
55  }
JBuildL1Parameters(const double Tmax_ns, const bool combine)
Constructor.
Definition: JBuildL1.hh:45
Template specialisation of L1 builder for JHitL1 data type.
Definition: JBuildL1.hh:197
void setEndIterators()
Use std::partition to sort the clusters in order of decreasing multiplicity.
JModule()
Default constructor.
Definition: JModule.hh:86
vector< vector< JCluster >::iterator > end_iterators
iterators pointing to the first element whose multiplicity is lower than the index ...
const unsigned int max_multiplicity
the highest allowed value for the multiplicity
JMONITOR::JClusterBuilder::JClusterBuilder ( const JDAQSuperFrame frame,
const JModule module,
const double  window,
const bool  combine 
)
inline

constructor

Definition at line 58 of file JClusterBuilder.hh.

59  // use the () operator of JBuildL1 to build L1s
60  (*this)(frame,module,back_inserter( *( (vector<JCluster>*)this) ) ) ;
61 
62  // order using std::partition
63  setEndIterators() ;
64  }
JBuildL1Parameters(const double Tmax_ns, const bool combine)
Constructor.
Definition: JBuildL1.hh:45
Template specialisation of L1 builder for JHitL1 data type.
Definition: JBuildL1.hh:197
void setEndIterators()
Use std::partition to sort the clusters in order of decreasing multiplicity.
JModule()
Default constructor.
Definition: JModule.hh:86
vector< vector< JCluster >::iterator > end_iterators
iterators pointing to the first element whose multiplicity is lower than the index ...
const unsigned int max_multiplicity
the highest allowed value for the multiplicity

Member Function Documentation

void JMONITOR::JClusterBuilder::reset ( const JDAQSuperFrame frame,
const JModule module 
)
inline

This is a way to re-use the allocated memory.

It behaves like the constructor, but new memory does not have to be allocated for vector<JCluster> all the time.

Definition at line 72 of file JClusterBuilder.hh.

72  {
73  static_cast<JModule>(*this) = module ;
74 
75  vector<JCluster>::clear() ; // vector is emptied, but memory stays allocated
76  (*this)(frame,module,back_inserter( *( (vector<JCluster>*)this) ) ) ;
77 
78  setEndIterators() ;
79  }
Data structure for a composite optical module.
Definition: JModule.hh:68
void setEndIterators()
Use std::partition to sort the clusters in order of decreasing multiplicity.
vector<JCluster>::const_iterator JMONITOR::JClusterBuilder::begin_m ( unsigned int  multiplicity) const
inline

returns begin iterator for clusters with exactly the given multiplicity

Definition at line 82 of file JClusterBuilder.hh.

82  {
83  // restrict to allowed range
84  multiplicity = max( (unsigned int)0,multiplicity) ;
85  multiplicity = min(max_multiplicity,multiplicity) ;
86  return end_iterators[multiplicity+1] ;
87  }
vector< vector< JCluster >::iterator > end_iterators
iterators pointing to the first element whose multiplicity is lower than the index ...
const unsigned int max_multiplicity
the highest allowed value for the multiplicity
vector<JCluster>::const_iterator JMONITOR::JClusterBuilder::end_m ( unsigned int  multiplicity) const
inline

returns end iterator for clusters with exactly the given multiplicity

Definition at line 90 of file JClusterBuilder.hh.

90  {
91  // restrict to allowed range
92  multiplicity = max( (unsigned int)0,multiplicity) ;
93  multiplicity = min(max_multiplicity,multiplicity) ;
94  return end_iterators[multiplicity] ;
95  }
vector< vector< JCluster >::iterator > end_iterators
iterators pointing to the first element whose multiplicity is lower than the index ...
const unsigned int max_multiplicity
the highest allowed value for the multiplicity
vector<JCluster>::const_iterator JMONITOR::JClusterBuilder::begin_inclusive_m ( unsigned int  multiplicity) const
inline

returns begin iterator for clusters with at least the given multiplicity

Definition at line 98 of file JClusterBuilder.hh.

98  {
100  }
vector< vector< JCluster >::iterator > end_iterators
iterators pointing to the first element whose multiplicity is lower than the index ...
const unsigned int max_multiplicity
the highest allowed value for the multiplicity
vector<JCluster>::const_iterator JMONITOR::JClusterBuilder::end_inclusive_m ( unsigned int  multiplicity) const
inline

returns end iterator for clusters with at least the given multiplicity

Definition at line 103 of file JClusterBuilder.hh.

103  {
104  return end_m(multiplicity) ;
105  }
vector< JCluster >::const_iterator end_m(unsigned int multiplicity) const
returns end iterator for clusters with exactly the given multiplicity
unsigned int JMONITOR::JClusterBuilder::getNclusters ( const unsigned int  multiplicity) const
inline

return the number of clusters with exactly the given multiplicity

Definition at line 108 of file JClusterBuilder.hh.

108  {
109  return distance( begin_m(multiplicity), end_m(multiplicity) ) ;
110  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
vector< JCluster >::const_iterator end_m(unsigned int multiplicity) const
returns end iterator for clusters with exactly the given multiplicity
vector< JCluster >::const_iterator begin_m(unsigned int multiplicity) const
returns begin iterator for clusters with exactly the given multiplicity
unsigned int JMONITOR::JClusterBuilder::getInclusiveNclusters ( const unsigned int  multiplicity) const
inline

return the number of clusters with at least the given multiplicity

Definition at line 113 of file JClusterBuilder.hh.

113  {
114  return distance( begin_inclusive_m(multiplicity), end_inclusive_m(multiplicity) ) ;
115  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
vector< JCluster >::const_iterator end_inclusive_m(unsigned int multiplicity) const
returns end iterator for clusters with at least the given multiplicity
vector< JCluster >::const_iterator begin_inclusive_m(unsigned int multiplicity) const
returns begin iterator for clusters with at least the given multiplicity
void JMONITOR::JClusterBuilder::setEndIterators ( )
inlineprotected

Use std::partition to sort the clusters in order of decreasing multiplicity.

The end_iterators denote the boundaries.

Definition at line 123 of file JClusterBuilder.hh.

123  {
125  for( unsigned int m=max_multiplicity; m>0; --m ) {
126  end_iterators[m] = partition( vector<JCluster>::begin(), vector<JCluster>::end(), MinimalMultiplicityFunctor(m) ) ;
127  }
129  }
vector< vector< JCluster >::iterator > end_iterators
iterators pointing to the first element whose multiplicity is lower than the index ...
const unsigned int max_multiplicity
the highest allowed value for the multiplicity
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHitL1 >::operator() ( const JSuperFrame2D< JHit > &  input,
JOutput_t  out 
) const
inlineinherited

Build hits from calibrated data.

The output data are time sorted.

Parameters
inputinput L0 data
outoutput L1 data

Definition at line 227 of file JBuildL1.hh.

228  {
229  const JSuperFrameClone2D<JHit> clone(input);
230 
231  buffer.clear();
232 
233  static_cast<const JBuildL1<JHit>&>(*this)(input, std::back_inserter(buffer));
234 
235  for (typename std::vector<JHit>::const_iterator p = buffer.begin(); p != buffer.end(); ++p) {
236 
237  JHitL1 hit(input.getModuleID());
238 
239  for (typename JSuperFrameClone2D<JHit>::const_iterator i = clone.begin(); i != clone.end(); ++i) {
240 
241  for (typename JSuperFrameClone2D<JHit>::value_type::const_iterator q = i->fast_forward(*p); this->getTimeDifference(*p,*q) <= TMax_ns; ++q) {
242 
243  hit.push_back(JHitL0(i->getPMTIdentifier(),
244  i->getAxis(),
245  *q));
246  }
247  }
248 
249  *out = hit.sort();
250  ++out;
251  }
252  }
std::vector< value_type >::const_iterator const_iterator
Data structure for L1 hit.
Definition: JHitL1.hh:34
Clone of JSuperFrame2D.
double getTimeDifference(const JDAQChronometer &first, const JDAQChronometer &second)
Get time difference between two chronometers.
std::vector< JHit > buffer
Definition: JBuildL1.hh:276
Data structure for L0 hit.
Definition: JHitL0.hh:27
void fast_forward(argument_type hit) const
Increment the internal iterators until the lower bounds corresponding to the time of the given hit...
const JHitL1 & sort()
Sort L0 hits.
Definition: JHitL1.hh:97
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHitL1 >::operator() ( const JDAQSuperFrame input,
const JModule module,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The time calibration is applied. The output data are time sorted.

Parameters
inputDAQ super frame
modulemodule
outoutput L1 data

Definition at line 266 of file JBuildL1.hh.

269  {
270  if (!input.empty()) {
271  (*this)(this->demultiplex(input, module), out);
272  }
273  }
bool empty() const
Definition: JDAQFrame.hh:180
JSuperFrame2D< JHit > & demultiplex(const JDAQSuperFrame &input, const JModule &module) const
Demultiplex and pre-process DAQ super frame.
Definition: JBuild.hh:103
void JTRIGGER::JBuildL1< JHit >::operator() ( typename JSuperFrame2D< JHit >::const_iterator  __begin,
typename JSuperFrame2D< JHit >::const_iterator  __end,
JOutput_t  out 
) const
inlineinherited

Build hits from set of frames with calibrated data.

The output data are time sorted.

Parameters
__beginbegin of input L0 data
__endend of input L0 data
outoutput L1 data

Definition at line 133 of file JBuildL1.hh.

136  {
137  (*this)(JSuperFrame1D<JHit_t>::multiplex(__begin, __end), out);
138  }
1-dimensional frame with time calibrated data from one optical module.
void JTRIGGER::JBuildL1< JHit >::operator() ( const JSuperFrame1D< JHit > &  input,
JOutput_t  out 
) const
inlineinherited

Build hits from calibrated data.

The output data are time sorted.

Parameters
inputinput L0 data
outoutput L1 data

Definition at line 150 of file JBuildL1.hh.

151  {
152  int n = input.size();
153 
154  for (typename JSuperFrame1D<JHit_t>::const_iterator q = input.begin(), p = q++; n != 0; ++q, --n) {
155 
156  if (this->getTimeDifference(*p,*q) <= TMax_ns) {
157 
158  *out = *p;
159  ++out;
160 
161  if (combine) {
162  for (++q, --n; this->getTimeDifference(*p,*q) <= TMax_ns; ++q, --n) {}
163  }
164  }
165 
166  p = q;
167  }
168  }
1-dimensional frame with time calibrated data from one optical module.
const int n
Definition: JPolint.hh:697
double getTimeDifference(const JDAQChronometer &first, const JDAQChronometer &second)
Get time difference between two chronometers.
void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::operator() ( const JDAQTimeslice timeslice,
const JModuleRouter router,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The time calibration is applied. Note that the output data are not time sorted.

Parameters
timesliceDAQ time slice
routermodule router
outoutput data

Definition at line 57 of file JBuildHelper.hh.

60  {
61  for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
62  if (router.hasModule(i->getModuleID())) {
63  static_cast<const JBuild_t&>(*this)(*i, router.getModule(i->getModuleID()), out);
64  }
65  }
66  }
const JModule & getModule(const JObjectID &id) const
Get module parameters.
bool hasModule(const JObjectID &id) const
Has module.
void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
const bool  snapshot,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The time calibration is applied. Note that the output data are not time sorted.

Parameters
eventDAQ event
routermodule router
snapshotuse shapshot hits (else use triggered hits)
outoutput data

Definition at line 81 of file JBuildHelper.hh.

85  {
86  static_cast<const JBuild_t&>(*this)(JDAQTimeslice(event, snapshot), router, out);
87  }
Data time slice.
void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The snapshot data of the DAQ event are used. The time calibration is applied. Note that the output data are not time sorted.

Parameters
eventDAQ event
routermodule router
outoutput data

Definition at line 102 of file JBuildHelper.hh.

105  {
106  static_cast<const JBuild_t&>(*this)(JDAQTimeslice(event, true), router, out);
107  }
Data time slice.
void JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > >::operator() ( const JDAQTimeslice timeslice,
const JModuleRouter router,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The time calibration is applied. Note that the output data are not time sorted.

Parameters
timesliceDAQ time slice
routermodule router
outoutput data

Definition at line 57 of file JBuildHelper.hh.

60  {
61  for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
62  if (router.hasModule(i->getModuleID())) {
63  static_cast<const JBuild_t&>(*this)(*i, router.getModule(i->getModuleID()), out);
64  }
65  }
66  }
const JModule & getModule(const JObjectID &id) const
Get module parameters.
bool hasModule(const JObjectID &id) const
Has module.
void JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
const bool  snapshot,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The time calibration is applied. Note that the output data are not time sorted.

Parameters
eventDAQ event
routermodule router
snapshotuse shapshot hits (else use triggered hits)
outoutput data

Definition at line 81 of file JBuildHelper.hh.

85  {
86  static_cast<const JBuild_t&>(*this)(JDAQTimeslice(event, snapshot), router, out);
87  }
Data time slice.
void JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
JOutput_t  out 
) const
inlineinherited

Build hits from uncalibrated DAQ data.

The snapshot data of the DAQ event are used. The time calibration is applied. Note that the output data are not time sorted.

Parameters
eventDAQ event
routermodule router
outoutput data

Definition at line 102 of file JBuildHelper.hh.

105  {
106  static_cast<const JBuild_t&>(*this)(JDAQTimeslice(event, true), router, out);
107  }
Data time slice.
void JTRIGGER::JBuild< JHit >::setPreprocessor ( const JPreprocessor::JOption_t  option,
const match_type match 
)
inlineinherited

Set pre-processor of consecutive hits.

Parameters
optionoption
matchmatch criterion

Definition at line 59 of file JBuild.hh.

60  {
61  this->option = option;
62  this->match.reset(match.clone());
63  }
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
virtual void reset() override
Reset pointer.
void JTRIGGER::JBuild< JHit >::resetPreprocessor ( )
inlineinherited

Reset pre-processor of consecutive hits.

Definition at line 69 of file JBuild.hh.

70  {
71  this->option = JPreprocessor::none_t;
72  this->match.reset();
73  }
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
virtual void reset() override
Reset pointer.
void JTRIGGER::JBuild< JHit >::setDAQHitSelector ( const JDAQHitSelector selector)
inlineinherited

Set DAQ hit selector.

Parameters
selectorDAQ hit selector

Definition at line 81 of file JBuild.hh.

82  {
83  this->selector.reset(selector.clone());
84  }
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
void JTRIGGER::JBuild< JHit >::resetDAQHitSelector ( )
inlineinherited

Reset DAQ hit selector.

Definition at line 90 of file JBuild.hh.

91  {
92  this->selector.reset(new JDAQHitDefaultSelector());
93  }
JLANG::JSharedPointer< selector_type > selector
DAQ hit selector.
Definition: JBuild.hh:117
Default class to select DAQ hits.
JSuperFrame2D<JHit >& JTRIGGER::JBuild< JHit >::demultiplex ( const JDAQSuperFrame input,
const JModule module 
) const
inlineinherited

Demultiplex and pre-process DAQ super frame.

Parameters
inputDAQ super frame
modulemodule data
Returns
2D super frame

Definition at line 103 of file JBuild.hh.

105  {
107 
108  if (match.is_valid()) {
109  buffer.preprocess(option, *match);
110  }
111 
112  return buffer;
113  }
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
JLANG::JSharedPointer< selector_type > selector
DAQ hit selector.
Definition: JBuild.hh:117
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
bool is_valid() const
Check validity of pointer.
void preprocess(JPreprocessor::JOption_t option, const match_type &match)
Pre-process data.
2-dimensional frame with time calibrated data from one optical module.
static JDetectorVersion& JDETECTOR::JModule::getVersion ( )
inlinestaticinherited

Get detector version.

Definition at line 118 of file JModule.hh.

119  {
120  static JDetectorVersion version;
121 
122  return version;
123  }
version
Definition: JEditTuneHV.sh:5
static void JDETECTOR::JModule::setVersion ( const JVersion version)
inlinestaticinherited

Set detector version.

Parameters
versionversion

Definition at line 131 of file JModule.hh.

132  {
133  getVersion() = JDetectorVersion(version);
134  }
static JDetectorVersion & getVersion()
Get detector version.
Definition: JModule.hh:118
static bool JDETECTOR::JModule::compare ( const JModule first,
const JModule second,
const double  precision = 1.0e-3 
)
inlinestaticinherited

Compare modules.

The comparison only covers the orientations of the modules.

Parameters
firstfirst module
secondsecond module
precisionprecision
Returns
true if two modules are equal; else false

Definition at line 147 of file JModule.hh.

150  {
151  if (first.size() == second.size()) {
152 
153  for (size_t i = 0; i != first.size(); ++i) {
154  if (first[i].getDirection().getDot(second[i].getDirection()) < 1.0 - precision) {
155  return false;
156  }
157  }
158 
159  return true;
160  }
161 
162  return false;
163  }
double getDot(const JAngle3D &angle) const
Get dot product.
JDirection3D getDirection(const Vec &dir)
Get direction.
const JPMT& JDETECTOR::JModule::getPMT ( const int  index) const
inlineinherited

Get PMT.

Parameters
indexreadout channel (TDC)
Returns
PMT at given index

Definition at line 173 of file JModule.hh.

174  {
175  return at(index);
176  }
JPMT& JDETECTOR::JModule::getPMT ( const int  index)
inlineinherited

Get PMT.

Parameters
indexreadout channel (TDC)
Returns
PMT at given index

Definition at line 185 of file JModule.hh.

186  {
187  return at(index);
188  }
void JDETECTOR::JModule::setPMT ( const int  index,
const JPMT pmt 
)
inlineinherited

Set PMT.

Parameters
indexreadout channel (TDC)
pmtPMT

Definition at line 197 of file JModule.hh.

198  {
199  if (index >= (int) size()) {
200  resize(index + 1);
201  }
202 
203  (*this)[index] = pmt;
204  }
JVector3D JDETECTOR::JModule::getCenter ( ) const
inlineinherited

Get center of module based on crossing point of PMT axes.

This method perform a fit of the crossing point of the PMT axes.
A general purpose implementation of such a fit is available in JFIT::JEstimator<JPoint3D>.

Returns
center

Definition at line 215 of file JModule.hh.

216  {
217  using namespace JPP;
218 
219  if (this->size() > 1u) {
220 
221  double x = 0;
222  double y = 0;
223  double z = 0;
224 
225  JMatrix3S V;
226 
227  for (const_iterator pmt = this->begin(); pmt != this->end(); ++pmt) {
228 
229  const double xx = 1.0 - pmt->getDX() * pmt->getDX();
230  const double yy = 1.0 - pmt->getDY() * pmt->getDY();
231  const double zz = 1.0 - pmt->getDZ() * pmt->getDZ();
232 
233  const double xy = -pmt->getDX() * pmt->getDY();
234  const double xz = -pmt->getDX() * pmt->getDZ();
235  const double yz = -pmt->getDY() * pmt->getDZ();
236 
237  V.a00 += xx;
238  V.a01 += xy;
239  V.a02 += xz;
240 
241  V.a11 += yy;
242  V.a12 += yz;
243 
244  V.a22 += zz;
245 
246  x += xx * pmt->getX() + xy * pmt->getY() + xz * pmt->getZ();
247  y += xy * pmt->getX() + yy * pmt->getY() + yz * pmt->getZ();
248  z += xz * pmt->getX() + yz * pmt->getY() + zz * pmt->getZ();
249  }
250 
251  V.a10 = V.a01;
252  V.a20 = V.a02;
253  V.a21 = V.a12;
254 
255  V.invert();
256 
257  return JVector3D(V.a00 * x + V.a01 * y + V.a02 * z,
258  V.a10 * x + V.a11 * y + V.a12 * z,
259  V.a20 * x + V.a21 * y + V.a22 * z);
260 
261  } else {
262  throw JValueOutOfRange("JModule::getCenter(): Not enough PMTs.");
263  }
264  }
V(JDAQEvent-JTriggerReprocessor)*1.0/(JDAQEvent+1.0e-10)
double u[N+1]
Definition: JPolint.hh:776
JVector3D()
Default constructor.
Definition: JVector3D.hh:41
void JDETECTOR::JModule::compile ( )
inlineinherited

Compile module data.

For detector versions before JDetectorVersion::V4, the position, quaternion data and time offset of the module should be set.
The position is set to the intersection point of the PMT axes (or their average position if this is not possible).
The quaternion data are maintained.
For an optical module (i.e. floor > 0), the time offset is set to the average time offset of the PMTs and for a base module (i.e. floor = 0), the time offset is set to zero.
These time offsets should be corrected for delay in the piezo sensor and hydrophone, respectively.

Definition at line 282 of file JModule.hh.

283  {
284  using namespace std;
285  using namespace JPP;
286 
287  if (!this->empty()) {
288 
289  JPosition3D& pos = this->getPosition();
290 
291  try {
292  pos = this->getCenter();
293  }
294  catch(const exception&) {
295 
296  pos = JPosition3D(0.0, 0.0, 0.0);
297 
298  for (iterator i = this->begin(); i != this->end(); ++i) {
299  pos.add(i->getPosition());
300  }
301 
302  pos.div(size());
303  }
304  }
305 
306  this->setCalibration(getAverage(make_array(this->begin(), this->end(), &JModule::getT0), 0.0));
307  }
std::iterator_traits< T >::value_type getAverage(T __begin, T __end)
Get average.
Definition: JMath.hh:494
const array_type< JValue_t > & make_array(const JValue_t(&array)[N])
Method to create array of values.
Definition: JVectorize.hh:54
JVector3D getCenter() const
Get center of module based on crossing point of PMT axes.
Definition: JModule.hh:215
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
JPosition3D()
Default constructor.
Definition: JPosition3D.hh:48
void setCalibration(const JCalibration &cal)
Set calibration.
double getT0() const
Get time offset.
void JDETECTOR::JModule::rotate ( const JRotation3D R)
inlineinherited

Rotate module.

Parameters
Rrotation matrix

Definition at line 315 of file JModule.hh.

316  {
318 
319  for (iterator i = this->begin(); i != this->end(); ++i) {
320  i->rotate(R);
321  }
322  }
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
void JDETECTOR::JModule::rotate ( const JQuaternion3D Q)
inlineinherited

Rotate module.

Parameters
Qquaternion

Definition at line 377 of file JModule.hh.

378  {
380 
381  for (iterator i = this->begin(); i != this->end(); ++i) {
382  i->rotate(Q);
383  }
384  }
Q(UTCMax_s-UTCMin_s)-livetime_s
JPosition3D & rotate(const JRotation3D &R)
Rotate.
Definition: JPosition3D.hh:186
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3X R)
inlineinherited

Rotate around X-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 214 of file JPosition3D.hh.

215  {
216  R.rotate(__y, __z);
217 
218  return *this;
219  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3Y R)
inlineinherited

Rotate around Y-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 242 of file JPosition3D.hh.

243  {
244  R.rotate(__x, __z);
245 
246  return *this;
247  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
JPosition3D& JGEOMETRY3D::JPosition3D::rotate ( const JRotation3Z R)
inlineinherited

Rotate around Z-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 270 of file JPosition3D.hh.

271  {
272  R.rotate(__x, __y);
273 
274  return *this;
275  }
void rotate(double &__x, double &__y) const
Rotate.
Definition: JRotation2D.hh:96
void JGEOMETRY3D::JQuaternion3D::rotate ( double &  __x,
double &  __y,
double &  __z 
) const
inlineinherited

Rotate.

Parameters
__xx value
__yy value
__zz value

Definition at line 805 of file JQuaternion3D.hh.

806  {
807  const double qx = 2.0 * (__c*__z - __d*__y);
808  const double qy = 2.0 * (__d*__x - __b*__z);
809  const double qz = 2.0 * (__b*__y - __c*__x);
810 
811  __x = __x + __c*qz - __d*qy + __a*qx;
812  __y = __y - __b*qz + __a*qy + __d*qx;
813  __z = __z + __a*qz + __b*qy - __c*qx;
814  }
void JDETECTOR::JModule::rotate_back ( const JRotation3D R)
inlineinherited

Rotate back module.

Parameters
Rrotation matrix

Definition at line 330 of file JModule.hh.

331  {
333 
334  for (iterator i = this->begin(); i != this->end(); ++i) {
335  i->rotate_back(R);
336  }
337  }
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
void JDETECTOR::JModule::rotate_back ( const JQuaternion3D Q)
inlineinherited

Rotate back module.

Parameters
Qquaternion

Definition at line 392 of file JModule.hh.

393  {
395 
396  for (iterator i = this->begin(); i != this->end(); ++i) {
397  i->rotate_back(Q);
398  }
399  }
Q(UTCMax_s-UTCMin_s)-livetime_s
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3X R)
inlineinherited

Rotate back around X-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 228 of file JPosition3D.hh.

229  {
230  R.rotate_back(__y, __z);
231 
232  return *this;
233  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3Y R)
inlineinherited

Rotate back around Y-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 256 of file JPosition3D.hh.

257  {
258  R.rotate_back(__x, __z);
259 
260  return *this;
261  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
JPosition3D& JGEOMETRY3D::JPosition3D::rotate_back ( const JRotation3Z R)
inlineinherited

Rotate back around Z-axis.

Parameters
Rrotation matrix
Returns
this position

Definition at line 284 of file JPosition3D.hh.

285  {
286  R.rotate_back(__x, __y);
287 
288  return *this;
289  }
void rotate_back(double &__x, double &__y) const
Rotate back.
Definition: JRotation2D.hh:112
void JGEOMETRY3D::JQuaternion3D::rotate_back ( double &  __x,
double &  __y,
double &  __z 
) const
inlineinherited

Rotate back.

Parameters
__xx value
__yy value
__zz value

Definition at line 824 of file JQuaternion3D.hh.

825  {
826  const double qx = 2.0 * (__d*__y - __c*__z);
827  const double qy = 2.0 * (__b*__z - __d*__x);
828  const double qz = 2.0 * (__c*__x - __b*__y);
829 
830  __x = __x - __c*qz + __d*qy + __a*qx;
831  __y = __y + __b*qz + __a*qy - __d*qx;
832  __z = __z + __a*qz - __b*qy + __c*qx;
833  }
void JDETECTOR::JModule::transform ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transformation of geometry (see method JGEOMETRY3D::JPosition3D::transform(const JRotation3D&, const JVector3D&)).

Parameters
Rrotation matrix
posposition of origin (after rotation)

Definition at line 346 of file JModule.hh.

348  {
350 
351  for (iterator i = this->begin(); i != this->end(); ++i) {
352  i->transform(R, pos);
353  }
354  }
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
Definition: JPosition3D.hh:331
then JCookie sh JDataQuality D $DETECTOR_ID R
Definition: JDataQuality.sh:41
void JDETECTOR::JModule::transform ( const JTransformation3D T)
inlineinherited

Transformation of geometry.

Parameters
Ttransformation

Definition at line 362 of file JModule.hh.

363  {
364  JPosition3D::transform(T.getRotation(), T.getPosition());
365 
366  for (iterator i = this->begin(); i != this->end(); ++i) {
367  i->transform(T);
368  }
369  }
void transform(const JRotation3D &R, const JVector3D &pos)
Transform position.
Definition: JPosition3D.hh:331
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JVector3D& JGEOMETRY3D::JVector3D::transform ( const JMatrix3D T)
inlineinherited

Transform.

Parameters
Tmatrix
Returns
this vector

Definition at line 206 of file JVector3D.hh.

207  {
208  T.transform(__x, __y, __z);
209 
210  return *this;
211  }
do set_variable OUTPUT_DIRECTORY $WORKDIR T
JModule& JDETECTOR::JModule::set ( const JVector3D pos)
inlineinherited

Set position.

Parameters
posposition
Returns
this module

Definition at line 408 of file JModule.hh.

409  {
410  return add(pos - this->getPosition());
411  }
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:130
JModule & add(const JVector3D &pos)
Add position.
Definition: JModule.hh:420
JModule& JDETECTOR::JModule::set ( const double  t0)
inlineinherited

Set time offset.

Parameters
t0time offset [ns]
Returns
this module

Definition at line 456 of file JModule.hh.

457  {
458  for (iterator i = begin(); i != end(); ++i) {
459  i->setT0(t0);
460  }
461 
462  return *this;
463  }
void JEEP::JStatus::set ( const int  bit)
inlineinherited

Set PMT status.

Parameters
bitbit

Definition at line 131 of file JStatus.hh.

132  {
133  this->status |= (1<<bit);
134  }
JModule& JDETECTOR::JModule::add ( const JVector3D pos)
inlineinherited

Add position.

Parameters
posposition
Returns
this module

Definition at line 420 of file JModule.hh.

421  {
422  for (iterator i = begin(); i != end(); ++i) {
423  i->add(pos);
424  }
425 
426  JPosition3D::add(pos);
427 
428  return *this;
429  }
JVector3D & add(const JVector3D &vector)
Add vector.
Definition: JVector3D.hh:142
JModule& JDETECTOR::JModule::add ( const double  t0)
inlineinherited

Add time offset.

Parameters
t0time offset [ns]
Returns
this module

Definition at line 472 of file JModule.hh.

473  {
474  for (iterator i = begin(); i != end(); ++i) {
475  i->addT0(t0);
476  }
477 
478  return *this;
479  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::add ( const JQuaternion3D quaternion)
inlineinherited

Add quaternion.

Parameters
quaternionquaternion
Returns
this quaternion

Definition at line 637 of file JQuaternion3D.hh.

638  {
639  __a += quaternion.getA();
640  __b += quaternion.getB();
641  __c += quaternion.getC();
642  __d += quaternion.getD();
643 
644  return *this;
645  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JModule& JDETECTOR::JModule::sub ( const JVector3D pos)
inlineinherited

Subtract position.

Parameters
posposition
Returns
this module

Definition at line 438 of file JModule.hh.

439  {
440  for (iterator i = begin(); i != end(); ++i) {
441  i->sub(pos);
442  }
443 
444  JPosition3D::sub(pos);
445 
446  return *this;
447  }
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Definition: JVector3D.hh:158
JModule& JDETECTOR::JModule::sub ( const double  t0)
inlineinherited

Subtract time offset.

Parameters
t0time offset [ns]
Returns
this module

Definition at line 488 of file JModule.hh.

489  {
490  for (iterator i = begin(); i != end(); ++i) {
491  i->subT0(t0);
492  }
493 
494  return *this;
495  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::sub ( const JQuaternion3D quaternion)
inlineinherited

Subtract quaternion.

Parameters
quaternionquaternion
Returns
this quaternion

Definition at line 654 of file JQuaternion3D.hh.

655  {
656  __a -= quaternion.getA();
657  __b -= quaternion.getB();
658  __c -= quaternion.getC();
659  __d -= quaternion.getD();
660 
661  return *this;
662  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JModule& JDETECTOR::JModule::operator+= ( const JVector3D pos)
inlineinherited

Add position.

Parameters
posposition
Returns
this module

Definition at line 504 of file JModule.hh.

505  {
506  return this->add(pos);
507  }
JModule & add(const JVector3D &pos)
Add position.
Definition: JModule.hh:420
JModule& JDETECTOR::JModule::operator-= ( const JVector3D pos)
inlineinherited

Subtract position.

Parameters
posposition
Returns
this module

Definition at line 516 of file JModule.hh.

517  {
518  return this->sub(pos);
519  }
JModule & sub(const JVector3D &pos)
Subtract position.
Definition: JModule.hh:438
int JLANG::JObjectID::getID ( ) const
inlineinherited

Get identifier.

Returns
identifier

Definition at line 50 of file JObjectID.hh.

51  {
52  return __id;
53  }
int& JLANG::JObjectID::getID ( )
inlineinherited

Get identifier.

Returns
identifier

Definition at line 61 of file JObjectID.hh.

62  {
63  return __id;
64  }
void JLANG::JObjectID::setID ( const int  id)
inlineinherited

Set identifier.

Parameters
ididentifier

Definition at line 72 of file JObjectID.hh.

73  {
74  this->__id = id;
75  }
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 84 of file JObjectID.hh.

85  {
86  return this->getID() < object.getID();
87  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
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 96 of file JObjectID.hh.

97  {
98  return this->getID() < id;
99  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
bool JDETECTOR::JLocation::less ( const JLocation location) const
inlineinherited

Less than method.

Parameters
locationmodule location
Returns
true if first location before second location; else false

Definition at line 157 of file JLocation.hh.

158  {
159  if (this->getString() == location.getString())
160  return this->getFloor() < location.getFloor();
161  else
162  return this->getString() < location.getString();
163  }
int getFloor() const
Get floor number.
Definition: JLocation.hh:145
int getString() const
Get string number.
Definition: JLocation.hh:134
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 108 of file JObjectID.hh.

109  {
110  return this->getID() > id;
111  }
int getID() const
Get identifier.
Definition: JObjectID.hh:50
const JLocation& JDETECTOR::JLocation::getLocation ( ) const
inlineinherited

Get location.

Returns
location

Definition at line 69 of file JLocation.hh.

70  {
71  return static_cast<const JLocation&>(*this);
72  }
Logical location of module.
Definition: JLocation.hh:37
JLocation& JDETECTOR::JLocation::getLocation ( )
inlineinherited

Get location.

Returns
location

Definition at line 80 of file JLocation.hh.

81  {
82  return static_cast<JLocation&>(*this);
83  }
Logical location of module.
Definition: JLocation.hh:37
void JDETECTOR::JLocation::setLocation ( const JLocation location)
inlineinherited

Set location.

Parameters
locationlocation

Definition at line 91 of file JLocation.hh.

92  {
93  static_cast<JLocation&>(*this) = location;
94  }
Logical location of module.
Definition: JLocation.hh:37
std::string JDETECTOR::JLocation::toString ( ) const
inlineinherited

Convert module location to string.

Returns
string

Definition at line 102 of file JLocation.hh.

103  {
104  return toString("% %");
105  }
std::string toString() const
Convert module location to string.
Definition: JLocation.hh:102
std::string JDETECTOR::JLocation::toString ( const std::string fmt,
const std::string  target = "%" 
) const
inlineinherited

Convert module loation to string.

The targets target in the format string fmt are consecutively replaced by floor and string.

Parameters
fmtformat
targettarget
Returns
string

Definition at line 118 of file JLocation.hh.

119  {
120  JLANG::JString buffer(fmt);
121 
122  buffer.replace(target, string, 1);
123  buffer.replace(target, floor, 1);
124 
125  return buffer;
126  }
Wrapper class around STL string class.
Definition: JString.hh:27
int JDETECTOR::JLocation::getString ( ) const
inlineinherited

Get string number.

Returns
string number

Definition at line 134 of file JLocation.hh.

135  {
136  return string;
137  }
int JDETECTOR::JLocation::getFloor ( ) const
inlineinherited

Get floor number.

Returns
floor number

Definition at line 145 of file JLocation.hh.

146  {
147  return floor;
148  }
const JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( ) const
inlineinherited

Get position.

Returns
position

Definition at line 130 of file JPosition3D.hh.

131  {
132  return static_cast<const JPosition3D&>(*this);
133  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
JPosition3D& JGEOMETRY3D::JPosition3D::getPosition ( )
inlineinherited

Get position.

Returns
position

Definition at line 141 of file JPosition3D.hh.

142  {
143  return static_cast<JPosition3D&>(*this);
144  }
Data structure for position in three dimensions.
Definition: JPosition3D.hh:36
void JGEOMETRY3D::JPosition3D::setPosition ( const JVector3D pos)
inlineinherited

Set position.

Parameters
posposition

Definition at line 152 of file JPosition3D.hh.

153  {
154  static_cast<JVector3D&>(*this) = pos;
155  }
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
JGEOMETRY3D::JPosition3D::operator JAngle3D ( ) const
inlineinherited

Type conversion operator.

Returns
angle

Definition at line 163 of file JPosition3D.hh.

164  {
165  return JAngle3D(getX(), getY(), getZ());
166  }
Data structure for angles in three dimensions.
Definition: JAngle3D.hh:33
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JGEOMETRY3D::JPosition3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 174 of file JPosition3D.hh.

175  {
176  return JVersor3D(getX(), getY(), getZ());
177  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
double getZ() const
Get z position.
Definition: JVector3D.hh:115
JGEOMETRY3D::JQuaternion3D::operator JVersor3D ( ) const
inlineinherited

Type conversion operator.

Returns
direction

Definition at line 520 of file JQuaternion3D.hh.

521  {
522  return JVersor3D(this->getB(), this->getC(), this->getD());
523  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
void JGEOMETRY3D::JPosition3D::transform_back ( const JRotation3D R,
const JVector3D pos 
)
inlineinherited

Transform back position.

The final position is obtained as follows:

  1. offset position with position pos;
  2. rotation of postion according matrix R;
Parameters
Rrotation matrix
posposition of origin (before rotation)

Definition at line 359 of file JPosition3D.hh.

361  {
362  // offset with respect to origin
363 
364  add(pos);
365 
366  // rotate back geometry to system with particle direction along z-axis
367 
368  rotate_back(R);
369  }
JPosition3D & rotate_back(const JRotation3D &R)
Rotate back.
Definition: JPosition3D.hh:200
JVector3D & add(const JVector3D &vector)
Add vector.
Definition: JVector3D.hh:142
double JGEOMETRY3D::JPosition3D::getDot ( const JAngle3D angle) const
inlineinherited

Get dot product.

Parameters
angleangle
Returns
dot product

Definition at line 378 of file JPosition3D.hh.

379  {
380  return
381  getX() * angle.getDX() +
382  getY() * angle.getDY() +
383  getZ() * angle.getDZ();
384  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double getDX() const
Get x direction.
Definition: JAngle3D.hh:108
double getDZ() const
Get z direction.
Definition: JAngle3D.hh:130
double getDY() const
Get y direction.
Definition: JAngle3D.hh:119
double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3D dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 393 of file JPosition3D.hh.

394  {
395  return
396  getX() * dir.getDX() +
397  getY() * dir.getDY() +
398  getZ() * dir.getDZ();
399  }
double getDY() const
Get y direction.
Definition: JVersor3D.hh:106
double getDX() const
Get x direction.
Definition: JVersor3D.hh:95
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double getDZ() const
Get z direction.
Definition: JVersor3D.hh:117
double JGEOMETRY3D::JPosition3D::getDot ( const JVersor3Z dir) const
inlineinherited

Get dot product.

Parameters
dirdirection
Returns
dot product

Definition at line 408 of file JPosition3D.hh.

409  {
410  return
411  getX() * dir.getDX() +
412  getY() * dir.getDY() +
413  getZ() * dir.getDZ();
414  }
double getDY() const
Get y direction.
Definition: JVersor3Z.hh:158
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getDX() const
Get x direction.
Definition: JVersor3Z.hh:147
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getDZ() const
Get z direction.
Definition: JVersor3Z.hh:169
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double JGEOMETRY3D::JVector3D::getDot ( const JVector3D vector) const
inlineinherited

Get dot product.

Parameters
vectorvector
Returns
dot product

Definition at line 282 of file JVector3D.hh.

283  {
284  return
285  getX() * vector.getX() +
286  getY() * vector.getY() +
287  getZ() * vector.getZ();
288  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double JGEOMETRY3D::JQuaternion3D::getDot ( const JQuaternion3D quaternion) const
inlineinherited

Get dot product.

Parameters
quaternionquaternion
Returns
dot product

Definition at line 933 of file JQuaternion3D.hh.

934  {
935  return
936  getA() * quaternion.getA() -
937  getB() * quaternion.getB() -
938  getC() * quaternion.getC() -
939  getD() * quaternion.getD();
940  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JGEOMETRY3D::JVector3D::operator JVector2D ( ) const
inlineinherited

Type conversion operator.

Returns
JVector2D

Definition at line 83 of file JVector3D.hh.

84  {
85  return JVector2D(this->getX(), this->getY());
86  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double JGEOMETRY3D::JVector3D::getX ( ) const
inlineinherited

Get x position.

Returns
x position

Definition at line 94 of file JVector3D.hh.

95  {
96  return __x;
97  }
double JGEOMETRY3D::JVector3D::getY ( ) const
inlineinherited

Get y position.

Returns
y position

Definition at line 104 of file JVector3D.hh.

105  {
106  return __y;
107  }
double JGEOMETRY3D::JVector3D::getZ ( ) const
inlineinherited

Get z position.

Returns
z position

Definition at line 115 of file JVector3D.hh.

116  {
117  return __z;
118  }
JVector3D& JGEOMETRY3D::JVector3D::negate ( )
inlineinherited

Negate vector.

Returns
this vector

Definition at line 126 of file JVector3D.hh.

127  {
128  __x = -__x;
129  __y = -__y;
130  __z = -__z;
131 
132  return *this;
133  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::negate ( )
inlineinherited

Negate quaternion.

Returns
this quaternion

Definition at line 620 of file JQuaternion3D.hh.

621  {
622  __a = -__a;
623  __b = -__b;
624  __c = -__c;
625  __d = -__d;
626 
627  return *this;
628  }
JVector3D& JGEOMETRY3D::JVector3D::mul ( const double  factor)
inlineinherited

Scale vector.

Parameters
factormultiplication factor
Returns
this vector

Definition at line 174 of file JVector3D.hh.

175  {
176  __x *= factor;
177  __y *= factor;
178  __z *= factor;
179 
180  return *this;
181  }
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 354 of file JMath.hh.

355  {
356  return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::mul ( const double  factor)
inlineinherited

Scale quaternion.

Parameters
factormultiplication factor
Returns
this quaternion

Definition at line 671 of file JQuaternion3D.hh.

672  {
673  __a *= factor;
674  __b *= factor;
675  __c *= factor;
676  __d *= factor;
677 
678  return *this;
679  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D first,
const JQuaternion3X second 
)
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (also called cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 708 of file JQuaternion3D.hh.

709  {
710  __a = first.getA() * second.getA() - first.getB() * second.getB();
711  __b = first.getA() * second.getB() + first.getB() * second.getA();
712  __c = first.getC() * second.getA() + first.getD() * second.getB();
713  __d = -first.getC() * second.getB() + first.getD() * second.getA();
714 
715  return *this;
716  }
double getB() const
Get b value.
double getB() const
Get b value.
double getA() const
Get a value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D first,
const JQuaternion3Y second 
)
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (or cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 728 of file JQuaternion3D.hh.

730  {
731  __a = first.getA() * second.getA() - first.getC() * second.getC();
732  __b = first.getB() * second.getA() - first.getD() * second.getC();
733  __c = first.getA() * second.getC() + first.getC() * second.getA();
734  __d = first.getB() * second.getC() + first.getD() * second.getA();
735 
736  return *this;
737  }
double getB() const
Get b value.
double getA() const
Get a value.
double getC() const
Get c value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D first,
const JQuaternion3Z second 
)
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (or cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 749 of file JQuaternion3D.hh.

751  {
752  __a = first.getA() * second.getA() - first.getD() * second.getD();
753  __b = first.getB() * second.getA() + first.getC() * second.getD();
754  __c = -first.getB() * second.getD() + first.getC() * second.getA();
755  __d = first.getA() * second.getD() + first.getD() * second.getA();
756 
757  return *this;
758  }
double getB() const
Get b value.
double getA() const
Get a value.
double getD() const
Get d value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3D first,
const JQuaternion3D second 
)
inlineinherited

Quaternion multiplication.

This method evaluates the Hamilton product (or cross product).

Parameters
firstfirst quaternion
secondsecond quaternion
Returns
this quaternion

Definition at line 770 of file JQuaternion3D.hh.

772  {
773  __a = first.getA() * second.getA() - first.getB() * second.getB() - first.getC() * second.getC() - first.getD() * second.getD();
774  __b = first.getA() * second.getB() + first.getB() * second.getA() + first.getC() * second.getD() - first.getD() * second.getC();
775  __c = first.getA() * second.getC() - first.getB() * second.getD() + first.getC() * second.getA() + first.getD() * second.getB();
776  __d = first.getA() * second.getD() + first.getB() * second.getC() - first.getC() * second.getB() + first.getD() * second.getA();
777 
778  return *this;
779  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::mul ( const JQuaternion3X qx,
const JQuaternion3Y qy,
const JQuaternion3Z qz 
)
inlineinherited

Quaternion multiplication.

Parameters
qxrotation around x-axis
qyrotation around y-axis
qzrotation around x-axis
Returns
this quaternion

Definition at line 790 of file JQuaternion3D.hh.

793  {
794  return *this = JQuaternion3D().setIdentity().mul(qz).mul(qy).mul(qx);
795  }
JQuaternion3D()
Default constructor.
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 354 of file JMath.hh.

355  {
356  return static_cast<JFirst_t&>(*this) = JFirst_t().mul(static_cast<const JFirst_t&>(*this), object);
357  }
JVector3D& JGEOMETRY3D::JVector3D::div ( const double  factor)
inlineinherited

Scale vector.

Parameters
factordivision factor
Returns
this vector

Definition at line 190 of file JVector3D.hh.

191  {
192  __x /= factor;
193  __y /= factor;
194  __z /= factor;
195 
196  return *this;
197  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::div ( const double  factor)
inlineinherited

Scale quaternion.

Parameters
factordivision factor
Returns
this quaternion

Definition at line 688 of file JQuaternion3D.hh.

689  {
690  __a /= factor;
691  __b /= factor;
692  __c /= factor;
693  __d /= factor;
694 
695  return *this;
696  }
bool JGEOMETRY3D::JVector3D::equals ( const JVector3D vector,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
vectorvector
precisionprecision
Returns
true if vectors are equal; else false

Definition at line 221 of file JVector3D.hh.

223  {
224  return (fabs(getX() - vector.getX()) <= precision &&
225  fabs(getY() - vector.getY()) <= precision &&
226  fabs(getZ() - vector.getZ()) <= precision);
227  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
bool JGEOMETRY3D::JQuaternion3D::equals ( const JQuaternion3D quaternion,
const double  precision = std::numeric_limits<double>::min() 
) const
inlineinherited

Check equality.

Parameters
quaternionquaternion
precisionnumerical precision
Returns
true if quaternions are equal; else false

Definition at line 843 of file JQuaternion3D.hh.

845  {
846  return (fabs(getA() - quaternion.getA()) <= precision &&
847  fabs(getB() - quaternion.getB()) <= precision &&
848  fabs(getC() - quaternion.getC()) <= precision &&
849  fabs(getD() - quaternion.getD()) <= precision);
850  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
bool JEEP::JStatus::equals ( const JStatus status) const
inlineinherited

Equal method.

Parameters
statusstatus
Returns
true if this status equal to given status; else false

Definition at line 109 of file JStatus.hh.

110  {
111  return this->status == status.status;
112  }
double JGEOMETRY3D::JVector3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 235 of file JVector3D.hh.

236  {
237  return getX()*getX() + getY()*getY() + getZ()*getZ();
238  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
double JGEOMETRY3D::JQuaternion3D::getLengthSquared ( ) const
inlineinherited

Get length squared.

Returns
square of length

Definition at line 886 of file JQuaternion3D.hh.

887  {
888  return getA()*getA() + getB()*getB() + getC()*getC() + getD()*getD();
889  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
double JGEOMETRY3D::JVector3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 246 of file JVector3D.hh.

247  {
248  return sqrt(getLengthSquared());
249  }
double getLengthSquared() const
Get length squared.
Definition: JVector3D.hh:235
double JGEOMETRY3D::JQuaternion3D::getLength ( ) const
inlineinherited

Get length.

Returns
length

Definition at line 897 of file JQuaternion3D.hh.

898  {
899  return sqrt(getLengthSquared());
900  }
double getLengthSquared() const
Get length squared.
double JGEOMETRY3D::JVector3D::getDistanceSquared ( const JVector3D pos) const
inlineinherited

Get squared of distance to point.

Parameters
posposition
Returns
square of distance

Definition at line 258 of file JVector3D.hh.

259  {
260  return JVector3D(pos).sub(*this).getLengthSquared();
261  }
JVector3D()
Default constructor.
Definition: JVector3D.hh:41
double JGEOMETRY3D::JQuaternion3D::getDistanceSquared ( const JQuaternion3D quaternion) const
inlineinherited

Get squared of distance to quaternion.

Parameters
quaternionquaternion
Returns
square of distance

Definition at line 909 of file JQuaternion3D.hh.

910  {
911  return JQuaternion3D(quaternion).sub(*this).getLengthSquared();
912  }
JQuaternion3D()
Default constructor.
double JGEOMETRY3D::JVector3D::getDistance ( const JVector3D pos) const
inlineinherited

Get distance to point.

Parameters
posposition
Returns
distance

Definition at line 270 of file JVector3D.hh.

271  {
272  return sqrt(getDistanceSquared(pos));
273  }
double getDistanceSquared(const JVector3D &pos) const
Get squared of distance to point.
Definition: JVector3D.hh:258
double JGEOMETRY3D::JQuaternion3D::getDistance ( const JQuaternion3D quaternion) const
inlineinherited

Get distance to quaternion.

Parameters
quaternionquaternion
Returns
distance

Definition at line 921 of file JQuaternion3D.hh.

922  {
923  return sqrt(getDistanceSquared(quaternion));
924  }
double getDistanceSquared(const JQuaternion3D &quaternion) const
Get squared of distance to quaternion.
JVector3D& JGEOMETRY3D::JVector3D::getCross ( const JVector3D first,
const JVector3D second 
)
inlineinherited

Get cross product.

Note that this vector should not overlap with the first or second vector,

Parameters
firstfirst vector
secondsecond vector
Returns
this vector

Definition at line 299 of file JVector3D.hh.

301  {
302  __x = first .getY() * second.getZ() - second.getY() * first .getZ();
303  __y = second.getX() * first .getZ() - first .getX() * second.getZ();
304  __z = first .getX() * second.getY() - second.getX() * first .getY();
305 
306  return *this;
307  }
double getY() const
Get y position.
Definition: JVector3D.hh:104
double getX() const
Get x position.
Definition: JVector3D.hh:94
double getZ() const
Get z position.
Definition: JVector3D.hh:115
static const JQuaternion3D& JGEOMETRY3D::JQuaternion3D::getIdentity ( )
inlinestaticinherited

Get identity quaternion.

Returns
identity quaternion

Definition at line 463 of file JQuaternion3D.hh.

464  {
465  static const JQuaternion3D Q = JQuaternion3D().setIdentity();
466 
467  return Q;
468  }
Q(UTCMax_s-UTCMin_s)-livetime_s
Data structure for unit quaternion in three dimensions.
JQuaternion3D()
Default constructor.
const JQuaternion3D& JGEOMETRY3D::JQuaternion3D::getQuaternion ( ) const
inlineinherited

Get quaternion.

Returns
quaternion

Definition at line 476 of file JQuaternion3D.hh.

477  {
478  return static_cast<const JQuaternion3D&>(*this);
479  }
Data structure for unit quaternion in three dimensions.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::getQuaternion ( )
inlineinherited

Get quaternion.

Returns
quaternion

Definition at line 487 of file JQuaternion3D.hh.

488  {
489  return static_cast<JQuaternion3D&>(*this);
490  }
Data structure for unit quaternion in three dimensions.
void JGEOMETRY3D::JQuaternion3D::setQuaternion ( const JQuaternion3D quaternion)
inlineinherited

Set quaternion.

Parameters
quaternionquaternion

Definition at line 498 of file JQuaternion3D.hh.

499  {
500  static_cast<JQuaternion3D&>(*this) = quaternion;
501  }
Data structure for unit quaternion in three dimensions.
JGEOMETRY3D::JQuaternion3D::operator JVector3D ( ) const
inlineinherited

Type conversion operator.

Returns
position

Definition at line 509 of file JQuaternion3D.hh.

510  {
511  return JVector3D(this->getB(), this->getC(), this->getD());
512  }
double getB() const
Get b value.
Data structure for vector in three dimensions.
Definition: JVector3D.hh:34
double getD() const
Get d value.
double getC() const
Get c value.
double JGEOMETRY3D::JQuaternion3D::getAngle ( ) const
inlineinherited

Get rotation angle.

Returns
angle [rad]

Definition at line 531 of file JQuaternion3D.hh.

532  {
533  return atan2(sqrt(this->getB()*this->getB() +
534  this->getC()*this->getC() +
535  this->getD()*this->getD()),
536  this->getA()) * 2.0;
537  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
double JGEOMETRY3D::JQuaternion3D::getA ( ) const
inlineinherited

Get a value.

Returns
a value

Definition at line 545 of file JQuaternion3D.hh.

546  {
547  return __a;
548  }
double JGEOMETRY3D::JQuaternion3D::getB ( ) const
inlineinherited

Get b value.

Returns
b value

Definition at line 556 of file JQuaternion3D.hh.

557  {
558  return __b;
559  }
double JGEOMETRY3D::JQuaternion3D::getC ( ) const
inlineinherited

Get c value.

Returns
c value

Definition at line 567 of file JQuaternion3D.hh.

568  {
569  return __c;
570  }
double JGEOMETRY3D::JQuaternion3D::getD ( ) const
inlineinherited

Get d value.

Returns
d value

Definition at line 578 of file JQuaternion3D.hh.

579  {
580  return __d;
581  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::setIdentity ( )
inlineinherited

Set to identity quaternion.

Returns
this quaternion

Definition at line 589 of file JQuaternion3D.hh.

590  {
591  __a = 1.0;
592  __b = 0.0;
593  __c = 0.0;
594  __d = 0.0;
595 
596  return *this;
597  }
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::conjugate ( )
inlineinherited

Conjugate quaternion.

Returns
this quaternion

Definition at line 605 of file JQuaternion3D.hh.

606  {
607  __b = -__b;
608  __c = -__c;
609  __d = -__d;
610 
611  return *this;
612  }
bool JGEOMETRY3D::JQuaternion3D::isIdentity ( const double  precision = std::numeric_limits<double>::min()) const
inlineinherited

Test identity.

Parameters
precisionprecision
Returns
true if identity quaternion; else false

Definition at line 859 of file JQuaternion3D.hh.

860  {
861  if (fabs(getA()) <= precision) {
862 
863  if (fabs(getB()) <= precision)
864  return ((fabs(getC()) <= precision && fabs(fabs(getD()) - 1.0) <= precision) ||
865  (fabs(fabs(getC()) - 1.0) <= precision && fabs(getD()) <= precision));
866  else
867  return (fabs(fabs(getB()) - 1.0) <= precision &&
868  fabs(getC()) <= precision &&
869  fabs(getD()) <= precision);
870 
871  } else {
872 
873  return (fabs(fabs(getA()) - 1.0) <= precision &&
874  fabs(getB()) <= precision &&
875  fabs(getC()) <= precision &&
876  fabs(getD()) <= precision);
877  }
878  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
double getA() const
Get a value.
JQuaternion3D JGEOMETRY3D::JQuaternion3D::getConjugate ( ) const
inlineinherited

Get conjugate of this quaternion.

Returns
conjugate quaternion

Definition at line 948 of file JQuaternion3D.hh.

949  {
950  return JQuaternion3D(*this).conjugate();
951  }
JQuaternion3D()
Default constructor.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::normalise ( )
inlineinherited

Normalise quaternion.

Returns
this quaternion

Definition at line 959 of file JQuaternion3D.hh.

960  {
961  const double v = getLength();
962 
963  if (v != 0.0) {
964  mul(1.0 / v);
965  }
966 
967  return *this;
968  }
JQuaternion3D & mul(const double factor)
Scale quaternion.
data_type v[N+1][M+1]
Definition: JPolint.hh:777
double getLength() const
Get length.
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::pow ( const double  y)
inlineinherited

Raise quaternion to given power.

Parameters
ypower
Returns
this object

Definition at line 977 of file JQuaternion3D.hh.

978  {
979  const double v = sqrt(getB() * getB() +
980  getC() * getC() +
981  getD() * getD());
982 
983  if (v != 0.0) {
984 
985  const JVersor3D u(getB(), getC(), getD());
986 
987  const double theta = atan2(v, getA());
988 
989  *this = JQuaternion3D(2.0 * theta * y, u);
990  }
991 
992  return *this;
993  }
double getB() const
Get b value.
double getD() const
Get d value.
double getC() const
Get c value.
JQuaternion3D()
Default constructor.
double getA() const
Get a value.
data_type v[N+1][M+1]
Definition: JPolint.hh:777
Data structure for normalised vector in three dimensions.
Definition: JVersor3D.hh:26
double u[N+1]
Definition: JPolint.hh:776
JQuaternion3D& JGEOMETRY3D::JQuaternion3D::interpolate ( const JQuaternion3D object,
const double  alpha 
)
inlineinherited

Interpolation between quaternions.

The result is equal to *this = (1 - alpha) * (*this) + (alpha) * (object).

Parameters
objectobject
alphainterpolation factor [0, 1]
Returns
this object

Definition at line 1004 of file JQuaternion3D.hh.

1006  {
1007  const double MAXIMAL_DOT_PRODUCT = 0.9995;
1008 
1009  JQuaternion3D v0(*this);
1010  JQuaternion3D v1(object);
1011 
1012  v0.normalise();
1013  v1.normalise();
1014 
1015  double dot = v0.getDot(v1);
1016 
1017  if (dot < 0.0) {
1018  v1 = -v1;
1019  dot = -dot;
1020  }
1021 
1022  double s1 = alpha;
1023  double s0 = 1.0 - alpha;
1024 
1025  if (dot <= MAXIMAL_DOT_PRODUCT) {
1026 
1027  const double theta_0 = acos(dot);
1028  const double theta_1 = theta_0 * alpha;
1029 
1030  s1 = sin(theta_1) / sin(theta_0);
1031  s0 = cos(theta_1) - dot * s1;
1032  }
1033 
1034  *this = (s0 * v0) + (s1 * v1);
1035 
1036  return normalise();
1037  }
then usage set_variable ACOUSTICS_WORKDIR $WORKDIR set_variable FORMULA sin([0]+2 *$PI *([1]+[2]*x)*x)" set_variable DY 1.0e-8 mkdir $WORKDIR for DETECTOR in $DETECTORS[*]
Data structure for unit quaternion in three dimensions.
JQuaternion3D & normalise()
Normalise quaternion.
const JCalibration& JDETECTOR::JCalibration::getCalibration ( ) const
inlineinherited

Get calibration.

Returns
calibration

Definition at line 67 of file JDetector/JCalibration.hh.

68  {
69  return *this;
70  }
JCalibration& JDETECTOR::JCalibration::getCalibration ( )
inlineinherited

Get calibration.

Returns
calibration

Definition at line 78 of file JDetector/JCalibration.hh.

79  {
80  return *this;
81  }
void JDETECTOR::JCalibration::setCalibration ( const JCalibration cal)
inlineinherited

Set calibration.

Parameters
calcalibration

Definition at line 89 of file JDetector/JCalibration.hh.

90  {
91  *this = cal;
92  }
double JDETECTOR::JCalibration::getT0 ( ) const
inlineinherited

Get time offset.

Returns
time offset [ns]

Definition at line 100 of file JDetector/JCalibration.hh.

101  {
102  return t0;
103  }
void JDETECTOR::JCalibration::setT0 ( const double  t0)
inlineinherited

Set time offset.

Parameters
t0time offset [ns]

Definition at line 111 of file JDetector/JCalibration.hh.

112  {
113  this->t0 = t0;
114  }
void JDETECTOR::JCalibration::addT0 ( const double  t0)
inlineinherited

Add time offset.

Parameters
t0time offset [ns]

Definition at line 122 of file JDetector/JCalibration.hh.

123  {
124  this->t0 += t0;
125  }
void JDETECTOR::JCalibration::subT0 ( const double  t0)
inlineinherited

Subtract time offset.

Parameters
t0time offset [ns]

Definition at line 133 of file JDetector/JCalibration.hh.

134  {
135  this->t0 -= t0;
136  }
int JEEP::JStatus::getStatus ( ) const
inlineinherited

Get status.

Returns
status

Definition at line 63 of file JStatus.hh.

64  {
65  return this->status;
66  }
JStatus& JEEP::JStatus::getStatus ( )
inlineinherited

Get status.

Returns
status

Definition at line 74 of file JStatus.hh.

75  {
76  return *this;
77  }
int JEEP::JStatus::getStatus ( const int  mask) const
inlineinherited

Get status.

Parameters
maskmask
Returns
status

Definition at line 86 of file JStatus.hh.

87  {
88  return (this->status & mask);
89  }
void JEEP::JStatus::setStatus ( const JStatus status)
inlineinherited

Set status.

Parameters
statusstatus

Definition at line 97 of file JStatus.hh.

98  {
99  this->status = status.status;
100  }
bool JEEP::JStatus::has ( const int  bit) const
inlineinherited

Test PMT status.

Parameters
bitbit

Definition at line 120 of file JStatus.hh.

121  {
122  return (this->status & (1<<bit)) != 0;
123  }
void JEEP::JStatus::reset ( const int  bit)
inlineinherited

Reset PMT status.

Parameters
bitbit

Definition at line 142 of file JStatus.hh.

143  {
144  this->status &= ~(1<<bit);
145  }

Member Data Documentation

const unsigned int JMONITOR::JClusterBuilder::max_multiplicity
protected

the highest allowed value for the multiplicity

Definition at line 150 of file JClusterBuilder.hh.

vector< vector<JCluster>::iterator > JMONITOR::JClusterBuilder::end_iterators
protected

iterators pointing to the first element whose multiplicity is lower than the index

Definition at line 156 of file JClusterBuilder.hh.

double JTRIGGER::JBuildL1Parameters::TMax_ns
inherited

Definition at line 74 of file JBuildL1.hh.

bool JTRIGGER::JBuildL1Parameters::combine
inherited

Definition at line 75 of file JBuildL1.hh.

pre-processor option

Definition at line 115 of file JBuild.hh.

pre-processor match criterion

Definition at line 116 of file JBuild.hh.

DAQ hit selector.

Definition at line 117 of file JBuild.hh.

int JLANG::JObjectID::__id
protectedinherited

Definition at line 140 of file JObjectID.hh.

int JDETECTOR::JLocation::string
protectedinherited

Definition at line 234 of file JLocation.hh.

int JDETECTOR::JLocation::floor
protectedinherited

Definition at line 235 of file JLocation.hh.

double JGEOMETRY3D::JVector3D::__x
protectedinherited

Definition at line 310 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__y
protectedinherited

Definition at line 311 of file JVector3D.hh.

double JGEOMETRY3D::JVector3D::__z
protectedinherited

Definition at line 312 of file JVector3D.hh.

double JGEOMETRY3D::JQuaternion3D::__a
protectedinherited

Definition at line 1117 of file JQuaternion3D.hh.

double JGEOMETRY3D::JQuaternion3D::__b
protectedinherited

Definition at line 1118 of file JQuaternion3D.hh.

double JGEOMETRY3D::JQuaternion3D::__c
protectedinherited

Definition at line 1119 of file JQuaternion3D.hh.

double JGEOMETRY3D::JQuaternion3D::__d
protectedinherited

Definition at line 1120 of file JQuaternion3D.hh.

double JDETECTOR::JCalibration::t0
protectedinherited

Definition at line 202 of file JDetector/JCalibration.hh.

int JEEP::JStatus::status
protectedinherited

Definition at line 200 of file JStatus.hh.


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