This class implements.. More...
#include <interface/PixelROCTrimBits.h>
Public Member Functions | |
PixelROCName | name () const |
PixelROCTrimBits () | |
int | read (PixelROCName rocid, std::ifstream &in) |
int | read (PixelROCName rocid, std::istringstream &in) |
int | read (PixelROCName rocid, std::string in) |
int | readBinary (PixelROCName rocid, std::ifstream &in) |
void | setROCTrimBits (PixelROCName rocid, std::string bits) |
void | setTrim (unsigned int col, unsigned int row, unsigned int trim) |
unsigned int | trim (unsigned int col, unsigned int row) const |
void | writeASCII (std::ofstream &out) const |
void | writeBinary (std::ofstream &out) const |
void | writeXML (std::ofstream *out) const |
Private Attributes | |
unsigned char | bits_ [2080] |
PixelROCName | rocid_ |
Friends | |
std::ostream & | operator<< (std::ostream &s, const PixelROCTrimBits &trimbits) |
This class implements..
A longer explanation will be placed here later
Definition at line 20 of file PixelROCTrimBits.h.
PixelROCTrimBits::PixelROCTrimBits | ( | ) |
Definition at line 18 of file PixelROCTrimBits.cc.
{ }
PixelROCName pos::PixelROCTrimBits::name | ( | ) | const [inline] |
int PixelROCTrimBits::read | ( | PixelROCName | rocid, |
std::string | in | ||
) |
int PixelROCTrimBits::read | ( | PixelROCName | rocid, |
std::istringstream & | in | ||
) |
Definition at line 98 of file PixelROCTrimBits.cc.
References bits_, INSTR::byte, AlCaHLTBitMon_QueryRunRegistry::data, i, j, rocid_, GlobalPosition_Frontier_DevDB_cff::tag, and tmp.
{ std::string tag; //std::cout << "PixelROCTrimBits::read rocid:"<<rocid<<std::endl; rocid_=rocid; //std::cout << "PixelROCTrimBits::read rocid_:"<<rocid_<<std::endl; for (int i=0;i<52;i++) { in >> tag; // std::cout << "Now reading col:"<<tag<<std::endl; std::string data; in >> data; // std::cout <<" data: " <<data<<std::endl; unsigned char byte=0; for(int j=0;j<80;j++) { unsigned char tmp=toupper(data[j])-48; if (tmp>9) tmp-=7; //FIXME this is so ugly byte+=tmp; if ((j+1)%2==0) { //std::cout << "Writing byte:"<<(int)byte<<std::endl; bits_[i*40+(j+1)/2-1]=byte; byte=0; } else { byte*=16; } } } return 1; }
int PixelROCTrimBits::read | ( | PixelROCName | rocid, |
std::ifstream & | in | ||
) |
Definition at line 50 of file PixelROCTrimBits.cc.
References bits_, INSTR::byte, AlCaHLTBitMon_QueryRunRegistry::data, i, j, rocid_, GlobalPosition_Frontier_DevDB_cff::tag, and tmp.
{ std::string tag; //std::cout << "PixelROCTrimBits::read rocid:"<<rocid<<std::endl; rocid_=rocid; //std::cout << "PixelROCTrimBits::read rocid_:"<<rocid_<<std::endl; for (int i=0;i<52;i++){ in >> tag; //std::cout << "Now reading col:"<<tag<<std::endl; std::string data; in >> data; //std::cout <<"data.size()" <<data.size()<<std::endl; unsigned char byte=0; for(int j=0;j<80;j++){ unsigned char tmp=toupper(data[j])-48; if (tmp>9) tmp-=7; //FIXME this is so ugly byte+=tmp; if ((j+1)%2==0) { //std::cout << "Writing byte:"<<(int)byte<<std::endl; bits_[i*40+(j+1)/2-1]=byte; byte=0; } else{ byte*=16; } } } return 1; }
int PixelROCTrimBits::readBinary | ( | PixelROCName | rocid, |
std::ifstream & | in | ||
) |
Definition at line 265 of file PixelROCDACSettings.cc.
Referenced by pos::PixelTrimAllPixels::PixelTrimAllPixels().
{ rocid_=rocid; in.read((char*)&Vdd_,1); in.read((char*)&Vana_,1); in.read((char*)&Vsf_,1); in.read((char*)&Vcomp_,1); in.read((char*)&Vleak_,1); in.read((char*)&VrgPr_,1); in.read((char*)&VwllPr_,1); in.read((char*)&VrgSh_,1); in.read((char*)&VwllSh_,1); in.read((char*)&VHldDel_,1); in.read((char*)&Vtrim_,1); in.read((char*)&VcThr_,1); in.read((char*)&VIbias_bus_,1); in.read((char*)&VIbias_sf_,1); in.read((char*)&VOffsetOp_,1); in.read((char*)&VbiasOp_,1); in.read((char*)&VOffsetRO_,1); in.read((char*)&VIon_,1); in.read((char*)&VIbias_PH_,1); in.read((char*)&VIbias_DAC_,1); in.read((char*)&VIbias_roc_,1); in.read((char*)&VIColOr_,1); in.read((char*)&Vnpix_,1); in.read((char*)&VsumCol_,1); in.read((char*)&Vcal_,1); in.read((char*)&CalDel_,1); in.read((char*)&TempRange_,1); in.read((char*)&WBC_,1); in.read((char*)&ChipContReg_,1); return 1; }
void PixelROCTrimBits::setROCTrimBits | ( | PixelROCName | rocid, |
std::string | bits | ||
) |
Definition at line 22 of file PixelROCTrimBits.cc.
References bits_, gather_cfg::cout, i, and rocid_.
void PixelROCTrimBits::setTrim | ( | unsigned int | col, |
unsigned int | row, | ||
unsigned int | trim | ||
) |
unsigned int PixelROCTrimBits::trim | ( | unsigned int | col, |
unsigned int | row | ||
) | const |
Definition at line 181 of file PixelROCTrimBits.cc.
Referenced by pos::PixelCalibConfiguration::disablePixels(), pos::PixelCalibConfiguration::enablePixels(), and writeASCII().
void PixelROCTrimBits::writeASCII | ( | std::ofstream & | out | ) | const |
Definition at line 159 of file PixelROCTrimBits.cc.
References rocid_, pos::PixelROCName::rocname(), and trim().
{ //std::cout << " PixelROCTrimBits::writeASCII rocid_.rocname():"<<rocid_.rocname()<<std::endl; out << "ROC: "<<rocid_.rocname()<<std::endl; //std::cout << "PixelROCTrimBits::writeBinary:"<<rocid_.rocname().size() // << " " <<rocid_.rocname()<<std::endl; for(unsigned int col=0;col<52;col++){ out << "col"; if (col<10) out << "0"; out <<col<<": "; for (int row=0;row<80;row++){ out << std::hex<<std::uppercase<<trim(col,row)<<std::dec; } out << std::endl; } }
void PixelROCTrimBits::writeBinary | ( | std::ofstream & | out | ) | const |
Definition at line 145 of file PixelROCTrimBits.cc.
References bits_, i, rocid_, and pos::PixelROCName::rocname().
void PixelROCTrimBits::writeXML | ( | std::ofstream * | out | ) | const |
Definition at line 230 of file PixelROCTrimBits.cc.
References base64_decode, base64_encode(), bits_, rocid_, and pos::PixelROCName::rocname().
{ std::string mthn = "[PixelROCTrimBits::writeXML()]\t\t\t\t" ; std::string encoded = base64_encode(bits_, sizeof(bits_)); std::string decoded = base64_decode(encoded); *out << " <DATA>" << std::endl ; *out << " <ROC_NAME>" << rocid_.rocname() << "</ROC_NAME>" << std::endl ; *out << " <TRIM_BITS>" << encoded << "</TRIM_BITS>" << std::endl ; *out << " </DATA>" << std::endl ; *out << " " << std::endl ; }
std::ostream& operator<< | ( | std::ostream & | s, |
const PixelROCTrimBits & | trimbits | ||
) | [friend] |
unsigned char pos::PixelROCTrimBits::bits_[2080] [private] |
Definition at line 49 of file PixelROCTrimBits.h.
Referenced by read(), setROCTrimBits(), setTrim(), trim(), writeBinary(), and writeXML().
PixelROCName pos::PixelROCTrimBits::rocid_ [private] |
Definition at line 50 of file PixelROCTrimBits.h.
Referenced by name(), read(), setROCTrimBits(), writeASCII(), writeBinary(), and writeXML().