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      Takashi Matsushita
0007  * Created:     12 Mar 2015
0008  */
0009 
0010 #ifndef tmEventSetup_L1TUtmAlgorithm_hh
0011 #define tmEventSetup_L1TUtmAlgorithm_hh
0012 
0013 #include <set>
0014 #include <string>
0015 #include <vector>
0016 #include "CondFormats/Serialization/interface/Serializable.h"
0017 #include "tmEventSetup/esAlgorithm.hh"
0018 
0019 /**
0020  *  This class implements data structure for Algorithm
0021  */
0022 class L1TUtmAlgorithm {
0023 public:
0024   L1TUtmAlgorithm()
0025       : name_(),
0026         expression_(),
0027         expression_in_condition_(),
0028         rpn_vector_(),
0029         index_(),
0030         module_id_(),
0031         module_index_(),
0032         version(0) {}
0033   L1TUtmAlgorithm(std::string name,
0034                   std::string expression,
0035                   std::string expression_in_condition,
0036                   std::vector<std::string> rpn_vector,
0037                   unsigned int index,
0038                   unsigned int module_id,
0039                   unsigned int module_index,
0040                   unsigned int ver)
0041       : name_(name),
0042         expression_(expression),
0043         expression_in_condition_(expression_in_condition),
0044         rpn_vector_(rpn_vector),
0045         index_(index),
0046         module_id_(module_id),
0047         module_index_(module_index),
0048         version(ver) {}
0049 
0050   L1TUtmAlgorithm(const tmeventsetup::esAlgorithm& esAlg)
0051       : L1TUtmAlgorithm(esAlg.getName(),
0052                         esAlg.getExpression(),
0053                         esAlg.getExpressionInCondition(),
0054                         esAlg.getRpnVector(),
0055                         esAlg.getIndex(),
0056                         esAlg.getModuleId(),
0057                         esAlg.getModuleIndex(),
0058                         0  //There is no version retrieval in esAlgorithm. However, it seems pretty hard coded to 0
0059         ) {};
0060 
0061   virtual ~L1TUtmAlgorithm() = default;
0062 
0063   /** set rpn_vector_ */
0064   void setRpnVector(const std::vector<std::string>& x) { rpn_vector_ = x; };
0065 
0066   /** get algorithm name */
0067   const std::string& getName() const { return name_; };
0068 
0069   /** get algorithm expression in grammar */
0070   const std::string& getExpression() const { return expression_; };
0071 
0072   /** get algorithm expression in condition */
0073   const std::string& getExpressionInCondition() const { return expression_in_condition_; };
0074 
0075   /** get reverse polish notion of algorithm expression in condition */
0076   const std::vector<std::string>& getRpnVector() const { return rpn_vector_; };
0077 
0078   /** get algorithm index */
0079   unsigned int getIndex() const { return index_; };
0080 
0081   /** get module id */
0082   unsigned int getModuleId() const { return module_id_; };
0083 
0084   /** get module index */
0085   unsigned int getModuleIndex() const { return module_index_; };
0086 
0087 protected:
0088   std::string name_;                    /**< name of algorithm */
0089   std::string expression_;              /**< algorithm expression in grammar */
0090   std::string expression_in_condition_; /**< algorithm expression in condition */
0091   std::vector<std::string> rpn_vector_; /**< reverse polish notation of algorithm expression in condition */
0092   unsigned int index_;                  /**< index of algorithm (global) */
0093   unsigned int module_id_;              /**< module id */
0094   unsigned int module_index_;           /**< index of algorithm in module (local to module id) */
0095   unsigned int version;
0096 
0097   COND_SERIALIZABLE;
0098 };
0099 
0100 #endif  // tmEventSetup_L1TUtmAlgorithm_hh