ATLAS Offline Software
IdDictMgr.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 // $Header: /DetectorDescription/IdDict/src/IdDictMgr.cxx,v 1.43 2008-12-09 09:49:43 dquarrie Exp $
6 
7 #include "IdDict/IdDictDefs.h"
9 #include <fstream>
10 #include <iostream>
11 
12 #include <stdio.h>
13 #include <cstdlib>
14 #include <atomic>
15 
16 
17 
18 class Debugger
19 {
20 public:
21  static bool get_debug_state()
22  {
23  if (::getenv ("IDDEBUG") != 0) {
24  return true;
25  }
26  return false;
27  }
28  static bool debug ()
29  {
30  static const bool debug_state = get_debug_state();
31  return debug_state;
32  }
33 };
34 
35 static bool isNumber(const std::string& str)
36 {
37  bool result = true;
38  for (unsigned int i=0; i<str.size(); ++i) {
39  if(!isdigit(str[i])) return (false);
40  }
41  if (0 == str.size()) return (false);
42 
43  return (result);
44 }
45 
46 
47 
52 {
53 public:
54  static int build_id ();
55 
56 };
57 
58 template <class T>
59 class TypeId
60 {
61 public:
62  operator int ()
63  {
64  static const int i = TypeIdBuilder::build_id ();
65  return (i);
66  }
67 };
68 
70 {
71  static std::atomic<int> i = 0;
72  i++;
73  return (i);
74 }
75 
76 
81  :
82  m_resolved_references(false),
83  m_generated_implementation(false),
84  m_do_checks(false),
85  m_do_neighbours(true)
86 {
87 }
88 
90 {
91  clear();
92 }
93 
94 const std::string& IdDictMgr::tag() const
95 {
96  return m_tag;
97 }
98 
99 const std::string& IdDictMgr::DTD_version() const
100 {
101  return m_DTD_version;
102 }
103 
104 bool IdDictMgr::do_checks () const
105 {
106  return m_do_checks;
107 }
108 
109 void
110 IdDictMgr::set_do_checks (bool do_checks)
111 {
113  for (const auto& p : m_dictionaries) {
114  IdDictDictionary* d = p.second;
115  d->set_do_checks(do_checks);
116  }
117 }
118 
120 {
121  return m_do_neighbours;
122 }
123 
124 void
125 IdDictMgr::set_do_neighbours (bool do_neighbours)
126 {
128  for (const auto& p : m_dictionaries) {
129  IdDictDictionary* d = p.second;
130  d->set_do_neighbours(do_neighbours);
131  }
132 }
133 
134 const std::string&
135 IdDictMgr::find_metadata (const std::string& name) const
136 {
137  metadata_map::const_iterator it = m_metadata.find(name);
138  static const std::string empty;
139  if (it != m_metadata.end()) return (it->second);
140  else return empty;
141 }
142 
143 void
144 IdDictMgr::add_metadata (const std::string& name, const std::string& value)
145 {
146  if(!m_metadata.insert(metadata_map::value_type(name, value)).second) {
147  std::cout << "IdDictMgr::add_metadata> unable to add name/value " << name << "/" << value << std::endl;
148  }
149 }
150 
151 void
152 IdDictMgr::set_DTD_version(const std::string& DTD_version)
153 {
155 }
156 
157 
159 {
160  return (m_dictionaries);
161 }
162 
164 {
165  dictionary_map::const_iterator it;
166 
167  it = m_dictionaries.find (name);
168 
169  if (it == m_dictionaries.end ()) return (0);
170 
171  return ((*it).second);
172 }
173 
175 {
176  if (dictionary == 0) return;
177 
178  std::string& name = dictionary->m_name;
179 
180  // Delete entry if already there
182  if (it != m_dictionaries.end()) delete (*it).second;
183 
185 
186  if (Debugger::debug ())
187  {
189 
190  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
191  {
192  std::string s = (*it).first;
193  IdDictDictionary* d = (*it).second;
194 
195  std::cout << "IdDictMgr::add_dictionary> d[" << s << "]=" << d << std::endl;
196  }
197  }
198 }
199 
200 void IdDictMgr::add_subdictionary_name (const std::string& name)
201 {
202  m_subdictionary_names.insert(name);
203 }
204 
205 
207 {
209 
210  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
211  {
212  // From mgr, only resolve refs for top-level dictionaries
213  IdDictDictionary* dictionary = (*it).second;
214  if (m_subdictionary_names.find(dictionary->m_name) != m_subdictionary_names.end()) continue;
215  dictionary->resolve_references (*this);
216  }
217 }
218 
219 void IdDictMgr::generate_implementation (const std::string& tag)
220 {
221 
222  if (Debugger::debug ())
223  {
224  std::cout << "IdDictMgr::generate_implementation>" << std::endl;
225  }
226 
227  // Must reset the implementation for multiple passes, this resets
228  // the generated flags
230 
232 
233  m_tag = tag;
235  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it) {
236  // From mgr, only generate impl for top-level dictionaries
237  IdDictDictionary* dictionary = (*it).second;
238  if (m_subdictionary_names.find(dictionary->m_name) != m_subdictionary_names.end()) continue;
239  dictionary->generate_implementation (*this, tag);
240  }
242  }
243 }
244 
246 {
247 
248  std::cout << "IdDictMgr::reset_implementation" << std::endl;
249 
250 
252 
254  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it) {
255  // From mgr, only generate impl for top-level dictionaries
256  IdDictDictionary* dictionary = (*it).second;
257  if (m_subdictionary_names.find(dictionary->m_name) != m_subdictionary_names.end()) continue;
258  dictionary->reset_implementation ();
259  }
261  }
262 }
263 
264 
265 bool IdDictMgr::verify () const
266 {
267  dictionary_map::const_iterator it;
268 
269  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
270  {
271  const IdDictDictionary* dictionary = (*it).second;
272  if (!dictionary->verify ()) return (false);
273  }
274 
275  return (true);
276 }
277 
279 {
281 
282  for (it = m_dictionaries.begin (); it != m_dictionaries.end (); ++it)
283  {
284  IdDictDictionary* dictionary = (*it).second;
285  dictionary->clear ();
286  delete dictionary;
287  }
288 
289  m_dictionaries.clear ();
290  m_resolved_references = false;
292 
293 }
294 
299  :
300  m_parent_dict(0),
301  //m_resolved_references(false),
302  m_generated_implementation(false),
303  m_do_checks(false),
304  m_do_neighbours(true)
305 {}
306 
308 {
309 }
310 
311 IdDictField* IdDictDictionary::find_field (const std::string& name) const
312 {
313  std::map <std::string, IdDictField*>::const_iterator it;
314 
315  it = m_fields.find (name);
316 
317  if (it == m_fields.end ()) {
318  // If parent exists, look for field there
319  if(m_parent_dict) {
320  it = m_parent_dict->m_fields.find (name);
321  if (it == m_parent_dict->m_fields.end ()) {
322  return (0);
323  }
324  }
325  else {
326  return (0);
327  }
328  }
329 
330  return ((*it).second);
331 }
332 
333 IdDictLabel* IdDictDictionary::find_label (const std::string& field, const std::string& label) const
334 {
335  IdDictField* idField = find_field(field);
336  if (!idField) return nullptr;
337  return (idField->find_label(label));
338 }
339 
340 int IdDictDictionary::get_label_value (const std::string& field, const std::string& label, int& value) const
341 {
342  IdDictLabel* idLabel = find_label(field, label);
343  if (!idLabel || !idLabel->m_valued) return (1);
344  value = idLabel->m_value;
345  return (0);
346 }
347 
349 {
350  if (field == 0) return;
351 
352  std::string& name = field->m_name;
353 
354  m_fields[name] = field;
355 }
356 
358 {
359  std::map <std::string, IdDictSubRegion*>::const_iterator it;
360 
361  it = m_subregions.find (name);
362 
363  if (it == m_subregions.end ()) return (0);
364 
365  return ((*it).second);
366 }
367 
368 IdDictRegion* IdDictDictionary::find_region (const std::string& region_name) const
369 {
370  return find_region (region_name, "");
371 }
372 
373 IdDictRegion* IdDictDictionary::find_region (const std::string& region_name, const std::string& group_name) const
374 {
375  for (size_t i = 0; i < m_regions.size (); ++i)
376  {
377  IdDictRegion* region = m_regions[i];
378  if ( (group_name!= "") && (region->group_name() != group_name) ) continue;
379  if ((region != 0) && (region_name == region->m_name)) return (region);
380  }
381 
382  return (0);
383 }
384 
386 {
387  for (size_t i = 0; i < m_groups.size (); ++i)
388  {
390  if ((group != 0) && (group->name() == group_name)) return (group);
391  }
392 
393  return (0);
394 }
395 
397 {
398  if (subregion == 0) return;
399 
400  std::string& name = subregion->m_name;
401 
402  m_subregions[name] = subregion;
403 }
404 
406 {
407  m_subdictionary_names.push_back(name);
408 }
409 
410 
411 
413 {
414  // Add region to corresponding group
415  IdDictGroup* group = find_group(region->group_name());
416  if (0 == group) {
417  group = new IdDictGroup(region->group_name());
418  m_groups.push_back(group);
419  }
420  group->add_dictentry (region);
421 }
422 
424 {
425  {
427 
428  for (it = m_fields.begin (); it != m_fields.end (); ++it)
429  {
430  IdDictField* field = (*it).second;
431  field->resolve_references (idd);
432  }
433  }
434  {
436 
437  for (it = m_subregions.begin (); it != m_subregions.end (); ++it)
438  {
439  IdDictSubRegion* subregion = (*it).second;
440  subregion->resolve_references (idd, *this);
441  }
442  }
443  {
444  size_t index = 0;
445 
447  for (it = m_groups.begin (); it != m_groups.end (); ++it)
448  {
449  (*it)->resolve_references (idd, *this, index);
450  }
451  }
452 }
453 
454 typedef std::vector <IdDictRegion*> RV;
455 
456 static void compute_bits (const RV& regions, size_t level, const std::string& group)
457 {
458  //
459  // Compute the OR of all fields at <level>, for the
460  // subset of overlapping regions
461  //
462  Range::field ored_field;
463  unsigned int k;
464  for (k = 0; k < regions.size (); ++k) {
465  IdDictRegion* region = regions[k];
466  if (region->m_implementation.size () <= level) continue;
468  const Range::field thisField = f.field();
469  //on first time, set the original field
470  if (k == 0) ored_field = thisField;
471  //on subsequent iterations, 'or' the new fields with the original
472  else ored_field |= thisField;
473  }
474  //
475  // Now that we have the ored width of all first fields of
476  // all regions, we upgrade the bit width in the corresponding
477  // field implementations.
478  //
479  for (k = 0; k < regions.size (); ++k) {
480  IdDictRegion* region = regions[k];
481  if (region->m_implementation.size () <= level) continue;
482  // Don't set ored bits for regions outside of group - ok to
483  // calculate with them only
484  if (group != region->m_group) continue;
486  f.set_ored_field(ored_field);
487  }
488 }
489 
490 static void get_bits (const RV& regions, size_t level, const std::string& group)
491 {
492 
493  // This function is recusively called for each level to get the
494  // number of bits. By "definition" we require regions in the same
495  // group to overlap to have a uniform bit-allocation for a group.
496  //
497  // For each call, the first region within the specified "group"
498  // which has a (non-empty) field value at the current level is
499  // used as reference. According to this reference, the regions are
500  // divided into two sets: a set overlapping with the reference and
501  // a non-overlapping set. For the overlapping set, get_bits is
502  // called again, but for the next level. When control comes back,
503  // then a reference is chosen from the non-overlapping set and the
504  // procedure continues.
505  //
506  // The calculation of bits needed for a particular level is done
507  // in compute_bits before the overlapping is check for this level.
508  //
509 
510 
511  // Invalid call - return
512  if (regions.size () == 0) return;
513 
514  if (regions.size () == 1) {
515  /*
516  There is only one region (ie one range)
517  therefore the bitsets are unambiguous
518 
519  The bit width of each field implementation is
520  simply the bit width of the corresponding field.
521  */
522 
523  IdDictRegion* region = regions[0];
524 
525  for (size_t k = level; k < region->m_implementation.size (); ++k) {
527 
528  f.set_ored_field(f.field());
529 
530 
531  }
532 
533 
534 
535  return;
536  }
537 
538  size_t k;
539 
540  // Copy the regions provided in the arguments to a local clone.
541 
542  RV mr = regions;
543 
544  // Compute the number of bits needed at this level
545  compute_bits (mr, level, group);
546 
547 
555  RV overlapping;
556  RV orig;
557  RV temp;
558  overlapping.reserve(mr.size());
559  orig.reserve(mr.size());
560  temp.reserve(mr.size());
561 
562  for (;;) {
563  if (mr.size () == 0) {
564  break;
565  }
566  overlapping.clear ();
567  temp.clear ();
568  // Find the first non empty Region within the specified group
569  IdDictRegion* reference_region = 0;
570  for (k = 0; k < mr.size (); ++k) {
571  reference_region = mr[k];
572  if (reference_region->m_implementation.size () > level) {
573  if (group == reference_region->m_group) {
574  overlapping.push_back (reference_region);
575  break;
576  } else {
577  temp.push_back(reference_region);
578  }
579  }
580  }
581 
582  // Should be redundant with the mr.size() test above, but put here
583  // to try to avoid coverity warnings that reference_region may be null.
584  if (reference_region == 0) break;
585 
586  if (overlapping.size () == 0) {
587  break;
588  }
589 
590  // Now really split mr into the two subsets
591 
592  ++k;
593  const IdDictFieldImplementation& f1 = reference_region->m_implementation[level];
594 
595  Range::field ored_field = f1.field();
596  // copy into original test sample, some may have already been
597  // added to temp above.
598  for (; k < mr.size (); ++k) {
599  IdDictRegion* region = mr[k];
600  temp.push_back (region);
601  }
602  bool found_overlap = false;
603 
604  // Compare the reference field at this level to those in the
605  // remaining regions and check for overlap.
606  //
607  // The comparison must be done repeatedly because the overlap
608  // field gets larger and may overlap with previously checked
609  // field of a region.
610  //
611  // By "definition" we require regions in the same group to
612  // overlap to have a uniform bit-allocation for a group.
613  //
614  // For regions outside the current group, the overlap is
615  // allowed for the top level fields with the same names. As
616  // soon as one finds a field with a different name which is in
617  // a region outside the group, this and subsequent fields are
618  // ignored.
619  //
620  do {
621  // copy temp into orig, set overlap to false for this loop over regions
622  orig.clear();
623  orig = temp;
624  temp.clear();
625  found_overlap = false;
626  for (size_t i = 0; i < orig.size (); ++i) {
627  IdDictRegion* region = orig[i];
628  if (region->m_implementation.size () <= level) continue;
629  bool overlap = false;
631 
632  const Range::field& thisField = f.field();
633 
634  // Now expand bits by or'ing them with other regions
635  // at this level, requiring the name to be the same.
636  if (f1.range()->m_field_name == f.range()->m_field_name)
637  overlap = ored_field.overlaps_with (thisField);
638  // Check for either an overlap or force overlap for
639  // regions in the same group
640  if (overlap || (region->m_group == group)) {
641  overlapping.push_back (region);
642  ored_field |= thisField;
643  found_overlap = true;
644  } else {
645  temp.push_back (region);
646  }
647  }
648  } while(found_overlap);
649 
650  // Check overlapping collection - if there are only regions from
651  // the same group, we can safely throw away "temp" the other
652  // collection
653  bool all_within_group = true;
654  bool none_within_group = true;
655  for (size_t i = 0; i < overlapping.size (); ++i) {
656  IdDictRegion* region = overlapping[i];
657  if (group == region->m_group) {
658  none_within_group = false;
659  }else {
660  all_within_group = false;
661  }
662  }
663  // Remove temp is no longer needed
664  if (all_within_group) temp.clear();
665 
666  // Recurse on the remaining fields of the overlapping regions
667  //
668  // Continue only if there are regions still within the current
669  // group
670  if(!none_within_group) {
671  get_bits (overlapping, level + 1, group);
672  }
673 
674  // Continue for the other not-yet-overlapping regions.
675 
676  mr = temp;
677  }
678 }
679 
681  const std::string& tag)
682 {
683 
684  if (Debugger::debug ())
685  {
686  std::cout << "IdDictDictionary::generate_implementation>" << std::endl;
687  }
688 
690 
691  // Propagate to each region and copy their generation into the
692  // dict's vector.
694  for (it = m_groups.begin (); it != m_groups.end (); ++it) {
695  (*it)->generate_implementation (idd, *this, tag);
696  // Get regions from group and save in m_regions
697  const regions_type& regions = (*it)->regions();
699  for (it1 = regions.begin(); it1 != regions.end(); ++it1) {
700  m_regions.push_back(*it1);
701  }
702  }
703 
704  // Loop again over groups and set the bit-packing - starting at
705  // level 0
706  for (it = m_groups.begin (); it != m_groups.end (); ++it) {
707  // Copy to temporary vector all regions in the group. And
708  // look for regions in local m_regions vector for any
709  // regions "dummy", which come from reference
710  // dictionaries.
711  // Skip special group
712  if ("dummy" == (*it)->name()) continue;
713 
714  get_bits (m_regions, 0, (*it)->name());
715 // get_bits (regions, 0, (*it)->name());
716  }
717 
718  // Set integral over the number of bits
719  integrate_bits ();
720 
721  // Set neighbours for regions
723  for (itr = m_regions.begin (); itr != m_regions.end (); ++itr) {
724  (*itr)->find_neighbours(*this);
725  }
726 
728  }
729 }
730 
732 {
734  m_regions.clear();
736  for (it = m_groups.begin (); it != m_groups.end (); ++it) {
737  (*it)->reset_implementation();
738  }
740  }
741 }
742 
743 int
745 {
746 
747  // Find first region that matches id
748 
750 
751  size_type i = 0;
752  for (it = m_regions.begin (); it != m_regions.end (); ++it, ++i) {
753  const IdDictRegion& region = *(*it);
754 
755  Range range = region.build_range();
756 
757  if (range.match(id) && range.fields() >= id.fields()) {
758  index = i;
759  return (0);
760  }
761  }
762 
763  return (1);
764 }
765 
766 
768 {
769  return find_region (id, "");
770 }
771 
773 {
774  // Find first region that matches id
775 
776  IdDictRegion* pRegion = 0;
778 
779  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
780  IdDictRegion& region = *(*it);
781  if ( (group_name!= "") && (region.group_name() != group_name) ) continue;
782 
783  Range range = region.build_range();
784 
785  if (range.match(id) && range.fields() >= id.fields()) {
786  pRegion = &region;
787  }
788  }
789 
790  return (pRegion);
791 }
792 
793 void
795 {
796  // For each region, loop over its levels and set the bit offset
797  // for each FieldImplementation
798 
799  for (IdDictRegion* region : m_regions) {
800  size_t bits_offset = 0;
802  impl.optimize(); // optimize for decoding
803  impl.set_bits_offset(bits_offset);
804  bits_offset += impl.bits();
805 
806  // Set whether or not to decode index
807  Range::field field = impl.ored_field();
808  if ((not field.isBounded()) || (0 != field.get_minimum()) ){
809  impl.set_decode_index(true);
810  }
811  }
812  }
813 }
814 
815 
841 {
842  // check #1
843 
845  if (mr.has_overlap ()) return (false);
846 
847 
848  return (true);
849 }
850 
862 {
863  // verify
864  if (verify()) {
865 
866  std::map< ExpandedIdentifier, IdDictDictEntry* > regions;
867 
869 
870  for (it = m_groups.begin (); it != m_groups.end (); ++it) {
871 
872  (*it)->sort();
873  }
874  }
875  else {
876  std::cout << "IdDictDictionary::sort - WARNING verify is FALSE - cannot sort "
877  << std::endl;
878  }
879 }
880 
882 {
883  {
885 
886  for (it = m_subregions.begin (); it != m_subregions.end (); ++it)
887  {
888  IdDictSubRegion* subregion = (*it).second;
889  subregion->clear ();
890  delete subregion;
891  }
892 
893  m_subregions.clear ();
894  }
895 
896  {
898 
899  for (it = m_fields.begin (); it != m_fields.end (); ++it)
900  {
901  IdDictField* field = (*it).second;
902  field->clear ();
903  delete field;
904  }
905 
906  m_fields.clear ();
907  }
908 
909  {
911 
912  for (it = m_groups.begin (); it != m_groups.end (); ++it) {
913 
914  IdDictGroup* group = *it;
915  group->clear ();
916  delete group;
917  }
918 
919  m_groups.clear ();
920  }
921 }
922 
924 {
926 
928 
929  for (it = m_groups.begin (); it != m_groups.end (); ++it)
930  {
931  const IdDictGroup& group = *(*it);
932 
933  MultiRange group_mr = group.build_multirange();
934 
935  for (unsigned int i = 0; i < group_mr.size(); ++i) {
936  const Range& range = group_mr[i];
937  result.add (range);
938  }
939  }
940 
941 // IdDictDictionary::regions_const_it it;
942 
943 // for (it = m_regions.begin (); it != m_regions.end (); ++it)
944 // {
945 // const IdDictRegion& region = *(*it);
946 
947 // // skip regions created from parents
948 // if("dummy" == region.m_name) continue;
949 
950 // // skip empty regions - may arise from alternate_regions
951 // // where a tag selects an empty region
952 // if(region.m_is_empty) continue;
953 
954 // result.add (region.build_range ());
955 
956 // }
957 
958  return (result);
959 }
960 
962  const Range& prefix,
963  const std::string& last_field) const
964 {
966 
968  if ("" == last_field) {
969  // Take all fields
970  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
971 
972  const IdDictRegion& region = *(*it);
973 
974  // skip regions created from parents
975  if("dummy" == region.m_name) continue;
976 
977  // skip empty regions - may arise from alternate_regions
978  // where a tag selects an empty region
979  if(region.m_is_empty) continue;
980 
981  Range range(region.build_range ());
982  // Check region selection
983  if (range.match(region_id))result.add (std::move(range));
984  }
985  }
986  else {
987  // Not all fields required
988  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
989  const IdDictRegion& region = *(*it);
990 
991  // skip regions created from parents
992  if("dummy" == region.m_name) continue;
993 
994  // skip empty regions - may arise from alternate_regions
995  // where a tag selects an empty region
996  if(region.m_is_empty) continue;
997 
998  Range range(region.build_range ());
999  // Check region selection
1000  if (range.match(region_id)) {
1001  // Build new range up to last_field and add it to result -
1002  // remove duplicate ranges with addRangeToMR
1003  Range new_range(prefix); // Prepend with prefix
1004 
1005  std::vector <IdDictFieldImplementation>::const_iterator fit;
1006  for (fit = region.m_implementation.begin ();
1007  fit != region.m_implementation.end ();
1008  ++fit) {
1009  const IdDictFieldImplementation& impl = *fit;
1010 
1011 // new_range.add(impl.m_field);
1012  new_range.add(impl.range()->build_range());
1013 
1014  if (last_field == impl.range()->m_field->m_name) {
1015  break;
1016  }
1017  }
1018  result.add(std::move(new_range));
1019  }
1020  }
1021  }
1022 
1023  return (result);
1024 }
1025 
1026 
1028  const std::string& group_name,
1029  const Range& prefix,
1030  const std::string& last_field) const
1031 {
1032  MultiRange result;
1033 
1035  if ("" == last_field) {
1036  // Take all fields
1037  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
1038 
1039  const IdDictRegion& region = *(*it);
1040 
1041  // skip regions created from parents
1042  if("dummy" == region.m_name) continue;
1043 
1044  // skip empty regions - may arise from alternate_regions
1045  // where a tag selects an empty region
1046  if(region.m_is_empty) continue;
1047 
1048  Range range(region.build_range ());
1049  // Check region selection
1050  if (range.match(region_id) && region.group_name() == group_name)result.add (std::move(range));
1051  }
1052  }
1053  else {
1054  // Not all fields required
1055  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
1056  const IdDictRegion& region = *(*it);
1057 
1058  // skip regions created from parents
1059  if("dummy" == region.m_name) continue;
1060 
1061  // skip empty regions - may arise from alternate_regions
1062  // where a tag selects an empty region
1063  if(region.m_is_empty) continue;
1064 
1065  Range range(region.build_range ());
1066  // Check region selection
1067  if (range.match(region_id) && region.group_name() == group_name) {
1068  // Build new range up to last_field and add it to result -
1069  // remove duplicate ranges with addRangeToMR
1070  Range new_range(prefix); // Prepend with prefix
1071 
1072  std::vector <IdDictFieldImplementation>::const_iterator fit;
1073  for (fit = region.m_implementation.begin ();
1074  fit != region.m_implementation.end ();
1075  ++fit) {
1076  const IdDictFieldImplementation& impl = *fit;
1077 
1078 // new_range.add(impl.m_field);
1079  new_range.add(impl.range()->build_range());
1080 
1081  if (last_field == impl.range()->m_field->m_name) {
1082  break;
1083  }
1084  }
1085  result.add(std::move(new_range));
1086  }
1087  }
1088  }
1089 
1090  return (result);
1091 }
1092 
1093 
1094 
1108 int
1110  size_t index1,
1111  size_t index2,
1112  Identifier& packedId) const
1113 {
1114  packedId = 0;
1115 
1116 // std::cout << "IdDictDictionary::pack32: index1,2, fields "
1117 // << index1 << " " << index2 << " " << id.fields()
1118 // << " " << (std::string)id << std::endl;
1119 
1120  // Preconditions...
1121 
1122  if (index2 < index1) {
1123  // bad parameters.
1124  return (1);
1125  }
1126 
1127  if (index1 >= id.fields ()) {
1128  // nothing very useful !!
1129  return (1);
1130  }
1131 
1132  if (index2 >= id.fields ()) {
1133  // bad parameter...
1134  return (1);
1135  }
1136 
1146  for (size_t k = 0; k < m_regions.size (); ++k) {
1147  bool selected = true;
1148 
1149  const IdDictRegion& region = *m_regions[k];
1150 
1151  // Must skip empty regions - can arise when a tag selects an
1152  // empty region
1153  if (region.m_is_empty) continue;
1154 
1155  for (size_t i = 0; i < region.m_implementation.size (); ++i) {
1156  if (i >= id.fields ()) break;
1157 
1159 
1160  if (!impl.field().match (id[i])) {
1161 // std::cout << "Region #" << region.m_index <<
1162 // " field " << impl.range()->m_field_name <<
1163 // " #" << i << " (" << (std::string) impl.field() << ") does not match " <<
1164 // id[i] << std::endl;
1165 
1166  selected = false;
1167  break;
1168  }
1169  }
1170 
1171  if (selected) {
1172  size_t position = Identifier::NBITS;
1173 
1174 // std::cout << "Region #" << region.m_index << " selected" << std::endl;
1175 
1176  // We have the proper region.
1177  for (size_t i = index1; i <= index2; ++i) {
1179 
1180  Identifier::value_type index = impl.ored_field().get_value_index (id[i]);
1181 
1182  if (0 == position && impl.bits() > 0) {
1183  return(1);
1184  }
1185 
1186  position -= impl.bits();
1187  packedId |= (index << position);
1188  }
1189  break;
1190  }
1191  }
1192 
1193 
1194  return (0);
1195 }
1196 
1197 
1198 
1199 int
1201  size_t index1,
1202  size_t index2,
1203  size_t region_index,
1204  Identifier& packedId,
1205  size_t first_field_index) const
1206 {
1207 
1208  // Preconditions...
1209 
1210  if (m_do_checks) {
1211 
1212  if (index2 < index1) {
1213  // bad parameters.
1214  std::cout << "IdDictDictionary::pack32 - index2 < index1 - 1,2"
1215  << index1 << " " << index2 << std::endl;
1216  return (1);
1217  }
1218 
1219  if (region_index >= m_regions.size()) {
1220  // bad parameters.
1221  std::cout << "IdDictDictionary::pack32 - region index incorrect - index,size"
1222  << region_index << " " << m_regions.size() << std::endl;
1223  return (1);
1224  }
1225  }
1226 
1227 
1228  // Get the region
1229  const IdDictRegion& region = *m_regions[region_index];
1230 
1231  if (m_do_checks) {
1232  if (region.m_is_empty) {
1233  std::cout << "IdDictDictionary::pack32 - region id empty" << std::endl;
1234  // bad parameters.
1235  return (1);
1236  }
1237  if(index1 < first_field_index) {
1238  std::cout << "IdDictDictionary::pack32 - first_field_index > index1 "
1239  << first_field_index << " " << index1 << std::endl;
1240  return (1);
1241  }
1242  }
1243 
1244  // Set the starting position
1245  size_t position = Identifier::NBITS;
1246  if(!first_field_index) {
1248  position -= impl.bits_offset();
1249  }
1250 
1251  size_t field_index = 0;
1252  for (size_t i = index1; i <= index2; ++i, ++field_index) {
1253 
1255 
1256  if (m_do_checks) {
1257 
1258  // Field should be within allowed range
1259  if (!impl.ored_field().match(fields[field_index])) {
1260  std::cout << "IdDictDictionary::pack32 - field does NOT match: value, allowed values "
1261  << fields[field_index] << " " << (std::string)impl.ored_field()
1262  << std::endl;
1263  // bad parameters.
1264  return (1);
1265  }
1266 
1267  // Check that we don't try to go below 0
1268  if (0 == position && impl.bits() > 0) {
1269  std::cout << "IdDictDictionary::pack32 - going past 0" << std::endl;
1270  return(1);
1271  }
1272  }
1273 
1275  if (impl.decode_index()) {
1276  index = impl.ored_field().get_value_index (fields[field_index]);
1277  }
1278  else {
1279  index = (Identifier::value_type)fields[field_index];
1280  }
1281 
1282  position -= impl.bits();
1283  packedId |= (index << position);
1284 
1285  }
1286 
1287 
1288  return (0);
1289 }
1290 
1295  size_t index2,
1296  size_t region_index,
1297  Identifier& packedId) const
1298 {
1299 
1300  // Preconditions...
1301 
1302  if (m_do_checks) {
1303 
1304  if (index2 < index1) {
1305  // bad parameters.
1306  std::cout << "IdDictDictionary::pack32 - index2 < index1 - 1,2"
1307  << index1 << " " << index2 << std::endl;
1308  return (1);
1309  }
1310 
1311  if (region_index >= m_regions.size()) {
1312  // bad parameters.
1313  std::cout << "IdDictDictionary::pack32 - region index incorrect - index,size"
1314  << region_index << " " << m_regions.size() << std::endl;
1315  return (1);
1316  }
1317  }
1318 
1319 
1320  // Get the region
1321  const IdDictRegion& region = *m_regions[region_index];
1322 
1323  if (m_do_checks) {
1324  if (region.m_is_empty) {
1325  std::cout << "IdDictDictionary::pack32 - region id empty" << std::endl;
1326  // bad parameters.
1327  return (1);
1328  }
1329  }
1330 
1331  size_t field_index = 0;
1332  for (size_t i = index1; i <= index2; ++i, ++field_index) {
1333 
1335 
1336  size_t position = Identifier::NBITS - impl.bits_offset() - impl.bits();
1337 
1338  Identifier::value_type mask = (((Identifier::value_type)1 << impl.bits()) - 1) << position;
1339 
1341 
1342  packedId &= (mask);
1343 
1344  }
1345  return (0);
1346 }
1347 
1348 
1349 
1354 #if defined(FLATTEN) && defined(__GNUC__)
1355 // We compile this package with optimization, even in debug builds; otherwise,
1356 // the heavy use of Eigen makes it too slow. However, from here we may call
1357 // to out-of-line Eigen code that is linked from other DSOs; in that case,
1358 // it would not be optimized. Avoid this by forcing all Eigen code
1359 // to be inlined here if possible.
1360 __attribute__ ((flatten))
1361 #endif
1362 int
1364  const ExpandedIdentifier& prefix,
1365  size_t index2,
1366  ExpandedIdentifier& unpackedId) const
1367 {
1368 
1369  ExpandedIdentifier localPrefix (prefix);
1370  unpackedId.clear ();
1371  if (0 < localPrefix.fields ()) unpackedId = localPrefix;
1372 
1378  size_t index1 = 0; // field index
1379  size_t position = Identifier::NBITS; // overall bit position - used for debugging only
1380 
1381  for (size_t k = 0; k < m_regions.size (); ++k)
1382  {
1383  bool selected = false;
1384 
1385  const IdDictRegion& region = *m_regions[k];
1386 
1387  // Must skip empty regions - can arise when a tag selects an
1388  // empty region
1389  if (region.m_is_empty) continue;
1390 
1391 // for (size_t i = index1; i < region.m_implementation.size (); ++i)
1392  for (size_t i = 0; i < region.m_implementation.size (); ++i)
1393  {
1394  if (i >= localPrefix.fields ())
1395  {
1400  selected = true;
1401  index1 = i;
1402  break;
1403  }
1404 
1406 
1407  if (!impl.field().match (localPrefix[i]))
1408  {
1409 
1410  break;
1411  }
1412  }
1413 
1414  if (selected)
1415  {
1424  for (size_t i = index1; i < region.m_implementation.size (); ++i)
1425  {
1427 
1428  if (impl.bits() == 0) continue;
1429 
1430  Identifier::value_type mask = (static_cast<Identifier::value_type>(1) << impl.bits()) - 1;
1431 
1432  if (position < impl.bits()) break; // Nothing more to get
1433  size_t index = id.extract(position - impl.bits(), mask);
1434 
1435  if (index >= impl.ored_field().get_indices ())
1436  {
1443  selected = false;
1444  break;
1445  }
1446 
1447  ExpandedIdentifier::element_type value = impl.ored_field().get_value_at (index);
1448 
1455  if (!impl.field().match (value))
1456  {
1457 
1458  selected = false;
1459  break;
1460  }
1461 
1462 
1463 
1464  // Found value
1465 
1466  unpackedId.add (value);
1467  localPrefix.add (value);
1468 
1469  position -= impl.bits(); // overall bit position
1470 
1471 
1472 
1473  index1++; // next field
1474 
1475  if (index1 > index2) break; // quit at index2
1476  }
1477 
1478  if (selected) break;
1479  }
1480  }
1481 
1482  return (0);
1483 }
1484 
1490 int
1492  const ExpandedIdentifier& prefix,
1493  size_t index2,
1494  const std::string& sep,
1495  std::string& unpackedId) const
1496 {
1497 
1498  ExpandedIdentifier localPrefix (prefix);
1499 
1500 
1506  size_t index1 = 0; // field index
1507  size_t position = Identifier::NBITS; // overall bit position - used for debugging only
1508 
1509  for (size_t k = 0; k < m_regions.size (); ++k) {
1510  bool selected = false;
1511 
1512  const IdDictRegion& region = *m_regions[k];
1513 
1514  // Must skip empty regions - can arise when a tag selects an
1515  // empty region
1516  if (region.m_is_empty) continue;
1517 
1518 // for (size_t i = index1; i < region.m_implementation.size (); ++i)
1519  for (size_t i = 0; i < region.m_implementation.size (); ++i) {
1520  if (i >= localPrefix.fields ()) {
1525  selected = true;
1526  index1 = i;
1527  break;
1528  }
1529 
1531 
1532  if (!impl.field().match (localPrefix[i])) {
1533 
1534  break;
1535  }
1536  }
1537 
1538  if (selected) {
1545 // bits32 temp = id;
1546 
1547 // std::cout << "Region #" << region.m_index << " selected" << std::endl;
1548 
1549  for (size_t i = index1; i < region.m_implementation.size (); ++i) {
1551 
1552  if (impl.bits() == 0) continue;
1553 
1554  Identifier::value_type mask = (static_cast<Identifier::value_type>(1) << impl.bits()) - 1;
1555 
1556  if (position < impl.bits()) break; // Nothing more to get
1557  size_t index = id.extract(position - impl.bits(), mask);
1558 
1559  if (index >= impl.ored_field().get_indices ()) {
1560 
1561  selected = false;
1562  break;
1563  }
1564 
1565  ExpandedIdentifier::element_type value = impl.ored_field().get_value_at (index);
1566 
1573  if (!impl.field().match (value)) {
1574 
1575  selected = false;
1576  break;
1577  }
1578 
1579 
1580  // Add value to string
1581 
1582  std::string str_value("nil");
1583  char temp[20];
1584 
1585  // The policy below is:
1586  // - if a value is a character string or name, just add this name
1587  // - if a value is a number, then prefix it with the
1588  // name of the field
1589  //
1590  // NOTE: min/max is a number, but for value/label we
1591  // distinguish between number and name by looking for an IdDictLabel
1592  const IdDictRange* range = impl.range();
1593  IdDictLabel* label = range->m_field->find_label(range->m_label);
1594  switch (range->m_specification) {
1595  case IdDictRange::by_minmax:
1596  // For a range of values (numbers), add in the field name
1597  str_value = range->m_field->m_name + ' ';
1598  sprintf (temp, "%d", value);
1599  str_value += temp;
1600  break;
1601  case IdDictRange::by_value:
1602  case IdDictRange::by_label:
1603  str_value = "";
1604  if (!label) {
1605  // Is a number, add in field name
1606  str_value += range->m_field->m_name + ' ';
1607  }
1608  str_value += range->m_label;
1609  break;
1610  case IdDictRange::by_values:
1611  case IdDictRange::by_labels:
1612  str_value = "";
1613  // Is a name
1614  if (label) {
1615  // Found label with "find_label" on the field
1616  if (label->m_valued) {
1617  str_value += range->m_label;
1618  }
1619  }
1620  else {
1621  // If not found with the "find" above, we must
1622  // get the value and name from the range
1623  // itself.
1624 
1625  unsigned int index1 = 0;
1626  for (; index1 < range->m_values.size(); ++index1) {
1627  if (value == range->m_values[index1]) {
1628  break;
1629  }
1630  }
1631 
1632  // In some cases we
1633  if (index1 < range->m_labels.size()) {
1634  if (isNumber(range->m_labels[index1])) {
1635  str_value += range->m_field->m_name + ' ';
1636  }
1637  str_value += range->m_labels[index1];
1638  }
1639  else {
1640  std::cout << "IdDictDictionary::unpack - Could not find value." << std::endl;
1641  std::cout << "value " << value << std::endl;
1642  std::cout << "field values " << std::endl;
1643  for (unsigned int i=0; i < range->m_values.size(); ++i) {
1644  std::cout << range->m_values[i] << " ";
1645  }
1646  std::cout << std::endl;
1647  }
1648  }
1649  break;
1650  case IdDictRange::unknown:
1651 
1652  std::cout << "unknown" << std::endl;
1653 
1654  break;
1655  }
1656 
1657 
1658  if (index1)unpackedId += sep;
1659  unpackedId += str_value;
1660  localPrefix.add (value);
1661 
1662  position -= impl.bits(); // overall bit position
1663 
1664 
1665 
1666  index1++; // next field
1667 
1668  if (index1 > index2) break; // quit at index2
1669  }
1670  if (selected) break;
1671  }
1672  }
1673 
1674  return (0);
1675 }
1676 
1677 
1686 int
1688  size_t first_field_index,
1689  size_t field_index,
1690  size_t region_index,
1691  int& field) const
1692 {
1693  field = 0;
1694 
1695  if (m_do_checks) {
1696 
1697  // Check regions
1698  if (region_index >= m_regions.size()) {
1699  std::cout << "IdDictDictionary::unpack - region index too large. Index, nregions "
1700  << region_index << " " << m_regions.size() << std::endl;
1701  return (1);
1702  }
1703  }
1704 
1705  const IdDictRegion& region = *m_regions.at(region_index);
1706 
1707  if (m_do_checks) {
1708 
1709  // check number of fields
1710  if (field_index >= region.m_implementation.size()) {
1711  std::cout << "IdDictDictionary::unpack - field index too large. Index, nfields "
1712  << field_index << " " << region.m_implementation.size()
1713  << std::endl;
1714  return (1);
1715  }
1716 
1717  }
1718 
1719  const IdDictFieldImplementation& impl = region.m_implementation.at(field_index);
1720  size_t prefix_offset = 0;
1721 
1722  size_t position = Identifier::NBITS; // overall bit position
1723 
1724  // One or more fields missing from prefix, get the offset
1725  if (first_field_index) {
1726  if (m_do_checks) {
1727  if (first_field_index >= region.m_implementation.size()) {
1728  std::cout << "IdDictDictionary::unpack - first_field_index too large. Index, nfields "
1729  << first_field_index << " " << region.m_implementation.size()
1730  << std::endl;
1731  return (1);
1732  }
1733  }
1734 
1735  // One or more fields missing from prefix, get the offset
1736  prefix_offset = region.m_implementation[first_field_index].bits_offset();
1737 
1738  if (m_do_checks) {
1739  // Should have a non-zero number of bits
1740  if (impl.bits() == 0) {
1741  std::cout << "IdDictDictionary::unpack - no bits for this field. Region, field indexes "
1742  << region_index << " " << field_index << std::endl;
1743  return (1);
1744  }
1745 
1746  // Check the shift value
1747  if (impl.bits() + impl.bits_offset() - prefix_offset > position) {
1748  std::cout << "IdDictDictionary::unpack - bits + offset too large. Region, field indexes, bits, offset "
1749  << region_index << " " << field_index << " "
1750  << impl.bits() << " " << impl.bits_offset() << " " << prefix_offset
1751  << std::endl;
1752  return (1);
1753  }
1754  }
1755  }
1756 
1757  Identifier::value_type mask = (static_cast<Identifier::value_type>(1) << impl.bits()) - 1;
1758 
1759  size_t index = id.extract(position -= impl.bits() + impl.bits_offset() - prefix_offset, mask);
1760 
1761  field = index;
1762  if (impl.decode_index()) field = impl.ored_field().get_value_at (index);
1763 
1764 
1765  return (0);
1766 }
1767 
1777 int
1779  size_t first_field_index,
1780  size_t begin_field_index,
1781  size_t end_field_index,
1782  size_t region_index,
1783  Identifier& idout) const
1784 {
1785 
1786  idout = Identifier();
1787  if (region_index >= m_regions.size()) {
1788  std::cout << "IdDictDictionary::copy - region index too large. Index, nregions "
1789  << region_index << " " << m_regions.size() << std::endl;
1790  return (1);
1791  }
1792 
1793  const IdDictRegion& region = *m_regions[region_index];
1794 
1795  if (first_field_index >= region.m_implementation.size() ||
1796  begin_field_index >= region.m_implementation.size() ||
1797  end_field_index >= region.m_implementation.size()) {
1798  std::cout << "IdDictDictionary::copy - field index too large. Indexes first, begin, end, nfields "
1799  << first_field_index << " "
1800  << begin_field_index << " "
1801  << end_field_index << " "
1802  << region.m_implementation.size()
1803  << std::endl;
1804  return (1);
1805  }
1806 
1807  size_t missing_offset = 0;
1808  if (first_field_index) {
1809  if (first_field_index > begin_field_index) {
1810  std::cout << "IdDictDictionary::copy - first_field_index > begin_field_index. Indexes "
1811  << first_field_index << " " << begin_field_index << std::endl;
1812  return (1);
1813  }
1814  // One or more fields missing from prefix, get the offset
1815  missing_offset = region.m_implementation[first_field_index].bits_offset();
1816  }
1817 
1818  size_t prefix_offset = 0;
1819  if (begin_field_index) {
1820  if (begin_field_index > end_field_index) {
1821  std::cout << "IdDictDictionary::copy - begin_field_index > end_field_index. Indexes "
1822  << begin_field_index << " " << end_field_index << std::endl;
1823  return (1);
1824  }
1825  // One or more fields missing from prefix, get the offset
1826  prefix_offset = region.m_implementation[begin_field_index].bits_offset();
1827  }
1828 
1829  const IdDictFieldImplementation& impl = region.m_implementation[end_field_index];
1830  size_t suffix_offset = impl.bits() + impl.bits_offset();
1831 
1832  size_t position = Identifier::NBITS; // overall bit position
1833 
1834  if (position < prefix_offset - missing_offset) {
1835  std::cout << "IdDictDictionary::copy - position < prefix + missing. "
1836  << prefix_offset << " " << missing_offset << std::endl;
1837  return (1);
1838  }
1839 
1840 
1841  if (position < suffix_offset + missing_offset) {
1842  std::cout << "IdDictDictionary::copy - position < suffix + missing. "
1843  << suffix_offset << " " << missing_offset << std::endl;
1844  return (1);
1845  }
1846 
1847 
1848  // prepare the mask for copying
1849 
1851 
1852  Identifier::value_type prefix_mask = prefix_offset ? (static_cast<Identifier::value_type>(1) << (position - prefix_offset + missing_offset)) - 1 : 0;
1853 
1854  Identifier::value_type suffix_mask = (static_cast<Identifier::value_type>(1) << (position - suffix_offset + missing_offset)) - 1;
1855 
1856  mask -= prefix_mask + suffix_mask;
1857 
1858  idout = idin.mask_shift(mask, missing_offset);
1859 
1860 
1861  return (0);
1862 }
1863 
1864 
1865 
1866 bool
1868 {
1869  return (m_do_checks);
1870 }
1871 
1872 void
1874 {
1876 }
1877 
1878 bool
1880 {
1881  return (m_do_neighbours);
1882 }
1883 
1884 void
1886 {
1888 }
1889 
1890 
1892 {
1893 }
1894 
1896  const std::string& /*tag*/)
1897 {
1898 }
1899 
1901 {
1902 }
1903 
1904 bool IdDictField::verify () const
1905 {
1906  return (true);
1907 }
1908 
1909 IdDictLabel* IdDictField::find_label (const std::string& name) const
1910 {
1911  for (size_t i = 0; i < m_labels.size (); ++i)
1912  {
1913  IdDictLabel* label = m_labels[i];
1914  if ((label != 0) && (label->m_name == name)) return (label);
1915  }
1916 
1917  return (0);
1918 }
1919 
1920 void
1922  m_labels.push_back (label);
1923 }
1924 
1925 size_t
1927  return m_labels.size ();
1928 }
1929 
1930 const std::string&
1932  return m_labels.at(index)->m_name;
1933 }
1934 
1936 IdDictField::get_label_value (const std::string& name) const {
1938  try{
1939  value = std::stoi(name);
1940  return value;
1941  } catch (std::invalid_argument & e){
1942  for (const auto *label:m_labels) {
1943  if (label == nullptr) continue;
1944  if (label->m_valued) value = label->m_value;
1945  if (label->m_name == name) {
1946  return (value);
1947  }
1948  value++;
1949  }
1950  }
1951  std::cerr << "Warning : label " << name << " not found" << std::endl;
1952  return (0);
1953 }
1954 
1956  for (size_t i = 0; i < m_labels.size (); ++i) {
1957  IdDictLabel* label = m_labels[i];
1958  delete label;
1959  }
1960  m_labels.clear ();
1961 }
1962 
1963 
1968  :
1969  m_generated_implementation(false)
1970 {
1971 }
1972 
1973 IdDictGroup::IdDictGroup (const std::string& name)
1974  :
1975  m_name(name),
1976  m_generated_implementation(false)
1977 {
1978 }
1979 
1981 {
1982 }
1983 
1984 const std::string& IdDictGroup::name()
1985 {
1986  return (m_name);
1987 }
1988 
1989 const std::vector<IdDictDictEntry*>&
1991 {
1992  return (m_entries);
1993 }
1994 
1995 const std::vector<IdDictRegion*>&
1997 {
1998  return (m_regions);
1999 }
2000 
2001 
2002 MultiRange
2004 {
2005  MultiRange result;
2006 
2008 
2009  for (it = m_regions.begin (); it != m_regions.end (); ++it)
2010  {
2011  const IdDictRegion& region = *(*it);
2012 
2013  // skip regions created from parents
2014  if("dummy" == region.m_name) continue;
2015 
2016  // skip empty regions - may arise from alternate_regions
2017  // where a tag selects an empty region
2018  if(region.m_is_empty) continue;
2019 
2020  Range r = region.build_range();
2021  result.add (std::move(r));
2022 
2023  }
2024 
2025  return (result);
2026 }
2027 
2028 void
2030 {
2031  m_entries.push_back (region);
2032 }
2033 
2034 void
2037  size_t& index)
2038 {
2040  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2041  (*it)->set_index(index);
2042  index++;
2043 
2044  (*it)->resolve_references (idd, dictionary);
2045  }
2046 }
2047 
2048 void
2051  const std::string& tag)
2052 {
2053  if (Debugger::debug ())
2054  {
2055  std::cout << "IdDictGroup::generate_implementation>" << std::endl;
2056  }
2057 
2059 
2060  // Loop over entries and fill regions vec with selected region
2061  // (AltRegions have a selection)
2063  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2064  (*it)->generate_implementation (idd, dictionary, tag);
2065  // Get region and save in m_regions
2066  IdDictRegion* region = dynamic_cast<IdDictRegion*> (*it);
2067  if(region) {
2068  m_regions.push_back(region);
2069  }
2070  else {
2071  IdDictAltRegions* altregions = dynamic_cast<IdDictAltRegions*> (*it);
2072  if(altregions) {
2073  m_regions.push_back(altregions->m_selected_region);
2074  }
2075  }
2076  }
2077 
2078  if (m_regions.size() != m_entries.size()) {
2079  std::cout << "IdDictGroup::generate_implementation - mismatch of sizes: regions/entries "
2080  << m_regions.size() << " " << m_entries.size()
2081  << std::endl;
2082  }
2083 
2085  }
2086 }
2087 
2088 void
2090 {
2092 
2093  m_regions.clear();
2095  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2096  (*it)->reset_implementation();
2097  }
2099  }
2100 }
2101 
2102 
2103 bool
2105 {
2106  // Should check that all regions have the same number of levels,
2107  // which is part of the definition of a group
2108  return (true);
2109 }
2110 
2120 {
2121 
2122  std::map< ExpandedIdentifier, IdDictDictEntry* > regions;
2123 
2125 
2126  for (it = m_regions.begin (); it != m_regions.end (); ++it) {
2127 
2128  const IdDictRegion& region = *(*it);
2129  Range range = region.build_range ();
2130  RangeIterator itr(range);
2131  auto first = itr.begin();
2132  auto last = itr.end();
2133  if (first != last) {
2134  regions[*first] = *it;
2135  } else {
2136  std::cout << "IdDictDictionary::sort - WARNING empty region cannot sort "
2137  << std::endl;
2138  }
2139  }
2140  if (regions.size() == m_regions.size()) {
2141  // Reorder the regions
2143  std::vector<IdDictRegion*>::size_type vecIt = 0;
2144  for (; mapIt != regions.end (); ++mapIt, ++vecIt) {
2145  m_entries[vecIt] = (*mapIt).second;
2146  }
2147  }
2148  else {
2149  std::cout << "IdDictGroup::sort - WARNING region map size is NOT the same as the vector size. Map size "
2150  << regions.size() << " vector size " << m_regions.size()
2151  << std::endl;
2152  }
2153 }
2154 
2155 void
2157 {
2159 
2160  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2161 
2162  IdDictDictEntry* region = *it;
2163  region->clear ();
2164  delete region;
2165  }
2166 
2167  m_entries.clear ();
2168 }
2169 
2170 
2175 {
2176 }
2177 
2179 {
2180 }
2181 
2186  :
2187  m_selected_region(0)
2188 {
2189 }
2190 
2192 {
2195  for (; first != last; ++first) {
2196  delete (*first).second;
2197  }
2198 }
2199 
2200 std::string
2202 {
2203  std::string result;
2204  if (1 <= m_regions.size()) result = (*m_regions.begin()).second->group_name();
2205  return (result);
2206 }
2207 
2208 
2209 void
2211 {
2212  map_iterator first = m_regions.begin();
2213  map_iterator last = m_regions.end();
2214  for (; first != last; ++first) {
2215  (*first).second->set_index (index);
2216  }
2217 }
2218 
2219 
2220 void
2223 {
2224  // We assume that it is not necessary to select only those with
2225  // the correct tag -> send to all in map
2226  map_iterator first = m_regions.begin();
2227  map_iterator last = m_regions.end();
2228  for (; first != last; ++first) {
2229  (*first).second->resolve_references (idd, dictionary);
2230  }
2231 }
2232 
2233 void
2236  const std::string& tag)
2237 {
2238  // Find the region given by the tag
2239  map_iterator region_it = m_regions.find(tag);
2240  if(region_it == m_regions.end()) {
2241  std::cout << "IdDictAltRegions::generate_implementation could not find region for tag "
2242  << tag << " Keys in map " << std::endl;
2243  map_iterator first = m_regions.begin();
2244  map_iterator last = m_regions.end();
2245  int i = 0;
2246  for (; first != last; ++first, ++i) {
2247  std::cout << " i " << i << " key " << (*first).first;
2248  }
2249  std::cout << std::endl;
2250  return;
2251  }
2252  m_selected_region = (*region_it).second;
2253 
2254 
2256 
2257 }
2258 
2259 void
2261 {
2263 }
2264 
2265 
2266 bool
2268 {
2269  return (true);
2270 }
2271 
2272 void
2274 {
2275  map_iterator first = m_regions.begin();
2276  map_iterator last = m_regions.end();
2277  for (; first != last; ++first) {
2278  (*first).second->clear();
2279  delete (*first).second;
2280  }
2281  m_regions.clear();
2282 }
2283 
2284 Range
2286  Range result;
2287 
2289  return (result);
2290 }
2291 
2292 
2293 std::string
2295  return (m_group);
2296 }
2297 
2298 void
2300  m_index = index;
2301 }
2302 
2303 void
2305  m_entries.push_back (entry);
2306 }
2307 
2308 void
2311  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2312  IdDictRegionEntry* entry = *it;
2313  entry->resolve_references (idd, dictionary, *this);
2314  }
2315 }
2316 
2317 void
2320  const std::string& tag){
2321 
2322  if (Debugger::debug ()) {
2323  std::cout << "IdDictRegion::generate_implementation>" << std::endl;
2324  }
2327  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2328  IdDictRegionEntry* entry = *it;
2329  entry->generate_implementation (idd, dictionary, *this, tag);
2330  }
2332  }
2333 }
2334 
2335 void
2337  // Find the neighbours
2338  IdDictRegion* region = 0;
2339  if ("" != m_next_abs_eta_name) {
2340  region = dictionary.find_region(m_next_abs_eta_name,m_group );
2341  if (region) {
2342  region->m_prev_abs_eta = this;
2343  m_next_abs_eta = region;
2344  }
2345  }
2346  for (unsigned int i = 0; i < m_prev_samp_names.size(); ++i) {
2347  if ("" != m_prev_samp_names[i]) {
2348  region = dictionary.find_region(m_prev_samp_names[i],m_group );
2349  if (region) {
2350  m_prev_samp.push_back(region);
2351  }
2352  }
2353  }
2354  for (unsigned int i = 0; i < m_next_samp_names.size(); ++i) {
2355  if ("" != m_next_samp_names[i]) {
2356  region = dictionary.find_region(m_next_samp_names[i],m_group );
2357  if (region) {
2358  m_next_samp.push_back(region);
2359  }
2360  }
2361  }
2362 
2363  for (unsigned int i = 0; i < m_prev_subdet_names.size(); ++i) {
2364  if ("" != m_prev_subdet_names[i]) {
2365  region = dictionary.find_region(m_prev_subdet_names[i],m_group );
2366  if (region) {
2367  m_prev_subdet.push_back(region);
2368  }
2369  }
2370  }
2371  for (unsigned int i = 0; i < m_next_subdet_names.size(); ++i) {
2372  if ("" != m_next_subdet_names[i]) {
2373  region = dictionary.find_region(m_next_subdet_names[i],m_group );
2374  if (region) {
2375  m_next_subdet.push_back(region);
2376  }
2377 
2378  }
2379  }
2380 }
2381 
2382 
2383 void
2386  m_implementation.clear(); // remove implementation
2388  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2389  IdDictRegionEntry* entry = *it;
2390  entry->reset_implementation ();
2391  }
2392  // reset neighbours
2393  m_prev_abs_eta = 0;
2394  m_next_abs_eta = 0;
2395  m_prev_samp.clear();
2396  m_next_samp.clear();
2397  m_prev_subdet.clear();
2398  m_next_subdet.clear();
2399 
2401  }
2402 }
2403 
2404 bool IdDictRegion::verify () const {
2405  return (true);
2406 }
2407 
2408 void
2411  for (it = m_entries.begin (); it != m_entries.end (); ++it){
2412  IdDictRegionEntry* entry = *it;
2413  entry->clear ();
2414  delete entry;
2415  }
2416  m_entries.clear ();
2417 }
2418 
2419 Range
2421  Range result;
2422  std::vector <IdDictRegionEntry*>::const_iterator it;
2423  for (it = m_entries.begin (); it != m_entries.end (); ++it){
2424  const IdDictRegionEntry& entry = *(*it);
2425  Range r = entry.build_range ();
2426  result.add (std::move(r));
2427  }
2428  return (result);
2429 }
2430 
2431 
2436 {
2437 }
2438 
2440 {
2441 }
2442 
2443 void
2445  IdDictDictionary& /*dictionary*/,
2446  const std::string& /*tag*/)
2447 {
2448  std::cout << "IdDictSubRegion::generate_implementation - SHOULD NEVER BE CALLED " << std::endl;
2449 }
2450 
2451 
2452 void
2455  IdDictRegion& region,
2456  const std::string& tag)
2457 {
2458 
2459  if (Debugger::debug ())
2460  {
2461  std::cout << "IdDictSubRegion::generate_implementation>" << std::endl;
2462  }
2463 
2464  // NOTE: we DO NOT protect this method with
2465  // m_generated_implementation because a subregion is a "reference"
2466  // and must be looped over to fully implement a region.
2467 
2469 
2470  for (it = m_entries.begin (); it != m_entries.end (); ++it) {
2471  IdDictRegionEntry* entry = *it;
2472  entry->generate_implementation (idd, dictionary, region, tag);
2473  }
2474 }
2475 
2476 void
2478  for (auto * entry:m_entries) {
2479  entry->reset_implementation ();
2480  }
2481 }
2482 
2483 
2484 
2485 void
2487  IdDictDictionary& dictionary, IdDictRegion& /*region*/) {
2488  if(!m_resolved_references) {
2489  m_field = dictionary.find_field (m_field_name);
2490  if (m_field == nullptr) {
2491  m_field = new IdDictField;
2493  dictionary.add_field (m_field);
2494  }
2495 
2496  if (m_specification == unknown) {
2506  unsigned int labels = m_field->get_label_number ();
2507  if (labels == 1) {
2509  m_label = m_field->get_label (0);
2510  } else if (labels > 1) {
2512  for (size_t i = 0; i < labels; ++i) {
2513  m_labels.push_back (m_field->get_label (i));
2514  }
2515  }
2516  }
2517 
2518  if (m_specification == by_label) {
2520  } else if (m_specification == by_labels) {
2521  m_values.clear ();
2522  for (size_t i = 0; i < m_labels.size (); ++i) {
2523  const std::string& label = m_labels[i];
2524  int value = m_field->get_label_value (label);
2525  m_values.push_back (value);
2526  }
2527  }
2528  m_resolved_references = true;
2529  }
2530 }
2531 
2532 void
2534  IdDictDictionary& dictionary, IdDictRegion& region,const std::string& /*tag*/) {
2535 
2536  // Add IdDictFieldImplementation to this region
2537 
2538  // NOTE: we DO NOT protect this method with
2539  // m_generated_implementation because the same object may be
2540  // called more than once because there are IdDictRangeRef's which
2541  // point to the same IdDictRange's.
2542 
2543  if (Debugger::debug ()) {
2544  std::cout << "IdDictRange::generate_implementation>" << std::endl;
2545  }
2546 
2547  region.m_implementation.resize (region.m_implementation.size () + 1);
2548  IdDictFieldImplementation& impl = region.m_implementation.back ();
2549  impl.set_range(this);
2550  if (m_field->m_index == 0) {
2551  m_field->m_index = region.m_implementation.size () - 1;
2552 
2553  } else if (m_field->m_index != (region.m_implementation.size () - 1)) {
2554  std::cout << "Bad field index for " << m_field_name
2555  << " index " << m_field->m_index
2556  << " in dictionary " << dictionary.m_name
2557  << " region #" << region.m_index
2558  << " size " << (region.m_implementation.size () - 1)
2559  << std::endl;
2560  }
2561 
2562  size_t index = region.m_implementation.size () - 1;
2563  if (region.m_implementation.size () <= index) {
2564  std::cout << "IdDictRange::generate_implementation: index >= impl size - "
2565  << index << " " << region.m_implementation.size ()
2566  << std::endl;
2567  return;
2568  }
2569 
2571  switch (m_specification) {
2572  case by_value:
2573  case by_label: {
2574  impl.set_field(Range::field(m_value, m_value));
2575  break;
2576  }
2577  case by_values:
2578  case by_labels: {
2580  v.insert(v.end(), m_values.begin(), m_values.end());
2581  field.set(v);
2582  impl.set_field(field);
2583  }
2584  break;
2585  case by_minmax:
2586  field.set (m_minvalue, m_maxvalue);
2587  impl.set_field(field);
2588  break;
2589  case unknown:
2590  break;
2591  }
2592 }
2593 
2594 
2595 Range
2597  Range result;
2599  switch (m_specification) {
2600  case by_value:
2601  case by_label:{
2602  field.set (m_value, m_value);
2603  break;
2604  }
2605  case by_values:
2606  case by_labels:{
2608  v.insert(v.end(), m_values.begin(), m_values.end());
2609  field.set (v);
2610  break;
2611  }
2612  case by_minmax:{
2613  field.set (m_minvalue, m_maxvalue);
2614  break;
2615  }
2616  case unknown:{
2617  break;
2618  }
2619  }
2621  field.set(true);
2622  } else if (has_previous == m_continuation_mode) {
2623  field.set_previous(m_prev_value);
2624  } else if (has_next == m_continuation_mode) {
2625  field.set_next(m_next_value);
2626  } else if (has_both == m_continuation_mode) {
2627  field.set_previous(m_prev_value);
2628  field.set_next(m_next_value);
2629  }
2630  result.add (std::move(field));
2631  return (result);
2632 }
2633 
2634 
2635 
2636 void
2639  IdDictRegion& region) {
2640  if (m_range) m_range->resolve_references (idd, dictionary, region);
2641 }
2642 
2643 void
2646  IdDictRegion& region,
2647  const std::string& tag) {
2648  if (m_range) m_range->generate_implementation (idd, dictionary, region, tag);
2649 }
2650 
2651 void
2654 }
2655 
2656 bool
2658  if (m_range) return (m_range->verify());
2659  return (true);
2660 }
2661 
2662 Range
2664  Range result;
2665  if (m_range) result = m_range->build_range();
2666  return (result);
2667 }
2668 
2669 
2670 
2671 
2676  :
2677  m_subregion(0),
2678  m_resolved_references(false)
2679  //m_generated_implementation(false)
2680 {
2681 }
2682 
2684 {
2685 }
2686 
2689  IdDictRegion& /*region*/)
2690 {
2691  if(!m_resolved_references) {
2692  m_subregion = dictionary.find_subregion (m_subregion_name);
2693  m_resolved_references = true;
2694  }
2695 }
2696 
2699  IdDictRegion& region,
2700  const std::string& tag)
2701 {
2702 
2703  if (Debugger::debug ())
2704  {
2705  std::cout << "IdDictReference::generate_implementation>" << std::endl;
2706  }
2707 
2708  if (m_subregion != 0) m_subregion->generate_implementation (idd, dictionary, region, tag);
2709 }
2710 
2712 {
2714 }
2715 
2717 {
2718  return (true);
2719 }
2720 
2722 {
2723  Range result;
2724 
2726 
2727 
2728  return (result);
2729 }
2730 
2731 
2732 
2733 
2734 
2735 
2740  :
2741  m_dictionary (0),
2742  m_resolved_references(false),
2743  m_generated_implementation(false),
2744  m_propagated_information(false)
2745 {
2746 }
2747 
2749 {
2750 }
2751 
2754  IdDictRegion& /*region*/)
2755 {
2756  if(!m_resolved_references) {
2758  if(m_dictionary) {
2761  }
2762  m_resolved_references = true;
2763  }
2764 }
2765 
2768  IdDictRegion& region,
2769  const std::string& tag)
2770 {
2772  if(m_dictionary) {
2773  if (!m_propagated_information) {
2774 
2775  // Propagate information to referenced dictionary:
2776  //
2777  // 1) Loop over ranges in this region and add them to the
2778  // referenced dictionary, then propagate the generate
2779  // implementation
2780 
2781  // 2) Duplicate the regions of the current dictionary in
2782  // referenced dictionary. Only the top level range(s) need
2783  // to be propagated to correctly calculate the bits of the
2784  // upper levels.
2785 
2786  // Save a vector of entries to prepend, inverting their order
2787  std::vector<IdDictRegionEntry*> prepend_entries;
2789  for (it = region.m_entries.begin (); it != region.m_entries.end (); ++it) {
2790  IdDictRegionEntry* entry = *it;
2791  if(this == entry) break; // end when we get to the dictionary (this)
2792  // If this is a range entry, add a duplicate to all
2793  // regions in the subdictionary
2794  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
2795  if(range) {
2796  prepend_entries.insert(prepend_entries.begin(), entry);
2797  }
2798  }
2799 
2800 
2801 
2802 
2803  // Now prepend list to each region and generate each region
2805  for (it2 = m_dictionary->m_all_regions.begin (); it2 != m_dictionary->m_all_regions.end (); ++it2) {
2806  IdDictRegion& region2 = *(*it2);
2807  for (it = prepend_entries.begin(); it != prepend_entries.end(); ++it) {
2808  IdDictRegionEntry* entry = *it;
2809  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
2810  if(range) {
2811  IdDictRangeRef* new_range = new IdDictRangeRef;
2812  new_range->m_range = range;
2813  region2.m_entries.insert(region2.m_entries.begin(), new_range);
2814  }
2815  }
2816  }
2817 
2818  // Now copy all prefixes into new regions in the
2819  // referenced dictionary
2820  if (prepend_entries.size() > 0) {
2821 
2822  // Save region number
2823  const IdDictRegion& region2 = *m_dictionary->m_all_regions.back();
2824  size_t region_number = region2.m_index + 1;
2825 
2827 
2828  // Loop over all regions of current dict, add to ref dict (m_dictionary)
2829  for (it = dictionary.m_all_regions.begin (); it != dictionary.m_all_regions.end (); ++it, ++region_number) {
2830  IdDictRegion& region3 = *(*it);
2831  IdDictRegion* new_region = new IdDictRegion;
2832  new_region->m_name = "dummy";
2833  new_region->m_group = "dummy";
2834  new_region->m_index = region_number;
2835 
2836  // to all region vectors
2837  m_dictionary->m_all_regions.push_back(new_region);
2838  // to the entries of the dictionary
2839  m_dictionary->add_dictentry(new_region);
2840 
2841  // Now add in only the ranges
2843  size_t i = 0;
2844  for (it = region3.m_entries.begin (); it != region3.m_entries.end (); ++it, ++i) {
2845  if (i >= prepend_entries.size()) continue;
2846 
2847  IdDictRegionEntry* entry = *it;
2848  IdDictRange* range = dynamic_cast<IdDictRange*> (entry);
2849  if(range) {
2850  IdDictRangeRef* new_range = new IdDictRangeRef;
2851  new_range->m_range = range;
2852  new_region->m_entries.push_back(new_range);
2853  }
2854  }
2855  }
2856  }
2857  m_propagated_information = true;
2858  }
2861  }
2862  else {
2863  std::cout << "IdDictDictionaryRef::generate_implementation: - WARNING no dictionary found, cannot generate implementation "
2864  << std::endl;
2865  }
2866  }
2867 }
2868 
2870 {
2874  }
2875 }
2876 
2878 {
2879  return (true);
2880 }
2881 
2883  Range result;
2884  return (result);
2885 }
2886 
2887 
2888 
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
IdDictDictionary::find_region
IdDictRegion * find_region(const std::string &region_name) const
Definition: IdDictMgr.cxx:368
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
Debugger
Definition: IdDictMgr.cxx:19
IdDictField::m_index
size_t m_index
Definition: IdDictDefs.h:331
beamspotman.r
def r
Definition: beamspotman.py:676
IdDictMgr::dictionary_map
std::map< std::string, IdDictDictionary * > dictionary_map
Definition: IdDictDefs.h:34
IdDictSubRegion::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictMgr.cxx:2444
IdDictRangeRef
Definition: IdDictDefs.h:575
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
IdDictDictEntry::~IdDictDictEntry
virtual ~IdDictDictEntry()
Definition: IdDictMgr.cxx:2178
IdDictRegion::m_next_samp
std::vector< IdDictRegion * > m_next_samp
Definition: IdDictDefs.h:473
IdDictDictionary::build_multirange
MultiRange build_multirange() const
Get MultiRange for full dictionary.
Definition: IdDictMgr.cxx:923
IdDictGroup::m_name
std::string m_name
Definition: IdDictDefs.h:371
IdDictMgr::resolve_references
void resolve_references()
Construct dictionary after parsing.
Definition: IdDictMgr.cxx:206
IdDictMgr::verify
bool verify() const
Definition: IdDictMgr.cxx:265
IdDictAltRegions::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary)
Definition: IdDictMgr.cxx:2221
Debugger::get_debug_state
static bool get_debug_state()
Definition: IdDictMgr.cxx:21
IdDictDictionary::unpack
int unpack(const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will incl...
Definition: IdDictMgr.cxx:1363
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
IdDictField::get_label
const std::string & get_label(size_t index) const
Definition: IdDictMgr.cxx:1931
IdDictRegion::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary)
Definition: IdDictMgr.cxx:2309
IdDictDictionary::reset
int reset(size_t index1, size_t index2, size_t region_index, Identifier &packedId) const
Reset fields from index1 to index2.
Definition: IdDictMgr.cxx:1294
get_generator_info.result
result
Definition: get_generator_info.py:21
IdDictGroup
Definition: IdDictDefs.h:341
IdDictDictionary::do_neighbours
bool do_neighbours(void) const
Neighbour initialization is performed by default One can switch or query this mode for any idHelper w...
Definition: IdDictMgr.cxx:1879
IdDictMgr::m_metadata
metadata_map m_metadata
Definition: IdDictDefs.h:88
IdDictDictionary::generate_implementation
void generate_implementation(const IdDictMgr &idd, const std::string &tag="")
Definition: IdDictMgr.cxx:680
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
IdDictField::add_label
void add_label(IdDictLabel *label)
Definition: IdDictMgr.cxx:1921
IdDictRange::by_minmax
@ by_minmax
Definition: IdDictDefs.h:546
IdDictLabel::m_value
int m_value
Definition: IdDictDefs.h:337
IdDictDictionary::m_groups
std::vector< IdDictGroup * > m_groups
Definition: IdDictDefs.h:304
IdDictReference::~IdDictReference
~IdDictReference()
Definition: IdDictMgr.cxx:2683
IdDictDictionary::do_checks
bool do_checks(void) const
Checks are performed by default in debug compilation and NOT in optimized compilation.
Definition: IdDictMgr.cxx:1867
IdentifierField::overlaps_with
bool overlaps_with(const IdentifierField &other) const
Check whether two IdentifierFields overlap.
Definition: IdentifierField.cxx:193
index
Definition: index.py:1
hist_file_dump.d
d
Definition: hist_file_dump.py:137
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
IdDictRangeRef::verify
bool verify() const
Definition: IdDictMgr.cxx:2657
IdDictGroup::sort
void sort()
Sort:
Definition: IdDictMgr.cxx:2119
IdDictAltRegions::m_selected_region
IdDictRegion * m_selected_region
Definition: IdDictDefs.h:427
IdDictRange::by_label
@ by_label
Definition: IdDictDefs.h:544
IdDictDictionary::find_label
IdDictLabel * find_label(const std::string &field, const std::string &label) const
Definition: IdDictMgr.cxx:333
IdDictGroup::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDefs.h:373
IdDictDictionaryRef::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2882
Identifier::mask_shift
value_type mask_shift(value_type mask, size_type shift) const
extract field(s) by masking first, then shifting
IdDictReference::m_resolved_references
bool m_resolved_references
Definition: IdDictDefs.h:618
IdDictMgr::set_do_checks
void set_do_checks(bool do_checks)
Definition: IdDictMgr.cxx:110
IdDictField::clear
void clear()
Definition: IdDictMgr.cxx:1955
IdDictRange::m_field_name
std::string m_field_name
Definition: IdDictDefs.h:537
IdDictRegion::m_prev_abs_eta
IdDictRegion * m_prev_abs_eta
Definition: IdDictDefs.h:470
IdDictDictionaryRef::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region)
Definition: IdDictMgr.cxx:2752
IdDictGroup::verify
bool verify() const
Definition: IdDictMgr.cxx:2104
IdDictDictionary::groups_const_it
groups_type::const_iterator groups_const_it
Definition: IdDictDefs.h:298
IdDictRegion::find_neighbours
void find_neighbours(const IdDictDictionary &dictionary)
Definition: IdDictMgr.cxx:2336
IdDictRangeRef::m_range
IdDictRange * m_range
Definition: IdDictDefs.h:592
ExpandedIdentifier::add
void add(element_type value)
Append a value into a new field.
skel.it
it
Definition: skel.GENtoEVGEN.py:396
IdDictRange::by_labels
@ by_labels
Definition: IdDictDefs.h:545
RangeIterator
This iterator is able to generate all possible identifiers, from a fully bounded Range.
Definition: RangeIterator.h:19
IdDictDictionary::regions_type
std::vector< IdDictRegion * > regions_type
Definition: IdDictDefs.h:292
IdDictMgr::get_dictionary_map
const dictionary_map & get_dictionary_map() const
Access to all dictionaries.
Definition: IdDictMgr.cxx:158
ExpandedIdentifier
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:102
IdDictReference::m_subregion
IdDictSubRegion * m_subregion
Definition: IdDictDefs.h:615
IdDictDictionary::m_do_checks
bool m_do_checks
Definition: IdDictDefs.h:312
IdDictDictionaryRef::~IdDictDictionaryRef
~IdDictDictionaryRef()
Definition: IdDictMgr.cxx:2748
IdDictField::find_label
IdDictLabel * find_label(const std::string &name) const
Definition: IdDictMgr.cxx:1909
IdDictField::generate_implementation
void generate_implementation(const IdDictMgr &idd, const std::string &tag="")
Definition: IdDictMgr.cxx:1895
athena.value
value
Definition: athena.py:124
ExpandedIdentifier::fields
size_type fields() const
IdDictMgr::find_metadata
const std::string & find_metadata(const std::string &name) const
Access to meta data, name/value pairs.
Definition: IdDictMgr.cxx:135
IdDictReference::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region, const std::string &tag="")
Definition: IdDictMgr.cxx:2697
IdDictAltRegions::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictMgr.cxx:2234
IdDictMgr::m_dictionaries
dictionary_map m_dictionaries
Definition: IdDictDefs.h:87
IdDictDictionary::~IdDictDictionary
~IdDictDictionary()
Definition: IdDictMgr.cxx:307
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
IdDictDictEntry::clear
virtual void clear()=0
IdDictAltRegions::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2260
IdDictReference::verify
bool verify() const
Definition: IdDictMgr.cxx:2716
IdDictRange::m_specification
specification_type m_specification
Definition: IdDictDefs.h:557
IdDictRegion::m_prev_samp
std::vector< IdDictRegion * > m_prev_samp
Definition: IdDictDefs.h:472
IdDictRegion::clear
void clear()
Definition: IdDictMgr.cxx:2409
IdDictReference::IdDictReference
IdDictReference()
Definition: IdDictMgr.cxx:2675
IdDictRangeRef::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region)
Definition: IdDictMgr.cxx:2637
IdDictDictEntry
Definition: IdDictDefs.h:378
IdDictRegion::verify
bool verify() const
Definition: IdDictMgr.cxx:2404
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
IdDictAltRegions
Definition: IdDictDefs.h:402
IdDictRegion::m_prev_subdet
std::vector< IdDictRegion * > m_prev_subdet
Definition: IdDictDefs.h:474
IdDictDictionary::pack32
int pack32(const ExpandedIdentifier &id, size_t index1, size_t index2, Identifier &packedId) const
Pack to 32bits the subset of id between (inclusive) index1 and index2 - this is generic,...
Definition: IdDictMgr.cxx:1109
IdDictMgr::m_DTD_version
std::string m_DTD_version
Definition: IdDictDefs.h:85
TypeIdBuilder
Definition: IdDictMgr.cxx:52
IdDictDictionary::find_field
IdDictField * find_field(const std::string &name) const
Definition: IdDictMgr.cxx:311
IdDictSubRegion::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2477
CalibDbCompareRT.region_id
region_id
Definition: CalibDbCompareRT.py:68
IdDictRegion
Definition: IdDictDefs.h:433
IdDictGroup::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictMgr.cxx:2049
IdDictRegion::m_next_subdet
std::vector< IdDictRegion * > m_next_subdet
Definition: IdDictDefs.h:475
IdDictDictionary::resolve_references
void resolve_references(const IdDictMgr &idd)
Definition: IdDictMgr.cxx:423
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
IdDictRegion::m_name
std::string m_name
Definition: IdDictDefs.h:461
IdDictDictionary::verify
bool verify() const
Here, we verify global constraints : (this must only be applied after the resolve_references and ge...
Definition: IdDictMgr.cxx:840
RangeIterator::begin
RangeIterator begin() const
Definition: RangeIterator.cxx:12
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
IdDictDictionaryRef::m_dictionary_name
std::string m_dictionary_name
Definition: IdDictDefs.h:639
IdDictRange::m_field
IdDictField * m_field
Definition: IdDictDefs.h:538
IdDictRange::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region, const std::string &tag="")
Definition: IdDictMgr.cxx:2533
IdDictRange::has_previous
@ has_previous
Definition: IdDictDefs.h:552
IdDictLabel::m_valued
bool m_valued
Definition: IdDictDefs.h:336
IdDictDefs.h
IdDictDictionary::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:731
IdDictGroup::m_entries
std::vector< IdDictDictEntry * > m_entries
Definition: IdDictDefs.h:372
IdDictDictionary::m_parent_dict
IdDictDictionary * m_parent_dict
Definition: IdDictDefs.h:306
IdDictMgr::IdDictMgr
IdDictMgr()
Definition: IdDictMgr.cxx:80
IdDictGroup::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary, size_t &index)
Definition: IdDictMgr.cxx:2035
IdDictDictionary::size_type
Identifier::size_type size_type
Definition: IdDictDefs.h:100
IdDictMgr
Definition: IdDictDefs.h:32
IdDictDictionary::groups_it
groups_type::iterator groups_it
Definition: IdDictDefs.h:297
IdDictRegion::m_next_abs_eta
IdDictRegion * m_next_abs_eta
Definition: IdDictDefs.h:471
TypeIdBuilder::build_id
static int build_id()
Definition: IdDictMgr.cxx:69
IdDictMgr::set_do_neighbours
void set_do_neighbours(bool do_neighbours)
Definition: IdDictMgr.cxx:125
IdDictDictionary::m_fields
std::map< std::string, IdDictField * > m_fields
Definition: IdDictDefs.h:300
beamspotnt.labels
list labels
Definition: bin/beamspotnt.py:1447
IdDictDictionary::IdDictDictionary
IdDictDictionary()
Definition: IdDictMgr.cxx:298
IdDictDictionary::find_group
IdDictGroup * find_group(const std::string &group_name) const
Definition: IdDictMgr.cxx:385
IdDictAltRegions::IdDictAltRegions
IdDictAltRegions()
Definition: IdDictMgr.cxx:2185
IdDictMgr::find_dictionary
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
Definition: IdDictMgr.cxx:163
IdDictRegion::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2420
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
IdDictRegion::m_index
size_t m_index
Definition: IdDictDefs.h:460
IdDictMgr::add_subdictionary_name
void add_subdictionary_name(const std::string &name)
Definition: IdDictMgr.cxx:200
IdDictRegion::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2384
Trk::index1
@ index1
Definition: BoundarySurfaceFace.h:48
IdDictRange::m_maxvalue
int m_maxvalue
Definition: IdDictDefs.h:563
IdDictField::m_name
std::string m_name
Definition: IdDictDefs.h:329
lumiFormat.i
int i
Definition: lumiFormat.py:85
IdDictRange::has_both
@ has_both
Definition: IdDictDefs.h:553
IdDictGroup::IdDictGroup
IdDictGroup()
Definition: IdDictMgr.cxx:1967
IdDictRange::m_prev_value
int m_prev_value
Definition: IdDictDefs.h:564
IdDictField::get_label_number
size_t get_label_number() const
Definition: IdDictMgr.cxx:1926
IdDictAltRegions::group_name
std::string group_name() const
Definition: IdDictMgr.cxx:2201
DetDescrDictionaryDict::it1
std::vector< HWIdentifier >::iterator it1
Definition: DetDescrDictionaryDict.h:17
IdDictAltRegions::map_iterator
map_type::iterator map_iterator
Definition: IdDictDefs.h:424
IdDictField::verify
bool verify() const
Definition: IdDictMgr.cxx:1904
IdDictDictionary::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:311
IdDictRegion::m_is_empty
bool m_is_empty
Definition: IdDictDefs.h:464
IdDictGroup::build_multirange
MultiRange build_multirange() const
Get MultiRange for this group.
Definition: IdDictMgr.cxx:2003
IdDictDictEntry::IdDictDictEntry
IdDictDictEntry()
Definition: IdDictMgr.cxx:2174
IdDictRegion::add_entry
void add_entry(IdDictRegionEntry *entry)
Definition: IdDictMgr.cxx:2304
IdDictDictionary::m_regions
std::vector< IdDictRegion * > m_regions
Definition: IdDictDefs.h:302
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
IdDictGroup::clear
void clear()
Definition: IdDictMgr.cxx:2156
IdDictGroup::add_dictentry
void add_dictentry(IdDictDictEntry *entry)
Definition: IdDictMgr.cxx:2029
mc.group_name
group_name
Definition: mc.PhPy8EG_A14NNPDF23_NNLOPS_example.py:33
IdDictRegion::group_name
std::string group_name() const
Definition: IdDictMgr.cxx:2294
IdDictRange::unknown
@ unknown
Definition: IdDictDefs.h:541
IdDictRange::m_value
int m_value
Definition: IdDictDefs.h:561
IdDictDictionaryRef::m_propagated_information
bool m_propagated_information
Definition: IdDictDefs.h:647
IdDictDictionary::add_subdictionary_name
void add_subdictionary_name(const std::string &name)
Definition: IdDictMgr.cxx:405
IdDictDictionary::regions_it
regions_type::iterator regions_it
Definition: IdDictDefs.h:293
IdDictLabel
Definition: IdDictDefs.h:334
hist_file_dump.f
f
Definition: hist_file_dump.py:135
IdDictMgr::m_resolved_references
bool m_resolved_references
Definition: IdDictDefs.h:90
Debugger::debug
static bool debug()
Definition: IdDictMgr.cxx:28
IdDictRegion::m_next_abs_eta_name
std::string m_next_abs_eta_name
Definition: IdDictDefs.h:465
IdDictGroup::regions
const std::vector< IdDictRegion * > & regions()
Definition: IdDictMgr.cxx:1996
IdDictMgr::do_neighbours
bool do_neighbours() const
Check whether or not to init neighbours.
Definition: IdDictMgr.cxx:119
IdDictMgr::m_do_checks
bool m_do_checks
Definition: IdDictDefs.h:92
IdDictRegion::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, const std::string &tag="")
Definition: IdDictMgr.cxx:2318
MuonValidation_CreateResolutionProfiles.fit
def fit(h, emin, emax)
Definition: MuonValidation_CreateResolutionProfiles.py:69
IdDictField::get_label_value
ExpandedIdentifier::element_type get_label_value(const std::string &name) const
Definition: IdDictMgr.cxx:1936
IdentifierField::element_vector
std::vector< element_type > element_vector
Definition: IdentifierField.h:25
Identifier::ALL_BITS
@ ALL_BITS
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:34
IdDictRegion::m_entries
std::vector< IdDictRegionEntry * > m_entries
Definition: IdDictDefs.h:458
IdDictDictionary::regions_const_it
regions_type::const_iterator regions_const_it
Definition: IdDictDefs.h:294
IdDictMgr::reset_implementation
void reset_implementation()
Reset of implementation.
Definition: IdDictMgr.cxx:245
IdDictField::m_labels
std::vector< IdDictLabel * > m_labels
Definition: IdDictDefs.h:330
IdDictDictionary::get_label_value
int get_label_value(const std::string &field, const std::string &label, int &value) const
Definition: IdDictMgr.cxx:340
IdDictMgr::add_dictionary
void add_dictionary(IdDictDictionary *dictionary)
Fillers:
Definition: IdDictMgr.cxx:174
python.update_ci_reference_files.mr
mr
Definition: update_ci_reference_files.py:415
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
grepfile.sep
sep
Definition: grepfile.py:38
IdDictRegion::m_group
std::string m_group
Definition: IdDictDefs.h:462
IdDictMgr::~IdDictMgr
~IdDictMgr()
Definition: IdDictMgr.cxx:89
IdDictRegion::m_prev_samp_names
std::vector< std::string > m_prev_samp_names
Definition: IdDictDefs.h:466
IdDictDictionary::sort
void sort()
Sort:
Definition: IdDictMgr.cxx:861
MultiRange
A MultiRange combines several Ranges.
Definition: MultiRange.h:17
master.dictionary
dictionary
Definition: master.py:47
Trk::index2
@ index2
Definition: BoundarySurfaceFace.h:49
IdDictSubRegion::~IdDictSubRegion
~IdDictSubRegion()
Definition: IdDictMgr.cxx:2439
IdDictAltRegions::m_regions
map_type m_regions
Definition: IdDictDefs.h:426
IdDictAltRegions::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2285
IdDictDictionary::clear
void clear()
Definition: IdDictMgr.cxx:881
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
IdDictAltRegions::clear
void clear()
Definition: IdDictMgr.cxx:2273
IdDictRegionEntry::verify
virtual bool verify() const
Definition: IdDictDefs.h:518
IdDictDictionary::entries_it
entries_type::iterator entries_it
Definition: IdDictDefs.h:289
IdDictDictionary::add_field
void add_field(IdDictField *field)
Definition: IdDictMgr.cxx:348
Identifier::NBITS
@ NBITS
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
RangeIterator.h
IdDictRange::m_labels
std::vector< std::string > m_labels
Definition: IdDictDefs.h:567
IdDictDictionary::m_do_neighbours
bool m_do_neighbours
Definition: IdDictDefs.h:313
IdDictRange::has_next
@ has_next
Definition: IdDictDefs.h:551
IdDictRangeRef::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2663
IdDictDictEntry::group_name
virtual std::string group_name() const =0
IdDictDictionaryRef::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2869
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: IdDictMgr.cxx:2299
IdDictRegion::m_next_samp_names
std::vector< std::string > m_next_samp_names
Definition: IdDictDefs.h:467
IdDictRange::m_continuation_mode
continuation_mode m_continuation_mode
Definition: IdDictDefs.h:566
IdDictDictionary
Definition: IdDictDefs.h:97
Range::add
void add()
Add a wild card field.
Definition: DetectorDescription/Identifier/src/Range.cxx:75
IdDictSubRegion::IdDictSubRegion
IdDictSubRegion()
Definition: IdDictMgr.cxx:2435
IdDictRegionEntry
Definition: IdDictDefs.h:507
IdDictDictionary::find_subregion
IdDictSubRegion * find_subregion(const std::string &subregion_name) const
Definition: IdDictMgr.cxx:357
IdDictRange
Definition: IdDictDefs.h:523
RangeIterator::end
RangeIterator end() const
Definition: RangeIterator.cxx:24
python.PyAthena.v
v
Definition: PyAthena.py:154
IdDictRegion::m_prev_subdet_names
std::vector< std::string > m_prev_subdet_names
Definition: IdDictDefs.h:468
impl
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:46
IdDictRegion::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:484
IdDictGroup::name
const std::string & name()
Definition: IdDictMgr.cxx:1984
DeMoScan.index
string index
Definition: DeMoScan.py:364
__attribute__
__attribute__((always_inline)) inline uint16_t TileCalibDrawerBase
Definition: TileCalibDrawerBase.h:190
IdDictGroup::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2089
IdDictDictionary::m_subdictionary_names
std::vector< std::string > m_subdictionary_names
Definition: IdDictDefs.h:305
IdDictRange::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2596
IdDictField::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:1900
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28
IdDictReference::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2711
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
IdDictDictionaryRef::verify
bool verify() const
Definition: IdDictMgr.cxx:2877
IdDictDictionary::m_subregions
std::map< std::string, IdDictSubRegion * > m_subregions
Definition: IdDictDefs.h:301
IdDictGroup::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:374
IdDictDictionary::add_dictentry
void add_dictentry(IdDictDictEntry *entry)
Definition: IdDictMgr.cxx:412
IdDictRegionEntry::reset_implementation
virtual void reset_implementation()
Definition: IdDictDefs.h:517
MultiRange::size
size_type size() const
Definition: MultiRange.cxx:70
DeMoScan.first
bool first
Definition: DeMoScan.py:536
IdDictReference::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region)
Definition: IdDictMgr.cxx:2687
IdDictRange::m_resolved_references
bool m_resolved_references
Definition: IdDictDefs.h:571
IdDictDictionaryRef::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region, const std::string &tag="")
Definition: IdDictMgr.cxx:2766
IdentifierField
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
Definition: IdentifierField.h:21
IdDictMgr::m_do_neighbours
bool m_do_neighbours
Definition: IdDictDefs.h:93
IdDictRange::by_values
@ by_values
Definition: IdDictDefs.h:543
IdDictMgr::set_DTD_version
void set_DTD_version(const std::string &DTD_version)
Definition: IdDictMgr.cxx:152
ExpandedIdentifier::clear
void clear()
Erase all fields.
IdDictMgr::clear
void clear()
Definition: IdDictMgr.cxx:278
TypeId
Definition: IdDictMgr.cxx:60
IdDictMgr::do_checks
bool do_checks() const
Check whether or not to do checks for ids.
Definition: IdDictMgr.cxx:104
IdDictAltRegions::set_index
void set_index(size_t index)
Definition: IdDictMgr.cxx:2210
IdDictRangeRef::generate_implementation
void generate_implementation(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region, const std::string &tag="")
Definition: IdDictMgr.cxx:2644
IdDictMgr::DTD_version
const std::string & DTD_version() const
DTD version.
Definition: IdDictMgr.cxx:99
Identifier::value_type
unsigned long long value_type
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:27
isNumber
bool isNumber(const std::string &s)
Definition: PoolSvc.cxx:52
IdDictDictionaryRef::m_dictionary
IdDictDictionary * m_dictionary
Definition: IdDictDefs.h:640
IdDictGroup::entries
const std::vector< IdDictDictEntry * > & entries()
Definition: IdDictMgr.cxx:1990
str
Definition: BTagTrackIpAccessor.cxx:11
IdDictDictionaryRef::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:646
IdDictRange::m_label
std::string m_label
Definition: IdDictDefs.h:560
IdDictSubRegion
Definition: IdDictDefs.h:488
IdDictRange::by_value
@ by_value
Definition: IdDictDefs.h:542
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IdDictDictionaryRef::m_resolved_references
bool m_resolved_references
Definition: IdDictDefs.h:645
IdDictDictionary::set_do_neighbours
void set_do_neighbours(bool do_neighbours)
Definition: IdDictMgr.cxx:1885
CaloCondBlobAlgs_fillNoiseFromASCII.fields
fields
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:106
IdDictDictionaryRef::IdDictDictionaryRef
IdDictDictionaryRef()
Definition: IdDictMgr.cxx:2739
IdDictField
Definition: IdDictDefs.h:316
IdDictRange::wrap_around
@ wrap_around
Definition: IdDictDefs.h:554
IdDictFieldImplementation
IdDictFieldImplementation is used to capture the specification of a single field of an Identifier.
Definition: IdDictFieldImplementation.h:58
IdDictGroup::~IdDictGroup
virtual ~IdDictGroup()
Definition: IdDictMgr.cxx:1980
IdDictRange::resolve_references
void resolve_references(const IdDictMgr &idd, IdDictDictionary &dictionary, IdDictRegion &region)
Definition: IdDictMgr.cxx:2486
IdDictDictionary::integrate_bits
void integrate_bits()
Set up integral of bits for efficient unpacking.
Definition: IdDictMgr.cxx:794
ExpandedIdentifier::element_type
int element_type
Definition: DetectorDescription/Identifier/Identifier/ExpandedIdentifier.h:106
IdDictAltRegions::~IdDictAltRegions
~IdDictAltRegions()
Definition: IdDictMgr.cxx:2191
IdDictMgr::tag
const std::string & tag() const
Version tag.
Definition: IdDictMgr.cxx:94
IdDictRegion::m_implementation
std::vector< IdDictFieldImplementation > m_implementation
Definition: IdDictDefs.h:459
IdDictAltRegions::verify
bool verify() const
Definition: IdDictMgr.cxx:2267
IdDictRangeRef::reset_implementation
void reset_implementation()
Definition: IdDictMgr.cxx:2652
IdDictReference::m_subregion_name
std::string m_subregion_name
Definition: IdDictDefs.h:614
IdDictMgr::m_generated_implementation
bool m_generated_implementation
Definition: IdDictDefs.h:91
IdDictDictionary::copy
int copy(const Identifier &idin, size_t first_field_index, size_t begin_field_index, size_t end_field_index, size_t region_index, Identifier &idout) const
Copy a number of fields of the value_type id into another value_type id.
Definition: IdDictMgr.cxx:1778
IdDictDictionary::add_subregion
void add_subregion(IdDictSubRegion *subregion)
Definition: IdDictMgr.cxx:396
RV
std::vector< IdDictRegion * > RV
Definition: IdDictMgr.cxx:454
IdDictField::resolve_references
void resolve_references(const IdDictMgr &idd)
Definition: IdDictMgr.cxx:1891
IdDictRange::m_minvalue
int m_minvalue
Definition: IdDictDefs.h:562
fitman.k
k
Definition: fitman.py:528
IdDictMgr::m_subdictionary_names
std::set< std::string > m_subdictionary_names
Definition: IdDictDefs.h:89
IdDictMgr::m_tag
std::string m_tag
Definition: IdDictDefs.h:86
IdDictReference::build_range
Range build_range() const
Definition: IdDictMgr.cxx:2721
IdDictDictionary::m_all_regions
std::vector< IdDictRegion * > m_all_regions
Definition: IdDictDefs.h:303
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4
IdDictRange::m_next_value
int m_next_value
Definition: IdDictDefs.h:565
IdDictMgr::add_metadata
void add_metadata(const std::string &name, const std::string &value)
Definition: IdDictMgr.cxx:144
IdDictMgr::generate_implementation
void generate_implementation(const std::string &tag="")
Definition: IdDictMgr.cxx:219
IdDictRegion::m_next_subdet_names
std::vector< std::string > m_next_subdet_names
Definition: IdDictDefs.h:469
IdDictRange::m_values
std::vector< int > m_values
Definition: IdDictDefs.h:568
Identifier
Definition: IdentifierFieldParser.cxx:14
IdDictDictionary::set_do_checks
void set_do_checks(bool do_checks)
Definition: IdDictMgr.cxx:1873