Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
novaddt::GroupedHitList< VAL > Class Template Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-01-26/DDTBaseDataProducts/GroupedHitList.h"

Public Types

typedef VAL value_t
 

Public Member Functions

 GroupedHitList ()
 
template<class It >
 GroupedHitList (It begin, It end, std::vector< size_t > boundary_list)
 
unsigned n_groups () const
 
std::size_t group_size (unsigned group) const
 
VAL::value_type first_value () const
 
VAL::value_type last_value () const
 
VAL::value_type extent () const
 
HitList get (unsigned group) const
 
HitList const & get () const
 

Private Member Functions

std::size_t low (unsigned group) const
 
std::size_t high (unsigned group) const
 
HitList::const_iterator get_it (size_t index) const
 
void check_empty () const
 

Private Attributes

HitList hits_
 
std::vector< size_t > bound_list_
 

Detailed Description

template<class VAL>
class novaddt::GroupedHitList< VAL >

Definition at line 13 of file GroupedHitList.h.

Member Typedef Documentation

template<class VAL>
typedef VAL novaddt::GroupedHitList< VAL >::value_t

Definition at line 19 of file GroupedHitList.h.

Constructor & Destructor Documentation

template<class VAL >
novaddt::GroupedHitList< VAL >::GroupedHitList ( )
inline

Definition at line 60 of file GroupedHitList.h.

61  {
62  }
template<class VAL >
template<class It >
novaddt::GroupedHitList< VAL >::GroupedHitList ( It  begin,
It  end,
std::vector< size_t >  boundary_list 
)
inline

Definition at line 71 of file GroupedHitList.h.

72  : hits_(begin, end),
73  bound_list_(boundary_list)
74  {
75  }
std::vector< size_t > bound_list_

Member Function Documentation

template<class VAL >
void novaddt::GroupedHitList< VAL >::check_empty ( ) const
inlineprivate

Definition at line 114 of file GroupedHitList.h.

References ana::assert(), om::cerr, allTimeWatchdog::endl, and novaddt::GroupedHitList< VAL >::hits_.

Referenced by novaddt::GroupedHitList< VAL >::first_value(), and novaddt::GroupedHitList< VAL >::last_value().

115  {
116  if (hits_.empty())
117  {
118  std::cerr << "The HitList is empty, so you cannot retrieve any elements."
119  << std::endl;
120  assert(false);
121  }
122  }
OStream cerr
Definition: OStream.cxx:7
assert(nhit_max >=nhit_nbins)
template<class VAL >
VAL::value_type novaddt::GroupedHitList< VAL >::extent ( ) const
inline

Definition at line 144 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::first_value(), and novaddt::GroupedHitList< VAL >::last_value().

145  {
146  return last_value() - first_value();
147  }
VAL::value_type first_value() const
VAL::value_type last_value() const
template<class VAL >
VAL::value_type novaddt::GroupedHitList< VAL >::first_value ( ) const
inline
template<class VAL >
HitList novaddt::GroupedHitList< VAL >::get ( unsigned  group) const
inline

Definition at line 159 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::get_it(), novaddt::GroupedHitList< VAL >::high(), and novaddt::GroupedHitList< VAL >::low().

Referenced by ddt::SuperDDTEva::analyze().

160  {
161  return HitList(get_it(low(group)), get_it(high(group)));
162  }
std::vector< DAQHit > HitList
Definition: HitList.h:15
std::size_t low(unsigned group) const
HitList::const_iterator get_it(size_t index) const
std::size_t high(unsigned group) const
template<class VAL >
HitList const & novaddt::GroupedHitList< VAL >::get ( ) const
inline

Definition at line 166 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::hits_.

167  {
168  return hits_;
169  }
template<class VAL>
HitList::const_iterator novaddt::GroupedHitList< VAL >::get_it ( size_t  index) const
inlineprivate

Definition at line 152 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::hits_, and allTimeWatchdog::index.

Referenced by novaddt::GroupedHitList< VAL >::get().

153  {
154  return hits_.begin() + index;
155  }
template<class VAL >
std::size_t novaddt::GroupedHitList< VAL >::group_size ( unsigned  group) const
inline

Definition at line 107 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::high(), and novaddt::GroupedHitList< VAL >::low().

108  {
109  return high(group) - low(group);
110  }
std::size_t low(unsigned group) const
std::size_t high(unsigned group) const
template<class VAL >
std::size_t novaddt::GroupedHitList< VAL >::high ( unsigned  group) const
inlineprivate

Definition at line 99 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::bound_list_.

Referenced by novaddt::GroupedHitList< VAL >::get(), and novaddt::GroupedHitList< VAL >::group_size().

100  {
101  // the upper bound is the lower bound of the next group
102  return bound_list_.at(group + 1);
103  }
std::vector< size_t > bound_list_
template<class VAL >
VAL::value_type novaddt::GroupedHitList< VAL >::last_value ( ) const
inline
template<class VAL >
std::size_t novaddt::GroupedHitList< VAL >::low ( unsigned  group) const
inlineprivate
template<class VAL >
unsigned novaddt::GroupedHitList< VAL >::n_groups ( ) const
inline

Definition at line 79 of file GroupedHitList.h.

References novaddt::GroupedHitList< VAL >::bound_list_, and fillBadChanDBTables::result.

Referenced by ddt::SuperDDTEva::analyze().

80  {
81  unsigned result = 0;
82  if (!bound_list_.empty())
83  // Since the boundary list contains the beginning and the end,
84  // the number of groups is one less than the number of boundaries.
85  result = bound_list_.size() - 1;
86 
87  return result;
88  }
std::vector< size_t > bound_list_

Member Data Documentation

template<class VAL>
std::vector<size_t> novaddt::GroupedHitList< VAL >::bound_list_
private
template<class VAL>
HitList novaddt::GroupedHitList< VAL >::hits_
private

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