1#ifndef __JTRIGGER__JTIMESLICEROUTER__
2#define __JTRIGGER__JTIMESLICEROUTER__
152 this->
set(×lice);
166 int number_of_elements = 2;
169 if (i->size() > number_of_elements) {
170 number_of_elements = i->size();
184 const JGrid<double> bounds(number_of_elements, Tmin_ns, Tmax_ns);
189 for (
int i = 0; i != bounds.
getSize(); ++i) {
202 for (
const_iterator frame = this->
get()->begin(); frame != this->
get()->end(); ++frame, ++grid) {
204 grid->configure(bounds);
206 if (!frame->empty()) {
208 buffer.resize(frame->size() + 2);
210 copy(frame->begin(), frame->end(), buffer.begin() + 1);
216 frame_type ::const_iterator hit = buffer.begin(); ++hit;
217 buffer_type::const_iterator t1 = limits.begin();
221 while (hit->getT() < *t1) { ++hit; }
223 i->getY().lpos =
distance(buffer.cbegin(), hit) - 1;
228 frame_type ::const_reverse_iterator hit = buffer.rbegin(); ++hit;
229 buffer_type::const_reverse_iterator t1 = limits.rbegin();
233 while (hit->getT() >= *t1) { ++hit; }
235 i->getY().rpos =
distance(buffer.cbegin(), hit.base()) - 1;
299 if (first < 0) { first = 0; }
300 if (second >= grid.
getSize()) { second = grid.size() - 1; }
302 return frame.
subset(grid.
getY(first).lpos, grid.
getY(second).rpos);
KM3NeT DAQ constants, bit handling, etc.
The elements in a collection are sorted according to their abscissa values and a given distance opera...
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
General purpose class for hash map of unique elements.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
Template implementation of class that holds pointer to object(s).
virtual void set(JClass_t *p) override
Set pointer.
virtual JClass_t * get() const override
Get pointer.
JDAQFrameSubset subset(const int i1, const int i2) const
Get subset of data.
unsigned int JTDC_t
leading edge [ns]
int getModuleID() const
Get module identifier.
Data frame of one optical module.
void copy(const Head &from, JHead &to)
Copy header from from to to.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
std::vector< JHitW0 > buffer_type
hits
Auxiliary classes and methods for triggering.
KM3NeT DAQ data structures and auxiliaries.
double getFrameTime()
Get frame time duration.
double getTimeSinceRTS(const int frame_index)
Get time in ns since last RTS for a given frame index.
Auxiliary class for TDC constraints.
Auxiliary structure for indexing hits in a data frame.
Auxiliary base class for JTimesliceRouter.
JTimesliceRouter_t(const int numberOfBins)
Constructor.
const JDAQHit DAQHIT_MIN
begin hit marker
const JDAQHit::JTDC_t TMIN_NS
minimal TDC value
const JDAQHit::JTDC_t TMAX_NS
maximal TDC value
const JDAQHit DAQHIT_MAX
end hit marker
Router for fast addressing of hits in KM3NETDAQ::JDAQTimeslice data structure as a function of the op...
std::vector< grid_type > table
JTimesliceRouter(const int numberOfBins)
Constructor.
JDAQFrameSubset getFrameSubset(const JDAQModuleIdentifier &module, const JTimeRange &timeRange) const
Get subset of frame given module identifier and range of hit times.
void configure(const JDAQTimeslice ×lice)
Configure.
JTOOLS::JHashMap< int, int > router_type
JTOOLS::JGridCollection< element_type > grid_type
JTOOLS::JElement2D< double, pair_type > element_type
const JDAQSuperFrame & getSuperFrame(const JDAQModuleIdentifier &module) const
Get super frame.
JTimesliceRouter(const JDAQTimeslice ×lice, const int numberOfBins)
Constructor.
bool hasSuperFrame(const JDAQModuleIdentifier &module) const
Check presence of module.
JDAQTimeslice::const_iterator const_iterator
const int getAddress(const JDAQModuleIdentifier &module) const
Get address of module.