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

#include <IdDictGroup.h>

Collaboration diagram for IdDictGroup:

Public Member Functions

 IdDictGroup ()
 
 IdDictGroup (const std::string &name)
 
 ~IdDictGroup ()
 
const std::string & name ()
 
const std::vector< IdDictDictEntry * > & entries ()
 
const std::vector< IdDictRegion * > & regions ()
 
MultiRange build_multirange () const
 Get MultiRange for this group. More...
 
void add_dictentry (IdDictDictEntry *entry)
 
void resolve_references (const IdDictMgr &idd, IdDictDictionary &dictionary, size_t &index)
 
void generate_implementation (const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
 
void reset_implementation ()
 
bool verify () const
 
void sort ()
 Sort: More...
 
void clear ()
 

Private Attributes

std::string m_name
 
std::vector< IdDictDictEntry * > m_entries
 
std::vector< IdDictRegion * > m_regions
 
bool m_generated_implementation
 

Detailed Description

Definition at line 19 of file IdDictGroup.h.

Constructor & Destructor Documentation

◆ IdDictGroup() [1/2]

IdDictGroup::IdDictGroup ( )

Definition at line 20 of file IdDictGroup.cxx.

21  :
23 }

◆ IdDictGroup() [2/2]

IdDictGroup::IdDictGroup ( const std::string &  name)

Definition at line 25 of file IdDictGroup.cxx.

26  :
27  m_name(name),
29 }

◆ ~IdDictGroup()

IdDictGroup::~IdDictGroup ( )

Definition at line 31 of file IdDictGroup.cxx.

31  {
32 }

Member Function Documentation

◆ add_dictentry()

void IdDictGroup::add_dictentry ( IdDictDictEntry entry)

Definition at line 72 of file IdDictGroup.cxx.

72  {
73  m_entries.push_back(region);
74 }

◆ build_multirange()

MultiRange IdDictGroup::build_multirange ( ) const

Get MultiRange for this group.

Definition at line 49 of file IdDictGroup.cxx.

49  {
51 
53 
54  for (it = m_regions.begin(); it != m_regions.end(); ++it) {
55  const IdDictRegion& region = *(*it);
56 
57  // skip regions created from parents
58  if ("dummy" == region.m_name) continue;
59 
60  // skip empty regions - may arise from alternate_regions
61  // where a tag selects an empty region
62  if (region.m_is_empty) continue;
63 
64  Range r = region.build_range();
65  result.add(std::move(r));
66  }
67 
68  return(result);
69 }

◆ clear()

void IdDictGroup::clear ( )

Definition at line 185 of file IdDictGroup.cxx.

185  {
187 
188  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
189  IdDictDictEntry* region = *it;
190  region->clear();
191  delete region;
192  }
193 
194  m_entries.clear();
195 }

◆ entries()

const std::vector< IdDictDictEntry * > & IdDictGroup::entries ( )

Definition at line 39 of file IdDictGroup.cxx.

39  {
40  return(m_entries);
41 }

◆ generate_implementation()

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

Definition at line 90 of file IdDictGroup.cxx.

92  {
93  if (Debugger::debug()) {
94  std::cout << "IdDictGroup::generate_implementation>" << std::endl;
95  }
96 
98  // Loop over entries and fill regions vec with selected region
99  // (AltRegions have a selection)
101  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
102  (*it)->generate_implementation(idd, dictionary, tag);
103  // Get region and save in m_regions
104  IdDictRegion* region = dynamic_cast<IdDictRegion*> (*it);
105  if (region) {
106  m_regions.push_back(region);
107  } else {
108  IdDictAltRegions* altregions = dynamic_cast<IdDictAltRegions*> (*it);
109  if (altregions) {
110  m_regions.push_back(altregions->m_selected_region);
111  }
112  }
113  }
114 
115  if (m_regions.size() != m_entries.size()) {
116  std::cout << "IdDictGroup::generate_implementation - mismatch of sizes: regions/entries "
117  << m_regions.size() << " " << m_entries.size()
118  << std::endl;
119  }
120 
122  }
123 }

◆ name()

const std::string & IdDictGroup::name ( )

Definition at line 34 of file IdDictGroup.cxx.

34  {
35  return(m_name);
36 }

◆ regions()

const std::vector< IdDictRegion * > & IdDictGroup::regions ( )

Definition at line 44 of file IdDictGroup.cxx.

44  {
45  return(m_regions);
46 }

◆ reset_implementation()

void IdDictGroup::reset_implementation ( )

Definition at line 126 of file IdDictGroup.cxx.

126  {
128  m_regions.clear();
130  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
131  (*it)->reset_implementation();
132  }
134  }
135 }

◆ resolve_references()

void IdDictGroup::resolve_references ( const IdDictMgr idd,
IdDictDictionary dictionary,
size_t &  index 
)

Definition at line 77 of file IdDictGroup.cxx.

79  {
81  for (it = m_entries.begin(); it != m_entries.end(); ++it) {
82  (*it)->set_index(index);
83  index++;
84 
85  (*it)->resolve_references(idd, dictionary);
86  }
87 }

◆ sort()

void IdDictGroup::sort ( )

Sort:

Loop over regions and sort according to their first identifier

Definition at line 152 of file IdDictGroup.cxx.

152  {
153  std::map< ExpandedIdentifier, IdDictDictEntry* > regions;
154 
156 
157  for (it = m_regions.begin(); it != m_regions.end(); ++it) {
158  const IdDictRegion& region = *(*it);
159  Range range = region.build_range();
160  RangeIterator itr(range);
161  auto first = itr.begin();
162  auto last = itr.end();
163  if (first != last) {
164  regions[*first] = *it;
165  } else {
166  std::cout << "IdDictDictionary::sort - WARNING empty region cannot sort "
167  << std::endl;
168  }
169  }
170  if (regions.size() == m_regions.size()) {
171  // Reorder the regions
173  std::vector<IdDictRegion*>::size_type vecIt = 0;
174  for (; mapIt != regions.end(); ++mapIt, ++vecIt) {
175  m_entries[vecIt] = (*mapIt).second;
176  }
177  } else {
178  std::cout << "IdDictGroup::sort - WARNING region map size is NOT the same as the vector size. Map size "
179  << regions.size() << " vector size " << m_regions.size()
180  << std::endl;
181  }
182 }

◆ verify()

bool IdDictGroup::verify ( ) const

Definition at line 138 of file IdDictGroup.cxx.

138  {
139  // Should check that all regions have the same number of levels,
140  // which is part of the definition of a group
141  return(true);
142 }

Member Data Documentation

◆ m_entries

std::vector<IdDictDictEntry*> IdDictGroup::m_entries
private

Definition at line 48 of file IdDictGroup.h.

◆ m_generated_implementation

bool IdDictGroup::m_generated_implementation
private

Definition at line 50 of file IdDictGroup.h.

◆ m_name

std::string IdDictGroup::m_name
private

Definition at line 47 of file IdDictGroup.h.

◆ m_regions

std::vector<IdDictRegion*> IdDictGroup::m_regions
private

Definition at line 49 of file IdDictGroup.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
beamspotman.r
def r
Definition: beamspotman.py:676
IdDictGroup::m_name
std::string m_name
Definition: IdDictGroup.h:47
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
IdDictGroup::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictGroup.h:49
skel.it
it
Definition: skel.GENtoEVGEN.py:396
RangeIterator
This iterator is able to generate all possible identifiers, from a fully bounded Range.
Definition: RangeIterator.h:19
IdDictDictEntry::clear
virtual void clear()=0
IdDictDictEntry
Definition: IdDictDictEntry.h:13
IdDictAltRegions
Definition: IdDictAltRegions.h:20
IdDictRegion
Definition: IdDictRegion.h:20
IdDictRegion::m_name
std::string m_name
Definition: IdDictRegion.h:44
IdDictGroup::m_entries
std::vector< IdDictDictEntry * > m_entries
Definition: IdDictGroup.h:48
IdDictRegion::build_range
Range build_range() const
Definition: IdDictRegion.cxx:147
IdDictRegion::m_is_empty
bool m_is_empty
Definition: IdDictRegion.h:47
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
IdDictDictionary::regions_it
regions_type::iterator regions_it
Definition: IdDictDictionary.h:226
Debugger::debug
static bool debug()
Definition: Debugger.h:18
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictGroup.cxx:44
IdDictDictionary::regions_const_it
regions_type::const_iterator regions_const_it
Definition: IdDictDictionary.h:227
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
master.dictionary
dictionary
Definition: master.py:47
IdDictDictionary::entries_it
entries_type::iterator entries_it
Definition: IdDictDictionary.h:222
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:29
IdDictGroup::name
const std::string & name()
Definition: IdDictGroup.cxx:34
IdDictGroup::m_generated_implementation
bool m_generated_implementation
Definition: IdDictGroup.h:50
DeMoScan.first
bool first
Definition: DeMoScan.py:536
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24