1 #ifndef __JDYNAMICS__JDYNAMICS__
2 #define __JDYNAMICS__JDYNAMICS__
115 void set(
const double t0_s)
117 const double Tmax_s = 0.5 * (getUpperLimit() - getLowerLimit());
119 setRange(t0_s - Tmax_s, t0_s + Tmax_s);
131 NUMBER_OF_POINTS = 20,
132 NUMBER_OF_DEGREES = 1
155 const double Tmax_s) :
168 for (JDetector::const_iterator module =
detector.begin(); module !=
detector.end(); ++module) {
169 if (module->getFloor() != 0) {
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;
262 if (!in_range(t1_s)) {
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()) {
285 buffer[module->getID()] = Q1;
313 NUMBER_OF_POINTS = 7,
314 NUMBER_OF_DEGREES = 2
337 const double Tmax_s) :
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.
const JPosition3D & getPosition() const
Get position.
Data structure for unit quaternion in three dimensions.
JQuaternion3D & conjugate()
Conjugate quaternion.
const JQuaternion3D & getQuaternion() const
Get quaternion.
JVector3D & add(const JVector3D &vector)
Add vector.
JVector3D & sub(const JVector3D &vector)
Subtract vector.
Interface of object iteration for a single data type.
virtual const pointer_type & next()=0
Get next element.
virtual bool hasNext()=0
Check availability of 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);.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
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 JRotation getRotation
Function object to get rotation matrix to go from first to second module.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
bool hasDetectorBuilder(const int id)
Check if detector builder is available.
JDetectorBuilder & getDetectorBuilder()
Get detector builder.
JPosition3D getPiezoPosition()
Get relative position of piezo in optical module.
Main namespace for dynamic position and orientation calibration.
void setRange(double &xmin, double &xmax, const bool logx)
Set axis range.
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
Auxiliary interface for building detector.
const JModule & getModule(const int id=-1, const JLocation &location=JLocation()) const
Get module.
@ V4
Version with quaternion and time offset per module.
Dynamic orientation calibration.
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
const_reverse_iterator rbegin() const
begin of reverse of calibration data
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
JTOOLS::JHashMap< int, function_type > data_type
data_type::const_reverse_iterator const_reverse_iterator
void load(JObjectIterator< JCOMPASS::JOrientation > &input)
Load calibration data.
const_iterator begin() const
begin of calibration data
JTOOLS::JHashMap< int, JGEOMETRY3D::JQuaternion3D > buffer_type
data_type::const_iterator const_iterator
JTOOLS::JElement2D< double, JGEOMETRY3D::JQuaternion3D > element_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
function_type::collection_type::container_type container_type
Dynamic position calibration.
data_type::const_iterator const_iterator
const JGeometry & getGeometry() const
Get detector geometry.
const_reverse_iterator rend() const
begin of reverse of calibration data
JPosition(const JDetector &detector, const double Tmax_s)
Constructor.
const_iterator end() const
end of calibration data
JACOUSTICS::JGeometry JGeometry
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
JTOOLS::JHashMap< int, function_type > data_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.
data_type::const_reverse_iterator const_reverse_iterator
const_reverse_iterator rbegin() const
begin of reverse of calibration data
JTOOLS::JElement2D< double, JACOUSTICS::JMODEL::JString > element_type
const_iterator begin() const
begin of calibration data
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.