L1TUtmTriggerMenu

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 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
//
// NOTE:  This file was automatically generated from UTM library via import_utm.pl
// DIRECT EDITS MIGHT BE LOST.
//
/**
 * @author Bernhard Arnold
 *         Takashi Matsushita
 * @date:  2015-03-12
 */

#ifndef tmEventSetup_L1TUtmTriggerMenu_hh
#define tmEventSetup_L1TUtmTriggerMenu_hh

#include "CondFormats/L1TObjects/interface/L1TUtmScale.h"
#include "CondFormats/L1TObjects/interface/L1TUtmCondition.h"
#include "CondFormats/L1TObjects/interface/L1TUtmAlgorithm.h"
#include "CondFormats/Serialization/interface/Serializable.h"

#include "tmEventSetup/esTriggerMenu.hh"

#include <map>
#include <string>

/**
 *  This class implements data structure for TriggerMenu
 */
class L1TUtmTriggerMenu {
public:
  L1TUtmTriggerMenu()
      : algorithm_map_(),
        condition_map_(),
        scale_map_(),
        external_map_(),
        token_to_condition_(),
        name_(),
        version_(),
        comment_(),
        datetime_(),
        uuid_firmware_(),
        scale_set_name_(),
        n_modules_(),
        version(0) {}
  L1TUtmTriggerMenu(std::map<std::string, L1TUtmAlgorithm> algorithm_map,
                    std::map<std::string, L1TUtmCondition> condition_map,
                    std::map<std::string, L1TUtmScale> scale_map,
                    std::string name,
                    std::string ver_s,
                    std::string comment,
                    std::string datetime,
                    std::string uuid_firmware,
                    std::string scale_set_name,
                    unsigned int n_modules,
                    unsigned int ver_i)
      : algorithm_map_(algorithm_map),
        condition_map_(condition_map),
        scale_map_(scale_map),
        external_map_(),
        token_to_condition_(),
        name_(name),
        version_(ver_s),
        comment_(comment),
        datetime_(datetime),
        uuid_firmware_(uuid_firmware),
        scale_set_name_(scale_set_name),
        n_modules_(n_modules),
        version(ver_i) {}

  L1TUtmTriggerMenu(const tmeventsetup::esTriggerMenu& esMenu)
      : external_map_(),        //These are null to my best knowledge
        token_to_condition_(),  //These are null to my best knowledge
        name_(esMenu.getName()),
        version_(esMenu.getVersion()),
        comment_(esMenu.getComment()),
        datetime_(esMenu.getDatetime()),
        uuid_firmware_(esMenu.getFirmwareUuid()),
        scale_set_name_(esMenu.getScaleSetName()),
        n_modules_(esMenu.getNmodules()),
        version(0) {
    for (const auto& it : esMenu.getAlgorithmMap())
      algorithm_map_.emplace(std::make_pair(it.first, L1TUtmAlgorithm(it.second)));
    for (const auto& it : esMenu.getConditionMap())
      condition_map_.emplace(std::make_pair(it.first, L1TUtmCondition(it.second)));
    for (const auto& it : esMenu.getScaleMap())
      scale_map_.emplace(std::make_pair(it.first, L1TUtmScale(it.second)));
  };

  virtual ~L1TUtmTriggerMenu() = default;

  /** get algorithm_map_
     *
     * @return reference of algorithm_map_
     */
  const std::map<std::string, L1TUtmAlgorithm>& getAlgorithmMap() const { return algorithm_map_; };

  /** get condition_map_
     *
     * @return reference of condition_map_
     */
  const std::map<std::string, L1TUtmCondition>& getConditionMap() const { return condition_map_; };

  /** get scale_map_
     *
     * @return reference of scale_map_
     */
  const std::map<std::string, L1TUtmScale>& getScaleMap() const { return scale_map_; };

  /** get menu name
     *
     * @return name of the menu
     */
  const std::string& getName() const { return name_; };

  /** get grammar version
     *
     * @return grammar version
     */
  const std::string& getVersion() const { return version_; };

  /** get comment on the menu
     *
     * @return comment
     */
  const std::string& getComment() const { return comment_; };

  /** get datetime of the menu
     *
     * @return datetime
     */
  const std::string& getDatetime() const { return datetime_; };

  /** get UUID of firmware generated by VHDL producer
     *
     * @return UUID
     */
  const std::string& getFirmwareUuid() const { return uuid_firmware_; };

  /** gets the hash of the L1 firmware 
     *
     * @return the hash identifying the L1 firmware 
     */
  const unsigned long getFirmwareUuidHashed() const;

  /** get scale set name
     *
     * @return scale set name
     */
  const std::string& getScaleSetName() const { return scale_set_name_; };

  /** get number of uGT boards for the menu
     *
     * @return number of uGT boards
     */
  const unsigned int getNmodules() const { return n_modules_; };

  /** set menu name
     *
     * @param value [in] name of the menu
     */
  void setName(const std::string& value) { name_ = value; };

  /** set grammar version
     *
     * @param value [in] grammar version
     */
  void setVersion(const std::string& value) { version_ = value; };

  /** set comment on the menu
     *
     * @param value [in] comment
     */
  void setComment(const std::string& value) { comment_ = value; };

  /** set datetime of the menu
     *
     * @param value [in] datetime
     */
  void setDatetime(const std::string& value) { datetime_ = value; };

  /** set UUID of firmware generated by VHDL producer
     *
     * @param value [in] UUID
     */
  void setFirmwareUuid(const std::string& value) { uuid_firmware_ = value; };

  /** set scale set name
     *
     * @param value [in] scale set name
     */
  void setScaleSetName(const std::string& value) { scale_set_name_ = value; };

  /** set number of uGT boards for the menu
     *
     * @param value [in] number of uGT boards
     */
  void setNmodules(const unsigned int value) { n_modules_ = value; };

  /** hash computation function
     *
     * @return computed hash
     */
  static unsigned long murmurHashNeutral2(const void* key, int len, unsigned int seed);

protected:
  std::map<std::string, L1TUtmAlgorithm> algorithm_map_; /**< map of algorithm <algorithm name, L1TUtmAlgorithm> */
  std::map<std::string, L1TUtmCondition> condition_map_; /**< map of condition <condition name, L1TUtmCondition> */
  std::map<std::string, L1TUtmScale> scale_map_;         /**< map of scale <scale name, L1TUtmScale*> */
  std::map<std::string, unsigned int> external_map_;     /**< map of external <external name, channel id> */
  std::map<std::string, std::string>
      token_to_condition_;     /**< look-up table for translating expression in grammar to expression in condition */
  std::string name_;           /**< name of the menu */
  std::string version_;        /**< menu grammar version */
  std::string comment_;        /**< comment on the menu */
  std::string datetime_;       /**< datetime of the menu */
  std::string uuid_firmware_;  /**< uuid of firmware */
  std::string scale_set_name_; /**< scale set name */
  unsigned int n_modules_;     /**< number of uGT boards for the menu */
  unsigned int version;
  COND_SERIALIZABLE;
};

#endif  // tmEventSetup_L1TUtmTriggerMenu_hh