1 #ifndef __JDYNAMICS__JDYNAMICS__
2 #define __JDYNAMICS__JDYNAMICS__
36 namespace JDYNAMICS {}
37 namespace JPP {
using namespace JDYNAMICS; }
60 template<
class JKey_t,
class JValue_t,
class JEvaluator_t>
63 double xmin = std::numeric_limits<double>::max();
66 if (!i->second.empty() && i->second.getXmin() < xmin) {
67 xmin = i->second.getXmin();
81 template<
class JKey_t,
class JValue_t,
class JEvaluator_t>
84 double xmax = std::numeric_limits<double>::lowest();
87 if (!i->second.empty() && i->second.getXmax() > xmax) {
88 xmax = i->second.getXmax();
128 t0_s(std::numeric_limits<double>::lowest())
136 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
137 if (module->getFloor() != 0) {
156 t0_s = std::numeric_limits<double>::lowest();
216 for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
224 if (t1_s >= f1.getXmin() && t1_s <= f1.getXmax()) {
237 buffer[module->getID()] = Q1;
280 if (!calibration.
empty())
281 return out <<
"[" <<
FIXED(15,0) << calibration.
getXmin()
331 t0_s(std::numeric_limits<double>::lowest())
344 t0_s = std::numeric_limits<double>::lowest();
351 for (JACOUSTICS::JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
419 for (JDetector::iterator module = detector.begin(); module != detector.end(); ++module) {
421 if (module->getFloor() != 0) {
423 if (!buffer.
has(module->getString())) {
425 buffer[module->getString()] =
calibration[module->getString()](t1_s);
429 if (buffer.
has(module->getString())) {
430 module->set(geometry[module->getString()].getPosition(buffer[module->getString()], module->getFloor()) -
getPiezoPosition());
472 if (!calibration.
empty())
473 return out <<
"[" <<
FIXED(15,0) << calibration.
getXmin()
509 template<
class JObjectIterator_t>
510 void load(JObjectIterator_t& input)
void setTmax(const double Tmax_s)
Set applicability period.
JTOOLS::JElement2D< double, JACOUSTICS::JMODEL::JString > element_type
number of points for interpolation
const_reverse_iterator rend() const
begin of reverse of calibration data
The elements in a collection are sorted according to their abscissa values and a given distance opera...
void update(JDetector &detector, const double t1_s)
Calibrate given detector at given time.
Dynamic orientation calibration.
Dynamic position calibration.
JDynamics(const JDetector &detector, const double Tmax_s)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const JOrientation &calibration)
Write calibration to output stream.
JTOOLS::JHashMap< int, function_type > data_type
const_reverse_iterator rend() const
begin of reverse of calibration data
JQuaternion3D getQuaternion(const JQuaternion &Q)
Get quaternion.
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
function_type::collection_type::container_type container_type
General purpose class for hash map of unique elements.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
bool hasDetectorAddressMap(const int id)
Check if detector address map is available.
const_reverse_iterator rbegin() const
begin of reverse of calibration data
const_iterator begin() const
begin of calibration data
static JRotation getRotation
Function object to get rotation matrix to go from first to second module.
Lookup table for PMT addresses in detector.
Auxiliary data structure for floating point format specification.
Interface of object iteration for a single data type.
data_type::const_reverse_iterator const_reverse_iterator
Data structure for detector geometry and calibration.
double getXmin() const
Get minimal abscissa.
static double getXmax(const JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t > &input)
Get maximal abscissa of mapped function objects.
JTOOLS::JHashMap< int, JGEOMETRY3D::JQuaternion3D > buffer_type
static double getXmin(const JTOOLS::JHashMap< JKey_t, JValue_t, JEvaluator_t > &input)
Get minimal abscissa of mapped function objects.
const JModuleAddressMap & get(const int id) const
Get module address map.
const JGeometry & getGeometry() const
Get detector geometry.
JACOUSTICS::JGeometry JGeometry
void load(JObjectIterator_t &input)
Load calibration data.
const_reverse_iterator rbegin() const
begin of reverse of calibration data
data_type::const_iterator const_iterator
double UNIXTimeStop
stop time
void load(JObjectIterator< JACOUSTICS::JEvt > &input)
Load calibration data.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
const_iterator end() const
end of calibration data
virtual const pointer_type & next()=0
Get next element.
double getXmin() const
Get minimal abscissa.
JPosition(const JDetector &detector, const double Tmax_s)
Constructor.
int getID() const
Get identifier.
void setTmax(const double Tmax_s)
Set applicability period.
virtual bool hasNext()=0
Check availability of next element.
General purpose class for a collection of sorted elements.
const JPosition3D & getPosition() const
Get position.
void update(JDetector &detector, const double t1_s)
Calibrate given detector at given time.
void load(JObjectIterator< JCOMPASS::JOrientation > &input)
Load calibration data.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
double getXmax() const
Get maximal abscissa.
JTOOLS::JElement2D< double, JGEOMETRY3D::JQuaternion3D > element_type
data_type::const_iterator const_iterator
const_iterator end() const
end of calibration data
data_type::const_reverse_iterator const_reverse_iterator
Data structure for unit quaternion in three dimensions.
double getTmax() const
Get applicability period.
Dynamic detector calibration.
double UNIXTimeStart
start time
double getTmax() const
Get applicability period.
JPosition3D getPiezoPosition()
Get relative position of piezo in optical module.
JTOOLS::JHashMap< int, function_type > data_type
const_iterator begin() const
begin of calibration data
JOrientation(const JDetector &detector, const double Tmax_s)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const JPosition &calibration)
Write calibration to output stream.
const JDetector & operator()(const double t1_s)
Get detector calibrated at given time.
Data structure for position in three dimensions.
Exception for accessing a value in a collection that is outside of its range.
Compass event data types.
Model for fit to acoutsics data.
double getXmax() const
Get maximal abscissa.
number of degrees for interpolation
JVector3D & add(const JVector3D &vector)
Add vector.
const JModule & getModule(const JDetector &detector, const JModuleLocation &location)
find module with a given string and floor number
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
JQuaternion3D & conjugate()
Conjugate quaternion.