1 #ifndef __JDYNAMICS__JDYNAMICS__
2 #define __JDYNAMICS__JDYNAMICS__
45 namespace JDYNAMICS {}
46 namespace JPP {
using namespace 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) {
194 if (buffer.has(orientation->
id)) {
206 bool empty()
const {
return calibration.empty(); }
207 size_t size()
const {
return calibration.size(); }
226 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
232 if (calibration.has(module->getID()) && !calibration.get(module->getID()).empty()) {
233 if (calibration[module->getID()].getXmin() <= t1_s &&
234 calibration[module->getID()].getXmax() >= t1_s) {
242 return (
double) n1 / (double) n0;
260 if (!calibration.empty()) {
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) {
374 bool empty()
const {
return calibration.empty(); }
375 size_t size()
const {
return calibration.size(); }
396 for (JDetector::const_iterator module = detector.begin(); module != detector.end(); ++module) {
397 if (module->getFloor() != 0) {
398 string.insert(module->getString());
406 if (calibration.has(*
i) && !calibration.get(*i).empty()) {
407 if (calibration[*
i].getXmin() <= t1_s &&
408 calibration[*
i].getXmax() >= t1_s) {
415 return (
double) n1 / (double) n0;
444 if (!calibration.empty()) {
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())) {
456 if (calibration.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) :
500 position (detector, 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)) {
546 if (
orientation.update(static_cast<JDetector&>(*
this), t1_s)) { range.
join(
orientation.getUTCTimeRange()); is_updated =
true; }
547 if (position .update(static_cast<JDetector&>(*
this), t1_s)) { range.
join(position .
getUTCTimeRange()); is_updated =
true; }
550 setUTCTimeRange(range);
587 return {
orientation.getCoverage(*
this, t1_s), position.getCoverage(*
this, t1_s) };
610 return getCoverage(0.5 * (getLowerLimit() + getUpperLimit()));
JTOOLS::JElement2D< double, JACOUSTICS::JMODEL::JString > element_type
void set(const double t0_s)
Set.
JDAQUTCTimeRange getUTCTimeRange()
Get UTC time range.
JDAQUTCExtended getTimesliceStart() const
Get start of timeslice.
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...
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.
Dynamic orientation calibration.
Dynamic position calibration.
double position
coverage of detector by available position calibration [0,1]
const JDetector & getDetector() const
Get actual detector.
static JDetectorMechanics getMechanics
Function object to get string mechanics.
JDynamics(const JDetector &detector, const double Tmax_s)
Constructor.
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.
ROOT TTree parameter settings.
JPosition position
position calibration
#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
JOrientation orientation
orientation calibration
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.
const std::string & getVersion() const
Get version.
Interface of object iteration for a single data type.
data_type::const_reverse_iterator const_reverse_iterator
Data structure for detector geometry and calibration.
JTOOLS::JHashMap< int, JGEOMETRY3D::JQuaternion3D > buffer_type
const JModuleAddressMap & get(const int id) const
Get module address map.
JMODEL::JString getString(const JFit &fit)
Get model parameters of string.
ROOT TTree parameter settings.
const JGeometry & getGeometry() const
Get detector geometry.
const JQuaternion3D & getQuaternion() const
Get quaternion.
JACOUSTICS::JGeometry JGeometry
static const int COMPASS_DISABLE
Enable (disable) use of compass if this status bit is 0 (1);.
double orientation
coverage of detector by available orientation calibration [0,1]
Auxiliary data structure to pre-load auxiliary data in memory.
void load(JObjectIterator_t &input)
Load calibration data.
const_reverse_iterator rbegin() const
begin of reverse of calibration data
JUTCTracker(const double Tmax_s)
Constructor.
const JPolynome f1(1.0, 2.0, 3.0)
Function.
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.
Version with quaternion and time offset per module.
JPosition(const JDetector &detector, const double Tmax_s)
Constructor.
int getID() const
Get identifier.
coverage_type getCoverage() const
Get actual coverage.
virtual bool hasNext()=0
Check availability of next element.
General purpose class for a collection of sorted elements.
void load(const std::string &file_name)
Load mechanical model parameters from file.
const JPosition3D & getPosition() const
Get position.
double getCoverage(const JDetector &detector, const double t1_s) const
Get coverage.
void load(JObjectIterator< JCOMPASS::JOrientation > &input)
Load calibration data.
JUINT32_t getUTCseconds() const
Get major time.
JDetectorAddressMap & getDetectorAddressMap()
Get detector address map.
JPreloader(const int id)
Constructor.
JTOOLS::JElement2D< double, JGEOMETRY3D::JQuaternion3D > element_type
Data structure for coverage of dynamic calibrations.
static const JGetDetectorVersion getDetectorVersion
Function object to map detector version to numerical value.
data_type::const_iterator const_iterator
bool update(JDetector &detector, const double t1_s)
Calibrate given detector at given UTC time.
const_iterator end() const
end of calibration data
data_type::const_reverse_iterator const_reverse_iterator
bool update(const double t1_s)
Get detector calibrated at given time.
Data structure for unit quaternion in three dimensions.
bool update(const JDAQChronometer &chronometer)
Get detector calibrated at given time.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
Dynamic detector calibration.
void setRange(double &xmin, double &xmax, const bool logx)
Set axis range.
double UNIXTimeStart
start time
Auxiliary class to define a range between two values.
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.
bool update(JDetector &detector, const double t1_s)
Calibrate given detector at given UTC 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.
double getCoverage(const JDetector &detector, const double t1_s) const
Get coverage.
Model for fit to acoutsics data.
JVector3D & add(const JVector3D &vector)
Add vector.
const JModule & getModule(const JModuleAddressMap &memo, const int id=-1, const JLocation &location=JLocation())
Get module according module address map.
JTOOLS::JPolfitFunction1D< NUMBER_OF_POINTS, NUMBER_OF_DEGREES, element_type, JTOOLS::JCollection > function_type
Auxiliary data structure to track applicability period of calibration data.
JQuaternion3D & conjugate()
Conjugate quaternion.