HistoBookRequest

HistoType

MonitorObjectProvider

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
/*
 * =====================================================================================
 *
 *       Filename:  CSCDQM_MonitorObjectProviderIf.h
 *
 *    Description:  Histo Provider Interface
 *
 *        Version:  1.0
 *        Created:  10/03/2008 10:26:04 AM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Valdas Rapsevicius, valdas.rapsevicius@cern.ch
 *        Company:  CERN, CH
 *
 * =====================================================================================
 */

#ifndef CSCDQM_MonitorObjectProviderIf_H
#define CSCDQM_MonitorObjectProviderIf_H

#include "DataFormats/MuonDetId/interface/CSCDetId.h"

#include "CSCDQM_HistoDef.h"
#include "CSCDQM_MonitorObject.h"

namespace cscdqm {

  enum HistoType { INT, FLOAT, STRING, H1D, H2D, H3D, PROFILE, PROFILE2D };

  struct HistoBookRequest {
    const HistoDef* hdef;
    HistoType htype;
    std::string ctype;
    std::string folder;
    std::string title;

    int nchX;
    double lowX;
    double highX;

    int nchY;
    double lowY;
    double highY;

    int nchZ;
    double lowZ;
    double highZ;

    int default_int;
    float default_float;
    std::string default_string;

    std::string option;

    HistoBookRequest(const HistoDef& p_hdef,
                     const HistoType& p_htype,
                     const std::string& p_ctype,
                     const std::string& p_folder,
                     const std::string& p_title,
                     const int p_nchX = 0,
                     const double p_lowX = 0,
                     const double p_highX = 0,
                     const int p_nchY = 0,
                     const double p_lowY = 0,
                     const double p_highY = 0,
                     const int p_nchZ = 0,
                     const double p_lowZ = 0,
                     const double p_highZ = 0,
                     const std::string& p_option = "s") {
      hdef = &p_hdef;
      htype = p_htype;
      ctype = p_ctype;
      folder = p_folder;
      title = p_title;
      nchX = p_nchX;
      lowX = p_lowX;
      highX = p_highX;
      nchY = p_nchY;
      lowY = p_lowY;
      highY = p_highY;
      nchZ = p_nchZ;
      lowZ = p_lowZ;
      highZ = p_highZ;
      option = p_option;
    }

    HistoBookRequest(const HistoDef& p_hdef, const std::string& p_folder, const int p_value) {
      hdef = &p_hdef;
      htype = INT;
      ctype = "INT";
      folder = p_folder;
      title = p_hdef.getHistoName();
      default_int = p_value;
    }

    HistoBookRequest(const HistoDef& p_hdef, const std::string& p_folder, const float p_value) {
      hdef = &p_hdef;
      htype = FLOAT;
      ctype = "FLOAT";
      folder = p_folder;
      title = p_hdef.getHistoName();
      default_float = p_value;
    }

    HistoBookRequest(const HistoDef& p_hdef,
                     const std::string& p_folder,
                     const std::string& p_title,
                     const std::string& p_value) {
      hdef = &p_hdef;
      htype = STRING;
      ctype = "STRING";
      folder = p_folder;
      title = p_title;
      default_string = p_value;
    }
  };

  /**
   * @class MonitorObjectProvider
   * @brief Interface for Histogram providing objects. Used by Event Processor
   * to retrieve MonitorObject 's and by Collection to book MonitorObject 's
   */
  class MonitorObjectProvider {
  public:
    virtual ~MonitorObjectProvider() noexcept(false) {}
    virtual bool getCSCDetId(const unsigned int crateId, const unsigned int dmbId, CSCDetId& detId) const = 0;
    virtual MonitorObject* bookMonitorObject(const HistoBookRequest& p_req) = 0;
  };

}  // namespace cscdqm

#endif