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_L1TUtmObject_hh
0011 #define tmEventSetup_L1TUtmObject_hh
0012 
0013 #include "CondFormats/L1TObjects/interface/L1TUtmCut.h"
0014 #include "CondFormats/Serialization/interface/Serializable.h"
0015 
0016 #include "tmEventSetup/esObject.hh"
0017 
0018 #include <limits>
0019 #include <string>
0020 #include <vector>
0021 
0022 /**
0023  *  This class implements data structure for Object
0024  */
0025 class L1TUtmObject {
0026 public:
0027   L1TUtmObject()
0028       : name_(),
0029         type_(),
0030         comparison_operator_(),
0031         bx_offset_(),
0032         threshold_(),
0033         ext_signal_name_(),
0034         ext_channel_id_(std::numeric_limits<unsigned int>::max()),
0035         cuts_(),
0036         version(0) {}
0037   L1TUtmObject(std::string name,
0038                int type,
0039                int comparison_operator,
0040                int bx_offset,
0041                double threshold,
0042                std::string ext_signal_name,
0043                unsigned int ext_channel_id,
0044                std::vector<L1TUtmCut> cuts,
0045                unsigned int vers)
0046       : name_(name),
0047         type_(type),
0048         comparison_operator_(comparison_operator),
0049         bx_offset_(bx_offset),
0050         threshold_(threshold),
0051         ext_signal_name_(ext_signal_name),
0052         ext_channel_id_(ext_channel_id),
0053         cuts_(cuts),
0054         version(vers) {}
0055 
0056   L1TUtmObject(const tmeventsetup::esObject& esObj)
0057       : name_(esObj.getName()),
0058         type_(esObj.getType()),
0059         comparison_operator_(esObj.getComparisonOperator()),
0060         bx_offset_(esObj.getBxOffset()),
0061         threshold_(esObj.getThreshold()),
0062         ext_signal_name_(esObj.getExternalSignalName()),
0063         ext_channel_id_(esObj.getExternalChannelId()),
0064         version(0) {
0065     cuts_.reserve(esObj.getCuts().size());
0066     for (auto it = esObj.getCuts().begin(); it != esObj.getCuts().end(); ++it)
0067       cuts_.emplace_back(L1TUtmCut(*it));
0068   };
0069 
0070   virtual ~L1TUtmObject() = default;
0071 
0072   /** set object name */
0073   void setName(const std::string& x) { name_ = x; };
0074 
0075   /** set object type */
0076   void setType(const int x) { type_ = x; };
0077 
0078   /** set comparison operator for threshold */
0079   void setComparisonOperator(const int x) { comparison_operator_ = x; };
0080 
0081   /** set BX offset of the object */
0082   void setBxOffset(const int x) { bx_offset_ = x; };
0083 
0084   /** set Et/pT threshold in GeV */
0085   void setThreshold(double x) { threshold_ = x; };
0086 
0087   /** set external name */
0088   void setExternalSignalName(const std::string& x) { ext_signal_name_ = x; };
0089 
0090   /** set external channel id */
0091   void setExternalChannelId(const unsigned int x) { ext_channel_id_ = x; };
0092 
0093   /** set cuts */
0094   void setCuts(const std::vector<L1TUtmCut>& x) { cuts_ = x; };
0095 
0096   /** get object name */
0097   const std::string& getName() const { return name_; };
0098 
0099   /** get object type */
0100   const int getType() const { return type_; };
0101 
0102   /** get comparison operator for threshold cut */
0103   const int getComparisonOperator() const { return comparison_operator_; };
0104 
0105   /** get BX offset of the object */
0106   const int getBxOffset() const { return bx_offset_; };
0107 
0108   /** get Et/pT threshold in GeV */
0109   const double getThreshold() const { return threshold_; };
0110 
0111   /** get external name */
0112   const std::string& getExternalSignalName() const { return ext_signal_name_; };
0113 
0114   /** get external channel id */
0115   const unsigned int getExternalChannelId() const { return ext_channel_id_; };
0116 
0117   /** get cuts on the object */
0118   const std::vector<L1TUtmCut>& getCuts() const { return cuts_; };
0119 
0120 protected:
0121   std::string name_;            /**< name of object */
0122   int type_;                    /**< type of object */
0123   int comparison_operator_;     /**< comparison operator for threshold cut */
0124   int bx_offset_;               /**< bunch crossing  offset of object */
0125   double threshold_;            /**< threshold in GeV */
0126   std::string ext_signal_name_; /**< name of extenal signal, only valid when esObjectType == EXT */
0127   unsigned int ext_channel_id_; /**< channel id of external signal, only valid when esObjectType == EXT */
0128   std::vector<L1TUtmCut> cuts_; /**< list of cuts applied on object */
0129   unsigned int version;
0130   COND_SERIALIZABLE;
0131 };
0132 
0133 #endif  // tmEventSetup_L1TUtmObject_hh