Rivet  1.8.0
HistoFormat.hh
1 // -*- C++ -*-
2 #ifndef RIVET_HistoFormat_HH
3 #define RIVET_HistoFormat_HH
4 
5 #include "Rivet/Rivet.hh"
6 
7 namespace Rivet {
8 
9 
11  enum HistoFormat { AIDAML, FLAT, ROOT };
12 
14  typedef std::map<HistoFormat, std::string> HistoFormatMap;
15 
16 
18  typedef std::map<std::string, HistoFormat> HistoFormatMapR;
19 
20 
23  HistoFormatMap hfmap;
24  hfmap[AIDAML] = "AIDA";
25  hfmap[FLAT] = "FLAT";
26 #ifdef HAVE_ROOT
27  hfmap[ROOT] = "ROOT";
28 #endif
29  return hfmap;
30  }
31 
35  HistoFormatMapR hfmapr;
36  for (HistoFormatMap::const_iterator hf = hfmap.begin(); hf != hfmap.end(); ++hf) {
37  hfmapr[hf->second] = hf->first;
38  }
39  return hfmapr;
40  }
41 
42 
44  typedef std::vector<HistoFormat> HistoFormatList;
45 
46 
50  HistoFormatList names;
52  for (HistoFormatMap::const_iterator hf = hfmap.begin(); hf != hfmap.end(); ++hf) {
53  names.push_back(hf->first);
54  }
55  return names;
56  }
57 
58 
60  inline std::vector<std::string> getKnownHistoFormatNames() {
61  vector<string> names;
63  for (HistoFormatMap::const_iterator hf = hfmap.begin(); hf != hfmap.end(); ++hf) {
64  names.push_back(hf->second);
65  }
66  return names;
67  }
68 
69 
70 }
71 
72 #endif