1#ifndef __JDYNAMICS__JDYNAMICS__
2#define __JDYNAMICS__JDYNAMICS__
115 void set(
const double t0_s)
119 setRange(t0_s - Tmax_s, t0_s + Tmax_s);
155 const double Tmax_s) :
161 THROW(JValueOutOfRange,
"Detector version " << detector.getVersion() <<
" < " << JDetectorVersion::V4);
166 const JDetectorBuilder& demo = getDetectorBuilder(detector.getID());
168 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
169 if (module->getFloor() != 0) {
170 buffer[module->getID()] = getRotation(demo.getModule(module->getID()), *module);
226 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
233 if (
calibration[module->getID()].getXmin() <= t1_s &&
242 return (
double) n1 / (double) n0;
264 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
266 if (module->getFloor() != 0 && !module->has(
COMPASS_DISABLE) &&
calibration.has(module->getID()) && buffer.has(module->getID())) {
272 if (t1_s >= f1.getXmin() && t1_s <= f1.getXmax()) {
281 module->rotate(Q1 * Q0.conjugate());
285 buffer[module->getID()] = Q1;
313 NUMBER_OF_POINTS = 7,
314 NUMBER_OF_DEGREES = 2
337 const double Tmax_s) :
344 THROW(JValueOutOfRange,
"Detector version " << detector.getVersion() <<
" < " << JDetectorVersion::V4);
363 for (JACOUSTICS::JEvt::const_iterator i = evt->begin(); i != evt->end(); ++i) {
396 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
397 if (module->getFloor() != 0) {
398 string.insert(module->getString());
415 return (
double) n1 / (double) n0;
446 if (!in_range(t1_s)) {
450 for (JDetector::iterator module =
detector.begin(); module !=
detector.end(); ++module) {
452 if (module->getFloor() != 0) {
454 if (!buffer.
has(module->getString())) {
461 if (t1_s >= f1.getXmin() && t1_s <= f1.getXmax()) {
462 buffer[module->getString()] = f1(t1_s);
468 if (buffer.
has(module->getString())) {
469 module->set(geometry[module->getString()].getPosition(buffer[module->getString()], module->getFloor()) - getPiezoPosition());
496 const double Tmax_s) :
513 return static_cast<const JDetector&
>(*this);
522 template<
class JObjectIterator_t>
523 void load(JObjectIterator_t& input)
540 bool is_updated =
false;
542 if (!in_range(t1_s)) {
550 setUTCTimeRange(range);
587 return {
orientation.getCoverage(*
this, t1_s), position.getCoverage(*
this, t1_s) };
610 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.
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.
Auxiliary class to define a range between two values.
Data structure for position in three dimensions.
Data structure for unit quaternion in three dimensions.
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);.
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
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.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
void load(const std::string &file_name)
Load mechanical model parameters from file.
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.
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.
Data structure for coverage of dynamic calibrations.
double position
coverage of detector by available position calibration [0,1]
double orientation
coverage of detector by available orientation calibration [0,1]
Dynamic detector calibration.
JPosition position
position calibration
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.
Auxiliary data structure to pre-load auxiliary data in memory.
JPreloader(const int id)
Constructor.