CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/CalibFormats/SiPixelObjects/interface/PixelDACScanRange.h

Go to the documentation of this file.
00001 #ifndef PixelDACScanRange_h
00002 #define PixelDACScanRange_h
00003 
00008 //
00009 // This class collects the information
00010 // about the range of DAC settings used
00011 // in scans of the DACs.
00012 //
00013 //
00014 //
00015 
00016 #include <string>
00017 #include <vector>
00018 #include <cassert>
00019 
00020 namespace pos{
00026   class PixelDACScanRange {
00027 
00028   public:
00029 
00030     PixelDACScanRange(){;}
00031     PixelDACScanRange(std::string dacname, unsigned int first, 
00032                       unsigned int last, unsigned int step,
00033                       unsigned int index, bool mixValuesAcrossROCs);
00034     PixelDACScanRange(std::string name, 
00035                       std::vector<unsigned int> values,
00036                       unsigned int index, bool mixValuesAcrossROCs);
00037 
00038     std::string name() const { return name_;}
00039     unsigned int dacchannel() const { return dacchannel_; }
00040     unsigned int step() const { assert(uniformSteps_); return step_; }
00041     unsigned int first() const { assert(uniformSteps_); return first_; }
00042     unsigned int last() const { assert(uniformSteps_); return last_; }
00043     unsigned int index() const { return index_; }
00044     unsigned int getNPoints() const { return values_.size(); }
00045     unsigned int value(unsigned int ivalue) const { assert(ivalue<values_.size()); return values_[ivalue]; }
00046     bool mixValuesAcrossROCs() const { return mixValuesAcrossROCs_; }
00047     bool uniformSteps() const { return uniformSteps_; }
00048     void setRelative() { relative_=true; }
00049     bool relative() const { return relative_; }
00050     void setNegative() { negative_=true; }
00051     bool negative() const { return negative_; }
00052 
00053     std::vector<unsigned int> values() const { return values_; }
00054 
00055   private:
00056 
00057     void setDACChannel(std::string name);
00058 
00059 
00060     std::string name_;
00061     unsigned int dacchannel_;
00062     bool uniformSteps_;
00063     unsigned int first_;
00064     unsigned int last_;
00065     unsigned int step_;
00066     std::vector<unsigned int> values_;
00067     unsigned int index_;
00068 
00069     bool mixValuesAcrossROCs_; // whether to spread the DAC values across the entire range on each iteration for different ROCs on a channel
00070 
00071     bool relative_; //Only to be used with 'SetRelative' and indicates that the
00072                     //value specified should apply a change to the default
00073                     //dac setting.
00074 
00075     bool negative_; //Used to flag that relative value is negative
00076 
00077   };
00078 }
00079 #endif