ATLAS Offline Software
IdDictRegion.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #include "IdDict/IdDictRegion.h"
9 #include "src/Debugger.h"
10 #include <iostream>
11 
12 std::string
14  return(m_group);
15 }
16 
17 void
19  m_index = index;
20 }
21 
22 void
24  m_entries.push_back(entry);
25 }
26 
27 void
30  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
32  entry->resolve_references(idd, dictionary, *this);
33  }
34 }
35 
36 void
39  const std::string& tag) {
40  if (Debugger::debug()) {
41  std::cout << "IdDictRegion::generate_implementation>" << std::endl;
42  }
45  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
47  entry->generate_implementation(idd, dictionary, *this, tag);
48  }
50  }
51 }
52 
53 void
55  // Find the neighbours
56  IdDictRegion* region = 0;
57 
58  if ("" != m_next_abs_eta_name) {
59  region = dictionary.find_region(m_next_abs_eta_name, m_group);
60  if (region) {
61  region->m_prev_abs_eta = this;
62  m_next_abs_eta = region;
63  }
64  }
65  for (unsigned int i = 0; i < m_prev_samp_names.size(); ++i) {
66  if ("" != m_prev_samp_names[i]) {
67  region = dictionary.find_region(m_prev_samp_names[i], m_group);
68  if (region) {
69  m_prev_samp.push_back(region);
70  }
71  }
72  }
73  for (unsigned int i = 0; i < m_next_samp_names.size(); ++i) {
74  if ("" != m_next_samp_names[i]) {
75  region = dictionary.find_region(m_next_samp_names[i], m_group);
76  if (region) {
77  m_next_samp.push_back(region);
78  }
79  }
80  }
81 
82  for (unsigned int i = 0; i < m_prev_subdet_names.size(); ++i) {
83  if ("" != m_prev_subdet_names[i]) {
84  region = dictionary.find_region(m_prev_subdet_names[i], m_group);
85  if (region) {
86  m_prev_subdet.push_back(region);
87  }
88  }
89  }
90  for (unsigned int i = 0; i < m_next_subdet_names.size(); ++i) {
91  if ("" != m_next_subdet_names[i]) {
92  region = dictionary.find_region(m_next_subdet_names[i], m_group);
93  if (region) {
94  m_next_subdet.push_back(region);
95  }
96  }
97  }
98 }
99 
100 void
103  m_implementation.clear(); // remove implementation
105  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
107  entry->reset_implementation();
108  }
109  // reset neighbours
110  m_prev_abs_eta = 0;
111  m_next_abs_eta = 0;
112  m_prev_samp.clear();
113  m_next_samp.clear();
114  m_prev_subdet.clear();
115  m_next_subdet.clear();
116 
118  }
119 }
120 
121 bool IdDictRegion::verify() const {
122  return(true);
123 }
124 
125 void
128  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
130  entry->clear();
131  delete entry;
132  }
133  m_entries.clear();
134 }
135 
136 size_t
138  return m_implementation.size();
139 }
140 
141 size_t
143  return m_entries.size();
144 }
145 
146 Range
148  Range result;
149 
150  std::vector <IdDictRegionEntry*>::const_iterator it;
151  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
152  const IdDictRegionEntry& entry = *(*it);
153  Range r = entry.build_range();
154  result.add(std::move(r));
155  }
156  return(result);
157 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
beamspotman.r
def r
Definition: beamspotman.py:676
IdDictRegion::m_next_samp
std::vector< IdDictRegion * > m_next_samp
Definition: IdDictRegion.h:56
IdDictRegion::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary)
Definition: IdDictRegion.cxx:28
get_generator_info.result
result
Definition: get_generator_info.py:21
index
Definition: index.py:1
IdDictDictionary.h
IdDictRegion::m_prev_abs_eta
IdDictRegion * m_prev_abs_eta
Definition: IdDictRegion.h:53
IdDictRegion::find_neighbours
void find_neighbours(const IdDictDictionary &dictionary)
Definition: IdDictRegion.cxx:54
skel.it
it
Definition: skel.GENtoEVGEN.py:396
Debugger.h
IdDictRegionEntry.h
IdDictRegion::m_prev_samp
std::vector< IdDictRegion * > m_prev_samp
Definition: IdDictRegion.h:55
IdDictRegion::clear
void clear()
Definition: IdDictRegion.cxx:126
IdDictRegion::verify
bool verify() const
Definition: IdDictRegion.cxx:121
IdDictRegion::m_prev_subdet
std::vector< IdDictRegion * > m_prev_subdet
Definition: IdDictRegion.h:57
IdDictRegion
Definition: IdDictRegion.h:20
IdDictRegion::m_next_subdet
std::vector< IdDictRegion * > m_next_subdet
Definition: IdDictRegion.h:58
IdDictMgr
Definition: IdDictMgr.h:14
IdDictRegion::m_next_abs_eta
IdDictRegion * m_next_abs_eta
Definition: IdDictRegion.h:54
IdDictRegion::build_range
Range build_range() const
Definition: IdDictRegion.cxx:147
IdDictRegion::m_index
size_t m_index
Definition: IdDictRegion.h:43
IdDictRegion::reset_implementation
void reset_implementation()
Definition: IdDictRegion.cxx:101
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictRegion::add_entry
void add_entry(IdDictRegionEntry *entry)
Definition: IdDictRegion.cxx:23
IdDictRegion::fieldSize
size_t fieldSize() const
Definition: IdDictRegion.cxx:137
IdDictRegion::group_name
std::string group_name() const
Definition: IdDictRegion.cxx:13
Debugger::debug
static bool debug()
Definition: Debugger.h:18
IdDictRegion::m_next_abs_eta_name
std::string m_next_abs_eta_name
Definition: IdDictRegion.h:48
IdDictRegion::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictRegion.cxx:37
IdDictRegion::size
size_t size() const
Definition: IdDictRegion.cxx:142
IdDictRegion::m_entries
std::vector< IdDictRegionEntry * > m_entries
Definition: IdDictRegion.h:41
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
IdDictRegion::m_group
std::string m_group
Definition: IdDictRegion.h:45
IdDictRegion::m_prev_samp_names
std::vector< std::string > m_prev_samp_names
Definition: IdDictRegion.h:49
master.dictionary
dictionary
Definition: master.py:47
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
IdDictRegion::set_index
void set_index(size_t index)
Definition: IdDictRegion.cxx:18
IdDictRegion::m_next_samp_names
std::vector< std::string > m_next_samp_names
Definition: IdDictRegion.h:50
IdDictDictionary
Definition: IdDictDictionary.h:30
IdDictRegionEntry
Definition: IdDictRegionEntry.h:14
IdDictFieldImplementation.h
IdDictRegion::m_prev_subdet_names
std::vector< std::string > m_prev_subdet_names
Definition: IdDictRegion.h:51
IdDictRegion::m_generated_implementation
bool m_generated_implementation
Definition: IdDictRegion.h:67
DeMoScan.index
string index
Definition: DeMoScan.py:364
IdDictRegion.h
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IdDictRegion::m_implementation
std::vector< IdDictFieldImplementation > m_implementation
Definition: IdDictRegion.h:42
IdDictRegion::m_next_subdet_names
std::vector< std::string > m_next_subdet_names
Definition: IdDictRegion.h:52