All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WindowChannelMap.cxx
Go to the documentation of this file.
1 /**
2  * @file icaruscode/PMT/Trigger/Algorithms/WindowChannelMap.cxx
3  * @brief Applies sliding window trigger patterns.
4  * @author Gianluca Petrillo (petrillo@slac.stanford.edu)
5  * @date January 29, 2021
6  * @see icaruscode/PMT/Trigger/Algorithms/WindowChannelMap.h
7  *
8  * Linkage to the implementation file is required when using `dump()` methods.
9  */
10 
11 // library header
13 
14 // ICARUS libraries
16 
17 // C/C++ standard libraries
18 #include <ostream>
19 
20 
21 //------------------------------------------------------------------------------
23  (std::ostream& out, std::string const& indent /* = "" */) const
24 {
25  out << indent << "window #" << index << " at " << center << " cm";
26  if (hasCryostat()) out << " in " << cryoid;
27  else out << " (cryostat undefined)";
28  out << " includes " << channels.size() << " channels";
29  if (!channels.empty())
30  out << " (" << icarus::makeIntegerRanges(channels) << ")";
31  if (hasOppositeWindow()) out << " opposite to [#" << opposite << "]";
32  if (hasUpstreamWindow()) out << " downstream of [#" << upstream << "]";
33  if (hasDownstreamWindow()) out << " upstream of [#" << downstream << "]";
34 } // icarus::trigger::WindowChannelMap::WindowInfo_t::dump()
35 
36 
37 //------------------------------------------------------------------------------
39  (std::ostream& out, std::string const& indent, std::string const& firstIndent)
40  const
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()
49 
50 
51 //------------------------------------------------------------------------------
52 std::ostream& icarus::trigger::operator<<
53  (std::ostream& out, icarus::trigger::WindowChannelMap const& wi)
54  { wi.dump(out); return out; }
55 
56 
57 //------------------------------------------------------------------------------
Class compacting a list of integers.
Information about composition and topology of trigger sliding windows.
IntegerRanges< typename Coll::value_type, CheckGrowing > makeIntegerRanges(Coll const &coll)
Data structure enclosing information for trigger sliding windows.
void dump(std::ostream &out, std::string const &indent, std::string const &firstIndent) const
Prints the content of the full mapping.
void dump(std::ostream &out, std::string const &indent="") const
Prints the information content (single line).