Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-12 04:16:16

0001 //
0002 // NOTE:  This file was automatically generated from UTM library via import_utm.pl
0003 // DIRECT EDITS MIGHT BE LOST.
0004 //
0005 /**
0006  * @author Bernhard Arnold
0007  *         Takashi Matsushita
0008  * @date:  2015-03-12
0009  */
0010 
0011 #ifndef tmEventSetup_L1TUtmTriggerMenu_hh
0012 #define tmEventSetup_L1TUtmTriggerMenu_hh
0013 
0014 #include "CondFormats/L1TObjects/interface/L1TUtmScale.h"
0015 #include "CondFormats/L1TObjects/interface/L1TUtmCondition.h"
0016 #include "CondFormats/L1TObjects/interface/L1TUtmAlgorithm.h"
0017 #include "CondFormats/Serialization/interface/Serializable.h"
0018 
0019 #include "tmEventSetup/esTriggerMenu.hh"
0020 
0021 #include <map>
0022 #include <string>
0023 
0024 /**
0025  *  This class implements data structure for TriggerMenu
0026  */
0027 class L1TUtmTriggerMenu {
0028 public:
0029   L1TUtmTriggerMenu()
0030       : algorithm_map_(),
0031         condition_map_(),
0032         scale_map_(),
0033         external_map_(),
0034         token_to_condition_(),
0035         name_(),
0036         version_(),
0037         comment_(),
0038         datetime_(),
0039         uuid_firmware_(),
0040         scale_set_name_(),
0041         n_modules_(),
0042         version(0) {}
0043   L1TUtmTriggerMenu(std::map<std::string, L1TUtmAlgorithm> algorithm_map,
0044                     std::map<std::string, L1TUtmCondition> condition_map,
0045                     std::map<std::string, L1TUtmScale> scale_map,
0046                     std::string name,
0047                     std::string ver_s,
0048                     std::string comment,
0049                     std::string datetime,
0050                     std::string uuid_firmware,
0051                     std::string scale_set_name,
0052                     unsigned int n_modules,
0053                     unsigned int ver_i)
0054       : algorithm_map_(algorithm_map),
0055         condition_map_(condition_map),
0056         scale_map_(scale_map),
0057         external_map_(),
0058         token_to_condition_(),
0059         name_(name),
0060         version_(ver_s),
0061         comment_(comment),
0062         datetime_(datetime),
0063         uuid_firmware_(uuid_firmware),
0064         scale_set_name_(scale_set_name),
0065         n_modules_(n_modules),
0066         version(ver_i) {}
0067 
0068   L1TUtmTriggerMenu(const tmeventsetup::esTriggerMenu& esMenu)
0069       : external_map_(),        //These are null to my best knowledge
0070         token_to_condition_(),  //These are null to my best knowledge
0071         name_(esMenu.getName()),
0072         version_(esMenu.getVersion()),
0073         comment_(esMenu.getComment()),
0074         datetime_(esMenu.getDatetime()),
0075         uuid_firmware_(esMenu.getFirmwareUuid()),
0076         scale_set_name_(esMenu.getScaleSetName()),
0077         n_modules_(esMenu.getNmodules()),
0078         version(0) {
0079     for (const auto& it : esMenu.getAlgorithmMap())
0080       algorithm_map_.emplace(std::make_pair(it.first, L1TUtmAlgorithm(it.second)));
0081     for (const auto& it : esMenu.getConditionMap())
0082       condition_map_.emplace(std::make_pair(it.first, L1TUtmCondition(it.second)));
0083     for (const auto& it : esMenu.getScaleMap())
0084       scale_map_.emplace(std::make_pair(it.first, L1TUtmScale(it.second)));
0085   };
0086 
0087   virtual ~L1TUtmTriggerMenu() = default;
0088 
0089   /** get algorithm_map_
0090      *
0091      * @return reference of algorithm_map_
0092      */
0093   const std::map<std::string, L1TUtmAlgorithm>& getAlgorithmMap() const { return algorithm_map_; };
0094 
0095   /** get condition_map_
0096      *
0097      * @return reference of condition_map_
0098      */
0099   const std::map<std::string, L1TUtmCondition>& getConditionMap() const { return condition_map_; };
0100 
0101   /** get scale_map_
0102      *
0103      * @return reference of scale_map_
0104      */
0105   const std::map<std::string, L1TUtmScale>& getScaleMap() const { return scale_map_; };
0106 
0107   /** get menu name
0108      *
0109      * @return name of the menu
0110      */
0111   const std::string& getName() const { return name_; };
0112 
0113   /** get grammar version
0114      *
0115      * @return grammar version
0116      */
0117   const std::string& getVersion() const { return version_; };
0118 
0119   /** get comment on the menu
0120      *
0121      * @return comment
0122      */
0123   const std::string& getComment() const { return comment_; };
0124 
0125   /** get datetime of the menu
0126      *
0127      * @return datetime
0128      */
0129   const std::string& getDatetime() const { return datetime_; };
0130 
0131   /** get UUID of firmware generated by VHDL producer
0132      *
0133      * @return UUID
0134      */
0135   const std::string& getFirmwareUuid() const { return uuid_firmware_; };
0136 
0137   /** gets the hash of the L1 firmware 
0138      *
0139      * @return the hash identifying the L1 firmware 
0140      */
0141   const unsigned long getFirmwareUuidHashed() const;
0142 
0143   /** get scale set name
0144      *
0145      * @return scale set name
0146      */
0147   const std::string& getScaleSetName() const { return scale_set_name_; };
0148 
0149   /** get number of uGT boards for the menu
0150      *
0151      * @return number of uGT boards
0152      */
0153   const unsigned int getNmodules() const { return n_modules_; };
0154 
0155   /** set menu name
0156      *
0157      * @param value [in] name of the menu
0158      */
0159   void setName(const std::string& value) { name_ = value; };
0160 
0161   /** set grammar version
0162      *
0163      * @param value [in] grammar version
0164      */
0165   void setVersion(const std::string& value) { version_ = value; };
0166 
0167   /** set comment on the menu
0168      *
0169      * @param value [in] comment
0170      */
0171   void setComment(const std::string& value) { comment_ = value; };
0172 
0173   /** set datetime of the menu
0174      *
0175      * @param value [in] datetime
0176      */
0177   void setDatetime(const std::string& value) { datetime_ = value; };
0178 
0179   /** set UUID of firmware generated by VHDL producer
0180      *
0181      * @param value [in] UUID
0182      */
0183   void setFirmwareUuid(const std::string& value) { uuid_firmware_ = value; };
0184 
0185   /** set scale set name
0186      *
0187      * @param value [in] scale set name
0188      */
0189   void setScaleSetName(const std::string& value) { scale_set_name_ = value; };
0190 
0191   /** set number of uGT boards for the menu
0192      *
0193      * @param value [in] number of uGT boards
0194      */
0195   void setNmodules(const unsigned int value) { n_modules_ = value; };
0196 
0197   /** hash computation function
0198      *
0199      * @return computed hash
0200      */
0201   static unsigned long murmurHashNeutral2(const void* key, int len, unsigned int seed);
0202 
0203 protected:
0204   std::map<std::string, L1TUtmAlgorithm> algorithm_map_; /**< map of algorithm <algorithm name, L1TUtmAlgorithm> */
0205   std::map<std::string, L1TUtmCondition> condition_map_; /**< map of condition <condition name, L1TUtmCondition> */
0206   std::map<std::string, L1TUtmScale> scale_map_;         /**< map of scale <scale name, L1TUtmScale*> */
0207   std::map<std::string, unsigned int> external_map_;     /**< map of external <external name, channel id> */
0208   std::map<std::string, std::string>
0209       token_to_condition_;     /**< look-up table for translating expression in grammar to expression in condition */
0210   std::string name_;           /**< name of the menu */
0211   std::string version_;        /**< menu grammar version */
0212   std::string comment_;        /**< comment on the menu */
0213   std::string datetime_;       /**< datetime of the menu */
0214   std::string uuid_firmware_;  /**< uuid of firmware */
0215   std::string scale_set_name_; /**< scale set name */
0216   unsigned int n_modules_;     /**< number of uGT boards for the menu */
0217   unsigned int version;
0218   COND_SERIALIZABLE;
0219 };
0220 
0221 #endif  // tmEventSetup_L1TUtmTriggerMenu_hh