DCMHardwareConfig.h
Go to the documentation of this file.
1 #ifndef _DBUTILS_DAQCONFIG_DCMHWCONFIG_H
2 #define _DBUTILS_DAQCONFIG_DCMHWCONFIG_H
3 
4 #include <DatabaseUtils/DAQConfig/ASICRegisterValueSet.h>
5 #include <DatabaseUtils/DAQConfig/FEBPulserParameterSet.h>
6 #include <DatabaseUtils/DAQConfig/GlobalNameSpec.h>
7 #include <DatabaseUtils/DAQConfig/SubsystemNameSpec.h>
8 #include <boost/shared_ptr.hpp>
9 #include <boost/thread/mutex.hpp>
10 #include <iostream>
11 #include <string>
12 #include <vector>
13 
14 namespace dbutils {
15 namespace daqconfig {
16 
17 /**
18  * Worker class to handle fetching and formatting of DCM
19  * hardware configuration data.
20  *
21  * @author Kurt Biery
22  * @version $Revision: 1.21.14.1 $ $Date: 2019/09/27 00:07:03 $
23  */
24 
26 
27  public:
28 
29  // ********************
30  // *** Constructors ***
31  // ********************
32 
33  DCMHardwareConfig(const std::vector<int64_t>& subsystemConfigIdList,
34  const std::string& dcmName,
35  bool loadDataImmediately = true);
36 
37  DCMHardwareConfig(const SubsystemNameSpec& nameSpec,
38  const std::string& dcmName,
39  bool loadDataImmediately = true);
40 
41  DCMHardwareConfig(const GlobalNameSpec& nameSpec,
42  const std::string& dcmName,
43  bool loadDataImmediately = true);
44 
45  DCMHardwareConfig(const int64_t& globalConfigId,
46  const std::string& dcmName,
47  bool loadDataImmediately = true);
48 
49  virtual ~DCMHardwareConfig() {};
50 
51  // *******************
52  // *** Initializer ***
53  // *******************
54 
55  void loadData();
56 
57  // *****************
58  // *** Accessors ***
59  // *****************
60 
61  virtual bool hasValidData() const {
62  boost::mutex::scoped_lock sl(_dataMutex);
63  return _hasValidData;
64  }
65  int64_t getPrimarySubsystemConfigId() const {
66  boost::mutex::scoped_lock sl(_dataMutex);
68  }
69 
71 
72  protected:
73 
74  bool _fetchNamedConfigList(const SubsystemNameSpec& nameSpec,
75  std::vector<int64_t>& idList);
76 
77  bool _fetchNamedConfigList(const GlobalNameSpec& nameSpec,
78  std::vector<int64_t>& idList);
79 
80  bool _fetchAllData(const std::vector<int64_t>& subsystemConfigIdList,
81  const std::string& dcmName);
82 
83  bool _fetchDCMSystemParams(const std::vector<int64_t>& subsystemConfigIdList);
84 
85  bool _fetchDCMFirmwareLocations(const std::vector<int64_t>& subsystemConfigIdList,
86  const std::string& dcmName);
87  bool _fetchFEBFirmwareLocations(const std::vector<int64_t>& subsystemConfigIdList,
88  const std::string& dcmName);
89  bool _fetchFEBEnableMasks(const std::vector<int64_t>& subsystemConfigIdList,
90  const std::string& dcmName);
91  bool _fetchDCMDataDevValues(const std::vector<int64_t>& subsystemConfigIdList,
92  const std::string& dcmName);
93  bool _fetchTimingSystemValues(const std::vector<int64_t>& subsystemConfigIdList,
94  const std::string& dcmName);
95  bool _fetchDCMFPGAParams(const std::vector<int64_t>& subsystemConfigIdList,
96  const std::string& dcmName);
97  bool _fetchDCMApplicationParams(const std::vector<int64_t>& subsystemConfigIdList,
98  const std::string& dcmName);
99 
100  bool _fetchPixelEnableMasks(const std::vector<int64_t>& subsystemConfigIdList,
101  const std::string& dcmName);
102  bool _fetchASICRegisterValues(const std::vector<int64_t>& subsystemConfigIdList,
103  const std::string& dcmName);
104  bool _fetchDSODataRegulatorValues(const std::vector<int64_t>& subsystemConfigIdList,
105  const std::string& dcmName);
106  bool _fetchFEBPulserValues(const std::vector<int64_t>& subsystemConfigIdList,
107  const std::string& dcmName);
108 
109  bool _fetchPixelOffsets(const std::vector<int64_t>& subsystemConfigIdList,
110  const std::string& dcmName);
111  bool _fetchPixelThresholds(const std::vector<int64_t>& subsystemConfigIdList,
112  const std::string& dcmName);
113 
115  std::vector<int64_t> _subsystemConfigIdList;
118 
120 
121  // system-wide parameters
124 
125  // dcm-specific parameters
130  int64_t _febEnableMask;
141 
142  // feb-specific parameters
143  std::vector<int32_t> _pixelEnableList;
144  std::vector<dbutils::daqconfig::ASICRegisterValueSet> _asicRegisterValueList;
145  std::vector<int16_t> _dsoPointsPerPixelList;
146  std::vector<dbutils::daqconfig::FEBPulserParameterSet> _pulserParameterList;
147 
148  // pixel-specific parameters
149  std::vector<boost::shared_ptr<std::vector<int16_t> > > _pixelOffsetArray;
150  std::vector<boost::shared_ptr<std::vector<int16_t> > > _pixelThresholdArray;
151 
152 };
153 
154 } // end of namespace daqconfig
155 } // end of namespace dbutil
156 
157 #endif
bool _fetchPixelOffsets(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
DCMHardwareConfig(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName, bool loadDataImmediately=true)
bool _fetchDCMFPGAParams(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchDCMFirmwareLocations(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchNamedConfigList(const SubsystemNameSpec &nameSpec, std::vector< int64_t > &idList)
bool _fetchDSODataRegulatorValues(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
std::vector< boost::shared_ptr< std::vector< int16_t > > > _pixelOffsetArray
bool _fetchPixelEnableMasks(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
std::vector< dbutils::daqconfig::FEBPulserParameterSet > _pulserParameterList
bool _fetchAllData(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
std::vector< int16_t > _dsoPointsPerPixelList
bool _fetchFEBEnableMasks(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchFEBPulserValues(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchPixelThresholds(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
std::vector< boost::shared_ptr< std::vector< int16_t > > > _pixelThresholdArray
std::vector< int64_t > _subsystemConfigIdList
bool _fetchASICRegisterValues(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchDCMApplicationParams(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
std::vector< dbutils::daqconfig::ASICRegisterValueSet > _asicRegisterValueList
bool _fetchDCMDataDevValues(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchTimingSystemValues(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchFEBFirmwareLocations(const std::vector< int64_t > &subsystemConfigIdList, const std::string &dcmName)
bool _fetchDCMSystemParams(const std::vector< int64_t > &subsystemConfigIdList)
enum BeamMode string