ATLAS Offline Software
IdDictAltRegions.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include "IdDict/IdDictRegion.h"
7 #include "Identifier/Range.h"
9 
10 #include <iostream>
11 
16  :
17  m_selected_region(0) {
18 }
19 
23  for (; first != last; ++first) {
24  delete (*first).second;
25  }
26 }
27 
28 std::string
30  std::string result;
31  if (1 <= m_regions.size()) result = (*m_regions.begin()).second->group_name();
32  return(result);
33 }
34 
35 void
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 }
44 
45 void
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 }
57 
58 void
61  const std::string& tag) {
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 }
82 
83 void
86 }
87 
88 bool
90  return(true);
91 }
92 
93 void
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 }
104 
105 Range
107  Range result;
108 
110  return(result);
111 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
IdDictAltRegions::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary)
Definition: IdDictAltRegions.cxx:46
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:40
Range.h
IdDictAltRegions::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictAltRegions.cxx:59
IdDictAltRegions::reset_implementation
void reset_implementation()
Definition: IdDictAltRegions.cxx:84
IdDictAltRegions.h
IdDictMgr
Definition: IdDictMgr.h:14
IdDictAltRegions::IdDictAltRegions
IdDictAltRegions()
Definition: IdDictAltRegions.cxx:15
IdDictRegion::build_range
Range build_range() const
Definition: IdDictRegion.cxx:147
IdDictRegion::reset_implementation
void reset_implementation()
Definition: IdDictRegion.cxx:101
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictAltRegions::group_name
std::string group_name() const
Definition: IdDictAltRegions.cxx:29
IdDictAltRegions::map_iterator
map_type::iterator map_iterator
Definition: IdDictAltRegions.h:37
IdDictRegion::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictRegion.cxx:37
master.dictionary
dictionary
Definition: master.py:47
IdDictAltRegions::m_regions
map_type m_regions
Definition: IdDictAltRegions.h:39
IdDictAltRegions::build_range
Range build_range() const
Definition: IdDictAltRegions.cxx:106
IdDictAltRegions::clear
void clear()
Definition: IdDictAltRegions.cxx:94
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
IdDictDictionary
Definition: IdDictDictionary.h:30
IdDictFieldImplementation.h
DeMoScan.first
bool first
Definition: DeMoScan.py:536
IdDictAltRegions::set_index
void set_index(size_t index)
Definition: IdDictAltRegions.cxx:36
IdDictRegion.h
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IdDictAltRegions::~IdDictAltRegions
~IdDictAltRegions()
Definition: IdDictAltRegions.cxx:20
IdDictAltRegions::verify
bool verify() const
Definition: IdDictAltRegions.cxx:89