Rivet
1.8.0
|
00001 // -*- C++ -*- 00002 #ifndef RIVET_HistoFormat_HH 00003 #define RIVET_HistoFormat_HH 00004 00005 #include "Rivet/Rivet.hh" 00006 00007 namespace Rivet { 00008 00009 00011 enum HistoFormat { AIDAML, FLAT, ROOT }; 00012 00014 typedef std::map<HistoFormat, std::string> HistoFormatMap; 00015 00016 00018 typedef std::map<std::string, HistoFormat> HistoFormatMapR; 00019 00020 00022 inline HistoFormatMap getKnownHistoFormats() { 00023 HistoFormatMap hfmap; 00024 hfmap[AIDAML] = "AIDA"; 00025 hfmap[FLAT] = "FLAT"; 00026 #ifdef HAVE_ROOT 00027 hfmap[ROOT] = "ROOT"; 00028 #endif 00029 return hfmap; 00030 } 00031 00033 inline HistoFormatMapR getKnownHistoFormatsR() { 00034 HistoFormatMap hfmap = getKnownHistoFormats(); 00035 HistoFormatMapR hfmapr; 00036 for (HistoFormatMap::const_iterator hf = hfmap.begin(); hf != hfmap.end(); ++hf) { 00037 hfmapr[hf->second] = hf->first; 00038 } 00039 return hfmapr; 00040 } 00041 00042 00044 typedef std::vector<HistoFormat> HistoFormatList; 00045 00046 00049 inline HistoFormatList getKnownHistoFormatEnums() { 00050 HistoFormatList names; 00051 HistoFormatMap hfmap = getKnownHistoFormats(); 00052 for (HistoFormatMap::const_iterator hf = hfmap.begin(); hf != hfmap.end(); ++hf) { 00053 names.push_back(hf->first); 00054 } 00055 return names; 00056 } 00057 00058 00060 inline std::vector<std::string> getKnownHistoFormatNames() { 00061 vector<string> names; 00062 HistoFormatMap hfmap = getKnownHistoFormats(); 00063 for (HistoFormatMap::const_iterator hf = hfmap.begin(); hf != hfmap.end(); ++hf) { 00064 names.push_back(hf->second); 00065 } 00066 return names; 00067 } 00068 00069 00070 } 00071 00072 #endif