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) {
 
  245      for (
iterator product = this->begin(); product != this->end(); ++product) {
 
  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) {
 
  328        out << upi << 
" -> ";
 
  333      range = 
down.equal_range(upi);
 
  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);
 
  409      in.ignore(numeric_limits<streamsize>::max(), 
'\n');
 
  411      for (
string buffer; getline(in, buffer); ) {
 
  413        istringstream is(buffer);
 
  421        is >> buffer;  istringstream(trim(buffer)) >> parameters.
OPERATIONID;
 
  422        is >> buffer;  istringstream(trim(buffer)) >> parameters.
CITY;
 
  423        is >> buffer;  istringstream(trim(buffer)) >> parameters.
LOCATIONID;
 
  424        is >> buffer;  istringstream(trim(buffer)) >> parameters.
LOGIN;
 
  425        is >> buffer;  istringstream(trim(buffer)) >> parameters.
USERID;
 
  426        is >> buffer;  istringstream(trim(buffer)) >> parameters.
STARTD;
 
  427        is >> buffer;  istringstream(trim(buffer)) >> parameters.
ENDD;
 
  428        is >> buffer;  istringstream(trim(buffer)) >> parameters.
CONTAINER_UPI;
 
  429        is >> buffer;  istringstream(trim(buffer)) >> parameters.
POSITION;
 
  430        is >> buffer;  istringstream(trim(buffer)) >> parameters.
CONTENT_UPI;
 
  437        this->push_back(product);
 
 
  457        object.up  .insert(make_pair(product.content  .getUPI(), 
object.size()));
 
  458        object.down.insert(make_pair(product.container.getUPI(), 
object.size()));
 
  460        object.push_back(product);
 
 
  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) {
 
 
  529      return down.equal_range(upi);
 
 
  569        if (
object.position   == product.
position        &&
 
  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.
 
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
 
Auxiliary class to specify white space character(s) in currect locale.
 
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).
 
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.
 
map_type::const_iterator range_iterator
 
void load(const char *const file_name, const std::string &separator=";")
Load detector integration from CSV formatted input file.
 
std::pair< map_type::const_iterator, map_type::const_iterator > range_type
 
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.
 
std::multimap< JUPI_t, int > map_type
 
void configure(JProductIntegration_t &product, const JPeriod_t &period)
Configure detector integration for given detector identifier.
 
map_type::const_iterator range_const_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.
 
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).
 
const JPBS_t & getPBS() const
Get 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).
 
const JUPI_t & getUPI() const
Get UPI.