00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef CSCDQM_Collection_H
00020 #define CSCDQM_Collection_H
00021
00022 #include <string>
00023 #include <map>
00024 #include <vector>
00025 #include <sstream>
00026 #include <TProfile.h>
00027
00028 #include <xercesc/parsers/XercesDOMParser.hpp>
00029 #include <xercesc/dom/DOMNodeList.hpp>
00030 #include <xercesc/dom/DOMElement.hpp>
00031
00032 #include <boost/shared_ptr.hpp>
00033
00034 #include "DQM/CSCMonitorModule/interface/CSCDQM_Exception.h"
00035 #include "DQM/CSCMonitorModule/interface/CSCDQM_Logger.h"
00036 #include "DQM/CSCMonitorModule/interface/CSCDQM_Utility.h"
00037 #include "DQM/CSCMonitorModule/interface/CSCDQM_Configuration.h"
00038
00039 namespace cscdqm {
00040
00041 using namespace XERCES_CPP_NAMESPACE;
00042
00043 static const char XML_BOOK_DEFINITION[] = "Definition";
00044 static const char XML_BOOK_DEFINITION_ID[] = "id";
00045 static const char XML_BOOK_HISTOGRAM[] = "Histogram";
00046 static const char XML_BOOK_DEFINITION_REF[] = "ref";
00047 static const char XML_BOOK_HISTO_NAME[] = "Name";
00048 static const char XML_BOOK_HISTO_PREFIX[] = "Prefix";
00049 static const char XML_BOOK_HISTO_TYPE[] = "Type";
00050 static const char XML_BOOK_HISTO_TITLE[] = "Title";
00051 static const char XML_BOOK_ONDEMAND[] = "OnDemand";
00052 static const char XML_BOOK_ONDEMAND_TRUE[] = "1";
00053 static const char XML_BOOK_ONDEMAND_FALSE[] = "0";
00054
00055 static const int DEF_HISTO_COLOR = 48;
00056
00060 typedef std::map<std::string, std::string> CoHistoProps;
00061 typedef std::map<std::string, CoHistoProps> CoHisto;
00062 typedef std::map<std::string, CoHisto> CoHistoMap;
00063
00069 class Collection {
00070
00071 public:
00072
00073 Collection(Configuration* const p_config);
00074
00075 void bookEMUHistos() const;
00076 void bookDDUHistos(const HwId dduId) const;
00077 void bookCSCHistos(const HwId crateId, const HwId dmbId) const;
00078 void bookCSCHistos(const HistoId hid, const HwId crateId, const HwId dmbId, const HwId addId) const;
00079
00080 const bool isOnDemand(const HistoName& name) const;
00081
00082 void printCollection() const;
00083
00084 private:
00085
00086 static const bool checkHistoValue(const CoHistoProps& h, const std::string& name, std::string& value);
00087 static const bool checkHistoValue(const CoHistoProps& h, const std::string& name, int& value);
00088 static const bool checkHistoValue(const CoHistoProps& h, const std::string name, double& value);
00089
00090 static std::string& getHistoValue(const CoHistoProps& h, const std::string& name, std::string& value, const std::string& def_value = "");
00091 static int& getHistoValue(const CoHistoProps& h, const std::string& name, int& value, const int& def_value = 0);
00092 static double& getHistoValue(const CoHistoProps& h, const std::string name, double& value, const int def_value = 0.0);
00093
00094 void load();
00095 void book(const HistoDef& h, const CoHistoProps& h, const std::string& folder) const;
00096 static const int ParseAxisLabels(const std::string& s, std::map<int, std::string>& labels);
00097 static void getNodeProperties(DOMNode*& node, CoHistoProps& hp);
00098
00099 Configuration* config;
00100
00101 CoHistoMap collection;
00102
00103 };
00104
00105 }
00106
00107 #endif