ATLAS Offline Software
Public Member Functions | Private Types | Private Attributes | List of all members
IdDictAltRegions Class Reference

#include <IdDictAltRegions.h>

Inheritance diagram for IdDictAltRegions:
Collaboration diagram for IdDictAltRegions:

Public Member Functions

 IdDictAltRegions ()
 
virtual ~IdDictAltRegions ()
 
virtual std::string group_name () const override
 Group name for this region. More...
 
IdDictRegionselected_region ()
 Currently selected region. More...
 
void add_region (IdDictRegion *region)
 Add a new region, with key given by the tag. More...
 
void select_region (const std::string &name)
 Select the named region. More...
 
virtual void set_index (size_t index) override
 
virtual Range build_range () const override
 
virtual void resolve_references (const IdDictMgr &idd, IdDictDictionary &dictionary) override
 
virtual void generate_implementation (const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="") override
 
virtual void reset_implementation () override
 
virtual bool verify () const override
 
virtual void clear () override
 

Private Types

using map_type = std::map< std::string, IdDictRegion * >
 
using map_iterator = map_type::iterator
 
using value_type = map_type::value_type
 

Private Attributes

map_type m_regions
 
IdDictRegionm_selected_region {}
 

Detailed Description

Definition at line 20 of file IdDictAltRegions.h.

Member Typedef Documentation

◆ map_iterator

using IdDictAltRegions::map_iterator = map_type::iterator
private

Definition at line 71 of file IdDictAltRegions.h.

◆ map_type

using IdDictAltRegions::map_type = std::map<std::string, IdDictRegion* >
private

Definition at line 70 of file IdDictAltRegions.h.

◆ value_type

using IdDictAltRegions::value_type = map_type::value_type
private

Definition at line 72 of file IdDictAltRegions.h.

Constructor & Destructor Documentation

◆ IdDictAltRegions()

IdDictAltRegions::IdDictAltRegions ( )

Definition at line 15 of file IdDictAltRegions.cxx.

16  :
18 }

◆ ~IdDictAltRegions()

IdDictAltRegions::~IdDictAltRegions ( )
virtual

Definition at line 20 of file IdDictAltRegions.cxx.

20  {
23  for (; first != last; ++first) {
24  delete (*first).second;
25  }
26 }

Member Function Documentation

◆ add_region()

void IdDictAltRegions::add_region ( IdDictRegion region)

Add a new region, with key given by the tag.

Definition at line 115 of file IdDictAltRegions.cxx.

116 {
117  m_regions[region->tag()] = region;
118 }

◆ build_range()

Range IdDictAltRegions::build_range ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 106 of file IdDictAltRegions.cxx.

106  {
107  Range result;
108 
110  return(result);
111 }

◆ clear()

void IdDictAltRegions::clear ( )
overridevirtual

Implements IdDictDictEntry.

Definition at line 94 of file IdDictAltRegions.cxx.

94  {
95  map_iterator first = m_regions.begin();
96  map_iterator last = m_regions.end();
97 
98  for (; first != last; ++first) {
99  (*first).second->clear();
100  delete (*first).second;
101  }
102  m_regions.clear();
103 }

◆ generate_implementation()

void IdDictAltRegions::generate_implementation ( const IdDictMgr idd,
IdDictDictionary dictionary,
const std::string &  tag = "" 
)
overridevirtual

Implements IdDictDictEntry.

Definition at line 59 of file IdDictAltRegions.cxx.

61  {
62  // Find the region given by the tag
63  map_iterator region_it = m_regions.find(tag);
64 
65  if (region_it == m_regions.end()) {
66  std::cout << "IdDictAltRegions::generate_implementation could not find region for tag "
67  << tag << " Keys in map " << std::endl;
68  map_iterator first = m_regions.begin();
69  map_iterator last = m_regions.end();
70  int i = 0;
71  for (; first != last; ++first, ++i) {
72  std::cout << " i " << i << " key " << (*first).first;
73  }
74  std::cout << std::endl;
75  return;
76  }
77  m_selected_region = (*region_it).second;
78 
79 
81 }

◆ group_name()

std::string IdDictAltRegions::group_name ( ) const
overridevirtual

Group name for this region.

Implements IdDictDictEntry.

Definition at line 29 of file IdDictAltRegions.cxx.

29  {
30  std::string result;
31  if (1 <= m_regions.size()) result = (*m_regions.begin()).second->group_name();
32  return(result);
33 }

◆ reset_implementation()

void IdDictAltRegions::reset_implementation ( )
overridevirtual

Implements IdDictDictEntry.

Definition at line 84 of file IdDictAltRegions.cxx.

◆ resolve_references()

void IdDictAltRegions::resolve_references ( const IdDictMgr idd,
IdDictDictionary dictionary 
)
overridevirtual

Implements IdDictDictEntry.

Definition at line 46 of file IdDictAltRegions.cxx.

47  {
48  // We assume that it is not necessary to select only those with
49  // the correct tag -> send to all in map
50  map_iterator first = m_regions.begin();
51  map_iterator last = m_regions.end();
52 
53  for (; first != last; ++first) {
54  (*first).second->resolve_references(idd, dictionary);
55  }
56 }

◆ select_region()

void IdDictAltRegions::select_region ( const std::string &  name)

Select the named region.

Definition at line 122 of file IdDictAltRegions.cxx.

123 {
124  map_iterator region_it = m_regions.find (name);
125  if (region_it == m_regions.end()){
126  std::cout << "IdDictAltRegion::select_region could not find region \""
127  << name << "\". Keys in map " << std::endl;
128  for (const auto& p : m_regions) {
129  std::cout << " key " << p.first;
130  }
131  std::cout << std::endl;
132  } else {
133  m_selected_region = region_it->second;
134  }
135 }

◆ selected_region()

IdDictRegion * IdDictAltRegions::selected_region ( )
inline

Currently selected region.

Definition at line 81 of file IdDictAltRegions.h.

82 {
83  return m_selected_region;
84 }

◆ set_index()

void IdDictAltRegions::set_index ( size_t  index)
overridevirtual

Implements IdDictDictEntry.

Definition at line 36 of file IdDictAltRegions.cxx.

36  {
37  map_iterator first = m_regions.begin();
38  map_iterator last = m_regions.end();
39 
40  for (; first != last; ++first) {
41  (*first).second->set_index(index);
42  }
43 }

◆ verify()

bool IdDictAltRegions::verify ( ) const
overridevirtual

Implements IdDictDictEntry.

Definition at line 89 of file IdDictAltRegions.cxx.

89  {
90  return(true);
91 }

Member Data Documentation

◆ m_regions

map_type IdDictAltRegions::m_regions
private

Definition at line 74 of file IdDictAltRegions.h.

◆ m_selected_region

IdDictRegion* IdDictAltRegions::m_selected_region {}
private

Definition at line 75 of file IdDictAltRegions.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
IdDictRegion::build_range
virtual Range build_range() const override
Definition: IdDictRegion.cxx:265
IdDictRegion::reset_implementation
virtual void reset_implementation() override
Definition: IdDictRegion.cxx:200
get_generator_info.result
result
Definition: get_generator_info.py:21
index
Definition: index.py:1
IdDictAltRegions::m_selected_region
IdDictRegion * m_selected_region
Definition: IdDictAltRegions.h:75
python.SystemOfUnits.second
float second
Definition: SystemOfUnits.py:135
IdDictRegion::tag
const std::string & tag() const
Definition: IdDictRegion.h:161
IdDictAltRegions::map_iterator
map_type::iterator map_iterator
Definition: IdDictAltRegions.h:71
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictRegion::generate_implementation
virtual void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="") override
Definition: IdDictRegion.cxx:136
master.dictionary
dictionary
Definition: master.py:47
IdDictAltRegions::m_regions
map_type m_regions
Definition: IdDictAltRegions.h:74
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
DeMoScan.first
bool first
Definition: DeMoScan.py:534
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:23