All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
icarus::trigger::WindowChannelMap Class Reference

Information about composition and topology of trigger sliding windows. More...

#include <WindowChannelMap.h>

Classes

struct  WindowComposition_t
 Geometric location and composition of the window. More...
 
struct  WindowInfo_t
 Information of a single window. More...
 
struct  WindowTopology_t
 Information of the identity and neighbourhood of a window. More...
 

Public Types

using WindowIndex_t = std::size_t
 Type of window index. More...
 

Public Member Functions

 WindowChannelMap (std::vector< WindowInfo_t > &&windows)
 Construction: moves the windows information into the map. More...
 
Access to window information.
std::size_t nWindows () const
 Number of sliding windows. More...
 
bool hasWindow (WindowIndex_t index) const
 Returns whether a window with the specified index is present. More...
 
WindowInfo_t const & info (WindowIndex_t index) const
 Returns the information for the window with specified index (unchecked). More...
 
void dump (std::ostream &out, std::string const &indent, std::string const &firstIndent) const
 Prints the content of the full mapping. More...
 
void dump (std::ostream &out, std::string const &indent="") const
 

Static Public Member Functions

static bool isValidWindow (WindowIndex_t index)
 Returns whether the specified index is not the invalid window index. More...
 

Static Public Attributes

static const WindowIndex_t InvalidWindowIndex = std::numeric_limits<WindowIndex_t>::max()
 Special index denoting an invalid window. More...
 

Private Attributes

std::vector< WindowInfo_tfWindows
 

Iterable standard interface

using value_type = WindowInfo_t
 
using reference_type = WindowInfo_t const &
 
using pointer_type = WindowInfo_t const *
 
std::size_t size () const
 
bool empty () const
 
auto begin () const
 
auto end () const
 
auto cbegin () const
 
auto cend () const
 

Detailed Description

Information about composition and topology of trigger sliding windows.

This class collects optical detector windows defined as a collection of channels, supposedly contiguous in space. A rudimentary topology is described with each window having upstream, downstream windows (with respect to the nominal beam direction) and a single opposite window.

The class exposes a minimal collection interface and is therefore iterable. Windows are identified by an index that matches their position in the collection.

This is just a data structure, and algorithms building the composition and topology of the windows are not part of it.

Definition at line 52 of file WindowChannelMap.h.

Member Typedef Documentation

Definition at line 150 of file WindowChannelMap.h.

Definition at line 149 of file WindowChannelMap.h.

Definition at line 148 of file WindowChannelMap.h.

Type of window index.

Definition at line 56 of file WindowChannelMap.h.

Constructor & Destructor Documentation

icarus::trigger::WindowChannelMap::WindowChannelMap ( std::vector< WindowInfo_t > &&  windows)
inlineexplicit

Construction: moves the windows information into the map.

Definition at line 116 of file WindowChannelMap.h.

117  : fWindows(std::move(windows)) {}
std::vector< WindowInfo_t > fWindows

Member Function Documentation

auto icarus::trigger::WindowChannelMap::begin ( ) const
inline

Definition at line 154 of file WindowChannelMap.h.

154 { return fWindows.begin(); }
std::vector< WindowInfo_t > fWindows
auto icarus::trigger::WindowChannelMap::cbegin ( ) const
inline

Definition at line 156 of file WindowChannelMap.h.

156 { return begin(); }
auto icarus::trigger::WindowChannelMap::cend ( ) const
inline

Definition at line 157 of file WindowChannelMap.h.

157 { return end(); }
void icarus::trigger::WindowChannelMap::dump ( std::ostream &  out,
std::string const &  indent,
std::string const &  firstIndent 
) const

Prints the content of the full mapping.

Definition at line 39 of file WindowChannelMap.cxx.

41 {
42  out << firstIndent << "Map has " << nWindows() << " windows:";
43  for (WindowInfo_t const& info: fWindows) {
44  out << "\n "; // additional indentation
45  info.dump(out, indent);
46  } // for
47  out << '\n';
48 } // icarus::trigger::WindowChannelMap::dump()
std::size_t nWindows() const
Number of sliding windows.
std::vector< WindowInfo_t > fWindows
void dump(std::ostream &out, std::string const &indent="") const
Prints the information content (single line).
WindowInfo_t const & info(WindowIndex_t index) const
Returns the information for the window with specified index (unchecked).
void icarus::trigger::WindowChannelMap::dump ( std::ostream &  out,
std::string const &  indent = "" 
) const
inline

Definition at line 140 of file WindowChannelMap.h.

141  { dump(out, indent, indent); }
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent) const
Prints the content of the full mapping.
bool icarus::trigger::WindowChannelMap::empty ( ) const
inline

Definition at line 153 of file WindowChannelMap.h.

153 { return fWindows.empty(); }
std::vector< WindowInfo_t > fWindows
auto icarus::trigger::WindowChannelMap::end ( ) const
inline

Definition at line 155 of file WindowChannelMap.h.

155 { return fWindows.end(); }
std::vector< WindowInfo_t > fWindows
bool icarus::trigger::WindowChannelMap::hasWindow ( WindowIndex_t  index) const
inline

Returns whether a window with the specified index is present.

Definition at line 127 of file WindowChannelMap.h.

127 { return index < nWindows(); }
std::size_t nWindows() const
Number of sliding windows.
WindowInfo_t const& icarus::trigger::WindowChannelMap::info ( WindowIndex_t  index) const
inline

Returns the information for the window with specified index (unchecked).

Definition at line 130 of file WindowChannelMap.h.

130 { return fWindows[index]; }
std::vector< WindowInfo_t > fWindows
static bool icarus::trigger::WindowChannelMap::isValidWindow ( WindowIndex_t  index)
inlinestatic

Returns whether the specified index is not the invalid window index.

Definition at line 162 of file WindowChannelMap.h.

163  { return index != InvalidWindowIndex; }
static const WindowIndex_t InvalidWindowIndex
Special index denoting an invalid window.
std::size_t icarus::trigger::WindowChannelMap::nWindows ( ) const
inline

Number of sliding windows.

Definition at line 124 of file WindowChannelMap.h.

124 { return fWindows.size(); }
std::vector< WindowInfo_t > fWindows
std::size_t icarus::trigger::WindowChannelMap::size ( ) const
inline

Definition at line 152 of file WindowChannelMap.h.

152 { return nWindows(); }
std::size_t nWindows() const
Number of sliding windows.

Member Data Documentation

std::vector<WindowInfo_t> icarus::trigger::WindowChannelMap::fWindows
private

Definition at line 167 of file WindowChannelMap.h.

const WindowIndex_t icarus::trigger::WindowChannelMap::InvalidWindowIndex = std::numeric_limits<WindowIndex_t>::max()
static

Special index denoting an invalid window.

Definition at line 60 of file WindowChannelMap.h.


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