Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
dbutils::dcs::APDSettings Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-03/DatabaseUtils/cxx/include/DCS/APDSettings.h"

Public Member Functions

 APDSettings (const int64_t &globalConfigId, const std::vector< std::string > &dcmList)
 
 APDSettings (DAQCONFIG::GlobalNameSpec nameSpec, const std::vector< std::string > &dcmList)
 
 APDSettings (DAQCONFIG::SubsystemNameSpec nameSpec, const std::vector< std::string > &dcmList)
 
virtual ~APDSettings ()
 
virtual bool hasValidData () const
 
bool getTemperature (const std::string &dcmName, const int &febId, int &temperature)
 
bool getCoolingEnableFlag (const std::string &dcmName, const int &febId, bool &isEnabled)
 
bool getVoltage (const std::string &dcmName, const int &febId, int &regulatorSetting)
 
bool getTemperature (const std::string &dcmName, const int &febId, double &temperature)
 
bool getTemperatureEnable (const std::string &dcmName, const int &febId, bool &enableFlag)
 
bool getVoltage (const std::string &dcmName, const int &febId, const std::string &coolingState, int &regulatorSetting)
 
bool getTemperatures (const std::string &dcmName, std::vector< int > &temperatureList)
 
bool getCoolingEnableMask (const std::string &dcmName, int64_t &enableMask)
 
bool getVoltages (const std::string &dcmName, std::vector< int > &voltageList)
 
bool getTemperatures (const std::string &dcmName, std::vector< double > &temperatureList)
 
bool getTemperatureEnableMask (const std::string &dcmName, int64_t &enableMask)
 
bool getVoltages (const std::string &dcmName, const std::string &coolingState, std::vector< int > &voltageList)
 
bool getDryAirChannel (const std::string &dcmName, const int &febId, int &channelNumber)
 
bool getDryAirChannels (const std::string &dcmName, std::vector< int > &channelList)
 
bool getAlarmThreshold (const std::string &dcmName, const int &febId, const std::string &pvName, const std::string &thresholdType, double &threshold)
 

Static Public Attributes

static const std::string WARM_COOLING_STATE
 
static const std::string COLD_COOLING_STATE
 

Protected Member Functions

bool _fetchAllData (const std::vector< int64_t > &subsysConfigIdList)
 

Protected Attributes

std::vector< std::string_dcmList
 
bool _hasValidData
 
boost::shared_ptr< DAQCONFIG::ConfigDataTree_temperatureDataSet
 
boost::shared_ptr< DAQCONFIG::ConfigDataTree_enableMaskDataSet
 
boost::shared_ptr< DAQCONFIG::ConfigDataTree_hvAdjustDataSet
 
boost::shared_ptr< DAQCONFIG::ConfigDataTree_dryAirChannelDataSet
 
boost::shared_ptr< DAQCONFIG::ConfigDataTree_alarmThresholdDataSet
 

Detailed Description

Worker class to handle fetching and formatting of APD configuration data.

Author
Kurt Biery
Version
Revision
1.8.14.1
Date
2019/09/27 00:07:04

Definition at line 25 of file APDSettings.h.

Constructor & Destructor Documentation

dbutils::dcs::APDSettings::APDSettings ( const int64_t &  globalConfigId,
const std::vector< std::string > &  dcmList 
)

Constructs an APDSettings instance for the specified global configuration ID and list of DCMs.

Definition at line 20 of file APDSettings.cpp.

References dbutils::daqconfig::NamedConfigUtils::getSubsystemConfigIdAncestryFromGlobalId(), dbutils::daqconfig::IDSpec::GLOBAL, dbutils::daqconfig::IDSpec::SLOWCONTROLS, and fabricate::status.

22 {
23  _hasValidData = false;
24 
25  IDSpec idSpec(globalConfigId, IDSpec::GLOBAL, IDSpec::SLOWCONTROLS);
26  std::vector<int64_t> subsysConfigIdList;
27  bool status = NamedConfigUtils::
28  getSubsystemConfigIdAncestryFromGlobalId(idSpec,
29  "APDHardware",
30  "slowcontrols",
31  subsysConfigIdList);
32  if (! status) {return;}
33 
34  _dcmList = dcmList;
35  std::sort(_dcmList.begin(), _dcmList.end());
36 
37  _hasValidData = _fetchAllData(subsysConfigIdList);
38 }
int status
Definition: fabricate.py:1613
bool _fetchAllData(const std::vector< int64_t > &subsysConfigIdList)
std::vector< std::string > _dcmList
Definition: APDSettings.h:97
dbutils::dcs::APDSettings::APDSettings ( DAQCONFIG::GlobalNameSpec  nameSpec,
const std::vector< std::string > &  dcmList 
)

Constructs an APDSettings instance for the specified global configuration name specification and list of DCMs.

Definition at line 45 of file APDSettings.cpp.

References dbutils::daqconfig::NamedConfigUtils::getConfigIdAncestry(), dbutils::daqconfig::NamedConfigUtils::getSubsystemConfigIdFromGlobalName(), dbutils::daqconfig::GlobalNameSpec::isSlowControlsConfiguration(), dbutils::daqconfig::IDSpec::SLOWCONTROLS, fabricate::status, and dbutils::daqconfig::IDSpec::SUBSYSTEM.

47 {
48  _hasValidData = false;
49 
50  // just in case...
51  nameSpec.isSlowControlsConfiguration(true);
52 
53  std::vector<int64_t> subsysConfigIdList;
54  int64_t subsystemConfigId;
55  bool status = NamedConfigUtils::
56  getSubsystemConfigIdFromGlobalName(nameSpec, "APDHardware",
57  "slowcontrols", subsystemConfigId);
58  if (status) {
59  IDSpec idSpec(subsystemConfigId, IDSpec::SUBSYSTEM,
60  IDSpec::SLOWCONTROLS);
61  status = NamedConfigUtils::
62  getConfigIdAncestry(idSpec, subsysConfigIdList);
63  }
64  if (! status) {return;}
65 
66  _dcmList = dcmList;
67  std::sort(_dcmList.begin(), _dcmList.end());
68 
69  _hasValidData = _fetchAllData(subsysConfigIdList);
70 }
int status
Definition: fabricate.py:1613
bool _fetchAllData(const std::vector< int64_t > &subsysConfigIdList)
std::vector< std::string > _dcmList
Definition: APDSettings.h:97
dbutils::dcs::APDSettings::APDSettings ( DAQCONFIG::SubsystemNameSpec  nameSpec,
const std::vector< std::string > &  dcmList 
)

Constructs an APDSettings instance for the specified subsystem configuration name specification and list of DCMs.

Definition at line 77 of file APDSettings.cpp.

References dbutils::daqconfig::NamedConfigUtils::getSubsystemConfigIdAncestry(), dbutils::daqconfig::SubsystemNameSpec::isSlowControlsConfiguration(), and fabricate::status.

79 {
80  _hasValidData = false;
81 
82  // just in case...
83  nameSpec.isSlowControlsConfiguration(true);
84 
85  std::vector<int64_t> subsysConfigIdList;
86  bool status = NamedConfigUtils::
87  getSubsystemConfigIdAncestry(nameSpec, subsysConfigIdList);
88  if (! status) {return;}
89 
90  _dcmList = dcmList;
91  std::sort(_dcmList.begin(), _dcmList.end());
92 
93  _hasValidData = _fetchAllData(subsysConfigIdList);
94 }
int status
Definition: fabricate.py:1613
bool _fetchAllData(const std::vector< int64_t > &subsysConfigIdList)
std::vector< std::string > _dcmList
Definition: APDSettings.h:97
virtual dbutils::dcs::APDSettings::~APDSettings ( )
inlinevirtual

Definition at line 45 of file APDSettings.h.

45 {};

Member Function Documentation

bool dbutils::dcs::APDSettings::_fetchAllData ( const std::vector< int64_t > &  subsysConfigIdList)
protected

Definition at line 464 of file APDSettings.cpp.

References dbutils::daqconfig::ConfigDataSelector::addSelectionColumn(), dbutils::daqconfig::DBColumnParams::DCMID_COLUMN_NAME, dbutils::daqconfig::DBColumnParams::FEBID_COLUMN_NAME, plot_validation_datamc::fname, and string.

Referenced by hasValidData().

465 {
466  {
467  ConfigDataSelector cfgSelector;
468  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
469  _dcmList[0],_dcmList[_dcmList.size()-1]);
470  cfgSelector.addSelectionColumn(DBColumnParams::FEBID_COLUMN_NAME);
471 
472  std::vector<std::string> dataColumnsOfInterest;
473  dataColumnsOfInterest.push_back("temperature");
474 
475  std::string fname("NovaDatabase/tables/DCS/APDTemperatureSettings.xml");
477  reset(new ConfigDataTree(fname, subsysConfigIdList, cfgSelector,
478  dataColumnsOfInterest));
479  }
480 
481  {
482  ConfigDataSelector cfgSelector;
483  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
484  _dcmList[0],_dcmList[_dcmList.size()-1]);
485 
486  std::vector<std::string> dataColumnsOfInterest;
487  dataColumnsOfInterest.push_back("mask");
488 
489  std::string fname("NovaDatabase/tables/DCS/DCSFEBEnableMasks.xml");
491  reset(new ConfigDataTree(fname, subsysConfigIdList, cfgSelector,
492  dataColumnsOfInterest));
493  }
494 
495  {
496  ConfigDataSelector cfgSelector;
497  cfgSelector.addSelectionColumn("coolingstate");
498  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
499  _dcmList[0],_dcmList[_dcmList.size()-1]);
500  cfgSelector.addSelectionColumn(DBColumnParams::FEBID_COLUMN_NAME);
501 
502  std::vector<std::string> dataColumnsOfInterest;
503  dataColumnsOfInterest.push_back("voltage");
504 
505  std::string fname("NovaDatabase/tables/DCS/APDHighVoltages.xml");
507  reset(new ConfigDataTree(fname, subsysConfigIdList, cfgSelector,
508  dataColumnsOfInterest));
509  }
510 
511  {
512  ConfigDataSelector cfgSelector;
513  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
514  _dcmList[0],_dcmList[_dcmList.size()-1]);
515  cfgSelector.addSelectionColumn(DBColumnParams::FEBID_COLUMN_NAME);
516 
517  std::vector<std::string> dataColumnsOfInterest;
518  dataColumnsOfInterest.push_back("dryairchannel");
519 
520  std::string fname("NovaDatabase/tables/DCS/FEBDryAirChannels.xml");
522  reset(new ConfigDataTree(fname, subsysConfigIdList, cfgSelector,
523  dataColumnsOfInterest));
524  }
525 
526  {
527  ConfigDataSelector cfgSelector;
528  cfgSelector.addSelectionColumn("pvName");
529  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
530  _dcmList[0],_dcmList[_dcmList.size()-1]);
531  cfgSelector.addSelectionColumn(DBColumnParams::FEBID_COLUMN_NAME);
532 
533  std::vector<std::string> dataColumnsOfInterest;
534  dataColumnsOfInterest.push_back("hihi");
535  dataColumnsOfInterest.push_back("hilo");
536  dataColumnsOfInterest.push_back("lohi");
537  dataColumnsOfInterest.push_back("lolo");
538 
539  std::string fname("NovaDatabase/tables/DCS/EPICSAlarmThresholds.xml");
541  reset(new ConfigDataTree(fname, subsysConfigIdList, cfgSelector,
542  dataColumnsOfInterest));
543  }
544 
545  return _temperatureDataSet.get() != 0 && _temperatureDataSet->hasValidData() &&
546  _enableMaskDataSet.get() != 0 && _enableMaskDataSet->hasValidData() &&
547  _hvAdjustDataSet.get() != 0 && _hvAdjustDataSet->hasValidData() &&
548  _dryAirChannelDataSet.get() != 0 && _dryAirChannelDataSet->hasValidData() &&
549  _alarmThresholdDataSet.get() != 0 && _alarmThresholdDataSet->hasValidData();
550 }
void addSelectionColumn(std::string columnName)
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _hvAdjustDataSet
Definition: APDSettings.h:102
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _alarmThresholdDataSet
Definition: APDSettings.h:104
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _temperatureDataSet
Definition: APDSettings.h:100
std::vector< std::string > _dcmList
Definition: APDSettings.h:97
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _dryAirChannelDataSet
Definition: APDSettings.h:103
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _enableMaskDataSet
Definition: APDSettings.h:101
enum BeamMode string
bool dbutils::dcs::APDSettings::getAlarmThreshold ( const std::string dcmName,
const int febId,
const std::string pvName,
const std::string thresholdType,
double &  threshold 
)

Fetches the alarm threshold for the specified DCM name, FEB ID, PV name, and threshold type (hihi, hilo, lohi, or lolo).

Returns
true if the value was successfully determined, false if not.

Definition at line 450 of file APDSettings.cpp.

Referenced by hasValidData().

455 {
456  if (_alarmThresholdDataSet.get() == 0) {return false;}
457  if (! _alarmThresholdDataSet->hasValidData()) {return false;}
458  return _alarmThresholdDataSet->
459  getEffectiveValueFor3Keys(pvName, dcmName, febId,
460  thresholdType, threshold);
461 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _alarmThresholdDataSet
Definition: APDSettings.h:104
bool dbutils::dcs::APDSettings::getCoolingEnableFlag ( const std::string dcmName,
const int febId,
bool &  isEnabled 
)

Fetches whether cooling is enabled for the specified DCM name and FEB ID.

Returns
true if the value was successfully determined, false if not.

Definition at line 126 of file APDSettings.cpp.

Referenced by hasValidData().

128 {
129  if (_enableMaskDataSet.get() == 0) {return false;}
130  if (! _enableMaskDataSet->hasValidData()) {return false;}
131 
132  int64_t fullMask;
133  if (! _enableMaskDataSet->getEffectiveValueFor1Key(dcmName, "mask",
134  fullMask)) {
135  return false;
136  }
137 
138  int64_t testMask = (((int64_t)1) << febId);
139  isEnabled = (febId >= 0 && febId < 64 && (fullMask & testMask) != 0);
140  return true;
141 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _enableMaskDataSet
Definition: APDSettings.h:101
bool dbutils::dcs::APDSettings::getCoolingEnableMask ( const std::string dcmName,
int64_t &  enableMask 
)

Fetches the cooling enable mask for the FEBs that are connected to the specified DCM. The resulting mask contains the information for all 64 FEBs, in numerical order, with the least significant bit in the mask corresponding to FEB 0.

Returns
true if the requested mask was successfully determined, false if not.

Definition at line 268 of file APDSettings.cpp.

Referenced by hasValidData().

269 {
270  if (_enableMaskDataSet.get() == 0) {return false;}
271  if (! _enableMaskDataSet->hasValidData()) {return false;}
272  return _enableMaskDataSet->getEffectiveValueFor1Key(dcmName, "mask",
273  enableMask);
274 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _enableMaskDataSet
Definition: APDSettings.h:101
bool dbutils::dcs::APDSettings::getDryAirChannel ( const std::string dcmName,
const int febId,
int channelNumber 
)

Fetches the dry air channel for the specified DCM name and FEB ID.

Returns
true if the value was successfully determined, false if not.

Definition at line 404 of file APDSettings.cpp.

Referenced by hasValidData().

406 {
407  if (_dryAirChannelDataSet.get() == 0) {return false;}
408  if (! _dryAirChannelDataSet->hasValidData()) {return false;}
409  return _dryAirChannelDataSet->getEffectiveValueFor2Keys(dcmName, febId,
410  "dryairchannel",
411  channelNumber);
412 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _dryAirChannelDataSet
Definition: APDSettings.h:103
bool dbutils::dcs::APDSettings::getDryAirChannels ( const std::string dcmName,
std::vector< int > &  channelList 
)

Fetches the list of dry air channels for the FEBs that are connected to the specified DCM. The resulting list will be populated with 64 values, one for each FEB (in numerical order), when this method executes successfully.

Returns
true if the requested values were successfully determined, false if not.

Definition at line 424 of file APDSettings.cpp.

References dbutils::daqconfig::DBColumnParams::HIGH_FEB_ID, and dbutils::daqconfig::DBColumnParams::LOW_FEB_ID.

Referenced by hasValidData().

425 {
426  if (_dryAirChannelDataSet.get() == 0) {return false;}
427  if (! _dryAirChannelDataSet->hasValidData()) {return false;}
428 
429  channelList.clear();
430  for (uint16_t febId = DBColumnParams::LOW_FEB_ID;
431  febId <= DBColumnParams::HIGH_FEB_ID; ++febId) {
432  int tmpValue;
433  if (! _dryAirChannelDataSet->getEffectiveValueFor2Keys(dcmName, febId,
434  "dryairchannel",
435  tmpValue)) {
436  return false;
437  }
438  channelList.push_back(tmpValue);
439  }
440  return true;
441 }
const uint16_t HIGH_FEB_ID
const uint16_t LOW_FEB_ID
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _dryAirChannelDataSet
Definition: APDSettings.h:103
bool dbutils::dcs::APDSettings::getTemperature ( const std::string dcmName,
const int febId,
int temperature 
)

Fetches the temperature setpoint (as an int) for the specified DCM name and FEB ID.

Returns
true if the value was successfully determined, false if not.

Definition at line 103 of file APDSettings.cpp.

References makeTrainCVSamples::int, and fabricate::status.

Referenced by hasValidData(), dbutils::RunHistory::Load(), and nova::dbi::RunHistory::LoadAPDSettings().

105 {
106  if (_temperatureDataSet.get() == 0) {return false;}
107  if (! _temperatureDataSet->hasValidData()) {return false;}
108 
109  double doubleTemp;
110  bool status =
111  _temperatureDataSet->getEffectiveValueFor2Keys(dcmName, febId,
112  "temperature",
113  doubleTemp);
114  if (! status) {return false;}
115 
116  temperature = (int) doubleTemp;
117  return true;
118 }
int status
Definition: fabricate.py:1613
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _temperatureDataSet
Definition: APDSettings.h:100
bool dbutils::dcs::APDSettings::getTemperature ( const std::string dcmName,
const int febId,
double &  temperature 
)

Fetches the temperature setpoint (as a double) for the specified DCM name and FEB ID.

Returns
true if the value was successfully determined, false if not.

Definition at line 177 of file APDSettings.cpp.

179 {
180  if (_temperatureDataSet.get() == 0) {return false;}
181  if (! _temperatureDataSet->hasValidData()) {return false;}
182  return _temperatureDataSet->getEffectiveValueFor2Keys(dcmName, febId,
183  "temperature",
184  temperature);
185 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _temperatureDataSet
Definition: APDSettings.h:100
bool dbutils::dcs::APDSettings::getTemperatureEnable ( const std::string dcmName,
const int febId,
bool &  enableFlag 
)

Fetches whether cooling is enabled for the specified DCM name and FEB ID.

Returns
true if the value was successfully determined, false if not.

Definition at line 193 of file APDSettings.cpp.

Referenced by hasValidData(), dbutils::RunHistory::Load(), and nova::dbi::RunHistory::LoadAPDSettings().

195 {
196  if (_enableMaskDataSet.get() == 0) {return false;}
197  if (! _enableMaskDataSet->hasValidData()) {return false;}
198 
199  int64_t fullMask;
200  if (! _enableMaskDataSet->getEffectiveValueFor1Key(dcmName, "mask",
201  fullMask)) {
202  return false;
203  }
204 
205  int64_t testMask = (((int64_t)1) << febId);
206  enableFlag = (febId >= 0 && febId < 64 && (fullMask & testMask) != 0);
207  return true;
208 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _enableMaskDataSet
Definition: APDSettings.h:101
bool dbutils::dcs::APDSettings::getTemperatureEnableMask ( const std::string dcmName,
int64_t &  enableMask 
)

Fetches the cooling enable mask for the FEBs that are connected to the specified DCM. The resulting mask contains the information for all 64 FEBs, in numerical order, with the least significant bit in the mask corresponding to FEB 0.

Returns
true if the requested mask was successfully determined, false if not.

Definition at line 359 of file APDSettings.cpp.

Referenced by hasValidData().

360 {
361  if (_enableMaskDataSet.get() == 0) {return false;}
362  if (! _enableMaskDataSet->hasValidData()) {return false;}
363  return _enableMaskDataSet->getEffectiveValueFor1Key(dcmName, "mask",
364  enableMask);
365 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _enableMaskDataSet
Definition: APDSettings.h:101
bool dbutils::dcs::APDSettings::getTemperatures ( const std::string dcmName,
std::vector< int > &  temperatureList 
)

Fetches the list of temperature setpoints (as integers) for the FEBs that are connected to the specified DCM. The resulting list will be populated with 64 values, one for each FEB (in numerical order), when this method executes successfully.

Returns
true if the requested values were successfully determined, false if not.

Definition at line 238 of file APDSettings.cpp.

References dbutils::daqconfig::DBColumnParams::HIGH_FEB_ID, and dbutils::daqconfig::DBColumnParams::LOW_FEB_ID.

Referenced by hasValidData().

240 {
241  if (_temperatureDataSet.get() == 0) {return false;}
242  if (! _temperatureDataSet->hasValidData()) {return false;}
243 
244  temperatureList.clear();
245  for (uint16_t febId = DBColumnParams::LOW_FEB_ID;
246  febId <= DBColumnParams::HIGH_FEB_ID; ++febId) {
247  double tmpValue;
248  if (! _temperatureDataSet->getEffectiveValueFor2Keys(dcmName, febId,
249  "temperature",
250  tmpValue)) {
251  return false;
252  }
253  temperatureList.push_back((int) tmpValue);
254  }
255  return true;
256 }
const uint16_t HIGH_FEB_ID
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _temperatureDataSet
Definition: APDSettings.h:100
const uint16_t LOW_FEB_ID
bool dbutils::dcs::APDSettings::getTemperatures ( const std::string dcmName,
std::vector< double > &  temperatureList 
)

Fetches the list of temperature setpoints (as doubles) for the FEBs that are connected to the specified DCM. The resulting list will be populated with 64 values, one for each FEB (in numerical order), when this method executes successfully.

Returns
true if the requested values were successfully determined, false if not.

Definition at line 329 of file APDSettings.cpp.

References dbutils::daqconfig::DBColumnParams::HIGH_FEB_ID, and dbutils::daqconfig::DBColumnParams::LOW_FEB_ID.

331 {
332  if (_temperatureDataSet.get() == 0) {return false;}
333  if (! _temperatureDataSet->hasValidData()) {return false;}
334 
335  temperatureList.clear();
336  for (uint16_t febId = DBColumnParams::LOW_FEB_ID;
337  febId <= DBColumnParams::HIGH_FEB_ID; ++febId) {
338  double tmpValue;
339  if (! _temperatureDataSet->getEffectiveValueFor2Keys(dcmName, febId,
340  "temperature",
341  tmpValue)) {
342  return false;
343  }
344  temperatureList.push_back(tmpValue);
345  }
346  return true;
347 }
const uint16_t HIGH_FEB_ID
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _temperatureDataSet
Definition: APDSettings.h:100
const uint16_t LOW_FEB_ID
bool dbutils::dcs::APDSettings::getVoltage ( const std::string dcmName,
const int febId,
int regulatorSetting 
)

Fetches the voltage regulator setting for the specified DCM name and FEB ID, taking into account whether cooling is enabled for the FEB.

Returns
true if the value was successfully determined, false if not.

Definition at line 150 of file APDSettings.cpp.

References string.

Referenced by hasValidData(), and nova::dbi::RunHistory::LoadAPDSettings().

152 {
153  if (_hvAdjustDataSet.get() == 0) {return false;}
154  if (! _hvAdjustDataSet->hasValidData()) {return false;}
155 
156  std::string coolingState = WARM_COOLING_STATE;
157  bool isEnabled;
158  if (getCoolingEnableFlag(dcmName, febId, isEnabled)) {
159  if (isEnabled) {
160  coolingState = COLD_COOLING_STATE;
161  }
162  }
163 
164  return _hvAdjustDataSet->getEffectiveValueFor3Keys(coolingState,
165  dcmName, febId,
166  "voltage",
167  regulatorSetting);
168 }
static const std::string COLD_COOLING_STATE
Definition: APDSettings.h:30
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _hvAdjustDataSet
Definition: APDSettings.h:102
bool getCoolingEnableFlag(const std::string &dcmName, const int &febId, bool &isEnabled)
static const std::string WARM_COOLING_STATE
Definition: APDSettings.h:29
enum BeamMode string
bool dbutils::dcs::APDSettings::getVoltage ( const std::string dcmName,
const int febId,
const std::string coolingState,
int regulatorSetting 
)

Fetches the voltage regulator setting for the specified DCM name, FEB ID, and cooling state.

Returns
true if the value was successfully determined, false if not.

Definition at line 217 of file APDSettings.cpp.

219 {
220  if (_hvAdjustDataSet.get() == 0) {return false;}
221  if (! _hvAdjustDataSet->hasValidData()) {return false;}
222  return _hvAdjustDataSet->getEffectiveValueFor3Keys(coolingState,
223  dcmName, febId,
224  "voltage",
225  regulatorSetting);
226 }
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _hvAdjustDataSet
Definition: APDSettings.h:102
bool dbutils::dcs::APDSettings::getVoltages ( const std::string dcmName,
std::vector< int > &  voltageList 
)

Fetches the list of voltage regulator settings for the FEBs that are connected to the specified DCM, taking into account whether cooling is enabled for each FEB. The resulting list will be populated with 64 values, one for each FEB (in numerical order), when this method executes successfully.

Returns
true if the requested values were successfully determined, false if not.

Definition at line 287 of file APDSettings.cpp.

References dbutils::daqconfig::DBColumnParams::HIGH_FEB_ID, dbutils::daqconfig::DBColumnParams::LOW_FEB_ID, and string.

Referenced by hasValidData().

288 {
289  if (_hvAdjustDataSet.get() == 0) {return false;}
290  if (! _hvAdjustDataSet->hasValidData()) {return false;}
291 
292  int64_t coolingEnableMask;
293  if (! getCoolingEnableMask(dcmName, coolingEnableMask)) {
294  return false;
295  }
296  int64_t _64BitOne = 1;
297 
298  voltageList.clear();
299  for (uint16_t febId = DBColumnParams::LOW_FEB_ID;
300  febId <= DBColumnParams::HIGH_FEB_ID; ++febId) {
301 
302  std::string coolingState = WARM_COOLING_STATE;
303  if ((coolingEnableMask & (_64BitOne << febId)) != 0) {
304  coolingState = COLD_COOLING_STATE;
305  }
306 
307  int tmpValue;
308  if (! _hvAdjustDataSet->getEffectiveValueFor3Keys(coolingState,
309  dcmName, febId,
310  "voltage",
311  tmpValue)) {
312  return false;
313  }
314  voltageList.push_back(tmpValue);
315  }
316  return true;
317 }
static const std::string COLD_COOLING_STATE
Definition: APDSettings.h:30
const uint16_t HIGH_FEB_ID
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _hvAdjustDataSet
Definition: APDSettings.h:102
const uint16_t LOW_FEB_ID
static const std::string WARM_COOLING_STATE
Definition: APDSettings.h:29
bool getCoolingEnableMask(const std::string &dcmName, int64_t &enableMask)
enum BeamMode string
bool dbutils::dcs::APDSettings::getVoltages ( const std::string dcmName,
const std::string coolingState,
std::vector< int > &  voltageList 
)

Fetches the list of warm or cold voltage regulator settings for the FEBs that are connected to the specified DCM. The resulting list will be populated with 64 values, one for each FEB (in numerical order), when this method executes successfully.

Returns
true if the requested values were successfully determined, false if not.

Definition at line 377 of file APDSettings.cpp.

References dbutils::daqconfig::DBColumnParams::HIGH_FEB_ID, and dbutils::daqconfig::DBColumnParams::LOW_FEB_ID.

379 {
380  if (_hvAdjustDataSet.get() == 0) {return false;}
381  if (! _hvAdjustDataSet->hasValidData()) {return false;}
382 
383  voltageList.clear();
384  for (uint16_t febId = DBColumnParams::LOW_FEB_ID;
385  febId <= DBColumnParams::HIGH_FEB_ID; ++febId) {
386  int tmpValue;
387  if (! _hvAdjustDataSet->getEffectiveValueFor3Keys(coolingState,
388  dcmName, febId,
389  "voltage",
390  tmpValue)) {
391  return false;
392  }
393  voltageList.push_back(tmpValue);
394  }
395  return true;
396 }
const uint16_t HIGH_FEB_ID
boost::shared_ptr< DAQCONFIG::ConfigDataTree > _hvAdjustDataSet
Definition: APDSettings.h:102
const uint16_t LOW_FEB_ID
virtual bool dbutils::dcs::APDSettings::hasValidData ( ) const
inlinevirtual

Member Data Documentation

boost::shared_ptr<DAQCONFIG::ConfigDataTree> dbutils::dcs::APDSettings::_alarmThresholdDataSet
protected

Definition at line 104 of file APDSettings.h.

std::vector<std::string> dbutils::dcs::APDSettings::_dcmList
protected

Definition at line 97 of file APDSettings.h.

boost::shared_ptr<DAQCONFIG::ConfigDataTree> dbutils::dcs::APDSettings::_dryAirChannelDataSet
protected

Definition at line 103 of file APDSettings.h.

boost::shared_ptr<DAQCONFIG::ConfigDataTree> dbutils::dcs::APDSettings::_enableMaskDataSet
protected

Definition at line 101 of file APDSettings.h.

bool dbutils::dcs::APDSettings::_hasValidData
protected

Definition at line 98 of file APDSettings.h.

Referenced by hasValidData().

boost::shared_ptr<DAQCONFIG::ConfigDataTree> dbutils::dcs::APDSettings::_hvAdjustDataSet
protected

Definition at line 102 of file APDSettings.h.

boost::shared_ptr<DAQCONFIG::ConfigDataTree> dbutils::dcs::APDSettings::_temperatureDataSet
protected

Definition at line 100 of file APDSettings.h.

const std::string dbutils::dcs::APDSettings::COLD_COOLING_STATE
static

Definition at line 30 of file APDSettings.h.

const std::string dbutils::dcs::APDSettings::WARM_COOLING_STATE
static

Definition at line 29 of file APDSettings.h.


The documentation for this class was generated from the following files: