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

#include <IdDictDefs.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 656 of file IdDictDefs.h.

Constructor & Destructor Documentation

◆ IdDictDictionaryRef()

IdDictDictionaryRef::IdDictDictionaryRef ( )

Definition at line 3289 of file IdDictMgr.cxx.

3290  :
3291  m_dictionary (0),
3292  m_resolved_references(false),
3295 {
3296 }

◆ ~IdDictDictionaryRef()

IdDictDictionaryRef::~IdDictDictionaryRef ( )

Definition at line 3298 of file IdDictMgr.cxx.

3299 {
3300 }

Member Function Documentation

◆ build_range()

Range IdDictDictionaryRef::build_range ( ) const
virtual

Implements IdDictRegionEntry.

Definition at line 3436 of file IdDictMgr.cxx.

3437 {
3438  Range result;
3439 
3440 // std::cout << "IdDictDictionaryRef::build_range> []" << std::endl;
3441 
3442  return (result);
3443 }

◆ clear()

void IdDictRegionEntry::clear ( )
virtualinherited

Definition at line 2913 of file IdDictMgr.cxx.

2914 {
2915 }

◆ generate_implementation()

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

Reimplemented from IdDictRegionEntry.

Definition at line 3316 of file IdDictMgr.cxx.

3320 {
3322  if(m_dictionary) {
3323  if (!m_propagated_information) {
3324 
3325  // Propagate information to referenced dictionary:
3326  //
3327  // 1) Loop over ranges in this region and add them to the
3328  // referenced dictionary, then propagate the generate
3329  // implementation
3330 
3331  // 2) Duplicate the regions of the current dictionary in
3332  // referenced dictionary. Only the top level range(s) need
3333  // to be propagated to correctly calculate the bits of the
3334  // upper levels.
3335 
3336  // Save a vector of entries to prepend, inverting their order
3337  std::vector<IdDictRegionEntry*> prepend_entries;
3339  for (it = region.m_entries.begin (); it != region.m_entries.end (); ++it) {
3340  IdDictRegionEntry* entry = *it;
3341  if(this == entry) break; // end when we get to the dictionary (this)
3342  // If this is a range entry, add a duplicate to all
3343  // regions in the subdictionary
3344  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
3345  if(range) {
3346  prepend_entries.insert(prepend_entries.begin(), entry);
3347  }
3348  }
3349 
3350 
3351 
3352 // std::cout << "nreg " << m_dictionary->m_all_regions.size() << " "
3353 // << m_dictionary->m_regions.size() << " "
3354 // << m_dictionary->m_entries.size() << " " << std::endl;
3355 
3356 
3357  // Now prepend list to each region and generate each region
3359  for (it2 = m_dictionary->m_all_regions.begin (); it2 != m_dictionary->m_all_regions.end (); ++it2) {
3360  IdDictRegion& region2 = *(*it2);
3361  for (it = prepend_entries.begin(); it != prepend_entries.end(); ++it) {
3362  IdDictRegionEntry* entry = *it;
3363  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
3364  if(range) {
3365  IdDictRangeRef* new_range = new IdDictRangeRef;
3366  new_range->m_range = range;
3367  region2.m_entries.insert(region2.m_entries.begin(), new_range);
3368  }
3369  }
3370  }
3371 
3372  // Now copy all prefixes into new regions in the
3373  // referenced dictionary
3374  if (prepend_entries.size() > 0) {
3375 
3376  // Save region number
3377  const IdDictRegion& region2 = *m_dictionary->m_all_regions.back();
3378  size_t region_number = region2.m_index + 1;
3379 
3381 
3382  // Loop over all regions of current dict, add to ref dict (m_dictionary)
3383  for (it = dictionary.m_all_regions.begin (); it != dictionary.m_all_regions.end (); ++it, ++region_number) {
3384  IdDictRegion& region3 = *(*it);
3385  IdDictRegion* new_region = new IdDictRegion;
3386  new_region->m_name = "dummy";
3387  new_region->m_group = "dummy";
3388  new_region->m_index = region_number;
3389 
3390  // to all region vectors
3391  m_dictionary->m_all_regions.push_back(new_region);
3392  // to the entries of the dictionary
3393  m_dictionary->add_dictentry(new_region);
3394 
3395  // Now add in only the ranges
3397  size_t i = 0;
3398  for (it = region3.m_entries.begin (); it != region3.m_entries.end (); ++it, ++i) {
3399  if (i >= prepend_entries.size()) continue;
3400 
3401  IdDictRegionEntry* entry = *it;
3402  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
3403  if(range) {
3404  IdDictRangeRef* new_range = new IdDictRangeRef;
3405  new_range->m_range = range;
3406  new_region->m_entries.push_back(new_range);
3407  }
3408  }
3409  }
3410  }
3411  m_propagated_information = true;
3412  }
3415  }
3416  else {
3417  std::cout << "IdDictDictionaryRef::generate_implementation: - WARNING no dictionary found, cannot generate implementation "
3418  << std::endl;
3419  }
3420  }
3421 }

◆ reset_implementation()

void IdDictDictionaryRef::reset_implementation ( )
virtual

Reimplemented from IdDictRegionEntry.

Definition at line 3423 of file IdDictMgr.cxx.

3424 {
3428  }
3429 }

◆ resolve_references()

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

Reimplemented from IdDictRegionEntry.

Definition at line 3302 of file IdDictMgr.cxx.

3305 {
3306  if(!m_resolved_references) {
3308  if(m_dictionary) {
3311  }
3312  m_resolved_references = true;
3313  }
3314 }

◆ verify()

bool IdDictDictionaryRef::verify ( ) const
virtual

Reimplemented from IdDictRegionEntry.

Definition at line 3431 of file IdDictMgr.cxx.

3432 {
3433  return (true);
3434 }

Member Data Documentation

◆ m_dictionary

IdDictDictionary* IdDictDictionaryRef::m_dictionary

Definition at line 675 of file IdDictDefs.h.

◆ m_dictionary_name

std::string IdDictDictionaryRef::m_dictionary_name

Definition at line 674 of file IdDictDefs.h.

◆ m_generated_implementation

bool IdDictDictionaryRef::m_generated_implementation
private

Definition at line 681 of file IdDictDefs.h.

◆ m_propagated_information

bool IdDictDictionaryRef::m_propagated_information
private

Definition at line 682 of file IdDictDefs.h.

◆ m_resolved_references

bool IdDictDictionaryRef::m_resolved_references
private

Definition at line 680 of file IdDictDefs.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
IdDictRangeRef
Definition: IdDictDefs.h:606
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: IdDictMgr.cxx:787
IdDictRangeRef::m_range
IdDictRange * m_range
Definition: IdDictDefs.h:623
skel.it
it
Definition: skel.GENtoEVGEN.py:423
IdDictRegion
Definition: IdDictDefs.h:448
IdDictDictionary::resolve_references
void resolve_references(const IdDictMgr &idd)
Definition: IdDictMgr.cxx:421
IdDictRegion::m_name
std::string m_name
Definition: IdDictDefs.h:476
IdDictDictionaryRef::m_dictionary_name
std::string m_dictionary_name
Definition: IdDictDefs.h:674
IdDictDictionary::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:850
IdDictDictionary::m_parent_dict
IdDictDictionary * m_parent_dict
Definition: IdDictDefs.h:306
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:161
IdDictRegion::m_index
size_t m_index
Definition: IdDictDefs.h:475
lumiFormat.i
int i
Definition: lumiFormat.py:92
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
IdDictDictionaryRef::m_propagated_information
bool m_propagated_information
Definition: IdDictDefs.h:682
IdDictDictionary::regions_it
regions_type::iterator regions_it
Definition: IdDictDefs.h:293
IdDictRegion::m_entries
std::vector< IdDictRegionEntry * > m_entries
Definition: IdDictDefs.h:473
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
IdDictRegion::m_group
std::string m_group
Definition: IdDictDefs.h:477
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:27
IdDictRegionEntry
Definition: IdDictDefs.h:523
IdDictRange
Definition: IdDictDefs.h:545
IdDictDictionary::add_dictentry
void add_dictentry(IdDictDictEntry *entry)
Definition: IdDictMgr.cxx:410
IdDictDictionaryRef::m_dictionary
IdDictDictionary * m_dictionary
Definition: IdDictDefs.h:675
IdDictDictionaryRef::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:681
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IdDictDictionaryRef::m_resolved_references
bool m_resolved_references
Definition: IdDictDefs.h:680
IdDictDictionary::m_all_regions
std::vector< IdDictRegion * > m_all_regions
Definition: IdDictDefs.h:303