Project
Loading...
Searching...
No Matches
o2::aodproducer::BunchCrossings Class Reference

#include <AODProducerWorkflowSpec.h>

Public Member Functions

 BunchCrossings ()=default
 Constructor initializes the acceleration structure.
 
void init (std::map< uint64_t, int > const &bcs)
 initialize this container (to be ready for lookup/search queries)
 
std::vector< uint64_t > const & getBCTimeVector () const
 return the sorted vector of increaing BC times
 
std::pair< size_t, uint64_t > lower_bound (uint64_t timestamp) const
 
void clear ()
 clear/reset this container
 
void print ()
 print information about this container
 

Detailed Description

A structure or container to organize bunch crossing data of a timeframe and to facilitate fast lookup and search within bunch crossings.

Definition at line 49 of file AODProducerWorkflowSpec.h.

Constructor & Destructor Documentation

◆ BunchCrossings()

o2::aodproducer::BunchCrossings::BunchCrossings ( )
default

Constructor initializes the acceleration structure.

Member Function Documentation

◆ clear()

void o2::aodproducer::BunchCrossings::clear ( )
inline

clear/reset this container

Definition at line 119 of file AODProducerWorkflowSpec.h.

◆ getBCTimeVector()

std::vector< uint64_t > const & o2::aodproducer::BunchCrossings::getBCTimeVector ( ) const
inline

return the sorted vector of increaing BC times

Definition at line 67 of file AODProducerWorkflowSpec.h.

◆ init()

void o2::aodproducer::BunchCrossings::init ( std::map< uint64_t, int > const &  bcs)
inline

initialize this container (to be ready for lookup/search queries)

Definition at line 56 of file AODProducerWorkflowSpec.h.

◆ lower_bound()

std::pair< size_t, uint64_t > o2::aodproducer::BunchCrossings::lower_bound ( uint64_t  timestamp) const
inline

Performs a "lower bound" search for timestamp within the bunch crossing data.

Returns the smallest bunch crossing (index and value) equal or greater than timestamp.

The functions is expected to perform much better than a binary search in the bunch crossing data directly. Expect O(1) instead of O(log(N)) at the cost of the additional memory used by this class.

This is not O(1). The loop below makes it at least O(N). The call to std::lower_bound is O(log(N)).

Definition at line 82 of file AODProducerWorkflowSpec.h.

◆ print()

void o2::aodproducer::BunchCrossings::print ( )
inline

print information about this container

Definition at line 127 of file AODProducerWorkflowSpec.h.


The documentation for this class was generated from the following file: