L1TUtmCut

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 134 135 136
//
// NOTE:  This file was automatically generated from UTM library via import_utm.pl
// DIRECT EDITS MIGHT BE LOST.
//
/**
 * @author      Takashi Matsushita
 * Created:     8 Nov 2015
 */

#ifndef tmEventSetup_L1TUtmCut_hh
#define tmEventSetup_L1TUtmCut_hh

#include "CondFormats/L1TObjects/interface/L1TUtmCutValue.h"
#include "CondFormats/Serialization/interface/Serializable.h"

#include "tmEventSetup/esCut.hh"

#include <string>

/**
 *  This class implements data structure for Cut
 */
class L1TUtmCut {
public:
  L1TUtmCut() : name_(), object_type_(), cut_type_(), minimum_(), maximum_(), data_(), key_(), version(0) {}
  L1TUtmCut(std::string name,
            int object_type,
            int cut_type,
            L1TUtmCutValue minimum,
            L1TUtmCutValue maximum,
            std::string data,
            std::string key,
            unsigned int vers)
      : name_(name),
        object_type_(object_type),
        cut_type_(cut_type),
        minimum_(minimum),
        maximum_(maximum),
        data_(data),
        key_(key),
        version(vers) {}

  L1TUtmCut(const tmeventsetup::esCut& esC)
      : L1TUtmCut(esC.getName(),
                  esC.getObjectType(),
                  esC.getCutType(),
                  L1TUtmCutValue(esC.getMinimum()),
                  L1TUtmCutValue(esC.getMaximum()),
                  esC.getData(),
                  esC.getKey(),
                  0) {};

  virtual ~L1TUtmCut() = default;

  /** set cut name */
  void setName(const std::string& name) { name_ = name; };

  /** set object type */
  void setObjectType(const int type) { object_type_ = type; };

  /** set cut type */
  void setCutType(const int type) { cut_type_ = type; };

  /** set minimum value of cut range (double) */
  void setMinimumValue(const double value) { minimum_.value = value; };

  /** set minimum value of cut range (HW index) */
  void setMinimumIndex(const unsigned int index) { minimum_.index = index; };

  /** set minimum value of cut range (L1TUtmCutValue struct) */
  void setMinimum(const L1TUtmCutValue& minimum) { minimum_ = minimum; };

  /** set maximum value of cut range (double) */
  void setMaximumValue(const double value) { maximum_.value = value; };

  /** set maximum value of cut range (HW index) */
  void setMaximumIndex(const unsigned int index) { maximum_.index = index; };

  /** set maximum value of cut range (L1TUtmCutValue struct) */
  void setMaximum(const L1TUtmCutValue& maximum) { maximum_ = maximum; };

  /** set precision for cut value calculations */
  void setPrecision(const unsigned int precision) {
    setMaximumIndex(precision);
    setMinimumIndex(precision);
  };  // HACK

  /** get cut name */
  const std::string& getName() const { return name_; };

  /** get target object type : combination of esObjectType and esFunctionType enums */
  const int getObjectType() const { return object_type_; };

  /** get cut type */
  const int getCutType() const { return cut_type_; };

  /** get L1TUtmCutValue struct for minimum value of cut range */
  const L1TUtmCutValue& getMinimum() const { return minimum_; };

  /** get L1TUtmCutValue struct for maximum value of cut range */
  const L1TUtmCutValue& getMaximum() const { return maximum_; };

  /** get L1TUtmCutValue struct for minimum value of cut range */
  const double getMinimumValue() const { return minimum_.value; };

  /** get L1TUtmCutValue struct for maximum value of cut range */
  const double getMaximumValue() const { return maximum_.value; };

  /** get L1TUtmCutValue struct for minimum value of cut range */
  const unsigned int getMinimumIndex() const { return minimum_.index; };

  /** get L1TUtmCutValue struct for maximum value of cut range */
  const unsigned int getMaximumIndex() const { return maximum_.index; };

  /** get data */
  const std::string& getData() const { return data_; };

  /** get key */
  const std::string& getKey() const { return key_; };

  /** get precision */
  const unsigned int getPrecision() const { return getMinimumIndex(); };  // HACK

protected:
  std::string name_;       /**< name of cut */
  int object_type_;        /**< target object type */
  int cut_type_;           /**< type of cut */
  L1TUtmCutValue minimum_; /**< minimum value of cut range */
  L1TUtmCutValue maximum_; /**< maximum value of cut range */
  std::string data_;       /**< data for charge/quality/isolation/charge correlation/impact parameter */
  std::string key_;        /**< key for accessing a scale */
  unsigned int version;
  COND_SERIALIZABLE;
};

#endif  // tmEventSetup_L1TUtmCut_hh