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:     8 Nov 2015
0008  */
0009 
0010 #ifndef tmEventSetup_L1TUtmCut_hh
0011 #define tmEventSetup_L1TUtmCut_hh
0012 
0013 #include "CondFormats/L1TObjects/interface/L1TUtmCutValue.h"
0014 #include "CondFormats/Serialization/interface/Serializable.h"
0015 
0016 #include "tmEventSetup/esCut.hh"
0017 
0018 #include <string>
0019 
0020 /**
0021  *  This class implements data structure for Cut
0022  */
0023 class L1TUtmCut {
0024 public:
0025   L1TUtmCut() : name_(), object_type_(), cut_type_(), minimum_(), maximum_(), data_(), key_(), version(0) {}
0026   L1TUtmCut(std::string name,
0027             int object_type,
0028             int cut_type,
0029             L1TUtmCutValue minimum,
0030             L1TUtmCutValue maximum,
0031             std::string data,
0032             std::string key,
0033             unsigned int vers)
0034       : name_(name),
0035         object_type_(object_type),
0036         cut_type_(cut_type),
0037         minimum_(minimum),
0038         maximum_(maximum),
0039         data_(data),
0040         key_(key),
0041         version(vers) {}
0042 
0043   L1TUtmCut(const tmeventsetup::esCut& esC)
0044       : L1TUtmCut(esC.getName(),
0045                   esC.getObjectType(),
0046                   esC.getCutType(),
0047                   L1TUtmCutValue(esC.getMinimum()),
0048                   L1TUtmCutValue(esC.getMaximum()),
0049                   esC.getData(),
0050                   esC.getKey(),
0051                   0) {};
0052 
0053   virtual ~L1TUtmCut() = default;
0054 
0055   /** set cut name */
0056   void setName(const std::string& name) { name_ = name; };
0057 
0058   /** set object type */
0059   void setObjectType(const int type) { object_type_ = type; };
0060 
0061   /** set cut type */
0062   void setCutType(const int type) { cut_type_ = type; };
0063 
0064   /** set minimum value of cut range (double) */
0065   void setMinimumValue(const double value) { minimum_.value = value; };
0066 
0067   /** set minimum value of cut range (HW index) */
0068   void setMinimumIndex(const unsigned int index) { minimum_.index = index; };
0069 
0070   /** set minimum value of cut range (L1TUtmCutValue struct) */
0071   void setMinimum(const L1TUtmCutValue& minimum) { minimum_ = minimum; };
0072 
0073   /** set maximum value of cut range (double) */
0074   void setMaximumValue(const double value) { maximum_.value = value; };
0075 
0076   /** set maximum value of cut range (HW index) */
0077   void setMaximumIndex(const unsigned int index) { maximum_.index = index; };
0078 
0079   /** set maximum value of cut range (L1TUtmCutValue struct) */
0080   void setMaximum(const L1TUtmCutValue& maximum) { maximum_ = maximum; };
0081 
0082   /** set precision for cut value calculations */
0083   void setPrecision(const unsigned int precision) {
0084     setMaximumIndex(precision);
0085     setMinimumIndex(precision);
0086   };  // HACK
0087 
0088   /** get cut name */
0089   const std::string& getName() const { return name_; };
0090 
0091   /** get target object type : combination of esObjectType and esFunctionType enums */
0092   const int getObjectType() const { return object_type_; };
0093 
0094   /** get cut type */
0095   const int getCutType() const { return cut_type_; };
0096 
0097   /** get L1TUtmCutValue struct for minimum value of cut range */
0098   const L1TUtmCutValue& getMinimum() const { return minimum_; };
0099 
0100   /** get L1TUtmCutValue struct for maximum value of cut range */
0101   const L1TUtmCutValue& getMaximum() const { return maximum_; };
0102 
0103   /** get L1TUtmCutValue struct for minimum value of cut range */
0104   const double getMinimumValue() const { return minimum_.value; };
0105 
0106   /** get L1TUtmCutValue struct for maximum value of cut range */
0107   const double getMaximumValue() const { return maximum_.value; };
0108 
0109   /** get L1TUtmCutValue struct for minimum value of cut range */
0110   const unsigned int getMinimumIndex() const { return minimum_.index; };
0111 
0112   /** get L1TUtmCutValue struct for maximum value of cut range */
0113   const unsigned int getMaximumIndex() const { return maximum_.index; };
0114 
0115   /** get data */
0116   const std::string& getData() const { return data_; };
0117 
0118   /** get key */
0119   const std::string& getKey() const { return key_; };
0120 
0121   /** get precision */
0122   const unsigned int getPrecision() const { return getMinimumIndex(); };  // HACK
0123 
0124 protected:
0125   std::string name_;       /**< name of cut */
0126   int object_type_;        /**< target object type */
0127   int cut_type_;           /**< type of cut */
0128   L1TUtmCutValue minimum_; /**< minimum value of cut range */
0129   L1TUtmCutValue maximum_; /**< maximum value of cut range */
0130   std::string data_;       /**< data for charge/quality/isolation/charge correlation/impact parameter */
0131   std::string key_;        /**< key for accessing a scale */
0132   unsigned int version;
0133   COND_SERIALIZABLE;
0134 };
0135 
0136 #endif  // tmEventSetup_L1TUtmCut_hh