Public Types | Public Member Functions | Private Attributes | List of all members
FclIndexRangeTool Class Reference

#include <FclIndexRangeTool.h>

Inheritance diagram for FclIndexRangeTool:
IndexRangeTool

Public Types

using Index = IndexRange::Index
 
using IndexRangeMap = std::map< Name, IndexRange >
 
- Public Types inherited from IndexRangeTool
using Name = IndexRange::Name
 

Public Member Functions

 FclIndexRangeTool (fhicl::ParameterSet const &ps)
 
 ~FclIndexRangeTool () override=default
 
IndexRange get (Name nam) const override
 
- Public Member Functions inherited from IndexRangeTool
virtual ~IndexRangeTool ()=default
 

Private Attributes

Index m_LogLevel
 
IndexRangeMap m_Ranges
 

Detailed Description

Definition at line 24 of file FclIndexRangeTool.h.

Member Typedef Documentation

Definition at line 28 of file FclIndexRangeTool.h.

Definition at line 29 of file FclIndexRangeTool.h.

Constructor & Destructor Documentation

FclIndexRangeTool::FclIndexRangeTool ( fhicl::ParameterSet const &  ps)

Definition at line 17 of file FclIndexRangeTool_tool.cc.

18 : m_LogLevel(ps.get<Index>("LogLevel")) {
19  const Name myname = "FclIndexRangeTool::ctor: ";
20  Index namSize = 0;
21  Index labSize = 0;
22  for ( string rnam : ps.get_pset_names() ) {
23  if ( rnam == "LogLevel" ) continue;
24  cout << myname << " " << rnam << endl;
26  if ( m_Ranges.find(rnam) != m_Ranges.end() ) {
27  cout << myname << "Overwriting duplicate range: " << rnam << endl;
28  }
29  IndexRange& ran = m_Ranges[rnam];
30  ran.name = rnam;
31  ran.labels = psr.get<NameVector>("labels");
32  ran.begin = psr.get<Index>("begin");
33  ran.end = psr.get<Index>("end");
34  if ( ran.name.size() > namSize ) namSize = ran.name.size();
35  if ( ran.label().size() > labSize ) labSize = ran.label().size();
36  }
37  if ( m_LogLevel >= 1 ) {
38  cout << myname << " LogLevel: " << m_LogLevel << endl;
39  cout << myname << " Range count: " << m_Ranges.size() << endl;
40  if ( m_LogLevel >= 2 ) {
41  for ( IndexRangeMap::value_type iran : m_Ranges ) {
42  const IndexRange& ran = iran.second;
43  cout << myname << setw(namSize+2) << ran.name
44  << setw(6) << ran.begin
45  << setw(6) << ran.end
46  << setw(labSize+1) << ran.label() << endl;
47  }
48  }
49  }
50 }
NameVector labels
Definition: IndexRange.h:33
Index begin
Definition: IndexRange.h:34
ChannelGroupService::Name Name
unsigned int Index
Index end
Definition: IndexRange.h:35
Name name
Definition: IndexRange.h:32
T get(std::string const &key) const
Definition: ParameterSet.h:271
static constexpr double ps
Definition: Units.h:99
Name label(Index ilab=0) const
Definition: IndexRange.h:106
IndexRangeMap m_Ranges
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
std::vector< string > NameVector
QTextStream & endl(QTextStream &s)
FclIndexRangeTool::~FclIndexRangeTool ( )
overridedefault

Member Function Documentation

IndexRange FclIndexRangeTool::get ( Name  nam) const
overridevirtual

Implements IndexRangeTool.

Definition at line 54 of file FclIndexRangeTool_tool.cc.

54  {
55  const Name myname = "FclIndexRangeTool::runData: ";
56  IndexRangeMap::const_iterator iran = m_Ranges.find(nam);
57  if ( iran == m_Ranges.end() ) return IndexRange();
58  return iran->second;
59 }
ChannelGroupService::Name Name
intermediate_table::const_iterator const_iterator
IndexRangeMap m_Ranges

Member Data Documentation

Index FclIndexRangeTool::m_LogLevel
private

Definition at line 43 of file FclIndexRangeTool.h.

IndexRangeMap FclIndexRangeTool::m_Ranges
private

Definition at line 44 of file FclIndexRangeTool.h.


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