Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:21

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_L1TUtmCondition_hh
0011 #define tmEventSetup_L1TUtmCondition_hh
0012 
0013 #include "CondFormats/L1TObjects/interface/L1TUtmCut.h"
0014 #include "CondFormats/L1TObjects/interface/L1TUtmObject.h"
0015 #include "CondFormats/Serialization/interface/Serializable.h"
0016 
0017 #include "tmEventSetup/esCondition.hh"
0018 
0019 #include <string>
0020 #include <vector>
0021 
0022 /**
0023  *  This class implements data structure for Condition
0024  */
0025 class L1TUtmCondition {
0026 public:
0027   L1TUtmCondition() : name_(), type_(-9999), objects_(), cuts_(), version(0){};
0028   L1TUtmCondition(
0029       std::string name, int type, std::vector<L1TUtmObject> objects, std::vector<L1TUtmCut> cuts, unsigned int vers)
0030       : name_(name), type_(type), objects_(objects), cuts_(cuts), version(vers){};
0031 
0032   L1TUtmCondition(const tmeventsetup::esCondition& esCond)
0033       : name_(esCond.getName()), type_(esCond.getType()), version(0) {
0034     objects_.reserve(esCond.getObjects().size());
0035     for (auto it = esCond.getObjects().begin(); it != esCond.getObjects().end(); ++it)
0036       objects_.emplace_back(L1TUtmObject(*it));
0037     cuts_.reserve(esCond.getCuts().size());
0038     for (auto it = esCond.getCuts().begin(); it != esCond.getCuts().end(); ++it)
0039       cuts_.emplace_back(L1TUtmCut(*it));
0040   };
0041 
0042   virtual ~L1TUtmCondition() = default;
0043 
0044   /** set condition name */
0045   void setName(const std::string& x) { name_ = x; };
0046 
0047   /** set condition type */
0048   void setType(const int x) { type_ = x; };
0049 
0050   /** get condition name */
0051   const std::string& getName() const { return name_; };
0052 
0053   /** get condition type */
0054   const int getType() const { return type_; };
0055 
0056   /** get objects associated with the condition */
0057   const std::vector<L1TUtmObject>& getObjects() const { return objects_; };
0058 
0059   /** get cuts associated with the condition */
0060   const std::vector<L1TUtmCut>& getCuts() const { return cuts_; };
0061 
0062 protected:
0063   std::string name_;                  /**< name of condition */
0064   int type_;                          /**< type of condition */
0065   std::vector<L1TUtmObject> objects_; /**< list of objects used in condition */
0066   std::vector<L1TUtmCut> cuts_;       /**< list of cuts applied on condition */
0067   unsigned int version;
0068   COND_SERIALIZABLE;
0069 };
0070 
0071 #endif  // tmEventSetup_L1TUtmCondition_hh