CMS 3D CMS Logo

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

This is the documentation about PixelNameTranslation... More...

#include <PixelPortCardConfig.h>

Inheritance diagram for pos::PixelPortCardConfig:
pos::PixelConfigBase

Public Member Functions

unsigned int AOHBiasAddressFromAOHNumber (unsigned int AOHNumber) const
 
unsigned int AOHGainAddressFromAOHNumber (unsigned int AOHNumber) const
 
unsigned int getAOHBias (unsigned int AOHNumber) const
 
unsigned int getAOHGain (unsigned int AOHNumber) const
 
unsigned int getccuAddress () const
 
unsigned int getchannelAddress () const
 
unsigned int getdeviceAddress (unsigned int i) const
 
unsigned int getdeviceAddressForSetting (std::string settingName) const
 
unsigned int getdevicesize () const
 
unsigned int getdeviceValues (unsigned int i) const
 
unsigned int getdeviceValuesForAddress (unsigned int address) const
 
unsigned int getdeviceValuesForSetting (std::string settingName) const
 
unsigned int geti2cSpeed () const
 
const std::string & getPortCardName () const
 
unsigned int getringAddress () const
 
std::string getTKFECID () const
 
std::string gettype () const
 
unsigned int new_PLL_CTR2_value (std::string CTR4or5, unsigned int last_CTR2) const
 
 PixelPortCardConfig (std::vector< std::vector< std::string > > &tableMat)
 
 PixelPortCardConfig (std::string)
 
void setAOHGain (unsigned int AOHNumber, unsigned int value)
 
void setdeviceValues (unsigned int address, unsigned int value)
 
void setdeviceValues (std::string settingName, unsigned int value)
 
void setPortCardName (std::string newName)
 
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

std::string AOHGainStringFromAOHNumber (unsigned int AOHNumber) const
 
bool containsDeviceAddress (unsigned int deviceAddress) const
 
bool containsSetting (std::string settingName) const
 
void fillDBToFileAddress ()
 
void fillNameToAddress ()
 
void setAOHGain (std::string settingName, unsigned int value)
 
void setDataBaseAOHGain (std::string settingName, unsigned int value)
 
void sortDeviceList ()
 

Private Attributes

unsigned int aohcount_
 
unsigned int ccuAddress_
 
unsigned int channelAddress_
 
std::vector< std::pair< unsigned int, unsigned int > > device_
 
unsigned int i2cSpeed_
 
std::vector< unsigned int > key_
 key used for sorting device_ More...
 
std::map< std::string, std::string > nameDBtoFileConversion_
 
std::map< std::string, unsigned int > nameToAddress_
 
std::string portcardname_
 
unsigned int ringAddress_
 
std::string TKFECID_
 
std::string type_
 

Detailed Description

This is the documentation about PixelNameTranslation...

" "

This class specifies the settings on the TKPCIFEC and the settings on the portcard

" "

This class provides the mapping between portcards and the modules controlled by the card

Definition at line 27 of file PixelPortCardConfig.h.

Constructor & Destructor Documentation

pos::PixelPortCardConfig::PixelPortCardConfig ( std::vector< std::vector< std::string > > &  tableMat)
PixelPortCardConfig::PixelPortCardConfig ( std::string  filename)

Definition at line 365 of file PixelPortCardConfig.cc.

References ccuAddress_, channelAddress_, containsSetting(), gather_cfg::cout, TauDecayModes::dec, device_, fillDBToFileAddress(), fillNameToAddress(), getdeviceAddressForSetting(), getdeviceValuesForSetting(), i2cSpeed_, recoMuon::in, pos::PortCardSettingNames::k_PLL_CTR2, pos::PortCardSettingNames::k_PLL_CTR4, pos::PortCardSettingNames::k_PLL_CTR4or5, pos::PortCardSettingNames::k_PLL_CTR5, nameToAddress_, new_PLL_CTR2_value(), AlCaHLTBitMon_ParallelJobs::p, portcardname_, ringAddress_, setAOHGain(), AlCaHLTBitMon_QueryRunRegistry::string, TKFECID_, and type_.

365  :
366  PixelConfigBase(" "," "," "){
367 
368  string mthn = "[PixelPortCardConfig::PixelPortCardConfig()]\t\t " ;
369  //std::cout << __LINE__ << "]\t" << mthn << "filename:"<<filename<<std::endl;
370 
371  size_t portcardpos=filename.find(std::string("portcard_"));
372  //std::cout << __LINE__ << "]\t" << mthn << "portcardpos:"<<portcardpos<<std::endl;
373  assert(portcardpos!=(unsigned int)std::string::npos);
374  size_t datpos=filename.find(std::string(".dat"));
375  //std::cout << __LINE__ << "]\t" << mthn << "datpos:"<<datpos<<std::endl;
376  assert(datpos!=(unsigned int)std::string::npos);
377  assert(datpos>portcardpos);
378 
379  portcardname_=filename.substr(portcardpos+9,datpos-portcardpos-9);
380 
381  //std::cout << "Portcard name extracted from file name:"<<portcardname_<<std::endl;
382 
383  std::ifstream in(filename.c_str());
384 
385  if(!in.good()){
386  std::cout << __LINE__ << "]\t" << mthn << "Could not open: " << filename << std::endl;
387  throw std::runtime_error("Failed to open file "+filename);
388  }
389  else {
390  std::cout << __LINE__ << "]\t" << mthn << "Opened: " << filename << std::endl;
391  }
392 
393  string dummy;
394 
395  in >> dummy;
396  if ( dummy == "Name:" ) // check that port card name matches the file name
397  {
398  in >> dummy; assert( dummy==portcardname_ );
399  in >> dummy;
400  }
401  if ( dummy == "Type:" ) // read in the type, defaulting to "fpix" if not specified
402  {
403  in >> type_;
404  assert( type_ == "fpix" || type_ == "bpix" );
405  in >> dummy;
406  }
407  else
408  {
409  type_ = "fpix";
410  }
413  assert(dummy=="TKFECID:"); in >> TKFECID_;
414  in >> dummy; assert(dummy=="ringAddress:"); in >> std::hex >> ringAddress_;
415  in >> dummy; assert(dummy=="ccuAddress:"); in >> std::hex >> ccuAddress_;
416  in >> dummy; assert(dummy=="channelAddress:"); in >> std::hex >> channelAddress_;
417  in >> dummy; assert(dummy=="i2cSpeed:"); in >> std::hex >> i2cSpeed_;
418 
419  //std::cout << __LINE__ << "]\t" << mthn
420  // <<TKFECAddress_<<", "<<ringAddress_<<", "<<ccuAddress_<<", "<<channelAddress_<<", "<<i2cSpeed_<<std::endl;
421 
422  assert( !nameToAddress_.empty() );
423  do {
424 
425  std::string settingName;
426  unsigned int i2c_address;
427  unsigned int i2c_values;
428 
429  in >> settingName >> std::hex >> i2c_values >> std::dec;
430  if (in.eof()) break;
431 
432  if ( settingName[settingName.size()-1] == ':' ) settingName.resize( settingName.size()-1 ); // remove ':' from end of string, if it's there
433 
434  // Special handling for AOHX_GainY
435  if ( settingName.find("AOH") != string::npos && settingName.find("Gain") != string::npos // contains both "AOH" and "Gain"
436  && settingName.find("123") == string::npos && settingName.find("456") == string::npos ) // does not contain "123" or "456"
437  {
438  setAOHGain(settingName, i2c_values);
439  }
440  else if ( settingName == k_PLL_CTR4 || settingName == k_PLL_CTR5 ) // special handling
441  {
442  unsigned int last_CTR2 = 0x0;
444 
445  device_.push_back( make_pair(getdeviceAddressForSetting(k_PLL_CTR2), new_PLL_CTR2_value(settingName, last_CTR2)) );
446  device_.push_back( make_pair(getdeviceAddressForSetting(k_PLL_CTR4or5), i2c_values) );
447  }
448  else // no special handling for this name
449  {
450  std::map<std::string, unsigned int>::iterator foundName_itr = nameToAddress_.find(settingName);
451 
452  if ( foundName_itr != nameToAddress_.end() )
453  {
454  i2c_address = foundName_itr->second;
455  }
456  else
457  {
458  i2c_address = strtoul(settingName.c_str(), nullptr, 16); // convert string to integer using base 16
459  }
460  pair<unsigned int, unsigned int> p(i2c_address, i2c_values);
461  device_.push_back(p);
462  }
463  }
464  while (!in.eof());
465 
466  in.close();
467 
468 }
unsigned int new_PLL_CTR2_value(std::string CTR4or5, unsigned int last_CTR2) const
std::map< std::string, unsigned int > nameToAddress_
unsigned int getdeviceValuesForSetting(std::string settingName) const
unsigned int getdeviceAddressForSetting(std::string settingName) const
std::vector< std::pair< unsigned int, unsigned int > > device_
bool containsSetting(std::string settingName) const
void setAOHGain(unsigned int AOHNumber, unsigned int value)
PixelConfigBase(std::string description, std::string creator, std::string date)

Member Function Documentation

unsigned int PixelPortCardConfig::AOHBiasAddressFromAOHNumber ( unsigned int  AOHNumber) const

Definition at line 1171 of file PixelPortCardConfig.cc.

References gather_cfg::cout, pos::PortCardSettingNames::k_bpix_AOH1_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias6_address, pos::PortCardSettingNames::k_fpix_AOH_Bias1_address, pos::PortCardSettingNames::k_fpix_AOH_Bias2_address, pos::PortCardSettingNames::k_fpix_AOH_Bias3_address, pos::PortCardSettingNames::k_fpix_AOH_Bias4_address, pos::PortCardSettingNames::k_fpix_AOH_Bias5_address, pos::PortCardSettingNames::k_fpix_AOH_Bias6_address, AlCaHLTBitMon_QueryRunRegistry::string, and type_.

Referenced by getAOHBias().

1172 {
1173  std::string mthn = "[PixelPortCardConfig::AOHBiasAddressFromAOHNumber()] " ;
1174  if ( type_ == "fpix" )
1175  {
1176  if (AOHNumber == 1) return PortCardSettingNames::k_fpix_AOH_Bias1_address;
1177  else if (AOHNumber == 2) return PortCardSettingNames::k_fpix_AOH_Bias2_address;
1178  else if (AOHNumber == 3) return PortCardSettingNames::k_fpix_AOH_Bias3_address;
1179  else if (AOHNumber == 4) return PortCardSettingNames::k_fpix_AOH_Bias4_address;
1180  else if (AOHNumber == 5) return PortCardSettingNames::k_fpix_AOH_Bias5_address;
1181  else if (AOHNumber == 6) return PortCardSettingNames::k_fpix_AOH_Bias6_address;
1182  else {std::cout << __LINE__ << "]\t" << mthn
1183  << "ERROR: For fpix, AOH number must be in the range 1-6, but the given AOH number was "
1184  << AOHNumber
1185  << "."
1186  << std::endl;
1187  assert(0);}
1188  }
1189  else if ( type_ == "bpix" )
1190  {
1191  if (AOHNumber == 1) return PortCardSettingNames::k_bpix_AOH1_Bias1_address;
1192  else if (AOHNumber == 2) return PortCardSettingNames::k_bpix_AOH1_Bias2_address;
1193  else if (AOHNumber == 3) return PortCardSettingNames::k_bpix_AOH1_Bias3_address;
1194  else if (AOHNumber == 4) return PortCardSettingNames::k_bpix_AOH1_Bias4_address;
1195  else if (AOHNumber == 5) return PortCardSettingNames::k_bpix_AOH1_Bias5_address;
1196  else if (AOHNumber == 6) return PortCardSettingNames::k_bpix_AOH1_Bias6_address;
1197  else if (AOHNumber == 7) return PortCardSettingNames::k_bpix_AOH2_Bias1_address;
1198  else if (AOHNumber == 8) return PortCardSettingNames::k_bpix_AOH2_Bias2_address;
1199  else if (AOHNumber == 9) return PortCardSettingNames::k_bpix_AOH2_Bias3_address;
1200  else if (AOHNumber ==10) return PortCardSettingNames::k_bpix_AOH2_Bias4_address;
1201  else if (AOHNumber ==11) return PortCardSettingNames::k_bpix_AOH2_Bias5_address;
1202  else if (AOHNumber ==12) return PortCardSettingNames::k_bpix_AOH2_Bias6_address;
1203  else if (AOHNumber ==13) return PortCardSettingNames::k_bpix_AOH3_Bias1_address;
1204  else if (AOHNumber ==14) return PortCardSettingNames::k_bpix_AOH3_Bias2_address;
1205  else if (AOHNumber ==15) return PortCardSettingNames::k_bpix_AOH3_Bias3_address;
1206  else if (AOHNumber ==16) return PortCardSettingNames::k_bpix_AOH3_Bias4_address;
1207  else if (AOHNumber ==17) return PortCardSettingNames::k_bpix_AOH3_Bias5_address;
1208  else if (AOHNumber ==18) return PortCardSettingNames::k_bpix_AOH3_Bias6_address;
1209  else if (AOHNumber ==19) return PortCardSettingNames::k_bpix_AOH4_Bias1_address;
1210  else if (AOHNumber ==20) return PortCardSettingNames::k_bpix_AOH4_Bias2_address;
1211  else if (AOHNumber ==21) return PortCardSettingNames::k_bpix_AOH4_Bias3_address;
1212  else if (AOHNumber ==22) return PortCardSettingNames::k_bpix_AOH4_Bias4_address;
1213  else if (AOHNumber ==23) return PortCardSettingNames::k_bpix_AOH4_Bias5_address;
1214  else if (AOHNumber ==24) return PortCardSettingNames::k_bpix_AOH4_Bias6_address;
1215  else {std::cout << __LINE__ << "]\t" << mthn
1216  << "ERROR: For bpix, AOH number must be in the range 1-24, but the given AOH number was "
1217  << AOHNumber
1218  << "."
1219  << std::endl;
1220  assert(0);}
1221  }
1222  else assert(0);
1223 }
const unsigned int k_bpix_AOH4_Bias6_address
const unsigned int k_fpix_AOH_Bias6_address
const unsigned int k_bpix_AOH3_Bias4_address
const unsigned int k_bpix_AOH3_Bias3_address
const unsigned int k_bpix_AOH2_Bias3_address
const unsigned int k_bpix_AOH2_Bias5_address
const unsigned int k_bpix_AOH4_Bias2_address
const unsigned int k_bpix_AOH1_Bias4_address
const unsigned int k_bpix_AOH3_Bias1_address
const unsigned int k_bpix_AOH3_Bias5_address
const unsigned int k_bpix_AOH2_Bias2_address
const unsigned int k_bpix_AOH1_Bias2_address
const unsigned int k_bpix_AOH1_Bias3_address
const unsigned int k_bpix_AOH4_Bias4_address
const unsigned int k_bpix_AOH3_Bias6_address
const unsigned int k_bpix_AOH4_Bias3_address
const unsigned int k_fpix_AOH_Bias5_address
const unsigned int k_bpix_AOH4_Bias1_address
const unsigned int k_bpix_AOH1_Bias6_address
const unsigned int k_fpix_AOH_Bias2_address
const unsigned int k_bpix_AOH1_Bias1_address
const unsigned int k_fpix_AOH_Bias4_address
const unsigned int k_fpix_AOH_Bias3_address
const unsigned int k_bpix_AOH1_Bias5_address
const unsigned int k_bpix_AOH3_Bias2_address
const unsigned int k_bpix_AOH2_Bias1_address
const unsigned int k_bpix_AOH2_Bias6_address
const unsigned int k_bpix_AOH4_Bias5_address
const unsigned int k_fpix_AOH_Bias1_address
const unsigned int k_bpix_AOH2_Bias4_address
unsigned int PixelPortCardConfig::AOHGainAddressFromAOHNumber ( unsigned int  AOHNumber) const

Definition at line 1279 of file PixelPortCardConfig.cc.

References gather_cfg::cout, pos::PortCardSettingNames::k_bpix_AOH1_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain456_address, pos::PortCardSettingNames::k_fpix_AOH_Gain123_address, pos::PortCardSettingNames::k_fpix_AOH_Gain456_address, AlCaHLTBitMon_QueryRunRegistry::string, and type_.

Referenced by getAOHBias(), and getAOHGain().

1280 {
1281  std::string mthn = "[PixelPortCardConfig::AOHGainAddressFromAOHNumber()] " ;
1282  unsigned int address;
1283  if ( type_ == "fpix" )
1284  {
1285  if (AOHNumber == 1) address = PortCardSettingNames::k_fpix_AOH_Gain123_address;
1286  else if (AOHNumber == 2) address = PortCardSettingNames::k_fpix_AOH_Gain123_address;
1287  else if (AOHNumber == 3) address = PortCardSettingNames::k_fpix_AOH_Gain123_address;
1288  else if (AOHNumber == 4) address = PortCardSettingNames::k_fpix_AOH_Gain456_address;
1289  else if (AOHNumber == 5) address = PortCardSettingNames::k_fpix_AOH_Gain456_address;
1290  else if (AOHNumber == 6) address = PortCardSettingNames::k_fpix_AOH_Gain456_address;
1291  else {std::cout << __LINE__ << "]\t" << mthn
1292  << "ERROR: For fpix, AOH number must be in the range 1-6, but the given AOH number was "
1293  << AOHNumber
1294  << "."
1295  << std::endl;
1296  assert(0);}
1297  }
1298  else if ( type_ == "bpix" )
1299  {
1300  if (AOHNumber == 1) address = PortCardSettingNames::k_bpix_AOH1_Gain123_address;
1301  else if (AOHNumber == 2) address = PortCardSettingNames::k_bpix_AOH1_Gain123_address;
1302  else if (AOHNumber == 3) address = PortCardSettingNames::k_bpix_AOH1_Gain123_address;
1303  else if (AOHNumber == 4) address = PortCardSettingNames::k_bpix_AOH1_Gain456_address;
1304  else if (AOHNumber == 5) address = PortCardSettingNames::k_bpix_AOH1_Gain456_address;
1305  else if (AOHNumber == 6) address = PortCardSettingNames::k_bpix_AOH1_Gain456_address;
1306  else if (AOHNumber == 7) address = PortCardSettingNames::k_bpix_AOH2_Gain123_address;
1307  else if (AOHNumber == 8) address = PortCardSettingNames::k_bpix_AOH2_Gain123_address;
1308  else if (AOHNumber == 9) address = PortCardSettingNames::k_bpix_AOH2_Gain123_address;
1309  else if (AOHNumber ==10) address = PortCardSettingNames::k_bpix_AOH2_Gain456_address;
1310  else if (AOHNumber ==11) address = PortCardSettingNames::k_bpix_AOH2_Gain456_address;
1311  else if (AOHNumber ==12) address = PortCardSettingNames::k_bpix_AOH2_Gain456_address;
1312  else if (AOHNumber ==13) address = PortCardSettingNames::k_bpix_AOH3_Gain123_address;
1313  else if (AOHNumber ==14) address = PortCardSettingNames::k_bpix_AOH3_Gain123_address;
1314  else if (AOHNumber ==15) address = PortCardSettingNames::k_bpix_AOH3_Gain123_address;
1315  else if (AOHNumber ==16) address = PortCardSettingNames::k_bpix_AOH3_Gain456_address;
1316  else if (AOHNumber ==17) address = PortCardSettingNames::k_bpix_AOH3_Gain456_address;
1317  else if (AOHNumber ==18) address = PortCardSettingNames::k_bpix_AOH3_Gain456_address;
1318  else if (AOHNumber ==19) address = PortCardSettingNames::k_bpix_AOH4_Gain123_address;
1319  else if (AOHNumber ==20) address = PortCardSettingNames::k_bpix_AOH4_Gain123_address;
1320  else if (AOHNumber ==21) address = PortCardSettingNames::k_bpix_AOH4_Gain123_address;
1321  else if (AOHNumber ==22) address = PortCardSettingNames::k_bpix_AOH4_Gain456_address;
1322  else if (AOHNumber ==23) address = PortCardSettingNames::k_bpix_AOH4_Gain456_address;
1323  else if (AOHNumber ==24) address = PortCardSettingNames::k_bpix_AOH4_Gain456_address;
1324  else {std::cout << __LINE__ << "]\t" << mthn
1325  << "ERROR: For bpix, AOH number must be in the range 1-24, but the given AOH number was "
1326  << AOHNumber
1327  << "."
1328  << std::endl;
1329  assert(0);}
1330  }
1331  else assert(0);
1332 
1333  return address;
1334 }
const unsigned int k_bpix_AOH1_Gain123_address
const unsigned int k_bpix_AOH1_Gain456_address
const unsigned int k_bpix_AOH4_Gain456_address
const unsigned int k_bpix_AOH2_Gain456_address
const unsigned int k_bpix_AOH4_Gain123_address
const unsigned int k_fpix_AOH_Gain123_address
const unsigned int k_bpix_AOH2_Gain123_address
const unsigned int k_bpix_AOH3_Gain123_address
const unsigned int k_fpix_AOH_Gain456_address
const unsigned int k_bpix_AOH3_Gain456_address
std::string PixelPortCardConfig::AOHGainStringFromAOHNumber ( unsigned int  AOHNumber) const
private

Definition at line 1225 of file PixelPortCardConfig.cc.

References gather_cfg::cout, AlCaHLTBitMon_QueryRunRegistry::string, and type_.

Referenced by containsSetting(), and setAOHGain().

1226 {
1227  std::string mthn = "[PixelPortCardConfig::AOHGainStringFromAOHNumber()] " ;
1228  if ( type_ == "fpix" )
1229  {
1230  if (AOHNumber == 1) return "AOH_Gain1";
1231  else if (AOHNumber == 2) return "AOH_Gain2";
1232  else if (AOHNumber == 3) return "AOH_Gain3";
1233  else if (AOHNumber == 4) return "AOH_Gain4";
1234  else if (AOHNumber == 5) return "AOH_Gain5";
1235  else if (AOHNumber == 6) return "AOH_Gain6";
1236  else {std::cout << __LINE__ << "]\t" << mthn
1237  << "ERROR: For fpix, AOH number must be in the range 1-6, but the given AOH number was "
1238  << AOHNumber
1239  << "."
1240  << std::endl;
1241  assert(0);}
1242  }
1243  else if ( type_ == "bpix" )
1244  {
1245  if (AOHNumber == 1) return "AOH1_Gain1";
1246  else if (AOHNumber == 2) return "AOH1_Gain2";
1247  else if (AOHNumber == 3) return "AOH1_Gain3";
1248  else if (AOHNumber == 4) return "AOH1_Gain4";
1249  else if (AOHNumber == 5) return "AOH1_Gain5";
1250  else if (AOHNumber == 6) return "AOH1_Gain6";
1251  else if (AOHNumber == 7) return "AOH2_Gain1";
1252  else if (AOHNumber == 8) return "AOH2_Gain2";
1253  else if (AOHNumber == 9) return "AOH2_Gain3";
1254  else if (AOHNumber ==10) return "AOH2_Gain4";
1255  else if (AOHNumber ==11) return "AOH2_Gain5";
1256  else if (AOHNumber ==12) return "AOH2_Gain6";
1257  else if (AOHNumber ==13) return "AOH3_Gain1";
1258  else if (AOHNumber ==14) return "AOH3_Gain2";
1259  else if (AOHNumber ==15) return "AOH3_Gain3";
1260  else if (AOHNumber ==16) return "AOH3_Gain4";
1261  else if (AOHNumber ==17) return "AOH3_Gain5";
1262  else if (AOHNumber ==18) return "AOH3_Gain6";
1263  else if (AOHNumber ==19) return "AOH4_Gain1";
1264  else if (AOHNumber ==20) return "AOH4_Gain2";
1265  else if (AOHNumber ==21) return "AOH4_Gain3";
1266  else if (AOHNumber ==22) return "AOH4_Gain4";
1267  else if (AOHNumber ==23) return "AOH4_Gain5";
1268  else if (AOHNumber ==24) return "AOH4_Gain6";
1269  else {std::cout << __LINE__ << "]\t" << mthn
1270  << "ERROR: For bpix, AOH number must be in the range 1-24, but the given AOH number was "
1271  << AOHNumber
1272  << "."
1273  << std::endl;
1274  assert(0);}
1275  }
1276  else assert(0);
1277 }
bool PixelPortCardConfig::containsDeviceAddress ( unsigned int  deviceAddress) const
private

Definition at line 1162 of file PixelPortCardConfig.cc.

References device_.

Referenced by containsSetting(), and setAOHGain().

1163 {
1164  for ( std::vector<std::pair<unsigned int, unsigned int> >::const_iterator device_itr = device_.begin(); device_itr != device_.end(); ++device_itr )
1165  {
1166  if ( device_itr->first == deviceAddress ) return true;
1167  }
1168  return false;
1169 }
std::vector< std::pair< unsigned int, unsigned int > > device_
bool pos::PixelPortCardConfig::containsSetting ( std::string  settingName) const
inlineprivate

Definition at line 83 of file PixelPortCardConfig.h.

References AOHGainStringFromAOHNumber(), containsDeviceAddress(), getdeviceAddressForSetting(), setAOHGain(), setDataBaseAOHGain(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by PixelPortCardConfig().

83 { return containsDeviceAddress(getdeviceAddressForSetting(settingName)); }
bool containsDeviceAddress(unsigned int deviceAddress) const
unsigned int getdeviceAddressForSetting(std::string settingName) const
void PixelPortCardConfig::fillDBToFileAddress ( )
private

Definition at line 728 of file PixelPortCardConfig.cc.

References pos::PortCardSettingNames::k_AOH1_Bias1, pos::PortCardSettingNames::k_AOH1_Bias2, pos::PortCardSettingNames::k_AOH1_Bias3, pos::PortCardSettingNames::k_AOH1_Bias4, pos::PortCardSettingNames::k_AOH1_Bias5, pos::PortCardSettingNames::k_AOH1_Bias6, pos::PortCardSettingNames::k_AOH2_Bias1, pos::PortCardSettingNames::k_AOH2_Bias2, pos::PortCardSettingNames::k_AOH2_Bias3, pos::PortCardSettingNames::k_AOH2_Bias4, pos::PortCardSettingNames::k_AOH2_Bias5, pos::PortCardSettingNames::k_AOH2_Bias6, pos::PortCardSettingNames::k_AOH3_Bias1, pos::PortCardSettingNames::k_AOH3_Bias2, pos::PortCardSettingNames::k_AOH3_Bias3, pos::PortCardSettingNames::k_AOH3_Bias4, pos::PortCardSettingNames::k_AOH3_Bias5, pos::PortCardSettingNames::k_AOH3_Bias6, pos::PortCardSettingNames::k_AOH4_Bias1, pos::PortCardSettingNames::k_AOH4_Bias2, pos::PortCardSettingNames::k_AOH4_Bias3, pos::PortCardSettingNames::k_AOH4_Bias4, pos::PortCardSettingNames::k_AOH4_Bias5, pos::PortCardSettingNames::k_AOH4_Bias6, pos::PortCardSettingNames::k_AOH_Bias1, pos::PortCardSettingNames::k_AOH_Bias2, pos::PortCardSettingNames::k_AOH_Bias3, pos::PortCardSettingNames::k_AOH_Bias4, pos::PortCardSettingNames::k_AOH_Bias5, pos::PortCardSettingNames::k_AOH_Bias6, pos::PortCardSettingNames::k_Delay25_GCR, pos::PortCardSettingNames::k_Delay25_RCL, pos::PortCardSettingNames::k_Delay25_RDA, pos::PortCardSettingNames::k_Delay25_SCL, pos::PortCardSettingNames::k_Delay25_SDA, pos::PortCardSettingNames::k_Delay25_TRG, pos::PortCardSettingNames::k_DOH_Ch0Bias_CLK, pos::PortCardSettingNames::k_DOH_Ch1Bias_Data, pos::PortCardSettingNames::k_DOH_Gain_SEU, pos::PortCardSettingNames::k_PLL_CTR1, pos::PortCardSettingNames::k_PLL_CTR2, pos::PortCardSettingNames::k_PLL_CTR3, pos::PortCardSettingNames::k_PLL_CTR4, pos::PortCardSettingNames::k_PLL_CTR5, nameDBtoFileConversion_, and type_.

Referenced by PixelPortCardConfig(), and setAOHGain().

729 {
730  if(type_ == "fpix")
731  {
732  // nameDBtoFileConversion_["CONFIG_KEY_ID" ] = ;
733  // nameDBtoFileConversion_["CONFIG_KEY" ] = ;
734  // nameDBtoFileConversion_["VERSION" ] = ;
735  // nameDBtoFileConversion_["CONDITION_DATA_SET_ID" ] = ;
736  // nameDBtoFileConversion_["KIND_OF_CONDITION_ID" ] = ;
737  // nameDBtoFileConversion_["KIND_OF_COND" ] = ;
738  // nameDBtoFileConversion_["SERIAL_NUMBER" ] = ;
739  // nameDBtoFileConversion_["PORT_CARD_ID" ] = ;
740  // nameDBtoFileConversion_["PORT_CARD" ] = ;
741  // nameDBtoFileConversion_["TRKFEC_NAME" ] = ;
742  // nameDBtoFileConversion_["RINGADDRESS" ] = ;
743  // nameDBtoFileConversion_["CHANNELADDRESS" ] = ;
744  // nameDBtoFileConversion_["CCUADDRESS" ] = ;
745  // nameDBtoFileConversion_["I2C_CNTRL" ] = ;
746  // nameDBtoFileConversion_["I2CSPEED" ] = ;
747  nameDBtoFileConversion_["AOH_BIAS1" ] = k_AOH_Bias1 ;
748  nameDBtoFileConversion_["AOH_BIAS2" ] = k_AOH_Bias2 ;
749  nameDBtoFileConversion_["AOH_BIAS3" ] = k_AOH_Bias3 ;
750  nameDBtoFileConversion_["AOH_BIAS4" ] = k_AOH_Bias4 ;
751  nameDBtoFileConversion_["AOH_BIAS5" ] = k_AOH_Bias5 ;
752  nameDBtoFileConversion_["AOH_BIAS6" ] = k_AOH_Bias6 ;
753  nameDBtoFileConversion_["AOH1_BIAS1" ] = k_AOH1_Bias1 ;
754  nameDBtoFileConversion_["AOH1_BIAS2" ] = k_AOH1_Bias2 ;
755  nameDBtoFileConversion_["AOH1_BIAS3" ] = k_AOH1_Bias3 ;
756  nameDBtoFileConversion_["AOH1_BIAS4" ] = k_AOH1_Bias4 ;
757  nameDBtoFileConversion_["AOH1_BIAS5" ] = k_AOH1_Bias5 ;
758  nameDBtoFileConversion_["AOH1_BIAS6" ] = k_AOH1_Bias6 ;
759 // nameDBtoFileConversion_["AOH1_GAIN1" ] = ;
760 // nameDBtoFileConversion_["AOH1_GAIN2" ] = ;
761 // nameDBtoFileConversion_["AOH1_GAIN3" ] = ;
762 // nameDBtoFileConversion_["AOH1_GAIN4" ] = ;
763 // nameDBtoFileConversion_["AOH1_GAIN5" ] = ;
764 // nameDBtoFileConversion_["AOH1_GAIN6" ] = ;
765  nameDBtoFileConversion_["AOH2_BIAS1" ] = k_AOH2_Bias1 ;
766  nameDBtoFileConversion_["AOH2_BIAS2" ] = k_AOH2_Bias2 ;
767  nameDBtoFileConversion_["AOH2_BIAS3" ] = k_AOH2_Bias3 ;
768  nameDBtoFileConversion_["AOH2_BIAS4" ] = k_AOH2_Bias4 ;
769  nameDBtoFileConversion_["AOH2_BIAS5" ] = k_AOH2_Bias5 ;
770  nameDBtoFileConversion_["AOH2_BIAS6" ] = k_AOH2_Bias6 ;
771 // nameDBtoFileConversion_["AOH2_GAIN1" ] = ;
772 // nameDBtoFileConversion_["AOH2_GAIN2" ] = ;
773 // nameDBtoFileConversion_["AOH2_GAIN3" ] = ;
774 // nameDBtoFileConversion_["AOH2_GAIN4" ] = ;
775 // nameDBtoFileConversion_["AOH2_GAIN5" ] = ;
776 // nameDBtoFileConversion_["AOH2_GAIN6" ] = ;
777  nameDBtoFileConversion_["AOH3_BIAS1" ] = k_AOH3_Bias1 ;
778  nameDBtoFileConversion_["AOH3_BIAS2" ] = k_AOH3_Bias2 ;
779  nameDBtoFileConversion_["AOH3_BIAS3" ] = k_AOH3_Bias3 ;
780  nameDBtoFileConversion_["AOH3_BIAS4" ] = k_AOH3_Bias4 ;
781  nameDBtoFileConversion_["AOH3_BIAS5" ] = k_AOH3_Bias5 ;
782  nameDBtoFileConversion_["AOH3_BIAS6" ] = k_AOH3_Bias6 ;
783 // nameDBtoFileConversion_["AOH3_GAIN1" ] = ;
784 // nameDBtoFileConversion_["AOH3_GAIN2" ] = ;
785 // nameDBtoFileConversion_["AOH3_GAIN3" ] = ;
786 // nameDBtoFileConversion_["AOH3_GAIN4" ] = ;
787 // nameDBtoFileConversion_["AOH3_GAIN5" ] = ;
788 // nameDBtoFileConversion_["AOH3_GAIN6" ] = ;
789  nameDBtoFileConversion_["AOH4_BIAS1" ] = k_AOH4_Bias1 ;
790  nameDBtoFileConversion_["AOH4_BIAS2" ] = k_AOH4_Bias2 ;
791  nameDBtoFileConversion_["AOH4_BIAS3" ] = k_AOH4_Bias3 ;
792  nameDBtoFileConversion_["AOH4_BIAS4" ] = k_AOH4_Bias4 ;
793  nameDBtoFileConversion_["AOH4_BIAS5" ] = k_AOH4_Bias5 ;
794  nameDBtoFileConversion_["AOH4_BIAS6" ] = k_AOH4_Bias6 ;
795 // nameDBtoFileConversion_["AOH4_GAIN1" ] = ;
796 // nameDBtoFileConversion_["AOH4_GAIN2" ] = ;
797 // nameDBtoFileConversion_["AOH4_GAIN3" ] = ;
798 // nameDBtoFileConversion_["AOH4_GAIN4" ] = ;
799 // nameDBtoFileConversion_["AOH4_GAIN5" ] = ;
800 // nameDBtoFileConversion_["AOH4_GAIN6" ] = ;
801 // nameDBtoFileConversion_["AOH5_BIAS1" ] = ;
802 // nameDBtoFileConversion_["AOH5_BIAS2" ] = ;
803 // nameDBtoFileConversion_["AOH5_BIAS3" ] = ;
804 // nameDBtoFileConversion_["AOH5_BIAS4" ] = ;
805 // nameDBtoFileConversion_["AOH5_BIAS5" ] = ;
806 // nameDBtoFileConversion_["AOH5_BIAS6" ] = ;
807 // nameDBtoFileConversion_["AOH5_GAIN1" ] = ;
808 // nameDBtoFileConversion_["AOH5_GAIN2" ] = ;
809 // nameDBtoFileConversion_["AOH5_GAIN3" ] = ;
810 // nameDBtoFileConversion_["AOH5_GAIN4" ] = ;
811 // nameDBtoFileConversion_["AOH5_GAIN5" ] = ;
812 // nameDBtoFileConversion_["AOH5_GAIN6" ] = ;
813 // nameDBtoFileConversion_["AOH6_BIAS1" ] = ;
814 // nameDBtoFileConversion_["AOH6_BIAS2" ] = ;
815 // nameDBtoFileConversion_["AOH6_BIAS3" ] = ;
816 // nameDBtoFileConversion_["AOH6_BIAS4" ] = ;
817 // nameDBtoFileConversion_["AOH6_BIAS5" ] = ;
818 // nameDBtoFileConversion_["AOH6_BIAS6" ] = ;
819 // nameDBtoFileConversion_["AOH6_GAIN1" ] = ;
820 // nameDBtoFileConversion_["AOH6_GAIN2" ] = ;
821 // nameDBtoFileConversion_["AOH6_GAIN3" ] = ;
822 // nameDBtoFileConversion_["AOH6_GAIN4" ] = ;
823 // nameDBtoFileConversion_["AOH6_GAIN5" ] = ;
824 // nameDBtoFileConversion_["AOH6_GAIN6" ] = ;
825  nameDBtoFileConversion_["DELAY25_GCR" ] = k_Delay25_GCR ;
826  nameDBtoFileConversion_["DELAY25_SCL" ] = k_Delay25_SCL ;
827  nameDBtoFileConversion_["DELAY25_TRG" ] = k_Delay25_TRG ;
828  nameDBtoFileConversion_["DELAY25_SDA" ] = k_Delay25_SDA ;
829  nameDBtoFileConversion_["DELAY25_RCL" ] = k_Delay25_RCL ;
830  nameDBtoFileConversion_["DELAY25_RDA" ] = k_Delay25_RDA ;
831  // nameDBtoFileConversion_["DEL3_GCR" ] = ;
832  // nameDBtoFileConversion_["DEL3_SCL" ] = ;
833  // nameDBtoFileConversion_["DEL3_TRG" ] = ;
834  // nameDBtoFileConversion_["DEL3_SDA" ] = ;
835  // nameDBtoFileConversion_["DEL3_RCL" ] = ;
836  // nameDBtoFileConversion_["DEL3_RDA" ] = ;
839  nameDBtoFileConversion_["DOH_SEU_GAIN" ] = k_DOH_Gain_SEU ;
840  // nameDBtoFileConversion_["DOH3_BIAS0" ] = ;
841  // nameDBtoFileConversion_["DOH3_BIAS1" ] = ;
842  // nameDBtoFileConversion_["DOH3_SEU_GAIN" ] = ;
843  nameDBtoFileConversion_["PLL_CTR1" ] = k_PLL_CTR1 ;
844  nameDBtoFileConversion_["PLL_CTR2" ] = k_PLL_CTR2 ;
845  nameDBtoFileConversion_["PLL_CTR3" ] = k_PLL_CTR3 ;
846  nameDBtoFileConversion_["PLL_CTR4" ] = k_PLL_CTR4 ;
847  nameDBtoFileConversion_["PLL_CTR5" ] = k_PLL_CTR5 ;
848  // nameDBtoFileConversion_["PLL3_CTR1" ] = ;
849  // nameDBtoFileConversion_["PLL3_CTR2" ] = ;
850  // nameDBtoFileConversion_["PLL3_CTR3" ] = ;
851  // nameDBtoFileConversion_["PLL3_CTR4_5" ] = ;
852  }
853  else if(type_ == "bpix")
854  {
855  // nameDBtoFileConversion_["CONFIG_KEY_ID" ] = ;
856  // nameDBtoFileConversion_["CONFIG_KEY" ] = ;
857  // nameDBtoFileConversion_["VERSION" ] = ;
858  // nameDBtoFileConversion_["CONDITION_DATA_SET_ID" ] = ;
859  // nameDBtoFileConversion_["KIND_OF_CONDITION_ID" ] = ;
860  // nameDBtoFileConversion_["KIND_OF_COND" ] = ;
861  // nameDBtoFileConversion_["SERIAL_NUMBER" ] = ;
862  // nameDBtoFileConversion_["PORT_CARD_ID" ] = ;
863  // nameDBtoFileConversion_["PORT_CARD" ] = ;
864  // nameDBtoFileConversion_["TRKFEC_NAME" ] = ;
865  // nameDBtoFileConversion_["RINGADDRESS" ] = ;
866  // nameDBtoFileConversion_["CHANNELADDRESS" ] = ;
867  // nameDBtoFileConversion_["CCUADDRESS" ] = ;
868  // nameDBtoFileConversion_["I2C_CNTRL" ] = ;
869  // nameDBtoFileConversion_["I2CSPEED" ] = ;
870  nameDBtoFileConversion_["AOH1_BIAS1" ] = k_AOH1_Bias1 ;
871  nameDBtoFileConversion_["AOH1_BIAS2" ] = k_AOH1_Bias2 ;
872  nameDBtoFileConversion_["AOH1_BIAS3" ] = k_AOH1_Bias3 ;
873  nameDBtoFileConversion_["AOH1_BIAS4" ] = k_AOH1_Bias4 ;
874  nameDBtoFileConversion_["AOH1_BIAS5" ] = k_AOH1_Bias5 ;
875  nameDBtoFileConversion_["AOH1_BIAS6" ] = k_AOH1_Bias6 ;
876  // nameDBtoFileConversion_["AOH1_GAIN1" ] = ;
877  // nameDBtoFileConversion_["AOH1_GAIN2" ] = ;
878  // nameDBtoFileConversion_["AOH1_GAIN3" ] = ;
879  // nameDBtoFileConversion_["AOH1_GAIN4" ] = ;
880  // nameDBtoFileConversion_["AOH1_GAIN5" ] = ;
881  // nameDBtoFileConversion_["AOH1_GAIN6" ] = ;
882  nameDBtoFileConversion_["AOH2_BIAS1" ] = k_AOH2_Bias1 ;
883  nameDBtoFileConversion_["AOH2_BIAS2" ] = k_AOH2_Bias2 ;
884  nameDBtoFileConversion_["AOH2_BIAS3" ] = k_AOH2_Bias3 ;
885  nameDBtoFileConversion_["AOH2_BIAS4" ] = k_AOH2_Bias4 ;
886  nameDBtoFileConversion_["AOH2_BIAS5" ] = k_AOH2_Bias5 ;
887  nameDBtoFileConversion_["AOH2_BIAS6" ] = k_AOH2_Bias6 ;
888  // nameDBtoFileConversion_["AOH2_GAIN1" ] = ;
889  // nameDBtoFileConversion_["AOH2_GAIN2" ] = ;
890  // nameDBtoFileConversion_["AOH2_GAIN3" ] = ;
891  // nameDBtoFileConversion_["AOH2_GAIN4" ] = ;
892  // nameDBtoFileConversion_["AOH2_GAIN5" ] = ;
893  // nameDBtoFileConversion_["AOH2_GAIN6" ] = ;
894  nameDBtoFileConversion_["AOH3_BIAS1" ] = k_AOH3_Bias1 ;
895  nameDBtoFileConversion_["AOH3_BIAS2" ] = k_AOH3_Bias2 ;
896  nameDBtoFileConversion_["AOH3_BIAS3" ] = k_AOH3_Bias3 ;
897  nameDBtoFileConversion_["AOH3_BIAS4" ] = k_AOH3_Bias4 ;
898  nameDBtoFileConversion_["AOH3_BIAS5" ] = k_AOH3_Bias5 ;
899  nameDBtoFileConversion_["AOH3_BIAS6" ] = k_AOH3_Bias6 ;
900  // nameDBtoFileConversion_["AOH3_GAIN1" ] = ;
901  // nameDBtoFileConversion_["AOH3_GAIN2" ] = ;
902  // nameDBtoFileConversion_["AOH3_GAIN3" ] = ;
903  // nameDBtoFileConversion_["AOH3_GAIN4" ] = ;
904  // nameDBtoFileConversion_["AOH3_GAIN5" ] = ;
905  // nameDBtoFileConversion_["AOH3_GAIN6" ] = ;
906  nameDBtoFileConversion_["AOH4_BIAS1" ] = k_AOH4_Bias1 ;
907  nameDBtoFileConversion_["AOH4_BIAS2" ] = k_AOH4_Bias2 ;
908  nameDBtoFileConversion_["AOH4_BIAS3" ] = k_AOH4_Bias3 ;
909  nameDBtoFileConversion_["AOH4_BIAS4" ] = k_AOH4_Bias4 ;
910  nameDBtoFileConversion_["AOH4_BIAS5" ] = k_AOH4_Bias5 ;
911  nameDBtoFileConversion_["AOH4_BIAS6" ] = k_AOH4_Bias6 ;
912  // nameDBtoFileConversion_["AOH4_GAIN1" ] = ;
913  // nameDBtoFileConversion_["AOH4_GAIN2" ] = ;
914  // nameDBtoFileConversion_["AOH4_GAIN3" ] = ;
915  // nameDBtoFileConversion_["AOH4_GAIN4" ] = ;
916  // nameDBtoFileConversion_["AOH4_GAIN5" ] = ;
917  // nameDBtoFileConversion_["AOH4_GAIN6" ] = ;
918  // nameDBtoFileConversion_["AOH5_BIAS1" ] = ;
919  // nameDBtoFileConversion_["AOH5_BIAS2" ] = ;
920  // nameDBtoFileConversion_["AOH5_BIAS3" ] = ;
921  // nameDBtoFileConversion_["AOH5_BIAS4" ] = ;
922  // nameDBtoFileConversion_["AOH5_BIAS5" ] = ;
923  // nameDBtoFileConversion_["AOH5_BIAS6" ] = ;
924  // nameDBtoFileConversion_["AOH5_GAIN1" ] = ;
925  // nameDBtoFileConversion_["AOH5_GAIN2" ] = ;
926  // nameDBtoFileConversion_["AOH5_GAIN3" ] = ;
927  // nameDBtoFileConversion_["AOH5_GAIN4" ] = ;
928  // nameDBtoFileConversion_["AOH5_GAIN5" ] = ;
929  // nameDBtoFileConversion_["AOH5_GAIN6" ] = ;
930  // nameDBtoFileConversion_["AOH6_BIAS1" ] = ;
931  // nameDBtoFileConversion_["AOH6_BIAS2" ] = ;
932  // nameDBtoFileConversion_["AOH6_BIAS3" ] = ;
933  // nameDBtoFileConversion_["AOH6_BIAS4" ] = ;
934  // nameDBtoFileConversion_["AOH6_BIAS5" ] = ;
935  // nameDBtoFileConversion_["AOH6_BIAS6" ] = ;
936  // nameDBtoFileConversion_["AOH6_GAIN1" ] = ;
937  // nameDBtoFileConversion_["AOH6_GAIN2" ] = ;
938  // nameDBtoFileConversion_["AOH6_GAIN3" ] = ;
939  // nameDBtoFileConversion_["AOH6_GAIN4" ] = ;
940  // nameDBtoFileConversion_["AOH6_GAIN5" ] = ;
941  // nameDBtoFileConversion_["AOH6_GAIN6" ] = ;
942  nameDBtoFileConversion_["DELAY25_GCR" ] = k_Delay25_GCR ;
943  nameDBtoFileConversion_["DELAY25_SCL" ] = k_Delay25_SCL ;
944  nameDBtoFileConversion_["DELAY25_TRG" ] = k_Delay25_TRG ;
945  nameDBtoFileConversion_["DELAY25_SDA" ] = k_Delay25_SDA ;
946  nameDBtoFileConversion_["DELAY25_RCL" ] = k_Delay25_RCL ;
947  nameDBtoFileConversion_["DELAY25_RDA" ] = k_Delay25_RDA ;
948  // nameDBtoFileConversion_["DEL3_GCR" ] = ;
949  // nameDBtoFileConversion_["DEL3_SCL" ] = ;
950  // nameDBtoFileConversion_["DEL3_TRG" ] = ;
951  // nameDBtoFileConversion_["DEL3_SDA" ] = ;
952  // nameDBtoFileConversion_["DEL3_RCL" ] = ;
953  // nameDBtoFileConversion_["DEL3_RDA" ] = ;
956  nameDBtoFileConversion_["DOH_SEU_GAIN" ] = k_DOH_Gain_SEU ;
957  // nameDBtoFileConversion_["DOH3_BIAS0" ] = ;
958  // nameDBtoFileConversion_["DOH3_BIAS1" ] = ;
959  // nameDBtoFileConversion_["DOH3_SEU_GAIN" ] = ;
960  nameDBtoFileConversion_["PLL_CTR1" ] = k_PLL_CTR1 ;
961  nameDBtoFileConversion_["PLL_CTR2" ] = k_PLL_CTR2 ;
962  nameDBtoFileConversion_["PLL_CTR3" ] = k_PLL_CTR3 ;
963  nameDBtoFileConversion_["PLL_CTR4" ] = k_PLL_CTR4 ;
964  nameDBtoFileConversion_["PLL_CTR5" ] = k_PLL_CTR5 ;
965  // nameDBtoFileConversion_["PLL3_CTR1" ] = ;
966  // nameDBtoFileConversion_["PLL3_CTR2" ] = ;
967  // nameDBtoFileConversion_["PLL3_CTR3" ] = ;
968  // nameDBtoFileConversion_["PLL3_CTR4_5" ] = ;
969  }
970 
971 
972 }
std::map< std::string, std::string > nameDBtoFileConversion_
void PixelPortCardConfig::fillNameToAddress ( )
private

Definition at line 636 of file PixelPortCardConfig.cc.

References pos::PortCardSettingNames::k_AOH1_Bias1, pos::PortCardSettingNames::k_AOH1_Bias2, pos::PortCardSettingNames::k_AOH1_Bias3, pos::PortCardSettingNames::k_AOH1_Bias4, pos::PortCardSettingNames::k_AOH1_Bias5, pos::PortCardSettingNames::k_AOH1_Bias6, pos::PortCardSettingNames::k_AOH1_Gain123, pos::PortCardSettingNames::k_AOH1_Gain456, pos::PortCardSettingNames::k_AOH2_Bias1, pos::PortCardSettingNames::k_AOH2_Bias2, pos::PortCardSettingNames::k_AOH2_Bias3, pos::PortCardSettingNames::k_AOH2_Bias4, pos::PortCardSettingNames::k_AOH2_Bias5, pos::PortCardSettingNames::k_AOH2_Bias6, pos::PortCardSettingNames::k_AOH2_Gain123, pos::PortCardSettingNames::k_AOH2_Gain456, pos::PortCardSettingNames::k_AOH3_Bias1, pos::PortCardSettingNames::k_AOH3_Bias2, pos::PortCardSettingNames::k_AOH3_Bias3, pos::PortCardSettingNames::k_AOH3_Bias4, pos::PortCardSettingNames::k_AOH3_Bias5, pos::PortCardSettingNames::k_AOH3_Bias6, pos::PortCardSettingNames::k_AOH3_Gain123, pos::PortCardSettingNames::k_AOH3_Gain456, pos::PortCardSettingNames::k_AOH4_Bias1, pos::PortCardSettingNames::k_AOH4_Bias2, pos::PortCardSettingNames::k_AOH4_Bias3, pos::PortCardSettingNames::k_AOH4_Bias4, pos::PortCardSettingNames::k_AOH4_Bias5, pos::PortCardSettingNames::k_AOH4_Bias6, pos::PortCardSettingNames::k_AOH4_Gain123, pos::PortCardSettingNames::k_AOH4_Gain456, pos::PortCardSettingNames::k_AOH_Bias1, pos::PortCardSettingNames::k_AOH_Bias2, pos::PortCardSettingNames::k_AOH_Bias3, pos::PortCardSettingNames::k_AOH_Bias4, pos::PortCardSettingNames::k_AOH_Bias5, pos::PortCardSettingNames::k_AOH_Bias6, pos::PortCardSettingNames::k_AOH_Gain123, pos::PortCardSettingNames::k_AOH_Gain456, pos::PortCardSettingNames::k_bpix_AOH1_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH1_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH2_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH3_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias1_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias2_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias3_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias4_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias5_address, pos::PortCardSettingNames::k_bpix_AOH4_Bias6_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain456_address, pos::PortCardSettingNames::k_bpix_Delay25_GCR_address, pos::PortCardSettingNames::k_bpix_Delay25_RCL_address, pos::PortCardSettingNames::k_bpix_Delay25_RDA_address, pos::PortCardSettingNames::k_bpix_Delay25_SCL_address, pos::PortCardSettingNames::k_bpix_Delay25_SDA_address, pos::PortCardSettingNames::k_bpix_Delay25_TRG_address, pos::PortCardSettingNames::k_bpix_DOH_Ch0Bias_CLK_address, pos::PortCardSettingNames::k_bpix_DOH_Ch1Bias_Data_address, pos::PortCardSettingNames::k_bpix_DOH_Dummy_address, pos::PortCardSettingNames::k_bpix_DOH_Gain_SEU_address, pos::PortCardSettingNames::k_bpix_PLL_CTR1_address, pos::PortCardSettingNames::k_bpix_PLL_CTR2_address, pos::PortCardSettingNames::k_bpix_PLL_CTR3_address, pos::PortCardSettingNames::k_bpix_PLL_CTR4or5_address, pos::PortCardSettingNames::k_Delay25_GCR, pos::PortCardSettingNames::k_Delay25_RCL, pos::PortCardSettingNames::k_Delay25_RDA, pos::PortCardSettingNames::k_Delay25_SCL, pos::PortCardSettingNames::k_Delay25_SDA, pos::PortCardSettingNames::k_Delay25_TRG, pos::PortCardSettingNames::k_DOH_Ch0Bias_CLK, pos::PortCardSettingNames::k_DOH_Ch1Bias_Data, pos::PortCardSettingNames::k_DOH_Dummy, pos::PortCardSettingNames::k_DOH_Gain_SEU, pos::PortCardSettingNames::k_fpix_AOH_Bias1_address, pos::PortCardSettingNames::k_fpix_AOH_Bias2_address, pos::PortCardSettingNames::k_fpix_AOH_Bias3_address, pos::PortCardSettingNames::k_fpix_AOH_Bias4_address, pos::PortCardSettingNames::k_fpix_AOH_Bias5_address, pos::PortCardSettingNames::k_fpix_AOH_Bias6_address, pos::PortCardSettingNames::k_fpix_AOH_Gain123_address, pos::PortCardSettingNames::k_fpix_AOH_Gain456_address, pos::PortCardSettingNames::k_fpix_Delay25_GCR_address, pos::PortCardSettingNames::k_fpix_Delay25_RCL_address, pos::PortCardSettingNames::k_fpix_Delay25_RDA_address, pos::PortCardSettingNames::k_fpix_Delay25_SCL_address, pos::PortCardSettingNames::k_fpix_Delay25_SDA_address, pos::PortCardSettingNames::k_fpix_Delay25_TRG_address, pos::PortCardSettingNames::k_fpix_DOH_Ch0Bias_CLK_address, pos::PortCardSettingNames::k_fpix_DOH_Ch1Bias_Data_address, pos::PortCardSettingNames::k_fpix_DOH_Dummy_address, pos::PortCardSettingNames::k_fpix_DOH_Gain_SEU_address, pos::PortCardSettingNames::k_fpix_PLL_CTR1_address, pos::PortCardSettingNames::k_fpix_PLL_CTR2_address, pos::PortCardSettingNames::k_fpix_PLL_CTR3_address, pos::PortCardSettingNames::k_fpix_PLL_CTR4or5_address, pos::PortCardSettingNames::k_PLL_CTR1, pos::PortCardSettingNames::k_PLL_CTR2, pos::PortCardSettingNames::k_PLL_CTR3, pos::PortCardSettingNames::k_PLL_CTR4or5, nameToAddress_, and type_.

Referenced by PixelPortCardConfig(), and setAOHGain().

637 {
638  if ( !nameToAddress_.empty() ) return;
639 
640  if ( type_ == "fpix" )
641  {
650 
655 
662 
667  }
668  else if ( type_ == "bpix" )
669  {
678 
687 
696 
705 
710 
717 
722  }
723  else assert(0);
724 
725  return;
726 }
const unsigned int k_bpix_AOH4_Bias6_address
const unsigned int k_fpix_AOH_Bias6_address
const unsigned int k_fpix_PLL_CTR4or5_address
const unsigned int k_bpix_AOH1_Gain123_address
const unsigned int k_bpix_AOH3_Bias4_address
const unsigned int k_fpix_DOH_Ch1Bias_Data_address
const unsigned int k_bpix_AOH3_Bias3_address
const unsigned int k_bpix_AOH2_Bias3_address
const unsigned int k_fpix_DOH_Dummy_address
const unsigned int k_bpix_DOH_Dummy_address
const unsigned int k_bpix_AOH2_Bias5_address
const unsigned int k_fpix_Delay25_GCR_address
std::map< std::string, unsigned int > nameToAddress_
const unsigned int k_fpix_PLL_CTR1_address
const unsigned int k_bpix_AOH4_Bias2_address
const unsigned int k_bpix_AOH1_Gain456_address
const unsigned int k_bpix_DOH_Ch1Bias_Data_address
const unsigned int k_bpix_AOH1_Bias4_address
const unsigned int k_bpix_AOH3_Bias1_address
const unsigned int k_bpix_AOH4_Gain456_address
const unsigned int k_bpix_AOH3_Bias5_address
const unsigned int k_bpix_Delay25_SDA_address
const unsigned int k_bpix_AOH2_Bias2_address
const unsigned int k_bpix_Delay25_SCL_address
const unsigned int k_bpix_PLL_CTR2_address
const unsigned int k_bpix_Delay25_TRG_address
const unsigned int k_bpix_AOH1_Bias2_address
const unsigned int k_bpix_AOH2_Gain456_address
const unsigned int k_bpix_AOH1_Bias3_address
const unsigned int k_bpix_PLL_CTR3_address
const unsigned int k_bpix_AOH4_Bias4_address
const unsigned int k_bpix_PLL_CTR4or5_address
const unsigned int k_bpix_AOH3_Bias6_address
const unsigned int k_bpix_AOH4_Gain123_address
const unsigned int k_bpix_AOH4_Bias3_address
const unsigned int k_fpix_AOH_Bias5_address
const unsigned int k_bpix_AOH4_Bias1_address
const unsigned int k_bpix_AOH1_Bias6_address
const unsigned int k_fpix_AOH_Bias2_address
const unsigned int k_bpix_AOH1_Bias1_address
const unsigned int k_fpix_AOH_Gain123_address
const unsigned int k_fpix_Delay25_TRG_address
const unsigned int k_fpix_AOH_Bias4_address
const unsigned int k_bpix_AOH2_Gain123_address
const unsigned int k_bpix_AOH3_Gain123_address
const unsigned int k_bpix_DOH_Gain_SEU_address
const unsigned int k_bpix_Delay25_RCL_address
const unsigned int k_bpix_DOH_Ch0Bias_CLK_address
const unsigned int k_bpix_Delay25_RDA_address
const unsigned int k_bpix_Delay25_GCR_address
const unsigned int k_fpix_Delay25_SDA_address
const unsigned int k_fpix_DOH_Ch0Bias_CLK_address
const unsigned int k_fpix_DOH_Gain_SEU_address
const unsigned int k_fpix_PLL_CTR2_address
const unsigned int k_bpix_PLL_CTR1_address
const unsigned int k_fpix_Delay25_RCL_address
const unsigned int k_fpix_Delay25_SCL_address
const unsigned int k_fpix_AOH_Bias3_address
const unsigned int k_bpix_AOH1_Bias5_address
const unsigned int k_fpix_AOH_Gain456_address
const unsigned int k_bpix_AOH3_Bias2_address
const unsigned int k_fpix_PLL_CTR3_address
const unsigned int k_bpix_AOH3_Gain456_address
const unsigned int k_bpix_AOH2_Bias1_address
const unsigned int k_bpix_AOH2_Bias6_address
const unsigned int k_bpix_AOH4_Bias5_address
const unsigned int k_fpix_AOH_Bias1_address
const unsigned int k_fpix_Delay25_RDA_address
const unsigned int k_bpix_AOH2_Bias4_address
unsigned int pos::PixelPortCardConfig::getAOHBias ( unsigned int  AOHNumber) const
inline
unsigned int PixelPortCardConfig::getAOHGain ( unsigned int  AOHNumber) const

Definition at line 1336 of file PixelPortCardConfig.cc.

References AOHGainAddressFromAOHNumber(), and getdeviceValuesForAddress().

Referenced by setAOHGain().

1337 {
1338  const unsigned int address = AOHGainAddressFromAOHNumber(AOHNumber);
1339  const unsigned int threeGainsValue = getdeviceValuesForAddress(address);
1340 
1341  if ( AOHNumber%3 == 1 ) return (((threeGainsValue) & 0x03)>>0); // return bits 0 & 1
1342  if ( AOHNumber%3 == 2 ) return (((threeGainsValue) & 0x0c)>>2); // return bits 2 & 3
1343  if ( AOHNumber%3 == 0 ) return (((threeGainsValue) & 0x30)>>4); // return bits 4 & 5
1344 
1345  assert(0);
1346 }
unsigned int AOHGainAddressFromAOHNumber(unsigned int AOHNumber) const
unsigned int getdeviceValuesForAddress(unsigned int address) const
unsigned int PixelPortCardConfig::getccuAddress ( ) const

Definition at line 1087 of file PixelPortCardConfig.cc.

References ccuAddress_.

Referenced by setPortCardName().

1087  {
1088  return ccuAddress_;
1089 }
unsigned int PixelPortCardConfig::getchannelAddress ( ) const

Definition at line 1091 of file PixelPortCardConfig.cc.

References channelAddress_.

Referenced by setPortCardName().

1091  {
1092  return channelAddress_;
1093 }
unsigned int PixelPortCardConfig::getdeviceAddress ( unsigned int  i) const

Definition at line 1103 of file PixelPortCardConfig.cc.

References device_, and mps_fire::i.

Referenced by setPortCardName().

1103  {
1104  assert(i<device_.size());
1105  return device_[i].first;
1106 }
std::vector< std::pair< unsigned int, unsigned int > > device_
unsigned int PixelPortCardConfig::getdeviceAddressForSetting ( std::string  settingName) const

Definition at line 1136 of file PixelPortCardConfig.cc.

References nameToAddress_.

Referenced by containsSetting(), getdeviceValuesForSetting(), PixelPortCardConfig(), setdeviceValues(), and setPortCardName().

1137 {
1138  //std::cout << "[PixelPortCardConfig::getdeviceAddressForSetting()]\t settingName: " << settingName<< std::endl ;
1139  std::map<std::string, unsigned int>::const_iterator foundName_itr = nameToAddress_.find(settingName);
1140  assert( foundName_itr != nameToAddress_.end() );
1141  return foundName_itr->second;
1142 }
std::map< std::string, unsigned int > nameToAddress_
unsigned int PixelPortCardConfig::getdevicesize ( ) const

Definition at line 1075 of file PixelPortCardConfig.cc.

References device_.

Referenced by setPortCardName().

1075  {
1076  return device_.size();
1077 }
std::vector< std::pair< unsigned int, unsigned int > > device_
unsigned int PixelPortCardConfig::getdeviceValues ( unsigned int  i) const

Definition at line 1108 of file PixelPortCardConfig.cc.

References device_, and mps_fire::i.

Referenced by setPortCardName().

1108  {
1109  assert(i<device_.size());
1110  return device_[i].second;
1111 }
std::vector< std::pair< unsigned int, unsigned int > > device_
unsigned int PixelPortCardConfig::getdeviceValuesForAddress ( unsigned int  address) const

Definition at line 1149 of file PixelPortCardConfig.cc.

References device_, and mps_fire::i.

Referenced by getAOHBias(), getAOHGain(), getdeviceValuesForSetting(), and setPortCardName().

1150 {
1151  for (int i=device_.size()-1; i>=0; i--) // Get the last occurance of address, if there are more than one.
1152  {
1153  if( device_.at(i).first==address )
1154  {
1155  return device_.at(i).second;
1156  }
1157  }
1158  assert(0); // didn't find this device
1159  return 0;
1160 }
std::vector< std::pair< unsigned int, unsigned int > > device_
unsigned int PixelPortCardConfig::getdeviceValuesForSetting ( std::string  settingName) const

Definition at line 1144 of file PixelPortCardConfig.cc.

References getdeviceAddressForSetting(), and getdeviceValuesForAddress().

Referenced by PixelPortCardConfig(), and setPortCardName().

1145 {
1147 }
unsigned int getdeviceAddressForSetting(std::string settingName) const
unsigned int getdeviceValuesForAddress(unsigned int address) const
unsigned int PixelPortCardConfig::geti2cSpeed ( ) const

Definition at line 1095 of file PixelPortCardConfig.cc.

References i2cSpeed_.

Referenced by setPortCardName().

1095  {
1096  return i2cSpeed_;
1097 }
const std::string& pos::PixelPortCardConfig::getPortCardName ( ) const
inline

Definition at line 51 of file PixelPortCardConfig.h.

References portcardname_.

51 { return portcardname_; }
unsigned int PixelPortCardConfig::getringAddress ( ) const

Definition at line 1083 of file PixelPortCardConfig.cc.

References ringAddress_.

Referenced by setPortCardName().

1083  {
1084  return ringAddress_;
1085 }
std::string PixelPortCardConfig::getTKFECID ( ) const

Definition at line 1079 of file PixelPortCardConfig.cc.

References TKFECID_.

Referenced by setPortCardName().

1079  {
1080  return TKFECID_;
1081 }
std::string PixelPortCardConfig::gettype ( ) const

Definition at line 1099 of file PixelPortCardConfig.cc.

References type_.

Referenced by setPortCardName().

1099  {
1100  return type_;
1101 }
unsigned int PixelPortCardConfig::new_PLL_CTR2_value ( std::string  CTR4or5,
unsigned int  last_CTR2 
) const

Definition at line 492 of file PixelPortCardConfig.cc.

References pos::PortCardSettingNames::k_PLL_CTR4, and pos::PortCardSettingNames::k_PLL_CTR5.

Referenced by PixelPortCardConfig(), and setAOHGain().

493 {
494  if ( CTR4or5 == k_PLL_CTR4 ) return 0xdf & last_CTR2;
495  else if ( CTR4or5 == k_PLL_CTR5 ) return 0x20 | last_CTR2;
496  else assert(0);
497 }
void pos::PixelPortCardConfig::setAOHGain ( unsigned int  AOHNumber,
unsigned int  value 
)
inline
void PixelPortCardConfig::setAOHGain ( std::string  settingName,
unsigned int  value 
)
private

Definition at line 499 of file PixelPortCardConfig.cc.

References device_, plotBeamSpotDB::first, mps_fire::i, pos::PortCardSettingNames::k_bpix_AOH1_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain456_address, pos::PortCardSettingNames::k_fpix_AOH_Gain123_address, pos::PortCardSettingNames::k_fpix_AOH_Gain456_address, AlCaHLTBitMon_ParallelJobs::p, and type_.

500 {
501  assert( settingName.find("AOH") != string::npos && settingName.find("Gain") != string::npos // contains both "AOH" and "Gain"
502  && settingName.find("123") == string::npos && settingName.find("456") == string::npos ); // does not contain "123" or "456"
503 
504  unsigned int i2c_address;
505 
506  // Get the i2c address of this AOH, and the channel on the AOH.
507  string::size_type GainPosition = settingName.find("Gain");
508  unsigned int whichAOH;
509  if ( settingName[GainPosition-2] == 'H' ) whichAOH = 0; // fpix
510  else // bpix
511  {
512  char whichAOHDigit[2]={0,0};
513  whichAOHDigit[0]=settingName[GainPosition-2];
514  whichAOH = atoi( whichAOHDigit );
515  }
516  char digit[2]={0,0};
517  digit[0]=settingName[GainPosition+4];
518  unsigned int channelOnAOH = atoi( digit );
519  assert( (type_=="fpix" && whichAOH==0)||(type_=="bpix" && 1 <= whichAOH&&whichAOH <= 4) );
520  assert( 1 <= channelOnAOH && channelOnAOH <= 6 );
521 
522  if ( whichAOH == 0 && channelOnAOH <= 3 ) i2c_address = k_fpix_AOH_Gain123_address;
523  else if ( whichAOH == 0 && channelOnAOH >= 4 ) i2c_address = k_fpix_AOH_Gain456_address;
524  else if ( whichAOH == 1 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH1_Gain123_address;
525  else if ( whichAOH == 1 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH1_Gain456_address;
526  else if ( whichAOH == 2 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH2_Gain123_address;
527  else if ( whichAOH == 2 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH2_Gain456_address;
528  else if ( whichAOH == 3 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH3_Gain123_address;
529  else if ( whichAOH == 3 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH3_Gain456_address;
530  else if ( whichAOH == 4 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH4_Gain123_address;
531  else if ( whichAOH == 4 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH4_Gain456_address;
532  else assert(0);
533 
534  // Search for this address in the previously-defined settings.
535  bool foundOne = false;
536  for (unsigned int i=0;i<device_.size();i++)
537  {
538  if ( device_[i].first == i2c_address ) // Change this setting in all previous instances
539  {
540  foundOne = true;
541  unsigned int oldValue = device_[i].second;
542  if ( channelOnAOH%3 == 1 )
543  device_[i].second = (0x3c & oldValue) + ((value & 0x3)<<0); // replace bits 0 and 1 with value
544  else if ( channelOnAOH%3 == 2 )
545  device_[i].second = (0x33 & oldValue) + ((value & 0x3)<<2); // replace bits 2 and 3 with value
546  else if ( channelOnAOH%3 == 0 )
547  device_[i].second = (0x0f & oldValue) + ((value & 0x3)<<4); // replace bits 4 and 5 with value
548  else assert(0);
549  //std::cout << "Changed setting "<< k_fpix_AOH_Gain123 <<"(address 0x"<<std::hex<<k_fpix_AOH_Gain123_address<<") from 0x"<<oldValue<<" to 0x"<< device_[i].second << std::dec <<"\n";
550  }
551  }
552  if ( foundOne ) return;
553  else // If this was not set previously, add this setting with the other two gains set to zero.
554  {
555  unsigned int i2c_value;
556  if ( channelOnAOH%3 == 1 ) i2c_value = ((value & 0x3)<<0);
557  else if ( channelOnAOH%3 == 2 ) i2c_value = ((value & 0x3)<<2);
558  else if ( channelOnAOH%3 == 0 ) i2c_value = ((value & 0x3)<<4);
559  else assert(0);
560 
561  pair<unsigned int, unsigned int> p(i2c_address, i2c_value);
562  device_.push_back(p);
563  return;
564  }
565 }
const unsigned int k_bpix_AOH1_Gain123_address
const unsigned int k_bpix_AOH1_Gain456_address
const unsigned int k_bpix_AOH4_Gain456_address
uint16_t size_type
const unsigned int k_bpix_AOH2_Gain456_address
std::vector< std::pair< unsigned int, unsigned int > > device_
const unsigned int k_bpix_AOH4_Gain123_address
const unsigned int k_fpix_AOH_Gain123_address
const unsigned int k_bpix_AOH2_Gain123_address
const unsigned int k_bpix_AOH3_Gain123_address
Definition: value.py:1
const unsigned int k_fpix_AOH_Gain456_address
const unsigned int k_bpix_AOH3_Gain456_address
void PixelPortCardConfig::setDataBaseAOHGain ( std::string  settingName,
unsigned int  value 
)
private

Definition at line 567 of file PixelPortCardConfig.cc.

References aohcount_, device_, plotBeamSpotDB::first, mps_fire::i, pos::PortCardSettingNames::k_bpix_AOH1_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain456_address, pos::PortCardSettingNames::k_fpix_AOH_Gain123_address, pos::PortCardSettingNames::k_fpix_AOH_Gain456_address, key_, AlCaHLTBitMon_ParallelJobs::p, and type_.

Referenced by containsSetting().

568 {
569  unsigned int i2c_address;
570 
571  // Get the i2c address of this AOH, and the channel on the AOH.
572  string::size_type GainPosition = settingName.find("GAIN");
573  unsigned int whichAOH;
574  if(type_ == "fpix")
575  {
576  whichAOH = 0 ; // fpix
577  }
578  else // bpix
579  {
580  char whichAOHDigit[2]={0,0};
581  whichAOHDigit[0]=settingName[GainPosition-2];
582  whichAOH = atoi( whichAOHDigit );
583  }
584  char digit[2]={0,0};
585  digit[0]=settingName[GainPosition+4];
586  unsigned int channelOnAOH = atoi( digit );
587  assert( (type_=="fpix" && whichAOH==0)||(type_=="bpix" && 1 <= whichAOH&&whichAOH <= 4) );
588  assert( 1 <= channelOnAOH && channelOnAOH <= 6 );
589 
590  if ( whichAOH == 0 && channelOnAOH <= 3 ) i2c_address = k_fpix_AOH_Gain123_address;
591  else if ( whichAOH == 0 && channelOnAOH >= 4 ) i2c_address = k_fpix_AOH_Gain456_address;
592  else if ( whichAOH == 1 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH1_Gain123_address;
593  else if ( whichAOH == 1 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH1_Gain456_address;
594  else if ( whichAOH == 2 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH2_Gain123_address;
595  else if ( whichAOH == 2 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH2_Gain456_address;
596  else if ( whichAOH == 3 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH3_Gain123_address;
597  else if ( whichAOH == 3 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH3_Gain456_address;
598  else if ( whichAOH == 4 && channelOnAOH <= 3 ) i2c_address = k_bpix_AOH4_Gain123_address;
599  else if ( whichAOH == 4 && channelOnAOH >= 4 ) i2c_address = k_bpix_AOH4_Gain456_address;
600  else assert(0);
601 
602  // Search for this address in the previously-defined settings.
603  bool foundOne = false;
604  for (unsigned int i=0;i<device_.size();i++)
605  {
606  if ( device_[i].first == i2c_address ) // Change this setting in all previous instances
607  {
608  foundOne = true;
609  unsigned int oldValue = device_[i].second;
610  if ( channelOnAOH%3 == 1 )
611  device_[i].second = (0x3c & oldValue) + ((value & 0x3)<<0); // replace bits 0 and 1 with value
612  else if ( channelOnAOH%3 == 2 )
613  device_[i].second = (0x33 & oldValue) + ((value & 0x3)<<2); // replace bits 2 and 3 with value
614  else if ( channelOnAOH%3 == 0 )
615  device_[i].second = (0x0f & oldValue) + ((value & 0x3)<<4); // replace bits 4 and 5 with value
616  else assert(0);
617  //std::cout << "Changed setting "<< k_fpix_AOH_Gain123 <<"(address 0x"<<std::hex<<k_fpix_AOH_Gain123_address<<") from 0x"<<oldValue<<" to 0x"<< device_[i].second << std::dec <<"\n";
618  }
619  }
620  if ( foundOne ) return;
621  else // If this was not set previously, add this setting with the other two gains set to zero.
622  {
623  unsigned int i2c_value;
624  if ( channelOnAOH%3 == 1 ) i2c_value = ((value & 0x3)<<0);
625  else if ( channelOnAOH%3 == 2 ) i2c_value = ((value & 0x3)<<2);
626  else if ( channelOnAOH%3 == 0 ) i2c_value = ((value & 0x3)<<4);
627  else assert(0);
628 
629  pair<unsigned int, unsigned int> p(i2c_address, i2c_value);
630  device_.push_back(p);
631  key_.push_back(aohcount_++);
632  return;
633  }
634 }
const unsigned int k_bpix_AOH1_Gain123_address
const unsigned int k_bpix_AOH1_Gain456_address
const unsigned int k_bpix_AOH4_Gain456_address
uint16_t size_type
const unsigned int k_bpix_AOH2_Gain456_address
std::vector< std::pair< unsigned int, unsigned int > > device_
const unsigned int k_bpix_AOH4_Gain123_address
std::vector< unsigned int > key_
key used for sorting device_
const unsigned int k_fpix_AOH_Gain123_address
const unsigned int k_bpix_AOH2_Gain123_address
const unsigned int k_bpix_AOH3_Gain123_address
Definition: value.py:1
const unsigned int k_fpix_AOH_Gain456_address
const unsigned int k_bpix_AOH3_Gain456_address
void PixelPortCardConfig::setdeviceValues ( unsigned int  address,
unsigned int  value 
)

Definition at line 1113 of file PixelPortCardConfig.cc.

References device_, mps_fire::i, AlCaHLTBitMon_ParallelJobs::p, and relativeConstraints::value.

Referenced by getAOHBias(), and setdeviceValues().

1113  {
1114  for (int i=device_.size()-1; i>=0; i--) // Change only the last occurance of address, if there are more than one.
1115  {
1116  if( device_.at(i).first==address )
1117  {
1118  device_.at(i).second=value;
1119  return;
1120  }
1121  }
1122 
1123  // This address wasn't found in the list, so add it and its value.
1124  pair<unsigned int, unsigned int> p(address, value);
1125  device_.push_back(p);
1126 
1127  return;
1128 }
std::vector< std::pair< unsigned int, unsigned int > > device_
Definition: value.py:1
void PixelPortCardConfig::setdeviceValues ( std::string  settingName,
unsigned int  value 
)

Definition at line 1130 of file PixelPortCardConfig.cc.

References getdeviceAddressForSetting(), and setdeviceValues().

1131 {
1133  return;
1134 }
unsigned int getdeviceAddressForSetting(std::string settingName) const
Definition: value.py:1
void setdeviceValues(unsigned int address, unsigned int value)
void pos::PixelPortCardConfig::setPortCardName ( std::string  newName)
inline
void PixelPortCardConfig::sortDeviceList ( )
private

Definition at line 470 of file PixelPortCardConfig.cc.

References device_, mps_fire::i, and key_.

470  {
471 
472  std::set < pair < unsigned int, pair <unsigned int, unsigned int> > > sorted;
473 
474  for (unsigned int i=0; i<device_.size(); i++ ) {
475  //cout<<key_.at(i)<<"\t"<<device_.at(i).first<<" "<<device_.at(i).second<<endl;
476  sorted.insert( make_pair(key_.at(i) , device_.at(i) ));
477  }
478 
479 // cout<<" -=-=-=-= done with sorting -=-=-="<<endl;
480  device_.clear();
481  for ( set < pair < unsigned int, pair <unsigned int, unsigned int> > >::iterator i=sorted.begin() ; i!=sorted.end() ; ++i) {
482  device_.push_back(i->second);
483  }
484 
485  // for (unsigned int i=0; i<device_.size(); i++ ) {
486  // cout<<" \t"<<device_.at(i).first<<" "<<device_.at(i).second<<endl;
487  // }
488 
489 }
std::vector< std::pair< unsigned int, unsigned int > > device_
std::vector< unsigned int > key_
key used for sorting device_
void PixelPortCardConfig::writeASCII ( std::string  dir = "") const
overridevirtual

Implements pos::PixelConfigBase.

Definition at line 975 of file PixelPortCardConfig.cc.

References ccuAddress_, channelAddress_, gather_cfg::cout, TauDecayModes::dec, device_, corrVsCorr::filename, mps_fire::i, i2cSpeed_, pos::PortCardSettingNames::k_bpix_AOH1_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain456_address, pos::PortCardSettingNames::k_fpix_AOH_Gain123_address, pos::PortCardSettingNames::k_fpix_AOH_Gain456_address, pos::PortCardSettingNames::k_PLL_CTR2, pos::PortCardSettingNames::k_PLL_CTR4, pos::PortCardSettingNames::k_PLL_CTR4or5, pos::PortCardSettingNames::k_PLL_CTR5, nameToAddress_, MillePedeFileConverter_cfg::out, portcardname_, ringAddress_, AlCaHLTBitMon_QueryRunRegistry::string, TKFECID_, and type_.

975  {
976 
977  std::string mthn = "[PixelPortCardConfig::writeASCII()]\t\t\t\t " ;
978  if (dir!="") dir+="/";
979  std::string filename=dir+"portcard_"+portcardname_+".dat";
980 
981  std::ofstream out(filename.c_str());
982  if (!out.good()){
983  std::cout << __LINE__ << "]\t" << mthn << "Could not open file: " << filename.c_str() << std::endl;
984  assert(0);
985  }
986 
987  out << "Name: " << portcardname_ << std::endl;
988  out << "Type: " << type_ << std::endl;
989  out << "TKFECID: " << TKFECID_ << std::endl;
990  out << "ringAddress: 0x" <<std::hex<< ringAddress_ <<std::dec<< std::endl;
991  out << "ccuAddress: 0x" <<std::hex<< ccuAddress_ <<std::dec<< std::endl;
992 
993  out << "channelAddress: 0x" <<std::hex<< channelAddress_ <<std::dec<< std::endl;
994 
995  out << "i2cSpeed: 0x" <<std::hex<< i2cSpeed_ <<std::dec<< std::endl;
996 
997  bool found_PLL_CTR2 = false;
998  unsigned int last_PLL_CTR2_value = 0x0;
999  for (unsigned int i=0;i<device_.size();i++)
1000  {
1001  unsigned int deviceAddress = device_.at(i).first;
1002 
1003  // Special handling for AOH gains
1004  if ( ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain123_address )
1005  || ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain456_address )
1006  || ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain123_address )
1007  || ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain456_address )
1008  || ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain123_address )
1009  || ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain456_address )
1010  || ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain123_address )
1011  || ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain456_address )
1012  || ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain123_address )
1013  || ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain456_address )
1014  )
1015  {
1016  std::string whichAOHString;
1017  unsigned int zeroOrThree;
1018  if ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain123_address ) { whichAOHString = ""; zeroOrThree = 0; }
1019  else if ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain456_address ) { whichAOHString = ""; zeroOrThree = 3; }
1020  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain123_address ) { whichAOHString = "1"; zeroOrThree = 0; }
1021  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain456_address ) { whichAOHString = "1"; zeroOrThree = 3; }
1022  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain123_address ) { whichAOHString = "2"; zeroOrThree = 0; }
1023  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain456_address ) { whichAOHString = "2"; zeroOrThree = 3; }
1024  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain123_address ) { whichAOHString = "3"; zeroOrThree = 0; }
1025  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain456_address ) { whichAOHString = "3"; zeroOrThree = 3; }
1026  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain123_address ) { whichAOHString = "4"; zeroOrThree = 0; }
1027  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain456_address ) { whichAOHString = "4"; zeroOrThree = 3; }
1028  else assert(0);
1029 
1030  out << "AOH"<<whichAOHString<<"_Gain"<<zeroOrThree+1<<": 0x"<< (((device_[i].second) & 0x03)>>0) << std::endl; // output bits 0 & 1
1031  out << "AOH"<<whichAOHString<<"_Gain"<<zeroOrThree+2<<": 0x"<< (((device_[i].second) & 0x0c)>>2) << std::endl; // output bits 2 & 3
1032  out << "AOH"<<whichAOHString<<"_Gain"<<zeroOrThree+3<<": 0x"<< (((device_[i].second) & 0x30)>>4) << std::endl; // output bits 4 & 5
1033  continue;
1034  }
1035  // End of special handling
1036 
1037  // Check to see if there's a name corresponding to this address.
1038  std::string settingName = "";
1039  for ( std::map<std::string, unsigned int>::const_iterator nameToAddress_itr = nameToAddress_.begin(); nameToAddress_itr != nameToAddress_.end(); ++nameToAddress_itr )
1040  {
1041 // cout << "[PixelPortCardConfig::WriteASCII()]\tnameToAddress.first: " << nameToAddress_itr->first << endl ;
1042 // cout << "[PixelPortCardConfig::WriteASCII()]\tnameToAddress.second: " << nameToAddress_itr->second << endl ;
1043 // cout << "[PixelPortCardConfig::WriteASCII()]\tdeviceAddress: " << deviceAddress << endl ;
1044  if ( nameToAddress_itr->second == deviceAddress ) {settingName = nameToAddress_itr->first; break;}
1045  if(nameToAddress_itr == (--nameToAddress_.end()))
1046  {
1047  cout << "[PixelPortCardConfig::WriteASCII()]\tdeviceAddress: " << deviceAddress << " NOT FOUND" << endl ;
1048  }
1049  }
1050 
1051 
1052  // Special handling for PLL addresses.
1053  if ( settingName == k_PLL_CTR2 )
1054  {
1055  if ( found_PLL_CTR2 && last_PLL_CTR2_value == device_.at(i).second ) continue; // don't save duplicate CTR2 settings
1056  found_PLL_CTR2 = true;
1057  last_PLL_CTR2_value = device_.at(i).second;
1058  }
1059  if ( found_PLL_CTR2 && settingName == k_PLL_CTR4or5 ) // change name to PLL_CTR4 or PLL_CTR5
1060  {
1061  if ( (last_PLL_CTR2_value & 0x20) == 0x0 ) settingName = k_PLL_CTR4;
1062  else settingName = k_PLL_CTR5;
1063  }
1064  // end of special handling
1065 
1066  if ( settingName=="" ) out << "0x" <<std::hex<< device_.at(i).first <<std::dec;
1067  else out << settingName << ":";
1068 
1069  out << " 0x" <<std::hex<< device_.at(i).second <<std::dec<< std::endl;
1070  }
1071 
1072  out.close();
1073 }
const unsigned int k_bpix_AOH1_Gain123_address
std::map< std::string, unsigned int > nameToAddress_
const unsigned int k_bpix_AOH1_Gain456_address
const unsigned int k_bpix_AOH4_Gain456_address
const unsigned int k_bpix_AOH2_Gain456_address
std::vector< std::pair< unsigned int, unsigned int > > device_
const unsigned int k_bpix_AOH4_Gain123_address
const unsigned int k_fpix_AOH_Gain123_address
const unsigned int k_bpix_AOH2_Gain123_address
const unsigned int k_bpix_AOH3_Gain123_address
const unsigned int k_fpix_AOH_Gain456_address
dbl *** dir
Definition: mlp_gen.cc:35
const unsigned int k_bpix_AOH3_Gain456_address
void pos::PixelPortCardConfig::writeXML ( pos::PixelConfigKey  key,
int  version,
std::string  path 
) const
inlineoverridevirtual
void PixelPortCardConfig::writeXML ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 1389 of file PixelPortCardConfig.cc.

References ccuAddress_, channelAddress_, device_, mps_fire::i, i2cSpeed_, pos::PortCardSettingNames::k_bpix_AOH1_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH1_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH2_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH3_Gain456_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain123_address, pos::PortCardSettingNames::k_bpix_AOH4_Gain456_address, pos::PortCardSettingNames::k_fpix_AOH_Gain123_address, pos::PortCardSettingNames::k_fpix_AOH_Gain456_address, pos::PortCardSettingNames::k_PLL_CTR2, pos::PortCardSettingNames::k_PLL_CTR4, pos::PortCardSettingNames::k_PLL_CTR4or5, pos::PortCardSettingNames::k_PLL_CTR5, nameDBtoFileConversion_, nameToAddress_, portcardname_, ringAddress_, AlCaHLTBitMon_QueryRunRegistry::string, TKFECID_, and type_.

1392 {
1393  std::string mthn = "[PixelPortCardConfig::writeXML()]\t\t\t " ;
1394 
1395 
1396  *outstream << " <DATA>" << std::endl;
1397  *outstream << " <PORT_CARD>" << portcardname_ << "</PORT_CARD>" << std::endl;
1398  *outstream << " <TRKFEC>" << TKFECID_ << "</TRKFEC>" << std::endl;
1399  *outstream << " <RING>" << ringAddress_ << "</RING>" << std::endl;
1400  *outstream << " <CCU_ADDR>" << ccuAddress_ << "</CCU_ADDR>" << std::endl;
1401  *outstream << " <CHANNEL>" << channelAddress_ << "</CHANNEL>" << std::endl;
1402  *outstream << " <I2C_SPEED>" << i2cSpeed_ << "</I2C_SPEED>" << std::endl;
1403 
1404  bool found_PLL_CTR2 = false;
1405  unsigned int last_PLL_CTR2_value = 0x0;
1406  for (unsigned int i=0;i<device_.size();i++)
1407  {
1408  unsigned int deviceAddress = device_.at(i).first;
1409 
1410  // Special handling for AOH gains
1411  if ( ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain123_address )
1412  || ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain456_address )
1413  || ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain123_address )
1414  || ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain456_address )
1415  || ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain123_address )
1416  || ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain456_address )
1417  || ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain123_address )
1418  || ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain456_address )
1419  || ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain123_address )
1420  || ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain456_address )
1421  )
1422  {
1423  std::string whichAOHString;
1424  unsigned int zeroOrThree;
1425  if ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain123_address ) { whichAOHString = ""; zeroOrThree = 0; }
1426  else if ( type_=="fpix" && deviceAddress == k_fpix_AOH_Gain456_address ) { whichAOHString = ""; zeroOrThree = 3; }
1427  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain123_address ) { whichAOHString = "1"; zeroOrThree = 0; }
1428  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH1_Gain456_address ) { whichAOHString = "1"; zeroOrThree = 3; }
1429  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain123_address ) { whichAOHString = "2"; zeroOrThree = 0; }
1430  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH2_Gain456_address ) { whichAOHString = "2"; zeroOrThree = 3; }
1431  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain123_address ) { whichAOHString = "3"; zeroOrThree = 0; }
1432  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH3_Gain456_address ) { whichAOHString = "3"; zeroOrThree = 3; }
1433  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain123_address ) { whichAOHString = "4"; zeroOrThree = 0; }
1434  else if ( type_=="bpix" && deviceAddress == k_bpix_AOH4_Gain456_address ) { whichAOHString = "4"; zeroOrThree = 3; }
1435  else assert(0);
1436 
1437  *outstream << " <AOH" << whichAOHString << "_GAIN" << zeroOrThree+1 << ">" << (((device_[i].second) & 0x03)>>0) << "</AOH" << whichAOHString << "_GAIN" << zeroOrThree+1 << ">" << std::endl; // output bits 0 & 1
1438  *outstream << " <AOH" << whichAOHString << "_GAIN" << zeroOrThree+2 << ">" << (((device_[i].second) & 0x0c)>>2) << "</AOH" << whichAOHString << "_GAIN" << zeroOrThree+2 << ">" << std::endl; // output bits 2 & 3
1439  *outstream << " <AOH" << whichAOHString << "_GAIN" << zeroOrThree+3 << ">" << (((device_[i].second) & 0x30)>>4) << "</AOH" << whichAOHString << "_GAIN" << zeroOrThree+3 << ">" << std::endl; // output bits 4 & 5
1440  continue;
1441  }
1442  // End of special handling
1443 
1444  // Check to see if there's a name corresponding to this address.
1445  std::string settingName = "";
1446  for ( std::map<std::string, unsigned int>::const_iterator nameToAddress_itr = nameToAddress_.begin(); nameToAddress_itr != nameToAddress_.end(); ++nameToAddress_itr )
1447  {
1448  if ( nameToAddress_itr->second == deviceAddress ) {settingName = nameToAddress_itr->first; break;}
1449  }
1450  for ( std::map<std::string, std::string>::const_iterator nameDBtoFileConversion_itr = nameDBtoFileConversion_.begin(); nameDBtoFileConversion_itr != nameDBtoFileConversion_.end(); ++nameDBtoFileConversion_itr )
1451  {
1452  if ( nameDBtoFileConversion_itr->second.find(settingName) != std::string::npos ) {settingName = nameDBtoFileConversion_itr->first; break;}
1453  }
1454 
1455  // Special handling for PLL addresses.
1456  if ( settingName == k_PLL_CTR2 )
1457  {
1458  if ( found_PLL_CTR2 && last_PLL_CTR2_value == device_.at(i).second ) continue; // don't save duplicate CTR2 settings
1459  found_PLL_CTR2 = true;
1460  last_PLL_CTR2_value = device_.at(i).second;
1461  }
1462  if ( found_PLL_CTR2 && settingName == k_PLL_CTR4or5 ) // change name to PLL_CTR4 or PLL_CTR5
1463  {
1464  if ( (last_PLL_CTR2_value & 0x20) == 0x0 ) settingName = k_PLL_CTR4;
1465  else settingName = k_PLL_CTR5;
1466  }
1467  // end of special handling
1468 
1469  if ( settingName=="" ) *outstream << device_.at(i).first;
1470  else *outstream << " <" << settingName << ">" ;
1471 
1472  *outstream << device_.at(i).second << "</" << settingName << ">" << std::endl;
1473  }
1474 
1475  *outstream << " </DATA>" << std::endl;
1476 
1477 }
const unsigned int k_bpix_AOH1_Gain123_address
std::map< std::string, unsigned int > nameToAddress_
std::map< std::string, std::string > nameDBtoFileConversion_
const unsigned int k_bpix_AOH1_Gain456_address
const unsigned int k_bpix_AOH4_Gain456_address
const unsigned int k_bpix_AOH2_Gain456_address
std::vector< std::pair< unsigned int, unsigned int > > device_
const unsigned int k_bpix_AOH4_Gain123_address
const unsigned int k_fpix_AOH_Gain123_address
const unsigned int k_bpix_AOH2_Gain123_address
const unsigned int k_bpix_AOH3_Gain123_address
const unsigned int k_fpix_AOH_Gain456_address
const unsigned int k_bpix_AOH3_Gain456_address
void PixelPortCardConfig::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.

Definition at line 1348 of file PixelPortCardConfig.cc.

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

Referenced by writeXML().

1354 {
1355  std::string mthn = "[PixelPortCardConfig::writeXMLHeader()]\t\t\t " ;
1356  std::stringstream fullPath ;
1357  fullPath << path << "/Pixel_PortCardSettings_" << PixelTimeFormatter::getmSecTime() << ".xml" ;
1358  std::cout << __LINE__ << "]\t" << mthn << "Writing to: " << fullPath.str() << std::endl ;
1359 
1360  outstream->open(fullPath.str().c_str()) ;
1361 
1362  *outstream << "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
1363  *outstream << "<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
1364  *outstream << " <HEADER>" << std::endl ;
1365  *outstream << " <TYPE>" << std::endl ;
1366  *outstream << " <EXTENSION_TABLE_NAME>PIXEL_PORTCARD_SETTINGS</EXTENSION_TABLE_NAME>" << std::endl ;
1367  *outstream << " <NAME>Pixel Port Card Settings</NAME>" << std::endl ;
1368  *outstream << " </TYPE>" << std::endl ;
1369  *outstream << " <RUN>" << std::endl ;
1370  *outstream << " <RUN_TYPE>Pixel Port Card Settings</RUN_TYPE>" << std::endl ;
1371  *outstream << " <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
1372  *outstream << " <RUN_BEGIN_TIMESTAMP>" << pos::PixelTimeFormatter::getTime() << "</RUN_BEGIN_TIMESTAMP>" << std::endl ;
1373  *outstream << " <LOCATION>CERN P5</LOCATION>" << std::endl ;
1374  *outstream << " </RUN>" << std::endl ;
1375  *outstream << " </HEADER>" << std::endl ;
1376  *outstream << "" << std::endl ;
1377  *outstream << " <DATA_SET>" << std::endl ;
1378  *outstream << " <PART>" << std::endl ;
1379  *outstream << " <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
1380  *outstream << " <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
1381  *outstream << " </PART>" << std::endl ;
1382  *outstream << " <VERSION>" << version << "</VERSION>" << std::endl ;
1383  *outstream << " <COMMENT_DESCRIPTION>" << getComment() << "</COMMENT_DESCRIPTION>" << std::endl ;
1384  *outstream << " <CREATED_BY_USER>" << getAuthor() << "</CREATED_BY_USER>" << std::endl ;
1385  *outstream << "" << std::endl ;
1386 }
static std::string getmSecTime(void)
static std::string getTime(void)
std::string getComment() const
std::string getAuthor() const
void PixelPortCardConfig::writeXMLTrailer ( std::ofstream *  out,
std::ofstream *  out1 = nullptr,
std::ofstream *  out2 = nullptr 
) const
overridevirtual

Reimplemented from pos::PixelConfigBase.

Definition at line 1479 of file PixelPortCardConfig.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by writeXML().

1482 {
1483  std::string mthn = "[PixelPortCardConfig::writeXMLTrailer()]\t\t\t " ;
1484 
1485  *outstream << " </DATA_SET>" << std::endl ;
1486  *outstream << "</ROOT> " << std::endl ;
1487 
1488  outstream->close() ;
1489 }

Member Data Documentation

unsigned int pos::PixelPortCardConfig::aohcount_
private

Definition at line 101 of file PixelPortCardConfig.h.

Referenced by setDataBaseAOHGain().

unsigned int pos::PixelPortCardConfig::ccuAddress_
private

Definition at line 93 of file PixelPortCardConfig.h.

Referenced by getccuAddress(), PixelPortCardConfig(), writeASCII(), and writeXML().

unsigned int pos::PixelPortCardConfig::channelAddress_
private

Definition at line 95 of file PixelPortCardConfig.h.

Referenced by getchannelAddress(), PixelPortCardConfig(), writeASCII(), and writeXML().

std::vector< std::pair<unsigned int, unsigned int> > pos::PixelPortCardConfig::device_
private
unsigned int pos::PixelPortCardConfig::i2cSpeed_
private

Definition at line 97 of file PixelPortCardConfig.h.

Referenced by geti2cSpeed(), PixelPortCardConfig(), writeASCII(), and writeXML().

std::vector< unsigned int > pos::PixelPortCardConfig::key_
private

key used for sorting device_

Definition at line 100 of file PixelPortCardConfig.h.

Referenced by setDataBaseAOHGain(), and sortDeviceList().

std::map<std::string, std::string> pos::PixelPortCardConfig::nameDBtoFileConversion_
private

Definition at line 107 of file PixelPortCardConfig.h.

Referenced by fillDBToFileAddress(), and writeXML().

std::map<std::string, unsigned int> pos::PixelPortCardConfig::nameToAddress_
private
std::string pos::PixelPortCardConfig::portcardname_
private
unsigned int pos::PixelPortCardConfig::ringAddress_
private

Definition at line 92 of file PixelPortCardConfig.h.

Referenced by getringAddress(), PixelPortCardConfig(), writeASCII(), and writeXML().

std::string pos::PixelPortCardConfig::TKFECID_
private

Definition at line 91 of file PixelPortCardConfig.h.

Referenced by getTKFECID(), PixelPortCardConfig(), writeASCII(), and writeXML().

std::string pos::PixelPortCardConfig::type_
private