Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:47:22

0001 #ifndef PixelDACScanRange_h
0002 #define PixelDACScanRange_h
0003 /*! \file CalibFormats/SiPixelObjects/interface/PixelConfigurationVerifier.h
0004 *   \brief This class collects the information about the range of DAC settings used in scans of the DACs
0005 *
0006 *   A longer explanation will be placed here later
0007 */
0008 //
0009 // This class collects the information
0010 // about the range of DAC settings used
0011 // in scans of the DACs.
0012 //
0013 //
0014 //
0015 
0016 #include <string>
0017 #include <vector>
0018 #include <cassert>
0019 
0020 namespace pos {
0021   /*! \class PixelConfigurationVerifier PixelConfigurationVerifier.h "interface/PixelConfigurationVerifier.h"
0022 *   \brief This class collects the information about the range of DAC settings used in scans of the DACs
0023 *
0024 *   A longer explanation will be placed here later
0025 */
0026   class PixelDACScanRange {
0027   public:
0028     PixelDACScanRange() { ; }
0029     PixelDACScanRange(std::string dacname,
0030                       unsigned int first,
0031                       unsigned int last,
0032                       unsigned int step,
0033                       unsigned int index,
0034                       bool mixValuesAcrossROCs);
0035     PixelDACScanRange(std::string name,
0036                       const std::vector<unsigned int>& values,
0037                       unsigned int index,
0038                       bool mixValuesAcrossROCs);
0039 
0040     std::string name() const { return name_; }
0041     unsigned int dacchannel() const { return dacchannel_; }
0042     unsigned int step() const {
0043       assert(uniformSteps_);
0044       return step_;
0045     }
0046     unsigned int first() const {
0047       assert(uniformSteps_);
0048       return first_;
0049     }
0050     unsigned int last() const {
0051       assert(uniformSteps_);
0052       return last_;
0053     }
0054     unsigned int index() const { return index_; }
0055     unsigned int getNPoints() const { return values_.size(); }
0056     unsigned int value(unsigned int ivalue) const {
0057       assert(ivalue < values_.size());
0058       return values_[ivalue];
0059     }
0060     bool mixValuesAcrossROCs() const { return mixValuesAcrossROCs_; }
0061     bool uniformSteps() const { return uniformSteps_; }
0062     void setRelative() { relative_ = true; }
0063     bool relative() const { return relative_; }
0064     void setNegative() { negative_ = true; }
0065     bool negative() const { return negative_; }
0066 
0067     std::vector<unsigned int> values() const { return values_; }
0068 
0069   private:
0070     void setDACChannel(std::string name);
0071 
0072     std::string name_;
0073     unsigned int dacchannel_;
0074     bool uniformSteps_;
0075     unsigned int first_;
0076     unsigned int last_;
0077     unsigned int step_;
0078     std::vector<unsigned int> values_;
0079     unsigned int index_;
0080 
0081     bool mixValuesAcrossROCs_;  // whether to spread the DAC values across the entire range on each iteration for different ROCs on a channel
0082 
0083     bool relative_;  //Only to be used with 'SetRelative' and indicates that the
0084                      //value specified should apply a change to the default
0085                      //dac setting.
0086 
0087     bool negative_;  //Used to flag that relative value is negative
0088   };
0089 }  // namespace pos
0090 #endif