CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
pos::PixelFECConfig Class Reference

This class specifies which FEC boards are used and how they are addressed. More...

#include <PixelFECConfig.h>

Inheritance diagram for pos::PixelFECConfig:
pos::PixelConfigBase

Public Member Functions

unsigned int crateFromFECNumber (unsigned int fecnumber) const
 
unsigned int FECSlotFromFECNumber (unsigned int fecnumber)
 
unsigned int getCrate (unsigned int i) const
 
unsigned int getFECNumber (unsigned int i) const
 
unsigned int getFECSlot (unsigned int i)
 
unsigned int getNFECBoards () const
 
unsigned int getVMEBaseAddress (unsigned int i) const
 
 PixelFECConfig (std::string filename)
 
 PixelFECConfig (std::vector< std::vector< std::string > > &tableMat)
 
unsigned int VMEBaseAddressFromFECNumber (unsigned int fecnumber) const
 
void writeASCII (std::string dir="") const override
 
void writeXML (pos::PixelConfigKey key, int version, std::string path) const override
 
void writeXML (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
void writeXMLTrailer (std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
 
- Public Member Functions inherited from pos::PixelConfigBase
std::string creator ()
 
std::string date ()
 
std::string description ()
 
std::string getAuthor () const
 
std::string getComment () const
 
 PixelConfigBase (std::string description, std::string creator, std::string date)
 
void setAuthor (std::string author)
 
void setComment (std::string comment)
 
virtual void writeXML (std::ofstream *out) const
 
virtual void writeXMLHeader (pos::PixelConfigKey key, int version, std::string path, std::ofstream *out) const
 
virtual void writeXMLTrailer (std::ofstream *out) const
 
virtual ~PixelConfigBase ()
 

Private Member Functions

unsigned int FECSlotFromVMEBaseAddress (unsigned int VMEBaseAddress)
 

Private Attributes

std::vector< PixelFECParametersfecconfig_
 

Detailed Description

This class specifies which FEC boards are used and how they are addressed.

" "

Definition at line 24 of file PixelFECConfig.h.

Constructor & Destructor Documentation

◆ PixelFECConfig() [1/2]

PixelFECConfig::PixelFECConfig ( std::string  filename)

◆ PixelFECConfig() [2/2]

PixelFECConfig::PixelFECConfig ( std::vector< std::vector< std::string > > &  tableMat)


EXTENSION_TABLE_NAME: (VIEW: )

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) PIXFEC_NAME NOT NULL VARCHAR2(200) CRATE_NUMBER NOT NULL NUMBER(38) SLOT_NUMBER NUMBER(38) VME_ADDR NOT NULL VARCHAR2(200)

Definition at line 18 of file PixelFECConfig.cc.

References c, fecconfig_, dqmiodumpmetadata::n, alignCSCRings::r, and createJobs::tmp.

18  : PixelConfigBase(" ", " ", " ") {
19  std::map<std::string, int> colM;
20  std::vector<std::string> colNames;
36  colNames.push_back("CONFIG_KEY");
37  colNames.push_back("KEY_TYPE");
38  colNames.push_back("KEY_ALIAS");
39  colNames.push_back("VERSION");
40  colNames.push_back("KIND_OF_COND");
41  colNames.push_back("PIXFEC_NAME");
42  colNames.push_back("CRATE_NUMBER");
43  colNames.push_back("SLOT_NUMBER");
44  colNames.push_back("VME_ADDR");
45 
46  for (unsigned int c = 0; c < tableMat[0].size(); c++) {
47  for (unsigned int n = 0; n < colNames.size(); n++) {
48  if (tableMat[0][c] == colNames[n]) {
49  colM[colNames[n]] = c;
50  break;
51  }
52  }
53  } //end for
54  /*
55  for(unsigned int n=0; n<colNames.size(); n++)
56  {
57  if(colM.find(colNames[n]) == colM.end()){
58  std::cerr << "[PixelFECConfig::PixelFECConfig()]\tCouldn't find in the database the column with name " << colNames[n] << std::endl;
59  assert(0);
60  }
61  }
62  */
63 
64  fecconfig_.clear();
65  for (unsigned int r = 1; r < tableMat.size(); r++) //Goes to every row of the Matrix
66  {
67  unsigned int fecnumber;
68  unsigned int crate;
69  unsigned int vme_base_address;
70 
71  // 01234567890123
72  // BPix_Pxl_FEC_1
73  // string fullFECName = tableMat[r][colM["PIXEL_FEC"]] ;
74  // fullFECName.replace(0,13,"") ;
75  fecnumber = atoi(tableMat[r][colM["PIXFEC_NAME"]].c_str());
76  crate = atoi(tableMat[r][colM["CRATE_NUMBER"]].c_str());
77  string hexVMEAddr = tableMat[r][colM["VME_ADDR"]];
78  sscanf(hexVMEAddr.c_str(), "%x", &vme_base_address);
80 
81  tmp.setFECParameters(fecnumber, crate, vme_base_address);
82 
83  fecconfig_.push_back(tmp);
84  }
85 
86 } // end contructor
This class implements..
std::vector< PixelFECParameters > fecconfig_
tmp
align.sh
Definition: createJobs.py:716
PixelConfigBase(std::string description, std::string creator, std::string date)

Member Function Documentation

◆ crateFromFECNumber()

unsigned int pos::PixelFECConfig::crateFromFECNumber ( unsigned int  fecnumber) const

◆ FECSlotFromFECNumber()

unsigned int pos::PixelFECConfig::FECSlotFromFECNumber ( unsigned int  fecnumber)
inline

Definition at line 40 of file PixelFECConfig.h.

References FECSlotFromVMEBaseAddress(), and VMEBaseAddressFromFECNumber().

40  {
42  }
unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress)
unsigned int VMEBaseAddressFromFECNumber(unsigned int fecnumber) const

◆ FECSlotFromVMEBaseAddress()

unsigned int pos::PixelFECConfig::FECSlotFromVMEBaseAddress ( unsigned int  VMEBaseAddress)
inlineprivate

Definition at line 61 of file PixelFECConfig.h.

References cms::cuda::assert().

Referenced by FECSlotFromFECNumber(), and getFECSlot().

61  {
62  assert(VMEBaseAddress % 0x8000000 == 0);
63  return VMEBaseAddress / 0x8000000;
64  }
assert(be >=bs)

◆ getCrate()

unsigned int pos::PixelFECConfig::getCrate ( unsigned int  i) const

◆ getFECNumber()

unsigned int pos::PixelFECConfig::getFECNumber ( unsigned int  i) const

◆ getFECSlot()

unsigned int pos::PixelFECConfig::getFECSlot ( unsigned int  i)
inline

Definition at line 39 of file PixelFECConfig.h.

References FECSlotFromVMEBaseAddress(), getVMEBaseAddress(), and mps_fire::i.

unsigned int FECSlotFromVMEBaseAddress(unsigned int VMEBaseAddress)
unsigned int getVMEBaseAddress(unsigned int i) const

◆ getNFECBoards()

unsigned int pos::PixelFECConfig::getNFECBoards ( ) const

◆ getVMEBaseAddress()

unsigned int pos::PixelFECConfig::getVMEBaseAddress ( unsigned int  i) const

Referenced by getFECSlot().

◆ VMEBaseAddressFromFECNumber()

unsigned int pos::PixelFECConfig::VMEBaseAddressFromFECNumber ( unsigned int  fecnumber) const

Referenced by FECSlotFromFECNumber().

◆ writeASCII()

void pos::PixelFECConfig::writeASCII ( std::string  dir = "") const
overridevirtual

Implements pos::PixelConfigBase.

◆ writeXML() [1/2]

void pos::PixelFECConfig::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 45 of file PixelFECConfig.h.

45 { ; }

◆ writeXML() [2/2]

void pos::PixelFECConfig::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

◆ writeXMLHeader()

void pos::PixelFECConfig::writeXMLHeader ( pos::PixelConfigKey  key,
int  version,
std::string  path,
std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

◆ writeXMLTrailer()

void pos::PixelFECConfig::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Member Data Documentation

◆ fecconfig_

std::vector<PixelFECParameters> pos::PixelFECConfig::fecconfig_
private

Definition at line 72 of file PixelFECConfig.h.

Referenced by PixelFECConfig().