Go to the documentation of this file. 1 #ifndef __JDB__JDETECTORINTEGRATION__
2 #define __JDB__JDETECTORINTEGRATION__
20 #include "dbclient/KM3NeTDBClient.h"
90 return this->
day < date.
day;
118 for (string::iterator i = buffer.begin(); i != buffer.end(); ++i) {
124 istringstream is(buffer);
126 is >>
object.year >>
object.month >>
object.day;
128 in.setstate(is.rdstate());
171 return out <<
"(" <<
object.getLowerLimit() <<
"," <<
object.getUpperLimit() <<
")";
206 istringstream(input.
STARTD) >> this->start_date;
207 istringstream(input.
ENDD) >> this->end_date;
248 return (this->container == product.
container &&
249 this->position == product.
position);
264 out <<
object.operation <<
' '
265 <<
object.container.getUPI() <<
' '
266 <<
object.content .getUPI() <<
' '
267 <<
object.position <<
' '
268 <<
object.start_date <<
' '
300 typedef std::pair<map_type::const_iterator,
324 bool empty()
const {
return data.empty(); }
325 size_t size()
const {
return data.size(); }
357 for (
size_t index = 0; index != data.size(); ++index) {
368 for (data_type::iterator product = data.begin(); product != data.end(); ++product) {
369 if (product->operation == detid) {
378 for (
size_t index = 0; index != data.size(); ++index) {
400 if (upi.
getPBS() >= pbs) {
402 const int index = find(upi);
435 const int index = find(upi);
439 out << upi <<
" -> ";
441 print(out, data[index]);
444 const range_type range = down.equal_range(upi);
447 out <<
"<- " << data[i->second] << endl;
467 print(out, data[index]);
489 detector.
data.push_back(product);
507 for (
const_iterator i =
object.data.begin(); i !=
object.data.end(); ++i) {
508 out << *i << std::endl;
532 return range.first->second;
535 THROW(
JDatabaseException,
"Ambiguous integration of UPI (call first method JDetectorIntegration::configure) " << upi);
553 while (q != up.end() && data[q->second].content.getPBS() <= pbs) {
586 if (data[*p].
overlap(data[i->second])) {
590 if (data[i->second].start_date > data[*p].start_date) {
597 buffer.push_back(i->second);
643 catch(std::exception& error) {
friend std::ostream & operator<<(std::ostream &out, const JDate_t &object)
Write date to output stream.
map_type::const_iterator range_iterator
bool has() const
Has status.
friend bool operator>>(ResultSet &rs, JDetectorIntegration &detector)
Read detector integration from result set.
bool less(const JDate_t &date) const
Less-than method.
const_iterator end() const
end of integration data
std::pair< map_type::const_iterator, map_type::const_iterator > range_type
JProductIntegration_t(const JProductIntegration &input)
Constructor.
void print(std::ostream &out, const JProductIntegration_t &product) const
Print product trace.
int find(const JUPI &upi) const
Find index of unique product with given UPI.
const_reverse_iterator rbegin() const
reverse begin of integration data
JProductTrace(const JDetectorIntegration &detector, const JUPI &upi, const std::vector< JPBS > &pbs)
Constructor.
bool empty() const
check emptyness of integration data
JDate_t()
Default constructor.
void unset()
Unset status.
static JDate_t max()
Maximal date.
std::string CONTAINER_UPI
JProductIntegration_t()
Default constructor.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JDetectorIntegration()
Default constructor.
const_reverse_iterator rend() const
reverse end of integration data
static const char SEPARATOR
Separation character.
friend std::ostream & operator<<(std::ostream &out, const JProductIntegration_t &object)
Write product integration to output stream.
Auxiliary classes and methods for database I/O.
void print(std::ostream &out, const JUPI &upi) const
Print product trace.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
const_iterator begin() const
begin of integration data
bool overlap(const JProductIntegration_t &product) const
Check whether there is an overlap between products.
data_type data
integration data
const JProductIntegration_t & trace(const JUPI &upi, const JPBS &pbs=PBS::DETECTOR) const
Trace product up to given integration level.
friend std::ostream & operator<<(std::ostream &out, const JDetectorIntegration &object)
Write detector integration to output stream.
data_type::const_iterator const_iterator
map_type::const_iterator range_const_iterator
void configure(JProductIntegration_t &product, const JPeriod_t &period)
Configure detector integration for given detector identifier.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
data_type::const_reverse_iterator const_reverse_iterator
const JUPI & getUPI() const
Get UPI.
std::multimap< JUPI, int > map_type
map_type up
up link UPI to integration data
JTOOLS::JRange< JDate_t > JPeriod_t
Type definition of period.
data_type::reverse_iterator reverse_iterator
Auxiliary class to trace product.
static const char *const getName()
Table name.
Product breakdown structure (PBS).
Template definition of auxiliary base class for comparison of data structures.
static const char *const getName()
Table name.
void configure(const std::string &detid)
Configure detector integration for given detector identifier.
std::vector< JProductIntegration_t > data_type
Auxiliary class for integration date.
JDate_t(const int year, const int month, const int day)
Constructor.
static JDate_t min()
Minimal date.
static const JPBS DETECTOR(0)
Fixed PBS.
range_type find(const JPBS &pbs) const
Find range of products with given PBS.
size_t size() const
size of integration data
data_type::iterator iterator
map_type down
down link UPI to integration data
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.
const JPBS & getPBS() const
Get PBS.
const JProductIntegration_t & operator[](const int index) const
Get product at given index.
friend std::istream & operator>>(std::istream &in, JDate_t &object)
Read date from input stream.
Universal product identifier (UPI).
Auxiliary class for product integration data.