Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Public Attributes | Private Attributes | List of all members
IdDictDictionaryRef Class Reference

#include <IdDictDictionaryRef.h>

Inheritance diagram for IdDictDictionaryRef:
Collaboration diagram for IdDictDictionaryRef:

Public Member Functions

 IdDictDictionaryRef ()
 
 ~IdDictDictionaryRef ()
 
void resolve_references (const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region)
 
void generate_implementation (const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region, const std::string &tag="")
 
void reset_implementation ()
 
bool verify () const
 
Range build_range () const
 
virtual void clear ()
 

Public Attributes

std::string m_dictionary_name
 
IdDictDictionarym_dictionary {}
 

Private Attributes

bool m_resolved_references {}
 
bool m_generated_implementation {}
 
bool m_propagated_information {}
 

Detailed Description

Definition at line 16 of file IdDictDictionaryRef.h.

Constructor & Destructor Documentation

◆ IdDictDictionaryRef()

IdDictDictionaryRef::IdDictDictionaryRef ( )

Definition at line 15 of file IdDictDictionaryRef.cxx.

16  :
17  m_dictionary(0),
18  m_resolved_references(false),
21 }

◆ ~IdDictDictionaryRef()

IdDictDictionaryRef::~IdDictDictionaryRef ( )

Definition at line 23 of file IdDictDictionaryRef.cxx.

23  {
24 }

Member Function Documentation

◆ build_range()

Range IdDictDictionaryRef::build_range ( ) const
virtual

Implements IdDictRegionEntry.

Definition at line 150 of file IdDictDictionaryRef.cxx.

150  {
151  Range result;
152 
153  return(result);
154 }

◆ clear()

void IdDictRegionEntry::clear ( )
virtualinherited

Definition at line 29 of file IdDictRegionEntry.cxx.

29  {
30 }

◆ generate_implementation()

void IdDictDictionaryRef::generate_implementation ( const IdDictMgr idd,
IdDictDictionary dictionary,
IdDictRegion region,
const std::string &  tag = "" 
)
virtual

Reimplemented from IdDictRegionEntry.

Definition at line 39 of file IdDictDictionaryRef.cxx.

42  {
44  if (m_dictionary) {
46  // Propagate information to referenced dictionary:
47  //
48  // 1) Loop over ranges in this region and add them to the
49  // referenced dictionary, then propagate the generate
50  // implementation
51 
52  // 2) Duplicate the regions of the current dictionary in
53  // referenced dictionary. Only the top level range(s) need
54  // to be propagated to correctly calculate the bits of the
55  // upper levels.
56 
57  // Save a vector of entries to prepend, inverting their order
58  std::vector<IdDictRegionEntry*> prepend_entries;
60  for (it = region.m_entries.begin(); it != region.m_entries.end(); ++it) {
62  if (this == entry) break; // end when we get to the dictionary (this)
63  // If this is a range entry, add a duplicate to all
64  // regions in the subdictionary
65  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
66  if (range) {
67  prepend_entries.insert(prepend_entries.begin(), entry);
68  }
69  }
70 
71 
72 
73 
74  // Now prepend list to each region and generate each region
76  for (it2 = m_dictionary->m_all_regions.begin(); it2 != m_dictionary->m_all_regions.end(); ++it2) {
77  IdDictRegion& region2 = *(*it2);
78  for (it = prepend_entries.begin(); it != prepend_entries.end(); ++it) {
80  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
81  if (range) {
82  IdDictRangeRef* new_range = new IdDictRangeRef;
83  new_range->m_range = range;
84  region2.m_entries.insert(region2.m_entries.begin(), new_range);
85  }
86  }
87  }
88 
89  // Now copy all prefixes into new regions in the
90  // referenced dictionary
91  if (prepend_entries.size() > 0) {
92  // Save region number
93  const IdDictRegion& region2 = *m_dictionary->m_all_regions.back();
94  size_t region_number = region2.m_index + 1;
95 
97 
98  // Loop over all regions of current dict, add to ref dict (m_dictionary)
99  for (it = dictionary.m_all_regions.begin(); it != dictionary.m_all_regions.end(); ++it, ++region_number) {
100  IdDictRegion& region3 = *(*it);
101  IdDictRegion* new_region = new IdDictRegion;
102  new_region->m_name = "dummy";
103  new_region->m_group = "dummy";
104  new_region->m_index = region_number;
105 
106  // to all region vectors
107  m_dictionary->m_all_regions.push_back(new_region);
108  // to the entries of the dictionary
109  m_dictionary->add_dictentry(new_region);
110 
111  // Now add in only the ranges
113  size_t i = 0;
114  for (it = region3.m_entries.begin(); it != region3.m_entries.end(); ++it, ++i) {
115  if (i >= prepend_entries.size()) continue;
116 
118  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
119  if (range) {
120  IdDictRangeRef* new_range = new IdDictRangeRef;
121  new_range->m_range = range;
122  new_region->m_entries.push_back(new_range);
123  }
124  }
125  }
126  }
128  }
131  } else {
132  std::cout <<
133  "IdDictDictionaryRef::generate_implementation: - WARNING no dictionary found, cannot generate implementation "
134  << std::endl;
135  }
136  }
137 }

◆ reset_implementation()

void IdDictDictionaryRef::reset_implementation ( )
virtual

Reimplemented from IdDictRegionEntry.

Definition at line 139 of file IdDictDictionaryRef.cxx.

139  {
143  }
144 }

◆ resolve_references()

void IdDictDictionaryRef::resolve_references ( const IdDictMgr idd,
IdDictDictionary dictionary,
IdDictRegion region 
)
virtual

Reimplemented from IdDictRegionEntry.

Definition at line 26 of file IdDictDictionaryRef.cxx.

28  {
29  if (!m_resolved_references) {
31  if (m_dictionary) {
34  }
35  m_resolved_references = true;
36  }
37 }

◆ verify()

bool IdDictDictionaryRef::verify ( ) const
virtual

Reimplemented from IdDictRegionEntry.

Definition at line 146 of file IdDictDictionaryRef.cxx.

146  {
147  return(true);
148 }

Member Data Documentation

◆ m_dictionary

IdDictDictionary* IdDictDictionaryRef::m_dictionary {}

Definition at line 32 of file IdDictDictionaryRef.h.

◆ m_dictionary_name

std::string IdDictDictionaryRef::m_dictionary_name

Definition at line 31 of file IdDictDictionaryRef.h.

◆ m_generated_implementation

bool IdDictDictionaryRef::m_generated_implementation {}
private

Definition at line 38 of file IdDictDictionaryRef.h.

◆ m_propagated_information

bool IdDictDictionaryRef::m_propagated_information {}
private

Definition at line 39 of file IdDictDictionaryRef.h.

◆ m_resolved_references

bool IdDictDictionaryRef::m_resolved_references {}
private

Definition at line 37 of file IdDictDictionaryRef.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
IdDictRangeRef
Definition: IdDictRangeRef.h:18
get_generator_info.result
result
Definition: get_generator_info.py:21
IdDictDictionary::generate_implementation
void generate_implementation(const IdDictMgr &idd, const std::string &tag="")
Definition: IdDictDictionary.cxx:165
IdDictRangeRef::m_range
IdDictRange * m_range
Definition: IdDictRangeRef.h:33
skel.it
it
Definition: skel.GENtoEVGEN.py:407
IdDictRegion
Definition: IdDictRegion.h:20
IdDictDictionary::resolve_references
void resolve_references(const IdDictMgr &idd)
Definition: IdDictDictionary.cxx:138
IdDictRegion::m_name
std::string m_name
Definition: IdDictRegion.h:44
IdDictDictionaryRef::m_dictionary_name
std::string m_dictionary_name
Definition: IdDictDictionaryRef.h:31
IdDictDictionary::reset_implementation
void reset_implementation()
Definition: IdDictDictionary.cxx:212
IdDictDictionary::m_parent_dict
IdDictDictionary * m_parent_dict
Definition: IdDictDictionary.h:239
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:115
IdDictRegion::m_index
size_t m_index
Definition: IdDictRegion.h:43
lumiFormat.i
int i
Definition: lumiFormat.py:85
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
IdDictDictionaryRef::m_propagated_information
bool m_propagated_information
Definition: IdDictDictionaryRef.h:39
IdDictDictionary::regions_it
regions_type::iterator regions_it
Definition: IdDictDictionary.h:226
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
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
IdDictRegionEntry
Definition: IdDictRegionEntry.h:14
IdDictRange
Definition: IdDictRange.h:18
IdDictDictionary::add_dictentry
void add_dictentry(IdDictDictEntry *entry)
Definition: IdDictDictionary.cxx:127
IdDictDictionaryRef::m_dictionary
IdDictDictionary * m_dictionary
Definition: IdDictDictionaryRef.h:32
IdDictDictionaryRef::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDictionaryRef.h:38
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IdDictDictionaryRef::m_resolved_references
bool m_resolved_references
Definition: IdDictDictionaryRef.h:37
IdDictDictionary::m_all_regions
std::vector< IdDictRegion * > m_all_regions
Definition: IdDictDictionary.h:236