Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dbutils::daqconfig::DCMRunConfig Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-11-25/DatabaseUtils/cxx/include/DAQConfig/DCMRunConfig.h"

Public Member Functions

 DCMRunConfig (const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
 
 DCMRunConfig (const SubsystemNameSpec &nameSpec, const std::string &dcmName)
 
 DCMRunConfig (const GlobalNameSpec &nameSpec, const std::string &dcmName)
 
 DCMRunConfig (const int64_t &globalConfigId, const std::string &dcmName)
 
virtual ~DCMRunConfig ()
 
virtual bool hasValidData () const
 
int64_t getPrimarySubsystemConfigId () const
 
int32_t getMilliSliceTimeLength () const
 

Protected Member Functions

bool _fetchAllData (const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
 
bool _fetchDCMSystemParams (const std::vector< int64_t > &subsystemConfigIdList)
 
bool _fetchDCMDataDevValues (const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
 
bool _fetchDCMApplicationParams (const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
 

Protected Attributes

bool _hasValidData
 
int64_t _primarySubsystemConfigId
 
int32_t _millisliceTimeLength
 
std::string _milliSliceMode
 
int32_t _milliSliceCalculateCheckSum
 
int32_t _corruptMessageLimit
 
int32_t _corruptMessageResetCount
 
int32_t _monitorMetricSendTimeInterval
 
int32_t _monitorCtrlRegGeneralStatus
 
int32_t _numberOfReadAttempts
 
int32_t _maxAllowedDelayInMilliSec
 
int32_t _monitorFEBStatusTimeInterval
 
int32_t _monitorFEBStatusLimit
 

Detailed Description

Worker class to handle fetching and formatting of DCM run configuration data.

Author
Kurt Biery
Version
Revision
1.5.12.1
Date
2019/09/27 00:07:03

Definition at line 22 of file DCMRunConfig.h.

Constructor & Destructor Documentation

dbutils::daqconfig::DCMRunConfig::DCMRunConfig ( const std::vector< int64_t > &  subsystemConfigIdList,
const std::string dcmName 
)

Creates a DCM run configuration object from the specified list of subsystem configuration IDs.

Parameters
subsystemConfigIdListThe list of subsystem configuration IDs.
dcmNameThe name of the DCM of interest.

Definition at line 18 of file DCMRunConfig.cpp.

References _fetchAllData(), _hasValidData, and _primarySubsystemConfigId.

Referenced by DCMRunConfig().

20 {
22  if (subsystemConfigIdList.size() > 0) {
23  _primarySubsystemConfigId = subsystemConfigIdList[0];
24  _hasValidData = _fetchAllData(subsystemConfigIdList, dcmName);
25  }
26  else {
27  _hasValidData = false;
28  }
29 }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
dbutils::daqconfig::DCMRunConfig::DCMRunConfig ( const SubsystemNameSpec nameSpec,
const std::string dcmName 
)

Creates a DCM run configuration object from the specified subsystem configuration specification.

Parameters
nameSpecThe named configuration of interest.
dcmNameThe name of the DCM of interest.

Definition at line 39 of file DCMRunConfig.cpp.

References _fetchAllData(), _hasValidData, _primarySubsystemConfigId, and DCMRunConfig().

41 {
43  std::vector<int64_t> subsystemConfigIdList;
44  if (NamedConfigUtils::
45  getSubsystemConfigIdAncestry(nameSpec, subsystemConfigIdList)) {
46  _primarySubsystemConfigId = subsystemConfigIdList[0];
47  _hasValidData = _fetchAllData(subsystemConfigIdList, dcmName);
48  }
49  else {
50  _hasValidData = false;
51  }
52 }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
dbutils::daqconfig::DCMRunConfig::DCMRunConfig ( const GlobalNameSpec nameSpec,
const std::string dcmName 
)

Creates a DCM run configuration object from the specified global configuration specification.

Parameters
nameSpecThe named configuration of interest.
dcmNameThe name of the DCM of interest.

Definition at line 62 of file DCMRunConfig.cpp.

References _fetchAllData(), _hasValidData, _primarySubsystemConfigId, dbutils::daqconfig::IDSpec::DAQ, DCMRunConfig(), and dbutils::daqconfig::IDSpec::SUBSYSTEM.

64 {
65  _hasValidData = false;
67  int64_t subsystemConfigId;
68  if (NamedConfigUtils::
69  getSubsystemConfigIdFromGlobalName(nameSpec,
70  SubsystemNameSpec::
71  DCM_SUBSYSTEM_NAME,
72  SubsystemNameSpec::
73  RUN_CONFIG_TYPE,
74  subsystemConfigId)) {
75  std::vector<int64_t> subsystemConfigIdList;
76  IDSpec idSpec(subsystemConfigId, IDSpec::SUBSYSTEM, IDSpec::DAQ);
77  if (NamedConfigUtils::
78  getConfigIdAncestry(idSpec, subsystemConfigIdList)) {
79  _primarySubsystemConfigId = subsystemConfigIdList[0];
80  _hasValidData = _fetchAllData(subsystemConfigIdList, dcmName);
81  }
82  }
83 }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
dbutils::daqconfig::DCMRunConfig::DCMRunConfig ( const int64_t &  globalConfigId,
const std::string dcmName 
)

Creates a DCM run configuration object from the specified global configuration ID.

Parameters
globalConfigIdThe ID of the global configuration of interest.
dcmNameThe name of the DCM of interest.

Definition at line 93 of file DCMRunConfig.cpp.

References _fetchAllData(), _hasValidData, _primarySubsystemConfigId, dbutils::daqconfig::IDSpec::DAQ, and dbutils::daqconfig::IDSpec::GLOBAL.

95 {
96  IDSpec idSpec(globalConfigId, IDSpec::GLOBAL, IDSpec::DAQ);
98  std::vector<int64_t> subsystemConfigIdList;
99  if (NamedConfigUtils::
100  getSubsystemConfigIdAncestryFromGlobalId(idSpec,
101  SubsystemNameSpec::
102  DCM_SUBSYSTEM_NAME,
103  SubsystemNameSpec::
104  RUN_CONFIG_TYPE,
105  subsystemConfigIdList)) {
106  _primarySubsystemConfigId = subsystemConfigIdList[0];
107  _hasValidData = _fetchAllData(subsystemConfigIdList, dcmName);
108  }
109  else {
110  _hasValidData = false;
111  }
112 }
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
virtual dbutils::daqconfig::DCMRunConfig::~DCMRunConfig ( )
inlinevirtual

Definition at line 42 of file DCMRunConfig.h.

42 {};

Member Function Documentation

bool dbutils::daqconfig::DCMRunConfig::_fetchAllData ( const std::vector< int64_t > &  subsystemConfigIdList,
const std::string dcmName 
)
protected

Definition at line 115 of file DCMRunConfig.cpp.

References _fetchDCMApplicationParams(), _fetchDCMDataDevValues(), _fetchDCMSystemParams(), and fabricate::status.

Referenced by DCMRunConfig(), and getMilliSliceTimeLength().

117 {
118  bool status = true;
119 
120  // system-wide data
121  if (status) {
122  status = _fetchDCMSystemParams(subsystemConfigIdList);
123  }
124 
125  // dcm-specific data
126  if (status) {
127  status = _fetchDCMDataDevValues(subsystemConfigIdList, dcmName);
128  }
129  if (status) {
130  status = _fetchDCMApplicationParams(subsystemConfigIdList, dcmName);
131  }
132 
133  return status;
134 }
int status
Definition: fabricate.py:1613
bool _fetchDCMApplicationParams(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchDCMSystemParams(const std::vector< int64_t > &subsystemConfigIdList)
bool _fetchDCMDataDevValues(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool dbutils::daqconfig::DCMRunConfig::_fetchDCMApplicationParams ( const std::vector< int64_t > &  subsystemConfigIdList,
const std::string dcmName 
)
protected

Definition at line 181 of file DCMRunConfig.cpp.

References _corruptMessageLimit, _corruptMessageResetCount, _maxAllowedDelayInMilliSec, _milliSliceCalculateCheckSum, _milliSliceMode, _monitorCtrlRegGeneralStatus, _monitorFEBStatusLimit, _monitorFEBStatusTimeInterval, _monitorMetricSendTimeInterval, dbutils::daqconfig::ConfigDataSelector::addSelectionColumn(), dbutils::daqconfig::DBColumnParams::DCMID_COLUMN_NAME, and dbutils::daqconfig::ConfigDataTree::getEffectiveValueFor1Key().

Referenced by _fetchAllData(), _fetchDCMDataDevValues(), and getMilliSliceTimeLength().

183 {
184  ConfigDataSelector cfgSelector;
185  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
186  dcmName, dcmName);
187 
188  std::vector<std::string> dataColumnsOfInterest;
189  dataColumnsOfInterest.push_back("milliSliceMode");
190  dataColumnsOfInterest.push_back("milliSliceCalculateCheckSum");
191  dataColumnsOfInterest.push_back("corruptMessageLimit");
192  dataColumnsOfInterest.push_back("corruptMessageResetCount");
193  dataColumnsOfInterest.push_back("monitorMetricSendTimeInterval");
194  dataColumnsOfInterest.push_back("monitorCtrlRegGeneralStatus");
195  dataColumnsOfInterest.push_back("maxAllowedDelayInMilliSec");
196  dataColumnsOfInterest.push_back("monitorFEBStatusTimeInterval");
197  dataColumnsOfInterest.push_back("monitorFEBStatusLimit");
198 
199  ConfigDataTree
200  dcmParamDataSet("NovaDatabase/tables/DAQConfig/DCMApplicationRunParameters.xml",
201  subsystemConfigIdList, cfgSelector,
202  dataColumnsOfInterest);
203 
204  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
205  "milliSliceMode",
206  _milliSliceMode)) {
207  return false;
208  }
209  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
210  "milliSliceCalculateCheckSum",
212  return false;
213  }
214  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
215  "corruptMessageLimit",
217  return false;
218  }
219  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
220  "corruptMessageResetCount",
222  return false;
223  }
224  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
225  "monitorMetricSendTimeInterval",
227  return false;
228  }
229  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
230  "monitorCtrlRegGeneralStatus",
232  return false;
233  }
234  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
235  "maxAllowedDelayInMilliSec",
237  return false;
238  }
239  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
240  "monitorFEBStatusTimeInterval",
242  return false;
243  }
244  if (! dcmParamDataSet.getEffectiveValueFor1Key(dcmName,
245  "monitorFEBStatusLimit",
247  return false;
248  }
249  return true;
250 }
static const std::string DCMID_COLUMN_NAME
bool dbutils::daqconfig::DCMRunConfig::_fetchDCMDataDevValues ( const std::vector< int64_t > &  subsystemConfigIdList,
const std::string dcmName 
)
protected

Definition at line 157 of file DCMRunConfig.cpp.

References _fetchDCMApplicationParams(), _numberOfReadAttempts, dbutils::daqconfig::ConfigDataSelector::addSelectionColumn(), dbutils::daqconfig::DBColumnParams::DCMID_COLUMN_NAME, and dbutils::daqconfig::ConfigDataTree::getEffectiveValueFor1Key().

Referenced by _fetchAllData(), _fetchDCMSystemParams(), and getMilliSliceTimeLength().

159 {
160  ConfigDataSelector cfgSelector;
161  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
162  dcmName, dcmName);
163 
164  std::vector<std::string> dataColumnsOfInterest;
165  dataColumnsOfInterest.push_back("numberOfReadAttempts");
166 
167  ConfigDataTree
168  dcmDataDevDataSet("NovaDatabase/tables/DAQConfig/DCMDataDevRunParameters.xml",
169  subsystemConfigIdList, cfgSelector,
170  dataColumnsOfInterest);
171 
172  if (! dcmDataDevDataSet.getEffectiveValueFor1Key(dcmName,
173  "numberOfReadAttempts",
175  return false;
176  }
177  return true;
178 }
static const std::string DCMID_COLUMN_NAME
bool dbutils::daqconfig::DCMRunConfig::_fetchDCMSystemParams ( const std::vector< int64_t > &  subsystemConfigIdList)
protected

Definition at line 137 of file DCMRunConfig.cpp.

References _fetchDCMDataDevValues(), _millisliceTimeLength, and dbutils::daqconfig::ConfigDataTree::getTrueValue().

Referenced by _fetchAllData(), and getMilliSliceTimeLength().

138 {
139  ConfigDataSelector cfgSelector;
140 
141  std::vector<std::string> dataColumnsOfInterest;
142  dataColumnsOfInterest.push_back("milliSliceDT");
143 
144  ConfigDataTree
145  dcmSystemParamDataSet("NovaDatabase/tables/DAQConfig/DCMSystemRunParameters.xml",
146  subsystemConfigIdList, cfgSelector,
147  dataColumnsOfInterest);
148 
149  if (! dcmSystemParamDataSet.getTrueValue("milliSliceDT",
151  return false;
152  }
153  return true;
154 }
int32_t dbutils::daqconfig::DCMRunConfig::getMilliSliceTimeLength ( ) const
inline
int64_t dbutils::daqconfig::DCMRunConfig::getPrimarySubsystemConfigId ( ) const
inline

Definition at line 49 of file DCMRunConfig.h.

References _primarySubsystemConfigId.

virtual bool dbutils::daqconfig::DCMRunConfig::hasValidData ( ) const
inlinevirtual

Definition at line 48 of file DCMRunConfig.h.

References _hasValidData.

Member Data Documentation

int32_t dbutils::daqconfig::DCMRunConfig::_corruptMessageLimit
protected

Definition at line 73 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_corruptMessageResetCount
protected

Definition at line 74 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

bool dbutils::daqconfig::DCMRunConfig::_hasValidData
protected

Definition at line 64 of file DCMRunConfig.h.

Referenced by DCMRunConfig(), and hasValidData().

int32_t dbutils::daqconfig::DCMRunConfig::_maxAllowedDelayInMilliSec
protected

Definition at line 78 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_milliSliceCalculateCheckSum
protected

Definition at line 72 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

std::string dbutils::daqconfig::DCMRunConfig::_milliSliceMode
protected

Definition at line 71 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_millisliceTimeLength
protected

Definition at line 68 of file DCMRunConfig.h.

Referenced by _fetchDCMSystemParams(), and getMilliSliceTimeLength().

int32_t dbutils::daqconfig::DCMRunConfig::_monitorCtrlRegGeneralStatus
protected

Definition at line 76 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_monitorFEBStatusLimit
protected

Definition at line 80 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_monitorFEBStatusTimeInterval
protected

Definition at line 79 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_monitorMetricSendTimeInterval
protected

Definition at line 75 of file DCMRunConfig.h.

Referenced by _fetchDCMApplicationParams().

int32_t dbutils::daqconfig::DCMRunConfig::_numberOfReadAttempts
protected

Definition at line 77 of file DCMRunConfig.h.

Referenced by _fetchDCMDataDevValues().

int64_t dbutils::daqconfig::DCMRunConfig::_primarySubsystemConfigId
protected

Definition at line 65 of file DCMRunConfig.h.

Referenced by DCMRunConfig(), and getPrimarySubsystemConfigId().


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