Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:30

0001 /*
0002  * =====================================================================================
0003  *
0004  *       Filename:  CSCDQM_MonitorObjectProviderIf.h
0005  *
0006  *    Description:  Histo Provider Interface
0007  *
0008  *        Version:  1.0
0009  *        Created:  10/03/2008 10:26:04 AM
0010  *       Revision:  none
0011  *       Compiler:  gcc
0012  *
0013  *         Author:  Valdas Rapsevicius, valdas.rapsevicius@cern.ch
0014  *        Company:  CERN, CH
0015  *
0016  * =====================================================================================
0017  */
0018 
0019 #ifndef CSCDQM_MonitorObjectProviderIf_H
0020 #define CSCDQM_MonitorObjectProviderIf_H
0021 
0022 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0023 
0024 #include "CSCDQM_HistoDef.h"
0025 #include "CSCDQM_MonitorObject.h"
0026 
0027 namespace cscdqm {
0028 
0029   enum HistoType { INT, FLOAT, STRING, H1D, H2D, H3D, PROFILE, PROFILE2D };
0030 
0031   struct HistoBookRequest {
0032     const HistoDef* hdef;
0033     HistoType htype;
0034     std::string ctype;
0035     std::string folder;
0036     std::string title;
0037 
0038     int nchX;
0039     double lowX;
0040     double highX;
0041 
0042     int nchY;
0043     double lowY;
0044     double highY;
0045 
0046     int nchZ;
0047     double lowZ;
0048     double highZ;
0049 
0050     int default_int;
0051     float default_float;
0052     std::string default_string;
0053 
0054     std::string option;
0055 
0056     HistoBookRequest(const HistoDef& p_hdef,
0057                      const HistoType& p_htype,
0058                      const std::string& p_ctype,
0059                      const std::string& p_folder,
0060                      const std::string& p_title,
0061                      const int p_nchX = 0,
0062                      const double p_lowX = 0,
0063                      const double p_highX = 0,
0064                      const int p_nchY = 0,
0065                      const double p_lowY = 0,
0066                      const double p_highY = 0,
0067                      const int p_nchZ = 0,
0068                      const double p_lowZ = 0,
0069                      const double p_highZ = 0,
0070                      const std::string& p_option = "s") {
0071       hdef = &p_hdef;
0072       htype = p_htype;
0073       ctype = p_ctype;
0074       folder = p_folder;
0075       title = p_title;
0076       nchX = p_nchX;
0077       lowX = p_lowX;
0078       highX = p_highX;
0079       nchY = p_nchY;
0080       lowY = p_lowY;
0081       highY = p_highY;
0082       nchZ = p_nchZ;
0083       lowZ = p_lowZ;
0084       highZ = p_highZ;
0085       option = p_option;
0086     }
0087 
0088     HistoBookRequest(const HistoDef& p_hdef, const std::string& p_folder, const int p_value) {
0089       hdef = &p_hdef;
0090       htype = INT;
0091       ctype = "INT";
0092       folder = p_folder;
0093       title = p_hdef.getHistoName();
0094       default_int = p_value;
0095     }
0096 
0097     HistoBookRequest(const HistoDef& p_hdef, const std::string& p_folder, const float p_value) {
0098       hdef = &p_hdef;
0099       htype = FLOAT;
0100       ctype = "FLOAT";
0101       folder = p_folder;
0102       title = p_hdef.getHistoName();
0103       default_float = p_value;
0104     }
0105 
0106     HistoBookRequest(const HistoDef& p_hdef,
0107                      const std::string& p_folder,
0108                      const std::string& p_title,
0109                      const std::string& p_value) {
0110       hdef = &p_hdef;
0111       htype = STRING;
0112       ctype = "STRING";
0113       folder = p_folder;
0114       title = p_title;
0115       default_string = p_value;
0116     }
0117   };
0118 
0119   /**
0120    * @class MonitorObjectProvider
0121    * @brief Interface for Histogram providing objects. Used by Event Processor
0122    * to retrieve MonitorObject 's and by Collection to book MonitorObject 's
0123    */
0124   class MonitorObjectProvider {
0125   public:
0126     virtual ~MonitorObjectProvider() noexcept(false) {}
0127     virtual bool getCSCDetId(const unsigned int crateId, const unsigned int dmbId, CSCDetId& detId) const = 0;
0128     virtual MonitorObject* bookMonitorObject(const HistoBookRequest& p_req) = 0;
0129   };
0130 
0131 }  // namespace cscdqm
0132 
0133 #endif