CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/CalibFormats/SiPixelObjects/src/PixelDACScanRange.cc

Go to the documentation of this file.
00001 //
00002 // This class collects the information
00003 // about the range of DAC settings used
00004 // in scans of the DACs.
00005 //
00006 //
00007 //
00008 
00009 #include "CalibFormats/SiPixelObjects/interface/PixelDACScanRange.h"
00010 #include "CalibFormats/SiPixelObjects/interface/PixelDACNames.h"
00011 #include <iostream>
00012 #include <assert.h>
00013 
00014 using namespace pos;
00015 
00016 PixelDACScanRange::PixelDACScanRange(std::string name, unsigned int first, 
00017                                      unsigned int last, unsigned int step,
00018                                      unsigned int index, bool mixValuesAcrossROCs){
00019 
00020   uniformSteps_=true;
00021   relative_=false;
00022   negative_=false;
00023 
00024   first_=first;
00025   last_=last;
00026   step_=step;
00027   
00028   name_=name;
00029   index_=index;
00030   mixValuesAcrossROCs_=mixValuesAcrossROCs;
00031   if (first_==last_) assert( mixValuesAcrossROCs==false );
00032   while(first<=last){
00033     values_.push_back(first);
00034     first+=step;
00035     //FIXME should have a better reporting
00036     assert(values_.size()<1000);
00037   }
00038 
00039   setDACChannel(name);
00040 
00041 }
00042 
00043 PixelDACScanRange::PixelDACScanRange(std::string name, 
00044                                      std::vector<unsigned int> values,
00045                                      unsigned int index, bool mixValuesAcrossROCs){
00046 
00047   uniformSteps_=false;
00048   relative_=false;
00049   negative_=false;
00050 
00051   name_=name;
00052   values_=values;
00053   mixValuesAcrossROCs_=mixValuesAcrossROCs;
00054   assert( mixValuesAcrossROCs==false );
00055 
00056   setDACChannel(name);
00057 
00058 }
00059 
00060 
00061 void PixelDACScanRange::setDACChannel(std::string name){
00062 
00063   if (name==pos::k_DACName_Vdd)                {
00064     dacchannel_=pos::k_DACAddress_Vdd          ;
00065   } else if (name==pos::k_DACName_Vana)        {
00066     dacchannel_=pos::k_DACAddress_Vana         ;
00067   } else if (name==pos::k_DACName_Vsf)         {
00068     dacchannel_=pos::k_DACAddress_Vsf          ;
00069   } else if (name==pos::k_DACName_Vcomp)       {
00070     dacchannel_=pos::k_DACAddress_Vcomp        ;
00071   } else if (name==pos::k_DACName_Vleak)       {
00072     dacchannel_=pos::k_DACAddress_Vleak        ;
00073   } else if (name==pos::k_DACName_VrgPr)       {
00074     dacchannel_=pos::k_DACAddress_VrgPr        ;
00075   } else if (name==pos::k_DACName_VwllPr)      {
00076     dacchannel_=pos::k_DACAddress_VwllPr       ;
00077   } else if (name==pos::k_DACName_VrgSh)       {
00078     dacchannel_=pos::k_DACAddress_VrgSh        ;
00079   } else if (name==pos::k_DACName_VwllSh)      {
00080     dacchannel_=pos::k_DACAddress_VwllSh       ;
00081   } else if (name==pos::k_DACName_VHldDel)     {
00082     dacchannel_=pos::k_DACAddress_VHldDel      ;
00083   } else if (name==pos::k_DACName_Vtrim)       {
00084     dacchannel_=pos::k_DACAddress_Vtrim        ;
00085   } else if (name==pos::k_DACName_VcThr)       {
00086     dacchannel_=pos::k_DACAddress_VcThr        ;
00087   } else if (name==pos::k_DACName_VIbias_bus)  {
00088     dacchannel_=pos::k_DACAddress_VIbias_bus   ;
00089   } else if (name==pos::k_DACName_VIbias_sf)   {
00090     dacchannel_=pos::k_DACAddress_VIbias_sf    ;
00091   } else if (name==pos::k_DACName_VOffsetOp)   {
00092     dacchannel_=pos::k_DACAddress_VOffsetOp    ;
00093   } else if (name==pos::k_DACName_VbiasOp)     {
00094     dacchannel_=pos::k_DACAddress_VbiasOp      ;
00095   } else if (name==pos::k_DACName_VOffsetRO)   {
00096     dacchannel_=pos::k_DACAddress_VOffsetRO    ;
00097   } else if (name==pos::k_DACName_VIon)        {
00098     dacchannel_=pos::k_DACAddress_VIon         ;
00099   } else if (name==pos::k_DACName_VIbias_PH)   {
00100     dacchannel_=pos::k_DACAddress_VIbias_PH    ;
00101   } else if (name==pos::k_DACName_VIbias_DAC)  {
00102     dacchannel_=pos::k_DACAddress_VIbias_DAC   ;
00103   } else if (name==pos::k_DACName_VIbias_roc)  {
00104     dacchannel_=pos::k_DACAddress_VIbias_roc   ;
00105   } else if (name==pos::k_DACName_VIColOr)     {
00106     dacchannel_=pos::k_DACAddress_VIColOr      ;
00107   } else if (name==pos::k_DACName_Vnpix)       {
00108     dacchannel_=pos::k_DACAddress_Vnpix        ;
00109   } else if (name==pos::k_DACName_VsumCol)     {
00110     dacchannel_=pos::k_DACAddress_VsumCol      ;
00111   } else if (name==pos::k_DACName_Vcal)        {
00112     dacchannel_=pos::k_DACAddress_Vcal         ;
00113   } else if (name==pos::k_DACName_CalDel)      {
00114     dacchannel_=pos::k_DACAddress_CalDel       ;
00115   } else if (name==pos::k_DACName_WBC)         {
00116     dacchannel_=pos::k_DACAddress_WBC          ;
00117   } else if (name==pos::k_DACName_ChipContReg) {
00118     dacchannel_=pos::k_DACAddress_ChipContReg  ;
00119   } else {
00120     std::cout << __LINE__ << "]\t[PixelDACScanRange::setDACChannel()]\t\t\t    " 
00121               << "The dac name: " << name << " is unknown!" << std::endl;
00122     assert(0);
00123   }
00124 }
00125