1#ifndef __JDYNAMICS__JDYNAMICS__
2#define __JDYNAMICS__JDYNAMICS__
112 void set(
const double t0_s)
116 setRange(t0_s - Tmax_s, t0_s + Tmax_s);
152 const double Tmax_s) :
158 THROW(JValueOutOfRange,
"Detector version " << detector.getVersion() <<
" < " << JDetectorVersion::V4);
163 const JDetectorBuilder& demo = getDetectorBuilder(detector.getID());
165 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
166 if (module->getFloor() != 0) {
167 buffer[module->getID()] = getRotation(demo.getModule(module->getID()), *module);
223 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
230 if (
calibration[module->getID()].getXmin() <= t1_s &&
239 return (
double) n1 / (double) n0;
261 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
263 if (module->getFloor() != 0 && !module->has(
COMPASS_DISABLE) &&
calibration.has(module->getID()) && buffer.has(module->getID())) {
269 if (t1_s >= f1.getXmin() && t1_s <= f1.getXmax()) {
278 module->rotate(Q1 * Q0.conjugate());
282 buffer[module->getID()] = Q1;
310 NUMBER_OF_POINTS = 7,
311 NUMBER_OF_DEGREES = 2
334 const double Tmax_s) :
341 THROW(JValueOutOfRange,
"Detector version " << detector.getVersion() <<
" < " << JDetectorVersion::V4);
360 for (JACOUSTICS::JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
379 geometry.setMechanics(*input.
next());
381 THROW(
JNoValue,
"Position calibration requires mechanical model data in input file; run putMechanics[.sh] or rerun JKatoomba.");
407 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
408 if (module->getFloor() != 0) {
409 string.insert(module->getString());
426 return (
double) n1 / (double) n0;
457 if (!in_range(t1_s)) {
461 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
463 if (module->getFloor() != 0) {
465 if (!buffer.
has(module->getString())) {
472 if (t1_s >= f1.getXmin() && t1_s <= f1.getXmax()) {
473 buffer[module->getString()] = f1(t1_s);
479 if (buffer.
has(module->getString())) {
480 module->set(geometry[module->getString()].getPosition(buffer[module->getString()], module->getFloor()) - getPiezoPosition());
512 const double Tmax_s) :
528 return static_cast<const JDetector&
>(*this);
537 template<
class JObjectIterator_t>
538 void load(JObjectIterator_t& input)
545 if (!position.empty()) {
559 bool is_updated =
false;
561 if (!in_range(t1_s)) {
569 setUTCTimeRange(range);
597 return {
orientation.getCoverage(*
this, t1_s), position.getCoverage(*
this, t1_s) };
620 return getCoverage(0.5 * (getLowerLimit() + getUpperLimit()));
Model for fit to acoutsics data.
ROOT TTree parameter settings.
General purpose class for a collection of sorted elements.
Compass event data types.
ROOT TTree parameter settings.
Coverage of dynamical detector calibration.
Data structure for detector geometry and calibration.
The elements in a collection are sorted according to their abscissa values and a given distance opera...
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose class for hash map of unique elements.
Mechanical modelling of string.
Auxiliary class to define a range between two values.
Data structure for position in three dimensions.
Data structure for unit quaternion in three dimensions.
Exception for missing value.
Interface of object iteration for a single data type.
virtual bool hasNext()=0
Check availability of next element.
virtual const pointer_type & next()=0
Get next element.
Exception for accessing a value in a collection that is outside of its range.
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
uint32_t getUTCseconds() const
Get major time.
static const int COMPASS_DISABLE
Enable (disable) use of compass if this status bit is 0 (1);.
Auxiliary classes and methods for acoustic position calibration.
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
JQuaternion3D getQuaternion(const JQuaternion &Q)
Get quaternion.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
bool hasDetectorBuilder(const int id)
Check if detector builder is available.
Main namespace for dynamic position and orientation calibration.
JTYPELIST< JCOMPASS::JOrientation, JACOUSTICS::JEvt, JACOUSTICS::JDetectorMechanics_t >::typelist calibration_types
Type definition for calibration data.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
Auxiliary data structure for mechanical model parameters of strings in a given detector.
double UNIXTimeStop
stop time
double UNIXTimeStart
start time
@ V4
Version with quaternion and time offset per module.
Dynamic orientation calibration.
JTOOLS::JHashMap< int, JGEOMETRY3D::JQuaternion3D > buffer_type
bool update(JDetector &detector, const double t1_s)
Calibrate given detector at given UTC time.
const_reverse_iterator rend() const
begin of reverse of calibration data
data_type::const_reverse_iterator const_reverse_iterator
@ NUMBER_OF_DEGREES
number of degrees for interpolation
@ NUMBER_OF_POINTS
number of points for interpolation
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
const_reverse_iterator rbegin() const
begin of reverse of calibration data
JTOOLS::JElement2D< double, JGEOMETRY3D::JQuaternion3D > element_type
void load(JObjectIterator< JCOMPASS::JOrientation > &input)
Load calibration data.
const_iterator begin() const
begin of calibration data
data_type::const_iterator const_iterator
function_type::collection_type::container_type container_type
JTOOLS::JHashMap< int, function_type > data_type
double getCoverage(const JDetector &detector, const double t1_s) const
Get coverage.
JOrientation(const JDetector &detector, const double Tmax_s)
Constructor.
const_iterator end() const
end of calibration data
Dynamic position calibration.
void load(JObjectIterator< JACOUSTICS::JDetectorMechanics_t > &input)
Load mechanical model data.
data_type::const_reverse_iterator const_reverse_iterator
JTOOLS::JHashMap< int, function_type > data_type
JTOOLS::JElement2D< double, JACOUSTICS::JMODEL::JString > element_type
const_reverse_iterator rend() const
begin of reverse of calibration data
JPosition(const JDetector &detector, const double Tmax_s)
Constructor.
JACOUSTICS::JGeometry JGeometry
const_iterator end() const
end of calibration data
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
void load(JObjectIterator< JACOUSTICS::JEvt > &input)
Load calibration data.
double getCoverage(const JDetector &detector, const double t1_s) const
Get coverage.
bool update(JDetector &detector, const double t1_s)
Calibrate given detector at given UTC time.
const JGeometry & getGeometry() const
Get detector geometry.
const_reverse_iterator rbegin() const
begin of reverse of calibration data
const_iterator begin() const
begin of calibration data
data_type::const_iterator const_iterator
Auxiliary data structure to track applicability period of calibration data.
JUTCTracker(const double Tmax_s)
Constructor.
void set(const double t0_s)
Set.
Dynamic detector calibration.
JPosition position
position calibration
JDYNAMICS::coverage_type coverage_type
JDynamics(const JDetector &detector, const double Tmax_s)
Constructor.
JOrientation orientation
orientation calibration
bool update(const double t1_s)
Get detector calibrated at given time.
coverage_type getCoverage(const JDAQChronometer &chronometer) const
Get coverage at given time.
coverage_type getCoverage(const double t1_s) const
Get coverage at given time.
coverage_type getCoverage() const
Get actual coverage.
bool update(const JDAQChronometer &chronometer)
Get detector calibrated at given time.
const JDetector & getDetector() const
Get actual detector.
void load(JObjectIterator_t &input)
Load calibration data.
Data structure for coverage of detector by dynamical calibrations.
Auxiliary class for recursive type list generation.