PixelDACScanRange

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
#ifndef PixelDACScanRange_h
#define PixelDACScanRange_h
/*! \file CalibFormats/SiPixelObjects/interface/PixelConfigurationVerifier.h
*   \brief This class collects the information about the range of DAC settings used in scans of the DACs
*
*   A longer explanation will be placed here later
*/
//
// This class collects the information
// about the range of DAC settings used
// in scans of the DACs.
//
//
//

#include <string>
#include <vector>
#include <cassert>

namespace pos {
  /*! \class PixelConfigurationVerifier PixelConfigurationVerifier.h "interface/PixelConfigurationVerifier.h"
*   \brief This class collects the information about the range of DAC settings used in scans of the DACs
*
*   A longer explanation will be placed here later
*/
  class PixelDACScanRange {
  public:
    PixelDACScanRange() { ; }
    PixelDACScanRange(std::string dacname,
                      unsigned int first,
                      unsigned int last,
                      unsigned int step,
                      unsigned int index,
                      bool mixValuesAcrossROCs);
    PixelDACScanRange(std::string name,
                      const std::vector<unsigned int>& values,
                      unsigned int index,
                      bool mixValuesAcrossROCs);

    std::string name() const { return name_; }
    unsigned int dacchannel() const { return dacchannel_; }
    unsigned int step() const {
      assert(uniformSteps_);
      return step_;
    }
    unsigned int first() const {
      assert(uniformSteps_);
      return first_;
    }
    unsigned int last() const {
      assert(uniformSteps_);
      return last_;
    }
    unsigned int index() const { return index_; }
    unsigned int getNPoints() const { return values_.size(); }
    unsigned int value(unsigned int ivalue) const {
      assert(ivalue < values_.size());
      return values_[ivalue];
    }
    bool mixValuesAcrossROCs() const { return mixValuesAcrossROCs_; }
    bool uniformSteps() const { return uniformSteps_; }
    void setRelative() { relative_ = true; }
    bool relative() const { return relative_; }
    void setNegative() { negative_ = true; }
    bool negative() const { return negative_; }

    std::vector<unsigned int> values() const { return values_; }

  private:
    void setDACChannel(std::string name);

    std::string name_;
    unsigned int dacchannel_;
    bool uniformSteps_;
    unsigned int first_;
    unsigned int last_;
    unsigned int step_;
    std::vector<unsigned int> values_;
    unsigned int index_;

    bool mixValuesAcrossROCs_;  // whether to spread the DAC values across the entire range on each iteration for different ROCs on a channel

    bool relative_;  //Only to be used with 'SetRelative' and indicates that the
                     //value specified should apply a change to the default
                     //dac setting.

    bool negative_;  //Used to flag that relative value is negative
  };
}  // namespace pos
#endif