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

#include <ProtoDuneChannelGroups.h>

Inheritance diagram for ProtoDuneChannelGroups:
IndexRangeGroupTool

Public Types

using Name = std::string
 
using NameVector = std::vector< Name >
 
using Index = IndexRangeGroup::Index
 
using GroupMap = std::map< Name, NameVector >
 
- Public Types inherited from IndexRangeGroupTool
using Name = IndexRangeGroup::Name
 

Public Member Functions

 ProtoDuneChannelGroups (fhicl::ParameterSet const &ps)
 
 ~ProtoDuneChannelGroups () override=default
 
IndexRangeGroup get (Name nam) const override
 
- Public Member Functions inherited from IndexRangeGroupTool
virtual ~IndexRangeGroupTool ()=default
 

Private Attributes

Index m_LogLevel
 
Name m_IndexRangeTool
 
const IndexRangeToolm_pIndexRangeTool =nullptr
 
GroupMap m_groups
 
GroupMap m_labels
 

Detailed Description

Definition at line 40 of file ProtoDuneChannelGroups.h.

Member Typedef Documentation

Definition at line 47 of file ProtoDuneChannelGroups.h.

Definition at line 46 of file ProtoDuneChannelGroups.h.

Definition at line 44 of file ProtoDuneChannelGroups.h.

Definition at line 45 of file ProtoDuneChannelGroups.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file ProtoDuneChannelGroups_tool.cc.

25 : m_LogLevel(ps.get<Index>("LogLevel")),
26  m_IndexRangeTool(ps.get<Name>("IndexRangeTool")) {
27  const Name myname = "ProtoDuneChannelGroups::ctor: ";
28  if ( m_IndexRangeTool.size() ) {
31  if ( m_pIndexRangeTool == nullptr ) {
32  cout << myname << "WARNING: Index range tool not found: " << m_IndexRangeTool << endl;
33  }
34  } else {
35  cout << myname << "WARNING: No Index range tool name." << endl;
36  }
37  Index napa = 6;
38  m_labels["tpss"].push_back("TPC sets");
39  m_labels["apas"].push_back("APAs");
40  NameVector soris = {"z", "c", "x", "u", "v", "i"};
41  for ( Name sori : soris ) {
42  m_labels["tpp" + sori + "s"].push_back(sori + " planes");
43  m_labels["apa" + sori + "s"].push_back(sori + " planes");
44  }
45  for ( Index itps=0; itps<napa; ++itps ) {
46  ostringstream sstps;
47  sstps << itps;
48  Name stps = sstps.str();
49  Index iapa = itps + 1;
50  ostringstream ssapa;
51  ssapa << iapa;
52  Name sapa = ssapa.str();
53  m_groups["tpss"].push_back("tps" + stps);
54  m_groups["apas"].push_back("apa" + sapa);
55  for ( Name sori : soris ) {
56  m_groups["tpp" + sori + "s"].push_back("tpp" + stps + sori);
57  m_groups["apa" + sori + "s"].push_back("apa" + sapa + sori);
58  }
59  }
60  Index nfmb = 20;
61  for ( Index iapa=1; iapa<=napa; ++iapa ) {
62  for ( Index ifmb=1; ifmb<=nfmb; ++ifmb ) {
63  ostringstream ssgrp;
64  ssgrp << "femb" << iapa;
65  if ( ifmb < 10 ) ssgrp << "0";
66  ssgrp << ifmb;
67  Name sgrp = ssgrp.str();
68  m_groups[sgrp].push_back(sgrp + "u");
69  m_groups[sgrp].push_back(sgrp + "v");
70  m_groups[sgrp].push_back(sgrp + "x");
71  Name slab = "FEMB " + sgrp.substr(4);
72  m_labels[sgrp].push_back(slab);
73  }
74  }
75  if ( m_LogLevel >= 1 ) {
76  cout << myname << " LogLevel: " << m_LogLevel << endl;
77  }
78 }
ChannelGroupService::Name Name
unsigned int Index
static constexpr double ps
Definition: Units.h:99
const IndexRangeTool * m_pIndexRangeTool
std::vector< string > NameVector
static DuneToolManager * instance(std::string fclname="", int dbg=1)
T * getShared(std::string name)
QTextStream & endl(QTextStream &s)
ProtoDuneChannelGroups::~ProtoDuneChannelGroups ( )
overridedefault

Member Function Documentation

IndexRangeGroup ProtoDuneChannelGroups::get ( Name  nam) const
overridevirtual

Implements IndexRangeGroupTool.

Definition at line 82 of file ProtoDuneChannelGroups_tool.cc.

82  {
83  const Name myname = "ProtoDuneChannelGroups::get: ";
84  if ( m_pIndexRangeTool == nullptr ) {
85  if ( m_LogLevel >= 2 ) cout << myname << "No IndexRangeTool." << endl;
86  return IndexRangeGroup();
87  }
88  GroupMap::const_iterator igrp = m_groups.find(nam);
89  if ( igrp == m_groups.end() ) {
90  if ( m_LogLevel >= 2 ) cout << myname << "Invalid group name: " << nam << endl;
91  return IndexRangeGroup();
92  }
94  for ( Name rnam : igrp->second ) {
95  rans.push_back(m_pIndexRangeTool->get(rnam));
96  }
97  NameVector labs;
98  GroupMap::const_iterator ilabs = m_labels.find(nam);
99  if ( ilabs == m_labels.end() ) return IndexRangeGroup(nam, rans);
100  return IndexRangeGroup(nam, ilabs->second, rans);
101 }
std::vector< IndexRange > RangeVector
ChannelGroupService::Name Name
intermediate_table::const_iterator const_iterator
const IndexRangeTool * m_pIndexRangeTool
std::vector< string > NameVector
QTextStream & endl(QTextStream &s)
virtual IndexRange get(Name nam) const =0

Member Data Documentation

GroupMap ProtoDuneChannelGroups::m_groups
private

Definition at line 66 of file ProtoDuneChannelGroups.h.

Name ProtoDuneChannelGroups::m_IndexRangeTool
private

Definition at line 62 of file ProtoDuneChannelGroups.h.

GroupMap ProtoDuneChannelGroups::m_labels
private

Definition at line 67 of file ProtoDuneChannelGroups.h.

Index ProtoDuneChannelGroups::m_LogLevel
private

Definition at line 61 of file ProtoDuneChannelGroups.h.

const IndexRangeTool* ProtoDuneChannelGroups::m_pIndexRangeTool =nullptr
private

Definition at line 65 of file ProtoDuneChannelGroups.h.


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