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

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

Public Member Functions

 PixelThresholds (const int64_t &globalConfigId, std::vector< std::string > dcmList)
 
virtual ~PixelThresholds ()
 
bool hasValidData () const
 
bool getThreshold (const std::string &dcmName, const int &febId, const int &pixelId, int16_t &threshold)
 
bool getThresholdsForFEB (const std::string &dcmName, const int &febId, std::vector< int16_t > &thresholdList)
 

Protected Attributes

bool _hasValidData
 
boost::shared_ptr< ConfigDataTree_pixelThresholdDataSet
 

Detailed Description

Worker class to handle fetching and formatting of pixel threshold data.

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

Definition at line 21 of file PixelThresholds.h.

Constructor & Destructor Documentation

dbutils::daqconfig::PixelThresholds::PixelThresholds ( const int64_t &  globalConfigId,
std::vector< std::string dcmList 
)

Definition at line 11 of file PixelThresholds.cpp.

References _hasValidData, _pixelThresholdDataSet, dbutils::daqconfig::ConfigDataSelector::addSelectionColumn(), dbutils::daqconfig::IDSpec::DAQ, dbutils::daqconfig::DBColumnParams::DCMID_COLUMN_NAME, dbutils::daqconfig::DBColumnParams::FEBID_COLUMN_NAME, plot_validation_datamc::fname, dbutils::daqconfig::NamedConfigUtils::getSubsystemConfigIdAncestryFromGlobalId(), getThreshold(), dbutils::daqconfig::IDSpec::GLOBAL, dbutils::daqconfig::DBColumnParams::PIXELID_COLUMN_NAME, fabricate::status, and string.

13 {
14  IDSpec idSpec(globalConfigId, IDSpec::GLOBAL, IDSpec::DAQ);
15  std::vector<int64_t> subsystemConfigIdList;
18  SubsystemNameSpec::
19  DCM_SUBSYSTEM_NAME,
20  SubsystemNameSpec::
21  HARDWARE_CONFIG_TYPE,
22  subsystemConfigIdList);
23  if (! status) {return;}
24  std::sort(dcmList.begin(), dcmList.end());
25 
26  {
27  ConfigDataSelector cfgSelector;
28  cfgSelector.addSelectionColumn(DBColumnParams::DCMID_COLUMN_NAME,
29  dcmList[0], dcmList[dcmList.size()-1]);
30  cfgSelector.addSelectionColumn(DBColumnParams::FEBID_COLUMN_NAME);
31  cfgSelector.addSelectionColumn(DBColumnParams::PIXELID_COLUMN_NAME);
32 
33  std::vector<std::string> dataColumnsOfInterest;
34  dataColumnsOfInterest.push_back("threshold");
35 
36  std::string fname("NovaDatabase/tables/DAQConfig/PixelThresholds.xml");
38  reset(new ConfigDataTree(fname, subsystemConfigIdList, cfgSelector,
39  dataColumnsOfInterest));
40  }
41 
43  _pixelThresholdDataSet->hasValidData();
44 }
int status
Definition: fabricate.py:1613
static const std::string PIXELID_COLUMN_NAME
static const std::string DCMID_COLUMN_NAME
static const std::string FEBID_COLUMN_NAME
static bool getSubsystemConfigIdAncestryFromGlobalId(const IDSpec &globalConfigId, const std::string &subsystemName, const std::string &subsystemConfigType, std::vector< int64_t > &idList, const std::string &globalNamesTableFile=DEFAULT_GLOBAL_NAMES_TABLE_FILE, const std::string &subsystemNamesTableFile=DEFAULT_SUBSYSTEM_NAMES_TABLE_FILE)
boost::shared_ptr< ConfigDataTree > _pixelThresholdDataSet
enum BeamMode string
virtual dbutils::daqconfig::PixelThresholds::~PixelThresholds ( )
inlinevirtual

Definition at line 32 of file PixelThresholds.h.

32 {};

Member Function Documentation

bool dbutils::daqconfig::PixelThresholds::getThreshold ( const std::string dcmName,
const int febId,
const int pixelId,
int16_t &  threshold 
)

Definition at line 47 of file PixelThresholds.cpp.

References _pixelThresholdDataSet, and getThresholdsForFEB().

Referenced by hasValidData(), and PixelThresholds().

49 {
50  if (_pixelThresholdDataSet.get() == 0) {return false;}
51  return _pixelThresholdDataSet->
52  getEffectiveValueFor3Keys(dcmName, febId, pixelId,
53  "threshold", threshold);
54 }
boost::shared_ptr< ConfigDataTree > _pixelThresholdDataSet
bool dbutils::daqconfig::PixelThresholds::getThresholdsForFEB ( const std::string dcmName,
const int febId,
std::vector< int16_t > &  thresholdList 
)

Definition at line 57 of file PixelThresholds.cpp.

References _pixelThresholdDataSet, and dump_to_simple_cpp::threshold.

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

59 {
60  if (_pixelThresholdDataSet.get() == 0) {return false;}
61 
62  thresholdList.clear();
63  for (int ipix = 0; ipix < 32; ++ipix) {
64  int16_t threshold = 0;
66  getEffectiveValueFor3Keys(dcmName, febId, ipix,
67  "threshold", threshold)) {
68  return false;
69  }
70  thresholdList.push_back(threshold);
71  }
72 
73  return true;
74 }
boost::shared_ptr< ConfigDataTree > _pixelThresholdDataSet
bool dbutils::daqconfig::PixelThresholds::hasValidData ( ) const
inline

Member Data Documentation

bool dbutils::daqconfig::PixelThresholds::_hasValidData
protected

Definition at line 48 of file PixelThresholds.h.

Referenced by hasValidData(), and PixelThresholds().

boost::shared_ptr<ConfigDataTree> dbutils::daqconfig::PixelThresholds::_pixelThresholdDataSet
protected

Definition at line 49 of file PixelThresholds.h.

Referenced by getThreshold(), getThresholdsForFEB(), and PixelThresholds().


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