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

#include <IdDictDefs.h>

Collaboration diagram for IdDictGroup:

Public Member Functions

 IdDictGroup ()
 
 IdDictGroup (const std::string &name)
 
virtual ~IdDictGroup ()
 
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 354 of file IdDictDefs.h.

Constructor & Destructor Documentation

◆ IdDictGroup() [1/2]

IdDictGroup::IdDictGroup ( )

Definition at line 2241 of file IdDictMgr.cxx.

2242  :
2243  //m_resolved_references(false),
2245 {
2246 }

◆ IdDictGroup() [2/2]

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

Definition at line 2248 of file IdDictMgr.cxx.

2249  :
2250  m_name(name),
2251  //m_resolved_references(false),
2253 {
2254 }

◆ ~IdDictGroup()

IdDictGroup::~IdDictGroup ( )
virtual

Definition at line 2256 of file IdDictMgr.cxx.

2257 {
2258 }

Member Function Documentation

◆ add_dictentry()

void IdDictGroup::add_dictentry ( IdDictDictEntry entry)

Definition at line 2305 of file IdDictMgr.cxx.

2306 {
2307  m_entries.push_back (region);
2308 }

◆ build_multirange()

MultiRange IdDictGroup::build_multirange ( ) const

Get MultiRange for this group.

Definition at line 2279 of file IdDictMgr.cxx.

2280 {
2281  MultiRange result;
2282 
2284 
2285  for (it = m_regions.begin (); it != m_regions.end (); ++it)
2286  {
2287  const IdDictRegion& region = *(*it);
2288 
2289  // skip regions created from parents
2290  if("dummy" == region.m_name) continue;
2291 
2292  // skip empty regions - may arise from alternate_regions
2293  // where a tag selects an empty region
2294  if(region.m_is_empty) continue;
2295 
2296  Range r = region.build_range();
2297  result.add (std::move(r));
2298 
2299  }
2300 
2301  return (result);
2302 }

◆ clear()

void IdDictGroup::clear ( )

Definition at line 2432 of file IdDictMgr.cxx.

2433 {
2435 
2436  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2437 
2438  IdDictDictEntry* region = *it;
2439  region->clear ();
2440  delete region;
2441  }
2442 
2443  m_entries.clear ();
2444 }

◆ entries()

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

Definition at line 2266 of file IdDictMgr.cxx.

2267 {
2268  return (m_entries);
2269 }

◆ generate_implementation()

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

Definition at line 2325 of file IdDictMgr.cxx.

2328 {
2329  if (Debugger::debug ())
2330  {
2331  std::cout << "IdDictGroup::generate_implementation>" << std::endl;
2332  }
2333 
2335 
2336  // Loop over entries and fill regions vec with selected region
2337  // (AltRegions have a selection)
2339  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2340  (*it)->generate_implementation (idd, dictionary, tag);
2341  // Get region and save in m_regions
2342  IdDictRegion* region = dynamic_cast<IdDictRegion*> (*it);
2343  if(region) {
2344  m_regions.push_back(region);
2345  }
2346  else {
2347  IdDictAltRegions* altregions = dynamic_cast<IdDictAltRegions*> (*it);
2348  if(altregions) {
2349  m_regions.push_back(altregions->m_selected_region);
2350  }
2351  }
2352  }
2353 
2354  if (m_regions.size() != m_entries.size()) {
2355  std::cout << "IdDictGroup::generate_implementation - mismatch of sizes: regions/entries "
2356  << m_regions.size() << " " << m_entries.size()
2357  << std::endl;
2358  }
2359 
2361  }
2362 }

◆ name()

std::string IdDictGroup::name ( )

Definition at line 2260 of file IdDictMgr.cxx.

2261 {
2262  return (m_name);
2263 }

◆ regions()

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

Definition at line 2272 of file IdDictMgr.cxx.

2273 {
2274  return (m_regions);
2275 }

◆ reset_implementation()

void IdDictGroup::reset_implementation ( )

Definition at line 2365 of file IdDictMgr.cxx.

2366 {
2368 
2369  m_regions.clear();
2371  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2372  (*it)->reset_implementation();
2373  }
2375  }
2376 }

◆ resolve_references()

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

Definition at line 2311 of file IdDictMgr.cxx.

2314 {
2316  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2317  (*it)->set_index(index);
2318  index++;
2319 
2320  (*it)->resolve_references (idd, dictionary);
2321  }
2322 }

◆ sort()

void IdDictGroup::sort ( )

Sort:

Loop over regions and sort according to their first identifier

Definition at line 2395 of file IdDictMgr.cxx.

2396 {
2397 
2398  std::map< ExpandedIdentifier, IdDictDictEntry* > regions;
2399 
2401 
2402  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
2403 
2404  const IdDictRegion& region = *(*it);
2405  Range range = region.build_range ();
2406  Range::identifier_factory first = range.factory_begin();
2407  Range::identifier_factory last = range.factory_end();
2408  if (first != last) {
2409  regions[*first] = *it;
2410  }
2411  else {
2412  std::cout << "IdDictDictionary::sort - WARNING empty region cannot sort "
2413  << std::endl;
2414  }
2415  }
2416  if (regions.size() == m_regions.size()) {
2417  // Reorder the regions
2419  std::vector<IdDictRegion*>::size_type vecIt = 0;
2420  for (; mapIt != regions.end (); ++mapIt, ++vecIt) {
2421  m_entries[vecIt] = (*mapIt).second;
2422  }
2423  }
2424  else {
2425  std::cout << "IdDictGroup::sort - WARNING region map size is NOT the same as the vector size. Map size "
2426  << regions.size() << " vector size " << m_regions.size()
2427  << std::endl;
2428  }
2429 }

◆ verify()

bool IdDictGroup::verify ( ) const

Definition at line 2380 of file IdDictMgr.cxx.

2381 {
2382  // Should check that all regions have the same number of levels,
2383  // which is part of the definition of a group
2384  return (true);
2385 }

Member Data Documentation

◆ m_entries

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

Definition at line 386 of file IdDictDefs.h.

◆ m_generated_implementation

bool IdDictGroup::m_generated_implementation
private

Definition at line 389 of file IdDictDefs.h.

◆ m_name

std::string IdDictGroup::m_name
private

Definition at line 385 of file IdDictDefs.h.

◆ m_regions

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

Definition at line 387 of file IdDictDefs.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: IdDictDefs.h:385
get_generator_info.result
result
Definition: get_generator_info.py:21
Range::identifier_factory
This factory is able to generate all possible identifiers, from a fully bounded Range.
Definition: DetectorDescription/Identifier/Identifier/Range.h:167
index
Definition: index.py:1
IdDictAltRegions::m_selected_region
IdDictRegion * m_selected_region
Definition: IdDictDefs.h:442
IdDictGroup::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDefs.h:387
skel.it
it
Definition: skel.GENtoEVGEN.py:423
IdDictDictEntry::clear
virtual void clear()=0
IdDictDictEntry
Definition: IdDictDefs.h:393
IdDictAltRegions
Definition: IdDictDefs.h:417
IdDictRegion
Definition: IdDictDefs.h:448
IdDictRegion::m_name
std::string m_name
Definition: IdDictDefs.h:476
IdDictGroup::m_entries
std::vector< IdDictDictEntry * > m_entries
Definition: IdDictDefs.h:386
IdDictGroup::name
std::string name()
Definition: IdDictMgr.cxx:2260
IdDictRegion::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2766
IdDictRegion::m_is_empty
bool m_is_empty
Definition: IdDictDefs.h:479
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
IdDictDictionary::regions_it
regions_type::iterator regions_it
Definition: IdDictDefs.h:293
Debugger::debug
static bool debug()
Definition: IdDictMgr.cxx:26
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictMgr.cxx:2272
IdDictDictionary::regions_const_it
regions_type::const_iterator regions_const_it
Definition: IdDictDefs.h:294
MultiRange
A MultiRange combines several Ranges.
Definition: DetectorDescription/Identifier/Identifier/Range.h:351
master.dictionary
dictionary
Definition: master.py:47
IdDictDictionary::entries_it
entries_type::iterator entries_it
Definition: IdDictDefs.h:289
Range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Definition: DetectorDescription/Identifier/Identifier/Range.h:27
IdDictGroup::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:389
DeMoScan.first
bool first
Definition: DeMoScan.py:534
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24