CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes | Friends

pos::PixelDACSettings Class Reference

This class is responsible for manipulating the DACsettings of a ROC. More...

#include <PixelDACSettings.h>

Inheritance diagram for pos::PixelDACSettings:
pos::PixelConfigBase

List of all members.

Public Member Functions

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

Private Member Functions

bool rocIsDisabled (const PixelDetectorConfig *detconfig, const PixelROCName rocname) const

Private Attributes

std::vector< PixelROCDACSettingsdacsettings_

Friends

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

Detailed Description

This class is responsible for manipulating the DACsettings of a ROC.

This is a placeholder for a lengthy description of the class, it's methods behavior and additional stuff like images. This description can be arbitrary long and complex, see for eg. page3Sect3.

Ut perspiciatis, unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam eaque ipsa, quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt, explicabo.

temp.png

Nemo enim ipsam voluptatem, quia voluptas sit, aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos, qui ratione voluptatem sequi nesciunt, neque porro quisquam est, qui dolorem ipsum, quia dolor sit, amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt, ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit, qui in ea voluptate velit esse, quam nihil molestiae consequatur, vel illum, qui dolorem eum fugiat, quo voluptas nulla pariatur?

Definition at line 61 of file PixelDACSettings.h.


Constructor & Destructor Documentation

PixelDACSettings::PixelDACSettings ( std::string  filename)

Definition at line 26 of file PixelDACSettings.cc.

References trackerHits::c, gather_cfg::cout, dacsettings_, i, recoMuon::in, pos::PixelROCDACSettings::read(), pos::PixelROCDACSettings::readBinary(), GlobalPosition_Frontier_DevDB_cff::tag, and tmp.

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

  std::string mthn = "[PixelDACSettings::PixelDACSettings()]\t\t\t    " ;
  
  if (filename[filename.size()-1]=='t'){

    std::ifstream in(filename.c_str());

    if (!in.good()){
      std::cout << __LINE__ << "]\t" << mthn << "Could not open: " << filename << std::endl;
      // assert(0); //in case of failure, we don't want POS to die here
      throw std::runtime_error("Failed to open file "+filename);
    }
    else {
      // std::cout << "Opened:"<<filename<<std::endl;
    }
        
        
    dacsettings_.clear();
        
    std::string tag;
        
    in >> tag;

    while (!in.eof()){
            
            
      PixelROCName rocid(in);

      //            std::cout << "[PixelDACSettings::PixelDACSettings()] DAC setting ROC id:"<<rocid<<std::endl;
            
      PixelROCDACSettings tmp;

      tmp.read(in,rocid);
            
      //            std::cout << "[PixelDACSettings::PixelDACSettings()] DACSetting: " << std::endl << tmp << std::endl ;
      dacsettings_.push_back(tmp);
            
      in >> tag;
            
      assert(dacsettings_.size()<100);
            
    }
        
    in.close();

  }
  else{

    std::ifstream in(filename.c_str(),std::ios::binary);

    if (!in.good()){
      std::cout << __LINE__ << "]\t" << mthn << "Could not open: " << filename << std::endl;
      assert(0);
    }
    else {
      std::cout << __LINE__ << "]\t" << mthn << "Opened: "         << filename << std::endl;
    }

    char nchar;

    in.read(&nchar,1);
        
    std::string s1;

    //wrote these lines of code without ref. needs to be fixed
    for(int i=0;i< nchar; i++){
      char c;
      in >>c;
      s1.push_back(c);
    }

    //std::cout << __LINE__ << "]\t" << mthn << "READ ROC name: " << s1 << std::endl;

    dacsettings_.clear();


    while (!in.eof()){

      //std::cout << __LINE__ << "]\t" << mthn << "read s1   : " << s1    << std::endl;

      PixelROCName rocid(s1);

      //std::cout << __LINE__ << "]\t" << mthn << "read rocid: " << rocid << std::endl;
            
      PixelROCDACSettings tmp;
      
      tmp.readBinary(in, rocid);

      dacsettings_.push_back(tmp);


      in.read(&nchar,1);

      s1.clear();

      if (in.eof()) continue;

      //wrote these lines of code without ref. needs to be fixed
      for(int i=0;i< nchar; i++){
        char c;
        in >>c;
        s1.push_back(c);
      }


    }

    in.close();



  }


  //std::cout << __LINE__ << "]\t" << mthn << "Read dac settings for "<<dacsettings_.size()<<" ROCs"<<std::endl;


}