CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/DQM/CSCMonitorModule/interface/CSCDQM_MonitorObjectProvider.h

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  CSCDQM_MonitorObjectProviderIf.h
00005  *
00006  *    Description:  Histo Provider Interface
00007  *
00008  *        Version:  1.0
00009  *        Created:  10/03/2008 10:26:04 AM
00010  *       Revision:  none
00011  *       Compiler:  gcc
00012  *
00013  *         Author:  Valdas Rapsevicius, valdas.rapsevicius@cern.ch
00014  *        Company:  CERN, CH
00015  *
00016  * =====================================================================================
00017  */
00018 
00019 #ifndef CSCDQM_MonitorObjectProviderIf_H
00020 #define CSCDQM_MonitorObjectProviderIf_H
00021 
00022 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00023 
00024 #include "DQM/CSCMonitorModule/interface/CSCDQM_HistoDef.h"
00025 #include "DQM/CSCMonitorModule/interface/CSCDQM_MonitorObject.h"
00026 
00027 namespace cscdqm {
00028 
00029   enum HistoType { INT, FLOAT, STRING, H1D, H2D, H3D, PROFILE, PROFILE2D };
00030 
00031   struct HistoBookRequest {
00032 
00033     const HistoDef *hdef;
00034     HistoType htype;
00035     std::string ctype;
00036     std::string folder;
00037     std::string title;
00038 
00039     int nchX;
00040     double lowX;
00041     double highX;
00042 
00043     int nchY;
00044     double lowY;
00045     double highY;
00046 
00047     int nchZ;
00048     double lowZ;
00049     double highZ;
00050 
00051     int default_int;
00052     float default_float;
00053     std::string default_string;
00054 
00055     std::string option;
00056 
00057     HistoBookRequest (const HistoDef& p_hdef, const HistoType& p_htype, const std::string& p_ctype,
00058                       const std::string& p_folder, const std::string& p_title,
00059                       const int p_nchX = 0, const double p_lowX = 0, const double p_highX = 0,
00060                       const int p_nchY = 0, const double p_lowY = 0, const double p_highY = 0,
00061                       const int p_nchZ = 0, const double p_lowZ = 0, const double p_highZ = 0,
00062                       const std::string& p_option = "s") {
00063       hdef = &p_hdef; 
00064       htype = p_htype;
00065       ctype = p_ctype;
00066       folder = p_folder; 
00067       title = p_title;
00068       nchX = p_nchX; 
00069       lowX = p_lowX;
00070       highX = p_highX; 
00071       nchY = p_nchY;
00072       lowY = p_lowY; 
00073       highY = p_highY;
00074       nchZ = p_nchZ; 
00075       lowZ = p_lowZ;
00076       highZ = p_highZ; 
00077       option = p_option;
00078     }
00079 
00080     HistoBookRequest (const HistoDef& p_hdef, const std::string& p_folder, const int p_value) {
00081       hdef = &p_hdef;
00082       htype = INT;
00083       ctype = "INT";
00084       folder = p_folder;
00085       title = p_hdef.getHistoName();
00086       default_int = p_value;
00087     }
00088 
00089     HistoBookRequest (const HistoDef& p_hdef, const std::string& p_folder, const float p_value) {
00090       hdef = &p_hdef;
00091       htype = FLOAT;
00092       ctype = "FLOAT";
00093       folder = p_folder;
00094       title = p_hdef.getHistoName();
00095       default_float = p_value;
00096     }
00097 
00098     HistoBookRequest (const HistoDef& p_hdef, const std::string& p_folder, 
00099                       const std::string& p_title, const std::string& p_value) {
00100       hdef = &p_hdef;
00101       htype = STRING;
00102       ctype = "STRING";
00103       folder = p_folder;
00104       title = p_title;
00105       default_string = p_value;
00106     }
00107 
00108   };
00109 
00115   class MonitorObjectProvider {
00116 
00117     public:
00118     
00119       virtual bool getCSCDetId(const unsigned int crateId, const unsigned int dmbId, CSCDetId& detId) const = 0;
00120       virtual MonitorObject *bookMonitorObject (const HistoBookRequest& p_req) = 0; 
00121   };
00122 
00123 }
00124 
00125 #endif