1#ifndef __JDB__JDETECTORINTEGRATION_T__
2#define __JDB__JDETECTORINTEGRATION_T__
23#include "dbclient/KM3NeTDBClient.h"
53 return out <<
"(" <<
object.getLowerLimit() <<
"," <<
object.getUpperLimit() <<
")";
133 in >>
object.operation
155 out <<
object.operation <<
' '
156 <<
object.container <<
' '
157 <<
object.content <<
' '
158 <<
object.position <<
' '
159 <<
object.start_date <<
' '
193 typedef std::pair<map_type::const_iterator,
219 void configure(
const std::string& detid,
const bool option =
false)
228 for (
size_t index = 0; index != this->size(); ++index) {
246 if (
product->operation == detid) {
258 for (
size_t index = 0; index != this->size(); ++index) {
282 if (
upi.getPBS() >=
pbs) {
286 switch (
distance(range.first, range.second)) {
326 for (map_type::const_iterator i = range.first; i != range.second; ++i) {
336 out <<
"<- " << (*this)[i->second] <<
endl;
357 for (map_type::const_iterator i = range.first; i != range.second; ++i) {
361 if (
distance(range.first, range.second) != 1) {
402 void load(
const char*
const file_name,
const std::string& separator =
";")
407 ifstream in(file_name);
411 for (
string buffer; getline(in, buffer); ) {
476 for (const_iterator i =
object.begin(); i !=
object.end(); ++i) {
477 out << *i << std::endl;
494 return up.equal_range(
upi);
511 while (q !=
up.end() && (*
this)[q->second].content.getPBS() <=
pbs) {
569 if (
object.position ==
product.position &&
571 object.start_date >
product.start_date) {
587 if (zmap.count(
object.position) == 0 ||
compare((*
this)[zmap[
object.position]],
object)) {
588 zmap[
object.position] = i->second;
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Auxiliary class to define a range between two values.
Auxiliary class to specify white space character(s) in currect locale.
Template definition of a multi-dimensional oscillation probability interpolation table.
static const JPBS_t DETECTOR(0)
PBS of detector
Auxiliary classes and methods for database I/O.
std::ostream & operator<<(std::ostream &out, const JAHRSCalibration &calibration)
Write AHRS calibration to output stream.
JTOOLS::JRange< JDate_t > JPeriod_t
Type definition of period.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::multimap< JUPI_t, int > map_type
map_type out
link UPI to disintegrated data
static const char *const getName()
Table name.
range_type get(const JUPI_t &upi) const
Get components of product with given UPI.
void load(const char *const file_name, const std::string &separator=";")
Load detector integration from CSV formatted input file.
const JProductIntegration_t & trace(const JUPI_t &upi, const JPBS_t &pbs=PBS::DETECTOR) const
Trace product up to given integration level.
JDetectorIntegration_t()
Default constructor.
void configure(JProductIntegration_t &product, const JPeriod_t &period)
Configure detector integration for given detector identifier.
map_type::const_iterator range_iterator
map_type down
down link UPI to integration data
void print(std::ostream &out, const JUPI_t &upi) const
Print product trace.
friend std::ostream & operator<<(std::ostream &out, const JDetectorIntegration_t &object)
Write detector integration to output stream.
void configure(const std::string &detid, const bool option=false)
Configure detector integration for given detector identifier.
std::pair< map_type::const_iterator, map_type::const_iterator > range_type
map_type::const_iterator range_const_iterator
void print(std::ostream &out, const JProductIntegration_t &product) const
Print product trace.
static bool compare(const JProductIntegration_t &first, const JProductIntegration_t &second)
Compare two product integrations.
friend std::istream & operator>>(std::istream &in, JDetectorIntegration_t &object)
Read detector integration from input stream.
range_type find(const JPBS_t &pbs) const
Find range of products with given PBS.
range_type find(const JUPI_t &upi) const
Find range of products with given UPI.
friend bool operator>>(ResultSet &rs, JDetectorIntegration_t &detector)
Read detector integration from result set.
map_type up
up link UPI to integration data
Product breakdown structure (PBS).
Auxiliary class for product integration data.
void unset()
Unset product status.
JDateAndTime_t start_date
JProductIntegration_t(const JProductIntegration &input)
Constructor.
void set()
Set product status.
friend std::ostream & operator<<(std::ostream &out, const JProductIntegration_t &object)
Write product integration to output stream.
JProductIntegration_t()
Default constructor.
friend std::istream & operator>>(std::istream &in, JProductIntegration_t &object)
Read product integration from input stream.
bool is_set() const
Check product status.
static const char *const getName()
Table name.
Universal product identifier (UPI).