CMS 3D CMS Logo

Classes | Modules | Functions | Variables | Friends

"Configuration Objects"

This is the base class of all configuration objects. More...

Classes

class  pos::PixelCalibConfiguration
 This class implements the steps that are used in a scan over Threshold and CalDelay. More...
class  pos::PixelConfigBase
 This file contains the base class for "pixel configuration data" management. More...
class  pos::PixelDACSettings
 This class is responsible for manipulating the DACsettings of a ROC. More...
class  pos::PixelDelay25Calib
 This class manages data and files used in the Delay25 calibration. More...
class  pos::PixelDetectorConfig
 This is the documentation about PixelDetectorConfig... More...
class  pos::PixelFECConfig
 This class specifies which FEC boards are used and how they are addressed. More...
class  pos::PixelFEDCard
 This is the documentation about PixelFEDCard... More...
class  pos::PixelFEDConfig
 This is the documentation about PixelFEDConfig... More...
class  pos::PixelGlobalDelay25
 This class specifies which delay25 channels are delayed over the entire pixel detector and by how much. More...
class  pos::PixelLowVoltageMap
 This is the documentation about PixelLowVoltageMap... More...
class  pos::PixelLTCConfig
 This is the documentation about PixelLTCConfig... More...
class  pos::PixelMaskAllPixels
 This is the documentation about PixelMaskAllPixels... More...
class  pos::PixelMaskBase
 This is the documentation about PixelMaskBase... More...
class  pos::PixelMaskOverride
 This is the documentation about PixelMaskOverride... More...
class  pos::PixelMaskOverrideBase
 This is the documentation about PixelMaskOverrideBase... More...
class  pos::PixelMaxVsf
 This is the documentation about PixelMaxVsf... More...
class  pos::PixelNameTranslation
 This is the documentation about PixelNameTranslation... More...
class  pos::PixelPortCardConfig
 This is the documentation about PixelNameTranslation... More...
class  pos::PixelTBMSettings
 This is the documentation about PixelTBMSettings... More...
class  pos::PixelTKFECConfig
 This class specifies which TKFEC boards are used and how they are addressed. More...
class  pos::PixelTrimBase
 This class implements.. More...
class  pos::PixelTrimCommon
 This class implements.. More...

Modules

 "Trim Objects"

Functions

void pos::PixelDACSettings::addROC (PixelROCDACSettings &rocname)
void pos::PixelDACSettings::generateConfiguration (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans, PixelDetectorConfig *detconfig, bool HVon=true) const
PixelROCDACSettings pos::PixelDACSettings::getDACSettings (int ROCId) const
PixelROCDACSettingspos::PixelDACSettings::getDACSettings (PixelROCName)
unsigned int pos::PixelDACSettings::numROCs ()
 pos::PixelDACSettings::PixelDACSettings (PixelROCDACSettings &rocname)
 pos::PixelDACSettings::PixelDACSettings (std::vector< std::vector< std::string > > &tableMat)
bool pos::PixelDACSettings::rocIsDisabled (const PixelDetectorConfig *detconfig, const PixelROCName rocname) const
void pos::PixelDACSettings::setVcthrDisable (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans) const
void pos::PixelDACSettings::setVcthrEnable (PixelFECConfigInterface *pixelFEC, PixelNameTranslation *trans, PixelDetectorConfig *detconfig) const
void pos::PixelDACSettings::writeASCII (std::string dir) const
void pos::PixelDACSettings::writeBinary (std::string filename) const
virtual void pos::PixelDACSettings::writeXML (std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
void pos::PixelDACSettings::writeXML (pos::PixelConfigKey key, int version, std::string path) const
virtual void pos::PixelDACSettings::writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
virtual void pos::PixelDACSettings::writeXMLTrailer (std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const

Variables

std::vector< PixelROCDACSettings > pos::PixelDACSettings::dacsettings_

Friends

std::ostream & pos::PixelDACSettings::operator<< (std::ostream &s, const PixelDACSettings &mask)

Detailed Description

This is the base class of all configuration objects.

A longer explanation of what a 'configuration object' actually is will be posted here once we find the time to write it....


Function Documentation

void PixelDACSettings::addROC ( PixelROCDACSettings rocname) [inherited]

Definition at line 153 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_.

{
  dacsettings_.push_back(rocname) ;
}
void PixelDACSettings::generateConfiguration ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans,
PixelDetectorConfig detconfig,
bool  HVon = true 
) const [inherited]

Definition at line 531 of file PixelDACSettings.cc.

References pos::PixelFECConfigInterface::clrcal(), pos::PixelDACSettings::dacsettings_, pos::PixelFECConfigInterface::dcolenable(), pos::PixelNameTranslation::getHdwAddress(), pos::PixelHdwAddress::hubaddress(), i, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progdac(), pos::PixelFECConfigInterface::qbufsend(), pos::PixelHdwAddress::rocid(), pos::PixelDACSettings::rocIsDisabled(), and pos::PixelFECConfigInterface::setAllDAC().

                                                                                                                          {

  bool bufferData=true; 

  std::vector<unsigned int> dacs;

  //pixelFEC->fecDebug(1);  //FIXME someday maybe don't want to take the time

  for(unsigned int i=0;i<dacsettings_.size();i++){

    bool disableRoc = rocIsDisabled(detconfig, dacsettings_[i].getROCName());

    dacsettings_[i].getDACs(dacs);

    PixelHdwAddress theROC=*(trans->getHdwAddress(dacsettings_[i].getROCName()));

    //Need to set readout speed (40MHz) and Vcal range (0-1800 mV) and enable the chip

    int controlreg=dacsettings_[i].getControlRegister();
    //std::cout << "[PixelDACSettings::generateConfiguration] ROC control reg to be set to: " <<  controlreg <<std::endl;

    pixelFEC->progdac(theROC.mfec(),
                      theROC.mfecchannel(),
                      theROC.hubaddress(),
                      theROC.portaddress(),
                      theROC.rocid(),
                      0xfd,
                      controlreg,
                      bufferData);

    //    std::cout<<"ROC="<<dacsettings_[i].getROCName()<<" ; VcThr set to "<<dacs[11]<<std::flush; //for debugging
    if (!HVon || disableRoc)    dacs[11]=0; //set Vcthr DAC to 0 (Vcthr is DAC 12=11+1)
    //    std::cout<<" ; setting VcThr to "<<dacs[11]<<std::endl; //for debugging
    pixelFEC->setAllDAC(theROC,dacs,bufferData);

    // start with no pixels on for calibration
    pixelFEC->clrcal(theROC.mfec(), 
                     theROC.mfecchannel(), 
                     theROC.hubaddress(), 
                     theROC.portaddress(),  
                     theROC.rocid(),
                     bufferData);

    // enable all the double columns
    for(int dcol=0;dcol<26;dcol++){
      pixelFEC->dcolenable(theROC.mfec(),
                           theROC.mfecchannel(),
                           theROC.hubaddress(),
                           theROC.portaddress(),
                           theROC.rocid(),
                           dcol,
                           1,
                           bufferData);
    }

    if (!HVon || disableRoc) { //HV off
      //      std::cout << "[PixelDACSettings::generateConfiguration] HV off! ROC control reg to be set to: " <<  (controlreg|0x2) <<std::endl;
      pixelFEC->progdac(theROC.mfec(),
                        theROC.mfecchannel(),
                        theROC.hubaddress(),
                        theROC.portaddress(),
                        theROC.rocid(),
                        0xfd,
                        controlreg | 0x2, //=010 in binary. should disable the chip
                        bufferData);
    }
  }

  if (bufferData) {
    pixelFEC->qbufsend();
  }

}
PixelROCDACSettings PixelDACSettings::getDACSettings ( int  ROCId) const [inherited]

Definition at line 365 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_.

Referenced by operator<<().

                                                                    {

  return dacsettings_[ROCId];

}
PixelROCDACSettings * PixelDACSettings::getDACSettings ( PixelROCName  name) [inherited]

Definition at line 371 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, i, and mergeVDriftHistosByStation::name.

                                                                      {

  for(unsigned int i=0;i<dacsettings_.size();i++){
    if (dacsettings_[i].getROCName()==name) return &(dacsettings_[i]);
  }

  return 0;

}
unsigned int pos::PixelDACSettings::numROCs ( ) [inline, inherited]

Definition at line 76 of file PixelDACSettings.h.

References pos::PixelDACSettings::dacsettings_.

{return dacsettings_.size();}
PixelDACSettings::PixelDACSettings ( PixelROCDACSettings rocname) [inherited]

Definition at line 147 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_.

                                                              :
  PixelConfigBase("","","") {
  dacsettings_.push_back(rocname) ;
}
PixelDACSettings::PixelDACSettings ( std::vector< std::vector< std::string > > &  tableMat) [inherited]

Definition at line 158 of file PixelDACSettings.cc.

References trackerHits::c, dtNoiseDBValidation_cfg::cerr, pos::PixelDACSettings::dacsettings_, pos::k_DACName_CalDel, pos::k_DACName_ChipContReg, pos::k_DACName_TempRange, pos::k_DACName_Vana, pos::k_DACName_VbiasOp, pos::k_DACName_Vcal, pos::k_DACName_Vcomp, pos::k_DACName_VcThr, pos::k_DACName_Vdd, pos::k_DACName_VHldDel, pos::k_DACName_VIbias_bus, pos::k_DACName_VIbias_DAC, pos::k_DACName_VIbias_PH, pos::k_DACName_VIbias_roc, pos::k_DACName_VIbias_sf, pos::k_DACName_VIColOr, pos::k_DACName_VIon, pos::k_DACName_Vleak, pos::k_DACName_Vnpix, pos::k_DACName_VOffsetOp, pos::k_DACName_VOffsetRO, pos::k_DACName_VrgPr, pos::k_DACName_VrgSh, pos::k_DACName_Vsf, pos::k_DACName_VsumCol, pos::k_DACName_Vtrim, pos::k_DACName_VwllPr, pos::k_DACName_VwllSh, pos::k_DACName_WBC, n, alignCSCRings::r, pos::PixelROCDACSettings::read(), and tmp.

                                                                             : PixelConfigBase("","","")
{

/*
 EXTENSION_TABLE_NAME: ROC_DAC_SETTINGS_COL (VIEW: CONF_KEY_ROCDAC_COL_V)
 
 CONFIG_KEY                                NOT NULL VARCHAR2(80)
 KEY_TYPE                                  NOT NULL VARCHAR2(80)
 KEY_ALIAS                                 NOT NULL VARCHAR2(80)
 VERSION                                            VARCHAR2(40)
 KIND_OF_COND                              NOT NULL VARCHAR2(40)
 ROC_NAME                                           VARCHAR2(200)
 VDD                                       NOT NULL NUMBER(38)
 VANA                                      NOT NULL NUMBER(38)
 VSF                                       NOT NULL NUMBER(38)
 VCOMP                                     NOT NULL NUMBER(38)
 VLEAK                                     NOT NULL NUMBER(38)
 VRGPR                                     NOT NULL NUMBER(38)
 VWLLPR                                    NOT NULL NUMBER(38)
 VRGSH                                     NOT NULL NUMBER(38)
 VWLLSH                                    NOT NULL NUMBER(38)
 VHLDDEL                                   NOT NULL NUMBER(38)
 VTRIM                                     NOT NULL NUMBER(38)
 VCTHR                                     NOT NULL NUMBER(38)
 VIBIAS_BUS                                NOT NULL NUMBER(38)
 VIBIAS_SF                                 NOT NULL NUMBER(38)
 VOFFSETOP                                 NOT NULL NUMBER(38)
 VBIASOP                                   NOT NULL NUMBER(38)
 VOFFSETRO                                 NOT NULL NUMBER(38)
 VION                                      NOT NULL NUMBER(38)
 VIBIAS_PH                                 NOT NULL NUMBER(38)
 VIBIAS_DAC                                NOT NULL NUMBER(38)
 VIBIAS_ROC                                NOT NULL NUMBER(38)
 VICOLOR                                   NOT NULL NUMBER(38)
 VNPIX                                     NOT NULL NUMBER(38)
 VSUMCOL                                   NOT NULL NUMBER(38)
 VCAL                                      NOT NULL NUMBER(38)
 CALDEL                                    NOT NULL NUMBER(38)
 TEMPRANGE                                 NOT NULL NUMBER(38)
 WBC                                       NOT NULL NUMBER(38)
 CHIPCONTREG                               NOT NULL NUMBER(38)
*/
//   std::multimap<std::string,std::pair<std::string,int > > pDSM;
  //  std::stringstream currentRocName;
  std::vector< std::string > ins = tableMat[0];
  std::string mthn("[PixelDACSettings::PixelDACSettings()] ") ;
  std::string dacName;
  std::istringstream dbin ;
//   int dacValue;
  int skipColumns = 0 ;
  std::map<std::string , int > colM;
  std::vector<std::string > colNames;
  std::map<std::string, std::string> nameTranslation ;

  colNames.push_back("CONFIG_KEY"  );
  colNames.push_back("KEY_TYPE"    );
  colNames.push_back("KEY_ALIAS"   );
  colNames.push_back("VERSION"     );
  colNames.push_back("KIND_OF_COND");
  colNames.push_back("ROC_NAME"    );
  colNames.push_back("VDD"         );
  colNames.push_back("VANA"        );
  colNames.push_back("VSF"         );
  colNames.push_back("VCOMP"       );
  colNames.push_back("VLEAK"       );
  colNames.push_back("VRGPR"       );
  colNames.push_back("VWLLPR"      );
  colNames.push_back("VRGSH"       );
  colNames.push_back("VWLLSH"      );
  colNames.push_back("VHLDDEL"     );
  colNames.push_back("VTRIM"       );
  colNames.push_back("VCTHR"       );
  colNames.push_back("VIBIAS_BUS"  );
  colNames.push_back("VIBIAS_SF"   );
  colNames.push_back("VOFFSETOP"   );
  colNames.push_back("VBIASOP"     );
  colNames.push_back("VOFFSETRO"   );
  colNames.push_back("VION"        );
  colNames.push_back("VIBIAS_PH"   );
  colNames.push_back("VIBIAS_DAC"  );
  colNames.push_back("VIBIAS_ROC"  );
  colNames.push_back("VICOLOR"     );
  colNames.push_back("VNPIX"       );
  colNames.push_back("VSUMCOL"     );
  colNames.push_back("VCAL"        );
  colNames.push_back("CALDEL"      );
  colNames.push_back("TEMPRANGE"   );
  colNames.push_back("WBC"         );
  colNames.push_back("CHIPCONTREG" );

  nameTranslation["VDD"]          = k_DACName_Vdd ;
  nameTranslation["VANA"]         = k_DACName_Vana;               
  nameTranslation["VSF"]          = k_DACName_Vsf;                 
  nameTranslation["VCOMP"]        = k_DACName_Vcomp;             
  nameTranslation["VLEAK"]        = k_DACName_Vleak;             
  nameTranslation["VRGPR"]        = k_DACName_VrgPr;             
  nameTranslation["VWLLPR"]       = k_DACName_VwllPr;           
  nameTranslation["VRGSH"]        = k_DACName_VrgSh;             
  nameTranslation["VWLLSH"]       = k_DACName_VwllSh;           
  nameTranslation["VHLDDEL"]      = k_DACName_VHldDel;         
  nameTranslation["VTRIM"]        = k_DACName_Vtrim;             
  nameTranslation["VCTHR"]        = k_DACName_VcThr;             
  nameTranslation["VIBIAS_BUS"]   = k_DACName_VIbias_bus;  
  nameTranslation["VIBIAS_SF"]    = k_DACName_VIbias_sf;     
  nameTranslation["VOFFSETOP"]    = k_DACName_VOffsetOp;     
  nameTranslation["VBIASOP"]      = k_DACName_VbiasOp;         
  nameTranslation["VOFFSETRO"]    = k_DACName_VOffsetRO;     
  nameTranslation["VION"]         = k_DACName_VIon;               
  nameTranslation["VIBIAS_PH"]    = k_DACName_VIbias_PH;     
  nameTranslation["VIBIAS_DAC"]   = k_DACName_VIbias_DAC;   
  nameTranslation["VIBIAS_ROC"]   = k_DACName_VIbias_roc;   
  nameTranslation["VICOLOR"]      = k_DACName_VIColOr;         
  nameTranslation["VNPIX"]        = k_DACName_Vnpix;             
  nameTranslation["VSUMCOL"]      = k_DACName_VsumCol;         
  nameTranslation["VCAL"]         = k_DACName_Vcal;               
  nameTranslation["CALDEL"]       = k_DACName_CalDel;           
  nameTranslation["TEMPRANGE"]    = k_DACName_TempRange;     
  nameTranslation["WBC"]          = k_DACName_WBC;                 
  nameTranslation["CHIPCONTREG"]  = k_DACName_ChipContReg; 

  // modified by MR on 25-02-2008 10:00:45
  // colM stores the index (referred to tableMat) where the specified dac setting is store!!!
  for(unsigned int c = skipColumns ; c < ins.size() ; c++){
    for(unsigned int n=0; n<colNames.size(); n++){
      if(tableMat[0][c] == colNames[n]){
        colM[colNames[n]] = c;
        break;
      }
    }
  }//end for
  for(unsigned int n=skipColumns; n<colNames.size(); n++){
    if(colM.find(colNames[n]) == colM.end()){
      std::cerr << "[PixelDACSettings::PixelDACSettings()]\tCouldn't find in the database the column with name " << colNames[n] << std::endl;
      assert(0);
    }
  }

        
  dacsettings_.clear();
//   struct timeval  start_time  ;
//   struct timeval  end_time    ;
//   gettimeofday(&start_time, (struct timezone *)0 );
  for(unsigned int r = 1 ; r < tableMat.size() ; r++){    //Goes to every row of the Matrix
    // currentRocName.str("");
    // currentRocName << tableMat[r][colM["NAME"]] ; 
    //currentRocName << "FPix_BmI_D" << tableMat[r][colM["HDISK_POSN"]]                 
    //     << "_BLD"       << tableMat[r][colM["BLD_POSN"]]                  
    //     << "_PNL"       << tableMat[r][colM["PANEL_POSITION"]]            
    //     << "_PLQ"       << tableMat[r][colM["PLAQ_POS"]]                 
    //     << "_ROC"       << tableMat[r][colM["ROC_POSN"]];                
                   
    // modified by MR on 25-02-2008 10:04:55
    PixelROCName rocid(tableMat[r][colM["ROC_NAME"]]);
    PixelROCDACSettings tmp(rocid);
    std::ostringstream dacs("") ;
    // +6 to get rid of the first 5 columns not pertaining DAC Settings...
    for(unsigned int n=skipColumns+6; n<colNames.size(); n++)
      {
        dacs << nameTranslation[colNames[n]] <<": "<< atoi(tableMat[r][colM[colNames[n]]].c_str()) << std::endl ;
        //       dacName  = colNames[n];
        //       dacValue = atoi(tableMat[r][colM[colNames[n]]].c_str());
        //       pDSM.insert(std::pair<std::string,std::pair<std::string,int> >(tableMat[r][colM["ROC_NAME"]],std::pair<std::string,int>(dacName,dacValue)));
        //       std::cout << "On " << tableMat[r][colM["ROC_NAME"]] << " DAC:\t" << dacName << " value:\t" << dacValue<< std::endl ;
        //       tmp.setDac(dacName, dacValue) ;
      }
//     tmp.setDACs(tmpDACs) ;
    dbin.str(dacs.str()) ;
    tmp.read(dbin, rocid) ;
    dacsettings_.push_back(tmp) ;
  }//end for r
//   gettimeofday(&end_time, (struct timezone *)0 );
//   int total_usecs = (end_time.tv_sec - start_time.tv_sec)*1000000 + (end_time.tv_usec - start_time.tv_usec);
//   std::cout << mthn << "Time taken : " << total_usecs / 1000000.  << " secs" << std::endl;
  
//   dacsettings_.clear();
//   std::string currentRocName2 = "";
//   for(std::multimap<std::string,std::pair<std::string,int> >::iterator tableMapIt=pDSM.begin(); tableMapIt!= pDSM.end(); tableMapIt++){
//     if(currentRocName2 != tableMapIt->first){
//       std::cout << tableMapIt->first << std::endl;
//       std::cout << tableMapIt->second.first << std::endl;
//       std::cout << tableMapIt->second.second << std::endl;
//       currentRocName2 = tableMapIt->first;
//       PixelROCName rocid(currentRocName2);
      
//       // std::cout << "DAC setting ROC id:"<<rocid<<std::endl;
  
//       PixelROCDACSettings tmp(rocid);
      
//       //       tmp.read(in,rocid);
            
//       dacsettings_.push_back(tmp);
//     }//end if
//     dacsettings_[dacsettings_.size()-1].setDac(tableMapIt->second.first,tableMapIt->second.second);
//   }//end for 
  
  
//   for(unsigned int w = 0 ; w < dacsettings_.size() ; w++)
//     {
  
//       PixelROCDACSettings tmp2 = dacsettings_[w];
//       //   std::cout<<tmp2<<std::endl;
//     }   
  //  std::cout<<"Number of ROCs in the PixelDACSettings::PixelDACSettings(vector <vector<string> >):"<<dacsettings_.size()<<std::endl; 
  //  std::cout << "[PixelDACSettings::PixelDACSettings(std::vector)] before end of constructor" << std::endl ;
}//end PDSMatrix constructor
bool PixelDACSettings::rocIsDisabled ( const PixelDetectorConfig detconfig,
const PixelROCName  rocname 
) const [private, inherited]

Definition at line 700 of file PixelDACSettings.cc.

References pos::PixelROCStatus::get(), pos::PixelDetectorConfig::getROCsList(), and pos::PixelROCStatus::noAnalogSignal.

Referenced by pos::PixelDACSettings::generateConfiguration(), and pos::PixelDACSettings::setVcthrEnable().

                                                                                                           {

  const std::map<PixelROCName, PixelROCStatus> & roclist=detconfig->getROCsList();
  const std::map<PixelROCName, PixelROCStatus>::const_iterator iroc = roclist.find(rocname);
  assert(iroc != roclist.end());    // the roc name should always be found
  PixelROCStatus thisROCstatus = iroc->second;

  return thisROCstatus.get(PixelROCStatus::noAnalogSignal);

}
void PixelDACSettings::setVcthrDisable ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans 
) const [inherited]

Definition at line 606 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, pos::PixelNameTranslation::getHdwAddress(), pos::PixelHdwAddress::hubaddress(), i, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progdac(), pos::PixelFECConfigInterface::qbufsend(), and pos::PixelHdwAddress::rocid().

                                                                                                            {
  //the point here is to set Vcthr to 0
  //then disable the ROCs

  //note -- no need to look at the detconfig here, because we're going to disable everything no matter what

  bool bufferData=true;

  std::vector<unsigned int> dacs;

  for(unsigned int i=0;i<dacsettings_.size();i++){ //loop over the ROCs

    dacsettings_[i].getDACs(dacs);
    int controlreg=dacsettings_[i].getControlRegister();

    PixelHdwAddress theROC=*(trans->getHdwAddress(dacsettings_[i].getROCName()));

    //std::cout<<"disabling ROC="<<dacsettings_[i].getROCName()<<std::endl;
    pixelFEC->progdac(theROC.mfec(),
                      theROC.mfecchannel(),
                      theROC.hubaddress(),
                      theROC.portaddress(),
                      theROC.rocid(),
                      12, //12 == Vcthr
                      0, //set Vcthr to 0
                      bufferData);

    //this should disable the roc
    pixelFEC->progdac(theROC.mfec(),
                      theROC.mfecchannel(),
                      theROC.hubaddress(),
                      theROC.portaddress(),
                      theROC.rocid(),
                      0xfd,
                      controlreg | 0x2,
                      bufferData);

  }

  if (bufferData) { //just copying the way it was done in the existing method
    pixelFEC->qbufsend();
  }
}
void PixelDACSettings::setVcthrEnable ( PixelFECConfigInterface pixelFEC,
PixelNameTranslation trans,
PixelDetectorConfig detconfig 
) const [inherited]

Definition at line 650 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, pos::PixelNameTranslation::getHdwAddress(), pos::PixelHdwAddress::hubaddress(), i, pos::PixelHdwAddress::mfec(), pos::PixelHdwAddress::mfecchannel(), pos::PixelHdwAddress::portaddress(), pos::PixelFECConfigInterface::progdac(), pos::PixelFECConfigInterface::qbufsend(), pos::PixelHdwAddress::rocid(), and pos::PixelDACSettings::rocIsDisabled().

                                                                                                                                          {
  //the point here is to set Vcthr to the nominal values
  //then enable the ROCs

  bool bufferData=true;

  std::vector<unsigned int> dacs;

  for(unsigned int i=0;i<dacsettings_.size();i++){ //loop over the ROCs

    bool disableRoc = rocIsDisabled(detconfig, dacsettings_[i].getROCName()); //don't enable ROCs that are disabled in the detconfig

    dacsettings_[i].getDACs(dacs);
    int controlreg=dacsettings_[i].getControlRegister();

    PixelHdwAddress theROC=*(trans->getHdwAddress(dacsettings_[i].getROCName()));

    //std::cout<<"ROC="<<dacsettings_[i].getROCName()<<" ; VcThr set to "<<dacs[11]
    //       << " ; ROC control reg to be set to: " <<  controlreg <<std::endl;

    if (!disableRoc) {
      pixelFEC->progdac(theROC.mfec(),
                        theROC.mfecchannel(),
                        theROC.hubaddress(),
                        theROC.portaddress(),
                        theROC.rocid(),
                        12, //12 == Vcthr
                        dacs[11],
                        bufferData);
      
      //enable the roc (assuming controlreg was set for the roc to be enabled)
      
      pixelFEC->progdac(theROC.mfec(),
                        theROC.mfecchannel(),
                        theROC.hubaddress(),
                        theROC.portaddress(),
                        theROC.rocid(),
                        0xfd,
                        controlreg,
                        bufferData);
      
    }
  }

  if (bufferData) {
    pixelFEC->qbufsend();
  }

}
void PixelDACSettings::writeASCII ( std::string  dir) const [virtual, inherited]

Implements pos::PixelConfigBase.

Definition at line 392 of file PixelDACSettings.cc.

References gather_cfg::cout, pos::PixelDACSettings::dacsettings_, lut2db_cfg::filename, i, python::rootplot::argparse::module, pos::PixelModuleName::modulename(), and dbtoconf::out.

                                                     {

  std::string mthn = "[PixelDACSettings::writeASCII()]\t\t\t    " ;
  PixelModuleName module(dacsettings_[0].getROCName().rocname());

  std::string filename=dir+"/ROC_DAC_module_"+module.modulename()+".dat";
  std::cout << __LINE__ << "]\t" << mthn << "Writing to file " << filename << std::endl ; 
  std::ofstream out(filename.c_str());
  
  for(unsigned int i=0;i<dacsettings_.size();i++){
    dacsettings_[i].writeASCII(out);
  }

}
void PixelDACSettings::writeBinary ( std::string  filename) const [inherited]

Definition at line 381 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, i, and dbtoconf::out.

                                                           {

  std::ofstream out(filename.c_str(),std::ios::binary);

  for(unsigned int i=0;i<dacsettings_.size();i++){
    dacsettings_[i].writeBinary(out);
  }

}
void PixelDACSettings::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = NULL,
std::ofstream *  out2 = NULL 
) const [virtual, inherited]

Reimplemented from pos::PixelConfigBase.

Definition at line 455 of file PixelDACSettings.cc.

References pos::PixelDACSettings::dacsettings_, and i.

                                                                {
  std::string mthn = "[PixelDACSettings::writeXML()]\t\t\t    " ;

  for(unsigned int i=0;i<dacsettings_.size();i++){
    dacsettings_[i].writeXML(outstream);
  }
}
void pos::PixelDACSettings::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const [inline, virtual, inherited]

Reimplemented from pos::PixelConfigBase.

Definition at line 87 of file PixelDACSettings.h.

{;}
void PixelDACSettings::writeXMLHeader ( pos::PixelConfigKey  key,
int  version,
std::string  path,
std::ofstream *  out,
std::ofstream *  out1 = NULL,
std::ofstream *  out2 = NULL 
) const [virtual, inherited]

Reimplemented from pos::PixelConfigBase.

Definition at line 408 of file PixelDACSettings.cc.

References gather_cfg::cout, pos::PixelConfigBase::getAuthor(), pos::PixelConfigBase::getComment(), pos::PixelTimeFormatter::getmSecTime(), and edm::service::getTime().

                                                                     {
  std::string mthn = "[PixelDACSettings::writeXMLHeader()]\t\t\t    " ;
  std::stringstream fullPath ;

  fullPath << path << "/Pixel_RocDacSettings_" << PixelTimeFormatter::getmSecTime() << ".xml" ;
  std::cout << __LINE__ << "]\t" << mthn << "Writing to: " << fullPath.str()  << std::endl ;

  outstream->open(fullPath.str().c_str()) ;
  
  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>"                               << std::endl ;
  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>"                          << std::endl ;
  *outstream << ""                                                                                      << std::endl ; 
  *outstream << " <!-- " << mthn << "-->"                                                               << std::endl ; 
  *outstream << ""                                                                                      << std::endl ; 
  *outstream << " <HEADER>"                                                                             << std::endl ;
  *outstream << "  <TYPE>"                                                                              << std::endl ;
  *outstream << "   <EXTENSION_TABLE_NAME>ROC_DAC_SETTINGS_COL</EXTENSION_TABLE_NAME>"                  << std::endl ;
  *outstream << "   <NAME>ROC DAC Settings Col</NAME>"                                                  << std::endl ;
  *outstream << "  </TYPE>"                                                                             << std::endl ;
  *outstream << "  <RUN>"                                                                               << std::endl ;
  *outstream << "   <RUN_TYPE>ROC DAC Settings</RUN_TYPE>"                                              << std::endl ;
  *outstream << "   <RUN_NUMBER>1</RUN_NUMBER>"                                                         << std::endl ;
  *outstream << "   <RUN_BEGIN_TIMESTAMP>" << PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl ;
  *outstream << "   <LOCATION>CERN P5</LOCATION>"                                                       << std::endl ; 
  *outstream << "  </RUN>"                                                                              << std::endl ;
  *outstream << " </HEADER>"                                                                            << std::endl ;
  *outstream << ""                                                                                      << std::endl ;
  *outstream << " <DATA_SET>"                                                                           << std::endl ;
  *outstream << "  <VERSION>"             << version      << "</VERSION>"                               << std::endl ;
  *outstream << "  <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>"                   << std::endl ;
  *outstream << "  <CREATED_BY_USER>"     << getAuthor()  << "</CREATED_BY_USER>"                       << std::endl ;
  *outstream << " "                                                                                     << std::endl ;
  *outstream << "  <PART>"                                                                              << std::endl ;
  *outstream << "   <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>"                                            << std::endl ;
  *outstream << "   <KIND_OF_PART>Detector ROOT</KIND_OF_PART>"                                         << std::endl ;
  *outstream << "  </PART>"                                                                             << std::endl ;
  *outstream << " "                                                                                     << std::endl ;

  std::cout << __LINE__ << "]\t" << mthn << "Header written" << std::endl ;
}
void PixelDACSettings::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = NULL,
std::ofstream *  out2 = NULL 
) const [virtual, inherited]

Reimplemented from pos::PixelConfigBase.

Definition at line 466 of file PixelDACSettings.cc.

References gather_cfg::cout.

                                                                      {
  std::string mthn = "[PixelDACSettings::writeXMLTrailer()]\t\t\t    " ;

  *outstream << " </DATA_SET>"                                                                         << std::endl ;
  *outstream << "</ROOT>"                                                                              << std::endl ;

  outstream->close() ;
  std::cout << __LINE__ << "]\t" << mthn << "Data written"                                             << std::endl ;
}

Variable Documentation

std::vector<PixelROCDACSettings> pos::PixelDACSettings::dacsettings_ [private, inherited]

Friends

std::ostream& operator<< ( std::ostream &  s,
const PixelDACSettings mask 
) [friend, inherited]

Definition at line 711 of file PixelDACSettings.cc.

                                                                   {

  s << dacs.getDACSettings(0) <<std::endl; 

  return s;

}