1 #ifndef __JCALIBRATE_JTDC_t__
2 #define __JCALIBRATE_JTDC_t__
21 namespace JCALIBRATE {}
22 namespace JPP {
using namespace JCALIBRATE; }
27 namespace JCALIBRATE {
67 multimap_type::insert(value_type(value.first, pmt));
72 multimap_type::insert(value);
86 void insert(
const int id,
const int tdc)
88 this->
insert(value_type(
id, tdc));
105 if (range.first == range.second) {
106 range = multimap_type::equal_range(
WILD_CARD);
120 bool has(
const int id,
const int tdc)
124 for (JTDC_t::const_iterator i = range.first; i != range.second; ++i) {
125 if (tdc == i->second) {
141 for (JTDC_t::const_iterator p = this->begin(); p != this->end(); ) {
143 JTDC_t::const_iterator q = p;
145 for ( ; q != this->end() && q->first == p->first; ++q) {}
149 JTDC_t::const_iterator i = p;
151 for ( ; i != q && i->second != pmt; ++i) {}
154 buffer.
insert(value_type(p->first, pmt));
173 for (const_iterator i = this->begin(); i != this->end(); ++i) {
210 JStringStream
is(in);
218 for (
int id, pmt; is >>
id >> pmt; ) {
219 tdc.
insert(JTDC_t::value_type(
id, pmt));
239 for (JTDC_t::const_iterator i = tdc.begin(); i != tdc.end(); ++i) {
240 out << setw(10) << i->first <<
' ' << setw(2) << i->second << endl;
std::multimap< int, int > multimap_type
friend std::istream & operator>>(std::istream &in, JTDC_t &tdc)
Read TDC constraints from input.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Auxiliary class for TDC constraints.
bool has(const int id, const int tdc)
Check if TDC is constraint.
friend std::ostream & operator<<(std::ostream &out, const JTDC_t &tdc)
Write TDC constraints to output.
static JStat getFileStatus
Function object for file status.
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
void insert(const value_type &value)
Insert constraint.
std::pair< const_iterator, const_iterator > range_type
Type definition for range of TDC constraints of a given module identfier.
void reverse()
Reverse constraints.
Exception for accessing a value in a collection that is outside of its range.
KM3NeT DAQ constants, bit handling, etc.
static const int NUMBER_OF_PMTS
Total number of PMTs in module.
bool is_valid(const bool option=false) const
Check validity of TDC constrants.
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
range_type equal_range(const int id)
Get range of constraints for given module.
void insert(const int id, const int tdc)
Insert constraint.