ATLAS Offline Software
IdDictParser.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // $Header: /build/atlas/cvs/atlas/offline/DetectorDescription/IdDictParser/src/IdDictParser.cxx,v 1.13 2008-12-09 09:55:22 dquarrie Exp $
6 
8 
9 #include <cstdlib>
10 #include <iostream>
11 
12 namespace IdDictParserNS
13 {
14 
15  class Debugger
16  {
17  public:
18  static bool get_debug_state()
19  {
20  return ::getenv ("XMLDEBUG") != 0;
21  }
22  static bool debug ()
23  {
24  static const bool debug_state = get_debug_state();
25  return debug_state;
26  }
27 
28  static void tab (int n)
29  {
30  for (int i = 0; i < n; ++i)
31  {
32  std::cout << " ";
33  }
34  }
35  };
36 
38  {
39  public:
40  void do_start (XMLCoreParser& parser, const XMLCoreNode& node);
41  void do_end (XMLCoreParser& parser, const XMLCoreNode& node);
42 
43  virtual void idd_start (IdDictParser& parser, const XMLCoreNode& node);
44  virtual void idd_end (IdDictParser& parser, const XMLCoreNode& node);
45  };
46 
48  {
49  public:
50  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
51  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
52  };
53 
55  {
56  public:
57  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
58  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
59  };
60 
62  {
63  public:
64  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
65  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
66  };
67 
69  {
70  public:
71  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
72  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
73  };
74 
76  {
77  public:
78  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
79  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
80  };
81 
83  {
84  public:
85  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
86  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
87  };
88 
90  {
91  public:
92  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
93  void idd_end (IdDictParser& parser, const XMLCoreNode& node);
94  };
95 
97  {
98  public:
99  virtual void idd_start (IdDictParser& parser, const XMLCoreNode& node);
100  virtual void idd_end (IdDictParser& parser, const XMLCoreNode& node);
101  };
102 
104  {
105  public:
106  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
107  };
108 
110  {
111  public:
112  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
113  };
114 
116  {
117  public:
118  void idd_start (IdDictParser& parser, const XMLCoreNode& node);
119  };
120 }
121 
122 using namespace IdDictParserNS;
123 
125 {
126  register_factory ("IdDict", std::make_unique<IdDictMgrFactory>());
127  register_factory ("IdDictionary", std::make_unique<DictionaryFactory>());
128  register_factory ("field", std::make_unique<FieldFactory>());
129  register_factory ("label", std::make_unique<LabelFactory>());
130  register_factory ("alternate_regions", std::make_unique<AltRegionsFactory>());
131  register_factory ("region", std::make_unique<RegionFactory>());
132  register_factory ("subregion", std::make_unique<SubRegionFactory>());
133  register_factory ("range", std::make_unique<RangeFactory>());
134  register_factory ("reference", std::make_unique<ReferenceFactory>());
135  register_factory ("dictionary", std::make_unique<DictionaryRefFactory>());
136 
137  m_dictionary = 0;
138  m_field = 0;
139  m_region = 0;
140  m_subregion = 0;
141  m_altregions = 0;
142  m_regionentry = 0;
143 }
144 
145 IdDictMgr& IdDictParser::parse (const std::string& file_name, const std::string& tag)
146 {
147  m_idd.clear ();
148 
150 
151  if (Debugger::debug ())
152  {
153  std::cout << "IdDictParser::parse1>" << std::endl;
154  }
155 
157 
158  if (Debugger::debug ())
159  {
160  std::cout << "IdDictParser::parse2>" << std::endl;
161  }
162 
164 
165  if (Debugger::debug ())
166  {
167  std::cout << "IdDictParser::parse3>" << std::endl;
168  }
169 
170  return (m_idd);
171 }
172 
173 void IdDictBaseFactory::do_start (XMLCoreParser& parser,
174  const XMLCoreNode& node)
175 {
176  parser.up ();
178 }
179 
181 {
183  parser.down ();
184 }
185 
187  const XMLCoreNode& /*node*/)
188 {
189 }
190 
192  const XMLCoreNode& /*node*/)
193 {
194 }
195 
196 
197 
198 
199 
200 
201 
202 
203 
205 {
206  if (Debugger::debug ())
207  {
208  Debugger::tab (parser.level());
209  std::cout << "IdDictMgrFactoryFactory::idd_start>" << std::endl;
210  }
211  parser.m_idd.set_DTD_version(get_value (node, "DTD_version"));
212 }
213 
215  const XMLCoreNode& /*node*/)
216 {
217  if (Debugger::debug ())
218  {
219  Debugger::tab (parser.level());
220  std::cout << "IdDictMgrFactoryFactory::idd_end>" << std::endl;
221  }
222 }
223 
225 {
226  if (Debugger::debug ())
227  {
228  Debugger::tab (parser.level());
229  std::cout << "DictionaryFactory::idd_start>" << std::endl;
230  }
231 
232  parser.m_dictionary = new IdDictDictionary;
233 
234  parser.m_dictionary->m_name = get_value (node, "name");
235  parser.m_dictionary->m_version = get_value (node, "version");
236  parser.m_dictionary->m_date = get_value (node, "date");
237  parser.m_dictionary->m_author = get_value (node, "author");
238 }
239 
241 {
242  if (Debugger::debug ())
243  {
244  Debugger::tab (parser.level());
245  std::cout << "DictionaryFactory::idd_end> d=" << parser.m_dictionary << std::endl;
246  }
247 
248  if (parser.m_dictionary != 0)
249  {
250  parser.m_idd.add_dictionary (parser.m_dictionary);
251 
252  parser.m_dictionary = 0;
253  }
254 }
255 
257 {
258  if (Debugger::debug ())
259  {
260  Debugger::tab (parser.level());
261  std::cout << "FieldFactory::idd_start>" << std::endl;
262  }
263 
264  IdDictField* field = new IdDictField;
265  parser.m_field = field;
266  field->m_name = get_value (node, "name");
267 
268 // std::cout << "FieldFactory::idd_start> name=" << field->m_name <<
269 // " has begin_fixed_bits=" << has_attribute (node, "begin_fixed_bits") << std::endl;
270 // if (has_attribute (node, "fixed_bits"))
271 // {
272 // field->m_begin_fixed_bits = get_value (node, "fixed_bits");
273 // std::cout << "FieldFactory::idd_start> name=" << field->m_name <<
274 // " begin_fixed_bits=" << field->m_begin_fixed_bits << std::endl;
275 // }
276 
277 }
278 
280 {
281  if (Debugger::debug ())
282  {
283  Debugger::tab (parser.level());
284  std::cout << "FieldFactory::idd_end>" << std::endl;
285  }
286 
287  if (parser.m_field != 0)
288  {
289  if (parser.m_dictionary != 0) parser.m_dictionary->add_field (parser.m_field);
290  else delete parser.m_field;
291 
292  parser.m_field = 0;
293  }
294 }
295 
297 {
298  if (Debugger::debug ())
299  {
300  Debugger::tab (parser.level());
301  std::cout << "LabelFactory::idd_start>" << std::endl;
302  }
303 
304  IdDictLabel* label = new IdDictLabel;
305  label->m_name = get_value (node, "name");
306  if (has_attribute (node, "value"))
307  {
308  label->m_valued = true;
309  label->m_value = get_int (node, "value");
310  }
311  else
312  {
313  label->m_valued = false;
314  label->m_value = 0;
315  }
316 
317  if (parser.m_field != 0) parser.m_field->add_label (label);
318  else delete label;
319 }
320 
322 {
323  if (Debugger::debug ())
324  {
325  Debugger::tab (parser.level());
326  std::cout << "LabelFactory::idd_end>" << std::endl;
327  }
328 }
329 
331 {
332  if (Debugger::debug ())
333  {
334  Debugger::tab (parser.level());
335  std::cout << "AltRegionsFactory::idd_start>" << std::endl;
336  }
337 
338  IdDictAltRegions* altregions = new IdDictAltRegions;
339 
340  if (Debugger::debug ())
341  {
342  Debugger::tab (parser.level());
343  std::cout << "AltRegionsFactory::idd_start> previous=" << parser.m_altregions
344  << " new=" << altregions
345  << std::endl;
346  }
347 
348  parser.m_altregions = altregions;
349 }
350 
352 {
353  if (Debugger::debug ())
354  {
355  Debugger::tab (parser.level());
356  std::cout << "AltRegionsFactory::idd_end>" << std::endl;
357  }
358 
359  if (parser.m_altregions != 0)
360  {
361 
362  // Set altregions to point to the default region
363  IdDictAltRegions::map_iterator region_it = parser.m_altregions->m_regions.find ("");
364 
365  if (region_it == parser.m_altregions->m_regions.end())
366  {
367  std::cout << "AltRegionsFactory::idd_end could not find default region. Keys in map " << std::endl;
368  IdDictAltRegions::map_iterator first = parser.m_altregions->m_regions.begin();
369  IdDictAltRegions::map_iterator last = parser.m_altregions->m_regions.end();
370  int i = 0;
371  for (; first != last; ++first, ++i)
372  {
373  std::cout << " i " << i << " key " << (*first).first;
374  }
375  std::cout << std::endl;
376  }
377  else
378  {
379  parser.m_altregions->m_selected_region = (*region_it).second;
380  }
381 
382  // add to dict
383  if (parser.m_dictionary != 0) parser.m_dictionary->add_dictentry (parser.m_altregions);
384  else delete parser.m_altregions;
385 
386  // reset pointer to altregions
387  parser.m_altregions = 0;
388  }
389 
390 }
391 
393 {
394  if (Debugger::debug ())
395  {
396  Debugger::tab (parser.level());
397  std::cout << "RegionFactory::idd_start>" << std::endl;
398  }
399 
400  parser.m_region = new IdDictRegion;
401  if (has_attribute (node, "name"))
402  {
403  parser.m_region->m_name = get_value (node, "name");
404  }
405 
406  // check for tag
407  if (has_attribute (node, "tag"))
408  {
409  parser.m_region->m_tag = get_value (node, "tag");
410 
411 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
412 // " tag=" << parser.m_region->m_tag << std::endl;
413  }
414 
415  // check for group name
416  if (has_attribute (node, "group"))
417  {
418  parser.m_region->m_group = get_value (node, "group");
419 
420 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
421 // " group name =" << parser.m_region->m_group << std::endl;
422  }
423 
424  // check for next region in absolute eta
425  if (has_attribute (node, "next_abs_eta"))
426  {
427  parser.m_region->m_next_abs_eta_name = get_value (node, "next_abs_eta");
428 
429 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
430 // " next_abs_eta name =" << parser.m_region->m_next_abs_eta << std::endl;
431  }
432 
433  // Look for regions in the previous sampling
434  if (has_attribute (node, "prev_samp")) {
435  std::string names = get_value (node, "prev_samp");
436 
437 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
438 // " next_abs_eta name =" << parser.m_region->m_next_abs_eta << std::endl;
439 
440  std::string::size_type pos = 0;
441 
442  for (;;) {
443  std::string::size_type next;
444 
445  next = names.find_first_not_of (" ", pos);
446  if (next == std::string::npos) break;
447  pos = next;
448  next = names.find_first_of (" ", pos);
449 
450  std::string name;
451  name = names.substr (pos, next - pos);
452  parser.m_region->m_prev_samp_names.push_back (name);
453 
454  if (next == std::string::npos) {
455  break;
456  }
457  else {
458  pos = next;
459  }
460  }
461  }
462 
463  // Look for regions in the next sampling
464  if (has_attribute (node, "next_samp")) {
465  std::string names = get_value (node, "next_samp");
466 
467 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
468 // " next_abs_eta name =" << parser.m_region->m_next_abs_eta << std::endl;
469 
470  std::string::size_type pos = 0;
471 
472  for (;;) {
473  std::string::size_type next;
474 
475  next = names.find_first_not_of (" ", pos);
476  if (next == std::string::npos) break;
477  pos = next;
478  next = names.find_first_of (" ", pos);
479 
480  std::string name;
481  name = names.substr (pos, next - pos);
482  parser.m_region->m_next_samp_names.push_back (name);
483 
484  if (next == std::string::npos) {
485  break;
486  }
487  else {
488  pos = next;
489  }
490  }
491  }
492 
493  // Look for regions in the prev subdet
494  if (has_attribute (node, "prev_subdet")) {
495  std::string names = get_value (node, "prev_subdet");
496 
497 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
498 // " prev_abs_eta name =" << parser.m_region->m_prev_abs_eta << std::endl;
499 
500  std::string::size_type pos = 0;
501 
502  for (;;) {
503  std::string::size_type prev;
504 
505  prev = names.find_first_not_of (" ", pos);
506  if (prev == std::string::npos) break;
507  pos = prev;
508  prev = names.find_first_of (" ", pos);
509 
510  std::string name;
511  name = names.substr (pos, prev - pos);
512  parser.m_region->m_prev_subdet_names.push_back (name);
513 
514  if (prev == std::string::npos) {
515  break;
516  }
517  else {
518  pos = prev;
519  }
520  }
521  }
522 
523  // Look for regions in the next subdet
524  if (has_attribute (node, "next_subdet")) {
525  std::string names = get_value (node, "next_subdet");
526 
527 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
528 // " next_abs_eta name =" << parser.m_region->m_next_abs_eta << std::endl;
529 
530  std::string::size_type pos = 0;
531 
532  for (;;) {
533  std::string::size_type next;
534 
535  next = names.find_first_not_of (" ", pos);
536  if (next == std::string::npos) break;
537  pos = next;
538  next = names.find_first_of (" ", pos);
539 
540  std::string name;
541  name = names.substr (pos, next - pos);
542  parser.m_region->m_next_subdet_names.push_back (name);
543 
544  if (next == std::string::npos) {
545  break;
546  }
547  else {
548  pos = next;
549  }
550  }
551  }
552 
553  // check for eta 0
554  if (has_attribute (node, "eta0"))
555  {
556  parser.m_region->m_eta0 = get_double (node, "eta0");
557 
558 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
559 // " next_abs_eta name =" << parser.m_region->m_next_abs_eta << std::endl;
560  }
561 
562  // check for deta
563  if (has_attribute (node, "deta"))
564  {
565  parser.m_region->m_deta = get_double (node, "deta");
566 
567 // std::cout << "RegionFactory::idd_start> name=" << parser.m_region->m_name <<
568 // " next_abs_eta name =" << parser.m_region->m_next_abs_eta << std::endl;
569  }
570 
571  // check for phi 0
572  if (has_attribute (node, "phi0"))
573  {
574  parser.m_region->m_phi0 = get_double (node, "phi0");
575  }
576 
577  // check for dphi
578  if (has_attribute (node, "dphi"))
579  {
580  parser.m_region->m_dphi = get_double (node, "dphi");
581  }
582 
583 
584  if (Debugger::debug ())
585  {
586  Debugger::tab (parser.level());
587  std::cout << "RegionFactory::idd_start> name, group, tag, next eta, prev/next samp, prev/next subdet "
588  << parser.m_region->m_name << " "
589  << parser.m_region->m_group << " "
590  << parser.m_region->m_tag << " "
591  << parser.m_region->m_next_abs_eta << " ";
592  for (unsigned int i = 0; i < parser.m_region->m_prev_samp_names.size(); ++i) {
593  std::cout << parser.m_region->m_prev_samp_names[i] << " ";
594  }
595  for (unsigned int i = 0; i < parser.m_region->m_next_samp_names.size(); ++i) {
596  std::cout << parser.m_region->m_next_samp_names[i] << " ";
597  }
598  for (unsigned int i = 0; i < parser.m_region->m_prev_subdet_names.size(); ++i) {
599  std::cout << parser.m_region->m_prev_subdet_names[i] << " ";
600  }
601  for (unsigned int i = 0; i < parser.m_region->m_next_subdet_names.size(); ++i) {
602  std::cout << parser.m_region->m_next_subdet_names[i] << " ";
603  }
604  std::cout << parser.m_region->m_eta0 << " "
605  << parser.m_region->m_deta << " "
606  << parser.m_region->m_phi0 << " "
607  << parser.m_region->m_dphi << " "
608  << std::endl;
609  }
610 
611 }
612 
614 {
615  if (Debugger::debug ())
616  {
617  Debugger::tab (parser.level());
618  std::cout << "RegionFactory::idd_end>" << std::endl;
619  }
620 
621  if (parser.m_region != 0)
622  {
623 
624  if (parser.m_altregions != 0)
625  {
626  // std::cout << "RegionFactory::idd_end> add region to altregions, tag "
627  // << parser.m_region->m_tag << std::endl;
628  parser.m_altregions->m_regions[parser.m_region->m_tag] = parser.m_region;
629  if (parser.m_dictionary != 0) parser.m_dictionary->m_all_regions.push_back (parser.m_region);
630 
631  // Check whether region is empty, i.e. no region entries have
632  // been found and added
633  if (parser.m_region->m_entries.size() == 0)
634  {
635  parser.m_region->m_is_empty = true;
636  }
637 
638  }
639  else if (parser.m_dictionary != 0)
640  {
641  parser.m_dictionary->add_dictentry (parser.m_region);
642  parser.m_dictionary->m_all_regions.push_back (parser.m_region);
643 
644  // Check whether region is empty, i.e. no region entries have
645  // been found and added
646  if (parser.m_region->m_entries.size() == 0)
647  {
648  parser.m_region->m_is_empty = true;
649  }
650  }
651  else
652  {
653  delete parser.m_region;
654  }
655 
656  parser.m_region = 0;
657  }
658 }
659 
661 {
662  if (Debugger::debug ())
663  {
664  Debugger::tab (parser.level());
665  std::cout << "SubRegionFactory::idd_start>" << std::endl;
666  }
667 
668  parser.m_subregion = new IdDictSubRegion;
669  parser.m_subregion->m_name = get_value (node, "name");
670 }
671 
673 {
674  if (Debugger::debug ())
675  {
676  Debugger::tab (parser.level());
677  std::cout << "SubRegionFactory::idd_end>" << std::endl;
678  }
679 
680  if (parser.m_subregion != 0)
681  {
682  if (parser.m_dictionary != 0) parser.m_dictionary->add_subregion (parser.m_subregion);
683  else delete parser.m_subregion;
684 
685  parser.m_subregion = 0;
686  }
687 }
688 
690 {
691  if (Debugger::debug ())
692  {
693  Debugger::tab (parser.level());
694  std::cout << "RegionEntryFactory::idd_start>" << std::endl;
695  }
696 }
697 
699 {
700  if (Debugger::debug ())
701  {
702  Debugger::tab (parser.level());
703  std::cout << "RegionEntryFactory::idd_end>" << std::endl;
704  }
705 
706  if (parser.m_regionentry != 0)
707  {
708  if (parser.m_region != 0) parser.m_region->add_entry (parser.m_regionentry);
709  else if (parser.m_subregion != 0) parser.m_subregion->add_entry (parser.m_regionentry);
710  else delete parser.m_regionentry;
711 
712  parser.m_regionentry = 0;
713  }
714 }
715 
717 {
718  if (Debugger::debug ())
719  {
720  Debugger::tab (parser.level());
721  std::cout << "RangeFactory::idd_start>" << std::endl;
722  }
723 
724  IdDictRange* range = new IdDictRange;
725  parser.m_regionentry = range;
726  range->m_field_name = get_value (node, "field");
727  range->m_field = 0;
728 
729  range->m_specification = IdDictRange::unknown;
730  range->m_continuation_mode = IdDictRange::none;
731  range->m_prev_value = 0;
732  range->m_next_value = 0;
733 
734  if (has_attribute (node, "value"))
735  {
736  range->m_specification = IdDictRange::by_label;
737  range->m_label = get_value (node, "value");
738 
739 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
740 // " value=" << range->m_label << std::endl;
741  }
742  else if (has_attribute (node, "values"))
743  {
744  range->m_specification = IdDictRange::by_labels;
745  std::string labels = get_value (node, "values");
746 
747 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
748 // " values=" << labels << std::endl;
749 
750  std::string::size_type pos = 0;
751 
752  for (;;)
753  {
754  std::string::size_type next;
755 
756  next = labels.find_first_not_of (" ", pos);
757  if (next == std::string::npos) break;
758  pos = next;
759  next = labels.find_first_of (" ", pos);
760 
761  std::string label;
762  label = labels.substr (pos, next - pos);
763  range->m_labels.push_back (label);
764 
765  if (next == std::string::npos)
766  {
767  break;
768  }
769  else
770  {
771  pos = next;
772  }
773  }
774  }
775  else
776  {
777  if (has_attribute (node, "minvalue"))
778  {
779  range->m_specification = IdDictRange::by_minvalue;
780  range->m_minvalue = get_int (node, "minvalue");
781 
782 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
783 // " minvalue=" << range->m_minvalue << std::endl;
784  }
785 
786  if (has_attribute (node, "maxvalue"))
787  {
788  if (range->m_specification == IdDictRange::by_minvalue)
789  range->m_specification = IdDictRange::by_minmax;
790  else
791  range->m_specification = IdDictRange::by_maxvalue;
792 
793  range->m_maxvalue = get_int (node, "maxvalue");
794 
795 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
796 // " maxvalue=" << range->m_maxvalue << std::endl;
797  }
798  }
799 
800 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
801 // " has wraparound=" << has_attribute (node, "wraparound") << std::endl;
802 
803  if (has_attribute (node, "wraparound"))
804  {
805  bool wraparound = get_boolean (node, "wraparound");
806  if (wraparound) range->m_continuation_mode = IdDictRange::wrap_around;
807 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
808 // " wraparound=" << range->m_wraparound << std::endl;
809  }
810 
811  if (has_attribute (node, "prev_value"))
812  {
813  range->m_prev_value = get_int (node, "prev_value");
814  range->m_continuation_mode = IdDictRange::has_previous;
815 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
816 // " prev_value=" << range->m_prev_value << std::endl;
817  }
818 
819  if (has_attribute (node, "next_value"))
820  {
821  range->m_next_value = get_int (node, "next_value");
822 
823  if (IdDictRange::has_previous == range->m_continuation_mode)
824  {
825  range->m_continuation_mode = IdDictRange::has_both;
826  }
827  else
828  {
829  range->m_continuation_mode = IdDictRange::has_next;
830  }
831 
832 // std::cout << "RangeFactory::idd_start> name=" << range->m_field_name <<
833 // " next_value=" << range->m_next_value << std::endl;
834  }
835 
836 }
837 
839 {
840  if (Debugger::debug ())
841  {
842  Debugger::tab (parser.level());
843  std::cout << "ReferenceFactory::idd_start>" << std::endl;
844  }
845 
847  parser.m_regionentry = reference;
848 
849  reference->m_subregion_name = get_value (node, "subregion");
850 
851 // std::cout << "ReferenceFactory::idd_start> subregion=" << reference->m_subregion_name <<
852 // std::endl;
853 }
854 
856 {
857  if (Debugger::debug ())
858  {
859  Debugger::tab (parser.level());
860  std::cout << "DictionaryRefFactory::idd_start>" << std::endl;
861  }
862 
863  IdDictDictionaryRef* dictionaryref = new IdDictDictionaryRef;
864  parser.m_regionentry = dictionaryref;
865  dictionaryref->m_dictionary_name = get_value (node, "name");
866 
867  // Add dictionary name to subdictionaries
868  if (dictionaryref->m_dictionary_name != "")
869  {
870  parser.m_idd.add_subdictionary_name (dictionaryref->m_dictionary_name);
871  if (parser.m_dictionary != 0) parser.m_dictionary->add_subdictionary_name (dictionaryref->m_dictionary_name);
872 
873  }
874 }
875 
IdDictParserNS::IdDictMgrFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:214
IdDictParserNS::SubRegionFactory
Definition: IdDictParser.cxx:90
IdDictParserNS::FieldFactory
Definition: IdDictParser.cxx:62
python.CaloScaleNoiseConfig.parser
parser
Definition: CaloScaleNoiseConfig.py:75
IdDictParserNS::RegionFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:392
IdDictMgr::resolve_references
void resolve_references()
Construct dictionary after parsing.
Definition: IdDictMgr.cxx:204
IdDictParserNS::RangeFactory
Definition: IdDictParser.cxx:104
IdDictParserNS::IdDictMgrFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:204
IdDictParserNS
Definition: IdDictParser.cxx:13
IdDictParserNS::Debugger::get_debug_state
static bool get_debug_state()
Definition: IdDictParser.cxx:18
IdDictRange::by_minmax
@ by_minmax
Definition: IdDictDefs.h:574
IdDictParserNS::DictionaryRefFactory
Definition: IdDictParser.cxx:116
IdDictParserNS::DictionaryFactory
Definition: IdDictParser.cxx:55
IdDictParserNS::AltRegionsFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:351
IdDictParserNS::SubRegionFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:672
IdDictParserNS::IdDictMgrFactory
Definition: IdDictParser.cxx:48
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
IdDictParserNS::IdDictBaseFactory::idd_start
virtual void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:186
IdDictRange::by_label
@ by_label
Definition: IdDictDefs.h:570
IdDictParser::m_dictionary
IdDictDictionary * m_dictionary
Definition: IdDictParser.h:18
XMLCoreFactory::has_attribute
static bool has_attribute(const XMLCoreNode &node, const std::string &name)
Definition: XMLCoreParser.cxx:132
IdDictParser::m_altregions
IdDictAltRegions * m_altregions
Definition: IdDictParser.h:21
IdDictDictionaryRef
Definition: IdDictDefs.h:657
IdDictRange::by_labels
@ by_labels
Definition: IdDictDefs.h:571
IdDictParser::m_regionentry
IdDictRegionEntry * m_regionentry
Definition: IdDictParser.h:23
IdDictRange::none
@ none
Definition: IdDictDefs.h:579
IdDictParser::parse
IdDictMgr & parse(const std::string &file_name, const std::string &tag="")
Definition: IdDictParser.cxx:145
IdDictParser::m_field
IdDictField * m_field
Definition: IdDictParser.h:19
XMLCoreFactory::get_int
static int get_int(const XMLCoreNode &node, const std::string &name)
Definition: XMLCoreParser.cxx:142
reference
Definition: hcg.cxx:437
IdDictParser::m_idd
IdDictMgr m_idd
Definition: IdDictParser.h:17
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
XMLCoreFactory::get_boolean
static bool get_boolean(const XMLCoreNode &node, const std::string &name)
Definition: XMLCoreParser.cxx:162
IdDictParserNS::Debugger::tab
static void tab(int n)
Definition: IdDictParser.cxx:28
IdDictParserNS::RegionEntryFactory::idd_end
virtual void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:698
IdDictAltRegions
Definition: IdDictDefs.h:417
XMLCoreNode
Definition: XMLCoreParser.h:21
IdDictRegion
Definition: IdDictDefs.h:448
IdDictParserNS::RegionEntryFactory::idd_start
virtual void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:689
IdDictParserNS::ReferenceFactory
Definition: IdDictParser.cxx:110
IdDictParserNS::FieldFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:256
IdDictParserNS::DictionaryFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:224
IdDictParserNS::RegionFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:613
IdDictParserNS::IdDictBaseFactory::idd_end
virtual void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:191
IdDictDictionaryRef::m_dictionary_name
std::string m_dictionary_name
Definition: IdDictDefs.h:674
IdDictRange::has_previous
@ has_previous
Definition: IdDictDefs.h:581
IdDictRange::by_minvalue
@ by_minvalue
Definition: IdDictDefs.h:572
IdDictParserNS::FieldFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:279
IdDictLabel
Definition: IdDictDefs.h:344
physics_parameters.file_name
string file_name
Definition: physics_parameters.py:32
XMLCoreParser
Definition: XMLCoreParser.h:107
IdDictParserNS::Debugger
Definition: IdDictParser.cxx:16
IdDictMgr
Definition: IdDictDefs.h:32
IdDictParserNS::ReferenceFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:838
beamspotnt.labels
list labels
Definition: bin/beamspotnt.py:1447
IdDictParser.h
IdDictParserNS::DictionaryFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:240
fillPileUpNoiseLumi.next
next
Definition: fillPileUpNoiseLumi.py:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
IdDictParserNS::AltRegionsFactory
Definition: IdDictParser.cxx:76
IdDictParserNS::LabelFactory
Definition: IdDictParser.cxx:69
IdDictRange::has_both
@ has_both
Definition: IdDictDefs.h:582
IdDictParserNS::LabelFactory::idd_end
void idd_end(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:321
beamspotman.n
n
Definition: beamspotman.py:731
IdDictAltRegions::map_iterator
map_type::iterator map_iterator
Definition: IdDictDefs.h:439
python.subdetectors.mmg.names
names
Definition: mmg.py:8
XMLCoreFactory::get_value
static std::string get_value(const XMLCoreNode &node, const std::string &name)
Definition: XMLCoreParser.cxx:180
IdDictParser::m_region
IdDictRegion * m_region
Definition: IdDictParser.h:20
IdDictParserNS::IdDictBaseFactory::do_start
void do_start(XMLCoreParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:173
IdDictRange::by_maxvalue
@ by_maxvalue
Definition: IdDictDefs.h:573
IdDictParserNS::RegionFactory
Definition: IdDictParser.cxx:83
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
XMLCoreParser::register_factory
void register_factory(const std::string &name, std::unique_ptr< XMLCoreFactory > factory)
Definition: XMLCoreParser.cxx:495
IdDictParserNS::RegionEntryFactory
Definition: IdDictParser.cxx:97
IdDictRange::unknown
@ unknown
Definition: IdDictDefs.h:567
IdDictParser
Definition: IdDictParser.h:12
IdDictParserNS::AltRegionsFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:330
XMLCoreFactory
Definition: XMLCoreParser.h:71
Debugger::debug
static bool debug()
Definition: IdDictMgr.cxx:26
IdDictParserNS::DictionaryRefFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:855
IdDictParserNS::IdDictBaseFactory::do_end
void do_end(XMLCoreParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:180
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
IdDictParserNS::LabelFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:296
IdDictRange::has_next
@ has_next
Definition: IdDictDefs.h:580
IdDictParserNS::SubRegionFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:660
IdDictReference
Definition: IdDictDefs.h:631
IdDictDictionary
Definition: IdDictDefs.h:97
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
IdDictRange
Definition: IdDictDefs.h:545
SCT_ConditionsAlgorithms::CoveritySafe::getenv
std::string getenv(const std::string &variableName)
get an environment variable
Definition: SCT_ConditionsUtilities.cxx:17
DeMoScan.first
bool first
Definition: DeMoScan.py:534
dq_make_web_display.reference
reference
Definition: dq_make_web_display.py:44
IdDictParser::m_subregion
IdDictSubRegion * m_subregion
Definition: IdDictParser.h:22
IdDictMgr::clear
void clear()
Definition: IdDictMgr.cxx:276
IdDictParser::IdDictParser
IdDictParser()
Definition: IdDictParser.cxx:124
IdDictSubRegion
Definition: IdDictDefs.h:503
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
IdDictField
Definition: IdDictDefs.h:318
IdDictRange::wrap_around
@ wrap_around
Definition: IdDictDefs.h:583
XMLCoreFactory::get_double
static double get_double(const XMLCoreNode &node, const std::string &name)
Definition: XMLCoreParser.cxx:152
IdDictParserNS::IdDictBaseFactory
Definition: IdDictParser.cxx:38
XMLCoreParser::visit
void visit(const std::string &file_name)
Definition: XMLCoreParser.cxx:382
node
Definition: memory_hooks-stdcmalloc.h:74
IdDictParserNS::Debugger::debug
static bool debug()
Definition: IdDictParser.cxx:22
IdDictParserNS::RangeFactory::idd_start
void idd_start(IdDictParser &parser, const XMLCoreNode &node)
Definition: IdDictParser.cxx:716
IdDictMgr::generate_implementation
void generate_implementation(const std::string &tag="")
Definition: IdDictMgr.cxx:217