1 #ifndef __JDB__JDETECTORINTEGRATION_T__
2 #define __JDB__JDETECTORINTEGRATION_T__
20 #include "dbclient/KM3NeTDBClient.h"
26 namespace JDATABASE {}
27 namespace JPP {
using namespace JDATABASE; }
50 return out <<
"(" <<
object.getLowerLimit() <<
"," <<
object.getUpperLimit() <<
")";
130 out <<
object.operation <<
' '
131 <<
object.container.getUPI() <<
' '
132 <<
object.content .getUPI() <<
' '
133 <<
object.position <<
' '
134 <<
object.start_date <<
' '
168 typedef std::pair<map_type::const_iterator,
198 for (
size_t index = 0; index != this->size(); ++index) {
208 for (
iterator product = this->begin(); product != this->end(); ++product) {
209 if (product->operation == detid) {
217 for (
size_t index = 0; index != this->size(); ++index) {
241 if (upi.
getPBS() >= pbs) {
245 switch (
distance(range.first, range.second)) {
285 for (map_type::const_iterator i =
range.first; i !=
range.second; ++i) {
287 out << upi <<
" -> ";
289 print(out, (*
this)[i->second]);
292 range = down.equal_range(upi);
295 out <<
"<- " << (*this)[i->second] << endl;
316 for (map_type::const_iterator i =
range.first; i !=
range.second; ++i) {
317 print(out, (*
this)[i->second]);
341 detector.
up .insert(make_pair(product.
content .
getUPI(), detector.size()));
344 detector.push_back(product);
367 in.ignore(numeric_limits<streamsize>::max(),
'\n');
369 for (
string buffer;
getline(in, buffer); ) {
371 istringstream
is(buffer);
373 const locale
loc(is.getloc(),
new JWhiteSpacesFacet(is.getloc(),
";"));
380 is >> buffer; istringstream(
trim(buffer)) >> parameters.
CITY;
381 is >> buffer; istringstream(
trim(buffer)) >> parameters.
LOCATIONID;
382 is >> buffer; istringstream(
trim(buffer)) >> parameters.
LOGIN;
383 is >> buffer; istringstream(
trim(buffer)) >> parameters.
USERID;
384 is >> buffer; istringstream(
trim(buffer)) >> parameters.
STARTD;
385 is >> buffer; istringstream(
trim(buffer)) >> parameters.
ENDD;
387 is >> buffer; istringstream(
trim(buffer)) >> parameters.
POSITION;
392 detector.
up .insert(make_pair(product.
content .
getUPI(), detector.size()));
395 detector.push_back(product);
411 for (const_iterator i =
object.begin(); i !=
object.end(); ++i) {
412 out << *i << std::endl;
429 return up.equal_range(upi);
446 while (q != up.end() && (*this)[q->second].content.getPBS() <= pbs) {
464 return down.equal_range(upi);
491 if (zmap.count(
object.position) == 0 ||
object.start_date > (*this)[zmap[
object.position]].start_date) {
492 zmap[
object.position] = i->second;
void unset()
Unset product status.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JProductIntegration_t(const JProductIntegration &input)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const JDetectorIntegration_t &object)
Write detector integration to output stream.
map_type up
up link UPI to integration data
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
void configure(JProductIntegration_t &product, const JPeriod_t &period)
Configure detector integration for given detector identifier.
void print(std::ostream &out, const JUPI_t &upi) const
Print product trace.
*fatal Wrong number of arguments esac JCookie sh typeset Z DETECTOR typeset Z SOURCE_RUN typeset Z TARGET_RUN set_variable PARAMETERS_FILE $WORKDIR parameters
Universal product identifier (UPI).
void set()
Set product status.
range_type find(const JPBS_t &pbs) const
Find range of products with given PBS.
JProductIntegration_t()
Default constructor.
const JPBS_t & getPBS() const
Get PBS.
const JUPI_t & getUPI() const
Get UPI.
std::string trim(const std::string &buffer)
Trim string.
std::pair< map_type::const_iterator, map_type::const_iterator > range_type
map_type::const_iterator range_const_iterator
static const char *const getName()
Table name.
const JProductIntegration_t & trace(const JUPI_t &upi, const JPBS_t &pbs=PBS::DETECTOR) const
Trace product up to given integration level.
JTOOLS::JRange< JDate_t > JPeriod_t
Type definition of period.
friend bool operator>>(ResultSet &rs, JDetectorIntegration_t &detector)
Read detector integration from result set.
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
range_type find(const JUPI_t &upi) const
Find range of products with given UPI.
std::multimap< JUPI_t, int > map_type
JDetectorIntegration_t()
Default constructor.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
friend std::istream & operator>>(std::istream &in, JDetectorIntegration_t &detector)
Read detector integration from input stream.
map_type down
down link UPI to integration data
Auxiliary class to define a range between two values.
map_type::const_iterator range_iterator
bool is_set() const
Check product status.
Product breakdown structure (PBS).
do set_variable DETECTOR_TXT $WORKDIR detector
static const char *const getName()
Table name.
JDateAndTime_t start_date
friend std::ostream & operator<<(std::ostream &out, const JProductIntegration_t &object)
Write product integration to output stream.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
void configure(const std::string &detid)
Configure detector integration for given detector identifier.
void print(std::ostream &out, const JProductIntegration_t &product) const
Print product trace.
Auxiliary class for product integration data.